@web-utils/form-ui 1.0.0-beta4 → 1.0.0-beta41

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 (189) hide show
  1. package/api/index.d.ts +60 -0
  2. package/api/index.mjs +42 -0
  3. package/awesome-button/index.d.ts +60 -0
  4. package/awesome-button/index.mjs +49 -0
  5. package/base.css +1 -0
  6. package/chunks/4GMuTlFS.mjs +25 -0
  7. package/chunks/B-YO6Py8.mjs +145 -0
  8. package/chunks/B1MSrc6f.mjs +8 -0
  9. package/chunks/B40JZqF5.mjs +60 -0
  10. package/chunks/BLNpMvUQ.mjs +95 -0
  11. package/chunks/BNQD6fKI.mjs +40 -0
  12. package/chunks/BROfNO6c.mjs +17 -0
  13. package/chunks/BiF8cEVB.mjs +102 -0
  14. package/chunks/Bm5eiSmT.mjs +79 -0
  15. package/chunks/C5BjmbyR.mjs +91 -0
  16. package/chunks/CBHZpxPE.mjs +108 -0
  17. package/chunks/CD2WYSl1.mjs +188 -0
  18. package/chunks/CE0MejA6.mjs +200 -0
  19. package/chunks/CSf0Lu3w.mjs +102 -0
  20. package/chunks/CXSIP67a.mjs +234 -0
  21. package/chunks/ChmDDqoZ2.mjs +478 -0
  22. package/chunks/ClpNoMQe.mjs +37 -0
  23. package/chunks/Csa9EgOO.mjs +152 -0
  24. package/chunks/CuBH-6_y.mjs +25 -0
  25. package/chunks/CybmpSN8.mjs +664 -0
  26. package/chunks/CzvmkGvn.mjs +89 -0
  27. package/chunks/DASUt7ot.mjs +166 -0
  28. package/chunks/DBNqhkDl.mjs +174 -0
  29. package/chunks/DMcUruCK2.mjs +207 -0
  30. package/chunks/DUjgfS7g.mjs +95 -0
  31. package/chunks/DWLv8UUC.mjs +612 -0
  32. package/chunks/Ds_Tpa_M.mjs +83 -0
  33. package/chunks/MeM8FGzA.mjs +200 -0
  34. package/chunks/_90XRi0U.mjs +105 -0
  35. package/chunks/_Uzl3uMy.mjs +109 -0
  36. package/chunks/b5HOxD60.mjs +1369 -0
  37. package/chunks/cmuHpsX6.mjs +109 -0
  38. package/chunks/ePSxkHli.mjs +95 -0
  39. package/chunks/jHrYQI1Q.mjs +320 -0
  40. package/chunks/kKoMKOYH.mjs +180 -0
  41. package/chunks/lPLJkGiz.mjs +25 -0
  42. package/chunks/mbLUSXcZ.mjs +56 -0
  43. package/chunks/y-DmM31a.mjs +168 -0
  44. package/confirm-button/index.d.ts +113 -0
  45. package/confirm-button/index.mjs +35 -0
  46. package/confirmable/index.d.ts +84 -0
  47. package/confirmable/index.mjs +8 -0
  48. package/constants/index.d.ts +53 -0
  49. package/constants/index.mjs +4 -0
  50. package/editable-tree/index.d.ts +254 -0
  51. package/editable-tree/index.mjs +2 -0
  52. package/editable-tree/style.css +1 -0
  53. package/element-dialog/index.d.ts +337 -16
  54. package/element-dialog/index.mjs +2 -91
  55. package/empty-view/index.d.ts +2 -2
  56. package/empty-view/index.mjs +1 -1
  57. package/flex-scroll-area/index.d.ts +1 -1
  58. package/flex-scroll-area/index.mjs +1 -1
  59. package/form-advice/index.mjs +13 -12
  60. package/form-button/index.d.ts +114 -0
  61. package/form-button/index.mjs +36 -0
  62. package/form-card/index.d.ts +14 -0
  63. package/form-card/index.mjs +18 -0
  64. package/form-cascader/index.d.ts +472 -0
  65. package/form-cascader/index.mjs +2 -0
  66. package/form-check-box-group/index.d.ts +289 -18
  67. package/form-check-box-group/index.mjs +1 -1
  68. package/form-check-box-group/style.css +1 -0
  69. package/form-checkbox/index.d.ts +236 -16
  70. package/form-checkbox/index.mjs +1 -1
  71. package/form-date-picker/index.d.ts +390 -19
  72. package/form-date-picker/index.mjs +1 -1
  73. package/form-holder/index.d.ts +87 -20
  74. package/form-holder/index.mjs +1 -1
  75. package/form-holder/style.css +1 -1
  76. package/form-image/index.d.ts +145 -13
  77. package/form-image/index.mjs +1 -1
  78. package/form-input/index.d.ts +301 -20
  79. package/form-input/index.mjs +1 -1
  80. package/form-input/style.css +1 -0
  81. package/form-input-cron-expression/index.d.ts +217 -0
  82. package/form-input-cron-expression/index.mjs +2 -0
  83. package/form-input-cron-expression/style.css +1 -0
  84. package/form-input-email/index.d.ts +307 -16
  85. package/form-input-email/index.mjs +1 -1
  86. package/form-input-id-card/index.d.ts +307 -16
  87. package/form-input-id-card/index.mjs +1 -1
  88. package/form-input-number/index.d.ts +246 -18
  89. package/form-input-number/index.mjs +1 -1
  90. package/form-input-phone-number/index.d.ts +307 -16
  91. package/form-input-phone-number/index.mjs +1 -1
  92. package/form-input-tag/index.d.ts +263 -1
  93. package/form-input-tag/index.mjs +1 -3
  94. package/form-input-time/index.d.ts +434 -1
  95. package/form-input-time/index.mjs +1 -3
  96. package/form-item-config-provider/index.d.ts +22 -0
  97. package/form-item-config-provider/index.mjs +24 -0
  98. package/form-item-group/index.d.ts +91 -17
  99. package/form-item-group/index.mjs +2 -78
  100. package/form-item-group/style.css +1 -1
  101. package/form-item-x/index.d.ts +141 -11
  102. package/form-item-x/index.mjs +1 -1
  103. package/form-item-x/style.css +1 -0
  104. package/form-radio-group/index.d.ts +303 -16
  105. package/form-radio-group/index.mjs +1 -1
  106. package/form-rate/index.d.ts +254 -14
  107. package/form-rate/index.mjs +1 -1
  108. package/form-red-table/index.mjs +27 -26
  109. package/form-row/index.d.ts +2 -2
  110. package/form-row/index.mjs +1 -1
  111. package/form-select/index.d.ts +537 -18
  112. package/form-select/index.mjs +1 -1
  113. package/form-slider/index.d.ts +283 -16
  114. package/form-slider/index.mjs +1 -1
  115. package/form-switch/index.d.ts +272 -14
  116. package/form-switch/index.mjs +1 -1
  117. package/form-text/index.d.ts +165 -13
  118. package/form-text/index.mjs +1 -1
  119. package/form-textarea/index.d.ts +351 -0
  120. package/form-textarea/index.mjs +2 -0
  121. package/form-time-select/index.d.ts +319 -0
  122. package/form-time-select/index.mjs +2 -0
  123. package/form-view/index.mjs +1 -1
  124. package/helper/dictionary.d.ts +15 -0
  125. package/helper/dictionary.mjs +97 -0
  126. package/hook/useDictionary.d.ts +60 -0
  127. package/hook/useDictionary.mjs +15 -0
  128. package/hook/useVisibilityChange.d.ts +4 -0
  129. package/hook/useVisibilityChange.mjs +14 -0
  130. package/iframe-window/index.d.ts +9 -0
  131. package/iframe-window/index.mjs +37 -0
  132. package/iframe-window/style.css +1 -0
  133. package/index.d.ts +52 -36
  134. package/index.mjs +54 -61
  135. package/package.json +10 -5
  136. package/pageable-table/index.d.ts +398 -0
  137. package/pageable-table/index.mjs +2 -0
  138. package/pageable-table/style.css +1 -0
  139. package/resize-observer/index.d.ts +8 -0
  140. package/resize-observer/index.mjs +40 -0
  141. package/resize-observer/style.css +1 -0
  142. package/resolver/index.mjs +29 -0
  143. package/table-column/index.d.ts +160 -0
  144. package/table-column/index.mjs +2 -0
  145. package/table-column/style.css +1 -0
  146. package/table-column-def/index.d.ts +85 -0
  147. package/table-column-def/index.mjs +11 -0
  148. package/table-view/index.d.ts +340 -1
  149. package/table-view/index.mjs +459 -6
  150. package/table-view/style.css +1 -0
  151. package/toolbar/index.d.ts +128 -1
  152. package/toolbar/index.mjs +1 -8
  153. package/toolbar/style.css +1 -0
  154. package/toolbar-button/index.d.ts +188 -1
  155. package/toolbar-button/index.mjs +1 -8
  156. package/vue-cron/index.d.ts +191 -0
  157. package/vue-cron/index.mjs +2 -0
  158. package/vue-cron/style.css +1 -0
  159. package/web-types.json +1 -1
  160. package/x-input-tag/index.d.ts +2 -0
  161. package/x-input-tag/index.mjs +232 -0
  162. package/x-input-tag/style.css +1 -0
  163. package/year-calendar/index.d.ts +99 -0
  164. package/year-calendar/index.mjs +2 -0
  165. package/year-calendar/style.css +1 -0
  166. package/chunks/B4M_TFeR.mjs +0 -152
  167. package/chunks/B5BIQCcK.mjs +0 -149
  168. package/chunks/BHNKrW1j.mjs +0 -61
  169. package/chunks/BO9jWhBl.mjs +0 -46
  170. package/chunks/BZ8aOa78.mjs +0 -35
  171. package/chunks/Bsz7y4Xp.mjs +0 -73
  172. package/chunks/Bxj372sF.mjs +0 -53
  173. package/chunks/C33EmJN8.mjs +0 -32
  174. package/chunks/C6Li3-l7.mjs +0 -28
  175. package/chunks/CBcdalMX.mjs +0 -35
  176. package/chunks/CdRsyF0n.mjs +0 -43
  177. package/chunks/ClNahmiU.mjs +0 -23
  178. package/chunks/CstztYMu.mjs +0 -28
  179. package/chunks/DC9b53M6.mjs +0 -32
  180. package/chunks/DDVAgRED.mjs +0 -36
  181. package/chunks/DpJQABVD.mjs +0 -91
  182. package/chunks/ZsLNWI9x.mjs +0 -46
  183. package/chunks/jn_iQrVZ.mjs +0 -28
  184. package/constants.d.ts +0 -1
  185. package/constants.mjs +0 -4
  186. package/input/style.css +0 -1
  187. package/resolver.mjs +0 -79
  188. package/utils/style.css +0 -1
  189. /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
