@fangzhongya/fang-ui 0.1.40 → 0.1.42

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.
@@ -27,6 +27,17 @@ function useSetValue(v, key, value) {
27
27
  }
28
28
  return v;
29
29
  }
30
+ function useHide(v, form) {
31
+ if (v == null ? void 0 : v.hide) {
32
+ if (typeof v.hide == "function") {
33
+ return v.hide(form, v);
34
+ } else {
35
+ return v.hide;
36
+ }
37
+ } else {
38
+ return false;
39
+ }
40
+ }
30
41
  function getFormRule(obj) {
31
42
  const prop = obj.prop;
32
43
  if (obj.orig) {
@@ -113,16 +124,51 @@ function setFormDefaultValue(obj, value) {
113
124
  }
114
125
  }
115
126
  }
116
- function useHide(v, form) {
117
- if (v == null ? void 0 : v.hide) {
118
- if (typeof v.hide == "function") {
119
- return v.hide(form, v);
127
+ function setValue(value, obj, data) {
128
+ let v = util.getChildrenData(obj, data);
129
+ if (obj.orig) {
130
+ v = data ?? {};
131
+ }
132
+ const prop = obj.prop;
133
+ if (prop) {
134
+ if (v) {
135
+ if (obj.pars) {
136
+ objValue.setObjValue(v, prop, value);
137
+ } else {
138
+ v[prop] = value;
139
+ }
120
140
  } else {
121
- return v.hide;
141
+ v = util.getChildrenData(obj, data, true);
142
+ if (obj.pars) {
143
+ objValue.setObjValue(v, prop, value);
144
+ } else {
145
+ v[prop] = value;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ function getValue(obj, data, index) {
151
+ const prop = obj.prop;
152
+ const cdata = util.getChildrenData(obj, data);
153
+ let cellValue;
154
+ if (prop) {
155
+ if (obj.pars) {
156
+ cellValue = objValue.getObjValue(prop, cdata);
157
+ } else {
158
+ cellValue = cdata == null ? void 0 : cdata[prop];
122
159
  }
123
160
  } else {
124
- return false;
161
+ cellValue = obj.value;
125
162
  }
163
+ if (obj.formatter) {
164
+ return obj.formatter(data, obj, cellValue, index, cdata);
165
+ } else {
166
+ return cellValue ?? obj.default;
167
+ }
168
+ }
169
+ function getListObjValue(value, obj, data, index) {
170
+ const v = getValue(obj, data, index);
171
+ setValue(v, obj, value);
126
172
  }
127
173
  function getValueObjs(value, multiple, options, config) {
128
174
  if (value !== void 0 && value !== null) {
@@ -167,48 +213,6 @@ function setOptionsValue(value, obj, data, options = {}) {
167
213
  obj.config
168
214
  );
169
215
  }
170
- function setValue(value, obj, data) {
171
- let v = util.getChildrenData(obj, data);
172
- if (obj.orig) {
173
- v = data ?? {};
174
- }
175
- const prop = obj.prop;
176
- if (prop) {
177
- if (v) {
178
- if (obj.pars) {
179
- objValue.setObjValue(v, prop, value);
180
- } else {
181
- v[prop] = value;
182
- }
183
- } else {
184
- v = util.getChildrenData(obj, data, true);
185
- if (obj.pars) {
186
- objValue.setObjValue(v, prop, value);
187
- } else {
188
- v[prop] = value;
189
- }
190
- }
191
- }
192
- }
193
- function getValue(obj, data, index) {
194
- const prop = obj.prop;
195
- const cdata = util.getChildrenData(obj, data);
196
- let cellValue;
197
- if (prop) {
198
- if (obj.pars) {
199
- cellValue = objValue.getObjValue(prop, cdata);
200
- } else {
201
- cellValue = cdata == null ? void 0 : cdata[prop];
202
- }
203
- } else {
204
- cellValue = obj.value;
205
- }
206
- if (obj.formatter) {
207
- return obj.formatter(data, obj, cellValue, index, cdata);
208
- } else {
209
- return cellValue ?? obj.default;
210
- }
211
- }
212
216
  function setComponString(value, obj, componObj, compons) {
213
217
  const compon = obj.compon;
214
218
  const tcom = lineToLargeHump.lineToLargeHump(compon);
@@ -279,16 +283,16 @@ function useSetSlot(obj, data, slots, options, emit, index, scope) {
279
283
  if (slotname) {
280
284
  const slot = slots[slotname];
281
285
  if (slot) {
282
- const value = vue.computed({
286
+ let value = (scope == null ? void 0 : scope.value) ?? vue.computed({
283
287
  get() {
284
288
  return getValue(obj, data, index);
285
289
  },
286
- set(value2) {
287
- setValue(value2, obj, data);
290
+ set(v) {
291
+ setValue(v, obj, data);
288
292
  }
289
293
  });
290
294
  const componObj = getComponObj(
291
- value.value,
295
+ value == null ? void 0 : value.value,
292
296
  obj,
293
297
  data,
294
298
  options,
@@ -472,6 +476,7 @@ function getLabelText(obj) {
472
476
  exports.getComponObj = getComponObj;
473
477
  exports.getFormRule = getFormRule;
474
478
  exports.getLabelText = getLabelText;
479
+ exports.getListObjValue = getListObjValue;
475
480
  exports.getOnObjs = getOnObjs;
476
481
  exports.getVNodeContent = getVNodeContent;
477
482
  exports.setFormDefaultValue = setFormDefaultValue;
@@ -14,6 +14,13 @@ export declare function useVueValue(v: any, key: string | Function): any;
14
14
  * @returns 返回修改后的对象
15
15
  */
16
16
  export declare function useSetValue(v: any, key: string | Function, value: any): any;
17
+ /**
18
+ * 判断列表对象是否应该隐藏
19
+ * @param v - 列表对象,可能包含hide属性
20
+ * @param form - 表单数据,可选参数,用于hide函数的计算
21
+ * @returns 返回是否隐藏的布尔值,如果v.hide是函数则执行函数返回结果,如果是布尔值则直接返回,否则返回false
22
+ */
23
+ export declare function useHide(v: ListObj, form?: any): boolean;
17
24
  /**
18
25
  * 获取表单规则路径
19
26
  * @param obj - 包含属性和父子关系的对象
@@ -26,13 +33,7 @@ export declare function getFormRule(obj: ListObj): string | undefined;
26
33
  * @param value - 表单值对象,用于设置默认值的数据源
27
34
  */
28
35
  export declare function setFormDefaultValue(obj: ListObj, value: ObjAny): void;
29
- /**
30
- * 判断列表对象是否应该隐藏
31
- * @param v - 列表对象,可能包含hide属性
32
- * @param form - 表单数据,可选参数,用于hide函数的计算
33
- * @returns 返回是否隐藏的布尔值,如果v.hide是函数则执行函数返回结果,如果是布尔值则直接返回,否则返回false
34
- */
35
- export declare function useHide(v: ListObj, form?: any): boolean;
36
+ export declare function getListObjValue(value: ObjAny, obj: ListObj, data: ObjAny, index: number | number[]): void;
36
37
  /**
37
38
  * 获取事件处理对象集合
38
39
  * @param obj - 包含事件配置的对象
@@ -25,6 +25,17 @@ function useSetValue(v, key, value) {
25
25
  }
26
26
  return v;
27
27
  }
28
+ function useHide(v, form) {
29
+ if (v == null ? void 0 : v.hide) {
30
+ if (typeof v.hide == "function") {
31
+ return v.hide(form, v);
32
+ } else {
33
+ return v.hide;
34
+ }
35
+ } else {
36
+ return false;
37
+ }
38
+ }
28
39
  function getFormRule(obj) {
29
40
  const prop = obj.prop;
30
41
  if (obj.orig) {
@@ -111,16 +122,51 @@ function setFormDefaultValue(obj, value) {
111
122
  }
112
123
  }
113
124
  }
114
- function useHide(v, form) {
115
- if (v == null ? void 0 : v.hide) {
116
- if (typeof v.hide == "function") {
117
- return v.hide(form, v);
125
+ function setValue(value, obj, data) {
126
+ let v = getChildrenData(obj, data);
127
+ if (obj.orig) {
128
+ v = data ?? {};
129
+ }
130
+ const prop = obj.prop;
131
+ if (prop) {
132
+ if (v) {
133
+ if (obj.pars) {
134
+ setObjValue(v, prop, value);
135
+ } else {
136
+ v[prop] = value;
137
+ }
118
138
  } else {
119
- return v.hide;
139
+ v = getChildrenData(obj, data, true);
140
+ if (obj.pars) {
141
+ setObjValue(v, prop, value);
142
+ } else {
143
+ v[prop] = value;
144
+ }
145
+ }
146
+ }
147
+ }
148
+ function getValue(obj, data, index) {
149
+ const prop = obj.prop;
150
+ const cdata = getChildrenData(obj, data);
151
+ let cellValue;
152
+ if (prop) {
153
+ if (obj.pars) {
154
+ cellValue = getObjValue(prop, cdata);
155
+ } else {
156
+ cellValue = cdata == null ? void 0 : cdata[prop];
120
157
  }
121
158
  } else {
122
- return false;
159
+ cellValue = obj.value;
123
160
  }
161
+ if (obj.formatter) {
162
+ return obj.formatter(data, obj, cellValue, index, cdata);
163
+ } else {
164
+ return cellValue ?? obj.default;
165
+ }
166
+ }
167
+ function getListObjValue(value, obj, data, index) {
168
+ const v = getValue(obj, data, index);
169
+ setValue(v, obj, value);
124
170
  }
125
171
  function getValueObjs(value, multiple, options, config) {
126
172
  if (value !== void 0 && value !== null) {
@@ -165,48 +211,6 @@ function setOptionsValue(value, obj, data, options = {}) {
165
211
  obj.config
166
212
  );
167
213
  }
168
- function setValue(value, obj, data) {
169
- let v = getChildrenData(obj, data);
170
- if (obj.orig) {
171
- v = data ?? {};
172
- }
173
- const prop = obj.prop;
174
- if (prop) {
175
- if (v) {
176
- if (obj.pars) {
177
- setObjValue(v, prop, value);
178
- } else {
179
- v[prop] = value;
180
- }
181
- } else {
182
- v = getChildrenData(obj, data, true);
183
- if (obj.pars) {
184
- setObjValue(v, prop, value);
185
- } else {
186
- v[prop] = value;
187
- }
188
- }
189
- }
190
- }
191
- function getValue(obj, data, index) {
192
- const prop = obj.prop;
193
- const cdata = getChildrenData(obj, data);
194
- let cellValue;
195
- if (prop) {
196
- if (obj.pars) {
197
- cellValue = getObjValue(prop, cdata);
198
- } else {
199
- cellValue = cdata == null ? void 0 : cdata[prop];
200
- }
201
- } else {
202
- cellValue = obj.value;
203
- }
204
- if (obj.formatter) {
205
- return obj.formatter(data, obj, cellValue, index, cdata);
206
- } else {
207
- return cellValue ?? obj.default;
208
- }
209
- }
210
214
  function setComponString(value, obj, componObj, compons) {
211
215
  const compon = obj.compon;
212
216
  const tcom = lineToLargeHump(compon);
@@ -277,16 +281,16 @@ function useSetSlot(obj, data, slots, options, emit, index, scope) {
277
281
  if (slotname) {
278
282
  const slot = slots[slotname];
279
283
  if (slot) {
280
- const value = computed({
284
+ let value = (scope == null ? void 0 : scope.value) ?? computed({
281
285
  get() {
282
286
  return getValue(obj, data, index);
283
287
  },
284
- set(value2) {
285
- setValue(value2, obj, data);
288
+ set(v) {
289
+ setValue(v, obj, data);
286
290
  }
287
291
  });
288
292
  const componObj = getComponObj(
289
- value.value,
293
+ value == null ? void 0 : value.value,
290
294
  obj,
291
295
  data,
292
296
  options,
@@ -471,6 +475,7 @@ export {
471
475
  getComponObj,
472
476
  getFormRule,
473
477
  getLabelText,
478
+ getListObjValue,
474
479
  getOnObjs,
475
480
  getVNodeContent,
476
481
  setFormDefaultValue,
@@ -39,7 +39,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
39
39
  resetFields,
40
40
  closeForm,
41
41
  dataForm,
42
- validate
42
+ validate,
43
+ getListValue
43
44
  } = setup.setUp(props, emit, cs, refForm, getLocale);
44
45
  function setKey(value, index2) {
45
46
  return [index2, value.label, value.prop, value.compon].join(",");
@@ -71,7 +72,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
71
72
  * @expose { [Promise] Promise对象true成功false失败 } validate
72
73
  * 校验表单
73
74
  */
74
- validate
75
+ validate,
76
+ getListValue,
77
+ getValue() {
78
+ return dataForm.value;
79
+ }
75
80
  });
76
81
  return (_ctx, _cache) => {
77
82
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
@@ -37,7 +37,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
37
  resetFields,
38
38
  closeForm,
39
39
  dataForm,
40
- validate
40
+ validate,
41
+ getListValue
41
42
  } = setUp(props, emit, cs, refForm, getLocale);
42
43
  function setKey(value, index) {
43
44
  return [index, value.label, value.prop, value.compon].join(",");
@@ -69,7 +70,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
70
  * @expose { [Promise] Promise对象true成功false失败 } validate
70
71
  * 校验表单
71
72
  */
72
- validate
73
+ validate,
74
+ getListValue,
75
+ getValue() {
76
+ return dataForm.value;
77
+ }
73
78
  });
74
79
  return (_ctx, _cache) => {
75
80
  return openBlock(), createElementBlock("div", mergeProps({
@@ -83,19 +83,39 @@ function setUp(props, emit, cs, refForm, getLocale) {
83
83
  }
84
84
  return setObjStyle.setObjStyle(vst, obj);
85
85
  }
86
+ const setListValue = (arr, listobj, callback) => {
87
+ arr == null ? void 0 : arr.forEach((obj) => {
88
+ if (listobj) {
89
+ obj.father = obj.father ?? listobj;
90
+ }
91
+ if (obj.children) {
92
+ setListValue(obj.children, obj, callback);
93
+ }
94
+ use.setFormDefaultValue(obj, dataForm.value);
95
+ if (callback) {
96
+ callback(obj);
97
+ }
98
+ });
99
+ };
86
100
  function setReset() {
87
- const setListValue = (arr, listobj) => {
88
- arr == null ? void 0 : arr.forEach((obj) => {
89
- if (listobj) {
90
- obj.father = obj.father ?? listobj;
101
+ setListValue(props.list);
102
+ }
103
+ function getListValue() {
104
+ const value = {};
105
+ const data2 = dataForm.value;
106
+ const getValue = (arr, indexs) => {
107
+ arr == null ? void 0 : arr.forEach((obj, index2) => {
108
+ const indss = [...indexs, index2];
109
+ if (obj.prop) {
110
+ use.getListObjValue(value, obj, data2, indss);
91
111
  }
92
112
  if (obj.children) {
93
- setListValue(obj.children, obj);
113
+ getValue(obj.children, indss);
94
114
  }
95
- use.setFormDefaultValue(obj, dataForm.value);
96
115
  });
97
116
  };
98
- setListValue(props.list);
117
+ getValue(props.list, []);
118
+ return value;
99
119
  }
100
120
  const triggerMap = {
101
121
  blur: getLocale("form.import"),
@@ -104,37 +124,27 @@ function setUp(props, emit, cs, refForm, getLocale) {
104
124
  };
105
125
  function getRules() {
106
126
  const rules = {};
107
- const setListValue = (arr, listobj) => {
108
- arr == null ? void 0 : arr.forEach((obj) => {
109
- var _a;
110
- if (listobj) {
111
- obj.father = obj.father ?? listobj;
112
- }
113
- if (obj.children) {
114
- setListValue(obj.children, obj);
115
- }
116
- use.setFormDefaultValue(obj, dataForm.value);
117
- obj.config = obj.config ?? {};
118
- if (((_a = obj.config) == null ? void 0 : _a.clearable) === void 0) {
119
- obj.config.clearable = true;
120
- }
121
- if (!obj.rule) {
122
- util.setPlaceholder(obj, triggerMap);
123
- }
124
- if (obj.prop) {
125
- const p = use.getFormRule(obj) ?? obj.prop;
126
- obj.__prop = p;
127
- if (obj.rules) {
128
- rules[p] = obj.rules;
129
- } else if (obj.rule) {
130
- rules[p] = util.getRule(obj, dataForm, refForm, triggerMap);
131
- } else {
132
- rules[p] = [];
133
- }
127
+ setListValue(props.list, void 0, (obj) => {
128
+ var _a;
129
+ obj.config = obj.config ?? {};
130
+ if (((_a = obj.config) == null ? void 0 : _a.clearable) === void 0) {
131
+ obj.config.clearable = true;
132
+ }
133
+ if (!obj.rule) {
134
+ util.setPlaceholder(obj, triggerMap);
135
+ }
136
+ if (obj.prop) {
137
+ const p = use.getFormRule(obj) ?? obj.prop;
138
+ obj.__prop = p;
139
+ if (obj.rules) {
140
+ rules[p] = obj.rules;
141
+ } else if (obj.rule) {
142
+ rules[p] = util.getRule(obj, dataForm, refForm, triggerMap);
143
+ } else {
144
+ rules[p] = [];
134
145
  }
135
- });
136
- };
137
- setListValue(props.list);
146
+ }
147
+ });
138
148
  return rules;
139
149
  }
140
150
  const dataRules = vue.ref(getRules());
@@ -217,7 +227,8 @@ function setUp(props, emit, cs, refForm, getLocale) {
217
227
  validateField,
218
228
  resetFields,
219
229
  closeForm,
220
- validate
230
+ validate,
231
+ getListValue
221
232
  };
222
233
  }
223
234
  exports.setUp = setUp;
@@ -26,5 +26,6 @@ export declare function setUp(props: DataProps, emit: Emit, cs: UseCssNameReturn
26
26
  resetFields: () => void;
27
27
  closeForm: () => void;
28
28
  validate: () => Promise<unknown>;
29
+ getListValue: () => {};
29
30
  };
30
31
  export {};
@@ -2,7 +2,7 @@ import { dataHandle } from "./data.js";
2
2
  import { provides } from "../common/config.js";
3
3
  import { setPlaceholder, getRule } from "./util.js";
4
4
  import "../../../utils/css.js";
5
- import { setFormDefaultValue, getFormRule } from "../../common/use.js";
5
+ import { setFormDefaultValue, getListObjValue, getFormRule } from "../../common/use.js";
6
6
  import { computed, provide, isProxy, ref, watch } from "vue";
7
7
  import { useCompons } from "../../../hooks/compons/index.js";
8
8
  import { FormsItems } from "../../forms-items/index.js";
@@ -81,19 +81,39 @@ function setUp(props, emit, cs, refForm, getLocale) {
81
81
  }
82
82
  return setObjStyle(vst, obj);
83
83
  }
84
+ const setListValue = (arr, listobj, callback) => {
85
+ arr == null ? void 0 : arr.forEach((obj) => {
86
+ if (listobj) {
87
+ obj.father = obj.father ?? listobj;
88
+ }
89
+ if (obj.children) {
90
+ setListValue(obj.children, obj, callback);
91
+ }
92
+ setFormDefaultValue(obj, dataForm.value);
93
+ if (callback) {
94
+ callback(obj);
95
+ }
96
+ });
97
+ };
84
98
  function setReset() {
85
- const setListValue = (arr, listobj) => {
86
- arr == null ? void 0 : arr.forEach((obj) => {
87
- if (listobj) {
88
- obj.father = obj.father ?? listobj;
99
+ setListValue(props.list);
100
+ }
101
+ function getListValue() {
102
+ const value = {};
103
+ const data = dataForm.value;
104
+ const getValue = (arr, indexs) => {
105
+ arr == null ? void 0 : arr.forEach((obj, index) => {
106
+ const indss = [...indexs, index];
107
+ if (obj.prop) {
108
+ getListObjValue(value, obj, data, indss);
89
109
  }
90
110
  if (obj.children) {
91
- setListValue(obj.children, obj);
111
+ getValue(obj.children, indss);
92
112
  }
93
- setFormDefaultValue(obj, dataForm.value);
94
113
  });
95
114
  };
96
- setListValue(props.list);
115
+ getValue(props.list, []);
116
+ return value;
97
117
  }
98
118
  const triggerMap = {
99
119
  blur: getLocale("form.import"),
@@ -102,37 +122,27 @@ function setUp(props, emit, cs, refForm, getLocale) {
102
122
  };
103
123
  function getRules() {
104
124
  const rules = {};
105
- const setListValue = (arr, listobj) => {
106
- arr == null ? void 0 : arr.forEach((obj) => {
107
- var _a;
108
- if (listobj) {
109
- obj.father = obj.father ?? listobj;
110
- }
111
- if (obj.children) {
112
- setListValue(obj.children, obj);
113
- }
114
- setFormDefaultValue(obj, dataForm.value);
115
- obj.config = obj.config ?? {};
116
- if (((_a = obj.config) == null ? void 0 : _a.clearable) === void 0) {
117
- obj.config.clearable = true;
118
- }
119
- if (!obj.rule) {
120
- setPlaceholder(obj, triggerMap);
121
- }
122
- if (obj.prop) {
123
- const p = getFormRule(obj) ?? obj.prop;
124
- obj.__prop = p;
125
- if (obj.rules) {
126
- rules[p] = obj.rules;
127
- } else if (obj.rule) {
128
- rules[p] = getRule(obj, dataForm, refForm, triggerMap);
129
- } else {
130
- rules[p] = [];
131
- }
125
+ setListValue(props.list, void 0, (obj) => {
126
+ var _a;
127
+ obj.config = obj.config ?? {};
128
+ if (((_a = obj.config) == null ? void 0 : _a.clearable) === void 0) {
129
+ obj.config.clearable = true;
130
+ }
131
+ if (!obj.rule) {
132
+ setPlaceholder(obj, triggerMap);
133
+ }
134
+ if (obj.prop) {
135
+ const p = getFormRule(obj) ?? obj.prop;
136
+ obj.__prop = p;
137
+ if (obj.rules) {
138
+ rules[p] = obj.rules;
139
+ } else if (obj.rule) {
140
+ rules[p] = getRule(obj, dataForm, refForm, triggerMap);
141
+ } else {
142
+ rules[p] = [];
132
143
  }
133
- });
134
- };
135
- setListValue(props.list);
144
+ }
145
+ });
136
146
  return rules;
137
147
  }
138
148
  const dataRules = ref(getRules());
@@ -215,7 +225,8 @@ function setUp(props, emit, cs, refForm, getLocale) {
215
225
  validateField,
216
226
  resetFields,
217
227
  closeForm,
218
- validate
228
+ validate,
229
+ getListValue
219
230
  };
220
231
  }
221
232
  export {
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
42
42
  const options = vue.computed(() => {
43
43
  if (props.filterable && value.value && isFiletr.value) {
44
44
  return props.options.filter((o) => {
45
- return (use.useVueValue(o, props.prop) + "").includes(
45
+ return String(use.useVueValue(o, props.prop) ?? "").includes(
46
46
  value.value || ""
47
47
  );
48
48
  });
@@ -40,7 +40,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
40
40
  const options = computed(() => {
41
41
  if (props.filterable && value.value && isFiletr.value) {
42
42
  return props.options.filter((o) => {
43
- return (useVueValue(o, props.prop) + "").includes(
43
+ return String(useVueValue(o, props.prop) ?? "").includes(
44
44
  value.value || ""
45
45
  );
46
46
  });
@@ -50,10 +50,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
50
50
  emit("click-multiple", listFuObj.getValueObjs(v)[0], is);
51
51
  };
52
52
  const isOptionsEmpty = vue.computed(() => {
53
- const arr = props.options.filter((o) => {
54
- return use.useVueValue(o, props.prop) === "";
55
- });
56
- return arr.length > 0;
53
+ return props.options.some((o) => use.useVueValue(o, props.prop) === "");
57
54
  });
58
55
  const setEmptyFun = () => {
59
56
  setValue = (item) => {
@@ -48,10 +48,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
48
48
  emit("click-multiple", listFuObj.getValueObjs(v)[0], is);
49
49
  };
50
50
  const isOptionsEmpty = computed(() => {
51
- const arr = props.options.filter((o) => {
52
- return useVueValue(o, props.prop) === "";
53
- });
54
- return arr.length > 0;
51
+ return props.options.some((o) => useVueValue(o, props.prop) === "");
55
52
  });
56
53
  const setEmptyFun = () => {
57
54
  setValue = (item) => {
@@ -84,9 +84,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
84
84
  }
85
85
  emit("update:modelValue", value2);
86
86
  if (props.optobj) {
87
- const obj = props.options.filter((o) => {
87
+ const obj = props.options.find((o) => {
88
88
  return use.useVueValue(o, props.prop) === value2;
89
- })[0];
89
+ });
90
90
  emit("change", value2, obj);
91
91
  } else {
92
92
  emit("change", value2);
@@ -82,9 +82,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
82
82
  }
83
83
  emit("update:modelValue", value2);
84
84
  if (props.optobj) {
85
- const obj = props.options.filter((o) => {
85
+ const obj = props.options.find((o) => {
86
86
  return useVueValue(o, props.prop) === value2;
87
- })[0];
87
+ });
88
88
  emit("change", value2, obj);
89
89
  } else {
90
90
  emit("change", value2);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "prefix": "fang-ui",
3
3
  "info": {},
4
- "lastModified": 1764388705761,
4
+ "lastModified": 1764415547531,
5
5
  "icons": {
6
6
  "bar": {
7
7
  "body": " <path fill=\"currentColor\" d=\"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z\" ></path> "
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const setObjStyle = require("@fangzhongya/utils/css/setObjStyle");
4
4
  const getCss = require("@fangzhongya/utils/css/getCss");
5
5
  function getCssNumber(str = "") {
6
- return Number(String(str).replaceAll(/[^0-9.-]/g, ""));
6
+ return Number(String(str ?? "").replaceAll(/[^0-9.-]/g, ""));
7
7
  }
8
8
  Object.defineProperty(exports, "setObjStyle", {
9
9
  enumerable: true,
package/dist/utils/css.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { setObjStyle } from "@fangzhongya/utils/css/setObjStyle";
2
2
  import { getCss } from "@fangzhongya/utils/css/getCss";
3
3
  function getCssNumber(str = "") {
4
- return Number(String(str).replaceAll(/[^0-9.-]/g, ""));
4
+ return Number(String(str ?? "").replaceAll(/[^0-9.-]/g, ""));
5
5
  }
6
6
  export {
7
7
  getCss,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/fang-ui",
3
3
  "private": false,
4
- "version": "0.1.40",
4
+ "version": "0.1.42",
5
5
  "type": "module",
6
6
  "description ": "fang-ui",
7
7
  "keywords": [
@@ -51,12 +51,12 @@
51
51
  "vue-tsc": "^3.1.5",
52
52
  "vxe-table": "4.6.20",
53
53
  "@fang-ui/components": "0.0.1-0",
54
- "@fang-ui/directives": "0.0.1-0",
54
+ "@fang-ui/locale": "0.0.1-0",
55
55
  "@fang-ui/hooks": "0.0.1-0",
56
+ "@fang-ui/directives": "0.0.1-0",
56
57
  "@fang-ui/icons": "0.0.1-0",
57
- "@fang-ui/locale": "0.0.1-0",
58
- "@fang-ui/theme": "0.0.1-0",
59
58
  "@fang-ui/types": "0.0.1-0",
59
+ "@fang-ui/theme": "0.0.1-0",
60
60
  "@fang-ui/utils": "0.0.1-0"
61
61
  },
62
62
  "main": "./dist/index.cjs",
File without changes