@fangzhongya/fang-ui 0.1.39 → 0.1.41

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 (141) hide show
  1. package/dist/components/common/use.cjs +148 -101
  2. package/dist/components/common/use.d.ts +26 -6
  3. package/dist/components/common/use.js +149 -102
  4. package/dist/components/company-select/src/index2.cjs +1 -2
  5. package/dist/components/company-select/src/index2.js +1 -2
  6. package/dist/components/double/src/index2.cjs +2 -2
  7. package/dist/components/double/src/index2.js +2 -2
  8. package/dist/components/forms/index.css +18 -0
  9. package/dist/components/forms/src/index2.cjs +9 -6
  10. package/dist/components/forms/src/index2.js +9 -6
  11. package/dist/components/forms/src/setup.cjs +9 -12
  12. package/dist/components/forms/src/setup.js +9 -12
  13. package/dist/components/forms/src/util.cjs +6 -8
  14. package/dist/components/forms/src/util.js +6 -8
  15. package/dist/components/forms-div/src/data.cjs +8 -5
  16. package/dist/components/forms-div/src/data.d.ts +21 -3
  17. package/dist/components/forms-div/src/data.js +8 -5
  18. package/dist/components/forms-div/src/index2.cjs +41 -70
  19. package/dist/components/forms-div/src/index2.js +43 -72
  20. package/dist/components/forms-item/index.css +49 -0
  21. package/dist/components/forms-item/src/data.cjs +6 -0
  22. package/dist/components/forms-item/src/data.d.ts +19 -0
  23. package/dist/components/forms-item/src/data.js +6 -0
  24. package/dist/components/forms-item/src/index2.cjs +11 -7
  25. package/dist/components/forms-item/src/index2.js +11 -7
  26. package/dist/components/forms-item/src/indexts.d.ts +40 -1
  27. package/dist/components/forms-item/src/label.cjs +7 -1
  28. package/dist/components/forms-item/src/label.d.ts +40 -1
  29. package/dist/components/forms-item/src/label.js +7 -1
  30. package/dist/components/forms-items/index.css +18 -0
  31. package/dist/components/forms-items/index.scss +21 -0
  32. package/dist/components/forms-items/src/data.cjs +9 -0
  33. package/dist/components/forms-items/src/data.d.ts +22 -0
  34. package/dist/components/forms-items/src/data.js +9 -0
  35. package/dist/components/forms-items/src/index2.cjs +22 -10
  36. package/dist/components/forms-items/src/index2.js +22 -10
  37. package/dist/components/forms-items/style/index2.scss +1 -0
  38. package/dist/components/icon/src/index2.cjs +1 -2
  39. package/dist/components/icon/src/index2.js +1 -2
  40. package/dist/components/input-history/src/index2.cjs +1 -1
  41. package/dist/components/input-history/src/index2.js +1 -1
  42. package/dist/components/input-select/src/index2.cjs +0 -2
  43. package/dist/components/input-select/src/index2.js +0 -2
  44. package/dist/components/inputs/src/index2.cjs +1 -1
  45. package/dist/components/inputs/src/index2.js +1 -1
  46. package/dist/components/list/src/index2.cjs +4 -8
  47. package/dist/components/list/src/index2.js +4 -8
  48. package/dist/components/list/src/util.cjs +7 -5
  49. package/dist/components/list/src/util.d.ts +29 -1
  50. package/dist/components/list/src/util.js +7 -5
  51. package/dist/components/lists/src/index2.cjs +1 -2
  52. package/dist/components/lists/src/index2.js +1 -2
  53. package/dist/components/menus/src/util.cjs +8 -24
  54. package/dist/components/menus/src/util.js +9 -25
  55. package/dist/components/page/index.css +18 -0
  56. package/dist/components/right-key/src/index2.cjs +3 -3
  57. package/dist/components/right-key/src/index2.js +3 -3
  58. package/dist/components/seamless-scroll/src/index2.cjs +1 -1
  59. package/dist/components/seamless-scroll/src/index2.js +1 -1
  60. package/dist/components/selects/src/index2.cjs +2 -2
  61. package/dist/components/selects/src/index2.js +2 -2
  62. package/dist/components/stick-edge/src/index2.cjs +2 -2
  63. package/dist/components/stick-edge/src/index2.js +2 -2
  64. package/dist/components/switchs/src/index2.cjs +1 -1
  65. package/dist/components/switchs/src/index2.js +1 -1
  66. package/dist/components/tables/common/com-color2.cjs +0 -3
  67. package/dist/components/tables/common/com-color2.js +0 -3
  68. package/dist/components/tables/common/com-lis2.cjs +0 -1
  69. package/dist/components/tables/common/com-lis2.js +0 -1
  70. package/dist/components/tables/common/pagin.d.ts +6 -0
  71. package/dist/components/tables/common/tooltip.cjs +1 -1
  72. package/dist/components/tables/common/tooltip.js +1 -1
  73. package/dist/components/tables/common/util.cjs +2 -4
  74. package/dist/components/tables/common/util.js +2 -4
  75. package/dist/components/tables/src/column.cjs +11 -3
  76. package/dist/components/tables/src/column.d.ts +29 -0
  77. package/dist/components/tables/src/column.js +11 -3
  78. package/dist/components/tables/src/columns.d.ts +7 -0
  79. package/dist/components/tables/src/columns3.cjs +1 -7
  80. package/dist/components/tables/src/columns3.js +1 -7
  81. package/dist/components/tables/src/index2.cjs +2 -2
  82. package/dist/components/tables/src/index2.js +2 -2
  83. package/dist/components/tablesv/src/column.cjs +11 -3
  84. package/dist/components/tablesv/src/column.d.ts +25 -0
  85. package/dist/components/tablesv/src/column.js +11 -3
  86. package/dist/components/tablesv/src/columns.d.ts +7 -0
  87. package/dist/components/tablesv/src/columns3.cjs +1 -7
  88. package/dist/components/tablesv/src/columns3.js +1 -7
  89. package/dist/components/tablesv/src/index2.cjs +2 -2
  90. package/dist/components/tablesv/src/index2.js +2 -2
  91. package/dist/components/uploads/src/util.cjs +2 -3
  92. package/dist/components/uploads/src/util.d.ts +7 -0
  93. package/dist/components/uploads/src/util.js +2 -3
  94. package/dist/css/forms-item.css +49 -0
  95. package/dist/css/forms-items.css +18 -0
  96. package/dist/css/forms.css +18 -0
  97. package/dist/css/index.css +18 -0
  98. package/dist/css/page.css +18 -0
  99. package/dist/directives/adjust/index.cjs +4 -8
  100. package/dist/directives/adjust/index.js +4 -8
  101. package/dist/directives/drag/index.cjs +6 -1
  102. package/dist/directives/drag/index.js +6 -1
  103. package/dist/directives/expose/index.cjs +6 -0
  104. package/dist/directives/expose/index.js +6 -0
  105. package/dist/directives/inserted/index.cjs +5 -0
  106. package/dist/directives/inserted/index.js +5 -0
  107. package/dist/directives/locus/index.cjs +5 -0
  108. package/dist/directives/locus/index.js +5 -0
  109. package/dist/directives/scroll/index.cjs +10 -0
  110. package/dist/directives/scroll/index.d.ts +0 -5
  111. package/dist/directives/scroll/index.js +10 -0
  112. package/dist/directives/sortable/index.cjs +5 -0
  113. package/dist/directives/sortable/index.js +5 -0
  114. package/dist/directives/stick/index.cjs +13 -8
  115. package/dist/directives/stick/index.js +13 -8
  116. package/dist/hooks/attrs-default/index.d.ts +5 -3
  117. package/dist/hooks/compons/index.d.ts +13 -0
  118. package/dist/hooks/cssname/index.cjs +1 -1
  119. package/dist/hooks/cssname/index.d.ts +22 -1
  120. package/dist/hooks/cssname/index.js +1 -1
  121. package/dist/hooks/default-config/index.d.ts +10 -0
  122. package/dist/hooks/expose/index.cjs +2 -0
  123. package/dist/hooks/expose/index.d.ts +6 -0
  124. package/dist/hooks/expose/index.js +2 -0
  125. package/dist/hooks/full-screen/index.d.ts +6 -0
  126. package/dist/hooks/global-config/index.d.ts +16 -0
  127. package/dist/hooks/inherit/index.cjs +2 -0
  128. package/dist/hooks/inherit/index.d.ts +8 -0
  129. package/dist/hooks/inherit/index.js +2 -0
  130. package/dist/hooks/locale/index.d.ts +24 -0
  131. package/dist/hooks/props-default/index.d.ts +14 -5
  132. package/dist/icons/iconify.d.ts +7 -0
  133. package/dist/icons/iconifyCss.d.ts +6 -0
  134. package/dist/icons/index.json +1 -1
  135. package/dist/index.css +18 -0
  136. package/dist/type.d.ts +8 -0
  137. package/dist/utils/local.cjs +12 -6
  138. package/dist/utils/local.js +12 -6
  139. package/dist/utils/util.cjs +7 -5
  140. package/dist/utils/util.js +7 -5
  141. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { h, resolveComponent, computed, useAttrs, isVNode, Fragment, render } from "vue";
