@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
@@ -12,7 +12,7 @@ const Components = {
12
12
  };
13
13
  function setUp(props, emit, cs, refForm, getLocale) {
14
14
  const buts = computed(() => {
15
- if (typeof props.buts == "undefined") {
15
+ if (props.buts === void 0) {
16
16
  return [
17
17
  {
18
18
  _id: "2",
@@ -136,12 +136,9 @@ function setUp(props, emit, cs, refForm, getLocale) {
136
136
  return rules;
137
137
  }
138
138
  const dataRules = ref(getRules());
139
- watch(
140
- () => props.list.length,
141
- () => {
142
- dataRules.value = getRules();
143
- }
144
- );
139
+ watch([() => props.list, () => props.list.length], () => {
140
+ dataRules.value = getRules();
141
+ });
145
142
  function validate() {
146
143
  return new Promise((resolve, reject) => {
147
144
  if (refForm.value) {
@@ -164,18 +161,18 @@ function setUp(props, emit, cs, refForm, getLocale) {
164
161
  if (callback) {
165
162
  callback(list, true);
166
163
  }
167
- emit("submit", list);
168
- }).catch((res) => {
164
+ emit("submit", list, true);
165
+ }).catch((error) => {
169
166
  if (callback) {
170
- callback(res, false);
167
+ callback(error, false);
171
168
  }
172
- emit("submit", res);
169
+ emit("submit", error, false);
173
170
  });
174
171
  } else {
175
172
  if (callback) {
176
173
  callback(obj);
177
174
  }
178
- emit("submit", obj);
175
+ emit("submit", obj, true, true);
179
176
  }
180
177
  }).catch(() => {
181
178
  });
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const use = require("../../common/use.cjs");
4
3
  const judge = require("@fangzhongya/utils/judge/judge");
5
4
  const config = require("../common/config.cjs");
6
5
  const lineToLargeHump = require("@fangzhongya/utils/name/lineToLargeHump");
6
+ const use = require("../../common/use.cjs");
7
7
  function _interopNamespaceDefault(e) {
8
8
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
9
9
  if (e) {
@@ -125,14 +125,12 @@ function getLinkageJudge(jyjudgev, linkage) {
125
125
  const v = judge2 == null ? void 0 : judge2(val, data);
126
126
  if (v) {
127
127
  callback(new Error(v));
128
- } else {
129
- if (prop) {
130
- refForm == null ? void 0 : refForm.validateField([prop], () => {
131
- callback();
132
- });
133
- } else {
128
+ } else if (prop) {
129
+ refForm == null ? void 0 : refForm.validateField([prop], () => {
134
130
  callback();
135
- }
131
+ });
132
+ } else {
133
+ callback();
136
134
  }
137
135
  };
138
136
  }
@@ -1,7 +1,7 @@
1
- import { getLabelText, useHide } from "../../common/use.js";
2
1
  import * as judge from "@fangzhongya/utils/judge/judge";
3
2
  import { changes } from "../common/config.js";
4
3
  import { lineToLargeHump } from "@fangzhongya/utils/name/lineToLargeHump";
4
+ import { getLabelText, useHide } from "../../common/use.js";
5
5
  function isValue(value) {
6
6
  if (value || value === 0 || value === false) {
7
7
  return false;
@@ -106,14 +106,12 @@ function getLinkageJudge(jyjudgev, linkage) {
106
106
  const v = judge2 == null ? void 0 : judge2(val, data);
107
107
  if (v) {
108
108
  callback(new Error(v));
109
- } else {
110
- if (prop) {
111
- refForm == null ? void 0 : refForm.validateField([prop], () => {
112
- callback();
113
- });
114
- } else {
109
+ } else if (prop) {
110
+ refForm == null ? void 0 : refForm.validateField([prop], () => {
115
111
  callback();
116
- }
112
+ });
113
+ } else {
114
+ callback();
117
115
  }
118
116
  };
119
117
  }
@@ -2,6 +2,12 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const name = "forms-div";
4
4
  const dataProps = {
5
+ index: {
6
+ type: Array,
7
+ default() {
8
+ return [];
9
+ }
10
+ },
5
11
  /**
6
12
  * @props { Object<ObjAny>} options={}
7
13
  * 选择数据集合
@@ -37,13 +43,10 @@ const dataProps = {
37
43
  },
38
44
  /**
39
45
  * 传入值
40
- * @props { Object } modelValue={} ( )
46
+ * @props { Object } modelValue ( )
41
47
  */
42
48
  modelValue: {
43
- type: Object,
44
- default() {
45
- return {};
46
- }
49
+ type: null
47
50
  },
48
51
  /**
49
52
  * @props { Object<ObjStr> } formvalue= ( )
@@ -4,6 +4,25 @@ import { ExtractPropTypes } from 'vue';
4
4
  */
5
5
  export declare const name = "forms-div";
6
6
  export declare const dataProps: {
7
+ index: {
8
+ type: {
9
+ (arrayLength: number): number[];
10
+ (...items: number[]): number[];
11
+ new (arrayLength: number): number[];
12
+ new (...items: number[]): number[];
13
+ isArray(arg: any): arg is any[];
14
+ readonly prototype: any[];
15
+ from<T>(arrayLike: ArrayLike<T>): T[];
16
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
17
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
18
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
19
+ of<T>(...items: T[]): T[];
20
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
21
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
22
+ readonly [Symbol.species]: ArrayConstructor;
23
+ };
24
+ default(): never[];
25
+ };
7
26
  /**
8
27
  * @props { Object<ObjAny>} options={}
9
28
  * 选择数据集合
@@ -35,11 +54,10 @@ export declare const dataProps: {
35
54
  };
36
55
  /**
37
56
  * 传入值
38
- * @props { Object } modelValue={} ( )
57
+ * @props { Object } modelValue ( )
39
58
  */
40
59
  modelValue: {
41
- type: ObjectConstructor;
42
- default(): {};
60
+ type: null;
43
61
  };
44
62
  /**
45
63
  * @props { Object<ObjStr> } formvalue= ( )
@@ -1,5 +1,11 @@
1
1
  const name = "forms-div";
2
2
  const dataProps = {
3
+ index: {
4
+ type: Array,
5
+ default() {
6
+ return [];
7
+ }
8
+ },
3
9
  /**
4
10
  * @props { Object<ObjAny>} options={}
5
11
  * 选择数据集合
@@ -35,13 +41,10 @@ const dataProps = {
35
41
  },
36
42
  /**
37
43
  * 传入值
38
- * @props { Object } modelValue={} ( )
44
+ * @props { Object } modelValue ( )
39
45
  */
40
46
  modelValue: {
41
- type: Object,
42
- default() {
43
- return {};
44
- }
47
+ type: null
45
48
  },
46
49
  /**
47
50
  * @props { Object<ObjStr> } formvalue= ( )
@@ -2,7 +2,6 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
4
  const data = require("./data.cjs");
5
- const lineToLargeHump = require("@fangzhongya/utils/name/lineToLargeHump");
6
5
  const objValue = require("@fangzhongya/utils/basic/object/objValue");
7
6
  const index = require("../../../hooks/cssname/index.cjs");
8
7
  const use = require("../../common/use.cjs");
@@ -21,6 +20,7 @@ const _sfc_main = vue.defineComponent({
21
20
  const prs = index$1.usePropsDefault(data.name, p, data.dataProps);
22
21
  const props = prs.listobj;
23
22
  const compons = index$2.useComponsGet(config.provides.compons);
23
+ const form = vue.inject(config.provides.form, {});
24
24
  const formvalue = vue.computed(() => {
25
25
  const o = {};
26
26
  if (typeof props.formvalue === "object") {
@@ -99,7 +99,7 @@ const _sfc_main = vue.defineComponent({
99
99
  return result;
100
100
  }
101
101
  function getSourceObject() {
102
- let source = prs.modelValue ?? {};
102
+ let source = prs.modelValue;
103
103
  if (props.orig) {
104
104
  source = prs.valueobj ?? {};
105
105
  }
@@ -136,10 +136,10 @@ const _sfc_main = vue.defineComponent({
136
136
  if (props.computed) {
137
137
  handleComputedSet(newValue, v);
138
138
  }
139
- if (!props.orig) {
140
- emit("update:modelValue", v);
139
+ if (!props.orig && !prop) {
140
+ emit("update:modelValue", newValue);
141
141
  }
142
- if (props.compon !== "items") {
142
+ if (prop) {
143
143
  emit("upform", newValue, props, v);
144
144
  }
145
145
  }
@@ -167,78 +167,49 @@ const _sfc_main = vue.defineComponent({
167
167
  }
168
168
  }
169
169
  }
170
- const options = vue.computed(() => {
171
- const optionss = prs.optionss;
172
- if (typeof props.options === "string") {
173
- const value2 = optionss[props.options];
174
- if (typeof value2 == "function") {
175
- return value2(optionss, value2.value, props) || [];
176
- } else {
177
- return value2 || [];
178
- }
179
- } else if (typeof props.options == "function") {
180
- return props.options(optionss, value.value, props) || [];
181
- } else {
182
- return props.options || [];
183
- }
184
- });
185
- const render = () => {
170
+ const setDom = () => {
171
+ var _a;
186
172
  const compon = props.compon || prs.compon || "input";
187
173
  const componValueName = prs.componValueName || "modelValue";
188
- const componObj = {
189
- ...binds.value,
190
- ...use.getOnObjs(
191
- props,
192
- prs.valueobj ?? value.value,
193
- emit,
194
- value
195
- ),
196
- class: cs.z("com"),
197
- options: options.value,
198
- listobj: props,
199
- multiple: props.multiple,
200
- optionss: prs.optionss,
201
- valueobj: prs.valueobj,
202
- [componValueName]: value.value,
203
- ["onUpdate:" + componValueName]: (v) => value.value = v,
204
- ["onUpform"]: (...arr) => {
205
- emit("upform", ...arr);
174
+ const obj = {
175
+ ...props,
176
+ compon,
177
+ slots: props.slots ?? slots,
178
+ config: {
179
+ ...binds.value,
180
+ index: prs.index,
181
+ class: [cs.z("com"), ((_a = props.config) == null ? void 0 : _a.class) ?? ""].join(
182
+ " "
183
+ ),
184
+ [componValueName]: value.value,
185
+ ["onUpdate:" + componValueName]: (v) => value.value = v,
186
+ ["onUpform"]: (...arr) => {
187
+ if (props.prop) {
188
+ emit("upform", ...arr);
189
+ }
190
+ }
206
191
  }
207
192
  };
208
- if (typeof compon == "string") {
209
- const tcom = lineToLargeHump.lineToLargeHump(compon);
210
- if (Object.keys(compons).includes(tcom)) {
211
- return vue.h(compons[tcom], componObj, slots);
212
- } else {
213
- return vue.h(vue.resolveComponent(compon), componObj, slots);
214
- }
215
- } else if (typeof compon == "function") {
216
- return compon(componObj, slots);
217
- } else if (vue.isVNode(compon)) {
218
- return compon;
219
- } else {
220
- return vue.h(compon, componObj, slots);
221
- }
222
- };
223
- const setSslot = () => {
224
- const slotname = props.slot ?? props.prop;
225
- if (slotname) {
226
- const slot = slots[slotname];
227
- if (slot) {
228
- return slot({
229
- row: prs.valueobj,
230
- value,
231
- column: props,
232
- options: options.value,
233
- multiple: props.multiple,
234
- optionss: prs.optionss
235
- });
193
+ return use.useVNodeComponDom(
194
+ obj,
195
+ prs.valueobj ?? value.value,
196
+ slots,
197
+ emit,
198
+ {
199
+ options: prs.optionss,
200
+ compons,
201
+ index: prs.index,
202
+ scope: {
203
+ $index: prs.index[0] || 0,
204
+ config: form,
205
+ options: prs.optionss,
206
+ value
207
+ }
236
208
  }
237
- }
238
- return render();
209
+ );
239
210
  };
240
211
  return () => {
241
- return props.compon ? vue.h("div", { class: cs.z() }, [setSslot()]) : "";
212
+ return props.compon ? vue.h("div", { class: cs.z() }, [setDom()]) : "";
242
213
  };
243
214
  }
244
215
  });
@@ -1,9 +1,8 @@
1
- import { defineComponent, computed, ref, h, resolveComponent, isVNode } from "vue";
1
+ import { defineComponent, inject, computed, ref, h } from "vue";
2
2
  import { name, dataProps, dataEmits, dataExpose } from "./data.js";
3
- import { lineToLargeHump } from "@fangzhongya/utils/name/lineToLargeHump";
4
3
  import { setObjValue, getObjValue } from "@fangzhongya/utils/basic/object/objValue";
5
4
  import { useCssName } from "../../../hooks/cssname/index.js";
6
- import { getOnObjs } from "../../common/use.js";
5
+ import { useVNodeComponDom } from "../../common/use.js";
7
6
  import { isEqual } from "@fangzhongya/utils/basic/object/isEqual";
8
7
  import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
9
8
  import { useComponsGet } from "../../../hooks/compons/index.js";
@@ -19,6 +18,7 @@ const _sfc_main = defineComponent({
19
18
  const prs = usePropsDefault(name, p, dataProps);
20
19
  const props = prs.listobj;
21
20
  const compons = useComponsGet(provides.compons);
21
+ const form = inject(provides.form, {});
22
22
  const formvalue = computed(() => {
23
23
  const o = {};
24
24
  if (typeof props.formvalue === "object") {
@@ -97,7 +97,7 @@ const _sfc_main = defineComponent({
97
97
  return result;
98
98
  }
99
99
  function getSourceObject() {
100
- let source = prs.modelValue ?? {};
100
+ let source = prs.modelValue;
101
101
  if (props.orig) {
102
102
  source = prs.valueobj ?? {};
103
103
  }
@@ -134,10 +134,10 @@ const _sfc_main = defineComponent({
134
134
  if (props.computed) {
135
135
  handleComputedSet(newValue, v);
136
136
  }
137
- if (!props.orig) {
138
- emit("update:modelValue", v);
137
+ if (!props.orig && !prop) {
138
+ emit("update:modelValue", newValue);
139
139
  }
140
- if (props.compon !== "items") {
140
+ if (prop) {
141
141
  emit("upform", newValue, props, v);
142
142
  }
143
143
  }
@@ -165,78 +165,49 @@ const _sfc_main = defineComponent({
165
165
  }
166
166
  }
167
167
  }
168
- const options = computed(() => {
169
- const optionss = prs.optionss;
170
- if (typeof props.options === "string") {
171
- const value2 = optionss[props.options];
172
- if (typeof value2 == "function") {
173
- return value2(optionss, value2.value, props) || [];
174
- } else {
175
- return value2 || [];
176
- }
177
- } else if (typeof props.options == "function") {
178
- return props.options(optionss, value.value, props) || [];
179
- } else {
180
- return props.options || [];
181
- }
182
- });
183
- const render = () => {
168
+ const setDom = () => {
169
+ var _a;
184
170
  const compon = props.compon || prs.compon || "input";
185
171
  const componValueName = prs.componValueName || "modelValue";
186
- const componObj = {
187
- ...binds.value,
188
- ...getOnObjs(
189
- props,
190
- prs.valueobj ?? value.value,
191
- emit,
192
- value
193
- ),
194
- class: cs.z("com"),
195
- options: options.value,
196
- listobj: props,
197
- multiple: props.multiple,
198
- optionss: prs.optionss,
199
- valueobj: prs.valueobj,
200
- [componValueName]: value.value,
201
- ["onUpdate:" + componValueName]: (v) => value.value = v,
202
- ["onUpform"]: (...arr) => {
203
- emit("upform", ...arr);
172
+ const obj = {
173
+ ...props,
174
+ compon,
175
+ slots: props.slots ?? slots,
176
+ config: {
177
+ ...binds.value,
178
+ index: prs.index,
179
+ class: [cs.z("com"), ((_a = props.config) == null ? void 0 : _a.class) ?? ""].join(
180
+ " "
181
+ ),
182
+ [componValueName]: value.value,
183
+ ["onUpdate:" + componValueName]: (v) => value.value = v,
184
+ ["onUpform"]: (...arr) => {
185
+ if (props.prop) {
186
+ emit("upform", ...arr);
187
+ }
188
+ }
204
189
  }
205
190
  };
206
- if (typeof compon == "string") {
207
- const tcom = lineToLargeHump(compon);
208
- if (Object.keys(compons).includes(tcom)) {
209
- return h(compons[tcom], componObj, slots);
210
- } else {
211
- return h(resolveComponent(compon), componObj, slots);
212
- }
213
- } else if (typeof compon == "function") {
214
- return compon(componObj, slots);
215
- } else if (isVNode(compon)) {
216
- return compon;
217
- } else {
218
- return h(compon, componObj, slots);
219
- }
220
- };
221
- const setSslot = () => {
222
- const slotname = props.slot ?? props.prop;
223
- if (slotname) {
224
- const slot = slots[slotname];
225
- if (slot) {
226
- return slot({
227
- row: prs.valueobj,
228
- value,
229
- column: props,
230
- options: options.value,
231
- multiple: props.multiple,
232
- optionss: prs.optionss
233
- });
191
+ return useVNodeComponDom(
192
+ obj,
193
+ prs.valueobj ?? value.value,
194
+ slots,
195
+ emit,
196
+ {
197
+ options: prs.optionss,
198
+ compons,
199
+ index: prs.index,
200
+ scope: {
201
+ $index: prs.index[0] || 0,
202
+ config: form,
203
+ options: prs.optionss,
204
+ value
205
+ }
234
206
  }
235
- }
236
- return render();
207
+ );
237
208
  };
238
209
  return () => {
239
- return props.compon ? h("div", { class: cs.z() }, [setSslot()]) : "";
210
+ return props.compon ? h("div", { class: cs.z() }, [setDom()]) : "";
240
211
  };
241
212
  }
242
213
  });
@@ -0,0 +1,49 @@
1
+ :root {
2
+ --on: rgb(91, 189, 246);
3
+ --color-primary: #409eff;
4
+ --bag-primary: #409eff;
5
+ --bag-primary-text: #ffffff;
6
+ --border: #eee;
7
+ --layout-panel-gap: 10px;
8
+ --layout-panel-padding: 20px;
9
+ --layout-form-item-padding-right: var(
10
+ --layout-panel-gap
11
+ );
12
+ --g-main-bg: var(--bg-color-page);
13
+ --lable-array-height: 20px;
14
+ }
15
+
16
+ .com-footer {
17
+ border-top: 1px solid var(--border);
18
+ padding: 20px 20px;
19
+ }
20
+
21
+ .com-lable-array {
22
+ line-height: var(--lable-array-height);
23
+ }
24
+
25
+ .forms-div {
26
+ width: 100%;
27
+ height: 100%;
28
+ }
29
+ .forms-div-com {
30
+ height: 100%;
31
+ }
32
+
33
+ .forms-item {
34
+ width: 100%;
35
+ }
36
+ .forms-item-el-item.is-height {
37
+ min-height: var(--forms-item-row-height);
38
+ }
39
+ .forms-item-el-item.is-height .el-form-item__label {
40
+ height: var(--forms-item-row-height);
41
+ line-height: var(--forms-item-row-height);
42
+ }
43
+ .forms-item-el-item .el-form-item__label {
44
+ white-space: pre-wrap;
45
+ }
46
+ .forms-item-el-item.is-top .el-form-item__content {
47
+ min-height: var(--forms-item-row-height);
48
+ display: grid;
49
+ }
@@ -2,6 +2,12 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const name = "forms-item";
4
4
  const dataProps = {
5
+ index: {
6
+ type: Array,
7
+ default() {
8
+ return [];
9
+ }
10
+ },
5
11
  /**
6
12
  * @props { Object<ObjAny>} options={}
7
13
  * 选择数据集合
@@ -4,6 +4,25 @@ import { ExtractPropTypes } from 'vue';
4
4
  */
5
5
  export declare const name = "forms-item";
6
6
  export declare const dataProps: {
7
+ index: {
8
+ type: {
9
+ (arrayLength: number): number[];
10
+ (...items: number[]): number[];
11
+ new (arrayLength: number): number[];
12
+ new (...items: number[]): number[];
13
+ isArray(arg: any): arg is any[];
14
+ readonly prototype: any[];
15
+ from<T>(arrayLike: ArrayLike<T>): T[];
16
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
17
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
18
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
19
+ of<T>(...items: T[]): T[];
20
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
21
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
22
+ readonly [Symbol.species]: ArrayConstructor;
23
+ };
24
+ default(): never[];
25
+ };
7
26
  /**
8
27
  * @props { Object<ObjAny>} options={}
9
28
  * 选择数据集合
@@ -1,5 +1,11 @@
1
1
  const name = "forms-item";
2
2
  const dataProps = {
3
+ index: {
4
+ type: Array,
5
+ default() {
6
+ return [];
7
+ }
8
+ },
3
9
  /**
4
10
  * @props { Object<ObjAny>} options={}
5
11
  * 选择数据集合