@vipl520/dk-ui 1.0.47 → 1.0.49
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.css +1 -1
- package/dist/index.js +85 -47
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +4 -4
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +85 -47
- package/dist/web-types.json +1 -1
- package/es/style-box-input/index.d.ts +5 -5
- package/es/style-box-input/src/props.d.ts +2 -2
- package/es/style-box-input/src/props.mjs +2 -2
- package/es/style-box-input/src/props.mjs.map +1 -1
- package/es/style-box-input/src/style-box-input.vue.d.ts +5 -5
- package/es/style-box-input/src/style-box-input.vue2.mjs +68 -42
- package/es/style-box-input/src/style-box-input.vue2.mjs.map +1 -1
- package/es/style-box-input/style/index.css +1 -1
- package/es/style-box-input/style/index.scss +7 -3
- package/es/style-input/index.d.ts +9 -0
- package/es/style-input/src/props.d.ts +8 -1
- package/es/style-input/src/props.mjs +10 -1
- package/es/style-input/src/props.mjs.map +1 -1
- package/es/style-input/src/style-input.vue.d.ts +9 -0
- package/es/style-input/src/style-input.vue2.mjs +7 -3
- package/es/style-input/src/style-input.vue2.mjs.map +1 -1
- package/lib/style-box-input/index.d.ts +5 -5
- package/lib/style-box-input/src/props.d.ts +2 -2
- package/lib/style-box-input/src/props.js +2 -2
- package/lib/style-box-input/src/props.js.map +1 -1
- package/lib/style-box-input/src/style-box-input.vue.d.ts +5 -5
- package/lib/style-box-input/src/style-box-input.vue2.js +67 -41
- package/lib/style-box-input/src/style-box-input.vue2.js.map +1 -1
- package/lib/style-box-input/style/index.css +1 -1
- package/lib/style-box-input/style/index.scss +7 -3
- package/lib/style-input/index.d.ts +9 -0
- package/lib/style-input/src/props.d.ts +8 -1
- package/lib/style-input/src/props.js +10 -1
- package/lib/style-input/src/props.js.map +1 -1
- package/lib/style-input/src/style-input.vue.d.ts +9 -0
- package/lib/style-input/src/style-input.vue2.js +7 -3
- package/lib/style-input/src/style-input.vue2.js.map +1 -1
- package/package.json +1 -1
@@ -6,6 +6,7 @@ var vue = require('vue');
|
|
6
6
|
var props = require('./props.js');
|
7
7
|
var html = require('./html.js');
|
8
8
|
var utils = require('@vipl520/utils');
|
9
|
+
var core = require('@vueuse/core');
|
9
10
|
|
10
11
|
const _hoisted_1 = { class: "dk-style-box-input" };
|
11
12
|
const _hoisted_2 = { class: "header" };
|
@@ -14,7 +15,7 @@ const _hoisted_4 = { class: "float-right cursor-pointer" };
|
|
14
15
|
const _hoisted_5 = { class: "name-header-operations" };
|
15
16
|
const _hoisted_6 = { class: "name-header-operations" };
|
16
17
|
const _hoisted_7 = { class: "name-header-operations" };
|
17
|
-
const _hoisted_8 = ["title", "
|
18
|
+
const _hoisted_8 = ["title", "onClick"];
|
18
19
|
const _hoisted_9 = ["onUpdate:modelValue", "onBlur"];
|
19
20
|
const _hoisted_10 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
|
20
21
|
const _hoisted_11 = /* @__PURE__ */ vue.createElementVNode(
|
@@ -34,7 +35,7 @@ const _hoisted_14 = /* @__PURE__ */ vue.createElementVNode(
|
|
34
35
|
/* HOISTED */
|
35
36
|
);
|
36
37
|
const _hoisted_15 = { class: "thumnail border" };
|
37
|
-
const _hoisted_16 = ["title", "
|
38
|
+
const _hoisted_16 = ["title", "onClick"];
|
38
39
|
const _hoisted_17 = ["onUpdate:modelValue", "onBlur"];
|
39
40
|
const _hoisted_18 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
|
40
41
|
const _hoisted_19 = { class: "anchor-wrapper" };
|
@@ -83,13 +84,17 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
83
84
|
width: props.modelValue.width || "",
|
84
85
|
height: props.modelValue.height || ""
|
85
86
|
});
|
86
|
-
const
|
87
|
-
|
88
|
-
|
89
|
-
()
|
90
|
-
|
87
|
+
const box = vue.ref(null);
|
88
|
+
const { width } = core.useElementSize(box);
|
89
|
+
const height = vue.computed(() => {
|
90
|
+
console.log("props.height", props.height);
|
91
|
+
if (props.height === "auto") {
|
92
|
+
const h = width.value / 1.8;
|
93
|
+
return h > 300 ? 300 : h;
|
94
|
+
} else {
|
95
|
+
return props.height;
|
91
96
|
}
|
92
|
-
);
|
97
|
+
});
|
93
98
|
vue.watch(
|
94
99
|
() => props.modelValue,
|
95
100
|
(newVal, oldVal) => {
|
@@ -182,17 +187,16 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
182
187
|
stopChangeBound.value = handleMouseUp.bind(event);
|
183
188
|
document.addEventListener("mouseup", stopChangeBound.value);
|
184
189
|
dragging.value = true;
|
185
|
-
const height2 = props.height;
|
186
190
|
const wrapperElement = document.querySelector(".wrapper");
|
187
|
-
const
|
191
|
+
const width2 = wrapperElement ? wrapperElement.offsetWidth : 0;
|
188
192
|
const multiples = {
|
189
193
|
margin: 0.9,
|
190
194
|
padding: 0.9 * 0.7
|
191
195
|
};
|
192
196
|
const { clientX, clientY } = event;
|
193
|
-
const setCursorAndDimensions = (cursor, left, top,
|
197
|
+
const setCursorAndDimensions = (cursor, left, top, width3, height2) => {
|
194
198
|
document.body.style.cursor = cursor;
|
195
|
-
Object.assign(positionStyle, { left, top, width:
|
199
|
+
Object.assign(positionStyle, { left, top, width: width3, height: height2, display: "block" });
|
196
200
|
};
|
197
201
|
startPosition.x = clientX;
|
198
202
|
startPosition.y = clientY;
|
@@ -200,16 +204,16 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
200
204
|
setCursorAndDimensions(
|
201
205
|
"ew-resize",
|
202
206
|
clientX + "px",
|
203
|
-
clientY -
|
207
|
+
clientY - height.value * 0.5 * multiples[type] + "px",
|
204
208
|
"0.1px",
|
205
|
-
|
209
|
+
height.value * multiples[type] + "px"
|
206
210
|
);
|
207
211
|
} else {
|
208
212
|
setCursorAndDimensions(
|
209
213
|
"ns-resize",
|
210
|
-
clientX -
|
214
|
+
clientX - width2 * 0.5 * multiples[type] + "px",
|
211
215
|
clientY + "px",
|
212
|
-
|
216
|
+
width2 * multiples[type] + "px",
|
213
217
|
"0.1px"
|
214
218
|
);
|
215
219
|
}
|
@@ -388,9 +392,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
388
392
|
vue.createElementVNode(
|
389
393
|
"div",
|
390
394
|
{
|
395
|
+
ref_key: "box",
|
396
|
+
ref: box,
|
391
397
|
tabindex: "0",
|
392
398
|
class: "wrapper",
|
393
|
-
style: vue.normalizeStyle([{ "margin-top": "10px" }, { height:
|
399
|
+
style: vue.normalizeStyle([{ "margin-top": "10px" }, { height: height.value + "px" }])
|
394
400
|
},
|
395
401
|
[
|
396
402
|
vue.createElementVNode(
|
@@ -411,8 +417,16 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
411
417
|
vue.createElementVNode("span", {
|
412
418
|
title: item.title,
|
413
419
|
class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`),
|
414
|
-
|
415
|
-
},
|
420
|
+
onClick: ($event) => onDblclick(item.value, key)
|
421
|
+
}, [
|
422
|
+
vue.createElementVNode(
|
423
|
+
"span",
|
424
|
+
null,
|
425
|
+
vue.toDisplayString(getValue(styles[item.value])),
|
426
|
+
1
|
427
|
+
/* TEXT */
|
428
|
+
)
|
429
|
+
], 10, _hoisted_8),
|
416
430
|
vue.withDirectives(vue.createElementVNode("input", {
|
417
431
|
ref_for: true,
|
418
432
|
ref_key: "inputField",
|
@@ -478,8 +492,16 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
478
492
|
vue.createElementVNode("span", {
|
479
493
|
title: item.title,
|
480
494
|
class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`),
|
481
|
-
|
482
|
-
},
|
495
|
+
onClick: ($event) => onDblclick(item.value, key + 4)
|
496
|
+
}, [
|
497
|
+
vue.createElementVNode(
|
498
|
+
"span",
|
499
|
+
null,
|
500
|
+
vue.toDisplayString(getValue(styles[item.value])),
|
501
|
+
1
|
502
|
+
/* TEXT */
|
503
|
+
)
|
504
|
+
], 10, _hoisted_16),
|
483
505
|
vue.withDirectives(vue.createElementVNode("input", {
|
484
506
|
ref_for: true,
|
485
507
|
ref_key: "inputField",
|
@@ -534,16 +556,18 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
534
556
|
},
|
535
557
|
[
|
536
558
|
vue.createElementVNode("span", _hoisted_22, [
|
537
|
-
vue.createElementVNode(
|
538
|
-
"
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
559
|
+
vue.createElementVNode("span", {
|
560
|
+
class: "content-unit left-0",
|
561
|
+
onClick: _cache[3] || (_cache[3] = ($event) => onDblclick("width", 9))
|
562
|
+
}, [
|
563
|
+
vue.createElementVNode(
|
564
|
+
"em",
|
565
|
+
null,
|
566
|
+
vue.toDisplayString(getValue(styles["width"])),
|
567
|
+
1
|
568
|
+
/* TEXT */
|
569
|
+
)
|
570
|
+
]),
|
547
571
|
vue.withDirectives(vue.createElementVNode(
|
548
572
|
"input",
|
549
573
|
{
|
@@ -560,16 +584,18 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
560
584
|
[vue.vModelText, styles.width]
|
561
585
|
]),
|
562
586
|
_hoisted_23,
|
563
|
-
vue.createElementVNode(
|
564
|
-
"
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
587
|
+
vue.createElementVNode("span", {
|
588
|
+
class: "content-unit right-0",
|
589
|
+
onClick: _cache[6] || (_cache[6] = ($event) => onDblclick("height", 9))
|
590
|
+
}, [
|
591
|
+
vue.createElementVNode(
|
592
|
+
"em",
|
593
|
+
null,
|
594
|
+
vue.toDisplayString(getValue(styles["height"])),
|
595
|
+
1
|
596
|
+
/* TEXT */
|
597
|
+
)
|
598
|
+
]),
|
573
599
|
vue.withDirectives(vue.createElementVNode(
|
574
600
|
"input",
|
575
601
|
{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"style-box-input.vue2.js","sources":["../../../src/style-box-input/src/style-box-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleBoxInput',\n});\n</script>\n<template>\n <div class=\"dk-style-box-input\">\n <div class=\"position-line\" :style=\"positionStyle\"></div>\n <div class=\"header\">\n <label class=\"items-center\">\n 内外边距 | 高宽\n <el-popover ref=\"popover\" placement=\"bottom\" title=\"说明\" :width=\"280\" trigger=\"hover\" :content=\"props.help\">\n <template #reference>\n <dk-icon icon=\"QuestionFilled\" class=\"m-l-5px vertical-text-top\"></dk-icon>\n </template>\n </el-popover>\n </label>\n <div class=\"float-right cursor-pointer\">\n <div class=\"name-header-operations\">\n <el-tooltip class=\"box-item\" effect=\"dark\" content=\"重置高宽\" placement=\"top-start\">\n <dk-icon icon=\"Refresh\" color=\"var(--el-color-primary)\" @click=\"onRefresh('widthHeight')\"></dk-icon>\n </el-tooltip>\n </div>\n <div class=\"name-header-operations\">\n <el-tooltip class=\"box-item\" effect=\"dark\" content=\"重置内边距\" placement=\"top-start\">\n <dk-icon icon=\"Refresh\" color=\"var(--el-color-success)\" @click=\"onRefresh('padding')\"></dk-icon>\n </el-tooltip>\n </div>\n <div class=\"name-header-operations\">\n <el-tooltip class=\"box-item\" effect=\"dark\" content=\"重置外边距\" placement=\"top-start\">\n <dk-icon icon=\"Refresh\" color=\"var(--el-color-warning)\" @click=\"onRefresh('margin')\"></dk-icon>\n </el-tooltip>\n </div>\n </div>\n\n <div tabindex=\"0\" class=\"wrapper\" style=\"margin-top: 10px\" :style=\"{ height: props.height + 'px' }\">\n <div\n class=\"thumnail margin\"\n :class=\"moves.margin ? 'thumnail-heightlight' : ''\"\n @mousemove=\"onMouseMove('margin', 'move', $event)\"\n @mouseleave=\"onMouseMove('margin', 'leave', $event)\"\n >\n <!--外边距 Margin-->\n <div>\n <div v-for=\"(item, key) in margins\" :key=\"key\">\n <span\n :title=\"item.title\"\n :class=\"`anchor-tip-${item.position} value-indicator`\"\n @dblclick=\"onDblclick(item.value, key)\"\n >\n {{ getValue(styles[item.value]) }}\n </span>\n <input\n ref=\"inputField\"\n v-model=\"styles[item.value]\"\n :class=\"'input-box anchor-tip-' + item.position + (showStyles[item.value] ? ' show' : '')\"\n @blur=\"onBlur(item.value)\"\n />\n <svg\n :width=\"item.svg.width\"\n :height=\"item.svg.height\"\n :viewBox=\"item.svg.viewBox\"\n preserveAspectRatio=\"none\"\n :data-link-anchor=\"item.value\"\n :style=\"item.svg.style\"\n class=\"esm-modal-svg\"\n v-html=\"item.svg.content\"\n ></svg>\n </div>\n </div>\n <div style=\"position: absolute; display: none; width: 100%; height: 100%\"></div>\n <div class=\"anchor-wrapper\">\n <div\n v-for=\"(item, key) in ['left', 'right', 'top', 'bottom']\"\n :key=\"key\"\n class=\"anchor\"\n :class=\"'anchor-' + item\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown('margin', item, $event)\"\n @mouseup=\"handleMouseUp\"\n ></div>\n </div>\n <span class=\"title\"> 外边距 </span>\n <!--外边距 Margin END-->\n\n <!--内边距 Padding-->\n <div class=\"thumnail border\">\n <div\n class=\"thumnail padding\"\n :class=\"moves.padding ? 'thumnail-heightlight' : ''\"\n @mousemove=\"onMouseMove('padding', 'move', $event)\"\n @mouseleave=\"onMouseMove('padding', 'leave', $event)\"\n >\n <div>\n <div v-for=\"(item, key) in paddings\" :key=\"key\">\n <span\n :title=\"item.title\"\n :class=\"`anchor-tip-${item.position} value-indicator`\"\n @dblclick=\"onDblclick(item.value, key + 4)\"\n >\n {{ getValue(styles[item.value]) }}\n </span>\n <input\n ref=\"inputField\"\n v-model=\"styles[item.value]\"\n :class=\"'input-box anchor-tip-' + item.position + (showStyles[item.value] ? ' show' : '')\"\n @blur=\"onBlur(item.value)\"\n />\n <svg\n :width=\"item.svg.width\"\n :height=\"item.svg.height\"\n :viewBox=\"item.svg.viewBox\"\n preserveAspectRatio=\"none\"\n :data-link-anchor=\"item.value\"\n :style=\"item.svg.style\"\n class=\"esm-modal-svg\"\n v-html=\"item.svg.content\"\n ></svg>\n </div>\n </div>\n <div class=\"anchor-wrapper\">\n <div\n v-for=\"(item, key) in ['left', 'right', 'top', 'bottom']\"\n :key=\"key\"\n class=\"anchor\"\n :class=\"'anchor-' + item\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown('padding', item, $event)\"\n @mouseup=\"handleMouseUp\"\n ></div>\n </div>\n <span class=\"title\"> 内边距 </span>\n <!--内边距 END-->\n <div\n class=\"thumnail width-height\"\n :class=\"moves.widthHeight ? 'thumnail-heightlight' : ''\"\n @mousemove=\"onMouseMove('widthHeight', 'move', $event)\"\n @mouseleave=\"onMouseMove('widthHeight', 'leave', $event)\"\n >\n <span class=\"title\">\n <span class=\"content-unit left-0\" @dblclick=\"onDblclick('width', 9)\">\n {{ getValue(styles['width']) }}\n </span>\n <input\n ref=\"inputWidth\"\n v-model=\"styles.width\"\n class=\"input-box absolute left-5% top-10px\"\n :class=\"showStyles['width'] ? ' show' : ''\"\n @blur=\"onBlur('width')\"\n />\n <span> x </span>\n <span class=\"content-unit right-0\" @dblclick=\"onDblclick('height', 9)\">\n {{ getValue(styles['height']) }}\n </span>\n <input\n ref=\"inputHeight\"\n v-model=\"styles.height\"\n class=\"input-box absolute right-5% top-10px\"\n :class=\"showStyles['height'] ? ' show' : ''\"\n @blur=\"onBlur('height')\"\n />\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleBoxInputProps } from './props'\nimport { nextTick, reactive, ref, watch } from 'vue'\nimport { margins, paddings } from './html'\nimport { upper } from '@vipl520/utils'\n\n\n\nconst props = defineProps(styleBoxInputProps)\n\nconst moves: any = reactive({\n margin: false,\n padding: false,\n widthHeight: false,\n})\n\nconst inputField = ref()\nconst inputWidth = ref()\nconst inputHeight = ref()\n\nconst styles: any = reactive({\n marginLeft: props.modelValue.marginLeft || '',\n marginRight: props.modelValue.marginRight || '',\n marginTop: props.modelValue.marginTop || '',\n marginBottom: props.modelValue.marginBottom || '',\n paddingLeft: props.modelValue.paddingLeft || '',\n paddingRight: props.modelValue.paddingRight || '',\n paddingTop: props.modelValue.paddingTop || '',\n paddingBottom: props.modelValue.paddingBottom || '',\n width: props.modelValue.width || '',\n height: props.modelValue.height || '',\n})\nconst emit = defineEmits(['update:modelValue', 'change'])\n\nconst height = ref(props.height)\n\nwatch(\n () => props.height,\n () => {\n console.log('height', props.height)\n }\n)\n\nwatch(\n () => props.modelValue,\n (newVal, oldVal) => {\n const propertiesToWatch = [\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'marginBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingBottom',\n 'width',\n 'height',\n ]\n propertiesToWatch.forEach((property) => {\n if (newVal[property] !== oldVal[property]) {\n styles[property] = newVal[property] || ''\n }\n })\n },\n { deep: true }\n)\n\nwatch(styles, () => {\n // 过滤 styles 中值为''\n const _styles = Object.keys(styles).reduce((acc: any, key) => {\n if (styles[key] !== '') {\n acc[key] = styles[key]\n }\n return acc\n }, {})\n emit('update:modelValue', _styles)\n emit('change', _styles)\n})\n\nconst showStyles: any = reactive({\n marginLeft: false,\n marginRight: false,\n marginTop: false,\n marginBottom: false,\n paddingLeft: false,\n paddingRight: false,\n paddingTop: false,\n paddingBottom: false,\n width: false,\n height: false,\n})\n\nconst dragging = ref(false)\nconst startPosition: any = reactive({\n x: 0,\n y: 0,\n})\n\nconst trackMouseBound: any = ref(null)\nconst stopChangeBound: any = ref(null)\nconst dragPosition = reactive({\n type: '',\n position: '',\n})\nconst positionStyle: any = reactive({\n display: 'none',\n width: '0px',\n height: '0px',\n left: '0px',\n top: '0px',\n})\n// const handleMouseMove = (event: any) => {\n// // 处理鼠标移动事件\n// if (dragging.value) {\n// const p = dragPosition.position\n// const type = dragPosition.type\n// const value = type + upper(p)\n// if (p === 'left' || p === 'right') {\n// // 说明是左右移动\n// positionStyle.left = event.clientX + 'px'\n// // 根据移动的距离,增加或者减少margin/padding-left/right 的大小\n// let difference = event.clientX - startPosition.x\n// if (p === 'left') {\n// difference = -difference\n// }\n// styles[value] = (parseInt(styles[value]) || 0) + difference + 'px'\n// startPosition.x = event.clientX\n// } else if (p === 'top' || p === 'bottom') {\n// positionStyle.top = event.clientY + 'px'\n// let difference = event.clientY - startPosition.y\n// if (p === 'top') {\n// difference = -difference\n// }\n// styles[value] = (parseInt(styles[value]) || 0) + difference + 'px'\n// startPosition.y = event.clientY\n// }\n// }\n// }\n\nconst handleMouseMove = (event: any) => {\n // 处理鼠标移动事件\n if (!dragging.value) return\n\n const p = dragPosition.position\n const type = dragPosition.type\n const value = type + upper(p)\n\n const updateStyle = (axis: 'x' | 'y', position: 'top' | 'bottom' | 'left' | 'right') => {\n const clientAxis = axis === 'x' ? 'clientX' : 'clientY'\n positionStyle[position] = event[clientAxis] + 'px'\n\n let difference = event[clientAxis] - startPosition[axis]\n if (p === 'top' || p === 'left') {\n difference = -difference\n }\n styles[value] = (parseInt(styles[value]) || 0) + difference + 'px'\n startPosition[axis] = event[clientAxis]\n }\n\n if (p === 'left' || p === 'right') {\n // 说明是左右移动\n updateStyle('x', 'left')\n } else if (p === 'top' || p === 'bottom') {\n updateStyle('y', 'top')\n }\n}\n\n// const handleMouseDown = (type: string, position: string, event: any) => {\n// // 处理鼠标按下事件\n// console.log('handleMouseDown', event)\n// dragPosition.position = position\n// dragPosition.type = type\n// trackMouseBound.value = handleMouseMove.bind(this)\n// document.addEventListener('mousemove', trackMouseBound.value)\n// stopChangeBound.value = handleMouseUp.bind(this)\n// document.addEventListener('mouseup', stopChangeBound.value)\n// dragging.value = true\n// const height = props.height\n// // 宽度 为.wrapper的宽度\n// const wrapperElement: any = document.querySelector('.wrapper')\n// const width = wrapperElement ? wrapperElement.offsetWidth : 0\n// const multiples: any = {\n// margin: 0.9,\n// padding: 0.9 * 0.7,\n// }\n// positionStyle.display = 'block'\n// startPosition.x = event.clientX\n// startPosition.y = event.clientY\n// if (position === 'left' || position === 'right') {\n// document.body.style.cursor = 'ew-resize'\n// positionStyle.left = event.clientX + 'px'\n// positionStyle.top = event.clientY - height * 0.5 * multiples[type] + 'px'\n// positionStyle.width = '0.1px'\n// positionStyle.height = height * multiples[type] + 'px'\n// } else {\n// document.body.style.cursor = 'ns-resize'\n// positionStyle.left = event.clientX - width * 0.5 * multiples[type] + 'px'\n// positionStyle.top = event.clientY + 'px'\n// positionStyle.width = width * multiples[type] + 'px'\n// positionStyle.height = '0.1px'\n// }\n// }\n\nconst handleMouseDown = (type: string, position: string, event: any) => {\n // 处理鼠标按下事件\n Object.assign(dragPosition, { position, type })\n trackMouseBound.value = handleMouseMove.bind(event)\n document.addEventListener('mousemove', trackMouseBound.value)\n stopChangeBound.value = handleMouseUp.bind(event)\n document.addEventListener('mouseup', stopChangeBound.value)\n dragging.value = true\n\n const height = props.height\n const wrapperElement: any = document.querySelector('.wrapper')\n const width = wrapperElement ? wrapperElement.offsetWidth : 0\n const multiples: any = {\n margin: 0.9,\n padding: 0.9 * 0.7,\n }\n\n const { clientX, clientY } = event\n\n const setCursorAndDimensions = (cursor: string, left: string, top: string, width: string, height: string) => {\n document.body.style.cursor = cursor\n Object.assign(positionStyle, { left, top, width, height, display: 'block' })\n }\n\n startPosition.x = clientX\n startPosition.y = clientY\n\n if (position === 'left' || position === 'right') {\n setCursorAndDimensions(\n 'ew-resize',\n clientX + 'px',\n clientY - height * 0.5 * multiples[type] + 'px',\n '0.1px',\n height * multiples[type] + 'px'\n )\n } else {\n setCursorAndDimensions(\n 'ns-resize',\n clientX - width * 0.5 * multiples[type] + 'px',\n clientY + 'px',\n width * multiples[type] + 'px',\n '0.1px'\n )\n }\n}\n\nconst handleMouseUp = () => {\n // 处理鼠标抬起事件\n document.removeEventListener('mousemove', trackMouseBound.value)\n document.removeEventListener('mouseup', stopChangeBound.value)\n dragging.value = false\n positionStyle.display = 'none'\n document.body.style.cursor = 'default'\n startPosition.x = null\n startPosition.y = null\n}\n\nconst onMouseMove = (value: string, type: string = 'move', event: any) => {\n if (!dragging.value) {\n event.stopPropagation()\n }\n if (type !== 'move') {\n moves[value] = false\n } else {\n // 其他的为false\n Object.keys(moves).forEach((key) => {\n if (key !== value) {\n moves[key] = false\n }\n })\n // 当前的为true\n moves[value] = true\n }\n}\n\nconst onDblclick = (value: any, key: number) => {\n showStyles[value] = true\n nextTick(() => {\n if (value === 'width') {\n inputWidth.value.focus()\n } else if (value === 'height') {\n inputHeight.value.focus()\n } else {\n inputField.value[key].focus()\n }\n })\n}\n\nconst getValue = (value: any) => {\n // 判断value结尾是否存在px、vh、%、rem等\n if (value === 'auto') {\n return value\n }\n if (value === '0' || value === 0) {\n return 0\n }\n if (value === '') {\n return '-'\n }\n return value\n}\n\nconst onBlur = (value: any) => {\n showStyles[value] = false\n // styles[value] 这是一个css的值,用户会自己填写,内容不确定,但是我希望是:数字+单位,单位为:px/rem/%/vh这些,如果不是的话,则默认为px\n if (styles[value] === '' || styles[value] === 'auto') {\n return\n }\n const validValueRegex = /^(\\d*\\.?\\d+)(px|rem|%|vh)$/\n // 检查value是否匹配有效单位,如果不匹配则默认为px\n if (!validValueRegex.test(styles[value])) {\n const number = parseInt(styles[value])\n if (isNaN(number)) {\n styles[value] = ''\n } else {\n styles[value] = number + 'px'\n }\n }\n}\n\nconst onRefresh = (type: string) => {\n if (type === 'widthHeight') {\n styles.width = ''\n styles.height = ''\n } else if (type === 'margin') {\n styles.marginLeft = ''\n styles.marginRight = ''\n styles.marginTop = ''\n styles.marginBottom = ''\n } else if (type === 'padding') {\n styles.paddingLeft = ''\n styles.paddingRight = ''\n styles.paddingTop = ''\n styles.paddingBottom = ''\n }\n}\n</script>\n"],"names":["__MACROS_defineComponent","reactive","ref","watch","upper","height","width","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"style-box-input.vue2.js","sources":["../../../src/style-box-input/src/style-box-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleBoxInput',\n});\n</script>\n<template>\n <div class=\"dk-style-box-input\">\n <div class=\"position-line\" :style=\"positionStyle\"></div>\n <div class=\"header\">\n <label class=\"items-center\">\n 内外边距 | 高宽\n <el-popover ref=\"popover\" placement=\"bottom\" title=\"说明\" :width=\"280\" trigger=\"hover\" :content=\"props.help\">\n <template #reference>\n <dk-icon icon=\"QuestionFilled\" class=\"m-l-5px vertical-text-top\"></dk-icon>\n </template>\n </el-popover>\n </label>\n <div class=\"float-right cursor-pointer\">\n <div class=\"name-header-operations\">\n <el-tooltip class=\"box-item\" effect=\"dark\" content=\"重置高宽\" placement=\"top-start\">\n <dk-icon icon=\"Refresh\" color=\"var(--el-color-primary)\" @click=\"onRefresh('widthHeight')\"></dk-icon>\n </el-tooltip>\n </div>\n <div class=\"name-header-operations\">\n <el-tooltip class=\"box-item\" effect=\"dark\" content=\"重置内边距\" placement=\"top-start\">\n <dk-icon icon=\"Refresh\" color=\"var(--el-color-success)\" @click=\"onRefresh('padding')\"></dk-icon>\n </el-tooltip>\n </div>\n <div class=\"name-header-operations\">\n <el-tooltip class=\"box-item\" effect=\"dark\" content=\"重置外边距\" placement=\"top-start\">\n <dk-icon icon=\"Refresh\" color=\"var(--el-color-warning)\" @click=\"onRefresh('margin')\"></dk-icon>\n </el-tooltip>\n </div>\n </div>\n <div ref=\"box\" tabindex=\"0\" class=\"wrapper\" style=\"margin-top: 10px\" :style=\"{ height: height + 'px' }\">\n <div\n class=\"thumnail margin\"\n :class=\"moves.margin ? 'thumnail-heightlight' : ''\"\n @mousemove=\"onMouseMove('margin', 'move', $event)\"\n @mouseleave=\"onMouseMove('margin', 'leave', $event)\"\n >\n <!--外边距 Margin-->\n <div>\n <div v-for=\"(item, key) in margins\" :key=\"key\">\n <span\n :title=\"item.title\"\n :class=\"`anchor-tip-${item.position} value-indicator`\"\n @click=\"onDblclick(item.value, key)\"\n >\n <span> {{ getValue(styles[item.value]) }}</span>\n </span>\n <input\n ref=\"inputField\"\n v-model=\"styles[item.value]\"\n :class=\"'input-box anchor-tip-' + item.position + (showStyles[item.value] ? ' show' : '')\"\n @blur=\"onBlur(item.value)\"\n />\n <svg\n :width=\"item.svg.width\"\n :height=\"item.svg.height\"\n :viewBox=\"item.svg.viewBox\"\n preserveAspectRatio=\"none\"\n :data-link-anchor=\"item.value\"\n :style=\"item.svg.style\"\n class=\"esm-modal-svg\"\n v-html=\"item.svg.content\"\n ></svg>\n </div>\n </div>\n <div style=\"position: absolute; display: none; width: 100%; height: 100%\"></div>\n <div class=\"anchor-wrapper\">\n <div\n v-for=\"(item, key) in ['left', 'right', 'top', 'bottom']\"\n :key=\"key\"\n class=\"anchor\"\n :class=\"'anchor-' + item\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown('margin', item, $event)\"\n @mouseup=\"handleMouseUp\"\n ></div>\n </div>\n <span class=\"title\"> 外边距 </span>\n <!--外边距 Margin END-->\n\n <!--内边距 Padding-->\n <div class=\"thumnail border\">\n <div\n class=\"thumnail padding\"\n :class=\"moves.padding ? 'thumnail-heightlight' : ''\"\n @mousemove=\"onMouseMove('padding', 'move', $event)\"\n @mouseleave=\"onMouseMove('padding', 'leave', $event)\"\n >\n <div>\n <div v-for=\"(item, key) in paddings\" :key=\"key\">\n <span\n :title=\"item.title\"\n :class=\"`anchor-tip-${item.position} value-indicator`\"\n @click=\"onDblclick(item.value, key + 4)\"\n >\n <span> {{ getValue(styles[item.value]) }}</span>\n </span>\n <input\n ref=\"inputField\"\n v-model=\"styles[item.value]\"\n :class=\"'input-box anchor-tip-' + item.position + (showStyles[item.value] ? ' show' : '')\"\n @blur=\"onBlur(item.value)\"\n />\n <svg\n :width=\"item.svg.width\"\n :height=\"item.svg.height\"\n :viewBox=\"item.svg.viewBox\"\n preserveAspectRatio=\"none\"\n :data-link-anchor=\"item.value\"\n :style=\"item.svg.style\"\n class=\"esm-modal-svg\"\n v-html=\"item.svg.content\"\n ></svg>\n </div>\n </div>\n <div class=\"anchor-wrapper\">\n <div\n v-for=\"(item, key) in ['left', 'right', 'top', 'bottom']\"\n :key=\"key\"\n class=\"anchor\"\n :class=\"'anchor-' + item\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown('padding', item, $event)\"\n @mouseup=\"handleMouseUp\"\n ></div>\n </div>\n <span class=\"title\"> 内边距 </span>\n <!--内边距 END-->\n <div\n class=\"thumnail width-height\"\n :class=\"moves.widthHeight ? 'thumnail-heightlight' : ''\"\n @mousemove=\"onMouseMove('widthHeight', 'move', $event)\"\n @mouseleave=\"onMouseMove('widthHeight', 'leave', $event)\"\n >\n <span class=\"title\">\n <span class=\"content-unit left-0\" @click=\"onDblclick('width', 9)\">\n <em>{{ getValue(styles['width']) }}</em>\n </span>\n <input\n ref=\"inputWidth\"\n v-model=\"styles.width\"\n class=\"input-box absolute left-5% top-10px\"\n :class=\"showStyles['width'] ? ' show' : ''\"\n @blur=\"onBlur('width')\"\n />\n <span> x </span>\n <span class=\"content-unit right-0\" @click=\"onDblclick('height', 9)\">\n <em>{{ getValue(styles['height']) }}</em>\n </span>\n <input\n ref=\"inputHeight\"\n v-model=\"styles.height\"\n class=\"input-box absolute right-5% top-10px\"\n :class=\"showStyles['height'] ? ' show' : ''\"\n @blur=\"onBlur('height')\"\n />\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleBoxInputProps } from './props'\nimport { nextTick, reactive, ref, watch, computed } from 'vue'\nimport { margins, paddings } from './html'\nimport { upper } from '@vipl520/utils'\nimport { useElementSize } from '@vueuse/core'\n\n\n\nconst props = defineProps(styleBoxInputProps)\n\nconst moves: any = reactive({\n margin: false,\n padding: false,\n widthHeight: false,\n})\n\nconst inputField = ref()\nconst inputWidth = ref()\nconst inputHeight = ref()\n\nconst styles: any = reactive({\n marginLeft: props.modelValue.marginLeft || '',\n marginRight: props.modelValue.marginRight || '',\n marginTop: props.modelValue.marginTop || '',\n marginBottom: props.modelValue.marginBottom || '',\n paddingLeft: props.modelValue.paddingLeft || '',\n paddingRight: props.modelValue.paddingRight || '',\n paddingTop: props.modelValue.paddingTop || '',\n paddingBottom: props.modelValue.paddingBottom || '',\n width: props.modelValue.width || '',\n height: props.modelValue.height || '',\n})\nconst emit = defineEmits(['update:modelValue', 'change'])\n\nconst box: any = ref(null)\nconst { width } = useElementSize(box) // 当前组件宽度\n\nconst height: any = computed(() => {\n console.log('props.height', props.height)\n if (props.height === 'auto') {\n const h = width.value / 1.8\n return h > 300 ? 300 : h\n } else {\n return props.height\n }\n})\n\nwatch(\n () => props.modelValue,\n (newVal, oldVal) => {\n const propertiesToWatch = [\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'marginBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingBottom',\n 'width',\n 'height',\n ]\n propertiesToWatch.forEach((property) => {\n if (newVal[property] !== oldVal[property]) {\n styles[property] = newVal[property] || ''\n }\n })\n },\n { deep: true }\n)\n\nwatch(styles, () => {\n // 过滤 styles 中值为''\n const _styles = Object.keys(styles).reduce((acc: any, key) => {\n if (styles[key] !== '') {\n acc[key] = styles[key]\n }\n return acc\n }, {})\n emit('update:modelValue', _styles)\n emit('change', _styles)\n})\n\nconst showStyles: any = reactive({\n marginLeft: false,\n marginRight: false,\n marginTop: false,\n marginBottom: false,\n paddingLeft: false,\n paddingRight: false,\n paddingTop: false,\n paddingBottom: false,\n width: false,\n height: false,\n})\n\nconst dragging = ref(false)\nconst startPosition: any = reactive({\n x: 0,\n y: 0,\n})\n\nconst trackMouseBound: any = ref(null)\nconst stopChangeBound: any = ref(null)\nconst dragPosition = reactive({\n type: '',\n position: '',\n})\nconst positionStyle: any = reactive({\n display: 'none',\n width: '0px',\n height: '0px',\n left: '0px',\n top: '0px',\n})\n// const handleMouseMove = (event: any) => {\n// // 处理鼠标移动事件\n// if (dragging.value) {\n// const p = dragPosition.position\n// const type = dragPosition.type\n// const value = type + upper(p)\n// if (p === 'left' || p === 'right') {\n// // 说明是左右移动\n// positionStyle.left = event.clientX + 'px'\n// // 根据移动的距离,增加或者减少margin/padding-left/right 的大小\n// let difference = event.clientX - startPosition.x\n// if (p === 'left') {\n// difference = -difference\n// }\n// styles[value] = (parseInt(styles[value]) || 0) + difference + 'px'\n// startPosition.x = event.clientX\n// } else if (p === 'top' || p === 'bottom') {\n// positionStyle.top = event.clientY + 'px'\n// let difference = event.clientY - startPosition.y\n// if (p === 'top') {\n// difference = -difference\n// }\n// styles[value] = (parseInt(styles[value]) || 0) + difference + 'px'\n// startPosition.y = event.clientY\n// }\n// }\n// }\n\nconst handleMouseMove = (event: any) => {\n // 处理鼠标移动事件\n if (!dragging.value) return\n\n const p = dragPosition.position\n const type = dragPosition.type\n const value = type + upper(p)\n\n const updateStyle = (axis: 'x' | 'y', position: 'top' | 'bottom' | 'left' | 'right') => {\n const clientAxis = axis === 'x' ? 'clientX' : 'clientY'\n positionStyle[position] = event[clientAxis] + 'px'\n\n let difference = event[clientAxis] - startPosition[axis]\n if (p === 'top' || p === 'left') {\n difference = -difference\n }\n styles[value] = (parseInt(styles[value]) || 0) + difference + 'px'\n startPosition[axis] = event[clientAxis]\n }\n\n if (p === 'left' || p === 'right') {\n // 说明是左右移动\n updateStyle('x', 'left')\n } else if (p === 'top' || p === 'bottom') {\n updateStyle('y', 'top')\n }\n}\n\n// const handleMouseDown = (type: string, position: string, event: any) => {\n// // 处理鼠标按下事件\n// console.log('handleMouseDown', event)\n// dragPosition.position = position\n// dragPosition.type = type\n// trackMouseBound.value = handleMouseMove.bind(this)\n// document.addEventListener('mousemove', trackMouseBound.value)\n// stopChangeBound.value = handleMouseUp.bind(this)\n// document.addEventListener('mouseup', stopChangeBound.value)\n// dragging.value = true\n// const height = props.height\n// // 宽度 为.wrapper的宽度\n// const wrapperElement: any = document.querySelector('.wrapper')\n// const width = wrapperElement ? wrapperElement.offsetWidth : 0\n// const multiples: any = {\n// margin: 0.9,\n// padding: 0.9 * 0.7,\n// }\n// positionStyle.display = 'block'\n// startPosition.x = event.clientX\n// startPosition.y = event.clientY\n// if (position === 'left' || position === 'right') {\n// document.body.style.cursor = 'ew-resize'\n// positionStyle.left = event.clientX + 'px'\n// positionStyle.top = event.clientY - height * 0.5 * multiples[type] + 'px'\n// positionStyle.width = '0.1px'\n// positionStyle.height = height * multiples[type] + 'px'\n// } else {\n// document.body.style.cursor = 'ns-resize'\n// positionStyle.left = event.clientX - width * 0.5 * multiples[type] + 'px'\n// positionStyle.top = event.clientY + 'px'\n// positionStyle.width = width * multiples[type] + 'px'\n// positionStyle.height = '0.1px'\n// }\n// }\n\nconst handleMouseDown = (type: string, position: string, event: any) => {\n // 处理鼠标按下事件\n Object.assign(dragPosition, { position, type })\n trackMouseBound.value = handleMouseMove.bind(event)\n document.addEventListener('mousemove', trackMouseBound.value)\n stopChangeBound.value = handleMouseUp.bind(event)\n document.addEventListener('mouseup', stopChangeBound.value)\n dragging.value = true\n\n // const height = props.height\n const wrapperElement: any = document.querySelector('.wrapper')\n const width = wrapperElement ? wrapperElement.offsetWidth : 0\n const multiples: any = {\n margin: 0.9,\n padding: 0.9 * 0.7,\n }\n\n const { clientX, clientY } = event\n\n const setCursorAndDimensions = (cursor: string, left: string, top: string, width: string, height: string) => {\n document.body.style.cursor = cursor\n Object.assign(positionStyle, { left, top, width, height, display: 'block' })\n }\n\n startPosition.x = clientX\n startPosition.y = clientY\n\n if (position === 'left' || position === 'right') {\n setCursorAndDimensions(\n 'ew-resize',\n clientX + 'px',\n clientY - height.value * 0.5 * multiples[type] + 'px',\n '0.1px',\n height.value * multiples[type] + 'px'\n )\n } else {\n setCursorAndDimensions(\n 'ns-resize',\n clientX - width * 0.5 * multiples[type] + 'px',\n clientY + 'px',\n width * multiples[type] + 'px',\n '0.1px'\n )\n }\n}\n\nconst handleMouseUp = () => {\n // 处理鼠标抬起事件\n document.removeEventListener('mousemove', trackMouseBound.value)\n document.removeEventListener('mouseup', stopChangeBound.value)\n dragging.value = false\n positionStyle.display = 'none'\n document.body.style.cursor = 'default'\n startPosition.x = null\n startPosition.y = null\n}\n\nconst onMouseMove = (value: string, type: string = 'move', event: any) => {\n if (!dragging.value) {\n event.stopPropagation()\n }\n if (type !== 'move') {\n moves[value] = false\n } else {\n // 其他的为false\n Object.keys(moves).forEach((key) => {\n if (key !== value) {\n moves[key] = false\n }\n })\n // 当前的为true\n moves[value] = true\n }\n}\n\nconst onDblclick = (value: any, key: number) => {\n showStyles[value] = true\n nextTick(() => {\n if (value === 'width') {\n inputWidth.value.focus()\n } else if (value === 'height') {\n inputHeight.value.focus()\n } else {\n inputField.value[key].focus()\n }\n })\n}\n\nconst getValue = (value: any) => {\n // 判断value结尾是否存在px、vh、%、rem等\n if (value === 'auto') {\n return value\n }\n if (value === '0' || value === 0) {\n return 0\n }\n if (value === '') {\n return '-'\n }\n return value\n}\n\nconst onBlur = (value: any) => {\n showStyles[value] = false\n // styles[value] 这是一个css的值,用户会自己填写,内容不确定,但是我希望是:数字+单位,单位为:px/rem/%/vh这些,如果不是的话,则默认为px\n if (styles[value] === '' || styles[value] === 'auto') {\n return\n }\n const validValueRegex = /^(\\d*\\.?\\d+)(px|rem|%|vh)$/\n // 检查value是否匹配有效单位,如果不匹配则默认为px\n if (!validValueRegex.test(styles[value])) {\n const number = parseInt(styles[value])\n if (isNaN(number)) {\n styles[value] = ''\n } else {\n styles[value] = number + 'px'\n }\n }\n}\n\nconst onRefresh = (type: string) => {\n if (type === 'widthHeight') {\n styles.width = ''\n styles.height = ''\n } else if (type === 'margin') {\n styles.marginLeft = ''\n styles.marginRight = ''\n styles.marginTop = ''\n styles.marginBottom = ''\n } else if (type === 'padding') {\n styles.paddingLeft = ''\n styles.paddingRight = ''\n styles.paddingTop = ''\n styles.paddingBottom = ''\n }\n}\n</script>\n"],"names":["__MACROS_defineComponent","reactive","ref","useElementSize","computed","watch","upper","width","height","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,iBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAkLD,IAAA,MAAM,QAAaC,YAAS,CAAA;AAAA,MAC1B,MAAQ,EAAA,KAAA;AAAA,MACR,OAAS,EAAA,KAAA;AAAA,MACT,WAAa,EAAA,KAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAA,MAAM,aAAaC,OAAI,EAAA,CAAA;AACvB,IAAA,MAAM,aAAaA,OAAI,EAAA,CAAA;AACvB,IAAA,MAAM,cAAcA,OAAI,EAAA,CAAA;AAExB,IAAA,MAAM,SAAcD,YAAS,CAAA;AAAA,MAC3B,UAAA,EAAY,KAAM,CAAA,UAAA,CAAW,UAAc,IAAA,EAAA;AAAA,MAC3C,WAAA,EAAa,KAAM,CAAA,UAAA,CAAW,WAAe,IAAA,EAAA;AAAA,MAC7C,SAAA,EAAW,KAAM,CAAA,UAAA,CAAW,SAAa,IAAA,EAAA;AAAA,MACzC,YAAA,EAAc,KAAM,CAAA,UAAA,CAAW,YAAgB,IAAA,EAAA;AAAA,MAC/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}.dk-style-box-input .position-line{background:rgba(255,0,0,.42);position:fixed;z-index:999}.dk-style-box-input .header{margin-bottom:20px}.dk-style-box-input .header .name-header-operations{float:right;margin-left:4px;position:relative}.dk-style-box-input .wrapper{background-color:#e7dec6;height:380px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.dk-style-box-input .wrapper .thumnail{margin:auto;position:relative;top:50%;transform:translateY(-50%)}.dk-style-box-input .wrapper .thumnail-heightlight{border:1px dashed rgba(51,51,51,.5);box-sizing:
|
1
|
+
.dk-style-box-input{display:flex;flex-direction:column;flex-shrink:0;min-height:100%;width:100%}.dk-style-box-input .position-line{background:rgba(255,0,0,.42);position:fixed;z-index:999}.dk-style-box-input .header{margin-bottom:20px}.dk-style-box-input .header .name-header-operations{float:right;margin-left:4px;position:relative}.dk-style-box-input .wrapper{background-color:#e7dec6;height:380px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.dk-style-box-input .wrapper .thumnail{margin:auto;position:relative;top:50%;transform:translateY(-50%)}.dk-style-box-input .wrapper .thumnail-heightlight{border:1px dashed rgba(51,51,51,.5);box-sizing:border-box}.dk-style-box-input .wrapper .margin{background-color:#eace95;height:100%;width:100%}.dk-style-box-input .wrapper .margin .title{color:#7f0020;display:block;padding:6px;position:absolute}.dk-style-box-input .wrapper .margin .anchor{background-color:#fff;border:1px solid rgba(51,51,51,.5);height:8px;width:8px;z-index:10000}.dk-style-box-input .wrapper .margin .anchor-left{left:-4px;position:absolute;top:50%;transform:translateY(-50%)}.dk-style-box-input .wrapper .margin .anchor-left:hover{cursor:w-resize}.dk-style-box-input .wrapper .margin .anchor-right{position:absolute;right:-4px;top:50%;transform:translateY(-50%)}.dk-style-box-input .wrapper .margin .anchor-right:hover{cursor:e-resize}.dk-style-box-input .wrapper .margin .anchor-top{left:50%;position:absolute;top:-4px;transform:translateX(-50%)}.dk-style-box-input .wrapper .margin .anchor-top:hover{cursor:n-resize}.dk-style-box-input .wrapper .margin .anchor-bottom{bottom:-4px;left:50%;position:absolute;transform:translateX(-50%)}.dk-style-box-input .wrapper .margin .anchor-bottom:hover{cursor:s-resize}.dk-style-box-input .wrapper .margin .anchor-tip-left{left:6px;position:absolute;top:50%;transform:translateY(-50%);z-index:999}.dk-style-box-input .wrapper .margin .anchor-tip-right{position:absolute;right:6px;top:50%;transform:translateY(-50%);z-index:999}.dk-style-box-input .wrapper .margin .anchor-tip-top{left:50%;position:absolute;top:6px;transform:translateX(-50%);z-index:999}.dk-style-box-input .wrapper .margin .anchor-tip-bottom{bottom:6px;left:50%;position:absolute;transform:translateX(-50%);z-index:999}.dk-style-box-input .wrapper .margin .anchor-tip-left,.dk-style-box-input .wrapper .margin .anchor-tip-right{width:13%;height:100%}.dk-style-box-input .wrapper .margin .anchor-tip-bottom,.dk-style-box-input .wrapper .margin .anchor-tip-top{height:10%;width:70%}.dk-style-box-input .wrapper .margin .border{border-width:3px;height:70%;width:70%}.dk-style-box-input .wrapper .margin .padding{background-color:#aed29f;height:calc(100% - 1px);width:calc(100% - 1px)}.dk-style-box-input .wrapper .margin .padding .anchor-tip-left,.dk-style-box-input .wrapper .margin .padding .anchor-tip-right{height:50%;width:16%}.dk-style-box-input .wrapper .margin .padding .anchor-tip-bottom,.dk-style-box-input .wrapper .margin .padding .anchor-tip-top{height:16%;width:100%}.dk-style-box-input .wrapper .margin .padding .width-height{align-items:center;background-color:#9ae0f1;display:flex;height:50%;justify-content:center;width:60%;font-size:14px}.dk-style-box-input .wrapper .margin .padding .width-height input{line-height:46px;top:calc(50% - 12px)}.dk-style-box-input .wrapper .margin .padding .width-height .title{color:#000;height:80%;padding:0;text-align:center;width:100%}.dk-style-box-input .wrapper .margin .padding .width-height .title span{top:calc(50% - 12px);height:100%;position:absolute}.dk-style-box-input .wrapper .margin .padding .width-height .title .content-unit{cursor:pointer;display:inline-block;width:40%}.dk-style-box-input .wrapper .margin .padding .width-height .title .content-unit em{font-style:normal;font-size:12px}.dk-style-box-input .wrapper .margin .input-box{border:0;border-radius:2px;display:none;font-size:12px;max-height:24px;max-width:48px;outline:1px solid #666}.dk-style-box-input .wrapper .margin .input-box.show{display:block}.dk-style-box-input .wrapper .margin .value-indicator{color:#333;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center}.dk-style-box-input .wrapper .margin .value-indicator:hover~.esm-modal-svg{opacity:1}.dk-style-box-input .wrapper .margin .esm-modal-svg{opacity:0}.dk-style-box-input .wrapper .margin .esm-modal-svg:hover{opacity:1}
|
@@ -39,13 +39,13 @@
|
|
39
39
|
|
40
40
|
.thumnail-heightlight {
|
41
41
|
border: 1px dashed rgba(51, 51, 51, 0.5);
|
42
|
-
box-sizing:
|
42
|
+
box-sizing: border-box;
|
43
43
|
}
|
44
44
|
|
45
45
|
.margin {
|
46
46
|
background-color: #eace95;
|
47
|
-
height:
|
48
|
-
width:
|
47
|
+
height: 100%;
|
48
|
+
width: 100%;
|
49
49
|
|
50
50
|
.title {
|
51
51
|
color: #7f0020;
|
@@ -204,6 +204,10 @@
|
|
204
204
|
cursor: pointer;
|
205
205
|
display: inline-block;
|
206
206
|
width: 40%;
|
207
|
+
em{
|
208
|
+
font-style: normal;
|
209
|
+
font-size: 12px;
|
210
|
+
}
|
207
211
|
}
|
208
212
|
}
|
209
213
|
}
|
@@ -3,6 +3,10 @@ export declare const StyleInput: import("@vipl520/utils").WithInstall<import("vu
|
|
3
3
|
default: () => import("./src/default").StyleInputConfig;
|
4
4
|
type: () => import("./src/default").StyleInputConfig;
|
5
5
|
};
|
6
|
+
hideComponents: {
|
7
|
+
default: () => never[];
|
8
|
+
type: () => string[];
|
9
|
+
};
|
6
10
|
modelValue: {
|
7
11
|
default: () => {};
|
8
12
|
type: ObjectConstructor;
|
@@ -12,6 +16,10 @@ export declare const StyleInput: import("@vipl520/utils").WithInstall<import("vu
|
|
12
16
|
default: () => import("./src/default").StyleInputConfig;
|
13
17
|
type: () => import("./src/default").StyleInputConfig;
|
14
18
|
};
|
19
|
+
hideComponents: {
|
20
|
+
default: () => never[];
|
21
|
+
type: () => string[];
|
22
|
+
};
|
15
23
|
modelValue: {
|
16
24
|
default: () => {};
|
17
25
|
type: ObjectConstructor;
|
@@ -21,6 +29,7 @@ export declare const StyleInput: import("@vipl520/utils").WithInstall<import("vu
|
|
21
29
|
}, {
|
22
30
|
modelValue: Record<string, any>;
|
23
31
|
components: import("./src/default").StyleInputConfig;
|
32
|
+
hideComponents: string[];
|
24
33
|
}, {}>>;
|
25
34
|
export default StyleInput;
|
26
35
|
export * from './src/props';
|
@@ -2,12 +2,19 @@ import type { ExtractPropTypes } from 'vue';
|
|
2
2
|
import { type StyleInputConfig } from './default';
|
3
3
|
export declare const styleInputProps: {
|
4
4
|
/**
|
5
|
-
*
|
5
|
+
* 引入组件
|
6
6
|
*/
|
7
7
|
components: {
|
8
8
|
default: () => StyleInputConfig;
|
9
9
|
type: () => StyleInputConfig;
|
10
10
|
};
|
11
|
+
/**
|
12
|
+
* 需要隐藏组件
|
13
|
+
*/
|
14
|
+
hideComponents: {
|
15
|
+
default: () => never[];
|
16
|
+
type: () => string[];
|
17
|
+
};
|
11
18
|
modelValue: {
|
12
19
|
default: () => {};
|
13
20
|
type: ObjectConstructor;
|
@@ -4,7 +4,7 @@ var _default = require('./default.js');
|
|
4
4
|
|
5
5
|
const styleInputProps = {
|
6
6
|
/**
|
7
|
-
*
|
7
|
+
* 引入组件
|
8
8
|
*/
|
9
9
|
components: {
|
10
10
|
default: () => {
|
@@ -12,6 +12,15 @@ const styleInputProps = {
|
|
12
12
|
},
|
13
13
|
type: Array
|
14
14
|
},
|
15
|
+
/**
|
16
|
+
* 需要隐藏组件
|
17
|
+
*/
|
18
|
+
hideComponents: {
|
19
|
+
default: () => {
|
20
|
+
return [];
|
21
|
+
},
|
22
|
+
type: Array
|
23
|
+
},
|
15
24
|
modelValue: {
|
16
25
|
default: () => {
|
17
26
|
return {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../src/style-input/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\nimport { defaultConfig, type StyleInputConfig } from './default'\n\nexport const styleInputProps = {\n /**\n *
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../src/style-input/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\nimport { defaultConfig, type StyleInputConfig } from './default'\n\nexport const styleInputProps = {\n /**\n * 引入组件\n */\n components: {\n default: () => {\n return defaultConfig\n },\n type: Array as () => StyleInputConfig,\n },\n /**\n * 需要隐藏组件\n */\n hideComponents: {\n default: () => {\n return []\n },\n type: Array as () => string[],\n },\n modelValue: {\n default: () => {\n return {}\n },\n type: Object,\n },\n}\n\nexport type StyleInputProps = ExtractPropTypes<typeof styleInputProps>\n"],"names":["defaultConfig"],"mappings":";;;;AAGO,MAAM,eAAkB,GAAA;AAAA;AAAA;AAAA;AAAA,EAI7B,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAO,OAAAA,sBAAA,CAAA;AAAA,KACT;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,cAAgB,EAAA;AAAA,IACd,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AACF;;;;"}
|
@@ -3,6 +3,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
default: () => import("./default").StyleInputConfig;
|
4
4
|
type: () => import("./default").StyleInputConfig;
|
5
5
|
};
|
6
|
+
hideComponents: {
|
7
|
+
default: () => never[];
|
8
|
+
type: () => string[];
|
9
|
+
};
|
6
10
|
modelValue: {
|
7
11
|
default: () => {};
|
8
12
|
type: ObjectConstructor;
|
@@ -12,6 +16,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
12
16
|
default: () => import("./default").StyleInputConfig;
|
13
17
|
type: () => import("./default").StyleInputConfig;
|
14
18
|
};
|
19
|
+
hideComponents: {
|
20
|
+
default: () => never[];
|
21
|
+
type: () => string[];
|
22
|
+
};
|
15
23
|
modelValue: {
|
16
24
|
default: () => {};
|
17
25
|
type: ObjectConstructor;
|
@@ -21,5 +29,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
21
29
|
}, {
|
22
30
|
modelValue: Record<string, any>;
|
23
31
|
components: import("./default").StyleInputConfig;
|
32
|
+
hideComponents: string[];
|
24
33
|
}, {}>;
|
25
34
|
export default _default;
|
@@ -31,10 +31,14 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
31
31
|
});
|
32
32
|
emit("update:modelValue", obj);
|
33
33
|
};
|
34
|
+
const _components = vue.ref([]);
|
34
35
|
const init = () => {
|
35
|
-
|
36
|
+
_components.value = props.components.filter((item) => {
|
37
|
+
console.log("item.name", item.name);
|
38
|
+
return !props.hideComponents.includes(item.name);
|
39
|
+
});
|
36
40
|
const obj = {};
|
37
|
-
|
41
|
+
_components.value.forEach((item) => {
|
38
42
|
const params = item.params;
|
39
43
|
const paramsObj = {};
|
40
44
|
Object.keys(params).forEach((key) => {
|
@@ -73,7 +77,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
73
77
|
(vue.openBlock(true), vue.createElementBlock(
|
74
78
|
vue.Fragment,
|
75
79
|
null,
|
76
|
-
vue.renderList(
|
80
|
+
vue.renderList(_components.value, (item, key) => {
|
77
81
|
return vue.openBlock(), vue.createBlock(_component_el_collapse_item, {
|
78
82
|
key,
|
79
83
|
title: "",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"style-input.vue2.js","sources":["../../../src/style-input/src/style-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleInput',\n});\n</script>\n<template>\n <div class=\"dk-style-input\">\n <div v-if=\"!loading\" class=\"p-5px\">\n <el-collapse v-model=\"activeNames\">\n <el-collapse-item v-for=\"(item, key) in
|
1
|
+
{"version":3,"file":"style-input.vue2.js","sources":["../../../src/style-input/src/style-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleInput',\n});\n</script>\n<template>\n <div class=\"dk-style-input\">\n <div v-if=\"!loading\" class=\"p-5px\">\n <el-collapse v-model=\"activeNames\">\n <el-collapse-item v-for=\"(item, key) in _components\" :key=\"key\" title=\"\" :name=\"key\">\n <template #title>\n {{ item.title }}\n </template>\n <component\n :is=\"item.name\"\n v-if=\"activeNames.includes(key)\"\n v-model=\"values[item.name]\"\n v-bind=\"item.props\"\n @change=\"onChange\"\n />\n </el-collapse-item>\n </el-collapse>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleInputProps } from './props'\nimport { onMounted, ref, watch } from 'vue'\n\n\nconst props = defineProps(styleInputProps)\nconst activeNames = ref([0])\nconst values: any = ref({})\nconst loading = ref(true)\n\nconst emit = defineEmits(['update:modelValue'])\nconst onChange = () => {\n const obj: any = {}\n Object.keys(values.value).forEach((key) => {\n Object.keys(values.value[key]).forEach((k) => {\n obj[k] = values.value[key][k]\n })\n })\n emit('update:modelValue', obj)\n}\n\nconst _components: any = ref([])\nconst init = () => {\n _components.value = props.components.filter((item: any) => {\n console.log('item.name', item.name)\n return !props.hideComponents.includes(item.name)\n })\n const obj: any = {}\n _components.value.forEach((item: any) => {\n const params = item.params\n const paramsObj: any = {}\n Object.keys(params).forEach((key) => {\n const param = params[key]\n if (props.modelValue[param]) {\n paramsObj[param] = props.modelValue[param]\n }\n })\n obj[item.name] = paramsObj\n })\n values.value = obj\n loading.value = false\n}\n\nwatch(\n () => props.modelValue,\n () => {\n init()\n },\n {\n deep: true,\n }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