pro-design-vue 1.2.18 → 1.2.19

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 (35) hide show
  1. package/dist/index.full.js +19 -49
  2. package/dist/index.full.min.js +7 -7
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +7 -7
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +19 -49
  7. package/es/components/form/src/fields/FieldCheckboxGroup.d.ts +27 -18
  8. package/es/components/form/src/fields/FieldRadioGroup.d.ts +27 -18
  9. package/es/components/form/src/hooks/useFieldOptions.d.ts +5 -1
  10. package/es/packages/components/form/src/fields/FieldCheckboxGroup.mjs +3 -1
  11. package/es/packages/components/form/src/fields/FieldCheckboxGroup.mjs.map +1 -1
  12. package/es/packages/components/form/src/fields/FieldRadioGroup.mjs +3 -1
  13. package/es/packages/components/form/src/fields/FieldRadioGroup.mjs.map +1 -1
  14. package/es/packages/components/form/src/hooks/useFieldOptions.mjs +9 -44
  15. package/es/packages/components/form/src/hooks/useFieldOptions.mjs.map +1 -1
  16. package/es/packages/components/form/src/utils/fieldPropsMap.mjs +2 -1
  17. package/es/packages/components/form/src/utils/fieldPropsMap.mjs.map +1 -1
  18. package/es/version.d.ts +1 -1
  19. package/es/version.mjs +1 -1
  20. package/es/version.mjs.map +1 -1
  21. package/lib/components/form/src/fields/FieldCheckboxGroup.d.ts +27 -18
  22. package/lib/components/form/src/fields/FieldRadioGroup.d.ts +27 -18
  23. package/lib/components/form/src/hooks/useFieldOptions.d.ts +5 -1
  24. package/lib/packages/components/form/src/fields/FieldCheckboxGroup.js +3 -1
  25. package/lib/packages/components/form/src/fields/FieldCheckboxGroup.js.map +1 -1
  26. package/lib/packages/components/form/src/fields/FieldRadioGroup.js +3 -1
  27. package/lib/packages/components/form/src/fields/FieldRadioGroup.js.map +1 -1
  28. package/lib/packages/components/form/src/hooks/useFieldOptions.js +9 -44
  29. package/lib/packages/components/form/src/hooks/useFieldOptions.js.map +1 -1
  30. package/lib/packages/components/form/src/utils/fieldPropsMap.js +2 -1
  31. package/lib/packages/components/form/src/utils/fieldPropsMap.js.map +1 -1
  32. package/lib/version.d.ts +1 -1
  33. package/lib/version.js +1 -1
  34. package/lib/version.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! Pro Design Vue v1.2.18 */
