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

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/B1MSrc6f.mjs +8 -0
  7. package/chunks/B3ajWLh3.mjs +198 -0
  8. package/chunks/BH_JJ8Xh.mjs +106 -0
  9. package/chunks/BWBHzD5N.mjs +89 -0
  10. package/chunks/Bd1UFJic.mjs +660 -0
  11. package/chunks/Bm5eiSmT.mjs +79 -0
  12. package/chunks/BsCS7SB5.mjs +141 -0
  13. package/chunks/BufIRDd0.mjs +185 -0
  14. package/chunks/C1AgOUe_.mjs +172 -0
  15. package/chunks/C3Uo82-I.mjs +35 -0
  16. package/chunks/C9dGL28n.mjs +56 -0
  17. package/chunks/CFOGMFgo.mjs +150 -0
  18. package/chunks/CLPSCSsy.mjs +603 -0
  19. package/chunks/CSyJ-vEx.mjs +17 -0
  20. package/chunks/CTKmEf2M.mjs +93 -0
  21. package/chunks/CWfUPCtS.mjs +1360 -0
  22. package/chunks/CXvGoZKJ.mjs +198 -0
  23. package/chunks/Cab-ZjRx.mjs +164 -0
  24. package/chunks/ChmDDqoZ2.mjs +478 -0
  25. package/chunks/Cj59E77g.mjs +230 -0
  26. package/chunks/CqTcEefA.mjs +93 -0
  27. package/chunks/Ct5bDJ50.mjs +38 -0
  28. package/chunks/CuG2Q-PM.mjs +100 -0
  29. package/chunks/D8UVq1t1.mjs +176 -0
  30. package/chunks/DDmQcNm6.mjs +93 -0
  31. package/chunks/DF9fJMQS.mjs +105 -0
  32. package/chunks/DJe97Fgi.mjs +107 -0
  33. package/chunks/DXYgAmil.mjs +317 -0
  34. package/chunks/DhtHh0jk.mjs +87 -0
  35. package/chunks/DiJyms_r.mjs +100 -0
  36. package/chunks/Ds_Tpa_M.mjs +83 -0
  37. package/chunks/TvNHGVAP.mjs +25 -0
  38. package/chunks/XCGWTz41.mjs +25 -0
  39. package/chunks/XqRTtFfp.mjs +166 -0
  40. package/chunks/cmuHpsX6.mjs +109 -0
  41. package/chunks/o6VhYAN52.mjs +207 -0
  42. package/chunks/pdwFQpA8.mjs +57 -0
  43. package/chunks/taicx2sd.mjs +25 -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 +453 -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 +227 -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,2 @@
