@vipl520/dk-ui 1.0.46 → 1.0.48
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 +96 -62
- 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 +96 -62
- package/dist/web-types.json +1 -1
- package/es/style-box-input/src/style-box-input.vue2.mjs +68 -56
- 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 +17 -4
- package/es/style-input/src/style-input.vue2.mjs.map +1 -1
- package/es/uni-icon/style/index.css +1 -1
- package/es/uni-icon/style/index.scss +2 -1
- package/lib/style-box-input/src/style-box-input.vue2.js +68 -56
- 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 +16 -3
- package/lib/style-input/src/style-input.vue2.js.map +1 -1
- package/lib/uni-icon/style/index.css +1 -1
- package/lib/uni-icon/style/index.scss +2 -1
- package/package.json +1 -1
- package/dist/uniicons.ttf +0 -0
@@ -14,46 +14,50 @@ const _hoisted_4 = { class: "float-right cursor-pointer" };
|
|
14
14
|
const _hoisted_5 = { class: "name-header-operations" };
|
15
15
|
const _hoisted_6 = { class: "name-header-operations" };
|
16
16
|
const _hoisted_7 = { class: "name-header-operations" };
|
17
|
-
const _hoisted_8 = ["title"
|
18
|
-
const _hoisted_9 = ["
|
19
|
-
const _hoisted_10 = ["
|
20
|
-
const _hoisted_11 =
|
17
|
+
const _hoisted_8 = ["title"];
|
18
|
+
const _hoisted_9 = ["onMouseenter"];
|
19
|
+
const _hoisted_10 = ["onUpdate:modelValue", "onBlur"];
|
20
|
+
const _hoisted_11 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
|
21
|
+
const _hoisted_12 = /* @__PURE__ */ vue.createElementVNode(
|
21
22
|
"div",
|
22
23
|
{ style: { "position": "absolute", "display": "none", "width": "100%", "height": "100%" } },
|
23
24
|
null,
|
24
25
|
-1
|
25
26
|
/* HOISTED */
|
26
27
|
);
|
27
|
-
const
|
28
|
-
const
|
29
|
-
const
|
28
|
+
const _hoisted_13 = { class: "anchor-wrapper" };
|
29
|
+
const _hoisted_14 = ["onMousedown"];
|
30
|
+
const _hoisted_15 = /* @__PURE__ */ vue.createElementVNode(
|
30
31
|
"span",
|
31
32
|
{ class: "title" },
|
32
33
|
" \u5916\u8FB9\u8DDD ",
|
33
34
|
-1
|
34
35
|
/* HOISTED */
|
35
36
|
);
|
36
|
-
const
|
37
|
-
const
|
38
|
-
const
|
39
|
-
const
|
40
|
-
const
|
41
|
-
const
|
42
|
-
const
|
37
|
+
const _hoisted_16 = { class: "thumnail border" };
|
38
|
+
const _hoisted_17 = ["title"];
|
39
|
+
const _hoisted_18 = ["onMouseenter"];
|
40
|
+
const _hoisted_19 = ["onUpdate:modelValue", "onBlur"];
|
41
|
+
const _hoisted_20 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
|
42
|
+
const _hoisted_21 = { class: "anchor-wrapper" };
|
43
|
+
const _hoisted_22 = ["onMousedown"];
|
44
|
+
const _hoisted_23 = /* @__PURE__ */ vue.createElementVNode(
|
43
45
|
"span",
|
44
46
|
{ class: "title" },
|
45
47
|
" \u5185\u8FB9\u8DDD ",
|
46
48
|
-1
|
47
49
|
/* HOISTED */
|
48
50
|
);
|
49
|
-
const
|
50
|
-
const
|
51
|
+
const _hoisted_24 = { class: "title" };
|
52
|
+
const _hoisted_25 = { class: "content-unit left-0" };
|
53
|
+
const _hoisted_26 = /* @__PURE__ */ vue.createElementVNode(
|
51
54
|
"span",
|
52
55
|
null,
|
53
56
|
" x ",
|
54
57
|
-1
|
55
58
|
/* HOISTED */
|
56
59
|
);
|
60
|
+
const _hoisted_27 = { class: "content-unit right-0" };
|
57
61
|
const __default__ = vue.defineComponent({
|
58
62
|
name: "DkStyleBoxInput"
|
59
63
|
});
|
@@ -410,9 +414,12 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
410
414
|
return vue.openBlock(), vue.createElementBlock("div", { key }, [
|
411
415
|
vue.createElementVNode("span", {
|
412
416
|
title: item.title,
|
413
|
-
class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`)
|
414
|
-
|
415
|
-
|
417
|
+
class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`)
|
418
|
+
}, [
|
419
|
+
vue.createElementVNode("span", {
|
420
|
+
onMouseenter: ($event) => onDblclick(item.value, key)
|
421
|
+
}, vue.toDisplayString(getValue(styles[item.value])), 41, _hoisted_9)
|
422
|
+
], 10, _hoisted_8),
|
416
423
|
vue.withDirectives(vue.createElementVNode("input", {
|
417
424
|
ref_for: true,
|
418
425
|
ref_key: "inputField",
|
@@ -420,7 +427,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
420
427
|
"onUpdate:modelValue": ($event) => styles[item.value] = $event,
|
421
428
|
class: vue.normalizeClass("input-box anchor-tip-" + item.position + (showStyles[item.value] ? " show" : "")),
|
422
429
|
onBlur: ($event) => onBlur(item.value)
|
423
|
-
}, null, 42,
|
430
|
+
}, null, 42, _hoisted_10), [
|
424
431
|
[vue.vModelText, styles[item.value]]
|
425
432
|
]),
|
426
433
|
(vue.openBlock(), vue.createElementBlock("svg", {
|
@@ -432,15 +439,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
432
439
|
style: vue.normalizeStyle(item.svg.style),
|
433
440
|
class: "esm-modal-svg",
|
434
441
|
innerHTML: item.svg.content
|
435
|
-
}, null, 12,
|
442
|
+
}, null, 12, _hoisted_11))
|
436
443
|
]);
|
437
444
|
}),
|
438
445
|
128
|
439
446
|
/* KEYED_FRAGMENT */
|
440
447
|
))
|
441
448
|
]),
|
442
|
-
|
443
|
-
vue.createElementVNode("div",
|
449
|
+
_hoisted_12,
|
450
|
+
vue.createElementVNode("div", _hoisted_13, [
|
444
451
|
(vue.openBlock(), vue.createElementBlock(
|
445
452
|
vue.Fragment,
|
446
453
|
null,
|
@@ -451,16 +458,16 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
451
458
|
onMousemove: handleMouseMove,
|
452
459
|
onMousedown: ($event) => handleMouseDown("margin", item, $event),
|
453
460
|
onMouseup: handleMouseUp
|
454
|
-
}, null, 42,
|
461
|
+
}, null, 42, _hoisted_14);
|
455
462
|
}),
|
456
463
|
64
|
457
464
|
/* STABLE_FRAGMENT */
|
458
465
|
))
|
459
466
|
]),
|
460
|
-
|
467
|
+
_hoisted_15,
|
461
468
|
vue.createCommentVNode("\u5916\u8FB9\u8DDD Margin END"),
|
462
469
|
vue.createCommentVNode("\u5185\u8FB9\u8DDD Padding"),
|
463
|
-
vue.createElementVNode("div",
|
470
|
+
vue.createElementVNode("div", _hoisted_16, [
|
464
471
|
vue.createElementVNode(
|
465
472
|
"div",
|
466
473
|
{
|
@@ -477,9 +484,12 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
477
484
|
return vue.openBlock(), vue.createElementBlock("div", { key }, [
|
478
485
|
vue.createElementVNode("span", {
|
479
486
|
title: item.title,
|
480
|
-
class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`)
|
481
|
-
|
482
|
-
|
487
|
+
class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`)
|
488
|
+
}, [
|
489
|
+
vue.createElementVNode("span", {
|
490
|
+
onMouseenter: ($event) => onDblclick(item.value, key + 4)
|
491
|
+
}, vue.toDisplayString(getValue(styles[item.value])), 41, _hoisted_18)
|
492
|
+
], 10, _hoisted_17),
|
483
493
|
vue.withDirectives(vue.createElementVNode("input", {
|
484
494
|
ref_for: true,
|
485
495
|
ref_key: "inputField",
|
@@ -487,7 +497,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
487
497
|
"onUpdate:modelValue": ($event) => styles[item.value] = $event,
|
488
498
|
class: vue.normalizeClass("input-box anchor-tip-" + item.position + (showStyles[item.value] ? " show" : "")),
|
489
499
|
onBlur: ($event) => onBlur(item.value)
|
490
|
-
}, null, 42,
|
500
|
+
}, null, 42, _hoisted_19), [
|
491
501
|
[vue.vModelText, styles[item.value]]
|
492
502
|
]),
|
493
503
|
(vue.openBlock(), vue.createElementBlock("svg", {
|
@@ -499,14 +509,14 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
499
509
|
style: vue.normalizeStyle(item.svg.style),
|
500
510
|
class: "esm-modal-svg",
|
501
511
|
innerHTML: item.svg.content
|
502
|
-
}, null, 12,
|
512
|
+
}, null, 12, _hoisted_20))
|
503
513
|
]);
|
504
514
|
}),
|
505
515
|
128
|
506
516
|
/* KEYED_FRAGMENT */
|
507
517
|
))
|
508
518
|
]),
|
509
|
-
vue.createElementVNode("div",
|
519
|
+
vue.createElementVNode("div", _hoisted_21, [
|
510
520
|
(vue.openBlock(), vue.createElementBlock(
|
511
521
|
vue.Fragment,
|
512
522
|
null,
|
@@ -517,13 +527,13 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
517
527
|
onMousemove: handleMouseMove,
|
518
528
|
onMousedown: ($event) => handleMouseDown("padding", item, $event),
|
519
529
|
onMouseup: handleMouseUp
|
520
|
-
}, null, 42,
|
530
|
+
}, null, 42, _hoisted_22);
|
521
531
|
}),
|
522
532
|
64
|
523
533
|
/* STABLE_FRAGMENT */
|
524
534
|
))
|
525
535
|
]),
|
526
|
-
|
536
|
+
_hoisted_23,
|
527
537
|
vue.createCommentVNode("\u5185\u8FB9\u8DDD END"),
|
528
538
|
vue.createElementVNode(
|
529
539
|
"div",
|
@@ -533,17 +543,18 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
533
543
|
onMouseleave: _cache[10] || (_cache[10] = ($event) => onMouseMove("widthHeight", "leave", $event))
|
534
544
|
},
|
535
545
|
[
|
536
|
-
vue.createElementVNode("span",
|
537
|
-
vue.createElementVNode(
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
546
|
+
vue.createElementVNode("span", _hoisted_24, [
|
547
|
+
vue.createElementVNode("span", _hoisted_25, [
|
548
|
+
vue.createElementVNode(
|
549
|
+
"em",
|
550
|
+
{
|
551
|
+
onMouseenter: _cache[3] || (_cache[3] = ($event) => onDblclick("width", 9))
|
552
|
+
},
|
553
|
+
vue.toDisplayString(getValue(styles["width"])),
|
554
|
+
33
|
555
|
+
/* TEXT, HYDRATE_EVENTS */
|
556
|
+
)
|
557
|
+
]),
|
547
558
|
vue.withDirectives(vue.createElementVNode(
|
548
559
|
"input",
|
549
560
|
{
|
@@ -559,17 +570,18 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
559
570
|
), [
|
560
571
|
[vue.vModelText, styles.width]
|
561
572
|
]),
|
562
|
-
|
563
|
-
vue.createElementVNode(
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
+
_hoisted_26,
|
574
|
+
vue.createElementVNode("span", _hoisted_27, [
|
575
|
+
vue.createElementVNode(
|
576
|
+
"em",
|
577
|
+
{
|
578
|
+
onMouseenter: _cache[6] || (_cache[6] = ($event) => onDblclick("height", 9))
|
579
|
+
},
|
580
|
+
vue.toDisplayString(getValue(styles["height"])),
|
581
|
+
33
|
582
|
+
/* TEXT, HYDRATE_EVENTS */
|
583
|
+
)
|
584
|
+
]),
|
573
585
|
vue.withDirectives(vue.createElementVNode(
|
574
586
|
"input",
|
575
587
|
{
|
@@ -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.pa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A,CAAO,UAAa,GAAA,EAAA,CAAA;AACpB,QAAA,MAAA,CAAO,aAAgB,GAAA,EAAA,CAAA;AAAA,OACzB;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
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 :title=\"item.title\" :class=\"`anchor-tip-${item.position} value-indicator`\">\n <span @mouseenter=\"onDblclick(item.value, key)\"> {{ 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 :title=\"item.title\" :class=\"`anchor-tip-${item.position} value-indicator`\">\n <span @mouseenter=\"onDblclick(item.value, key + 4)\"> {{ 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\">\n <em @mouseenter=\"onDblclick('width', 9)\">{{ 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\">\n <em @mouseenter=\"onDblclick('height', 9)\">{{ 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 } 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,iBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA0KD,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/C,WAA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AClB,MAAA,IAAW,SAAS,QAAU,EAAA;AAC5B,QAAA,MAAA,CAAO,UAAa,GAAA,EAAA,CAAA;AACpB,QAAA,MAAA,CAAO,WAAc,GAAA,EAAA,CAAA;AACrB,QAAA,MAAA,CAAO,SAAY,GAAA,EAAA,CAAA;AACnB,QAAA,MAAA,CAAO,YAAe,GAAA,EAAA,CAAA;AAAA,OACxB,MAAA,IAAW,SAAS,SAAW,EAAA;AAC7B,QAAA,MAAA,CAAO,WAAc,GAAA,EAAA,CAAA;AACrB,QAAA,MAAA,CAAO,YAAe,GAAA,EAAA,CAAA;AACtB,QAAA,MAAA,CAAO,UAAa,GAAA,EAAA,CAAA;AACpB,QAAA,MAAA,CAAO,aAAgB,GAAA,EAAA,CAAA;AAAA,OACzB;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
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:
|
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) => {
|
@@ -48,6 +52,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
48
52
|
values.value = obj;
|
49
53
|
loading.value = false;
|
50
54
|
};
|
55
|
+
vue.watch(
|
56
|
+
() => props.modelValue,
|
57
|
+
() => {
|
58
|
+
init();
|
59
|
+
},
|
60
|
+
{
|
61
|
+
deep: true
|
62
|
+
}
|
63
|
+
);
|
51
64
|
vue.onMounted(() => {
|
52
65
|
init();
|
53
66
|
});
|
@@ -64,7 +77,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
64
77
|
(vue.openBlock(true), vue.createElementBlock(
|
65
78
|
vue.Fragment,
|
66
79
|
null,
|
67
|
-
vue.renderList(
|
80
|
+
vue.renderList(_components.value, (item, key) => {
|
68
81
|
return vue.openBlock(), vue.createBlock(_component_el_collapse_item, {
|
69
82
|
key,
|
70
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,\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