@vipl520/dk-ui 1.0.20 → 1.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/dist/index.js +27 -41
  2. package/dist/index.min.js +7 -7
  3. package/dist/index.min.js.map +1 -1
  4. package/dist/index.min.mjs +6 -6
  5. package/dist/index.min.mjs.map +1 -1
  6. package/dist/index.mjs +27 -41
  7. package/dist/web-types.json +1 -1
  8. package/es/page-diy/src/config/rule/min/common/DkMinTitle.d.ts +1 -0
  9. package/es/page-diy/src/config/rule/min/common/DkMinTitle.mjs +2 -1
  10. package/es/page-diy/src/config/rule/min/common/DkMinTitle.mjs.map +1 -1
  11. package/es/page-diy/src/config/rule/min/common/index.d.ts +2 -0
  12. package/es/page-diy/src/config/rule/min/index.d.ts +2 -0
  13. package/es/style-number-input/index.d.ts +2 -1
  14. package/es/style-number-input/src/style-number-input.vue.d.ts +2 -1
  15. package/es/style-number-input/src/style-number-input.vue2.mjs +3 -2
  16. package/es/style-number-input/src/style-number-input.vue2.mjs.map +1 -1
  17. package/es/style-position-input/src/style-position-input.vue2.mjs +23 -39
  18. package/es/style-position-input/src/style-position-input.vue2.mjs.map +1 -1
  19. package/lib/page-diy/src/config/rule/min/common/DkMinTitle.d.ts +1 -0
  20. package/lib/page-diy/src/config/rule/min/common/DkMinTitle.js +2 -1
  21. package/lib/page-diy/src/config/rule/min/common/DkMinTitle.js.map +1 -1
  22. package/lib/page-diy/src/config/rule/min/common/index.d.ts +2 -0
  23. package/lib/page-diy/src/config/rule/min/index.d.ts +2 -0
  24. package/lib/style-number-input/index.d.ts +2 -1
  25. package/lib/style-number-input/src/style-number-input.vue.d.ts +2 -1
  26. package/lib/style-number-input/src/style-number-input.vue2.js +3 -2
  27. package/lib/style-number-input/src/style-number-input.vue2.js.map +1 -1
  28. package/lib/style-position-input/src/style-position-input.vue2.js +22 -38
  29. package/lib/style-position-input/src/style-position-input.vue2.js.map +1 -1
  30. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -16688,49 +16688,40 @@ var _sfc_main$G = /* @__PURE__ */ defineComponent({
16688
16688
  { label: "\u5DE6\u4E0A", value: "left-top" },
16689
16689
  { label: "\u5DE6\u4E0B", value: "left-down" },
16690
16690
  { label: "\u53F3\u4E0A", value: "right-top" },
16691
- { label: "\u53F3\u4E0B", value: "right-down" }
16691
+ { label: "\u53F3\u4E0B", value: "right-down" },
16692
+ { label: "\u4E0B\u5C45\u4E2D", value: "down-center" },
16693
+ { label: "\u4E0A\u5C45\u4E2D", value: "up-center" }
16692
16694
  ];
16695
+ const change = ref(false);
16693
16696
  const positionChange = (value) => {
16697
+ change.value = true;
16694
16698
  switch (value) {
16695
16699
  case "left-top":
16696
- form.value = {
16697
- left: "1px",
16698
- top: "0px",
16699
- right: "",
16700
- bottom: ""
16701
- };
16700
+ form.value = { left: "1px", top: "1px", right: "", bottom: "" };
16702
16701
  break;
16703
16702
  case "left-down":
16704
- form.value = {
16705
- left: "0px",
16706
- top: "",
16707
- right: "",
16708
- bottom: "0px"
16709
- };
16703
+ form.value = { left: "1px", bottom: "1px", right: "", up: "" };
16710
16704
  break;
16711
16705
  case "right-top":
16712
- form.value = {
16713
- left: "",
16714
- top: "0px",
16715
- right: "0px",
16716
- bottom: ""
16717
- };
16706
+ form.value = { top: "1px", right: "1px", left: "", bottom: "" };
16718
16707
  break;
16719
16708
  case "right-down":
16720
- form.value = {
16721
- left: "",
16722
- top: "",
16723
- right: "0px",
16724
- bottom: "0px"
16725
- };
16709
+ form.value = { right: "1px", bottom: "1px", left: "", up: "" };
16710
+ break;
16711
+ case "down-center":
16712
+ form.value = { left: "1px", right: "1px", bottom: "1px", up: "" };
16713
+ break;
16714
+ case "up-center":
16715
+ form.value = { left: "1px", top: "1px", right: "1px", bottom: "" };
16726
16716
  break;
16727
16717
  }
16728
- emitValue();
16729
16718
  };
16730
16719
  const emitValue = () => {
16731
16720
  const data = Object.keys(form.value).reduce((prev, cur) => {
16732
- if (form.value[cur] && cur !== "position") {
16733
- prev[cur] = form.value[cur];
16721
+ if (change.value && form.value[cur] != "0px" || !change.value && cur !== "position") {
16722
+ if (form.value[cur]) {
16723
+ prev[cur] = form.value[cur];
16724
+ }
16734
16725
  }
16735
16726
  return prev;
16736
16727
  }, {});
@@ -16807,15 +16798,7 @@ var _sfc_main$G = /* @__PURE__ */ defineComponent({
16807
16798
  ]),
16808
16799
  _: 1
16809
16800
  /* STABLE */
16810
- }),
16811
- createCommentVNode(' <el-select v-model="form.position" placeholder="Select">'),
16812
- createCommentVNode(" <el-option"),
16813
- createCommentVNode(' v-for="item in positions"'),
16814
- createCommentVNode(' :key="item.value"'),
16815
- createCommentVNode(' :label="item.label"'),
16816
- createCommentVNode(' :value="item.value"'),
16817
- createCommentVNode(" />"),
16818
- createCommentVNode(" </el-select>")
16801
+ })
16819
16802
  ]),
16820
16803
  _: 1
16821
16804
  /* STABLE */
