@dinert/element-plus 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/element-plus.umd.js +1 -1
  2. package/dist/element-plus.umd.js.map +1 -1
  3. package/dist/style.css +1 -1
  4. package/es/node_modules/@element-plus/icons-vue/dist/index.mjs +82 -22
  5. package/es/node_modules/@element-plus/icons-vue/dist/index.mjs.map +1 -1
  6. package/es/packages/assets/scss/dinert-form.scss.mjs +1 -4
  7. package/es/packages/assets/scss/dinert-form.scss.mjs.map +1 -1
  8. package/es/packages/assets/scss/dinert-table-page.scss.mjs +1 -4
  9. package/es/packages/assets/scss/dinert-table-page.scss.mjs.map +1 -1
  10. package/es/packages/assets/scss/dinert-table.scss.mjs +1 -4
  11. package/es/packages/assets/scss/dinert-table.scss.mjs.map +1 -1
  12. package/es/packages/assets/scss/dinert-tooltip.scss.mjs +1 -4
  13. package/es/packages/assets/scss/dinert-tooltip.scss.mjs.map +1 -1
  14. package/es/packages/components/form/src/cascader.mjs +10 -16
  15. package/es/packages/components/form/src/cascader.mjs.map +1 -1
  16. package/es/packages/components/form/src/checkbox.mjs +17 -15
  17. package/es/packages/components/form/src/checkbox.mjs.map +1 -1
  18. package/es/packages/components/form/src/date.mjs +6 -8
  19. package/es/packages/components/form/src/date.mjs.map +1 -1
  20. package/es/packages/components/form/src/index.mjs +140 -149
  21. package/es/packages/components/form/src/index.mjs.map +1 -1
  22. package/es/packages/components/form/src/input-autocomplete.mjs +5 -7
  23. package/es/packages/components/form/src/input-autocomplete.mjs.map +1 -1
  24. package/es/packages/components/form/src/input-number.mjs +9 -16
  25. package/es/packages/components/form/src/input-number.mjs.map +1 -1
  26. package/es/packages/components/form/src/input.mjs +12 -19
  27. package/es/packages/components/form/src/input.mjs.map +1 -1
  28. package/es/packages/components/form/src/radio.mjs +14 -16
  29. package/es/packages/components/form/src/radio.mjs.map +1 -1
  30. package/es/packages/components/form/src/rate.mjs +7 -13
  31. package/es/packages/components/form/src/rate.mjs.map +1 -1
  32. package/es/packages/components/form/src/select.mjs +7 -8
  33. package/es/packages/components/form/src/select.mjs.map +1 -1
  34. package/es/packages/components/form/src/switch.mjs +5 -12
  35. package/es/packages/components/form/src/switch.mjs.map +1 -1
  36. package/es/packages/components/form/src/tree-select.mjs +5 -6
  37. package/es/packages/components/form/src/tree-select.mjs.map +1 -1
  38. package/es/packages/components/form/utils/index.mjs +52 -30
  39. package/es/packages/components/form/utils/index.mjs.map +1 -1
  40. package/es/packages/components/table/hooks/index.mjs +14 -14
  41. package/es/packages/components/table/hooks/index.mjs.map +1 -1
  42. package/es/packages/components/table/src/index.mjs +116 -89
  43. package/es/packages/components/table/src/index.mjs.map +1 -1
  44. package/es/packages/components/table/src/recuve-table-column.mjs +148 -133
  45. package/es/packages/components/table/src/recuve-table-column.mjs.map +1 -1
  46. package/es/packages/components/table-page/src/index.mjs.map +1 -1
  47. package/es/packages/components/tooltip/src/index.mjs +16 -14
  48. package/es/packages/components/tooltip/src/index.mjs.map +1 -1
  49. package/es/packages/hooks/{useTablePage → TablePage}/index.mjs +24 -18
  50. package/es/packages/hooks/TablePage/index.mjs.map +1 -0
  51. package/es/packages/index.mjs +2 -2
  52. package/es/packages/index.mjs.map +1 -1
  53. package/es/packages/utils/tools.mjs +26 -41
  54. package/es/packages/utils/tools.mjs.map +1 -1
  55. package/es/src/components/dialog/index.d.ts +2 -0
  56. package/es/src/components/dialog/src/drag.d.ts +5 -0
  57. package/es/src/components/dialog/src/type.d.ts +15 -0
  58. package/es/src/components/form/index.d.ts +4 -3
  59. package/es/src/components/form/src/cascader.d.ts +7 -9
  60. package/es/src/components/form/src/checkbox.d.ts +7 -8
  61. package/es/src/components/form/src/date.d.ts +245 -8
  62. package/es/src/components/form/src/index.d.ts +4 -3
  63. package/es/src/components/form/src/input-autocomplete.d.ts +7 -8
  64. package/es/src/components/form/src/input-number.d.ts +7 -8
  65. package/es/src/components/form/src/input.d.ts +7 -8
  66. package/es/src/components/form/src/radio.d.ts +7 -8
  67. package/es/src/components/form/src/rate.d.ts +6 -7
  68. package/es/src/components/form/src/select.d.ts +7 -9
  69. package/es/src/components/form/src/switch.d.ts +7 -8
  70. package/es/src/components/form/src/tree-select.d.ts +7 -19
  71. package/es/src/components/form/types/components.d.ts +40 -0
  72. package/es/src/components/form/types/index.d.ts +45 -21
  73. package/es/src/components/form/types/utils.d.ts +5 -0
  74. package/es/src/components/form/utils/index.d.ts +1 -0
  75. package/es/src/components/table/index.d.ts +337 -326
  76. package/es/src/components/table/src/index.d.ts +338 -327
  77. package/es/src/components/table/src/recuve-table-column.d.ts +1 -1
  78. package/es/src/components/table/types/index.d.ts +24 -33
  79. package/{lib/src/hooks/useTablePage → es/src/hooks/TablePage}/index.d.ts +14 -17
  80. package/{lib/src/hooks/useTablePage → es/src/hooks/TablePage}/types/index.d.ts +1 -2
  81. package/es/src/index.d.ts +3 -3
  82. package/es/src/utils/tools.d.ts +1 -1
  83. package/es/src/views/test-table-page/types/index.d.ts +24 -0
  84. package/es/style.css +1 -1
  85. package/lib/index.js +1 -1
  86. package/lib/index.js.map +1 -1
  87. package/lib/src/components/dialog/index.d.ts +2 -0
  88. package/lib/src/components/dialog/src/drag.d.ts +5 -0
  89. package/lib/src/components/dialog/src/type.d.ts +15 -0
  90. package/lib/src/components/form/index.d.ts +4 -3
  91. package/lib/src/components/form/src/cascader.d.ts +7 -9
  92. package/lib/src/components/form/src/checkbox.d.ts +7 -8
  93. package/lib/src/components/form/src/date.d.ts +245 -8
  94. package/lib/src/components/form/src/index.d.ts +4 -3
  95. package/lib/src/components/form/src/input-autocomplete.d.ts +7 -8
  96. package/lib/src/components/form/src/input-number.d.ts +7 -8
  97. package/lib/src/components/form/src/input.d.ts +7 -8
  98. package/lib/src/components/form/src/radio.d.ts +7 -8
  99. package/lib/src/components/form/src/rate.d.ts +6 -7
  100. package/lib/src/components/form/src/select.d.ts +7 -9
  101. package/lib/src/components/form/src/switch.d.ts +7 -8
  102. package/lib/src/components/form/src/tree-select.d.ts +7 -19
  103. package/lib/src/components/form/types/components.d.ts +40 -0
  104. package/lib/src/components/form/types/index.d.ts +45 -21
  105. package/lib/src/components/form/types/utils.d.ts +5 -0
  106. package/lib/src/components/form/utils/index.d.ts +1 -0
  107. package/lib/src/components/table/index.d.ts +337 -326
  108. package/lib/src/components/table/src/index.d.ts +338 -327
  109. package/lib/src/components/table/src/recuve-table-column.d.ts +1 -1
  110. package/lib/src/components/table/types/index.d.ts +24 -33
  111. package/{es/src/hooks/useTablePage → lib/src/hooks/TablePage}/index.d.ts +14 -17
  112. package/{es/src/hooks/useTablePage → lib/src/hooks/TablePage}/types/index.d.ts +1 -2
  113. package/lib/src/index.d.ts +3 -3
  114. package/lib/src/utils/tools.d.ts +1 -1
  115. package/lib/src/views/test-table-page/types/index.d.ts +24 -0
  116. package/lib/style.css +1 -1
  117. package/package.json +87 -89
  118. package/es/packages/hooks/useTablePage/index.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