1
+ declare const _default: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
2
+ export default _default;
@@ -0,0 +1,227 @@
1
+ import { t as e } from "../chunks/B1MSrc6f.mjs";
2
+ import { isArray as t, isDef as n, isPlainObject as r, scrollIntoView as i } from "@web-utils/core";
3
+ import { Fragment as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, nextTick as d, normalizeClass as f, openBlock as p, renderList as m, toDisplayString as h, vShow as g, withCtx as _, withDirectives as v, withKeys as y } from "vue";
4
+ import { ElMessage as b, formContextKey as x, formItemContextKey as S } from "element-plus";
5
+ import { ElButton as C, ElInput as w, ElPopover as T, ElTag as E } from "element-plus/es";
6
+ import { debounce as D } from "lodash-es";
7
+ //#region src/components/form/XInputTag.vue
8
+ var O = {
9
+ name: "XInputTag",
10
+ inject: {
11
+ elForm: {
12
+ from: x,
13
+ default: ""
14
+ },
15
+ elFormItem: {
16
+ from: S,
17
+ default: ""
18
+ }
19
+ },
20
+ props: {
21
+ modelValue: {
22
+ type: [Array, String],
23
+ default: () => []
24
+ },
25
+ disabled: Boolean,
26
+ separator: {
27
+ type: String,
28
+ default: ","
29
+ },
30
+ count: {
31
+ type: Boolean,
32
+ default: !0
33
+ },
34
+ arrayMode: {
35
+ type: Boolean,
36
+ default: !0
37
+ },
38
+ objectMode: {
39
+ type: Boolean,
40
+ default: !0
41
+ },
42
+ query: Function,
43
+ type: {
44
+ type: String,
45
+ default: "标签"
46
+ }
47
+ },
48
+ emits: ["update:modelValue"],
49
+ data() {
50
+ return {
51
+ inputVisible: !1,
52
+ inputValue: "",
53
+ maxTag: 20,
54
+ items: [],
55
+ currentIndex: null
56
+ };
57
+ },
58
+ computed: {
59
+ inputDisabled() {
60
+ return this.disabled;
61
+ },
62
+ tags: { get() {
63
+ if (this.arrayMode) {
64
+ var e;
65
+ return (e = this.modelValue) != null && e.length ? this.objectMode ? this.modelValue.map((e) => e.id > 0 ? e : {
66
+ ...e,
67
+ id: null
68
+ }) : this.modelValue : [];
69
+ } else {
70
+ var n;
71
+ let e = this.arrayMode ? this.modelValue || [] : t(this.modelValue) ? this.modelValue : ((n = this.modelValue) == null ? void 0 : n.split(this.separator)) || [];
72
+ return e.length && e[0] ? e.map((e) => this.objectMode ? {
73
+ name: e,
74
+ id: null
75
+ } : e) : [];
76
+ }
77
+ } }
78
+ },
79
+ created() {
80
+ this.query && (this.debounceQuery = D(async () => {
81
+ this.query ? (this.items = await this.query(this.inputValue), this.currentIndex = 0) : this.currentIndex = null;
82
+ }, 200));
83
+ },
84
+ methods: {
85
+ async showInput() {
86
+ var e;
87
+ this.inputVisible = !0, await d(), this.$refs.saveTagInput.$refs.input.focus(), (e = this.items) != null && e.length && (this.currentIndex = 0);
88
+ },
89
+ handleClose(e) {
90
+ let t = this.tags.filter((t) => t !== e);
91
+ this.$emit("update:modelValue", this.arrayMode ? t : t.map((e) => e.name || e).join(this.separator));
92
+ },
93
+ async handleInputConfirm() {
94
+ await d(), n(this.currentIndex) && this.items[this.currentIndex] ? await this.addTag(this.items[this.currentIndex]) : this.inputValue ? await this.addTag(this.inputValue) : await this.reset();
95
+ },
96
+ async reset() {
97
+ var e;
98
+ (e = this.$refs.popover) == null || e.hide(), await d(), this.inputVisible = !1, this.inputValue = "", this.currentIndex = null;
99
+ },
100
+ async addTag(e) {
101
+ if (this.tags.length >= this.maxTag) {
102
+ b.warning({
103
+ message: `${this.type}已达上限!`,
104
+ showClose: !0
105
+ }), this.inputVisible = !1, this.inputValue = "";
106
+ return;
107
+ }
108
+ if (e) {
109
+ var t;
110
+ let n = r(e);
111
+ if (this.tags.some((t) => (this.objectMode && t.name || t) === (n && e.name || e))) {
112
+ this.inputVisible = !1, this.inputValue = "", b.warning({
113
+ message: `${this.type}已存在!`,
114
+ showClose: !0
115
+ });
116
+ return;
117
+ }
118
+ let i = [...this.tags];
119
+ if (n) i.push(e);
120
+ else {
121
+ let t = this.items.find((t) => (t.name || t) === e);
122
+ t ? i.push(t) : i.push(this.objectMode ? {
123
+ id: null,
124
+ name: e
125
+ } : e);
126
+ }
127
+ this.$emit("update:modelValue", this.arrayMode ? i : i.map((e) => e.name || e).join(this.separator)), await this.$nextTick(), (t = this.elFormItem) == null || t.clearValidate();
128
+ }
129
+ await this.reset();
130
+ },
131
+ onInputBlur() {
132
+ var e;
133
+ ((e = this.items) == null ? void 0 : e.length) === 0 ? this.handleInputConfirm() : this.reset();
134
+ },
135
+ tryQuery() {
136
+ var e;
137
+ (e = this.debounceQuery) == null || e.call(this);
138
+ },
139
+ onDropdownItemClick(e) {
140
+ this.inputVisible = !1, this.inputValue = "", this.addTag(e);
141
+ },
142
+ select(e) {
143
+ var t;
144
+ (t = this.items) != null && t.length && (e === 1 ? this.currentIndex > 0 ? this.currentIndex-- : this.currentIndex = this.items.length - 1 : e === 2 && (this.currentIndex < this.items.length - 1 ? this.currentIndex++ : this.currentIndex = 0), i(this.$refs.list, this.$refs.items[this.currentIndex]));
145
+ }
146
+ }
147
+ }, k = { class: "x-input-tag" }, A = {
148
+ key: 1,
149
+ style: {
150
+ "margin-left": "8px",
151
+ color: "#b5b5b5",
152
+ "line-height": "normal"
153
+ }
154
+ }, j = {
155
+ key: 4,
156
+ class: "tags-count"
157
+ }, M = {
158
+ ref: "list",
159
+ class: "dropdown-item-list"
160
+ }, N = ["onMouseenter", "onClick"];
161
+ function P(e, t, n, r, i, d) {
162
+ let b = E, x = w, S = C, D = T;
163
+ return p(), c("div", k, [
164
+ d.tags && d.tags.length && d.tags[0] ? (p(!0), c(a, { key: 0 }, m(d.tags, (e, t) => (p(), o(b, {
165
+ key: e.id || e.name || e,
166
+ size: "small",
167
+ "disable-transitions": "",
168
+ closable: !d.inputDisabled,
169
+ onClose: (n) => d.handleClose(e, t)
170
+ }, {
171
+ default: _(() => [u(h(e.name || e), 1)]),
172
+ _: 2
173
+ }, 1032, ["closable", "onClose"]))), 128)) : d.inputDisabled ? (p(), c("span", A, "无")) : s("v-if", !0),
174
+ d.inputDisabled ? s("v-if", !0) : v((p(), o(x, {
175
+ key: 2,
176
+ ref: "saveTagInput",
177
+ modelValue: i.inputValue,
178
+ "onUpdate:modelValue": [t[0] || (t[0] = (e) => i.inputValue = e), d.tryQuery],
179
+ class: "input-new-tag",
180
+ size: "small",
181
+ onKeyup: [
182
+ t[1] || (t[1] = y((e) => d.select(1), ["up"])),
183
+ t[2] || (t[2] = y((e) => d.select(2), ["down"])),
184
+ y(d.onInputBlur, ["esc"]),
185
+ y(d.handleInputConfirm, ["enter"])
186
+ ],
187
+ onBlur: d.onInputBlur
188
+ }, null, 8, [
189
+ "modelValue",
190
+ "onUpdate:modelValue",
191
+ "onKeyup",
192
+ "onBlur"
193
+ ])), [[g, i.inputVisible]]),
194
+ !d.inputDisabled && !i.inputVisible ? v((p(), o(S, {
195
+ key: 3,
196
+ class: "button-new-tag",
197
+ size: "small",
198
+ onClick: d.showInput
199
+ }, {
200
+ default: _(() => [...t[3] || (t[3] = [u(" + 添加 ", -1)])]),
201
+ _: 1
202
+ }, 8, ["onClick"])), [[g, d.tags.length < i.maxTag]]) : s("v-if", !0),
203
+ n.count ? (p(), c("span", j, h(d.tags.length && d.tags[0] ? d.tags.length : ""), 1)) : s("v-if", !0),
204
+ n.query ? (p(), o(D, {
205
+ key: 5,
206
+ ref: "popover",
207
+ "virtual-ref": e.$refs.saveTagInput,
208
+ placement: "bottom",
209
+ width: "240",
210
+ "popper-class": "dropdown-popup",
211
+ trigger: "manual"
212
+ }, {
213
+ default: _(() => [l("ul", M, [(p(!0), c(a, null, m(i.items, (e, t) => (p(), c("li", {
214
+ ref_for: !0,
215
+ ref: "items",
216
+ key: e.id || e.name || e,
217
+ class: f(["dropdown-item", { active: i.currentIndex === t }]),
218
+ onMouseenter: (e) => i.currentIndex = t,
219
+ onClick: (t) => d.onDropdownItemClick(e)
220
+ }, h(e.name || e), 43, N))), 128))], 512)]),
221
+ _: 1
222
+ }, 8, ["virtual-ref"])) : s("v-if", !0)
223
+ ]);
224
+ }
225
+ var F = /* @__PURE__ */ e(O, [["render", P]]);
226
+ //#endregion
227
+ export { F as default };
@@ -0,0 +1 @@
1
+ .el-form-item.is-error .x-input-tag{border-color:#f56c6c}.x-input-tag{border:1px solid var(--border-color);border-radius:4px;width:100%;height:120px;padding-top:4px;padding-right:4px;line-height:0;position:relative;overflow:auto}.x-input-tag .el-tag .el-tag__close:hover{background-color:#ee8677}.x-input-tag .el-tag,.x-input-tag .button-new-tag{margin-bottom:4px;margin-left:4px}.x-input-tag .el-input.input-new-tag{width:120px;margin-bottom:4px;margin-left:4px}.x-input-tag .tags-count{color:#b7b7b7;font-size:.9em;position:absolute;bottom:10px;right:6px}.dropdown-popup{padding:0}.dropdown-popup .dropdown-item-list{max-height:200px;overflow:auto}.dropdown-popup .dropdown-item{cursor:pointer;padding:5px 10px}.dropdown-popup .dropdown-item:hover,.dropdown-popup .dropdown-item.active{background-color:#f5f7fa}
@@ -0,0 +1,99 @@
1
+ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
2
+ showYearSelector: {
3
+ type: BooleanConstructor;
4
+ default: () => true;
5
+ };
6
+ activeDates: {
7
+ type: ArrayConstructor;
8
+ default: () => never[];
9
+ validator: (dateArray: unknown) => true;
10
+ };
11
+ modelValue: {
12
+ type: (StringConstructor | NumberConstructor)[];
13
+ default: number;
14
+ };
15
+ lang: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ activeClass: {
20
+ type: StringConstructor;
21
+ default: () => "";
22
+ };
23
+ prefixClass: {
24
+ type: StringConstructor;
25
+ default: () => "calendar--active";
26
+ };
27
+ hideWeekend: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ hideSunday: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ }>, {}, {
36
+ isUsingString: boolean;
37
+ }, {
38
+ month(): {};
39
+ activeYear: {
40
+ get(): number;
41
+ set(val: any): void;
42
+ };
43
+ }, {
44
+ changeYear(idx: any): void;
45
+ toggleDate(dateObj: any): void;
46
+ modifiedActiveDates(dateIndex: any, activeDate: any): unknown[];
47
+ monthClick(monthYearInfo: any): void;
48
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "toggleDate" | "monthClick" | "update:activeDates")[], "update:modelValue" | "toggleDate" | "monthClick" | "update:activeDates", import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
49
+ showYearSelector: {
50
+ type: BooleanConstructor;
51
+ default: () => true;
52
+ };
53
+ activeDates: {
54
+ type: ArrayConstructor;
55
+ default: () => never[];
56
+ validator: (dateArray: unknown) => true;
57
+ };
58
+ modelValue: {
59
+ type: (StringConstructor | NumberConstructor)[];
60
+ default: number;
61
+ };
62
+ lang: {
63
+ type: StringConstructor;
64
+ default: string;
65
+ };
66
+ activeClass: {
67
+ type: StringConstructor;
68
+ default: () => "";
69
+ };
70
+ prefixClass: {
71
+ type: StringConstructor;
72
+ default: () => "calendar--active";
73
+ };
74
+ hideWeekend: {
75
+ type: BooleanConstructor;
76
+ default: boolean;
77
+ };
78
+ hideSunday: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
82
+ }>> & Readonly<{
83
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
84
+ onToggleDate?: ((...args: any[]) => any) | undefined;
85
+ onMonthClick?: ((...args: any[]) => any) | undefined;
86
+ "onUpdate:activeDates"?: ((...args: any[]) => any) | undefined;
87
+ }>, {
88
+ modelValue: string | number;
89
+ showYearSelector: boolean;
90
+ activeDates: unknown[];
91
+ lang: string;
92
+ activeClass: string;
93
+ prefixClass: string;
94
+ hideWeekend: boolean;
95
+ hideSunday: boolean;
96
+ }, {}, {
97
+ MonthCalendar: any;
98
+ }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
99
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../chunks/ChmDDqoZ2.mjs";
2
+ export { e as default };
@@ -0,0 +1 @@
1
+ .c-wrapper[data-v-2a7f150d]{padding:10px}.calendar[data-v-2a7f150d]{text-align:center;color:#353c46cc;background-color:#fff;border-radius:2px;min-width:0;min-height:295px;text-decoration:none;transition:transform .3s;position:relative;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.calendar[data-v-2a7f150d]:hover{z-index:2}@media (min-width:1024px){.calendar[data-v-2a7f150d]:hover{transform:scale(1.15);box-shadow:0 7px 21px #0000001a}}.calendar .calendar__title[data-v-2a7f150d]{cursor:pointer;border-bottom:1px solid #c4c4c44d;flex:100%;justify-content:center;align-items:center;height:50px;margin-bottom:12px;font-size:18px;font-weight:700;display:flex}.calendar .calendar__body[data-v-2a7f150d]{flex-wrap:wrap;place-content:flex-start;min-width:194px;padding:0 20px;display:flex}.calendar .calendar__day[data-v-2a7f150d]{color:#5db3d4;flex:14.28%;justify-content:center;align-items:center;height:31px;font-size:16px;display:flex}.calendar .day__weektitle[data-v-2a7f150d]{color:#353c46cc}.calendar .day[data-v-2a7f150d]{cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:5px;justify-content:center;align-items:center;width:22px;height:22px;font-size:14px;display:flex;position:relative}.calendar .day[data-v-2a7f150d]:after{content:"";z-index:1;background-color:#0000;border-radius:50%;width:10px;height:10px;display:block;position:absolute;top:-5px;right:-5px}.calendar .day.calendar--active[data-v-2a7f150d]:after{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20fill='%23FF6060'%20d='M12%202C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm5%2011H7v-2h10v2z'/%3e%3c/svg%3e");background-size:100% 100%}.calendar .day[data-v-2a7f150d]:not(.calendar__day--otherMonth):hover{background-color:#6666661a;border-radius:5px}.calendar .day.calendar--active[data-v-2a7f150d]{color:#bcbcbc;background-color:#ffbaba80}.calendar .day.calendar--active.info[data-v-2a7f150d]{color:#fff;background-color:#17a2b8cc}.calendar .day.calendar--active.info[data-v-2a7f150d]:after{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%2317a2b8'%20d='M0%200h24v24H0V0z'/%3e%3cpath%20fill='white'%20d='M11%207h2v2h-2zm0%204h2v6h-2zm1-9C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm0%2018c-4.41%200-8-3.59-8-8s3.59-8%208-8%208%203.59%208%208-3.59%208-8%208z'/%3e%3c/svg%3e");background-size:100% 100%}.calendar .day.calendar--active.warning[data-v-2a7f150d]{color:#fff;background-color:#ffc107b3}.calendar .day.calendar--active.warning[data-v-2a7f150d]:after{background-color:#eaeaea4d;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23ffc107'%20d='M4.47%2021h15.06c1.54%200%202.5-1.67%201.73-3L13.73%204.99c-.77-1.33-2.69-1.33-3.46%200L2.74%2018c-.77%201.33.19%203%201.73%203zM12%2014c-.55%200-1-.45-1-1v-2c0-.55.45-1%201-1s1%20.45%201%201v2c0%20.55-.45%201-1%201zm1%204h-2v-2h2v2z'/%3e%3c/svg%3e");background-size:100% 100%}.calendar .calendar__day--otherMonth[data-v-2a7f150d]{color:#eaeaea;cursor:auto}.container__months.hide-sunday .calendar__day:nth-of-type(7n){display:none}.container__months.hide-sunday .calendar__day{flex:16.66%}.container__months.hide-weekend .calendar__day:nth-of-type(7n),.container__months.hide-weekend .calendar__day:nth-of-type(7n-1){display:none}.container__months.hide-weekend .calendar__day{flex:19%}.vue-calendar__container[data-v-5cc87b9a]{background-color:#f6f6f3;border-radius:2px;min-width:0;text-decoration:none;position:relative;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.vue-calendar__container .container__year[data-v-5cc87b9a]{-webkit-user-select:none;user-select:none;text-align:center;background-color:#fff;flex:100%;height:65px;font-size:24px;display:flex}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]{cursor:pointer;color:#000000e6;flex:1;justify-content:center;align-items:center;height:100%;display:flex}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]:hover{background-color:#6666661a}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]:nth-child(4n-3){color:#0000004d}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]:nth-child(2n){color:#0009}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]:nth-child(3){box-shadow:inset 0 -3px #4792bd}.vue-calendar__container .container__months[data-v-5cc87b9a]{flex-wrap:wrap;padding:15px;display:flex}.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:16.66%;padding:8px}@media (max-width:1300px){.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:25%}}@media (max-width:992px){.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:33.3%}}@media (max-width:768px){.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:50%}}@media (max-width:450px){.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:100%}}.vue-calendar__container .p-0[data-v-5cc87b9a]{padding:0}
@@ -1,152 +0,0 @@
1
- import { ElCol as e, ElFormItem as t, ElTooltip as n } from "element-plus/es";
2
- import { computed as r, createVNode as i, h as a, inject as o, isVNode as s, nextTick as c, unref as l, useTemplateRef as u } from "vue";
3
- import { ElCol as d, rowContextKey as f } from "element-plus";
4
- //#region src/components/form/form-item.js
5
- var p = {
6
- label: String,
7
- prop: String,
8
- required: Boolean,
9
- rules: Array,
10
- span: {
11
- type: Number,
12
- default: 12
13
- },
14
- block: Boolean,
15
- formItemClass: String,
16
- hideLabel: Boolean,
17
- tips: { type: String },
18
- tipsAfterLabel: {
19
- type: Boolean,
20
- default: !1
21
- },
22
- labelColspan: [Number, String],
23
- inputColspan: [Number, String],
24
- labelRowspan: [Number, String],
25
- inputRowspan: [Number, String]
26
- }, m = (e) => {
27
- let t = o("formHolder", null);
28
- return r(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
29
- }, h = (e, { rules: t } = {}) => {
30
- let n = m(e);
31
- return r(() => {
32
- let r = {}, i = l(t);
33
- return Object.keys(p).forEach((t) => {
34
- t === "rules" ? e[t] && i ? r[t] = [...e[t], ...i] : e[t] ? r[t] = e[t] : i && (r[t] = i) : r[t] = e[t];
35
- }), r.required = n.value, r;
36
- });
37
- };
38
- //#endregion
39
- //#region src/components/form/FormItemX.vue?vue&type=script&lang.jsx
40
- function g(e) {
41
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
42
- }
43
- //#endregion
44
- //#region src/components/form/FormItemX.vue
45
- var _ = {
46
- name: "FormItemX",
47
- inheritAttrs: !1,
48
- props: { ...p },
49
- setup(a, { attrs: s, slots: l, expose: d }) {
50
- let p = o(f, null), h = s.embed ? r(() => s.disabled) : b(a), _ = m(a), v = u("formItem"), y = r(() => !!p), x = r(() => {
51
- if (h.value) return [];
52
- if (_.value) {
53
- let e = {
54
- required: !0,
55
- message: `请输入${a.label}`
56
- };
57
- return a.rules ? [...a.rules, e] : [e];
58
- }
59
- return a.rules;
60
- });
61
- return d({
62
- clearValidate: async () => {
63
- var e;
64
- await c(), (e = v.value) == null || e.clearValidate();
65
- },
66
- validate: async () => {
67
- var e;
68
- await c(), (e = v.value) == null || e.validate();
69
- }
70
- }), () => {
71
- let r = l.tips || a.tips, o = r ? i(n, {
72
- effect: "light",
73
- content: a.tips,
74
- offset: 4
75
- }, {
76
- default: () => i("i", { class: "el-icon-info form-item-input-info" }, null),
77
- content: l.tips ? l.tips : null
78
- }) : null, s = i(t, {
79
- ref: "formItem",
80
- label: a.label,
81
- class: [
82
- "form-item",
83
- a.formItemClass,
84
- {
85
- "form-item-hide-label": a.hideLabel,
86
- "with-tips": !a.tipsAfterLabel && r,
87
- required: h.value === !1 && _.value
88
- }
89
- ],
90
- prop: a.prop,
91
- rules: x.value
92
- }, {
93
- ...l,
94
- default: () => {
95
- var e;
96
- return [(e = l.default) == null ? void 0 : e.call(l, {
97
- disabled: h.value,
98
- required: _.value
99
- }), r && !a.tipsAfterLabel ? o : null];
100
- },
101
- label: () => [l.label ? l.label() : a.label, a.tipsAfterLabel ? o : null]
102
- });
103
- return y.value ? i(e, { span: a.block ? 24 : a.span }, g(s) ? s : { default: () => [s] }) : s;
104
- };
105
- }
106
- }, v = "update:modelValue", y = {
107
- ...p,
108
- wrapFormItem: {
109
- type: Boolean,
110
- default: !0
111
- },
112
- disabled: {
113
- type: Boolean,
114
- default: void 0
115
- },
116
- col: Boolean
117
- }, b = (e) => {
118
- let t = o("formHolder", null), n = o("formItemGroup", null);
119
- return r(() => {
120
- if (e.disabled !== void 0) return e.disabled;
121
- if (t) {
122
- if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
123
- if (t.disabledFieldsMap[e.prop] === !0) return !0;
124
- }
125
- return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
126
- });
127
- }, x = [v], S = (e, t) => e(v, t), C = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? a(_, {
128
- ...n.value,
129
- embed: !0,
130
- disabled: i == null ? void 0 : i.value
131
- }, {
132
- default: () => t,
133
- label: r.label,
134
- error: r.error,
135
- tips: r.tips
136
- }) : t, w = (e, { emit: t, slots: n, rules: i }) => {
137
- let o = h(e, { rules: i }), s = b(e), c = (e) => S(t, e), l = (t) => e.col ? a(d, { span: e.block ? 24 : e.span }, { default: () => t }) : t;
138
- return {
139
- emitInput: c,
140
- render: ({ vNodes: t }) => C(e, {
141
- vNodes: l(t),
142
- formItemProps: o,
143
- slots: n,
144
- disabled: s
145
- }),
146
- placeholder: r(() => s.value ? "" : `请输入${e.label}`),
147
- disabled: s,
148
- formItemProps: o
149
- };
150
- };
151
- //#endregion
152
- export { w as a, S as i, y as n, _ as o, C as r, h as s, x as t };
@@ -1,149 +0,0 @@
1
- import e from "../form-advice/index.mjs";
2
- import t from "../form-red-table/index.mjs";
3
- import { ElForm as n, ElRow as r } from "element-plus/es";
4
- import { computed as i, createVNode as a, inject as o, nextTick as s, provide as c, reactive as l, useTemplateRef as u, watch as d } from "vue";
5
- import { animate as f } from "@web-utils/core";
6
- //#endregion
7
- //#region src/components/form/FormHolder.vue
8
- var p = {
9
- name: "FormHolder",
10
- inheritAttrs: !1,
11
- props: {
12
- model: Object,
13
- size: String,
14
- disabled: {
15
- type: Boolean,
16
- default: void 0
17
- },
18
- labelPosition: {
19
- type: String,
20
- default: "right"
21
- },
22
- labelWidth: {
23
- type: [String, Number],
24
- default: "auto"
25
- },
26
- required: {
27
- type: Boolean,
28
- default: !0
29
- },
30
- requiredFields: Array,
31
- disabledFields: Array,
32
- enabledFields: Array,
33
- showAdvice: {
34
- type: Boolean,
35
- default: !0
36
- },
37
- columns: [Array, Object],
38
- colCount: Number,
39
- notTableForm: {
40
- type: Boolean,
41
- default: void 0
42
- },
43
- commentValueColspan: Number,
44
- commentLabelColspan: Number,
45
- showMessage: {
46
- type: Boolean,
47
- default: !0
48
- },
49
- wrapRow: {
50
- type: Boolean,
51
- default: !0
52
- }
53
- },
54
- setup(p, { slots: m, expose: h }) {
55
- let g = o("formView", null), _ = u("form"), v = i(() => p.notTableForm === void 0 ? (g == null ? void 0 : g.tableForm) === void 0 ? !1 : g == null ? void 0 : g.tableForm : !p.notTableForm), y = i(() => v.value ? !1 : p.showMessage), b = i(() => {
56
- let e = {};
57
- return p.disabledFields && p.disabledFields.forEach((t) => {
58
- e[t] = !0;
59
- }), e;
60
- }), x = i(() => {
61
- let e = {};
62
- return p.enabledFields && p.enabledFields.length && p.enabledFields.forEach((t) => {
63
- e[t] = !0;
64
- }), e;
65
- }), S = i(() => {
66
- let e = {};
67
- return p.requiredFields && p.requiredFields.length && p.requiredFields.forEach((t) => {
68
- e[t] = !0;
69
- }), e;
70
- }), C = i(() => p.disabled === !0 ? !0 : p.disabled), w = i(() => p.enabledFields), T = i(() => p.requiredFields), E = i(() => p.disabledFields), D = async () => {
71
- await s();
72
- let e = _.value.$el.querySelector(".el-form-item.is-error");
73
- e && e.scrollIntoView({
74
- block: "center",
75
- inline: "center",
76
- behavior: "smooth"
77
- });
78
- }, O = async () => {
79
- try {
80
- return await _.value.validate();
81
- } catch {
82
- throw await D(), _.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
83
- f(e, "breathe-animation");
84
- }), Error("表单验证不通过!");
85
- }
86
- }, k = (e) => _.value.validateField(e), A = (e) => _.value.resetFields(e), j = (e) => _.value.scrollToField(e), M = (e) => _.value.clearValidate(e), N = () => _.value.getField(), P = (e) => _.value.setInitialValues(e), F = () => _.value.fields;
87
- d(() => p.required, () => {
88
- M();
89
- });
90
- let I = l({
91
- tableForm: v,
92
- disabled: C,
93
- enabledFields: w,
94
- requiredFields: T,
95
- enabledFieldsMap: x,
96
- disabledFieldsMap: b,
97
- requiredFieldsMap: S,
98
- disabledFields: E,
99
- scrollIntoRequiredField: D,
100
- formRef: _,
101
- validate: O,
102
- validateField: k,
103
- resetFields: A,
104
- scrollToField: j,
105
- clearValidate: M,
106
- getField: N,
107
- setInitialValues: P,
108
- getFields: F
109
- });
110
- return c("formHolder", I), h(I), () => a(n, {
111
- ref: "form",
112
- class: "form-holder",
113
- model: p.model,
114
- size: p.size,
115
- "show-message": y.value,
116
- disabled: p.disabled,
117
- "label-width": p.labelWidth,
118
- "label-position": p.labelPosition
119
- }, { default: () => {
120
- if (v.value) {
121
- var n, i, o;
122
- return [
123
- (n = m.top) == null ? void 0 : n.call(m),
124
- a(t, {
125
- class: { "hide-error-message": v },
126
- columns: p.columns,
127
- "col-count": p.colCount
128
- }, { default: () => {
129
- var t;
130
- return [(t = m.default) == null ? void 0 : t.call(m), p.showAdvice ? a(e, {
131
- "label-colspan": p.commentLabelColspan,
132
- "value-colspan": p.commentValueColspan
133
- }, null) : null];
134
- } }),
135
- (i = m.bottom) == null ? void 0 : i.call(m),
136
- a("div", { class: "red-form-footer" }, [(o = m.footer) == null ? void 0 : o.call(m)])
137
- ];
138
- } else {
139
- var s;
140
- return p.wrapRow ? a(r, null, { default: () => {
141
- var e;
142
- return [(e = m.default) == null ? void 0 : e.call(m)];
143
- } }) : (s = m.default) == null ? void 0 : s.call(m);
144
- }
145
- } });
146
- }
147
- };
148
- //#endregion
149
- export { p as t };