@@ -16857,7 +16840,8 @@ var _sfc_main$G = /* @__PURE__ */ defineComponent({
16857
16840
  default: withCtx(() => [
16858
16841
  createVNode(_component_dk_style_number_input, {
16859
16842
  modelValue: form.value[item.value],
16860
- "onUpdate:modelValue": ($event) => form.value[item.value] = $event
16843
+ "onUpdate:modelValue": ($event) => form.value[item.value] = $event,
16844
+ onInput: _cache[0] || (_cache[0] = ($event) => change.value = false)
16861
16845
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
16862
16846
  ]),
16863
16847
  _: 2
@@ -16932,7 +16916,7 @@ const __default__$f = defineComponent({
16932
16916
  var _sfc_main$F = /* @__PURE__ */ defineComponent({
16933
16917
  ...__default__$f,
16934
16918
  props: styleNumberInputProps,
16935
- emits: ["update:modelValue"],
16919
+ emits: ["input", "update:modelValue"],
16936
16920
  setup(__props, { emit }) {
16937
16921
  const props = __props;
16938
16922
  const values = splitUnit(props.modelValue, props.units);
@@ -17014,7 +16998,8 @@ var _sfc_main$F = /* @__PURE__ */ defineComponent({
17014
16998
  modelValue: form.number,
17015
16999
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.number = $event),
17016
17000
  type: "text",
17017
- controls: false
17001
+ controls: false,
17002
+ onInput: _cache[2] || (_cache[2] = ($event) => emit("input", $event))
17018
17003
  }, createSlots({
17019
17004
  prefix: withCtx(() => [
17020
17005
  createElementVNode(
@@ -20776,7 +20761,8 @@ var DkMinTitle$1 = {
20776
20761
  title: "\u4E3B\u6807\u9898",
20777
20762
  subtitle: "\u526F\u6807\u9898"
20778
20763
  },
20779
- showStyle: true
20764
+ showStyle: true,
20765
+ fixed: true
20780
20766
  };
20781
20767
  },
20782
20768
  props() {
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json.schemastore.org/web-types",
3
3
  "framework": "vue",
4
4
  "name": "dk",
5
- "version": "1.0.19",
5
+ "version": "1.0.21",
6
6
  "js-types-syntax": "typescript",
7
7
  "description-markup": "markdown",
8
8
  "contributions": {
@@ -9,6 +9,7 @@ declare namespace _default {
9
9
  subtitle: string;
10
10
  };
11
11
  showStyle: boolean;
12
+ fixed: boolean;
12
13
  };
13
14
  export function props(): {
14
15
  type: string;
@@ -11,7 +11,8 @@ var DkMinTitle = {
11
11
  title: "\u4E3B\u6807\u9898",
12
12
  subtitle: "\u526F\u6807\u9898"
13
13
  },
14
- showStyle: true
14
+ showStyle: true,
15
+ fixed: true
15
16
  };
16
17
  },
17
18
  props() {
@@ -1 +1 @@
1
- {"version":3,"file":"DkMinTitle.mjs","sources":["../../../../../../../src/page-diy/src/config/rule/min/common/DkMinTitle.js"],"sourcesContent":["const label = '标题'\nconst name = 'DkMinTitle'\n\nexport default {\n icon: 'material-symbols:title',\n label,\n name,\n rule() {\n return {\n type: name,\n props: {\n title: '主标题',\n subtitle: '副标题',\n },\n showStyle: true,\n }\n },\n props() {\n return [\n {\n type: 'radio',\n field: 'type',\n title: '类型',\n value: '0',\n options: [\n { label: '默认', value: '0' },\n { label: '副标题', value: '1' },\n ],\n control: [\n {\n value: '0',\n rule: [\n { type: 'input', field: 'title', title: '标题', value: '主标题' },\n {\n type: 'radio',\n field: 'align',\n title: '位置',\n value: 'left',\n options: [\n { label: '居左', value: 'left' },\n { label: '居中', value: 'center' },\n ],\n },\n { type: 'DkColorInput', field: 'color', title: '标题色', value: '#000' },\n ],\n },\n {\n value: '1',\n rule: [\n { type: 'input', field: 'title', title: '标题', value: '主标题' },\n { type: 'DkColorInput', field: 'color', title: '标题色', value: '#000' },\n { type: 'input', field: 'subtitle', title: '副标题', value: '' },\n { type: 'DkColorInput', field: 'subColor', title: '副标题色', value: '#999' },\n {\n type: 'switch',\n field: 'isMore',\n title: '显示更多',\n value: true,\n control: [\n {\n value: true,\n rule: [\n { type: 'input', field: 'moreText', title: '文本内容', value: '查看更多' },\n { type: 'input', field: 'url', title: '链接地址', value: '' },\n { type: 'DkColorInput', field: 'moreColor', title: '颜色', value: '#999' },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ]\n },\n}\n"],"names":[],"mappings":"AAAA,MAAM,KAAQ,GAAA,cAAA,CAAA;AACd,MAAM,IAAO,GAAA,YAAA,CAAA;AAEb,iBAAe;AAAA,EACb,IAAM,EAAA,wBAAA;AAAA,EACN,KAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAO,GAAA;AACL,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,IAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,oBAAA;AAAA,QACP,QAAU,EAAA,oBAAA;AAAA,OACZ;AAAA,MACA,SAAW,EAAA,IAAA;AAAA,KACb,CAAA;AAAA,GACF;AAAA,EACA,KAAQ,GAAA;AACN,IAAO,OAAA;AAAA,MACL;AAAA,QACE,IAAM,EAAA,OAAA;AAAA,QACN,KAAO,EAAA,MAAA;AAAA,QACP,KAAO,EAAA,cAAA;AAAA,QACP,KAAO,EAAA,GAAA;AAAA,QACP,OAAS,EAAA;AAAA,UACP,EAAE,KAAA,EAAO,cAAM,EAAA,KAAA,EAAO,GAAI,EAAA;AAAA,UAC1B,EAAE,KAAA,EAAO,oBAAO,EAAA,KAAA,EAAO,GA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A;AAAA,gBACP,OAAS,EAAA;AAAA,kBACP;AAAA,oBACE,KAAO,EAAA,IAAA;AAAA,oBACP,IAAM,EAAA;AAAA,sBACJ,EAAE,MAAM,OAAS,EAAA,KAAA,EAAO,YAAY,KAAO,EAAA,0BAAA,EAAQ,OAAO,0BAAO,EAAA;AAAA,sBACjE,EAAE,MAAM,OAAS,EAAA,KAAA,EAAO,OAAO,KAAO,EAAA,0BAAA,EAAQ,OAAO,EAAG,EAAA;AAAA,sBACxD,EAAE,MAAM,cAAgB,EAAA,KAAA,EAAO,aAAa,KAAO,EAAA,cAAA,EAAM,OAAO,MAAO,EAAA;AAAA,qBACzE;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"DkMinTitle.mjs","sources":["../../../../../../../src/page-diy/src/config/rule/min/common/DkMinTitle.js"],"sourcesContent":["const label = '标题'\nconst name = 'DkMinTitle'\n\nexport default {\n icon: 'material-symbols:title',\n label,\n name,\n rule() {\n return {\n type: name,\n props: {\n title: '主标题',\n subtitle: '副标题',\n },\n showStyle: true,\n fixed: true,\n }\n },\n props() {\n return [\n {\n type: 'radio',\n field: 'type',\n title: '类型',\n value: '0',\n options: [\n { label: '默认', value: '0' },\n { label: '副标题', value: '1' },\n ],\n control: [\n {\n value: '0',\n rule: [\n { type: 'input', field: 'title', title: '标题', value: '主标题' },\n {\n type: 'radio',\n field: 'align',\n title: '位置',\n value: 'left',\n options: [\n { label: '居左', value: 'left' },\n { label: '居中', value: 'center' },\n ],\n },\n { type: 'DkColorInput', field: 'color', title: '标题色', value: '#000' },\n ],\n },\n {\n value: '1',\n rule: [\n { type: 'input', field: 'title', title: '标题', value: '主标题' },\n { type: 'DkColorInput', field: 'color', title: '标题色', value: '#000' },\n { type: 'input', field: 'subtitle', title: '副标题', value: '' },\n { type: 'DkColorInput', field: 'subColor', title: '副标题色', value: '#999' },\n {\n type: 'switch',\n field: 'isMore',\n title: '显示更多',\n value: true,\n control: [\n {\n value: true,\n rule: [\n { type: 'input', field: 'moreText', title: '文本内容', value: '查看更多' },\n { type: 'input', field: 'url', title: '链接地址', value: '' },\n { type: 'DkColorInput', field: 'moreColor', title: '颜色', value: '#999' },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ]\n },\n}\n"],"names":[],"mappings":"AAAA,MAAM,KAAQ,GAAA,cAAA,CAAA;AACd,MAAM,IAAO,GAAA,YAAA,CAAA;AAEb,iBAAe;AAAA,EACb,IAAM,EAAA,wBAAA;AAAA,EACN,KAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAO,GAAA;AACL,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,IAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,oBAAA;AAAA,QACP,QAAU,EAAA,oBAAA;AAAA,OACZ;AAAA,MACA,SAAW,EAAA,IAAA;AAAA,MACX,KAAO,EAAA,IAAA;AAAA,KACT,CAAA;AAAA,GACF;AAAA,EACA,KAAQ,GAAA;AACN,IAAO,OAAA;AAAA,MACL;AAAA,QACE,IAAM,EAAA,OAAA;AAAA,QACN,KAAO,EAAA,MAAA;AAAA,QACP,KAAO,EAAA,cAAA;AAAA,QACP,KAAO,EAAA,GAAA;AAAA,QACP,OAAS,EAAA;AAAA,UACP,EAAE,KAAA,EAAO,cAAM,EAAA,KAAA,EAAO,GAAI,EAAA;AAAA,UAC1B,EAAE,KAAA,EAAO,oBAAO,EAAA,KAAA,EAAO,GAAI,EAAA;AAAA,SAC7B;AAAA,QACA,OAAS,EAAA;AAAA,UACP;AAAA,YACE,KAAO,EAAA,GAAA;AAAA,YACP,IAAM,EAAA;AAAA,cACJ,EAAE,MAAM,OAAS,EAAA,KAAA,EAAO,SAAS,KAAO,EAAA,cAAA,EAAM,OAAO,oBAAM,EAAA;AAAA,cAC3D;AAAA,gBACE,IAAM,EAAA,OAAA;A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AAO,EAAA,0BAAA,EAAQ,OAAO,EAAG,EAAA;AAAA,sBACxD,EAAE,MAAM,cAAgB,EAAA,KAAA,EAAO,aAAa,KAAO,EAAA,cAAA,EAAM,OAAO,MAAO,EAAA;AAAA,qBACzE;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAA;;;;"}
@@ -171,6 +171,7 @@ export const commonMenu: ({
171
171
  subtitle: string;
172
172
  };
173
173
  showStyle: boolean;
174
+ fixed: boolean;
174
175
  };
175
176
  props(): {
176
177
  type: string;
@@ -482,6 +483,7 @@ export const commonRuleList: {
482
483
  subtitle: string;
483
484
  };
484
485
  showStyle: boolean;
486
+ fixed: boolean;
485
487
  };
486
488
  props(): {
487
489
  type: string;
@@ -172,6 +172,7 @@ export const minRuleList: {
172
172
  subtitle: string;
173
173
  };
174
174
  showStyle: boolean;
175
+ fixed: boolean;
175
176
  };
176
177
  props(): {
177
178
  type: string;
@@ -486,6 +487,7 @@ export function createMinMenu(): {
486
487
  subtitle: string;
487
488
  };
488
489
  showStyle: boolean;
490
+ fixed: boolean;
489
491
  };
490
492
  props(): {
491
493
  type: string;
@@ -23,7 +23,7 @@ export declare const StyleNumberInput: import("@vipl520/utils").WithInstall<impo
23
23
  default: string;
24
24
  type: StringConstructor;
25
25
  };
26
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue")[], "input" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
27
  modelValue: {
28
28
  default: string;
29
29
  type: StringConstructor;
@@ -49,6 +49,7 @@ export declare const StyleNumberInput: import("@vipl520/utils").WithInstall<impo
49
49
  type: StringConstructor;
50
50
  };
51
51
  }>> & {
52
+ onInput?: ((...args: any[]) => any) | undefined;
52
53
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
53
54
  }, {
54
55
  modelValue: string;
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
23
23
  default: string;
24
24
  type: StringConstructor;
25
25
  };
26
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue")[], "input" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
27
  modelValue: {
28
28
  default: string;
29
29
  type: StringConstructor;
@@ -49,6 +49,7 @@ declare const _default: import("vue").DefineComponent<{
49
49
  type: StringConstructor;
50
50
  };
51
51
  }>> & {
52
+ onInput?: ((...args: any[]) => any) | undefined;
52
53
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
53
54
  }, {
54
55
  modelValue: string;
@@ -8,7 +8,7 @@ const __default__ = defineComponent({
8
8
  var _sfc_main = /* @__PURE__ */ defineComponent({
9
9
  ...__default__,
10
10
  props: styleNumberInputProps,
11
- emits: ["update:modelValue"],
11
+ emits: ["input", "update:modelValue"],
12
12
  setup(__props, { emit }) {
13
13
  const props = __props;
14
14
  const values = splitUnit(props.modelValue, props.units);
@@ -90,7 +90,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
90
90
  modelValue: form.number,
91
91
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.number = $event),
92
92
  type: "text",
93
- controls: false
93
+ controls: false,
94
+ onInput: _cache[2] || (_cache[2] = ($event) => emit("input", $event))
94
95
  }, createSlots({
95
96
  prefix: withCtx(() => [
96
97
  createElementVNode(
@@ -1 +1 @@
1
- {"version":3,"file":"style-number-input.vue2.mjs","sources":["../../../src/style-number-input/src/style-number-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleNumberInput',\n});\n</script>\n<template>\n <div :class=\"['dk-style-number-input', props.direction]\">\n <el-input v-model=\"form.number\" type=\"text\" :controls=\"false\">\n <template #prefix>\n <span\n class=\"w-resize\"\n :class=\"[`${props.direction}-resize`]\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown\"\n @mouseup=\"handleMouseUp\"\n >\n <el-tooltip\n class=\"item\"\n effect=\"dark\"\n :disabled=\"!props.tooltipContent\"\n :content=\"props.tooltipContent\"\n placement=\"top\"\n :open-delay=\"500\"\n >\n <dk-icon :icon=\"props.icon || 'Rank'\"></dk-icon>\n </el-tooltip>\n </span>\n </template>\n <template v-if=\"showUnit\" #append>\n <el-select v-model=\"form.unit\" style=\"width: 40px\" suffix-icon=\"\">\n <el-option v-for=\"(item, index) in units\" :key=\"index\" :label=\"item\" :value=\"item\" />\n </el-select>\n </template>\n </el-input>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { styleNumberInputProps } from './props'\nimport { reactive, ref, watch } from 'vue'\nimport { splitUnit } from '@vipl520/utils'\n\n\nconst props = defineProps(styleNumberInputProps)\nconst values = splitUnit(props.modelValue, props.units)\nconst form: any = reactive({\n number: values.number,\n unit: values.unit || 'px',\n})\n\nconst isDragging = ref(false)\nconst trackMouseBound: any = ref(null)\nconst stopChangeBound: any = ref(null)\nconst startY = ref(0) // 开始的Y坐标\nconst startX = ref(0) // 开始的X坐标\nconst handleMouseDown = (event: any) => {\n isDragging.value = true\n startX.value = event.clientX\n startY.value = event.clientY\n trackMouseBound.value = handleMouseMove.bind(event)\n stopChangeBound.value = handleMouseUp.bind(event)\n document.addEventListener('mousemove', trackMouseBound.value)\n document.addEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'ew-resize'\n}\n\nconst handleMouseMove = (event: any) => {\n if (isDragging.value) {\n let increment\n if (props.direction === 'horizontal') {\n const dx = event.clientX - startX.value\n increment = Math.floor(dx / 10)\n startX.value += increment * 10\n } else if (props.direction === 'vertical') {\n const dy = event.clientY - startY.value\n increment = Math.floor(dy / 10)\n startY.value += increment * 10\n }\n form.number = parseInt(form.number + increment)\n }\n}\n\nconst handleMouseUp = () => {\n console.log('up')\n document.removeEventListener('mousemove', trackMouseBound.value)\n document.removeEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'default'\n isDragging.value = false\n}\nconst emit = defineEmits(['update:modelValue'])\n\nwatch(\n () => form,\n () => {\n if (form.number === '') {\n emit('update:modelValue', '')\n } else {\n emit('update:modelValue', form.number + form.unit)\n }\n },\n {\n deep: true,\n }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n const values = splitUnit(props.modelValue, props.units)\n form.number = values.number\n form.unit = values.unit || 'px'\n }\n)\n</script>\n"],"names":["__MACROS_defineComponent","values"],"mappings":";;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,oBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAyCD,IAAA,MAAM,MAAS,GAAA,SAAA,CAAU,KAAM,CAAA,UAAA,EAAY,MAAM,KAAK,CAAA,CAAA;AACtD,IAAA,MAAM,OAAY,QAAS,CAAA;AAAA,MACzB,QAAQ,MAAO,CAAA,MAAA;AAAA,MACf,IAAA,EAAM,OAAO,IAAQ,IAAA,IAAA;AAAA,KACtB,CAAA,CAAA;AAED,IAAM,MAAA,UAAA,GAAa,IAAI,KAAK,CAAA,CAAA;AAC5B,IAAM,MAAA,eAAA,GAAuB,IAAI,IAAI,CAAA,CAAA;AACrC,IAAM,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AAA,IAAA,CAAK,SAASA,OAAO,CAAA,MAAA,CAAA;AACrB,QAAK,IAAA,CAAA,IAAA,GAAOA,QAAO,IAAQ,IAAA,IAAA,CAAA;AAAA,OAC7B;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style-number-input.vue2.mjs","sources":["../../../src/style-number-input/src/style-number-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleNumberInput',\n});\n</script>\n<template>\n <div :class=\"['dk-style-number-input', props.direction]\">\n <el-input v-model=\"form.number\" type=\"text\" :controls=\"false\" @input=\"emit('input', $event)\">\n <template #prefix>\n <span\n class=\"w-resize\"\n :class=\"[`${props.direction}-resize`]\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown\"\n @mouseup=\"handleMouseUp\"\n >\n <el-tooltip\n class=\"item\"\n effect=\"dark\"\n :disabled=\"!props.tooltipContent\"\n :content=\"props.tooltipContent\"\n placement=\"top\"\n :open-delay=\"500\"\n >\n <dk-icon :icon=\"props.icon || 'Rank'\"></dk-icon>\n </el-tooltip>\n </span>\n </template>\n <template v-if=\"showUnit\" #append>\n <el-select v-model=\"form.unit\" style=\"width: 40px\" suffix-icon=\"\">\n <el-option v-for=\"(item, index) in units\" :key=\"index\" :label=\"item\" :value=\"item\" />\n </el-select>\n </template>\n </el-input>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { styleNumberInputProps } from './props'\nimport { reactive, ref, watch } from 'vue'\nimport { splitUnit } from '@vipl520/utils'\n\n\nconst props = defineProps(styleNumberInputProps)\nconst values = splitUnit(props.modelValue, props.units)\nconst form: any = reactive({\n number: values.number,\n unit: values.unit || 'px',\n})\n\nconst isDragging = ref(false)\nconst trackMouseBound: any = ref(null)\nconst stopChangeBound: any = ref(null)\nconst startY = ref(0) // 开始的Y坐标\nconst startX = ref(0) // 开始的X坐标\nconst handleMouseDown = (event: any) => {\n isDragging.value = true\n startX.value = event.clientX\n startY.value = event.clientY\n trackMouseBound.value = handleMouseMove.bind(event)\n stopChangeBound.value = handleMouseUp.bind(event)\n document.addEventListener('mousemove', trackMouseBound.value)\n document.addEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'ew-resize'\n}\n\nconst handleMouseMove = (event: any) => {\n if (isDragging.value) {\n let increment\n if (props.direction === 'horizontal') {\n const dx = event.clientX - startX.value\n increment = Math.floor(dx / 10)\n startX.value += increment * 10\n } else if (props.direction === 'vertical') {\n const dy = event.clientY - startY.value\n increment = Math.floor(dy / 10)\n startY.value += increment * 10\n }\n form.number = parseInt(form.number + increment)\n }\n}\n\nconst handleMouseUp = () => {\n console.log('up')\n document.removeEventListener('mousemove', trackMouseBound.value)\n document.removeEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'default'\n isDragging.value = false\n}\nconst emit = defineEmits(['input', 'update:modelValue'])\n\nwatch(\n () => form,\n () => {\n if (form.number === '') {\n emit('update:modelValue', '')\n } else {\n emit('update:modelValue', form.number + form.unit)\n }\n },\n {\n deep: true,\n }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n const values = splitUnit(props.modelValue, props.units)\n form.number = values.number\n form.unit = values.unit || 'px'\n }\n)\n</script>\n"],"names":["__MACROS_defineComponent","values"],"mappings":";;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,oBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAyCD,IAAA,MAAM,MAAS,GAAA,SAAA,CAAU,KAAM,CAAA,UAAA,EAAY,MAAM,KAAK,CAAA,CAAA;AACtD,IAAA,MAAM,OAAY,QAAS,CAAA;AAAA,MACzB,QAAQ,MAAO,CAAA,MAAA;AAAA,MACf,IAAA,EAAM,OAAO,IA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AAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,MAAM;AACJ,QAAA,MAAMC,OAAS,GAAA,SAAA,CAAU,KAAM,CAAA,UAAA,EAAY,MAAM,KAAK,CAAA,CAAA;AACtD,QAAA,IAAA,CAAK,SAASA,OAAO,CAAA,MAAA,CAAA;AACrB,QAAK,IAAA,CAAA,IAAA,GAAOA,QAAO,IAAQ,IAAA,IAAA,CAAA;AAAA,OAC7B;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, Fragment, renderList, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle } from 'vue';
1
+ import { defineComponent, ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, Fragment, renderList, createTextVNode, toDisplayString, normalizeStyle } from 'vue';
2
2
  import { stylePositionInputProps } from './props.mjs';
3
3
  import { useElementSize } from '@vueuse/core';
4
4
 
@@ -40,49 +40,40 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
40
40
  { label: "\u5DE6\u4E0A", value: "left-top" },
41
41
  { label: "\u5DE6\u4E0B", value: "left-down" },
42
42
  { label: "\u53F3\u4E0A", value: "right-top" },
43
- { label: "\u53F3\u4E0B", value: "right-down" }
43
+ { label: "\u53F3\u4E0B", value: "right-down" },
44
+ { label: "\u4E0B\u5C45\u4E2D", value: "down-center" },
45
+ { label: "\u4E0A\u5C45\u4E2D", value: "up-center" }
44
46
  ];
47
+ const change = ref(false);
45
48
  const positionChange = (value) => {
49
+ change.value = true;
46
50
  switch (value) {
47
51
  case "left-top":
48
- form.value = {
49
- left: "1px",
50
- top: "0px",
51
- right: "",
52
- bottom: ""
53
- };
52
+ form.value = { left: "1px", top: "1px", right: "", bottom: "" };
54
53
  break;
55
54
  case "left-down":
56
- form.value = {
57
- left: "0px",
58
- top: "",
59
- right: "",
60
- bottom: "0px"
61
- };
55
+ form.value = { left: "1px", bottom: "1px", right: "", up: "" };
62
56
  break;
63
57
  case "right-top":
64
- form.value = {
65
- left: "",
66
- top: "0px",
67
- right: "0px",
68
- bottom: ""
69
- };
58
+ form.value = { top: "1px", right: "1px", left: "", bottom: "" };
70
59
  break;
71
60
  case "right-down":
72
- form.value = {
73
- left: "",
74
- top: "",
75
- right: "0px",
76
- bottom: "0px"
77
- };
61
+ form.value = { right: "1px", bottom: "1px", left: "", up: "" };
62
+ break;
63
+ case "down-center":
64
+ form.value = { left: "1px", right: "1px", bottom: "1px", up: "" };
65
+ break;
66
+ case "up-center":
67
+ form.value = { left: "1px", top: "1px", right: "1px", bottom: "" };
78
68
  break;
79
69
  }
80
- emitValue();
81
70
  };
82
71
  const emitValue = () => {
83
72
  const data = Object.keys(form.value).reduce((prev, cur) => {
84
- if (form.value[cur] && cur !== "position") {
85
- prev[cur] = form.value[cur];
73
+ if (change.value && form.value[cur] != "0px" || !change.value && cur !== "position") {
74
+ if (form.value[cur]) {
75
+ prev[cur] = form.value[cur];
76
+ }
86
77
  }
87
78
  return prev;
88
79
  }, {});
@@ -159,15 +150,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
159
150
  ]),
160
151
  _: 1
161
152
  /* STABLE */
162
- }),
163
- createCommentVNode(' <el-select v-model="form.position" placeholder="Select">'),
164
- createCommentVNode(" <el-option"),
165
- createCommentVNode(' v-for="item in positions"'),
166
- createCommentVNode(' :key="item.value"'),
167
- createCommentVNode(' :label="item.label"'),
168
- createCommentVNode(' :value="item.value"'),
169
- createCommentVNode(" />"),
170
- createCommentVNode(" </el-select>")
153
+ })
171
154
  ]),
172
155
  _: 1
173
156
  /* STABLE */
@@ -209,7 +192,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
209
192
  default: withCtx(() => [
210
193
  createVNode(_component_dk_style_number_input, {
211
194
  modelValue: form.value[item.value],
212
- "onUpdate:modelValue": ($event) => form.value[item.value] = $event
195
+ "onUpdate:modelValue": ($event) => form.value[item.value] = $event,
196
+ onInput: _cache[0] || (_cache[0] = ($event) => change.value = false)
213
197
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
214
198
  ]),
215
199
  _: 2
@@ -1 +1 @@
1
- {"version":3,"file":"style-position-input.vue2.mjs","sources":["../../../src/style-position-input/src/style-position-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStylePositionInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-style-position-input\">\n <el-form label-width=\"50px\" label-position=\"left\">\n <div>\n <el-form-item label=\"常用\">\n <el-radio-group @change=\"positionChange\">\n <el-radio-button v-for=\"(item, key) in positions\" :key=\"key\" :label=\"item.value\">\n {{ item.label }}\n </el-radio-button>\n </el-radio-group>\n <!-- <el-select v-model=\"form.position\" placeholder=\"Select\">-->\n <!-- <el-option-->\n <!-- v-for=\"item in positions\"-->\n <!-- :key=\"item.value\"-->\n <!-- :label=\"item.label\"-->\n <!-- :value=\"item.value\"-->\n <!-- />-->\n <!-- </el-select>-->\n </el-form-item>\n </div>\n <div class=\"m-t-10px\">\n <el-row :gutter=\"20\">\n <el-col v-for=\"(item, key) in custom\" :key=\"key\" :span=\"span\" class=\"m-b-5px\">\n <el-form-item :label=\"item.label\">\n <template #label>\n <el-tooltip class=\"item\" effect=\"dark\" :content=\"item.tip\" placement=\"top\">\n <span\n style=\"cursor: pointer\"\n :style=\"form[item.value] ? 'color:var(--el-color-primary)' : ''\"\n @click=\"form[item.value] = ''\"\n >\n {{ item.label }}:</span\n >\n </el-tooltip>\n </template>\n <dk-style-number-input v-model=\"form[item.value]\"></dk-style-number-input>\n </el-form-item>\n </el-col>\n </el-row>\n </div>\n </el-form>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { stylePositionInputProps } from './props'\nimport { computed, ref, watch } from 'vue'\nimport { useElementSize } from '@vueuse/core'\n\nconst el: any = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\n\nconst span = computed(() => {\n if (width.value <= 300) {\n return 24\n } else if (width.value < 800) {\n return 12\n } else {\n return 6\n }\n})\n\n\n\nconst props = defineProps(stylePositionInputProps)\n\nconst form: any = ref({\n left: props.modelValue.left || '',\n top: props.modelValue.top || '',\n right: props.modelValue.right || '',\n bottom: props.modelValue.bottom || '',\n})\n\nconst custom = [\n { label: '上', value: 'top', tip: '当前距离顶部距离,点击清除' },\n { label: '右', value: 'right', tip: '当前距离右侧的距离,点击清除' },\n { label: '下', value: 'bottom', tip: '当前距离底部的距离,点击清除' },\n { label: '左', value: 'left', tip: '当前距离左侧的距离,点击清除' },\n]\n\nconst positions = [\n { label: '左上', value: 'left-top' },\n { label: '左下', value: 'left-down' },\n { label: '右上', value: 'right-top' },\n { label: '右下', value: 'right-down' },\n]\nconst emit = defineEmits(['update:modelValue'])\nconst positionChange = (value: string) => {\n switch (value) {\n case 'left-top':\n form.value = {\n left: '1px',\n top: '0px',\n right: '',\n bottom: '',\n }\n break\n case 'left-down':\n form.value = {\n left: '0px',\n top: '',\n right: '',\n bottom: '0px',\n }\n break\n case 'right-top':\n form.value = {\n left: '',\n top: '0px',\n right: '0px',\n bottom: '',\n }\n break\n case 'right-down':\n form.value = {\n left: '',\n top: '',\n right: '0px',\n bottom: '0px',\n }\n break\n }\n emitValue()\n}\nconst emitValue = () => {\n // 只保留form中有的值,并移除position\n const data = Object.keys(form.value).reduce((prev: any, cur) => {\n if (form.value[cur] && cur !== 'position') {\n prev[cur] = form.value[cur]\n }\n return prev\n }, {})\n emit('update:modelValue', data)\n}\nwatch(\n () => form.value,\n () => {\n emitValue()\n },\n { deep: true }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n Object.keys(props.modelValue).reduce((prev: any, cur) => {\n if (cur !== 'position') {\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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style-position-input.vue2.mjs","sources":["../../../src/style-position-input/src/style-position-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStylePositionInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-style-position-input\">\n <el-form label-width=\"50px\" label-position=\"left\">\n <div>\n <el-form-item label=\"常用\">\n <el-radio-group @change=\"positionChange\">\n <el-radio-button v-for=\"(item, key) in positions\" :key=\"key\" :label=\"item.value\">\n {{ item.label }}\n </el-radio-button>\n </el-radio-group>\n </el-form-item>\n </div>\n <div class=\"m-t-10px\">\n <el-row :gutter=\"20\">\n <el-col v-for=\"(item, key) in custom\" :key=\"key\" :span=\"span\" class=\"m-b-5px\">\n <el-form-item :label=\"item.label\">\n <template #label>\n <el-tooltip class=\"item\" effect=\"dark\" :content=\"item.tip\" placement=\"top\">\n <span\n style=\"cursor: pointer\"\n :style=\"form[item.value] ? 'color:var(--el-color-primary)' : ''\"\n @click=\"form[item.value] = ''\"\n >\n {{ item.label }}:</span\n >\n </el-tooltip>\n </template>\n <dk-style-number-input v-model=\"form[item.value]\" @input=\"change = false\"></dk-style-number-input>\n </el-form-item>\n </el-col>\n </el-row>\n </div>\n </el-form>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { stylePositionInputProps } from './props'\nimport { computed, ref, watch } from 'vue'\nimport { useElementSize } from '@vueuse/core'\n\nconst el: any = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\n\nconst span = computed(() => {\n if (width.value <= 300) {\n return 24\n } else if (width.value < 800) {\n return 12\n } else {\n return 6\n }\n})\n\n\n\nconst props = defineProps(stylePositionInputProps)\n\nconst form: any = ref({\n left: props.modelValue.left || '',\n top: props.modelValue.top || '',\n right: props.modelValue.right || '',\n bottom: props.modelValue.bottom || '',\n})\n\nconst custom = [\n { label: '上', value: 'top', tip: '当前距离顶部距离,点击清除' },\n { label: '右', value: 'right', tip: '当前距离右侧的距离,点击清除' },\n { label: '下', value: 'bottom', tip: '当前距离底部的距离,点击清除' },\n { label: '左', value: 'left', tip: '当前距离左侧的距离,点击清除' },\n]\n\nconst positions = [\n { label: '左上', value: 'left-top' },\n { label: '左下', value: 'left-down' },\n { label: '右上', value: 'right-top' },\n { label: '右下', value: 'right-down' },\n { label: '下居中', value: 'down-center' },\n { label: '上居中', value: 'up-center' },\n]\nconst emit = defineEmits(['update:modelValue'])\n\nconst change = ref(false)\n\nconst positionChange = (value: string) => {\n change.value = true\n switch (value) {\n case 'left-top':\n form.value = { left: '1px', top: '1px', right: '', bottom: '' }\n break\n case 'left-down':\n form.value = { left: '1px', bottom: '1px', right: '', up: '' }\n break\n case 'right-top':\n form.value = { top: '1px', right: '1px', left: '', bottom: '' }\n break\n case 'right-down':\n form.value = { right: '1px', bottom: '1px', left: '', up: '' }\n break\n case 'down-center':\n form.value = { left: '1px', right: '1px', bottom: '1px', up: '' }\n break\n case 'up-center':\n form.value = { left: '1px', top: '1px', right: '1px', bottom: '' }\n break\n }\n // emitValue()\n}\nconst emitValue = () => {\n const data = Object.keys(form.value).reduce((prev: any, cur) => {\n // 当 change.value 存在时检查是否不等于 '0px',否则只检查当前 key 是否不等于 'position'\n if ((change.value && form.value[cur] != '0px') || (!change.value && cur !== 'position')) {\n if (form.value[cur]) {\n prev[cur] = form.value[cur]\n }\n }\n return prev\n }, {})\n emit('update:modelValue', data)\n}\nwatch(\n () => form.value,\n () => {\n emitValue()\n },\n { deep: true }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n Object.keys(props.modelValue).reduce((prev: any, cur) => {\n if (cur !== 'position') {\n prev[cur] = props.modelValue[cur]\n }\n return prev\n }, form.value)\n },\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AA,MACX,MAAM;AACJ,QAAU,SAAA,EAAA,CAAA;AAAA,OACZ;AAAA,MACA,EAAE,MAAM,IAAK,EAAA;AAAA,KACf,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,MAAM;AACJ,QAAA,MAAA,CAAO,KAAK,KAAM,CAAA,UAAU,EAAE,MAAO,CAAA,CAAC,MAAW,GAAQ,KAAA;AACvD,UAAA,IAAI,QAAQ,UAAY,EAAA;AACtB,YAAA,IAAA,CAAK,GAAG,CAAA,GAAI,KAAM,CAAA,UAAA,CAAW,GAAG,CAAA,CAAA;AAAA,WAClC;AACA,UAAO,OAAA,IAAA,CAAA;AAAA,SACT,EAAG,KAAK,KAAK,CAAA,CAAA;AAAA,OACf;AAAA,MACA,EAAE,MAAM,IAAK,EAAA;AAAA,KACf,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,6 +9,7 @@ declare namespace _default {
9
9
  subtitle: string;
10
10
  };
11
11
  showStyle: boolean;
12
+ fixed: boolean;
12
13
  };
13
14
  export function props(): {
14
15
  type: string;
@@ -15,7 +15,8 @@ var DkMinTitle = {
15
15
  title: "\u4E3B\u6807\u9898",
16
16
  subtitle: "\u526F\u6807\u9898"
17
17
  },
18
- showStyle: true
18
+ showStyle: true,
19
+ fixed: true
19
20
  };
20
21
  },
21
22
  props() {
@@ -1 +1 @@
1
- {"version":3,"file":"DkMinTitle.js","sources":["../../../../../../../src/page-diy/src/config/rule/min/common/DkMinTitle.js"],"sourcesContent":["const label = '标题'\nconst name = 'DkMinTitle'\n\nexport default {\n icon: 'material-symbols:title',\n label,\n name,\n rule() {\n return {\n type: name,\n props: {\n title: '主标题',\n subtitle: '副标题',\n },\n showStyle: true,\n }\n },\n props() {\n return [\n {\n type: 'radio',\n field: 'type',\n title: '类型',\n value: '0',\n options: [\n { label: '默认', value: '0' },\n { label: '副标题', value: '1' },\n ],\n control: [\n {\n value: '0',\n rule: [\n { type: 'input', field: 'title', title: '标题', value: '主标题' },\n {\n type: 'radio',\n field: 'align',\n title: '位置',\n value: 'left',\n options: [\n { label: '居左', value: 'left' },\n { label: '居中', value: 'center' },\n ],\n },\n { type: 'DkColorInput', field: 'color', title: '标题色', value: '#000' },\n ],\n },\n {\n value: '1',\n rule: [\n { type: 'input', field: 'title', title: '标题', value: '主标题' },\n { type: 'DkColorInput', field: 'color', title: '标题色', value: '#000' },\n { type: 'input', field: 'subtitle', title: '副标题', value: '' },\n { type: 'DkColorInput', field: 'subColor', title: '副标题色', value: '#999' },\n {\n type: 'switch',\n field: 'isMore',\n title: '显示更多',\n value: true,\n control: [\n {\n value: true,\n rule: [\n { type: 'input', field: 'moreText', title: '文本内容', value: '查看更多' },\n { type: 'input', field: 'url', title: '链接地址', value: '' },\n { type: 'DkColorInput', field: 'moreColor', title: '颜色', value: '#999' },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ]\n },\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,KAAQ,GAAA,cAAA,CAAA;AACd,MAAM,IAAO,GAAA,YAAA,CAAA;AAEb,iBAAe;AAAA,EACb,IAAM,EAAA,wBAAA;AAAA,EACN,KAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAO,GAAA;AACL,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,IAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,oBAAA;AAAA,QACP,QAAU,EAAA,oBAAA;AAAA,OACZ;AAAA,MACA,SAAW,EAAA,IAAA;AAAA,KACb,CAAA;AAAA,GACF;AAAA,EACA,KAAQ,GAAA;AACN,IAAO,OAAA;AAAA,MACL;AAAA,QACE,IAAM,EAAA,OAAA;AAAA,QACN,KAAO,EAAA,MAAA;AAAA,QACP,KAAO,EAAA,cA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AY,KAAO,EAAA,0BAAA,EAAQ,OAAO,MAAO,EAAA;AAAA,cACxE;AAAA,gBACE,IAAM,EAAA,QAAA;AAAA,gBACN,KAAO,EAAA,QAAA;AAAA,gBACP,KAAO,EAAA,0BAAA;AAAA,gBACP,KAAO,EAAA,IAAA;AAAA,gBACP,OAAS,EAAA;AAAA,kBACP;AAAA,oBACE,KAAO,EAAA,IAAA;AAAA,oBACP,IAAM,EAAA;AAAA,sBACJ,EAAE,MAAM,OAAS,EAAA,KAAA,EAAO,YAAY,KAAO,EAAA,0BAAA,EAAQ,OAAO,0BAAO,EAAA;AAAA,sBACjE,EAAE,MAAM,OAAS,EAAA,KAAA,EAAO,OAAO,KAAO,EAAA,0BAAA,EAAQ,OAAO,EAAG,EAAA;AAAA,sBACxD,EAAE,MAAM,cAAgB,EAAA,KAAA,EAAO,aAAa,KAAO,EAAA,cAAA,EAAM,OAAO,MAAO,EAAA;AAAA,qBACzE;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"DkMinTitle.js","sources":["../../../../../../../src/page-diy/src/config/rule/min/common/DkMinTitle.js"],"sourcesContent":["const label = '标题'\nconst name = 'DkMinTitle'\n\nexport default {\n icon: 'material-symbols:title',\n label,\n name,\n rule() {\n return {\n type: name,\n props: {\n title: '主标题',\n subtitle: '副标题',\n },\n showStyle: true,\n fixed: true,\n }\n },\n props() {\n return [\n {\n type: 'radio',\n field: 'type',\n title: '类型',\n value: '0',\n options: [\n { label: '默认', value: '0' },\n { label: '副标题', value: '1' },\n ],\n control: [\n {\n value: '0',\n rule: [\n { type: 'input', field: 'title', title: '标题', value: '主标题' },\n {\n type: 'radio',\n field: 'align',\n title: '位置',\n value: 'left',\n options: [\n { label: '居左', value: 'left' },\n { label: '居中', value: 'center' },\n ],\n },\n { type: 'DkColorInput', field: 'color', title: '标题色', value: '#000' },\n ],\n },\n {\n value: '1',\n rule: [\n { type: 'input', field: 'title', title: '标题', value: '主标题' },\n { type: 'DkColorInput', field: 'color', title: '标题色', value: '#000' },\n { type: 'input', field: 'subtitle', title: '副标题', value: '' },\n { type: 'DkColorInput', field: 'subColor', title: '副标题色', value: '#999' },\n {\n type: 'switch',\n field: 'isMore',\n title: '显示更多',\n value: true,\n control: [\n {\n value: true,\n rule: [\n { type: 'input', field: 'moreText', title: '文本内容', value: '查看更多' },\n { type: 'input', field: 'url', title: '链接地址', value: '' },\n { type: 'DkColorInput', field: 'moreColor', title: '颜色', value: '#999' },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ]\n },\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,KAAQ,GAAA,cAAA,CAAA;AACd,MAAM,IAAO,GAAA,YAAA,CAAA;AAEb,iBAAe;AAAA,EACb,IAAM,EAAA,wBAAA;AAAA,EACN,KAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAO,GAAA;AACL,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,IAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,oBAAA;AAAA,QACP,QAAU,EAAA,oBAAA;AAAA,OACZ;AAAA,MACA,SAAW,EAAA,IAAA;AAAA,MACX,KAAO,EAAA,IAAA;AAAA,KACT,CAAA;AAAA,GACF;AAAA,EACA,KAAQ,GAAA;AACN,IAAO,OAAA;AAAA,MACL;AAAA,QACE,IAAM,EAAA,OAAA;AAAA,QACN,KAAO,EAAA,MAAA;AAAA,QACP,KAAO,EAAA,cAAA;AAAA,QACP,KAAO,EAAA,GAAA;AAAA,QACP,OAAS,EAAA;AAAA,UACP,EAAE,KAAA,EAAO,cAAM,EAAA,KAAA,EAAO,GAAI,EAAA;AAAA,UAC1B,EAAE,KAAA,EAAO,oBAAO,EAAA,KAAA,EAAO,GAAI,EAAA;AAAA,SAC7B;AAAA,QACA,OAAS,EAAA;AAAA,UACP;AAAA,YACE,KA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AAA,oBACP,IAAM,EAAA;AAAA,sBACJ,EAAE,MAAM,OAAS,EAAA,KAAA,EAAO,YAAY,KAAO,EAAA,0BAAA,EAAQ,OAAO,0BAAO,EAAA;AAAA,sBACjE,EAAE,MAAM,OAAS,EAAA,KAAA,EAAO,OAAO,KAAO,EAAA,0BAAA,EAAQ,OAAO,EAAG,EAAA;AAAA,sBACxD,EAAE,MAAM,cAAgB,EAAA,KAAA,EAAO,aAAa,KAAO,EAAA,cAAA,EAAM,OAAO,MAAO,EAAA;AAAA,qBACzE;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAA;;;;"}
@@ -171,6 +171,7 @@ export const commonMenu: ({
171
171
  subtitle: string;
172
172
  };
173
173
  showStyle: boolean;
174
+ fixed: boolean;
174
175
  };
175
176
  props(): {
176
177
  type: string;
@@ -482,6 +483,7 @@ export const commonRuleList: {
482
483
  subtitle: string;
483
484
  };
484
485
  showStyle: boolean;
486
+ fixed: boolean;
485
487
  };
486
488
  props(): {
487
489
  type: string;
@@ -172,6 +172,7 @@ export const minRuleList: {
172
172
  subtitle: string;
173
173
  };
174
174
  showStyle: boolean;
175
+ fixed: boolean;
175
176
  };
176
177
  props(): {
177
178
  type: string;
@@ -486,6 +487,7 @@ export function createMinMenu(): {
486
487
  subtitle: string;
487
488
  };
488
489
  showStyle: boolean;
490
+ fixed: boolean;
489
491
  };
490
492
  props(): {
491
493
  type: string;
@@ -23,7 +23,7 @@ export declare const StyleNumberInput: import("@vipl520/utils").WithInstall<impo
23
23
  default: string;
24
24
  type: StringConstructor;
25
25
  };
26
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue")[], "input" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
27
  modelValue: {
28
28
  default: string;
29
29
  type: StringConstructor;
@@ -49,6 +49,7 @@ export declare const StyleNumberInput: import("@vipl520/utils").WithInstall<impo
49
49
  type: StringConstructor;
50
50
  };
51
51
  }>> & {
52
+ onInput?: ((...args: any[]) => any) | undefined;
52
53
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
53
54
  }, {
54
55
  modelValue: string;
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
23
23
  default: string;
24
24
  type: StringConstructor;
25
25
  };
26
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue")[], "input" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
27
  modelValue: {
28
28
  default: string;
29
29
  type: StringConstructor;
@@ -49,6 +49,7 @@ declare const _default: import("vue").DefineComponent<{
49
49
  type: StringConstructor;
50
50
  };
51
51
  }>> & {
52
+ onInput?: ((...args: any[]) => any) | undefined;
52
53
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
53
54
  }, {
54
55
  modelValue: string;
@@ -12,7 +12,7 @@ const __default__ = vue.defineComponent({
12
12
  var _sfc_main = /* @__PURE__ */ vue.defineComponent({
13
13
  ...__default__,
14
14
  props: props.styleNumberInputProps,
15
- emits: ["update:modelValue"],
15
+ emits: ["input", "update:modelValue"],
16
16
  setup(__props, { emit }) {
17
17
  const props = __props;
18
18
  const values = utils.splitUnit(props.modelValue, props.units);
@@ -94,7 +94,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
94
94
  modelValue: form.number,
95
95
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.number = $event),
96
96
  type: "text",
97
- controls: false
97
+ controls: false,
98
+ onInput: _cache[2] || (_cache[2] = ($event) => emit("input", $event))
98
99
  }, vue.createSlots({
99
100
  prefix: vue.withCtx(() => [
100
101
  vue.createElementVNode(