- import { defineComponent as i, computed as m, createVNode as p, resolveComponent as l, mergeProps as u } from "vue";
2
- import { customPlaceholder as h } from "../utils/index.mjs";
3
- const f = /* @__PURE__ */ i({
1
+ import { defineComponent as o, computed as r, createVNode as m, resolveComponent as s, mergeProps as i } from "vue";
2
+ import { customPlaceholder as n } from "../utils/index.mjs";
3
+ const u = /* @__PURE__ */ o({
4
4
  name: "dinert-input",
5
5
  props: {
6
6
  form: {
@@ -12,32 +12,25 @@ const f = /* @__PURE__ */ i({
12
12
  default: () => ({})
13
13
  }
14
14
  },
15
- setup(o) {
15
+ setup(t) {
16
16
  return {
17
- options: m(() => {
18
- const t = o.formItem.options || {};
19
- return t.type = o.formItem.type, t;
17
+ options: r(() => {
18
+ const e = t.formItem.options || {};
19
+ return e.type = t.formItem.type, e;
20
20
  })
21
21
  };
22
22
  },
23
23
  render() {
24
- var o, e, t, n, s;
25
- return p(l("el-input"), u({
24
+ return m(s("el-input"), i({
26
25
  modelValue: this.form.model[this.formItem.key],
27
- "onUpdate:modelValue": (r) => this.form.model[this.formItem.key] = r,
26
+ "onUpdate:modelValue": (t) => this.form.model[this.formItem.key] = t,
28
27
  clearable: !0,
29
28
  "show-word-limit": this.options.showWordLimit ? !0 : this.options.showWordLimit,
30
- placeholder: h(this.formItem.label)
31
- }, this.options, {
32
- onChange: (o = this.options.on) == null ? void 0 : o.onChange,
33
- onFocus: (e = this.options.on) == null ? void 0 : e.onFocus,
34
- onBlur: (t = this.options.on) == null ? void 0 : t.onBlur,
35
- onClear: (n = this.options.on) == null ? void 0 : n.onClear,
36
- onInput: (s = this.options.on) == null ? void 0 : s.onInput
37
- }), this.$slots);
29
+ placeholder: n(this.formItem.label)
30
+ }, this.options), this.$slots);
38
31
  }
39
32
  });
40
33
  export {
41
- f as default
34
+ u as default
42
35
  };
43
36
  //# sourceMappingURL=input.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.mjs","sources":["../../../../../packages/components/form/src/input.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\nimport {customPlaceholder} from '../utils'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\nimport type {InputProps} from 'element-plus'\n\n\nexport default defineComponent({\n name: 'dinert-input',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps<Partial<InputProps>, any>>,\n default: () => ({})\n },\n },\n setup(props) {\n const options = computed(() => {\n const options = props.formItem.options || {};\n (options as any).type = props.formItem.type\n return options\n })\n\n\n return {\n options,\n }\n },\n render() {\n return (\n <el-input\n v-model={this.form.model[this.formItem.key]}\n clearable\n show-word-limit={this.options.showWordLimit ? true : this.options.showWordLimit}\n placeholder={customPlaceholder(this.formItem.label)}\n {...this.options}\n onChange={this.options.on?.onChange}\n onFocus={this.options.on?.onFocus}\n onBlur={this.options.on?.onBlur}\n onClear={this.options.on?.onClear}\n onInput={this.options.on?.onInput}\n v-slots={this.$slots}\n >\n </el-input>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","showWordLimit","customPlaceholder","label","_a","on","onChange","_b","onFocus","_c","onBlur","_d","onClear","_e","onInput","$slots"],"mappings":";;AAQA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SARYC,EAAS,MAAM;AAC3B,cAAMD,IAAUP,EAAMK,SAASE,WAAW,CAAA;AACzCA,eAAAA,EAAgBL,OAAOF,EAAMK,SAASH,MAChCK;AAAAA,MACX,CAAC;AAAA;EAMJ;AAAA,EACDE,SAAS;;AACL,WAAAC,EAAAC,EAAA,UAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,mBAE1B,KAAKR,QAAQS,gBAAgB,KAAO,KAAKT,QAAQS;AAAAA,MAAa,aAClEC,EAAkB,KAAKZ,SAASa,KAAK;AAAA,OAC9C,KAAKX,SAAO;AAAA,MAAA,WACNY,IAAA,KAAKZ,QAAQa,OAAb,gBAAAD,EAAiBE;AAAAA,MAAQ,UAC1BC,IAAA,KAAKf,QAAQa,OAAb,gBAAAE,EAAiBC;AAAAA,MAAO,SACzBC,IAAA,KAAKjB,QAAQa,OAAb,gBAAAI,EAAiBC;AAAAA,MAAM,UACtBC,IAAA,KAAKnB,QAAQa,OAAb,gBAAAM,EAAiBC;AAAAA,MAAO,UACxBC,IAAA,KAAKrB,QAAQa,OAAb,gBAAAQ,EAAiBC;AAAAA,KACjB,GAAA,KAAKC,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
1
+ {"version":3,"file":"input.mjs","sources":["../../../../../packages/components/form/src/input.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\nimport {customPlaceholder} from '../utils'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\n\nexport default defineComponent({\n name: 'dinert-input',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['input']>(() => {\n const options = props.formItem.options || {}\n options.type = props.formItem.type\n return options\n })\n\n return {\n options,\n }\n },\n render() {\n return (\n <el-input\n v-model={this.form.model[this.formItem.key]}\n clearable\n show-word-limit={this.options.showWordLimit ? true : this.options.showWordLimit}\n placeholder={customPlaceholder(this.formItem.label)}\n {...this.options}\n v-slots={this.$slots}\n >\n </el-input>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","showWordLimit","customPlaceholder","label","$slots"],"mappings":";;AAOA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAOT,WAAO;AAAA,MACHO,SAPYC,EAAkE,MAAM;AACpF,cAAMD,IAAUP,EAAMK,SAASE,WAAW,CAAA;AAC1CA,eAAAA,EAAQL,OAAOF,EAAMK,SAASH,MACvBK;AAAAA,MACX,CAAC;AAAA;EAKJ;AAAA,EACDE,SAAS;AACL,WAAAC,EAAAC,EAAA,UAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,mBAE1B,KAAKR,QAAQS,gBAAgB,KAAO,KAAKT,QAAQS;AAAAA,MAAa,aAClEC,EAAkB,KAAKZ,SAASa,KAAK;AAAA,IAAC,GAC/C,KAAKX,OAAO,GACP,KAAKY,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
@@ -1,6 +1,6 @@
1
- import { defineComponent as l, computed as i, createVNode as e, resolveComponent as n, mergeProps as s, isVNode as p } from "vue";
2
- function a(o) {
3
- return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !p(o);
1
+ import { defineComponent as l, computed as i, createVNode as e, resolveComponent as r, mergeProps as n, isVNode as a } from "vue";
2
+ function p(o) {
3
+ return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !a(o);
4
4
  }
5
5
  const d = /* @__PURE__ */ l({
6
6
  name: "dinert-radio",
@@ -16,26 +16,24 @@ const d = /* @__PURE__ */ l({
16
16
  },
17
17
  setup(o) {
18
18
  return {
19
- options: i(() => o.formItem.options || {
20
- on: {}
21
- })
19
+ options: i(() => o.formItem.options || {})
22
20
  };
23
21
  },
24
22
  render() {
25
23
  let o;
26
- const r = this.options.options || [];
27
- return e(n("el-radio-group"), {
24
+ const s = this.options.options || [];
25
+ return e(r("el-radio-group"), {
28
26
  modelValue: this.form.model[this.formItem.key],
29
27
  "onUpdate:modelValue": (t) => this.form.model[this.formItem.key] = t
30
- }, a(o = r.map((t) => this.formItem.type === "radio-button" ? e(n("el-radio-button"), s({
31
- label: t.value
32
- }, this.options.on), {
33
- default: () => [t.label],
28
+ }, p(o = s.map((t) => this.formItem.type === "radio-button" ? e(r("el-radio-button"), n(t, {
29
+ value: t[this.options.value || "value"]
30
+ }), {
31
+ default: () => [t[this.options.label || "label"]],
34
32
  ...this.$slots
35
- }) : e(n("el-radio"), s({
36
- label: t.value
37
- }, this.options.on), {
38
- default: () => [t.label],
33
+ }) : e(r("el-radio"), n(t, {
34
+ value: t[this.options.value || "value"]
35
+ }), {
36
+ default: () => [t[this.options.label || "label"]],
39
37
  ...this.$slots
40
38
  }))) ? o : {
41
39
  default: () => [o]
@@ -1 +1 @@
1
- {"version":3,"file":"radio.mjs","sources":["../../../../../packages/components/form/src/radio.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\nimport type {RadioProps} from 'element-plus'\n\n\nexport default defineComponent({\n name: 'dinert-radio',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps<Partial<RadioProps>>>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed(() => {\n const options = props.formItem.options || {on: {}}\n return options\n })\n\n return {\n options\n }\n },\n render() {\n const options = this.options.options || []\n\n return (\n <el-radio-group v-model={this.form.model[this.formItem.key]}>\n {\n (options as any[]).map((item: RadioProps & {value: any}) => {\n if (this.formItem.type === 'radio-button') {\n return (<el-radio-button\n label={item.value}\n {...this.options.on}\n v-slots={this.$slots}\n >\n {item.label}\n </el-radio-button>)\n }\n return (<el-radio\n label={item.value}\n {...this.options.on}\n v-slots={this.$slots}\n >\n {item.label}\n </el-radio>)\n })\n }\n\n </el-radio-group>\n )\n }\n})\n\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","formItem","setup","options","computed","on","render","_slot","_createVNode","_resolveComponent","model","key","$event","map","item","_mergeProps","value","label","$slots"],"mappings":";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FF,KAAKC;AAAAA,IAAM,CAAA,CAI3B,CAAC,IAAAX,IAAA;AAAA,MAAAP,SAAAA,MAAA,CAAAO,CAAA;AAAA,IAAA,CAAA;AAAA,EAKlB;AACJ,CAAC;"}
1
+ {"version":3,"file":"radio.mjs","sources":["../../../../../packages/components/form/src/radio.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\n\nexport default defineComponent({\n name: 'dinert-radio',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['radio']>(() => {\n const options = props.formItem.options || {}\n return options\n })\n\n return {\n options\n }\n },\n render() {\n const options = this.options.options || []\n\n return (\n <el-radio-group v-model={this.form.model[this.formItem.key]}>\n {\n options.map(item => {\n if (this.formItem.type === 'radio-button') {\n return (<el-radio-button\n {...item}\n v-slots={this.$slots}\n value={item[this.options.value || 'value']}\n >\n {item[this.options.label || 'label']}\n\n </el-radio-button>)\n }\n return (<el-radio\n {...item}\n v-slots={this.$slots}\n value={item[this.options.value || 'value']}\n >\n {item[this.options.label || 'label']}\n\n </el-radio>)\n })\n }\n\n </el-radio-group>\n )\n }\n})\n\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","props","form","type","default","formItem","setup","options","computed","render","_slot","_createVNode","_resolveComponent","model","key","$event","map","item","_mergeProps","value","label","$slots"],"mappings":";AAA6C,SAAAA,EAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAM7C,MAAeM,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC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{ defineComponent as n, computed as r, createVNode as m, resolveComponent as s, mergeProps as p } from "vue";
2
- const a = /* @__PURE__ */ n({
1
+ import { defineComponent as t, computed as o, createVNode as r, resolveComponent as m, mergeProps as s } from "vue";
2
+ const d = /* @__PURE__ */ t({
3
3
  name: "dinert-rate",
4
4
  props: {
5
5
  form: {
@@ -13,23 +13,17 @@ const a = /* @__PURE__ */ n({
13
13
  },
14
14
  setup(e) {
15
15
  return {
16
- options: r(() => {
17
- const o = e.formItem.options || {};
18
- return o.type = e.formItem.type, o;
19
- })
16
+ options: o(() => e.formItem.options || {})
20
17
  };
21
18
  },
22
19
  render() {
23
- var e;
24
- return m(s("el-rate"), p({
20
+ return r(m("el-rate"), s({
25
21
  modelValue: this.form.model[this.formItem.key],
26
- "onUpdate:modelValue": (t) => this.form.model[this.formItem.key] = t
27
- }, this.options, {
28
- onChange: (e = this.options.on) == null ? void 0 : e.onChange
29
- }), this.$slots);
22
+ "onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e
23
+ }, this.options), this.$slots);
30
24
  }
31
25
  });
32
26
  export {
33
- a as default
27
+ d as default
34
28
  };
35
29
  //# sourceMappingURL=rate.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rate.mjs","sources":["../../../../../packages/components/form/src/rate.tsx"],"sourcesContent":["import {computed, defineComponent, PropType} from 'vue'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {RateProps} from 'element-plus'\n\n\nexport default defineComponent({\n name: 'dinert-rate',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps<Partial<RateProps>, any>>,\n default: () => ({})\n },\n },\n setup(props) {\n const options = computed(() => {\n const options = (props.formItem.options || {} as any)\n options.type = props.formItem.type\n return options\n })\n\n\n return {\n options,\n }\n },\n render() {\n return (\n <el-rate\n v-model={this.form.model[this.formItem.key]}\n {...this.options}\n onChange={this.options.on?.onChange}\n v-slots={this.$slots}\n >\n </el-rate>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","_a","on","onChange","$slots"],"mappings":";AAMA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SARYC,EAAS,MAAM;AAC3B,cAAMD,IAAWP,EAAMK,SAASE,WAAW,CAAA;AAC3CA,eAAAA,EAAQL,OAAOF,EAAMK,SAASH,MACvBK;AAAAA,MACX,CAAC;AAAA;EAMJ;AAAA,EACDE,SAAS;;AACL,WAAAC,EAAAC,EAAA,SAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,OACvC,KAAKR,SAAO;AAAA,MAAA,WACNS,IAAA,KAAKT,QAAQU,OAAb,gBAAAD,EAAiBE;AAAAA,KAClB,GAAA,KAAKC,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
1
+ {"version":3,"file":"rate.mjs","sources":["../../../../../packages/components/form/src/rate.tsx"],"sourcesContent":["import {computed, defineComponent, PropType} from 'vue'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\n\n\nexport default defineComponent({\n name: 'dinert-rate',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['rate']>(() => {\n const options = props.formItem.options || {}\n return options\n })\n\n\n return {\n options,\n }\n },\n render() {\n return (\n <el-rate\n v-model={this.form.model[this.formItem.key]}\n {...this.options}\n v-slots={this.$slots}\n >\n </el-rate>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","$slots"],"mappings":";AAKA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAOT,WAAO;AAAA,MACHO,SAPYC,EAAiE,MAC7DR,EAAMK,SAASE,WAAW,CAAA,CAE7C;AAAA;EAMJ;AAAA,EACDE,SAAS;AACL,WAAAC,EAAAC,EAAA,SAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,IAAA,GACvC,KAAKR,OAAO,GACP,KAAKS,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as r, computed as n, createVNode as t, resolveComponent as s, mergeProps as l } from "vue";
2
- import { customPlaceholder as m } from "../utils/index.mjs";
2
+ import { customPlaceholder as p } from "../utils/index.mjs";
3
3
  const u = /* @__PURE__ */ r({
4
4
  name: "dinert-select",
5
5
  props: {
@@ -14,9 +14,7 @@ const u = /* @__PURE__ */ r({
14
14
  },
15
15
  setup(o) {
16
16
  return {
17
- options: n(() => o.formItem.options || {
18
- on: {}
19
- })
17
+ options: n(() => o.formItem.options || [])
20
18
  };
21
19
  },
22
20
  render() {
@@ -25,15 +23,16 @@ const u = /* @__PURE__ */ r({
25
23
  modelValue: this.form.model[this.formItem.key],
26
24
  "onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e,
27
25
  clearable: !0,
28
- placeholder: m(this.formItem.label, "select")
29
- }, this.options, this.options.on, {
26
+ placeholder: p(this.formItem.label, "select")
27
+ }, this.options, {
30
28
  key: this.formItem.key
31
29
  }), {
32
30
  default: () => [o.map((e) => t(s("el-option"), l({
33
31
  key: e.value
34
- }, e, {
32
+ }, {
33
+ ...e,
35
34
  label: e[this.options.label || "label"],
36
- value: e[this.options.value || "value"]
35
+ value: this.options.value === "object" ? e : e[this.options.value || "value"]
37
36
  }), null))],
38
37
  ...this.$slots
39
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"select.mjs","sources":["../../../../../packages/components/form/src/select.tsx"],"sourcesContent":["import {computed, defineComponent, PropType} from 'vue'\nimport {customPlaceholder} from '../utils'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {ElSelect, SelectOptionProxy} from 'element-plus'\n\ntype FormItem = CustomFormItemProps<Partial<typeof ElSelect>, SelectOptionProxy[]>\n\nexport default defineComponent({\n name: 'dinert-select',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<FormItem>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed(() => {\n const options = props.formItem.options || {on: {}}\n return options\n })\n\n return {\n options,\n }\n },\n render() {\n const options = (this.options.options as SelectOptionProxy[]) || []\n return (\n <el-select\n v-model={this.form.model[this.formItem.key]}\n clearable\n placeholder={customPlaceholder(this.formItem.label, 'select')}\n\n {...this.options}\n {...this.options.on}\n v-slots={this.$slots}\n key={this.formItem.key}\n >\n {\n options.map((item: SelectOptionProxy) => {\n return (<el-option\n key={item.value}\n {...item}\n label={item[(this.options.label || 'label')]}\n value={item[((this.options.value as any) || 'value')]}\n >\n </el-option>)\n })\n }\n </el-select>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","on","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","customPlaceholder","label","map","item","value","$slots"],"mappings":";;AAQA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAOT,WAAO;AAAA,MACHO,SANYC,EAAS,MACLR,EAAMK,SAASE,WAAW;AAAA,QAACE,IAAI,CAAC;AAAA,OAEnD;AAAA;EAKJ;AAAA,EACDC,SAAS;AACL,UAAMH,IAAW,KAAKA,QAAQA,WAAmC,CAAA;AACjE,WAAAI,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKZ,KAAKa,MAAM,KAAKT,SAASU,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKf,KAAKa,MAAM,KAAKT,SAASU,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,aAE9BC,EAAkB,KAAKZ,SAASa,OAAO,QAAQ;AAAA,IAExD,GAAA,KAAKX,SACL,KAAKA,QAAQE,IAAE;AAAA,MAAA,KAEd,KAAKJ,SAASU;AAAAA,IAAG,CAAA,GAAA;AAAA,MAAAX,SAAAA,MAGlBG,CAAAA,EAAQY,IAAKC,CAAAA,MACTT,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,QAAA,KACSO,EAAKC;AAAAA,MAAK,GACXD,GAAI;AAAA,QAAA,OACDA,EAAM,KAAKb,QAAQW,SAAS,OAAO;AAAA,QAAE,OACrCE,EAAO,KAAKb,QAAQc,SAAiB,OAAO;AAAA,MAAE,CAAA,GAAA,IAAA,CAG5D,CAAC;AAAA,MAAA,GAZG,KAAKC;AAAAA,IAAM,CAAA;AAAA,EAgBhC;AACJ,CAAC;"}
1
+ {"version":3,"file":"select.mjs","sources":["../../../../../packages/components/form/src/select.tsx"],"sourcesContent":["import {computed, defineComponent, PropType} from 'vue'\nimport {customPlaceholder} from '../utils'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\n\nexport default defineComponent({\n name: 'dinert-select',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['select']>(() => {\n const options = props.formItem.options || []\n return options\n })\n\n return {\n options,\n }\n },\n render() {\n const options = this.options.options || []\n return (\n <el-select\n v-model={this.form.model[this.formItem.key]}\n clearable\n placeholder={customPlaceholder(this.formItem.label, 'select')}\n {...this.options}\n v-slots={this.$slots}\n key={this.formItem.key}\n >\n {\n options.map(item => {\n return (<el-option\n key={item.value}\n {...{\n ...item,\n label: item[(this.options.label || 'label')],\n value: this.options.value === 'object' ? item : item[(this.options.value || 'value')]\n }}\n\n >\n </el-option>)\n })\n }\n </el-select>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","customPlaceholder","label","map","item","value","$slots"],"mappings":";;AAKA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAOT,WAAO;AAAA,MACHO,SANYC,EAAmE,MAC/DR,EAAMK,SAASE,WAAW,CAAA,CAE7C;AAAA;EAKJ;AAAA,EACDE,SAAS;AACL,UAAMF,IAAU,KAAKA,QAAQA,WAAW,CAAA;AACxC,WAAAG,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,aAE9BC,EAAkB,KAAKX,SAASY,OAAO,QAAQ;AAAA,OACxD,KAAKV,SAAO;AAAA,MAAA,KAEX,KAAKF,SAASS;AAAAA,IAAG,CAAA,GAAA;AAAA,MAAAV,SAAAA,MAGlBG,CAAAA,EAAQW,IAAIC,CAAAA,MACRT,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,QAAA,KACSO,EAAKC;AAAAA,MAAK,GAAA;AAAA,QAEX,GAAGD;AAAAA,QACHF,OAAOE,EAAM,KAAKZ,QAAQU,SAAS,OAAO;AAAA,QAC1CG,OAAO,KAAKb,QAAQa,UAAU,WAAWD,IAAOA,EAAM,KAAKZ,QAAQa,SAAS,OAAO;AAAA,MAAE,CAAA,GAAA,IAAA,CAKhG,CAAC;AAAA,MAAA,GAfG,KAAKC;AAAAA,IAAM,CAAA;AAAA,EAmBhC;AACJ,CAAC;"}
@@ -1,5 +1,5 @@
1
- import { defineComponent as o, computed as s, createVNode as m, resolveComponent as n, mergeProps as r } from "vue";
2
- const d = /* @__PURE__ */ o({
1
+ import { defineComponent as e, computed as o, createVNode as s, resolveComponent as r, mergeProps as m } from "vue";
2
+ const d = /* @__PURE__ */ e({
3
3
  name: "dinert-switch",
4
4
  props: {
5
5
  form: {
@@ -13,21 +13,14 @@ const d = /* @__PURE__ */ o({
13
13
  },
14
14
  setup(t) {
15
15
  return {
16
- options: s(() => {
17
- const e = t.formItem.options || {
18
- on: {}
19
- };
20
- return e.type = t.formItem.type, e;
21
- })
16
+ options: o(() => t.formItem.options || {})
22
17
  };
23
18
  },
24
19
  render() {
25
- return m(n("el-switch"), r({
20
+ return s(r("el-switch"), m({
26
21
  modelValue: this.form.model[this.formItem.key],
27
22
  "onUpdate:modelValue": (t) => this.form.model[this.formItem.key] = t
28
- }, this.options, this.options.on, {
29
- key: this.options.key
30
- }), this.$slots);
23
+ }, this.options), this.$slots);
31
24
  }
32
25
  });
33
26
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"switch.mjs","sources":["../../../../../packages/components/form/src/switch.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\n\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\nimport type {SwitchProps} from 'element-plus'\n\n\nexport default defineComponent({\n name: 'dinert-switch',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps<Partial<SwitchProps>>>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed(() => {\n const options = props.formItem.options || {on: {}};\n (options as any).type = props.formItem.type\n return options\n })\n\n return {\n options\n }\n },\n render() {\n return (\n <el-switch\n v-model={this.form.model[this.formItem.key]}\n {...this.options}\n {...this.options.on}\n v-slots={this.$slots}\n key={this.options.key}\n >\n </el-switch>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","on","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","$slots"],"mappings":";AAQA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SAPYC,EAAS,MAAM;AAC3B,cAAMD,IAAUP,EAAMK,SAASE,WAAW;AAAA,UAACE,IAAI,CAAC;AAAA;AAC/CF,eAAAA,EAAgBL,OAAOF,EAAMK,SAASH,MAChCK;AAAAA,MACX,CAAC;AAAA;EAKJ;AAAA,EACDG,SAAS;AACL,WAAAC,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKZ,KAAKa,MAAM,KAAKT,SAASU,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKf,KAAKa,MAAM,KAAKT,SAASU,GAAG,IAACC;AAAAA,IACvC,GAAA,KAAKT,SACL,KAAKA,QAAQE,IAAE;AAAA,MAAA,KAEd,KAAKF,QAAQQ;AAAAA,KADT,GAAA,KAAKE,MAAM;AAAA,EAKhC;AACJ,CAAC;"}
1
+ {"version":3,"file":"switch.mjs","sources":["../../../../../packages/components/form/src/switch.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\n\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\n\nexport default defineComponent({\n name: 'dinert-switch',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed(() => {\n const options = props.formItem.options || {}\n return options\n })\n\n return {\n options\n }\n },\n render() {\n return (\n <el-switch\n v-model={this.form.model[this.formItem.key]}\n {...this.options}\n v-slots={this.$slots}\n >\n </el-switch>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","$slots"],"mappings":";AAOA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAOT,WAAO;AAAA,MACHO,SANYC,EAAS,MACLR,EAAMK,SAASE,WAAW,CAAA,CAE7C;AAAA;EAKJ;AAAA,EACDE,SAAS;AACL,WAAAC,EAAAC,EAAA,WAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKX,KAAKY,MAAM,KAAKR,SAASS,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKd,KAAKY,MAAM,KAAKR,SAASS,GAAG,IAACC;AAAAA,IAAA,GACvC,KAAKR,OAAO,GACP,KAAKS,MAAM;AAAA,EAIhC;AACJ,CAAC;"}
@@ -1,5 +1,5 @@
1
- import { defineComponent as o, computed as r, createVNode as s, resolveComponent as n, mergeProps as i } from "vue";
2
- import { customPlaceholder as l } from "../utils/index.mjs";
1
+ import { defineComponent as o, computed as r, createVNode as s, resolveComponent as l, mergeProps as m } from "vue";
2
+ import { customPlaceholder as i } from "../utils/index.mjs";
3
3
  const d = /* @__PURE__ */ o({
4
4
  name: "dinert-tree-select",
5
5
  props: {
@@ -16,7 +16,6 @@ const d = /* @__PURE__ */ o({
16
16
  return {
17
17
  options: r(() => {
18
18
  const t = e.formItem.options || {
19
- on: {},
20
19
  options: [],
21
20
  data: []
22
21
  };
@@ -25,14 +24,14 @@ const d = /* @__PURE__ */ o({
25
24
  };
26
25
  },
27
26
  render() {
28
- return s(n("el-tree-select"), i({
27
+ return s(l("el-tree-select"), m({
29
28
  modelValue: this.form.model[this.formItem.key],
30
29
  "onUpdate:modelValue": (e) => this.form.model[this.formItem.key] = e,
31
30
  clearable: !0,
32
- placeholder: l(this.formItem.label, "select"),
31
+ placeholder: i(this.formItem.label, "select"),
33
32
  filterable: this.options.filterable === void 0 ? !0 : this.options.filterable,
34
33
  "node-key": this.options.nodeKey
35
- }, this.options, this.options.on, {
34
+ }, this.options, {
36
35
  key: this.formItem.key
37
36
  }), this.$slots);
38
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tree-select.mjs","sources":["../../../../../packages/components/form/src/tree-select.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\nimport {customPlaceholder} from '../utils'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\nimport type {ElTreeSelect} from 'element-plus'\n\nexport default defineComponent({\n name: 'dinert-tree-select',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps<Partial<typeof ElTreeSelect>>>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed(() => {\n const options = props.formItem.options || {on: {}, options: [], data: []}\n options.data = options.options\n return options\n })\n\n return {\n options\n }\n },\n render() {\n return (\n <el-tree-select\n v-model={this.form.model[this.formItem.key]}\n clearable\n placeholder={customPlaceholder(this.formItem.label, 'select')}\n filterable={this.options.filterable === undefined ? true : this.options.filterable}\n node-key={this.options.nodeKey}\n {...this.options}\n {...this.options.on}\n v-slots={this.$slots}\n key={this.formItem.key}\n >\n </el-tree-select>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","on","data","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","customPlaceholder","label","filterable","undefined","nodeKey","$slots"],"mappings":";;AAOA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SAPYC,EAAS,MAAM;AAC3B,cAAMD,IAAUP,EAAMK,SAASE,WAAW;AAAA,UAACE,IAAI,CAAE;AAAA,UAAEF,SAAS,CAAE;AAAA,UAAEG,MAAM,CAAA;AAAA;AACtEH,eAAAA,EAAQG,OAAOH,EAAQA,SAChBA;AAAAA,MACX,CAAC;AAAA;EAKJ;AAAA,EACDI,SAAS;AACL,WAAAC,EAAAC,EAAA,gBAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKb,KAAKc,MAAM,KAAKV,SAASW,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKhB,KAAKc,MAAM,KAAKV,SAASW,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,aAE9BC,EAAkB,KAAKb,SAASc,OAAO,QAAQ;AAAA,MAAC,YACjD,KAAKZ,QAAQa,eAAeC,SAAY,KAAO,KAAKd,QAAQa;AAAAA,MAAU,YACxE,KAAKb,QAAQe;AAAAA,IACnB,GAAA,KAAKf,SACL,KAAKA,QAAQE,IAAE;AAAA,MAAA,KAEd,KAAKJ,SAASW;AAAAA,KADV,GAAA,KAAKO,MAAM;AAAA,EAKhC;AACJ,CAAC;"}
1
+ {"version":3,"file":"tree-select.mjs","sources":["../../../../../packages/components/form/src/tree-select.tsx"],"sourcesContent":["import {computed, defineComponent} from 'vue'\nimport {customPlaceholder} from '../utils'\n\nimport type {RewriteFormProps, CustomFormItemProps} from '@packages/components/form/types'\nimport type {PropType} from 'vue'\n\nexport default defineComponent({\n name: 'dinert-tree-select',\n props: {\n form: {\n type: Object as PropType<RewriteFormProps>,\n default: () => ({})\n },\n formItem: {\n type: Object as PropType<CustomFormItemProps>,\n default: () => ({})\n },\n },\n setup(props) {\n\n const options = computed<CustomFormItemProps[keyof CustomFormItemProps]['tree-select']>(() => {\n const options = props.formItem.options || {options: [], data: []}\n options.data = options.options\n return options\n })\n\n return {\n options\n }\n },\n render() {\n return (\n <el-tree-select\n v-model={this.form.model[this.formItem.key]}\n clearable\n placeholder={customPlaceholder(this.formItem.label, 'select')}\n filterable={this.options.filterable === undefined ? true : this.options.filterable}\n node-key={this.options.nodeKey}\n {...this.options}\n v-slots={this.$slots}\n key={this.formItem.key}\n >\n </el-tree-select>\n )\n }\n})\n\n"],"names":["defineComponent","name","props","form","type","Object","default","formItem","setup","options","computed","data","render","_createVNode","_resolveComponent","_mergeProps","model","key","$event","customPlaceholder","label","filterable","undefined","nodeKey","$slots"],"mappings":";;AAMA,MAAeA,sBAAgB;AAAA,EAC3BC,MAAM;AAAA,EACNC,OAAO;AAAA,IACHC,MAAM;AAAA,MACFC,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACnB;AAAA,IACDC,UAAU;AAAA,MACNH,MAAMC;AAAAA,MACNC,SAASA,OAAO,CAAA;AAAA,IACpB;AAAA,EACH;AAAA,EACDE,MAAMN,GAAO;AAQT,WAAO;AAAA,MACHO,SAPYC,EAAwE,MAAM;AAC1F,cAAMD,IAAUP,EAAMK,SAASE,WAAW;AAAA,UAACA,SAAS,CAAE;AAAA,UAAEE,MAAM,CAAA;AAAA;AAC9DF,eAAAA,EAAQE,OAAOF,EAAQA,SAChBA;AAAAA,MACX,CAAC;AAAA;EAKJ;AAAA,EACDG,SAAS;AACL,WAAAC,EAAAC,EAAA,gBAAA,GAAAC,EAAA;AAAA,MAAA,YAEiB,KAAKZ,KAAKa,MAAM,KAAKT,SAASU,GAAG;AAAA,MAAC,uBAAAC,CAAAA,MAAlC,KAAKf,KAAKa,MAAM,KAAKT,SAASU,GAAG,IAACC;AAAAA,MAAA,WAAA;AAAA,MAAA,aAE9BC,EAAkB,KAAKZ,SAASa,OAAO,QAAQ;AAAA,MAAC,YACjD,KAAKX,QAAQY,eAAeC,SAAY,KAAO,KAAKb,QAAQY;AAAAA,MAAU,YACxE,KAAKZ,QAAQc;AAAAA,OACnB,KAAKd,SAAO;AAAA,MAAA,KAEX,KAAKF,SAASU;AAAAA,KADV,GAAA,KAAKO,MAAM;AAAA,EAKhC;AACJ,CAAC;"}
@@ -1,22 +1,39 @@
1
- const u = (o, e, r) => {
2
- const t = o.target.parentElement.parentElement, l = window.getComputedStyle(t, null), n = e.rules ? 12 : e.beforeWidth || 0, a = parseInt(l.getPropertyValue("max-width")) - n - parseInt(l.getPropertyValue("padding-right"));
3
- o.target.previousElementSibling.offsetWidth >= a ? r.form.formItem[e.key].labelDisabled = !1 : r.form.formItem[e.key].labelDisabled = !0;
4
- }, d = (o, e) => {
5
- const r = e.type, t = e.options;
6
- if (["input"].includes(r))
7
- return o;
8
- if (["select"].includes(r) && t && t.options && t.options.length) {
9
- const l = t.options.filter((n) => n.value === o)[0];
10
- return l && l.label;
1
+ const f = (l, t, r) => {
2
+ const e = l.target.parentElement.parentElement, o = window.getComputedStyle(e, null), s = t.rules ? 12 : t.beforeWidth || 0, n = parseInt(o.getPropertyValue("max-width")) - s - parseInt(o.getPropertyValue("padding-right"));
3
+ l.target.previousElementSibling.offsetWidth >= n ? r.form.formItem[t.key].labelDisabled = !1 : r.form.formItem[t.key].labelDisabled = !0;
4
+ }, u = (l, t, r) => {
5
+ const e = [];
6
+ function o(s) {
7
+ s.forEach((n) => {
8
+ (Array.isArray(r) && r.includes(n[t]) || r === n[t]) && e.push(n), n.children && n.children.length && o(n.children);
9
+ });
10
+ }
11
+ return o(l), e;
12
+ }, m = (l, t) => {
13
+ var s, n, i, p;
14
+ const r = t.type, e = t.options || {}, o = [];
15
+ if (["input", "input-autocomplete", "input-number"].includes(r))
16
+ return l;
17
+ if (["select", "tree-select"].includes(r)) {
18
+ if (e && e.options && e.options.length) {
19
+ let a = null;
20
+ return e.valueKey && (a = l && l[e.valueKey]), u(e.options, e.value === "object" ? e.valueKey : e.value || "value", a || l).forEach((c) => {
21
+ o.push(c[e.label || "label"]);
22
+ }), o.join(",");
23
+ }
24
+ } else if (["cascader"].includes(r) && e && e.options && e.options.length) {
25
+ (((s = e.props) == null ? void 0 : s.emitPath) === void 0 || ((n = e.props) == null ? void 0 : n.emitPath) === !0) && (l = l && l[0]);
26
+ const a = u(e.options, ((i = e.props) == null ? void 0 : i.value) || "value", l)[0];
27
+ return a && a[((p = e.props) == null ? void 0 : p.label) || "label"];
11
28
  }
12
29
  return null;
13
- }, f = (o, e, r, t) => {
14
- if (!r || e.showLabel) {
15
- t.form.formItem[e.key].valueDisabled = !0;
30
+ }, y = (l, t, r, e) => {
31
+ if (!r || t.showLabel) {
32
+ e.form.formItem[t.key].tempValueDisabled = !0;
16
33
  return;
17
34
  }
18
- const l = o.target.parentElement.querySelector(".el-input__inner");
19
- if ([
35
+ let o = null;
36
+ if (["input", "input-autocomplete", "cascader", "input-number"].includes(t.type) ? o = l.target.parentElement.querySelector(".el-input__inner") : ["select", "tree-select"].includes(t.type) && (o = l.target.parentElement.querySelector(".el-select__selected-item.el-select__placeholder"), o = o || l.target.parentElement.querySelector(".el-select__selection")), [
20
37
  "datetime",
21
38
  "date",
22
39
  "week",
@@ -26,24 +43,29 @@ const u = (o, e, r) => {
26
43
  "daterange",
27
44
  "monthrange",
28
45
  "yearrange",
29
- "radio-button"
30
- ].includes(e.type)) {
31
- t.form.formItem[e.key].valueDisabled = !0;
46
+ "radio-button",
47
+ "checkbox",
48
+ "rate",
49
+ "textarea",
50
+ "checkbox-button"
51
+ ].includes(t.type)) {
52
+ e.form.formItem[t.key].tempValueDisabled = !0;
32
53
  return;
33
54
  }
34
- if (["switch", "radio"].includes(e.type))
35
- t.form.formItem[e.key].valueDisabled = !0;
36
- else if (l) {
37
- const a = window.getComputedStyle(l, null), s = l.offsetWidth - parseInt(a.getPropertyValue("padding-right")) - parseInt(a.getPropertyValue("padding-left"));
38
- o.target.previousElementSibling.offsetWidth >= s ? t.form.formItem[e.key].valueDisabled = !1 : t.form.formItem[e.key].valueDisabled = !0;
55
+ if (["switch", "radio"].includes(t.type))
56
+ e.form.formItem[t.key].tempValueDisabled = !0;
57
+ else if (o) {
58
+ const n = window.getComputedStyle(o, null), i = o.offsetWidth - parseInt(n.getPropertyValue("padding-right")) - parseInt(n.getPropertyValue("padding-left"));
59
+ l.target.previousElementSibling.offsetWidth >= i ? e.form.formItem[t.key].tempValueDisabled = !1 : e.form.formItem[t.key].tempValueDisabled = !0;
39
60
  } else
40
- t.form.formItem[e.key].valueDisabled = !1;
41
- }, p = (o, e = "input", r = "请输入") => (r = e === "select" ? "请选择" : r, r + (o || "")), m = (o, e = "formItem_") => e + (o || "");
61
+ e.form.formItem[t.key].tempValueDisabled = !1;
62
+ }, b = (l, t = "input", r = "请输入") => (r = t === "select" ? "请选择" : r, r + (l || "")), g = (l, t = "formItem_") => t + (l || "");
42
63
  export {
43
- p as customPlaceholder,
44
- m as formItemSlot,
45
- d as getTooltipValue,
46
- u as labelMouseEnter,
47
- f as valueMouseEnter
64
+ b as customPlaceholder,
65
+ u as findTreeNode,
66
+ g as formItemSlot,
67
+ m as getTooltipValue,
68
+ f as labelMouseEnter,
69
+ y as valueMouseEnter
48
70
  };
49
71
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/utils/index.ts"],"sourcesContent":["\nexport const labelMouseEnter = (e: MouseEvent, item: any, _this: any) => {\n const el = (e.target as any).parentElement.parentElement\n const labelEl = window.getComputedStyle(el, null)\n const isRequried = item.rules ? 12 : item.beforeWidth || 0\n const labelWidth\n = parseInt(labelEl.getPropertyValue('max-width')) - isRequried\n - parseInt(labelEl.getPropertyValue('padding-right'))\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\n if (tooltipWidth >= labelWidth) {\n _this.form.formItem[item.key].labelDisabled = false\n\n } else {\n _this.form.formItem[item.key].labelDisabled = true\n }\n}\n\nexport const getTooltipValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options\n if (['input'].includes(type)) {\n return value\n } else if (['select'].includes(type)) {\n if (options && options.options && options.options.length) {\n const item = options.options.filter((item: any) => item.value === value)[0]\n return item && item.label\n }\n\n }\n return null\n}\n\nexport const valueMouseEnter = (e: MouseEvent, item: any, value: any, _this: any) => {\n if (!value || item.showLabel) {\n _this.form.formItem[item.key].valueDisabled = true\n return\n }\n const el = (e.target as any).parentElement.querySelector('.el-input__inner') as HTMLElement\n const timer = [\n 'datetime',\n 'date',\n 'week',\n 'month',\n 'year',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',\n 'radio-button'\n ]\n if (timer.includes(item.type)) {\n _this.form.formItem[item.key].valueDisabled = true\n return\n }\n\n if (['switch', 'radio'].includes(item.type)) {\n _this.form.formItem[item.key].valueDisabled = true\n } else if (el) {\n const inputEl = window.getComputedStyle(el, null)\n const textWidth\n = el.offsetWidth\n - parseInt(inputEl.getPropertyValue('padding-right'))\n - parseInt(inputEl.getPropertyValue('padding-left'))\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\n if (tooltipWidth >= textWidth) {\n _this.form.formItem[item.key].valueDisabled = false\n } else {\n _this.form.formItem[item.key].valueDisabled = true\n\n }\n } else {\n _this.form.formItem[item.key].valueDisabled = false\n }\n}\n\nexport const customPlaceholder = (customName: any, type: string = 'input', name: string = '请输入') => {\n name = type === 'select' ? '请选择' : name\n return name + (customName || '')\n}\n\nexport const formItemSlot = (customName: any, name: string = 'formItem_') => {\n return name + (customName || '')\n}\n"],"names":["labelMouseEnter","e","item","_this","el","labelEl","isRequried","labelWidth","getTooltipValue","value","type","options","valueMouseEnter","inputEl","textWidth","customPlaceholder","customName","name","formItemSlot"],"mappings":"AACO,MAAMA,IAAkB,CAACC,GAAeC,GAAWC,MAAe;AAC/D,QAAAC,IAAMH,EAAE,OAAe,cAAc,eACrCI,IAAU,OAAO,iBAAiBD,GAAI,IAAI,GAC1CE,IAAaJ,EAAK,QAAQ,KAAKA,EAAK,eAAe,GACnDK,IACA,SAASF,EAAQ,iBAAiB,WAAW,CAAC,IAAIC,IAC9C,SAASD,EAAQ,iBAAiB,eAAe,CAAC;AAE5D,EADsBJ,EAAE,OAAe,uBAAuB,eAC1CM,IAChBJ,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB,KAG9CC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAEtD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,GAAG,EAAE,gBAAgB;AAAA,EAElD;AAEA,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAEtD,GAEaa,IAAoB,CAACC,GAAiBN,IAAe,SAASO,IAAe,WAC/EA,IAAAP,MAAS,WAAW,QAAQO,GAC5BA,KAAQD,KAAc,MAGpBE,IAAe,CAACF,GAAiBC,IAAe,gBAClDA,KAAQD,KAAc;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/form/utils/index.ts"],"sourcesContent":["\nexport const labelMouseEnter = (e: MouseEvent, item: any, _this: any) => {\n const el = (e.target as any).parentElement.parentElement\n const labelEl = window.getComputedStyle(el, null)\n const isRequried = item.rules ? 12 : item.beforeWidth || 0\n const labelWidth\n = parseInt(labelEl.getPropertyValue('max-width')) - isRequried\n - parseInt(labelEl.getPropertyValue('padding-right'))\n const tooltipWidth = (e.target as any).previousElementSibling.offsetWidth\n if (tooltipWidth >= labelWidth) {\n _this.form.formItem[item.key].labelDisabled = false\n\n } else {\n _this.form.formItem[item.key].labelDisabled = true\n }\n}\n\nexport const findTreeNode = (treeData: any, key: string, value: string) => {\n const result: any[] = []\n function filterResult(treeData: any) {\n treeData.forEach((item: any) => {\n if ((Array.isArray(value) && value.includes(item[key])) || value === item[key]) {\n result.push(item)\n }\n if (item.children && item.children.length) {\n filterResult(item.children)\n }\n })\n }\n filterResult(treeData)\n return result\n}\n\n\nexport const getTooltipValue = (value: any, item: any): any => {\n const type = item.type\n const options = item.options || {}\n const tempArr: string[] = []\n if (['input', 'input-autocomplete', 'input-number'].includes(type)) {\n return value\n } else if (['select', 'tree-select'].includes(type)) {\n if (options && options.options && options.options.length) {\n let newVal = null\n if (options.valueKey) {\n newVal = value && value[options.valueKey]\n }\n const selectItem = findTreeNode(options.options, options.value === 'object' ? options.valueKey : options.value || 'value', newVal || value)\n selectItem.forEach(item => {\n tempArr.push(item[options.label || 'label'])\n })\n return tempArr.join(',')\n }\n } else if (['cascader'].includes(type)) {\n if (options && options.options && options.options.length) {\n if (options.props?.emitPath === undefined || options.props?.emitPath === true) {\n value = value && value[0]\n }\n\n const selectItem = findTreeNode(options.options, options.props?.value || 'value', value)[0]\n return selectItem && selectItem[options.props?.label || 'label']\n }\n }\n return null\n}\n\nexport const valueMouseEnter = (e: MouseEvent, item: any, value: any, _this: any) => {\n if (!value || item.showLabel) {\n _this.form.formItem[item.key].tempValueDisabled = true\n return\n }\n let el: HTMLElement | null = null\n if (['input', 'input-autocomplete', 'cascader', 'input-number'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-input__inner') as HTMLElement\n } else if (['select', 'tree-select'].includes(item.type)) {\n el = (e.target as any).parentElement.querySelector('.el-select__selected-item.el-select__placeholder') as HTMLElement\n el = el || (e.target as any).parentElement.querySelector('.el-select__selection') as HTMLElement\n }\n const timer = [\n 'datetime',\n 'date',\n 'week',\n 'month',\n 'year',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n 'yearrange',\n 'radio-button',\n 'checkbox',\n 'rate',\n 'textarea',\n 'checkbox-button'\n ]\n if (timer.includes(item.type)) {\n _this.form.formItem[item.key].tempValueDisabled = true\n return\n }\n\n if (['switch', 'radio'].includes(item.type)) {\n _this.form.formItem[item.key].tempValueDisabled = true\n } else if (el) {\n const inputEl = window.getComputedStyle(el, null)\n const textWidth\n = el.offsetWidth\n - parseInt(inputEl.getPropertyValue('padding-right'))\n - parseInt(inputEl.getPropertyValue('padding-left'))\n const tooltipEl = (e.target as any).previousElementSibling\n const tooltipWidth = tooltipEl.offsetWidth\n\n if (tooltipWidth >= textWidth) {\n _this.form.formItem[item.key].tempValueDisabled = false\n } else {\n _this.form.formItem[item.key].tempValueDisabled = true\n\n }\n } else {\n _this.form.formItem[item.key].tempValueDisabled = false\n }\n\n}\n\nexport const customPlaceholder = (customName: any, type: string = 'input', name: string = '请输入') => {\n name = type === 'select' ? '请选择' : name\n return name + (customName || '')\n}\n\nexport const formItemSlot = (customName: any, name: string = 'formItem_') => {\n return name + (customName || '')\n}\n"],"names":["labelMouseEnter","e","item","_this","el","labelEl","isRequried","labelWidth","findTreeNode","treeData","key","value","result","filterResult","getTooltipValue","_a","_b","_c","_d","type","options","tempArr","newVal","selectItem","valueMouseEnter","inputEl","textWidth","customPlaceholder","customName","name","formItemSlot"],"mappings":"AACO,MAAMA,IAAkB,CAACC,GAAeC,GAAWC,MAAe;AAC/D,QAAAC,IAAMH,EAAE,OAAe,cAAc,eACrCI,IAAU,OAAO,iBAAiBD,GAAI,IAAI,GAC1CE,IAAaJ,EAAK,QAAQ,KAAKA,EAAK,eAAe,GACnDK,IACA,SAASF,EAAQ,iBAAiB,WAAW,CAAC,IAAIC,IAC9C,SAASD,EAAQ,iBAAiB,eAAe,CAAC;AAE5D,EADsBJ,EAAE,OAAe,uBAAuB,eAC1CM,IAChBJ,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB,KAG9CC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,gBAAgB;AAEtD,GAEaM,IAAe,CAACC,GAAeC,GAAaC,MAAkB;AACvE,QAAMC,IAAgB,CAAA;AACtB,WAASC,EAAaJ,GAAe;AACjCA,IAAAA,EAAS,QAAQ,CAACP,MAAc;AAC5B,OAAK,MAAM,QAAQS,CAAK,KAAKA,EAAM,SAAST,EAAKQ,CAAG,CAAC,KAAMC,MAAUT,EAAKQ,CAAG,MACzEE,EAAO,KAAKV,CAAI,GAEhBA,EAAK,YAAYA,EAAK,SAAS,UAC/BW,EAAaX,EAAK,QAAQ;AAAA,IAC9B,CACH;AAAA,EACL;AACA,SAAAW,EAAaJ,CAAQ,GACdG;AACX,GAGaE,IAAkB,CAACH,GAAYT,MAAmB;AAjCxD,MAAAa,GAAAC,GAAAC,GAAAC;AAkCH,QAAMC,IAAOjB,EAAK,MACZkB,IAAUlB,EAAK,WAAW,IAC1BmB,IAAoB,CAAA;AAC1B,MAAI,CAAC,SAAS,sBAAsB,cAAc,EAAE,SAASF,CAAI;AACtD,WAAAR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AAMH,EAAE,OAAe,cAAc,cAAc,kDAAkD,GACrGG,IAAKA,KAAOH,EAAE,OAAe,cAAc,cAAc,uBAAuB,IAEtE;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EAEM,SAASC,EAAK,IAAI,GAAG;AAC3B,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,oBAAoB;AAClD;AAAA,EACJ;AAEA,MAAI,CAAC,UAAU,OAAO,EAAE,SAASA,EAAK,IAAI;AACtC,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,oBAAoB;AAAA,WAC3CE,GAAI;AACX,UAAMqB,IAAU,OAAO,iBAAiBrB,GAAI,IAAI,GAC1CsB,IACItB,EAAG,cACC,SAASqB,EAAQ,iBAAiB,eAAe,CAAC,IAClD,SAASA,EAAQ,iBAAiB,cAAc,CAAC;AAI/D,IAHmBxB,EAAE,OAAe,uBACL,eAEXyB,IAChBvB,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,oBAAoB,KAElDC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,oBAAoB;AAAA,EAEtD;AAEA,IAAAC,EAAM,KAAK,SAASD,EAAK,GAAG,EAAE,oBAAoB;AAG1D,GAEayB,IAAoB,CAACC,GAAiBT,IAAe,SAASU,IAAe,WAC/EA,IAAAV,MAAS,WAAW,QAAQU,GAC5BA,KAAQD,KAAc,MAGpBE,IAAe,CAACF,GAAiBC,IAAe,gBAClDA,KAAQD,KAAc;"}
@@ -1,22 +1,22 @@
1
- const _ = (n, t) => {
2
- n == null || n.setCheckedNodes(t);
3
- }, k = (n, t, e) => {
4
- n.checked = e || t;
5
- }, o = async (n, t) => {
6
- for (let e = 0; e < t.length; e++)
7
- t[e].checked === void 0 ? (t[e].checked = !0, await (n == null ? void 0 : n.setChecked(t[e].prop, !0))) : t[e].checked !== void 0 && await (n == null ? void 0 : n.setChecked(t[e].prop, t[e].checked)), t[e].children && t[e].children.length && o(n, t[e].children);
8
- }, C = (n, t, e) => n.level === t.level && n.parent === t.parent ? e === "prev" || e === "next" : !1, v = async (n, t) => {
9
- o(t, [n.data]);
10
- }, x = (n, t, e, r, H, l) => {
1
+ const _ = (t, n) => {
2
+ t == null || t.setCheckedNodes(n);
3
+ }, k = (t, n, e) => {
4
+ t.checked = e || n;
5
+ }, p = async (t, n) => {
6
+ for (let e = 0; e < n.length; e++)
7
+ n[e].checked === void 0 ? (n[e].checked = !0, await (t == null ? void 0 : t.setChecked(n[e].prop, !0))) : n[e].checked !== void 0 && await (t == null ? void 0 : t.setChecked(n[e].prop, n[e].checked)), n[e].children && n[e].children.length && p(t, n[e].children);
8
+ }, C = (t, n, e) => t.level === n.level && t.parent === n.parent ? e === "prev" || e === "next" : !1, v = async (t, n) => {
9
+ p(n, [t.data]);
10
+ }, x = (t, n, e, r, H, l) => {
11
11
  if (!l.height) {
12
12
  e && e.parentElement && e.parentElement.parentElement && (e.parentElement.parentElement.style.height = "100%");
13
- const h = e && parseInt(window.getComputedStyle(e.parentElement, null).paddingTop), c = e && parseInt(window.getComputedStyle(e.parentElement, null).paddingBottom), f = t && t.offsetHeight || 0, a = t && parseInt(window.getComputedStyle(t, null).marginTop) || 0, m = t && parseInt(window.getComputedStyle(t, null).marginBottom) || 0, i = n && n.headerFooter, g = i && i.offsetHeight || 0, u = r && r.offsetHeight || 0, w = r && parseInt(window.getComputedStyle(r, null).marginTop) || 0, d = e && e.parentElement && e.parentElement.offsetHeight - f - g - u - w - a - h - c, s = e && e.querySelector(".el-table__header-wrapper table").offsetHeight || 0, p = e && e.querySelector(".el-table__body-wrapper table").offsetHeight || 0, E = e && (e.querySelector(".el-table__body-wrapper.is-scrolling-left") || e.querySelector(".el-table__body-wrapper.is-scrolling-right") || e.querySelector(".el-table__body-wrapper.is-scrolling-middle")) ? 17 : 0;
14
- e && (s + p + m > d || l.data && l.data.length === 0 ? (e.style.height = "0px", e.style.flex = "1", e.parentElement && e.parentElement.parentElement && (e.parentElement.parentElement.style.height = "100%")) : (e.style.height = p + s + 1 + E + "px", e.style.flex = "unset", e.parentElement && e.parentElement.parentElement && (e.parentElement.parentElement.style.height = "auto")));
13
+ const h = e && parseInt(window.getComputedStyle(e.parentElement, null).paddingTop), c = e && parseInt(window.getComputedStyle(e.parentElement, null).paddingBottom), f = n && n.offsetHeight || 0, m = n && parseInt(window.getComputedStyle(n, null).marginTop) || 0, g = n && parseInt(window.getComputedStyle(n, null).marginBottom) || 0, i = t && t.headerFooter, u = i && i.offsetHeight || 0, a = r && r.offsetHeight || 0, w = r && parseInt(window.getComputedStyle(r, null).marginTop) || 0, E = e && e.parentElement && e.parentElement.offsetHeight - f - u - a - w - m - h - c, s = e && e.querySelector(".el-table__header-wrapper table").offsetHeight || 0, o = e && e.querySelector(".el-table__body-wrapper table").offsetHeight || 0, d = e && (e.querySelector(".el-table__body-wrapper.is-scrolling-left") || e.querySelector(".el-table__body-wrapper.is-scrolling-right") || e.querySelector(".el-table__body-wrapper.is-scrolling-middle")) ? 17 : 0;
14
+ e && (s + o + g > E || l.data && l.data.length === 0 ? (e.style.height = "0px", e.style.flex = "1", e.parentElement && e.parentElement.parentElement && (e.parentElement.parentElement.style.height = "100%")) : (e.style.height = o + s + 1 + d + "px", e.style.flex = "unset", e.parentElement && e.parentElement.parentElement && (e.parentElement.parentElement.style.height = "auto")));
15
15
  }
16
16
  }, q = {
17
17
  children: "children",
18
18
  label: "label",
19
- class: (n) => n.show === !1 || n.setting || ["index", "selection"].includes(n.type) || ["selection"].includes(n.prop) ? "hide" : ""
19
+ class: (t) => (typeof t.show == "function" ? t.show(t) === !1 : t.show === !1) || t.setting || ["index", "selection"].includes(t.type) || ["selection"].includes(t.prop) ? "hide" : ""
20
20
  };
21
21
  export {
22
22
  _ as allShow,
@@ -24,7 +24,7 @@ export {
24
24
  k as checkTree,
25
25
  v as nodeDragEnd,
26
26
  x as resizeTaleHeight,
27
- o as treeNode,
27
+ p as treeNode,
28
28
  q as treeProps
29
29
  };
30
30
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/table/hooks/index.ts"],"sourcesContent":["\n\nimport type {RewriteTableColumnCtx, SelectTable, RewriteTableProps} from '../types/index'\nimport type Node from 'element-plus/es/components/tree/src/model/node'\nimport type {\n AllowDropType,\n} from 'element-plus/es/components/tree/src/tree.type'\n\nexport const allShow = (selectTable: any, tableColumns: RewriteTableColumnCtx[]) => {\n selectTable?.setCheckedNodes(tableColumns)\n}\n\nexport const checkTree = (data: Node, checked: boolean, childChecked: boolean) => {\n data.checked = childChecked || checked\n}\n\nexport const treeNode = async (selectTable: any, treeData2: any) => {\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < treeData2.length; i++) {\n if (treeData2[i].checked === undefined) {\n treeData2[i].checked = true\n await selectTable?.setChecked(treeData2[i].prop, true)\n } else if (treeData2[i].checked !== undefined) {\n await selectTable?.setChecked(treeData2[i].prop, treeData2[i].checked)\n }\n if (treeData2[i].children && treeData2[i].children.length) {\n treeNode(selectTable, treeData2[i].children)\n }\n }\n}\n\nexport const allowDrop = (draggingNode: Node, dropNode: Node, type: AllowDropType) => {\n if (draggingNode.level === dropNode.level) {\n if (draggingNode.parent === dropNode.parent) {\n return type === 'prev' || type === 'next'\n } else {\n return false\n }\n } else {\n // 不同级进行处理\n return false\n }\n}\n\nexport const nodeDragEnd = async (node: Node, selectTable: SelectTable) => {\n treeNode(selectTable, [node.data])\n}\n\nexport const resizeTaleHeight = (table: any, header: any, body: any, footer: any, headerFooterRef: any, tableProps: RewriteTableProps) => {\n if (!tableProps.height) {\n\n if (body && body.parentElement && body.parentElement.parentElement) {\n body.parentElement.parentElement.style.height = '100%'\n }\n\n const bodyPPT = (body && parseInt(window.getComputedStyle(body.parentElement, null).paddingTop))\n const bodyPPB = (body && parseInt(window.getComputedStyle(body.parentElement, null).paddingBottom))\n\n const headerH = (header && header.offsetHeight) || 0\n const headerMT = (header && parseInt(window.getComputedStyle(header, null).marginTop)) || 0\n const headerBT = (header && parseInt(window.getComputedStyle(header, null).marginBottom)) || 0\n\n const headerFooter = table && table.headerFooter\n const headerFooterH = (headerFooter && headerFooter.offsetHeight) || 0\n\n const footerH = (footer && footer.offsetHeight) || 0\n const footerMT = (footer && parseInt(window.getComputedStyle(footer, null).marginTop)) || 0\n const bodyCurrentH = body && body.parentElement && (body.parentElement.offsetHeight - headerH - headerFooterH - footerH - footerMT - headerMT - bodyPPT - bodyPPB)\n\n const tableHeaderH = (body && body.querySelector('.el-table__header-wrapper table').offsetHeight) || 0\n const tableBodyH = (body && body.querySelector('.el-table__body-wrapper table').offsetHeight) || 0\n\n\n const isXOverflow = (body && (body.querySelector('.el-table__body-wrapper.is-scrolling-left') || body.querySelector('.el-table__body-wrapper.is-scrolling-right') || body.querySelector('.el-table__body-wrapper.is-scrolling-middle')))\n const xOverflowH = isXOverflow ? 17 : 0\n\n // 当表格头和表格内容大于\n if (body) {\n if ((tableHeaderH + tableBodyH + headerBT) > bodyCurrentH || (tableProps.data && tableProps.data.length === 0)) {\n body.style.height = '0px'\n body.style.flex = '1'\n\n if (body.parentElement && body.parentElement.parentElement) {\n body.parentElement.parentElement.style.height = '100%'\n }\n } else {\n body.style.height = (tableBodyH + tableHeaderH + 1 + xOverflowH) + 'px'\n body.style.flex = 'unset'\n\n if (body.parentElement && body.parentElement.parentElement) {\n body.parentElement.parentElement.style.height = 'auto'\n }\n\n }\n }\n }\n}\n\nexport const treeProps = {\n children: 'children',\n label: 'label',\n class: (data: any) => {\n const hide = data.show === false || data.setting || ['index', 'selection'].includes(data.type) || ['selection'].includes(data.prop) ? 'hide' : ''\n return hide\n }\n}\n"],"names":["allShow","selectTable","tableColumns","checkTree","data","checked","childChecked","treeNode","treeData2","i","allowDrop","draggingNode","dropNode","type","nodeDragEnd","node","resizeTaleHeight","table","header","body","footer","headerFooterRef","tableProps","bodyPPT","bodyPPB","headerH","headerMT","headerBT","headerFooter","headerFooterH","footerH","footerMT","bodyCurrentH","tableHeaderH","tableBodyH","xOverflowH","treeProps"],"mappings":"AAQa,MAAAA,IAAU,CAACC,GAAkBC,MAA0C;AAChF,EAAAD,KAAA,QAAAA,EAAa,gBAAgBC;AACjC,GAEaC,IAAY,CAACC,GAAYC,GAAkBC,MAA0B;AAC9E,EAAAF,EAAK,UAAUE,KAAgBD;AACnC,GAEaE,IAAW,OAAON,GAAkBO,MAAmB;AAGhE,WAASC,IAAI,GAAGA,IAAID,EAAU,QAAQC;AAClC,IAAID,EAAUC,CAAC,EAAE,YAAY,UACfD,EAAAC,CAAC,EAAE,UAAU,IACvB,OAAMR,KAAA,gBAAAA,EAAa,WAAWO,EAAUC,CAAC,EAAE,MAAM,QAC1CD,EAAUC,CAAC,EAAE,YAAY,UAC1B,OAAAR,KAAA,gBAAAA,EAAa,WAAWO,EAAUC,CAAC,EAAE,MAAMD,EAAUC,CAAC,EAAE,WAE9DD,EAAUC,CAAC,EAAE,YAAYD,EAAUC,CAAC,EAAE,SAAS,UAC/CF,EAASN,GAAaO,EAAUC,CAAC,EAAE,QAAQ;AAGvD,GAEaC,IAAY,CAACC,GAAoBC,GAAgBC,MACtDF,EAAa,UAAUC,EAAS,SAC5BD,EAAa,WAAWC,EAAS,SAC1BC,MAAS,UAAUA,MAAS,SAMhC,IAIFC,IAAc,OAAOC,GAAYd,MAA6B;AACvE,EAAAM,EAASN,GAAa,CAACc,EAAK,IAAI,CAAC;AACrC,GAEaC,IAAmB,CAACC,GAAYC,GAAaC,GAAWC,GAAaC,GAAsBC,MAAkC;AAClI,MAAA,CAACA,EAAW,QAAQ;AAEpB,IAAIH,KAAQA,EAAK,iBAAiBA,EAAK,cAAc,kBAC5CA,EAAA,cAAc,cAAc,MAAM,SAAS;AAG9C,UAAAI,IAAWJ,KAAQ,SAAS,OAA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OAAO;AAAA,EACP,OAAO,CAAChC,MACSA,EAAK,SAAS,MAASA,EAAK,WAAW,CAAC,SAAS,WAAW,EAAE,SAASA,EAAK,IAAI,KAAK,CAAC,WAAW,EAAE,SAASA,EAAK,IAAI,IAAI,SAAS;AAGvJ;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/table/hooks/index.ts"],"sourcesContent":["\n\nimport type {RewriteTableColumnCtx, SelectTable, RewriteTableProps} from '../types/index'\nimport type Node from 'element-plus/es/components/tree/src/model/node'\nimport type {\n AllowDropType,\n} from 'element-plus/es/components/tree/src/tree.type'\n\nexport const allShow = (selectTable: any, tableColumns: RewriteTableColumnCtx[]) => {\n selectTable?.setCheckedNodes(tableColumns)\n}\n\nexport const checkTree = (data: Node, checked: boolean, childChecked: boolean) => {\n data.checked = childChecked || checked\n}\n\nexport const treeNode = async (selectTable: any, treeData2: any) => {\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < treeData2.length; i++) {\n if (treeData2[i].checked === undefined) {\n treeData2[i].checked = true\n await selectTable?.setChecked(treeData2[i].prop, true)\n } else if (treeData2[i].checked !== undefined) {\n await selectTable?.setChecked(treeData2[i].prop, treeData2[i].checked)\n }\n if (treeData2[i].children && treeData2[i].children.length) {\n treeNode(selectTable, treeData2[i].children)\n }\n }\n}\n\nexport const allowDrop = (draggingNode: Node, dropNode: Node, type: AllowDropType) => {\n if (draggingNode.level === dropNode.level) {\n if (draggingNode.parent === dropNode.parent) {\n return type === 'prev' || type === 'next'\n } else {\n return false\n }\n } else {\n // 不同级进行处理\n return false\n }\n}\n\nexport const nodeDragEnd = async (node: Node, selectTable: SelectTable) => {\n treeNode(selectTable, [node.data])\n}\n\nexport const resizeTaleHeight = (table: any, header: any, body: any, footer: any, headerFooterRef: any, tableProps: RewriteTableProps) => {\n if (!tableProps.height) {\n\n if (body && body.parentElement && body.parentElement.parentElement) {\n body.parentElement.parentElement.style.height = '100%'\n }\n\n const bodyPPT = (body && parseInt(window.getComputedStyle(body.parentElement, null).paddingTop))\n const bodyPPB = (body && parseInt(window.getComputedStyle(body.parentElement, null).paddingBottom))\n\n const headerH = (header && header.offsetHeight) || 0\n const headerMT = (header && parseInt(window.getComputedStyle(header, null).marginTop)) || 0\n const headerBT = (header && parseInt(window.getComputedStyle(header, null).marginBottom)) || 0\n\n const headerFooter = table && table.headerFooter\n const headerFooterH = (headerFooter && headerFooter.offsetHeight) || 0\n\n const footerH = (footer && footer.offsetHeight) || 0\n const footerMT = (footer && parseInt(window.getComputedStyle(footer, null).marginTop)) || 0\n const bodyCurrentH = body && body.parentElement && (body.parentElement.offsetHeight - headerH - headerFooterH - footerH - footerMT - headerMT - bodyPPT - bodyPPB)\n\n const tableHeaderH = (body && body.querySelector('.el-table__header-wrapper table').offsetHeight) || 0\n const tableBodyH = (body && body.querySelector('.el-table__body-wrapper table').offsetHeight) || 0\n\n\n const isXOverflow = (body && (body.querySelector('.el-table__body-wrapper.is-scrolling-left') || body.querySelector('.el-table__body-wrapper.is-scrolling-right') || body.querySelector('.el-table__body-wrapper.is-scrolling-middle')))\n const xOverflowH = isXOverflow ? 17 : 0\n\n // 当表格头和表格内容大于\n if (body) {\n if ((tableHeaderH + tableBodyH + headerBT) > bodyCurrentH || (tableProps.data && tableProps.data.length === 0)) {\n body.style.height = '0px'\n body.style.flex = '1'\n\n if (body.parentElement && body.parentElement.parentElement) {\n body.parentElement.parentElement.style.height = '100%'\n }\n } else {\n body.style.height = (tableBodyH + tableHeaderH + 1 + xOverflowH) + 'px'\n body.style.flex = 'unset'\n\n if (body.parentElement && body.parentElement.parentElement) {\n body.parentElement.parentElement.style.height = 'auto'\n }\n\n }\n }\n }\n}\n\nexport const treeProps = {\n children: 'children',\n label: 'label',\n class: (data: any) => {\n const hide = (typeof data.show === 'function' ? data.show(data) === false : data.show === false) || data.setting || ['index', 'selection'].includes(data.type) || ['selection'].includes(data.prop) ? 'hide' : ''\n return hide\n }\n}\n"],"names":["allShow","selectTable","tableColumns","checkTree","data","checked","childChecked","treeNode","treeData2","i","allowDrop","draggingNode","dropNode","type","nodeDragEnd","node","resizeTaleHeight","table","header","body","footer","headerFooterRef","tableProps","bodyPPT","bodyPPB","headerH","headerMT","headerBT","headerFooter","headerFooterH","footerH","footerMT","bodyCurrentH","tableHeaderH","tableBodyH","xOverflowH","treeProps"],"mappings":"AAQa,MAAAA,IAAU,CAACC,GAAkBC,MAA0C;AAChF,EAAAD,KAAA,QAAAA,EAAa,gBAAgBC;AACjC,GAEaC,IAAY,CAACC,GAAYC,GAAkBC,MAA0B;AAC9E,EAAAF,EAAK,UAAUE,KAAgBD;AACnC,GAEaE,IAAW,OAAON,GAAkBO,MAAmB;AAGhE,WAASC,IAAI,GAAGA,IAAID,EAAU,QAAQC;AAClC,IAAID,EAAUC,CAAC,EAAE,YAAY,UACfD,EAAAC,CAAC,EAAE,UAAU,IACvB,OAAMR,KAAA,gBAAAA,EAAa,WAAWO,EAAUC,CAAC,EAAE,MAAM,QAC1CD,EAAUC,CAAC,EAAE,YAAY,UAC1B,OAAAR,KAAA,gBAAAA,EAAa,WAAWO,EAAUC,CAAC,EAAE,MAAMD,EAAUC,CAAC,EAAE,WAE9DD,EAAUC,CAAC,EAAE,YAAYD,EAAUC,CAAC,EAAE,SAAS,UAC/CF,EAASN,GAAaO,EAAUC,CAAC,EAAE,QAAQ;AAGvD,GAEaC,IAAY,CAACC,GAAoBC,GAAgBC,MACtDF,EAAa,UAAUC,EAAS,SAC5BD,EAAa,WAAWC,EAAS,SAC1BC,MAAS,UAAUA,MAAS,SAMhC,IAIFC,IAAc,OAAOC,GAAYd,MAA6B;AACvE,EAAAM,EAASN,GAAa,CAACc,EAAK,IAAI,CAAC;AACrC,GAEaC,IAAmB,CAACC,GAAYC,GAAaC,GAAWC,GAAaC,GAAsBC,MAAkC;AAClI,MAAA,CAACA,EAAW,QAAQ;AAEpB,IAAIH,KAAQA,EAAK,iBAAiBA,EAAK,cAAc,kBAC5CA,EAAA,cAA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