@@ -0,0 +1,109 @@
1
+ import { camelize as e, capitalize as t, copy as n, hyphenate as r, isArray as i, isFunction as a, isString as o, uncapitalize as s } from "@web-utils/core";
2
+ import { computed as c, useAttrs as l } from "vue";
3
+ import { ElMessage as u } from "element-plus";
4
+ //#region src/utils/index.ts
5
+ var d = (e, n, r, i, a = !0) => {
6
+ let o = {};
7
+ if (n) for (let t in e) n(t) && (o[t] = e[t]);
8
+ return a && r && r.forEach((e) => {
9
+ o[`on${t(e)}`] = (...t) => i(e, ...t);
10
+ }), o;
11
+ }, f = (e, t) => c(() => {
12
+ let n = {};
13
+ if (t) for (let r in e) t(r) && (n[r] = e[r]);
14
+ return n;
15
+ }), p = ({ removeOn: t = !1, include: n, exclude: r } = {}) => {
16
+ let i = l();
17
+ return c(() => {
18
+ let a = {}, o = {}, c = {}, l = !1;
19
+ (n || r) && (l = !0), n == null || n.forEach((t) => {
20
+ o[e(t)] = !0;
21
+ }), r == null || r.forEach((t) => {
22
+ c[e(t)] = !0;
23
+ });
24
+ for (let e in i) if (e.startsWith("on")) {
25
+ let u = s(e.replace(/^on/, ""));
26
+ if (l && (n && o[u] !== !0 || r && c[u] === !0)) continue;
27
+ t ? a[u] = i[e] : a[e] = i[e];
28
+ }
29
+ return a;
30
+ });
31
+ }, m = (e, { predicate: t, removeOn: n }) => ({
32
+ listeners: p({ removeOn: n }),
33
+ autoBindProps: f(e, t)
34
+ }), h = (e, { withOn: t = !1 } = {}) => {
35
+ let n = {};
36
+ for (let r in e) r.startsWith("on") && (t ? n[r] = e[r] : n[s(r.replace(/^on/, ""))] = e[r]);
37
+ return n;
38
+ }, g = (e, t = "id", n = "label") => {
39
+ let r = [];
40
+ function i(e, a) {
41
+ if (!e) return;
42
+ let o = [...a, {
43
+ [t]: e[t],
44
+ [n]: e[n]
45
+ }];
46
+ if (!e.children || e.children.length === 0) {
47
+ r.push(o);
48
+ return;
49
+ }
50
+ e.children.forEach((e) => {
51
+ i(e, o);
52
+ });
53
+ }
54
+ return e.forEach((e) => i(e, [])), r;
55
+ }, _ = (e, t = "id", n = "label") => {
56
+ let r = [];
57
+ return g(e).forEach((e) => {
58
+ let i = [], a = [];
59
+ for (let r = 0; r < e.length; r++) i.push(e[r][t]), a.push(e[r][n]);
60
+ r.push({
61
+ value: i.join("/"),
62
+ label: a.join("/")
63
+ });
64
+ }), r;
65
+ }, v = (e, t = "id", n = "label") => {
66
+ let r = {};
67
+ return g(e).forEach((e) => {
68
+ let i = [], a = [];
69
+ for (let r = 0; r < e.length; r++) i.push(e[r][t]), a.push(e[r][n]);
70
+ r[i.join("/")] = {
71
+ value: i.join("/"),
72
+ label: a.join("/")
73
+ };
74
+ }), r;
75
+ };
76
+ function y(e) {
77
+ n(e, () => u.success({
78
+ duration: 1e3,
79
+ message: "复制成功!",
80
+ type: "success"
81
+ }), () => u.error({
82
+ duration: 1e3,
83
+ message: "复制失败!",
84
+ type: "error"
85
+ }));
86
+ }
87
+ var b = (e) => {
88
+ let t = [];
89
+ return e && (i(e) ? e.forEach((e) => {
90
+ i(e) ? t.push(...b(e)) : e && t.push(e);
91
+ }) : e && t.push(e)), t;
92
+ }, x = (e = "", t = {}) => {
93
+ let n = t || {};
94
+ return (e || "").replace(/{(.*?)}/g, (e, t) => {
95
+ if (t.indexOf(":")) {
96
+ let [e, r] = t.split(":");
97
+ return n[e] ? n[e] : r;
98
+ } else return n[t] || "";
99
+ });
100
+ }, S = (e, t) => a(e) ? x(e(t), t) : o(e) ? x(e, t) : null, C = (e) => {
101
+ let t = {};
102
+ for (let n in e) t[r(n)] = e[n];
103
+ return t;
104
+ }, w = (e, t) => {
105
+ for (let n in t) e[n] = t[n];
106
+ return e;
107
+ };
108
+ //#endregion
109
+ export { d as a, C as c, f as d, p as f, b as i, _ as l, y as n, h as o, S as r, v as s, w as t, m as u };
@@ -0,0 +1,95 @@
1
+ import { i as e, n as t } from "./CXSIP67a.mjs";
2
+ import { n } from "./BROfNO6c.mjs";
3
+ import { createVNode as r, mergeProps as i, useModel as a } from "vue";
4
+ import { ElSlider as o } from "element-plus/es";
5
+ import "element-plus/es/components/base/style/css";
6
+ import "element-plus/es/components/slider/style/css";
7
+ //#region src/components/form/props/slide.ts
8
+ var s = {
9
+ ...n,
10
+ modelValue: [Number, Array],
11
+ min: {
12
+ type: Number,
13
+ default: 0
14
+ },
15
+ max: {
16
+ type: Number,
17
+ default: 100
18
+ },
19
+ step: [Number, String],
20
+ showInput: {
21
+ type: Boolean,
22
+ default: !1
23
+ },
24
+ showInputControls: {
25
+ type: Boolean,
26
+ default: !0
27
+ },
28
+ size: {
29
+ type: String,
30
+ default: "default"
31
+ },
32
+ inputSize: {
33
+ type: String,
34
+ default: "default"
35
+ },
36
+ showStops: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ showTooltip: {
41
+ type: Boolean,
42
+ default: !0
43
+ },
44
+ formatTooltip: Function,
45
+ range: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ vertical: {
50
+ type: Boolean,
51
+ default: !1
52
+ },
53
+ height: String,
54
+ ariaLabel: String,
55
+ rangeStartLabel: String,
56
+ rangeEndLabel: String,
57
+ formatValueText: Function,
58
+ tooltipClass: String,
59
+ placement: {
60
+ type: String,
61
+ default: "top"
62
+ },
63
+ marks: Object,
64
+ validateEvent: {
65
+ type: Boolean,
66
+ default: !0
67
+ },
68
+ persistent: {
69
+ type: Boolean,
70
+ default: !0
71
+ }
72
+ }, c = {
73
+ modelValue: !0,
74
+ disabled: !0
75
+ }, l = (e) => n[e] === void 0 && c[e] !== !0, u = {
76
+ name: "FormSlider",
77
+ inheritAttrs: !1,
78
+ props: { ...s },
79
+ emits: { ...t },
80
+ setup(t, { emit: n, slots: s, attrs: c }) {
81
+ let u = a(t, "modelValue"), { render: d, disabled: f, listeners: p, inputProps: m } = e(t, {
82
+ emit: n,
83
+ slots: s,
84
+ predicate: l,
85
+ attrs: c
86
+ });
87
+ return () => d({ vNodes: r(o, i(p.value, m.value, {
88
+ modelValue: u.value,
89
+ "onUpdate:modelValue": (e) => u.value = e,
90
+ disabled: f.value
91
+ }), null) });
92
+ }
93
+ };
94
+ //#endregion
95
+ export { u as t };
@@ -0,0 +1,320 @@
1
+ import { i as e, n as t } from "./CXSIP67a.mjs";
2
+ import { n } from "./BROfNO6c.mjs";
3
+ import { useDictionary as r } from "../hook/useDictionary.mjs";
4
+ import { isNumber as i, isPlainObject as a, isString as o } from "@web-utils/core";
5
+ import { computed as s, createVNode as c, mergeProps as l, ref as u, watchEffect as d } from "vue";
6
+ import { ElOption as f, ElSelect as p } from "element-plus/es";
7
+ import "element-plus/es/components/base/style/css";
8
+ import "element-plus/es/components/select/style/css";
9
+ import "element-plus/es/components/option/style/css";
10
+ //#region src/components/form/props/select.ts
11
+ var m = {
12
+ ...n,
13
+ modelValue: [
14
+ String,
15
+ Number,
16
+ Boolean,
17
+ Object,
18
+ Array
19
+ ],
20
+ multiple: {
21
+ type: Boolean,
22
+ default: !1
23
+ },
24
+ options: {
25
+ type: Array,
26
+ default: () => []
27
+ },
28
+ props: {
29
+ type: Object,
30
+ default: () => ({
31
+ label: "label",
32
+ value: "value"
33
+ })
34
+ },
35
+ valueKey: {
36
+ type: String,
37
+ default: "value"
38
+ },
39
+ size: String,
40
+ clearable: {
41
+ type: Boolean,
42
+ default: !0
43
+ },
44
+ collapseTags: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ collapseTagsTooltip: {
49
+ type: Boolean,
50
+ default: !1
51
+ },
52
+ tagTooltip: {
53
+ type: Object,
54
+ default: () => ({})
55
+ },
56
+ multipleLimit: {
57
+ type: Number,
58
+ default: 0
59
+ },
60
+ id: String,
61
+ name: String,
62
+ effect: {
63
+ type: String,
64
+ default: "light"
65
+ },
66
+ autocomplete: {
67
+ type: String,
68
+ default: "off"
69
+ },
70
+ placeholder: String,
71
+ filterable: {
72
+ type: Boolean,
73
+ default: !1
74
+ },
75
+ allowCreate: {
76
+ type: Boolean,
77
+ default: !1
78
+ },
79
+ filterMethod: Function,
80
+ remote: {
81
+ type: Boolean,
82
+ default: !1
83
+ },
84
+ debounce: {
85
+ type: Number,
86
+ default: 300
87
+ },
88
+ remoteMethod: Function,
89
+ remoteShowSuffix: {
90
+ type: Boolean,
91
+ default: !1
92
+ },
93
+ loading: {
94
+ type: Boolean,
95
+ default: !1
96
+ },
97
+ loadingText: String,
98
+ noMatchText: String,
99
+ noDataText: String,
100
+ popperClass: {
101
+ type: String,
102
+ default: ""
103
+ },
104
+ popperStyle: [String, Object],
105
+ reserveKeyword: {
106
+ type: Boolean,
107
+ default: !0
108
+ },
109
+ defaultFirstOption: {
110
+ type: Boolean,
111
+ default: !1
112
+ },
113
+ teleported: {
114
+ type: Boolean,
115
+ default: !0
116
+ },
117
+ appendTo: [String, Object],
118
+ persistent: {
119
+ type: Boolean,
120
+ default: !0
121
+ },
122
+ automaticDropdown: {
123
+ type: Boolean,
124
+ default: !1
125
+ },
126
+ clearIcon: [String, Object],
127
+ fitInputWidth: {
128
+ type: Boolean,
129
+ default: !1
130
+ },
131
+ suffixIcon: [String, Object],
132
+ tagType: {
133
+ type: String,
134
+ default: "info"
135
+ },
136
+ tagEffect: {
137
+ type: String,
138
+ default: "light"
139
+ },
140
+ validateEvent: {
141
+ type: Boolean,
142
+ default: !0
143
+ },
144
+ dropDownOffset: {
145
+ type: Number,
146
+ default: 12
147
+ },
148
+ showArrow: {
149
+ type: Boolean,
150
+ default: !0
151
+ },
152
+ placement: {
153
+ type: String,
154
+ default: "bottom-start"
155
+ },
156
+ fallbackPlacements: {
157
+ type: Array,
158
+ default: () => [
159
+ "bottom-start",
160
+ "top-start",
161
+ "right",
162
+ "left"
163
+ ]
164
+ },
165
+ maxCollapseTags: {
166
+ type: Number,
167
+ default: 1
168
+ },
169
+ popperOptions: {
170
+ type: Object,
171
+ default: () => ({})
172
+ },
173
+ ariaLabel: String,
174
+ emptyValues: Array,
175
+ valueOnClear: [
176
+ String,
177
+ Number,
178
+ Boolean,
179
+ Function
180
+ ],
181
+ suffixTransition: {
182
+ type: Boolean,
183
+ default: !0
184
+ },
185
+ tabindex: [String, Number],
186
+ dictType: String,
187
+ gender: Boolean,
188
+ year: [Boolean, Number],
189
+ all: Boolean,
190
+ confirm: Boolean,
191
+ start: Number,
192
+ end: Number,
193
+ optionLabel: [String, Number],
194
+ emitLabel: Boolean,
195
+ english: Boolean,
196
+ chinese: Boolean,
197
+ typing: Boolean,
198
+ multipleStringMode: Boolean,
199
+ multipleStringSeparator: {
200
+ type: String,
201
+ default: ","
202
+ }
203
+ }, h = {
204
+ modelValue: !0,
205
+ emptyValues: !0,
206
+ disabled: !0,
207
+ dropDownOffset: !0,
208
+ valueOnClear: !0,
209
+ options: !0,
210
+ dictType: !0,
211
+ gender: !0,
212
+ year: !0,
213
+ all: !0,
214
+ confirm: !0,
215
+ start: !0,
216
+ end: !0,
217
+ optionLabel: !0,
218
+ emitLabel: !0,
219
+ english: !0,
220
+ chinese: !0,
221
+ typing: !0,
222
+ multipleStringMode: !0,
223
+ multipleStringSeparator: !0
224
+ }, g = (e) => n[e] === void 0 && h[e] !== !0, _ = {
225
+ name: "FormSelect",
226
+ inheritAttrs: !1,
227
+ props: { ...m },
228
+ emits: { ...t },
229
+ setup(t, { emit: n, slots: m, attrs: h }) {
230
+ let { emitInput: _, render: v, placeholder: y, disabled: b, listeners: x, inputProps: S } = e(t, {
231
+ emit: n,
232
+ slots: m,
233
+ attrs: h,
234
+ predicate: g,
235
+ messagePrefix: "请选择"
236
+ }), C = u(null), w = u(!1);
237
+ d(() => {
238
+ if (t.multiple && t.multipleStringMode) {
239
+ var e;
240
+ C.value = (e = t.modelValue) == null ? void 0 : e.split(",").filter((e) => e);
241
+ } else C.value = t.modelValue;
242
+ });
243
+ let T = (e) => {
244
+ if (t.multiple && t.multipleStringMode ? _(e.join(t.multipleStringSeparator)) : _(e), t.emitLabel) {
245
+ let r = O.value.find((n) => n[t.props.value] === e), i = r == null ? void 0 : r[t.props.label];
246
+ i !== t.optionLabel && n("update:optionLabel", i);
247
+ }
248
+ }, { dictItems: E } = r(t), D = u([]), O = s(() => {
249
+ if (t.dictType) return E.value;
250
+ if (t.remote) return D.value;
251
+ if (t.gender) return [{
252
+ [t.props.label]: "男",
253
+ [t.props.value]: t.chinese ? "男" : t.typing ? 1 : "1"
254
+ }, {
255
+ [t.props.label]: "女",
256
+ [t.props.value]: t.chinese ? "女" : t.typing ? 2 : "2"
257
+ }];
258
+ if (t.confirm) return [{
259
+ [t.props.label]: "是",
260
+ [t.props.value]: t.chinese ? "是" : t.english ? "Y" : t.typing ? 1 : "1"
261
+ }, {
262
+ [t.props.label]: "否",
263
+ [t.props.value]: t.chinese ? "否" : t.english ? "N" : t.typing ? 0 : "0"
264
+ }];
265
+ if (t.all) return [{
266
+ [t.props.value]: "",
267
+ [t.props.label]: "全部"
268
+ }, ...t.options];
269
+ if (t.start && t.end) return Array(t.end - t.start + 1).fill(1).map((e, n) => ({
270
+ [t.props.label]: t.start + n,
271
+ [t.props.value]: t.start + n
272
+ }));
273
+ if (t.year) {
274
+ let e = (/* @__PURE__ */ new Date()).getFullYear(), n = [], r = 10;
275
+ i(t.year) && (r = t.year);
276
+ for (let i = -r; i <= r; i++) {
277
+ let r = e + i;
278
+ n.push({
279
+ [t.props.label]: r,
280
+ [t.props.value]: r
281
+ });
282
+ }
283
+ return n;
284
+ }
285
+ return t.options ? t.options.map((e) => (e[t.props.value] = e[t.props.value] ?? e[t.props.label], e)) : [];
286
+ }), k = async (e) => {
287
+ try {
288
+ var n;
289
+ w.value = !0;
290
+ let r = await t.remoteMethod(e, t.prop);
291
+ ((n = r.data.data) == null ? void 0 : n.length) >= 0 ? o(r.data.data[0]) ? D.value = r.data.data.map((e) => ({
292
+ [t.props.value]: e,
293
+ [t.props.label]: e
294
+ })) : a(r.data.data[0]) && (D.value = r.data.data) : D.value = [];
295
+ } catch {}
296
+ w.value = !1;
297
+ };
298
+ return d(() => {
299
+ t.remote && k();
300
+ }), () => v({ vNodes: c(p, l(x.value, S.value, {
301
+ offset: t.dropDownOffset,
302
+ "model-value": C.value,
303
+ "onUpdate:modelValue": T,
304
+ disabled: b.value,
305
+ placeholder: y.value
306
+ }), {
307
+ ...m,
308
+ default: m.default || (() => {
309
+ var e;
310
+ return (e = O.value) == null ? void 0 : e.map(({ value: e, label: t }) => c(f, {
311
+ key: e,
312
+ label: t,
313
+ value: e
314
+ }, null));
315
+ })
316
+ }) });
317
+ }
318
+ };
319
+ //#endregion
320
+ export { _ as t };
@@ -0,0 +1,180 @@
1
+ import { i as e, n as t } from "./CXSIP67a.mjs";
2
+ import { n } from "./BROfNO6c.mjs";
3
+ import { useDictionary as r } from "../hook/useDictionary.mjs";
4
+ import { t as i } from "./Csa9EgOO.mjs";
5
+ import { computed as a, createVNode as o, defineComponent as s, isVNode as c, mergeProps as l, useModel as u } from "vue";
6
+ import { ElCheckbox as d, ElCheckboxButton as f, ElCheckboxGroup as p } from "element-plus/es";
7
+ import "element-plus/es/components/base/style/css";
8
+ import "element-plus/es/components/checkbox/style/css";
9
+ import "element-plus/es/components/checkbox-button/style/css";
10
+ import "element-plus/es/components/checkbox-group/style/css";
11
+ //#region src/components/form/props/checkbox-group.ts
12
+ var m = {
13
+ ...n,
14
+ modelValue: {
15
+ type: [Array, String],
16
+ default: () => []
17
+ },
18
+ size: String,
19
+ min: Number,
20
+ max: Number,
21
+ ariaLabel: String,
22
+ textColor: {
23
+ type: String,
24
+ default: "#ffffff"
25
+ },
26
+ fill: {
27
+ type: String,
28
+ default: "#409eff"
29
+ },
30
+ tag: {
31
+ type: String,
32
+ default: "div"
33
+ },
34
+ validateEvent: {
35
+ type: Boolean,
36
+ default: !0
37
+ },
38
+ options: {
39
+ type: Array,
40
+ default: () => []
41
+ },
42
+ props: {
43
+ type: Object,
44
+ default: () => ({
45
+ value: "value",
46
+ label: "label",
47
+ disabled: "disabled"
48
+ })
49
+ },
50
+ type: {
51
+ type: String,
52
+ default: "checkbox"
53
+ },
54
+ stringMode: Boolean,
55
+ delimiter: {
56
+ type: String,
57
+ default: ","
58
+ },
59
+ other: [String],
60
+ otherVal: [String],
61
+ otherProp: String,
62
+ otherPlaceholder: String,
63
+ otherLabel: String,
64
+ otherWidth: {
65
+ type: String,
66
+ default: "200px"
67
+ },
68
+ otherMaxLength: String,
69
+ gender: Boolean,
70
+ confirm: Boolean,
71
+ labelProp: {
72
+ type: String,
73
+ default: "name"
74
+ },
75
+ valueProp: {
76
+ type: String,
77
+ default: "code"
78
+ },
79
+ split: Boolean,
80
+ sort: Boolean,
81
+ classic: Boolean,
82
+ fillRow: Boolean,
83
+ ellipsis: Boolean,
84
+ dictType: String
85
+ }, h = {
86
+ modelValue: !0,
87
+ type: !0,
88
+ disabled: !0,
89
+ options: !0
90
+ }, g = (e) => n[e] === void 0 && h[e] !== !0;
91
+ //#endregion
92
+ //#region src/components/form/FormCheckBoxGroup.vue?vue&type=script&lang.jsx
93
+ function _(e) {
94
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !c(e);
95
+ }
96
+ //#endregion
97
+ //#region src/components/form/FormCheckBoxGroup.vue
98
+ var v = /* @__PURE__ */ s({
99
+ name: "FormCheckBoxGroup",
100
+ inheritAttrs: !1,
101
+ props: { ...m },
102
+ emits: {
103
+ ...t,
104
+ "update:other": null
105
+ },
106
+ setup(t, { emit: n, slots: s, attrs: c }) {
107
+ let m = u(t, "other"), { emitInput: h, render: v, disabled: y, listeners: b, inputProps: x } = e(t, {
108
+ emit: n,
109
+ slots: s,
110
+ attrs: c,
111
+ predicate: g,
112
+ messagePrefix: "请选择",
113
+ class: a(() => ["form-checkbox-group", {
114
+ "form-checkbox-group-row": t.fillRow,
115
+ "form-checkbox-group-row-break-word": t.fillRow,
116
+ "form-checkbox-group-row-ellipsis": t.ellipsis
117
+ }])
118
+ }), S = (e) => {
119
+ let n = e;
120
+ t.sort && (n = e.sort()), t.stringMode || t.split ? h(n.join(",")) : h(n);
121
+ }, C = a(() => {
122
+ if (t.stringMode || t.split) {
123
+ var e;
124
+ return Array.isArray(t.modelValue) ? t.modelValue.filter((e) => e) : ((e = t.modelValue) == null ? void 0 : e.split(t.delimiter).filter((e) => e)) ?? [];
125
+ }
126
+ return t.modelValue || [];
127
+ }), w = a(() => t.classic ? "label" : t.labelProp), T = a(() => t.classic ? "value" : t.valueProp), { dictItems: E } = r(t), D = a(() => t.dictType ? E.value : t.gender ? [{
128
+ [w.value]: "男",
129
+ [T.value]: "男"
130
+ }, {
131
+ [w.value]: "女",
132
+ [T.value]: "女"
133
+ }] : t.confirm ? [{
134
+ [w.value]: "是",
135
+ [T.value]: "是"
136
+ }, {
137
+ [w.value]: "否",
138
+ [T.value]: "否"
139
+ }] : t.options);
140
+ return () => v({ vNodes: [o(p, l(b.value, x.value, {
141
+ modelValue: C.value,
142
+ disabled: y.value,
143
+ "onUpdate:modelValue": S
144
+ }), {
145
+ ...s,
146
+ default: s.default || (() => {
147
+ var e;
148
+ return (e = D.value) == null ? void 0 : e.map(({ value: e, label: n, disabled: r }) => t.type === "button" ? o(f, {
149
+ key: e,
150
+ value: e,
151
+ disabled: r
152
+ }, _(n) ? n : { default: () => [n] }) : o(d, {
153
+ key: e,
154
+ value: e,
155
+ disabled: r
156
+ }, _(n) ? n : { default: () => [n] }));
157
+ })
158
+ }), C.value.includes(t.otherVal) ? o(i, {
159
+ "wrap-col": !1,
160
+ class: "form-checkbox-group-other",
161
+ "hide-label": !0,
162
+ "label-width": "0",
163
+ prop: t.otherProp,
164
+ disabled: y.value,
165
+ required: !!t.otherProp,
166
+ placeholder: t.otherPlaceholder,
167
+ label: t.otherLabel,
168
+ "show-message": !!t.otherLabel,
169
+ style: t.otherLabel ? { width: t.otherWidth } : {
170
+ marginBottom: 0,
171
+ width: t.otherWidth
172
+ },
173
+ modelValue: m.value,
174
+ "onUpdate:modelValue": (e) => m.value = e,
175
+ "max-length": t.otherMaxLength
176
+ }, null) : null] });
177
+ }
178
+ });
179
+ //#endregion
180
+ export { v as t };