@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.
Files changed (41) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +85 -47
  3. package/dist/index.min.js +4 -4
  4. package/dist/index.min.js.map +1 -1
  5. package/dist/index.min.mjs +4 -4
  6. package/dist/index.min.mjs.map +1 -1
  7. package/dist/index.mjs +85 -47
  8. package/dist/web-types.json +1 -1
  9. package/es/style-box-input/index.d.ts +5 -5
  10. package/es/style-box-input/src/props.d.ts +2 -2
  11. package/es/style-box-input/src/props.mjs +2 -2
  12. package/es/style-box-input/src/props.mjs.map +1 -1
  13. package/es/style-box-input/src/style-box-input.vue.d.ts +5 -5
  14. package/es/style-box-input/src/style-box-input.vue2.mjs +68 -42
  15. package/es/style-box-input/src/style-box-input.vue2.mjs.map +1 -1
  16. package/es/style-box-input/style/index.css +1 -1
  17. package/es/style-box-input/style/index.scss +7 -3
  18. package/es/style-input/index.d.ts +9 -0
  19. package/es/style-input/src/props.d.ts +8 -1
  20. package/es/style-input/src/props.mjs +10 -1
  21. package/es/style-input/src/props.mjs.map +1 -1
  22. package/es/style-input/src/style-input.vue.d.ts +9 -0
  23. package/es/style-input/src/style-input.vue2.mjs +7 -3
  24. package/es/style-input/src/style-input.vue2.mjs.map +1 -1
  25. package/lib/style-box-input/index.d.ts +5 -5
  26. package/lib/style-box-input/src/props.d.ts +2 -2
  27. package/lib/style-box-input/src/props.js +2 -2
  28. package/lib/style-box-input/src/props.js.map +1 -1
  29. package/lib/style-box-input/src/style-box-input.vue.d.ts +5 -5
  30. package/lib/style-box-input/src/style-box-input.vue2.js +67 -41
  31. package/lib/style-box-input/src/style-box-input.vue2.js.map +1 -1
  32. package/lib/style-box-input/style/index.css +1 -1
  33. package/lib/style-box-input/style/index.scss +7 -3
  34. package/lib/style-input/index.d.ts +9 -0
  35. package/lib/style-input/src/props.d.ts +8 -1
  36. package/lib/style-input/src/props.js +10 -1
  37. package/lib/style-input/src/props.js.map +1 -1
  38. package/lib/style-input/src/style-input.vue.d.ts +9 -0
  39. package/lib/style-input/src/style-input.vue2.js +7 -3
  40. package/lib/style-input/src/style-input.vue2.js.map +1 -1
  41. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"style-box-input.vue2.mjs","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 = 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AAA,MAAA,CAAO,aAAgB,GAAA,EAAA,CAAA;AAAA,OACzB;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style-box-input.vue2.mjs","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","width","height"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,iBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAkLD,IAAA,MAAM,QAAa,QAAS,CAAA;AAAA,MAC1B,MAAQ,EAAA,KAAA;AAAA,MACR,OAAS,EAAA,KAAA;AAAA,MACT,WAAa,EAAA,KAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAA,MAAM,aAAa,GAAI,EAAA,CAAA;AACvB,IAAA,MAAM,aAAa,GAAI,EAAA,CAAA;AACvB,IAAA,MAAM,cAAc,GAAI,EAAA,CAAA;AAExB,IAAA,MAAM,SAAc,QAAS,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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rink: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:initial}.dk-style-box-input .wrapper .margin{background-color:#eace95;height:90%;width:90%}.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 .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}
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: initial;
42
+ box-sizing: border-box;
43
43
  }
44
44
 