1
+ import { isVNode, h, resolveComponent, computed, Fragment, render } from "vue";
2
2
  import { isHTMLTag, isSVGTag } from "@vue/shared";
3
3
  import { getFathers, getChildrenData } from "../../utils/util.js";
4
4
  import { isObject } from "@fangzhongya/utils/basic/object/isObject";
@@ -88,17 +88,26 @@ function handleComputedWithoutDefault(obj, v) {
88
88
  }
89
89
  }
90
90
  function setFormDefaultValue(obj, value) {
91
- let v = getChildrenData(obj, value, true) ?? {};
91
+ let v = getChildrenData(obj, value);
92
92
  if (obj.orig) {
93
- v = value;
93
+ v = value ?? {};
94
94
  }
95
95
  setComputed(obj, v);
96
96
  const prop = obj.prop;
97
97
  if (prop) {
98
- if (obj.pars) {
99
- setObjValue(v, prop, getObjValue(prop, v) ?? obj.default);
98
+ if (v) {
99
+ if (obj.pars) {
100
+ setObjValue(v, prop, getObjValue(prop, v) ?? obj.default);
101
+ } else {
102
+ v[prop] = v[prop] ?? obj.default;
103
+ }
100
104
  } else {
101
- v[prop] = v[prop] ?? obj.default;
105
+ v = getChildrenData(obj, value, true);
106
+ if (obj.pars) {
107
+ setObjValue(v, prop, getObjValue(prop, v) ?? obj.default);
108
+ } else {
109
+ v[prop] = v[prop] ?? obj.default;
110
+ }
102
111
  }
103
112
  }
104
113
  }
@@ -148,48 +157,46 @@ function getValueObjs(value, multiple, options, config) {
148
157
  return value;
149
158
  }
150
159
  }
