|
@@ -12,7 +12,7 @@ import {
|
|
|
IconTextUnderline,
|
|
|
} from "@/assets/icons";
|
|
|
import { css } from "@linaria/core";
|
|
|
-import { Button, InputNumber, Tooltip } from "ant-design-vue";
|
|
|
+import { Button, InputNumber, Tooltip, Checkbox } from "ant-design-vue";
|
|
|
|
|
|
import { useEditor } from "@/modules/editor";
|
|
|
import Select from "@queenjs-modules/queditor/components/FormUI/Items/Select";
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
watch,
|
|
|
} from "vue";
|
|
|
import { any, bool, func, number, object, string } from "vue-types";
|
|
|
+import Slider from "../../formItems/Slider";
|
|
|
interface ColumnItem {
|
|
|
label?: string;
|
|
|
component?: ((...args: any[]) => any) | Record<string, any>;
|
|
@@ -313,6 +314,88 @@ export const FontSize = defineComponent({
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
+
|
|
|
+export const TextStroke = defineComponent({
|
|
|
+ props: {
|
|
|
+ value: any().def(undefined),
|
|
|
+ },
|
|
|
+ emits: ["change"],
|
|
|
+ setup(props, { emit }) {
|
|
|
+ const state = reactive({
|
|
|
+ visible: props.value ? true : false,
|
|
|
+ width: 1,
|
|
|
+ color: "#666666",
|
|
|
+ });
|
|
|
+ watch(
|
|
|
+ () => props.value,
|
|
|
+ () => {
|
|
|
+ formatVal(props.value);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ const formatVal = (value: any) => {
|
|
|
+ debugger;
|
|
|
+ if (!value) {
|
|
|
+ state.visible = false;
|
|
|
+ state.color = "#666666";
|
|
|
+ state.width = 1;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ state.visible = true;
|
|
|
+ const colorReg = /#[a-zA-Z0-9]{6}/g;
|
|
|
+ const color = value.match(colorReg)[0];
|
|
|
+ state.color = color;
|
|
|
+ const widthReg = /\d+px/g;
|
|
|
+ const width = value.match(widthReg)[0];
|
|
|
+ state.width = parseInt(width);
|
|
|
+ };
|
|
|
+ const colorChange = (v: string) => {
|
|
|
+ state.color = v;
|
|
|
+ buildValueSub();
|
|
|
+ };
|
|
|
+ const visibleChange = (e: any) => {
|
|
|
+ const checked = e.target.checked;
|
|
|
+ state.visible = checked;
|
|
|
+ buildValueSub();
|
|
|
+ };
|
|
|
+ const widthChange = (e: number) => {
|
|
|
+ state.width = e;
|
|
|
+ buildValueSub();
|
|
|
+ };
|
|
|
+ const buildValueSub = () => {
|
|
|
+ if (!state.visible) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const value = `${state.width}px ${state.color}`;
|
|
|
+ emit("change", value);
|
|
|
+ };
|
|
|
+
|
|
|
+ return () => {
|
|
|
+ return (
|
|
|
+ <div class={"flex-1"}>
|
|
|
+ <div class={"flex justify-between items-center w-full"}>
|
|
|
+ <div class={"flex-1 flex items-center"}>
|
|
|
+ <Checkbox checked={state.visible} onChange={visibleChange} />
|
|
|
+
|
|
|
+ {state.visible && (
|
|
|
+ <div class={"flex-1 px-20px"}>
|
|
|
+ <Slider
|
|
|
+ min={1}
|
|
|
+ max={5}
|
|
|
+ value={state.width}
|
|
|
+ step={1}
|
|
|
+ onChange={widthChange}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ <TextColor value={state.color} onChange={colorChange} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
export const LinkButton = defineComponent({
|
|
|
props: {
|
|
|
icon: any(),
|
|
@@ -470,6 +553,7 @@ const ColorPicker = css`
|
|
|
|
|
|
const AlignCompWapper = css`
|
|
|
display: flex;
|
|
|
+ background-color: #303030;
|
|
|
.ant-btn {
|
|
|
flex: 1;
|
|
|
width: 100%;
|
|
@@ -485,6 +569,7 @@ const FontStyleCompWapper = css`
|
|
|
align-items: center;
|
|
|
margin-right: 12px;
|
|
|
border-radius: 2px;
|
|
|
+ background-color: #303030;
|
|
|
& > div {
|
|
|
flex: 1;
|
|
|
border-radius: 0;
|
|
@@ -502,7 +587,11 @@ const formItemStyles = css`
|
|
|
height: 100%;
|
|
|
flex: 1;
|
|
|
margin-right: 12px;
|
|
|
- background-color: #303030;
|
|
|
+ .ant-input-number-affix-wrapper,
|
|
|
+ .ant-select {
|
|
|
+ background-color: #303030;
|
|
|
+ }
|
|
|
+
|
|
|
border-radius: 2px;
|
|
|
&:last-child {
|
|
|
margin-right: 0;
|