45
45
  .margin {
46
46
  background-color: #eace95;
47
- height: 90%;
48
- width: 90%;
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;
@@ -2,7 +2,7 @@ import { defaultConfig } from './default.mjs';
2
2
 
3
3
  const styleInputProps = {
4
4
  /**
5
- * 类型定义
5
+ * 引入组件
6
6
  */
7
7
  components: {
8
8
  default: () => {
@@ -10,6 +10,15 @@ const styleInputProps = {
10
10
  },
11
11
  type: Array
12
12
  },
13
+ /**
14
+ * 需要隐藏组件
15
+ */
16
+ hideComponents: {
17
+ default: () => {
18
+ return [];
19
+ },
20
+ type: Array
21
+ },
13
22
  modelValue: {
14
23
  default: () => {
15
24
  return {};
@@ -1 +1 @@
1
- {"version":3,"file":"props.mjs","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 modelValue: {\n default: () => {\n return {}\n },\n type: Object,\n },\n}\n\nexport type StyleInputProps = ExtractPropTypes<typeof styleInputProps>\n"],"names":[],"mappings":";;AAGO,MAAM,eAAkB,GAAA;AAAA;AAAA;AAAA;AAAA,EAI7B,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAO,OAAA,aAAA,CAAA;AAAA,KACT;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;;;;"}
1
+ {"version":3,"file":"props.mjs","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":[],"mappings":";;AAGO,MAAM,eAAkB,GAAA;AAAA;AAAA;AAAA;AAAA,EAI7B,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAO,OAAA,aAAA,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;
@@ -27,10 +27,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
27
27
  });
28
28
  emit("update:modelValue", obj);
29
29
  };
30
+ const _components = ref([]);
30
31
  const init = () => {
31
- const components = props.components;
32
+ _components.value = props.components.filter((item) => {
33
+ console.log("item.name", item.name);
34
+ return !props.hideComponents.includes(item.name);
35
+ });
32
36
  const obj = {};
33
- components.forEach((item) => {
37
+ _components.value.forEach((item) => {
34
38
  const params = item.params;
35
39
  const paramsObj = {};
36
40
  Object.keys(params).forEach((key) => {
@@ -69,7 +73,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
69
73
  (openBlock(true), createElementBlock(
70
74
  Fragment,
71
75
  null,
72
- renderList(props.components, (item, key) => {
76
+ renderList(_components.value, (item, key) => {
73
77
  return openBlock(), createBlock(_component_el_collapse_item, {
74
78
  key,
75
79
  title: "",
@@ -1 +1 @@
1
- {"version":3,"file":"style-input.vue2.mjs","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 props.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}\nconst init = () => {\n const components: any = props.components\n const obj: any = {}\n components.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 }\n)\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,cAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA6BD,IAAA,MAAM,WAAc,GAAA,GAAA,CAAI,CAAC,CAAC,CAAC,CAAA,CAAA;AAC3B,IAAM,MAAA,MAAA,GAAc,GAAI,CAAA,EAAE,CAAA,CAAA;AAC1B,IAAM,MAAA,OAAA,GAAU,IAAI,IAAI,CAAA,CAAA;AAGxB,IAAA,MAAM,WAAW,MAAM;AACrB,MAAA,MAAM,MAAW,EAAC,CAAA;AAClB,MAAA,MAAA,CAAO,KAAK,MAAO,CAAA,KAAK,CAAE,CAAA,OAAA,CAAQ,CAAC,GAAQ,KAAA;AACzC,QAAO,MAAA,CAAA,IAAA,CAAK,OAAO,KAAM,CAAA,GAAG,CAAC,CAAE,CAAA,OAAA,CAAQ,CAAC,CAAM,KAAA;AAC5C,UAAA,GAAA,CAAI,CAAC,CAAI,GAAA,MAAA,CAAO,KAAM,CAAA,GAAG,EAAE,CAAC,CAAA,CAAA;AAAA,SAC7B,CAAA,CAAA;AAAA,OACF,CAAA,CAAA;AACD,MAAA,IAAA,CAAK,qBAAqB,GAAG,CAAA,CAAA;AAAA,KAC/B,CAAA;AACA,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,MAAM,aAAkB,KAAM,CAAA,UAAA,CAAA;AAC9B,MAAA,MAAM,MAAW,EAAC,CAAA;AAClB,MAAW,UAAA,CAAA,OAAA,CAAQ,CAAC,IAAc,KAAA;AAChC,QAAA,MAAM,SAAS,IAAK,CAAA,MAAA,CAAA;AACpB,QAAA,MAAM,YAAiB,EAAC,CAAA;AACxB,QAAA,MAAA,CAAO,IAAK,CAAA,MAAM,CAAE,CAAA,OAAA,CAAQ,CAAC,GAAQ,KAAA;AACnC,UAAM,MAAA,KAAA,GAAQ,OAAO,GAAG,CAAA,CAAA;AACxB,UAAI,IAAA,KAAA,CAAM,UAAW,CAAA,KAAK,CAAG,EAAA;AAC3B,YAAA,SAAA,CAAU,KAAK,CAAA,GAAI,KAAM,CAAA,UAAA,CAAW,KAAK,CAAA,CAAA;AAAA,WAC3C;AAAA,SACD,CAAA,CAAA;AACD,QAAI,GAAA,CAAA,IAAA,CAAK,IAAI,CAAI,GAAA,SAAA,CAAA;AAAA,OAClB,CAAA,CAAA;AACD,MAAA,MAAA,CAAO,KAAQ,GAAA,GAAA,CAAA;AACf,MAAA,OAAA,CAAQ,KAAQ,GAAA,KAAA,CAAA;AAAA,KAClB,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,MAAM;AACJ,QAAK,IAAA,EAAA,CAAA;AAAA,OACP;AAAA,MACA;AAAA,QACE,IAAM,EAAA,IAAA;AAAA,OACR;AAAA,KACF,CAAA;AAEA,IAAA,SAAA,CAAU,MAAM;AACd,MAAK,IAAA,EAAA,CAAA;AAAA,KACN,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style-input.vue2.mjs","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 }\n)\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,cAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA6BD,IAAA,MAAM,WAAc,GAAA,GAAA,CAAI,CAAC,CAAC,CAAC,CAAA,CAAA;AAC3B,IAAM,MAAA,MAAA,GAAc,GAAI,CAAA,EAAE,CAAA,CAAA;AAC1B,IAAM,MAAA,OAAA,GAAU,IAAI,IAAI,CAAA,CAAA;AAGxB,IAAA,MAAM,WAAW,MAAM;AACrB,MAAA,MAAM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A,GAAI,KAAM,CAAA,UAAA,CAAW,KAAK,CAAA,CAAA;AAAA,WAC3C;AAAA,SACD,CAAA,CAAA;AACD,QAAI,GAAA,CAAA,IAAA,CAAK,IAAI,CAAI,GAAA,SAAA,CAAA;AAAA,OAClB,CAAA,CAAA;AACD,MAAA,MAAA,CAAO,KAAQ,GAAA,GAAA,CAAA;AACf,MAAA,OAAA,CAAQ,KAAQ,GAAA,KAAA,CAAA;AAAA,KAClB,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,MAAM;AACJ,QAAK,IAAA,EAAA,CAAA;AAAA,OACP;AAAA,MACA;AAAA,QACE,IAAM,EAAA,IAAA;AAAA,OACR;AAAA,KACF,CAAA;AAEA,IAAA,SAAA,CAAU,MAAM;AACd,MAAK,IAAA,EAAA,CAAA;AAAA,KACN,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,8 +4,8 @@ export declare const StyleBoxInput: import("@vipl520/utils").WithInstall<import(
4
4
  default: () => {};
5
5
  };
6
6
  height: {
7
- type: NumberConstructor;
8
- default: number;
7
+ type: (StringConstructor | NumberConstructor)[];
8
+ default: string;
9
9
  };
10
10
  help: {
11
11
  type: StringConstructor;
@@ -17,8 +17,8 @@ export declare const StyleBoxInput: import("@vipl520/utils").WithInstall<import(
17
17
  default: () => {};
18
18
  };
19
19
  height: {
20
- type: NumberConstructor;
21
- default: number;
20
+ type: (StringConstructor | NumberConstructor)[];
21
+ default: string;
22
22
  };
23
23
  help: {
24
24
  type: StringConstructor;
@@ -29,7 +29,7 @@ export declare const StyleBoxInput: import("@vipl520/utils").WithInstall<import(
29
29
  onChange?: ((...args: any[]) => any) | undefined;
30
30
  }, {
31
31
  modelValue: Record<string, any>;
32
- height: number;
32
+ height: string | number;
33
33
  help: string;
34
34
  }, {}>>;
35
35
  export default StyleBoxInput;
@@ -5,8 +5,8 @@ export declare const styleBoxInputProps: {
5
5
  default: () => {};
6
6
  };
7
7
  height: {
8
- type: NumberConstructor;
9
- default: number;
8
+ type: (StringConstructor | NumberConstructor)[];
9
+ default: string;
10
10
  };
11
11
  help: {
12
12
  type: StringConstructor;
@@ -6,8 +6,8 @@ const styleBoxInputProps = {
6
6
  default: () => ({})
7
7
  },
8
8
  height: {
9
- type: Number,
10
- default: 180
9
+ type: [Number, String],
10
+ default: "auto"
11
11
  },
12
12
  help: {
13
13
  type: String,
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../../src/style-box-input/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const styleBoxInputProps = {\n modelValue: {\n type: Object,\n default: () => ({}),\n },\n height: {\n type: Number,\n default: 180,\n },\n help: {\n type: String,\n default:\n '可以双击对应位置来配置内外边距和宽度高度,也支持通过描点拖拽增加,支持单位(px、rem、%、auto)',\n },\n}\n\nexport type StyleBoxInputProps = ExtractPropTypes<typeof styleBoxInputProps>\n"],"names":[],"mappings":";;AAEO,MAAM,kBAAqB,GAAA;AAAA,EAChC,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,GAAA;AAAA,GACX;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,MAAA;AAAA,IACN,OACE,EAAA,mQAAA;AAAA,GACJ;AACF;;;;"}
1
+ {"version":3,"file":"props.js","sources":["../../../src/style-box-input/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const styleBoxInputProps = {\n modelValue: {\n type: Object,\n default: () => ({}),\n },\n height: {\n type: [Number, String],\n default: 'auto',\n },\n help: {\n type: String,\n default: '可以双击对应位置来配置内外边距和宽度高度,也支持通过描点拖拽增加,支持单位(px、rem、%、auto)',\n },\n}\n\nexport type StyleBoxInputProps = ExtractPropTypes<typeof styleBoxInputProps>\n"],"names":[],"mappings":";;AAEO,MAAM,kBAAqB,GAAA;AAAA,EAChC,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,OAAS,EAAA,MAAA;AAAA,GACX;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,mQAAA;AAAA,GACX;AACF;;;;"}
@@ -4,8 +4,8 @@ declare const _default: import("vue").DefineComponent<{
4
4
  default: () => {};
5
5
  };
6
6
  height: {
7
- type: NumberConstructor;
8
- default: number;
7
+ type: (StringConstructor | NumberConstructor)[];
8
+ default: string;
9
9
  };
10
10
  help: {
11
11
  type: StringConstructor;
@@ -17,8 +17,8 @@ declare const _default: import("vue").DefineComponent<{
17
17
  default: () => {};
18
18
  };
19
19
  height: {
20
- type: NumberConstructor;
21
- default: number;
20
+ type: (StringConstructor | NumberConstructor)[];
21
+ default: string;
22
22
  };
23
23
  help: {
24
24
  type: StringConstructor;
@@ -29,7 +29,7 @@ declare const _default: import("vue").DefineComponent<{
29
29
  onChange?: ((...args: any[]) => any) | undefined;
30
30
  }, {
31
31
  modelValue: Record<string, any>;
32
- height: number;
32
+ height: string | number;
33
33
  help: string;
34
34
  }, {}>;
35
35
  export default _default;