151
- function setOptionsValue(value, obj, data, optionss = {}) {
152
- let options = [];
153
- if (obj == null ? void 0 : obj.options) {
154
- const opt = obj.options;
155
- if (typeof opt === "string") {
156
- const value2 = optionss[opt];
157
- if (typeof value2 == "function") {
158
- options = value2(optionss, value2, obj, data) || [];
159
- } else {
160
- options = value2 || [];
161
- }
162
- } else if (typeof opt == "function") {
163
- options = opt(optionss, value, obj, data) || [];
164
- } else {
165
- options = opt || [];
166
- }
167
- }
168
- return getValueObjs(value, obj.multiple, options, obj.config);
160
+ function setOptionsValue(value, obj, data, options = {}) {
161
+ return getValueObjs(
162
+ value,
163
+ obj.multiple,
164
+ processOptions(value, obj, data, options),
165
+ obj.config
166
+ );
169
167
  }
170
168
  function setValue(value, obj, data) {
171
- let v = getChildrenData(obj, data) ?? {};
169
+ let v = getChildrenData(obj, data);
172
170
  if (obj.orig) {
173
171
  v = data ?? {};
174
172
  }
175
173
  const prop = obj.prop;
176
174
  if (prop) {
177
- if (obj.pars) {
178
- setObjValue(v, prop, value);
175
+ if (v) {
176
+ if (obj.pars) {
177
+ setObjValue(v, prop, value);
178
+ } else {
179
+ v[prop] = value;
180
+ }
179
181
  } else {
180
- v[prop] = value;
182
+ v = getChildrenData(obj, data, true);
183
+ if (obj.pars) {
184
+ setObjValue(v, prop, value);
185
+ } else {
186
+ v[prop] = value;
187
+ }
181
188
  }
182
189
  }
183
190
  }
184
191
  function getValue(obj, data, index) {
185
192
  const prop = obj.prop;
186
- const cdata = getChildrenData(obj, data, true) ?? {};
193
+ const cdata = getChildrenData(obj, data);
187
194
  let cellValue;
188
195
  if (prop) {
189
196
  if (obj.pars) {
190
197
  cellValue = getObjValue(prop, cdata);
191
198
  } else {
192
- cellValue = cdata[prop];
199
+ cellValue = cdata == null ? void 0 : cdata[prop];
193
200
  }
194
201
  } else {
195
202
  cellValue = obj.value;
@@ -200,36 +207,51 @@ function getValue(obj, data, index) {
200
207
  return cellValue ?? obj.default;
201
208
  }
202
209
  }
203
- function setComponString(value, obj, componObj, data, optionss, compons) {
204
- processOptions(obj, componObj, optionss, value, data);
210
+ function setComponString(value, obj, componObj, compons) {
205
211
  const compon = obj.compon;
206
212
  const tcom = lineToLargeHump(compon);
207
- return renderComponent(tcom, compon, componObj, value, compons);
213
+ return renderComponent(obj, tcom, compon, componObj, value, compons);
208
214
  }
209
- function processOptions(obj, componObj, optionss, value, data) {
210
- if (!(obj == null ? void 0 : obj.options)) return;
211
- let options = [];
215
+ function processOptions(value, obj, data, options) {
216
+ if (!(obj == null ? void 0 : obj.options)) return [];
217
+ let option = [];
212
218
  const opt = obj.options;
213
219
  if (typeof opt === "string") {
214
- const optionsvalue = optionss[opt];
215
- options = typeof optionsvalue == "function" ? optionsvalue(optionss, value, obj, data) || [] : optionsvalue || [];
220
+ const optionsvalue = options[opt];
221
+ option = typeof optionsvalue == "function" ? optionsvalue(options, value, obj, data) || [] : optionsvalue || [];
216
222
  } else if (typeof opt == "function") {
217
- options = opt(optionss, value, obj, data) || [];
223
+ option = opt(options, value, obj, data) || [];
218
224
  } else {
219
- options = opt || [];
225
+ option = opt || [];
220
226
  }
221
- if ((options == null ? void 0 : options.length) > 0) {
222
- componObj.options = options;
227
+ return option;
228
+ }
229
+ function setSlots(obj) {
230
+ const slots = obj.slots;
231
+ if (isVNode(slots)) {
232
+ return {
233
+ default: () => slots
234
+ };
235
+ } else if (typeof slots === "function") {
236
+ return {
237
+ default: slots
238
+ };
239
+ } else if (isObject(slots)) {
240
+ return slots;
241
+ } else if (slots) {
242
+ return {
243
+ default: () => slots
244
+ };
223
245
  }
224
246
  }
225
- function renderComponent(tcom, compon, componObj, value, compons) {
247
+ function renderComponent(obj, tcom, compon, componObj, value, compons) {
226
248
  if (Object.keys(compons).includes(tcom)) {
227
- return h(compons[tcom], componObj);
249
+ return h(compons[tcom], componObj, setSlots(obj));
228
250
  }
229
251
  if (isHTMLTag(compon) || isSVGTag(compon)) {
230
252
  return h(compon, componObj, value);
231
253
  }
232
- return h(resolveComponent(compon), componObj);
254
+ return h(resolveComponent(compon), componObj, setSlots(obj));
233
255
  }
234
256
  function getOnObjs(obj, data, emit, ...arrs) {
235
257
  const objs = {};
@@ -250,63 +272,74 @@ function getOnObjs(obj, data, emit, ...arrs) {
250
272
  }
251
273
  return objs;
252
274
  }
253
- function useSetSlot(obj, data, slots, index, scope) {
275
+ function useSetSlot(obj, data, slots, options, emit, index, scope) {
254
276
  const slotname = obj.slot ?? obj.prop;
255
277
  if (slotname) {
256
278
  const slot = slots[slotname];
257
279
  if (slot) {
258
- const value = computed({
280
+ let value = (scope == null ? void 0 : scope.value) ?? computed({
259
281
  get() {
260
282
  return getValue(obj, data, index);
261
283
  },
262
- set(value2) {
263
- setValue(value2, obj, data);
284
+ set(v) {
285
+ setValue(v, obj, data);
264
286
  }
265
287
  });
288
+ const componObj = getComponObj(
289
+ value == null ? void 0 : value.value,
290
+ obj,
291
+ data,
292
+ options,
293
+ emit,
294
+ scope
295
+ );
266
296
  return slot({
267
- comscope: scope,
268
297
  column: obj,
269
298
  row: data,
270
299
  value,
271
- index
300
+ index,
301
+ ...componObj
272
302
  });
273
303
  }
274
304
  }
275
305
  }
276
- function useSetCompon(obj, data, optionss, compons, emit, index, scope) {
306
+ function getComponObj(value, obj, data, options, emit, scope) {
307
+ const componValueName = obj.componValueName || "modelValue";
308
+ const componObj = {
309
+ // ...attrs,
310
+ [componValueName]: value,
311
+ ["onUpdate:" + componValueName]: (v) => setValue(v, obj, data),
312
+ listobj: obj,
313
+ valueobj: data,
314
+ comscope: scope,
315
+ ...obj.config,
316
+ ...getOnObjs(obj, data, emit, scope)
317
+ };
318
+ if (obj.multiple) {
319
+ componObj.multiple = obj.multiple;
320
+ }
321
+ const option = processOptions(value, obj, data, options);
322
+ if (option.length > 0) {
323
+ componObj.options = option;
324
+ }
325
+ return componObj;
326
+ }
327
+ function useSetCompon(obj, data, options, compons, emit, index, scope) {
277
328
  if (obj.compon) {
278
329
  const value = getValue(obj, data, index);
279
- const componValueName = obj.componValueName || "modelValue";
280
- const attrs = useAttrs();
281
- const componObj = {
282
- ...attrs,
283
- ...obj.config,
284
- ...getOnObjs(obj, data, emit, scope),
285
- [componValueName]: value,
286
- ["onUpdate:" + componValueName]: (v) => setValue(v, obj, data),
287
- listobj: obj,
288
- valueobj: data,
289
- comscope: scope
290
- };
291
- if (obj.multiple) {
292
- componObj.multiple = obj.multiple;
293
- }
294
- if (typeof obj.compon == "string") {
295
- return setComponString(
296
- value,
297
- obj,
298
- componObj,
299
- data,
300
- optionss,
301
- compons
302
- );
303
- } else if (typeof obj.compon == "function") {
304
- return obj.compon(componObj);
305
- } else if (isVNode(obj.compon)) {
306
- return obj.compon;
307
- } else {
308
- return h(obj.compon, componObj);
309
- }
330
+ const componObj = getComponObj(value, obj, data, options, emit, scope);
331
+ return useGetCompon(obj.compon, componObj, obj, compons, value);
332
+ }
333
+ }
334
+ function useGetCompon(compon, componObj, obj, compons, value) {
335
+ if (typeof compon == "string") {
336
+ return setComponString(value, obj, componObj, compons);
337
+ } else if (typeof compon == "function") {
338
+ return compon(componObj, setSlots(obj));
339
+ } else if (isVNode(compon)) {
340
+ return compon;
341
+ } else {
342
+ return h(compon, componObj, setSlots(obj));
310
343
  }
311
344
  }
312
345
  const useGetDomValue = (obj, data, options, index) => {
@@ -316,7 +349,7 @@ const useGetDomValue = (obj, data, options, index) => {
316
349
  }
317
350
  return value;
318
351
  };
319
- const useGetDomLabel = (obj, data, slots, optionss, compons, emit, index) => {
352
+ const useGetDomLabel = (obj, data, slots, options, compons, emit, index) => {
320
353
  const label = obj.label;
321
354
  if (!label) {
322
355
  return label;
@@ -331,48 +364,46 @@ const useGetDomLabel = (obj, data, slots, optionss, compons, emit, index) => {
331
364
  return label;
332
365
  }
333
366
  if (Array.isArray(label)) {
334
- return renderLabelArray(label, data, optionss, compons, emit, index);
367
+ return renderLabelArray(label, data, options, compons, emit, index);
335
368
  }
336
- return handleObjectLabel(
337
- label,
338
- data,
339
- slots,
340
- optionss,
369
+ return useVNodeComponDom(label, data, slots, emit, {
370
+ options,
341
371
  compons,
342
- emit,
343
372
  index
344
- );
373
+ });
345
374
  };
346
- const renderLabelArray = (labels, data, optionss, compons, emit, index) => {
375
+ const renderLabelArray = (labels, data, options, compons, emit, index) => {
347
376
  return h(
348
377
  "div",
349
378
  { class: "com-lable-array" },
350
379
  labels.map((v) => {
351
380
  const labelObj = typeof v === "string" ? { value: v, compon: "div" } : v;
352
- return useSetCompon(labelObj, data, optionss, compons, emit, index);
381
+ return useSetCompon(labelObj, data, options, compons, emit, index);
353
382
  })
354
383
  );
355
384
  };
356
- const handleObjectLabel = (label, data, slots, optionss, compons, emit, index) => {
357
- const slot = useSetSlot(label, data, slots, index);
385
+ function useVNodeComponDom(obj, data, slots, emit, config) {
386
+ const { options, compons, index, scope } = config;
387
+ const slot = useSetSlot(obj, data, slots, options, emit, index, scope);
358
388
  if (slot) {
359
389
  return slot;
360
390
  }
361
- if (label.compon) {
391
+ if (obj.compon) {
362
392
  const column = useSetCompon(
363
- label,
393
+ obj,
364
394
  data,
365
- optionss,
395
+ options,
366
396
  compons,
367
397
  emit,
368
- index
398
+ index,
399
+ scope
369
400
  );
370
401
  if (column) {
371
402
  return column;
372
403
  }
373
404
  }
374
- return useGetDomValue(label, data, optionss, index);
375
- };
405
+ return useGetDomValue(obj, data, options, index);
406
+ }
376
407
  function useObjComponSelected(obj, props) {
377
408
  const arrs = [obj];
378
409
  getFathers(obj, arrs);
@@ -415,6 +446,19 @@ function getLabelText(obj) {
415
446
  if (obj.labelText) {
416
447
  return obj.labelText;
417
448
  }
449
+ if (!obj.label) {
450
+ const farrs = [];
451
+ getFathers(obj, farrs);
452
+ farrs.reverse();
453
+ for (const v of farrs) {
454
+ if (v.labelText) {
455
+ return v.labelText;
456
+ } else if (v.label) {
457
+ obj = v;
458
+ break;
459
+ }
460
+ }
461
+ }
418
462
  const label = useGetDomLabel(obj, {}, {}, {}, {}, () => {
419
463
  }, 0);
420
464
  if (isVNode(label)) {
@@ -424,11 +468,13 @@ function getLabelText(obj) {
424
468
  }
425
469
  }
426
470
  export {
471
+ getComponObj,
427
472
  getFormRule,
428
473
  getLabelText,
429
474
  getOnObjs,
430
475
  getVNodeContent,
431
476
  setFormDefaultValue,
477
+ useGetCompon,
432
478
  useGetDomLabel,
433
479
  useGetDomValue,
434
480
  useHide,
@@ -438,5 +484,6 @@ export {
438
484
  useSetCompon,
439
485
  useSetSlot,
440
486
  useSetValue,
487
+ useVNodeComponDom,
441
488
  useVueValue
442
489
  };
@@ -71,8 +71,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
71
71
  }
72
72
  function getArrKyeObj(arr, key, value) {
73
73
  if (arr) {
74
- for (let index2 = 0; index2 < arr.length; index2++) {
75
- const element = arr[index2];
74
+ for (const element of arr) {
76
75
  if (element[key] === value) {
77
76
  return element;
78
77
  }
@@ -69,8 +69,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
69
  }
70
70
  function getArrKyeObj(arr, key, value) {
71
71
  if (arr) {
72
- for (let index = 0; index < arr.length; index++) {
73
- const element = arr[index];
72
+ for (const element of arr) {
74
73
  if (element[key] === value) {
75
74
  return element;
76
75
  }
@@ -201,9 +201,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
201
201
  clearTimeout(timeout);
202
202
  }
203
203
  vue.onMounted(() => {
204
- if (window) {
204
+ if (globalThis) {
205
205
  console.log("onMounted");
206
- window.addEventListener("click", () => {
206
+ globalThis.addEventListener("click", () => {
207
207
  console.log("click");
208
208
  isfocus.value = false;
209
209
  });
@@ -199,9 +199,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
199
199
  clearTimeout(timeout);
200
200
  }
201
201
  onMounted(() => {
202
- if (window) {
202
+ if (globalThis) {
203
203
  console.log("onMounted");
204
- window.addEventListener("click", () => {
204
+ globalThis.addEventListener("click", () => {
205
205
  console.log("click");
206
206
  isfocus.value = false;
207
207
  });
@@ -49,6 +49,24 @@
49
49
  display: grid;
50
50
  }
51
51
 
52
+ .forms-items {
53
+ width: 100%;
54
+ }
55
+ .forms-items.row {
56
+ display: flex;
57
+ flex-direction: row;
58
+ }
59
+ .forms-items.column {
60
+ display: flex;
61
+ flex-direction: column;
62
+ }
63
+ .forms-items-li.no-error {
64
+ --el-color-danger: var(--el-border-color);
65
+ }
66
+ .forms-items-li.no-error .el-input__wrapper.is-focus {
67
+ --el-color-danger: var(--el-input-focus-border);
68
+ }
69
+
52
70
  .double {
53
71
  width: 100%;
54
72
  display: inline-flex;
@@ -44,6 +44,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
44
44
  function setKey(value, index2) {
45
45
  return [index2, value.label, value.prop, value.compon].join(",");
46
46
  }
47
+ const onUpform = (...arr) => emit("upform", ...arr);
47
48
  __expose({
48
49
  /**
49
50
  * @expose { Element } dom
@@ -104,7 +105,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
104
105
  "label-position": vue.unref(props).labelPosition == "auto" ? void 0 : vue.unref(props).labelPosition,
105
106
  ref_key: "refForm",
106
107
  ref: refForm,
107
- onSubmit: _cache[4] || (_cache[4] = vue.withModifiers(() => {
108
+ onSubmit: _cache[2] || (_cache[2] = vue.withModifiers(() => {
108
109
  }, ["prevent"]))
109
110
  }), {
110
111
  default: vue.withCtx(() => [
@@ -122,11 +123,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
122
123
  (item == null ? void 0 : item.isdiv) ? (vue.openBlock(), vue.createBlock(vue.unref(index$5.FormsDiv), {
123
124
  key: 0,
124
125
  listobj: item,
126
+ index: [index2],
125
127
  optionss: vue.unref(props).options,
126
128
  valueobj: vue.unref(dataForm),
127
129
  modelValue: vue.unref(dataForm),
128
130
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(dataForm) ? dataForm.value = $event : null),
129
- onUpform: _cache[1] || (_cache[1] = (...arr) => emit("upform", ...arr))
131
+ onUpform
130
132
  }, vue.createSlots({ _: 2 }, [
131
133
  vue.renderList(Object.keys(vue.unref(slots)), (k) => {
132
134
  return {
@@ -136,14 +138,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
136
138
  ])
137
139
  };
138
140
  })
139
- ]), 1032, ["listobj", "optionss", "valueobj", "modelValue"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$6.FormsItem), {
141
+ ]), 1032, ["listobj", "index", "optionss", "valueobj", "modelValue"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$6.FormsItem), {
140
142
  key: 1,
141
143
  listobj: item,
144
+ index: [index2],
142
145
  optionss: vue.unref(props).options,
143
146
  valueobj: vue.unref(dataForm),
144
147
  modelValue: vue.unref(dataForm),
145
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(dataForm) ? dataForm.value = $event : null),
146
- onUpform: _cache[3] || (_cache[3] = (...arr) => emit("upform", ...arr))
148
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(dataForm) ? dataForm.value = $event : null),
149
+ onUpform
147
150
  }, vue.createSlots({ _: 2 }, [
148
151
  vue.renderList(Object.keys(vue.unref(slots)), (k) => {
149
152
  return {
@@ -153,7 +156,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
153
156
  ])
154
157
  };
155
158
  })
156
- ]), 1032, ["listobj", "optionss", "valueobj", "modelValue"]))
159
+ ]), 1032, ["listobj", "index", "optionss", "valueobj", "modelValue"]))
157
160
  ], 6)), [
158
161
  [vue.vShow, !vue.unref(use.useHide)(item, vue.unref(dataForm))]
159
162
  ]);
@@ -42,6 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  function setKey(value, index) {
43
43
  return [index, value.label, value.prop, value.compon].join(",");
44
44
  }
45
+ const onUpform = (...arr) => emit("upform", ...arr);
45
46
  __expose({
46
47
  /**
47
48
  * @expose { Element } dom
@@ -102,7 +103,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
102
103
  "label-position": unref(props).labelPosition == "auto" ? void 0 : unref(props).labelPosition,
103
104
  ref_key: "refForm",
104
105
  ref: refForm,
105
- onSubmit: _cache[4] || (_cache[4] = withModifiers(() => {
106
+ onSubmit: _cache[2] || (_cache[2] = withModifiers(() => {
106
107
  }, ["prevent"]))
107
108
  }), {
108
109
  default: withCtx(() => [
@@ -120,11 +121,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
120
121
  (item == null ? void 0 : item.isdiv) ? (openBlock(), createBlock(unref(FormsDiv), {
121
122
  key: 0,
122
123
  listobj: item,
124
+ index: [index],
123
125
  optionss: unref(props).options,
124
126
  valueobj: unref(dataForm),
125
127
  modelValue: unref(dataForm),
126
128
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(dataForm) ? dataForm.value = $event : null),
127
- onUpform: _cache[1] || (_cache[1] = (...arr) => emit("upform", ...arr))
129
+ onUpform
128
130
  }, createSlots({ _: 2 }, [
129
131
  renderList(Object.keys(unref(slots)), (k) => {
130
132
  return {
@@ -134,14 +136,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
134
136
  ])
135
137
  };
136
138
  })
137
- ]), 1032, ["listobj", "optionss", "valueobj", "modelValue"])) : (openBlock(), createBlock(unref(FormsItem), {
139
+ ]), 1032, ["listobj", "index", "optionss", "valueobj", "modelValue"])) : (openBlock(), createBlock(unref(FormsItem), {
138
140
  key: 1,
139
141
  listobj: item,
142
+ index: [index],
140
143
  optionss: unref(props).options,
141
144
  valueobj: unref(dataForm),
142
145
  modelValue: unref(dataForm),
143
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(dataForm) ? dataForm.value = $event : null),
144
- onUpform: _cache[3] || (_cache[3] = (...arr) => emit("upform", ...arr))
146
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(dataForm) ? dataForm.value = $event : null),
147
+ onUpform
145
148
  }, createSlots({ _: 2 }, [
146
149
  renderList(Object.keys(unref(slots)), (k) => {
147
150
  return {
@@ -151,7 +154,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
151
154
  ])
152
155
  };
153
156
  })
154
- ]), 1032, ["listobj", "optionss", "valueobj", "modelValue"]))
157
+ ]), 1032, ["listobj", "index", "optionss", "valueobj", "modelValue"]))
155
158
  ], 6)), [
156
159
  [vShow, !unref(useHide)(item, unref(dataForm))]
157
160
  ]);
@@ -14,7 +14,7 @@ const Components = {
14
14
  };
15
15
  function setUp(props, emit, cs, refForm, getLocale) {
16
16
  const buts = vue.computed(() => {
17
- if (typeof props.buts == "undefined") {
17
+ if (props.buts === void 0) {
18
18
  return [
19
19
  {
20
20
  _id: "2",
@@ -138,12 +138,9 @@ function setUp(props, emit, cs, refForm, getLocale) {
138
138
  return rules;
139
139
  }
140
140
  const dataRules = vue.ref(getRules());
141
- vue.watch(
142
- () => props.list.length,
143
- () => {
144
- dataRules.value = getRules();
145
- }
146
- );
141
+ vue.watch([() => props.list, () => props.list.length], () => {
142
+ dataRules.value = getRules();
143
+ });
147
144
  function validate() {
148
145
  return new Promise((resolve, reject) => {
149
146
  if (refForm.value) {
@@ -166,18 +163,18 @@ function setUp(props, emit, cs, refForm, getLocale) {
166
163
  if (callback) {
167
164
  callback(list, true);
168
165
  }
169
- emit("submit", list);
170
- }).catch((res) => {
166
+ emit("submit", list, true);
167
+ }).catch((error) => {
171
168
  if (callback) {
172
- callback(res, false);
169
+ callback(error, false);
173
170
  }
174
- emit("submit", res);
171
+ emit("submit", error, false);
175
172
  });
176
173
  } else {
177
174
  if (callback) {
178
175
  callback(obj);
179
176
  }
180
- emit("submit", obj);
177
+ emit("submit", obj, true, true);
181
178
  }
182
179
  }).catch(() => {
183
180
  });