1
+ /*! Pro Design Vue v1.2.19 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('ant-design-vue'), require('vue'), require('ant-design-vue/es/locale/zh_CN.js')) :
@@ -32,7 +32,7 @@
32
32
  const DEFAULT_NAMESPACE = "pro";
33
33
  const DEFAULT_LOCALE = "zh-CN";
34
34
 
35
- const version$1 = "1.2.18";
35
+ const version$1 = "1.2.19";
36
36
 
37
37
  const makeInstaller = (components = []) => {
38
38
  const install = (app) => {
@@ -14424,19 +14424,22 @@
14424
14424
  });
14425
14425
  return enumArray;
14426
14426
  };
14427
- const formatOptions = (options) => {
14427
+ const formatOptions = (options, fieldNames) => {
14428
14428
  return options == null ? void 0 : options.map((opt) => {
14429
14429
  if (!isObject$4(opt)) {
14430
14430
  return { label: opt, value: opt };
14431
14431
  }
14432
+ opt.label = opt[fieldNames.label];
14433
+ opt.value = opt[fieldNames.value];
14434
+ opt.children = opt[fieldNames.children];
14432
14435
  if (opt == null ? void 0 : opt.text) {
14433
14436
  opt.label = opt == null ? void 0 : opt.text;
14434
14437
  }
14435
14438
  if (Array.isArray(opt.options) && opt.options.length) {
14436
- opt.options = formatOptions(opt.options);
14439
+ opt.options = formatOptions(opt.options, fieldNames);
14437
14440
  }
14438
14441
  if (Array.isArray(opt.children) && opt.children.length) {
14439
- opt.children = formatOptions(opt.children);
14442
+ opt.children = formatOptions(opt.children, fieldNames);
14440
14443
  }
14441
14444
  return opt;
14442
14445
  });
@@ -14457,7 +14460,7 @@
14457
14460
  const runOptions = vue.computed(() => runFunction(options, formData.value, rowData == null ? void 0 : rowData.value));
14458
14461
  const mergeOptions = vue.ref([]);
14459
14462
  const fieldNames = vue.computed(() => {
14460
- return fieldNamesConfig != null ? fieldNamesConfig : { label: "label", value: "value", children: "children" };
14463
+ return { label: "label", value: "value", children: "children", ...fieldNamesConfig };
14461
14464
  });
14462
14465
  const [innerParams, setInnerParams] = useState(
14463
14466
  () => {
@@ -14496,7 +14499,7 @@
14496
14499
  () => {
14497
14500
  var _a;
14498
14501
  if (Array.isArray(runOptions.value) && ((_a = runOptions.value) == null ? void 0 : _a.length) > 0) {
14499
- mergeOptions.value = formatOptions(runOptions.value);
14502
+ mergeOptions.value = formatOptions(runOptions.value, fieldNames.value);
14500
14503
  } else {
14501
14504
  const optionsEnum = runFunction(valueEnum, formData.value);
14502
14505
  mergeOptions.value = fieldParsingValueEnumToArray(optionsEnum);
@@ -14508,48 +14511,10 @@
14508
14511
  );
14509
14512
  const fetchData = useFetchData$1({ request });
14510
14513
  const requestOptions = debounce(async () => {
14511
- var _a;
14512
14514
  loading.value = true;
14513
14515
  const result = await fetchData(mergeParams.value, index == null ? void 0 : index.value);
14514
14516
  if (Array.isArray(result)) {
14515
- mergeOptions.value = result.map((opt) => {
14516
- if (opt == null ? void 0 : opt.text) {
14517
- opt.label = opt == null ? void 0 : opt.text;
14518
- }
14519
- return opt;
14520
- });
14521
- } else if (isObject$4(result)) {
14522
- const { success, total: dataTotal, data } = result;
14523
- if (success) {
14524
- if (paginationConfig == null ? void 0 : paginationConfig.value) {
14525
- total.value = dataTotal;
14526
- if (((_a = innerParams == null ? void 0 : innerParams.value) == null ? void 0 : _a.current) === 1) {
14527
- mergeOptions.value = data.map((opt) => {
14528
- if (opt == null ? void 0 : opt.text) {
14529
- opt.label = opt == null ? void 0 : opt.text;
14530
- }
14531
- return opt;
14532
- });
14533
- } else {
14534
- mergeOptions.value = [
14535
- ...mergeOptions.value,
14536
- ...data.map((opt) => {
14537
- if (opt == null ? void 0 : opt.text) {
14538
- opt.label = opt == null ? void 0 : opt.text;
14539
- }
14540
- return opt;
14541
- })
14542
- ];
14543
- }
14544
- } else {
14545
- mergeOptions.value = data.map((opt) => {
14546
- if (opt == null ? void 0 : opt.text) {
14547
- opt.label = opt == null ? void 0 : opt.text;
14548
- }
14549
- return opt;
14550
- });
14551
- }
14552
- }
14517
+ mergeOptions.value = formatOptions(result, fieldNames.value);
14553
14518
  }
14554
14519
  loading.value = false;
14555
14520
  }, 200);
@@ -14982,7 +14947,8 @@
14982
14947
  var FieldCheckboxGroup = /* @__PURE__ */ vue.defineComponent({
14983
14948
  name: "FieldCheckboxGroup",
14984
14949
  props: {
14985
- ...commonFieldProps()
14950
+ ...commonFieldProps(),
14951
+ fieldNames: Object
14986
14952
  },
14987
14953
  setup(props, {
14988
14954
  attrs
@@ -14998,6 +14964,7 @@
14998
14964
  options: props.options,
14999
14965
  valueEnum: props.valueEnum,
15000
14966
  dependencies: props.dependencies,
14967
+ fieldNames: props.fieldNames,
15001
14968
  params: props.params
15002
14969
  });
15003
14970
  const readValue = vue.computed(() => {
@@ -15055,7 +15022,8 @@
15055
15022
  radioLabel: {
15056
15023
  type: String,
15057
15024
  default: ""
15058
- }
15025
+ },
15026
+ fieldNames: Object
15059
15027
  },
15060
15028
  setup(props, {
15061
15029
  attrs
@@ -15072,6 +15040,7 @@
15072
15040
  options: props.options,
15073
15041
  valueEnum: props.valueEnum,
15074
15042
  dependencies: props.dependencies,
15043
+ fieldNames: props.fieldNames,
15075
15044
  params: props.params
15076
15045
  });
15077
15046
  const readValue = vue.computed(() => {
@@ -38075,13 +38044,14 @@
38075
38044
  "onUpdate:searchValue"
38076
38045
  ],
38077
38046
  checkbox: ["id", "autofocus", "disabled", "indeterminate"],
38078
- checkboxGroup: ["id", "disabled", "name", "options"],
38047
+ checkboxGroup: ["id", "disabled", "name", "options", "fieldNames"],
38079
38048
  radioGroup: [
38080
38049
  "id",
38081
38050
  "class",
38082
38051
  "disabled",
38083
38052
  "name",
38084
38053
  "options",
38054
+ "fieldNames",
38085
38055
  "optionType",
38086
38056
  "buttonStyle",
38087
38057
  "radioLabel"