cnhis-design-vue 3.1.14-beta.0 → 3.1.14-beta.11

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 (78) hide show
  1. package/README.md +1 -1
  2. package/es/packages/annotation-edit/index.d.ts +17 -0
  3. package/es/packages/annotation-edit/index.js +10 -0
  4. package/es/packages/annotation-edit/src/AnnotationEdit.d.ts +16 -0
  5. package/es/packages/annotation-edit/src/AnnotationEdit.js +119 -0
  6. package/es/packages/annotation-edit/style/index.css +15 -0
  7. package/es/packages/big-table/index.d.ts +2 -9
  8. package/es/packages/big-table/src/BigTable.vue.d.ts +30 -18
  9. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +53 -25
  10. package/es/packages/big-table/src/bigTableEmits.js +1 -1
  11. package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +25 -8
  12. package/es/packages/big-table/src/components/edit-form/edit-separate.vue_vue_type_script_setup_true_lang.js +29 -9
  13. package/es/packages/big-table/src/components/separate.vue.d.ts +3 -4
  14. package/es/packages/big-table/src/components/separate.vue_vue_type_script_setup_true_lang.js +7 -3
  15. package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +8 -4
  16. package/es/packages/big-table/src/hooks/useEdit.d.ts +25 -7
  17. package/es/packages/big-table/src/hooks/useSeparateRow.d.ts +1 -1
  18. package/es/packages/big-table/src/hooks/useSeparateRow.js +14 -10
  19. package/es/packages/big-table/src/utils.js +3 -3
  20. package/es/packages/big-table/style/index.css +15 -2
  21. package/es/packages/button-print/index.d.ts +1 -0
  22. package/es/packages/button-print/index.js +1 -0
  23. package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +5 -1
  24. package/es/packages/button-print/src/utils/index.d.ts +1 -0
  25. package/es/packages/button-print/src/utils/index.js +1 -0
  26. package/es/packages/button-print/src/utils/print.d.ts +1 -1
  27. package/es/packages/button-print/src/utils/print.js +1 -1
  28. package/es/packages/fabric-chart/index.d.ts +7 -2
  29. package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +8 -3
  30. package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +41 -9
  31. package/es/packages/fabric-chart/src/hooks/index.d.ts +1 -1
  32. package/es/packages/fabric-chart/src/hooks/index.js +2 -2
  33. package/es/packages/fabric-chart/src/hooks/useCenter.js +54 -33
  34. package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
  35. package/es/packages/fabric-chart/src/hooks/useEvent.d.ts +6 -0
  36. package/es/packages/fabric-chart/src/hooks/useEvent.js +68 -1
  37. package/es/packages/fabric-chart/src/hooks/useLeft.js +14 -14
  38. package/es/packages/fabric-chart/src/hooks/useRight.js +2 -13
  39. package/es/packages/fabric-chart/src/hooks/useTop.js +10 -20
  40. package/es/packages/fabric-chart/src/interface.d.ts +7 -0
  41. package/es/packages/form-render/index.d.ts +1 -1
  42. package/es/packages/form-render/src/FormRender.vue.d.ts +1 -1
  43. package/es/packages/form-render/src/components/renderer/cascader.d.ts +3 -3
  44. package/es/packages/form-render/src/components/renderer/cascader.js +41 -52
  45. package/es/packages/form-render/src/components/renderer/formItem.js +8 -92
  46. package/es/packages/form-render/src/components/renderer/input.js +5 -16
  47. package/es/packages/form-render/src/components/renderer/inputNumber.d.ts +12 -0
  48. package/es/packages/form-render/src/components/renderer/inputNumber.js +11 -4
  49. package/es/packages/form-render/src/components/renderer/select.js +16 -10
  50. package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +15 -2
  51. package/es/packages/form-render/src/components/renderer/simpleComponent.js +16 -15
  52. package/es/packages/form-render/src/hooks/useAnchor.d.ts +1 -1
  53. package/es/packages/form-render/src/hooks/useAnchor.js +3 -3
  54. package/es/packages/form-render/src/hooks/useAsyncQueue.js +1 -1
  55. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +11 -7
  56. package/es/packages/form-render/src/hooks/useFormItemDeps.d.ts +2 -2
  57. package/es/packages/form-render/src/hooks/useFormItemDeps.js +5 -6
  58. package/es/packages/form-render/src/types/fieldItem.d.ts +2 -1
  59. package/es/packages/form-render/src/utils/index.d.ts +9 -2
  60. package/es/packages/form-render/src/utils/index.js +43 -14
  61. package/es/packages/form-render/style/index.css +17 -15
  62. package/es/packages/index.css +32 -17
  63. package/es/packages/index.d.ts +1 -0
  64. package/es/packages/index.js +1 -0
  65. package/es/packages/info-header/index.d.ts +1375 -358
  66. package/es/packages/info-header/src/HiddenContent.vue.d.ts +689 -178
  67. package/es/packages/info-header/src/HiddenContent.vue_vue_type_script_setup_true_lang.js +11 -13
  68. package/es/packages/info-header/src/InfoEllipsis.js +4 -0
  69. package/es/packages/info-header/src/InfoEllipsis.vue.d.ts +833 -0
  70. package/es/packages/info-header/src/InfoEllipsis.vue_vue_type_script_setup_true_lang.js +41 -0
  71. package/es/packages/info-header/src/InfoHeader.vue.d.ts +1375 -358
  72. package/es/packages/info-header/src/InfoHeader.vue_vue_type_script_setup_true_lang.js +9 -13
  73. package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.d.ts +3 -5
  74. package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.js +9 -9
  75. package/es/src/components/SlotRender/index.d.ts +2 -0
  76. package/es/src/components/SlotRender/index.js +2 -0
  77. package/global.d.ts +8 -8
  78. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, ref, inject, computed, watch, createVNode } from 'vue';
2
2
  import { isField } from '@formily/core';
3
- import { isObject, isString } from 'lodash-es';
3
+ import { isEqual } from 'lodash-es';
4
4
  import { InjectAsyncQueue } from '../../constants/index.js';
5
- import { assignUpdateValue, formRenderLog, arrayed } from '../../utils/index.js';
5
+ import { assignUpdateValue, traverseDependKey } from '../../utils/index.js';
6
6
  import { connect, mapProps } from '@formily/vue';
7
7
  import { NCascader } from 'naive-ui';
8
8
  import { useFormField } from '../../hooks/useFormField.js';
@@ -14,7 +14,7 @@ const script = defineComponent({
14
14
  type: Array,
15
15
  default: () => []
16
16
  },
17
- deep: {
17
+ depth: {
18
18
  type: [Number, String],
19
19
  required: true
20
20
  },
@@ -32,59 +32,41 @@ const script = defineComponent({
32
32
  slots,
33
33
  emit
34
34
  }) {
35
- const _options = ref(null);
35
+ const remoteOptions = ref(null);
36
36
  const asyncQueue = inject(InjectAsyncQueue);
37
37
  const {
38
38
  field,
39
39
  title
40
40
  } = useFormField();
41
41
  async function fetchData(option) {
42
- if (!option && _options.value)
42
+ if (!option && remoteOptions.value)
43
43
  return;
44
- const config = props.urlConfig;
45
- if (!config)
44
+ if (!configFor(props))
46
45
  return;
47
- if (!isObject(config)) {
48
- formRenderLog(`invalid urlConfig (${config}) in CASCADER => ${title.value}`, "warn");
46
+ if (deepFor(option) + 1 >= deepFor(props))
49
47
  return;
50
- }
51
- if (deepFor(option) + 1 >= props.deep)
52
- return;
53
- let data = await asyncQueue.addAsync({
54
- ...createRequestParams(deepFor(option), config, option),
55
- key: title.value
56
- });
57
- if (!Array.isArray(data)) {
58
- data = [];
59
- }
60
- if (!data.length && isObject(option)) {
48
+ const data = await asyncQueue.addAsync(createRequestParams(deepFor(option), configFor(props), title.value, option));
49
+ if (!data.length && option) {
61
50
  option.isLeaf = true;
62
51
  updateValue(null, null, getOptionChain(option));
63
52
  show.value = false;
64
53
  return;
65
54
  }
66
55
  const result = data.map((item) => optionNormalize(item, deepFor(option)));
67
- option ? option.children = result : _options.value = result;
68
- function deepFor(option2) {
69
- var _a;
70
- return (_a = option2 == null ? void 0 : option2.depth) != null ? _a : -1;
71
- }
72
- function createRequestParams(deep, config2, option2) {
56
+ option ? option.children = result : remoteOptions.value = result;
57
+ function createRequestParams(deep, config, key, option2) {
73
58
  const params = {
74
59
  lvlnr: deep + 1 + ""
75
60
  };
76
- if (option2 && config2.dependKey) {
77
- arrayed(config2.dependKey).forEach((key) => {
78
- if (isString(key)) {
79
- params[key] = option2[valueKey.value];
80
- } else if (isObject(key)) {
81
- params[key.paramName] = option2[key.paramValue];
82
- }
61
+ if (option2 && config.dependKey) {
62
+ traverseDependKey(config.dependKey, (dependKey, valueKey2) => {
63
+ params[valueKey2] = option2[dependKey];
83
64
  });
84
65
  }
85
66
  return {
86
67
  params,
87
- ...config2
68
+ ...config,
69
+ key
88
70
  };
89
71
  }
90
72
  function getOptionChain(option2) {
@@ -96,30 +78,39 @@ const script = defineComponent({
96
78
  }
97
79
  return result2;
98
80
  }
99
- function optionNormalize(data2, deep) {
81
+ function optionNormalize(data2, depth) {
100
82
  return {
101
83
  [labelKey.value]: data2[labelKey.value],
102
84
  [valueKey.value]: data2[valueKey.value],
103
- depth: deep + 1,
85
+ depth: depth + 1,
104
86
  parent: option,
105
- isLeaf: deep + 2 >= props.deep
87
+ isLeaf: depth + 2 >= deepFor(props)
106
88
  };
107
89
  }
90
+ function configFor(target) {
91
+ return target.urlConfig;
92
+ }
93
+ function deepFor(target) {
94
+ var _a;
95
+ return (_a = target == null ? void 0 : target.depth) != null ? _a : -1;
96
+ }
108
97
  }
109
- const renderOptions = computed(() => {
110
- return _options.value || props.options || [];
98
+ const parsedOptions = computed(() => {
99
+ return remoteOptions.value || props.options || [];
111
100
  });
112
101
  watch(() => props.value, (n, o) => {
113
102
  var _a, _b;
114
- if (n != null && o == null) {
115
- fetchData();
116
- }
117
- if (isField(field.value) && field.value.visited) {
118
- (_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a);
119
- }
103
+ n != null && o == null && fetchData();
104
+ isField(field.value) && field.value.visited && ((_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a));
120
105
  }, {
121
106
  immediate: true
122
107
  });
108
+ watch(() => props.urlConfig, async (config, oldConfig) => {
109
+ if (isEqual(config, oldConfig))
110
+ return;
111
+ remoteOptions.value = null;
112
+ await fetchData();
113
+ });
123
114
  const labelKey = computed(() => {
124
115
  var _a, _b;
125
116
  return (_b = (_a = props.urlConfig) == null ? void 0 : _a.nameKey) != null ? _b : "text";
@@ -131,13 +122,11 @@ const script = defineComponent({
131
122
  const _value = computed(() => {
132
123
  try {
133
124
  const parsed = Array.isArray(props.value) ? props.value : JSON.parse(props.value || "");
134
- if (Array.isArray(parsed)) {
135
- return parsed.map((option) => option[labelKey.value]).join(" / ");
136
- } else {
137
- return [];
138
- }
125
+ if (!Array.isArray(parsed) || !parsed.length)
126
+ return null;
127
+ return parsed.map((option) => option[labelKey.value]).join(" / ");
139
128
  } catch (e) {
140
- return "";
129
+ return null;
141
130
  }
142
131
  });
143
132
  function updateValue(_, __, options) {
@@ -172,7 +161,7 @@ const script = defineComponent({
172
161
  "remote": true,
173
162
  "labelField": labelKey.value,
174
163
  "valueField": valueKey.value,
175
- "options": renderOptions.value,
164
+ "options": parsedOptions.value,
176
165
  "checkStrategy": "child",
177
166
  "onLoad": fetchData,
178
167
  "onFocus": focusDecorator(props.onFocus),
@@ -1,9 +1,9 @@
1
- import { defineComponent, inject, computed, ref, createVNode } from 'vue';
1
+ import { defineComponent, inject, computed, createVNode } from 'vue';
2
2
  import { isVoidField } from '@formily/core';
3
3
  import { connect, mapProps } from '@formily/vue';
4
- import { FileTrayFull, FileTray } from '@vicons/ionicons5';
5
4
  import { isBoolean } from 'lodash-es';
6
- import { NFormItem, NPopover, NIcon, NInput } from 'naive-ui';
5
+ import { NFormItem } from 'naive-ui';
6
+ import AnnotationEdit from '../../../../../packages/annotation-edit';
7
7
  import { InjectionAnnotation } from '../../../../../packages/form-render/src/constants';
8
8
 
9
9
  const script = defineComponent({
@@ -27,96 +27,12 @@ const script = defineComponent({
27
27
  };
28
28
  }
29
29
  });
30
- function renderTextarea() {
31
- return createVNode(NInput, {
32
- "type": "textarea",
33
- "value": annotationContent.value,
34
- "onUpdate:value": ($event) => annotationContent.value = $event
35
- }, null);
36
- }
37
- const __showPopper = ref(false);
38
- const showPopper = computed({
39
- get() {
40
- return __showPopper.value;
41
- },
42
- async set(value) {
43
- __showPopper.value = value;
44
- if (!value && isEdit.value) {
45
- await new Promise((resolve) => setTimeout(resolve, 200));
46
- isEdit.value = false;
47
- }
48
- }
49
- });
50
- const isEdit = ref(false);
51
- let clickTimer;
52
- function iconClick() {
53
- clearTimeout(clickTimer);
54
- if (showPopper.value && isEdit.value) {
55
- showPopper.value = false;
56
- return;
57
- }
58
- clickTimer = setTimeout(() => {
59
- if (!annotationContent.value) {
60
- isEdit.value = showPopper.value = true;
61
- }
62
- }, 200);
63
- }
64
- function iconDbClick() {
65
- clearTimeout(clickTimer);
66
- if (!annotationContent.value)
67
- return;
68
- showPopper.value = true;
69
- isEdit.value = true;
70
- }
71
- function iconMouseenter() {
72
- if (!annotationContent.value)
73
- return;
74
- showPopper.value = true;
75
- }
76
- function iconMouseleave() {
77
- if (!annotationContent.value || isEdit.value)
78
- return;
79
- showPopper.value = false;
80
- }
81
30
  function renderAnnotation() {
82
- return createVNode("section", {
83
- "class": ["form-render__formItemLabel--annotation", {
84
- "is-active": !!annotationContent.value
85
- }],
86
- "style": {
87
- "--icon-right": "-5"
88
- },
89
- "form-item-hover-show": !annotationContent.value && !isEdit.value
90
- }, [createVNode(NPopover, {
91
- "style": {
92
- maxWidth: "200px",
93
- wordBreak: "break-all"
94
- },
95
- "show": showPopper.value,
96
- "onUpdate:show": ($event) => showPopper.value = $event,
97
- "trigger": "manual",
98
- "duration": 100
99
- }, {
100
- default: renderDefault,
101
- trigger: renderTrigger
102
- })]);
103
- function renderText() {
104
- return createVNode("span", null, [annotationContent.value]);
105
- }
106
- function renderDefault() {
107
- return createVNode("div", null, [isEdit.value ? renderTextarea() : renderText()]);
108
- }
109
- function renderTrigger() {
110
- return createVNode("div", {
111
- "class": "form-render__formItemLabel--icon",
112
- "onMouseleave": iconMouseleave,
113
- "onMouseenter": iconMouseenter,
114
- "onDblclick": iconDbClick,
115
- "onClick": iconClick
116
- }, [createVNode(NIcon, {
117
- "component": annotationContent.value ? FileTrayFull : FileTray
118
- }, null)]);
119
- }
31
+ return createVNode(AnnotationEdit, {
32
+ "class": "form-render__formItemLabel--annotation",
33
+ "modelValue": annotationContent.value,
34
+ "onUpdate:modelValue": ($event) => annotationContent.value = $event
35
+ }, null);
120
36
  }
121
37
  const showAnnotation = computed(() => {
122
38
  return annotation.value && (!isBoolean(props.annotation) || props.annotation);
@@ -1,5 +1,5 @@
1
- import { defineComponent, computed, createVNode, Fragment } from 'vue';
2
- import { createSlot, assignUpdateValue } from '../../utils/index.js';
1
+ import { defineComponent, createVNode } from 'vue';
2
+ import { createInputSlot, assignUpdateValue } from '../../utils/index.js';
3
3
  import { connect, mapProps } from '@formily/vue';
4
4
  import { NInput } from 'naive-ui';
5
5
 
@@ -13,21 +13,10 @@ const script = defineComponent({
13
13
  type: String
14
14
  }
15
15
  },
16
- setup(props, {
17
- attrs
18
- }) {
19
- const _slots = computed(() => {
20
- const res = {};
21
- if (props.prefix) {
22
- res.prefix = () => createVNode(Fragment, null, [createSlot(props.prefix, props).default()]);
23
- }
24
- if (props.suffix) {
25
- res.suffix = () => createVNode(Fragment, null, [createSlot(props.suffix, props).default()]);
26
- }
27
- return res;
28
- });
16
+ setup(props) {
17
+ const _slots = createInputSlot(props);
29
18
  return () => {
30
- return createVNode(NInput, attrs, _slots.value);
19
+ return createVNode(NInput, null, _slots.value);
31
20
  };
32
21
  }
33
22
  });
@@ -1,5 +1,17 @@
1
1
  export declare const INPUT_NUMBER: import("vue").DefineComponent<{
2
2
  onChange: {};
3
+ prefix: {
4
+ type: StringConstructor;
5
+ };
6
+ suffix: {
7
+ type: StringConstructor;
8
+ };
3
9
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
4
10
  onChange: {};
11
+ prefix: {
12
+ type: StringConstructor;
13
+ };
14
+ suffix: {
15
+ type: StringConstructor;
16
+ };
5
17
  }>>, {}>;
@@ -1,15 +1,22 @@
1
1
  import { defineComponent, createVNode } from 'vue';
2
- import { assignUpdateValue } from '../../utils/index.js';
2
+ import { createInputSlot, assignUpdateValue } from '../../utils/index.js';
3
3
  import { connect, mapProps } from '@formily/vue';
4
4
  import { NInputNumber } from 'naive-ui';
5
5
 
6
6
  const script = defineComponent({
7
7
  props: {
8
- onChange: {}
8
+ onChange: {},
9
+ prefix: {
10
+ type: String
11
+ },
12
+ suffix: {
13
+ type: String
14
+ }
9
15
  },
10
- setup(_) {
16
+ setup(props) {
17
+ const _slots = createInputSlot(props);
11
18
  return () => {
12
- return createVNode(NInputNumber, null, null);
19
+ return createVNode(NInputNumber, null, _slots.value);
13
20
  };
14
21
  }
15
22
  });
@@ -1,9 +1,8 @@
1
- import { defineComponent, ref, inject, computed, watch, nextTick, createVNode } from 'vue';
1
+ import { defineComponent, ref, watch, inject, computed, nextTick, createVNode } from 'vue';
2
2
  import { isField } from '@formily/core';
3
- import { cloneDeep } from 'lodash-es';
3
+ import { isEqual, cloneDeep } from 'lodash-es';
4
4
  import { InjectAsyncQueue, InjectionFormItemDepsCollector, InjectionChangeContextCollector } from '../../constants/index.js';
5
- import { assignUpdateValue, formRenderLog, generateUrlParams } from '../../utils/index.js';
6
- import { isObject } from '@vueuse/core';
5
+ import { assignUpdateValue, traverseDependKey } from '../../utils/index.js';
7
6
  import { connect, mapProps } from '@formily/vue';
8
7
  import { NSelect } from 'naive-ui';
9
8
  import { useFormField } from '../../hooks/useFormField.js';
@@ -32,6 +31,7 @@ const script = defineComponent({
32
31
  emit
33
32
  }) {
34
33
  const remoteOptions = ref(null);
34
+ watch(remoteOptions, (o) => console.log("remoteOption", o));
35
35
  const lastSearch = ref("");
36
36
  const asyncQueue = inject(InjectAsyncQueue);
37
37
  const {
@@ -52,10 +52,6 @@ const script = defineComponent({
52
52
  if (!config) {
53
53
  return remoteOptions.value = null;
54
54
  }
55
- if (!isObject(config)) {
56
- formRenderLog(`invalid urlConfig (${config}) in SELECT => ${title.value}`, "warn");
57
- return remoteOptions.value = null;
58
- }
59
55
  try {
60
56
  remoteOptions.value = await asyncQueue.addAsync({
61
57
  ...createParams(config, field.value),
@@ -65,9 +61,16 @@ const script = defineComponent({
65
61
  remoteOptions.value = null;
66
62
  }
67
63
  function createParams(config2, field2) {
64
+ const _params = {};
65
+ traverseDependKey(config2.dependKey, (dependKey, valueKey2) => {
66
+ const _field = field2.query(dependKey).take();
67
+ if (isField(_field)) {
68
+ _params[valueKey2] = _field.value;
69
+ }
70
+ });
68
71
  return {
69
72
  ...config2,
70
- params: Object.assign({}, config2.params, generateUrlParams(field2, config2.dependKey))
73
+ params: Object.assign({}, config2.params, _params)
71
74
  };
72
75
  }
73
76
  }
@@ -79,13 +82,16 @@ const script = defineComponent({
79
82
  return filterOption(props.options, lastSearch.value);
80
83
  });
81
84
  const formItemDepsCollector = inject(InjectionFormItemDepsCollector);
82
- watch(() => props.urlConfig, (config) => {
85
+ watch(() => props.urlConfig, (config, oldConfig) => {
86
+ if (isEqual(config, oldConfig))
87
+ return;
83
88
  remoteOptions.value = null;
84
89
  config && formItemDepsCollector.setDeps(fieldKey.value, config.dependKey || [], async () => {
85
90
  remoteOptions.value = null;
86
91
  await nextTick();
87
92
  props.value != null && await fetchData();
88
93
  });
94
+ config && fetchData();
89
95
  }, {
90
96
  immediate: true
91
97
  });
@@ -1,2 +1,15 @@
1
- export declare const TEXT: (props: any) => JSX.Element;
2
- export declare const BUTTON: (props: any) => JSX.Element;
1
+ export declare const TEXT: {
2
+ (props: any): JSX.Element;
3
+ props: {
4
+ content: {};
5
+ fieldItem: {};
6
+ };
7
+ };
8
+ export declare const BUTTON: {
9
+ (props: any): JSX.Element;
10
+ props: {
11
+ onClick: {};
12
+ fieldItem: {};
13
+ content: {};
14
+ };
15
+ };
@@ -1,12 +1,9 @@
1
- import { createVNode, mergeProps, isVNode } from 'vue';
1
+ import { createVNode } from 'vue';
2
2
  import { connect, mapProps } from '@formily/vue';
3
3
  import { isFunction } from 'lodash-es';
4
4
  import { NButton } from 'naive-ui';
5
5
  import { createSlot } from '../../../../../packages/form-render/src/utils';
6
6
 
7
- function _isSlot(s) {
8
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
9
- }
10
7
  function createPropFor(props) {
11
8
  return (property) => {
12
9
  var _a;
@@ -14,9 +11,12 @@ function createPropFor(props) {
14
11
  };
15
12
  }
16
13
  const textScript = (props) => {
17
- var _a, _b, _c;
18
- const propFor = createPropFor(props);
19
- return createVNode("div", (_a = propFor("componentProps")) != null ? _a : {}, [(_c = (_b = createSlot(props.content, props)).default) == null ? void 0 : _c.call(_b)]);
14
+ var _a, _b;
15
+ return createVNode("div", null, [(_b = (_a = createSlot(props.content, props)).default) == null ? void 0 : _b.call(_a)]);
16
+ };
17
+ textScript.props = {
18
+ content: {},
19
+ fieldItem: {}
20
20
  };
21
21
  const TEXT = connect(textScript, mapProps((props) => {
22
22
  var _a;
@@ -26,19 +26,20 @@ const TEXT = connect(textScript, mapProps((props) => {
26
26
  };
27
27
  }));
28
28
  const buttonScript = (props) => {
29
- var _a;
30
- let _slot;
31
29
  const propFor = createPropFor(props);
32
30
  function onClick() {
33
- var _a2;
34
- const cb = propFor("onClick") || ((_a2 = propFor("componentProps")) == null ? void 0 : _a2.onClick);
31
+ var _a;
32
+ const cb = propFor("onClick") || ((_a = propFor("componentProps")) == null ? void 0 : _a.onClick);
35
33
  return () => isFunction(cb) && cb(props.fieldItem);
36
34
  }
37
- return createVNode(NButton, mergeProps((_a = propFor("componentProps")) != null ? _a : {}, {
35
+ return createVNode(NButton, {
38
36
  "onClick": onClick()
39
- }), _isSlot(_slot = createSlot(props.content, props)) ? _slot : {
40
- default: () => [_slot]
41
- });
37
+ }, createSlot(props.content, props));
38
+ };
39
+ buttonScript.props = {
40
+ onClick: {},
41
+ fieldItem: {},
42
+ content: {}
42
43
  };
43
44
  const BUTTON = connect(buttonScript, mapProps((props) => {
44
45
  var _a;
@@ -3,7 +3,7 @@ import { ISchema } from '@formily/json-schema/esm/types';
3
3
  import { FormItemDepsCollector } from '../../../../../es/packages/form-render';
4
4
  export declare function useAnchor(props: Readonly<AnyObject>, collector: FormItemDepsCollector): {
5
5
  currentAnchor: import("vue").WritableComputedRef<string>;
6
- onScroll: () => Promise<void>;
6
+ onScroll: () => void;
7
7
  formHeight: import("vue").ComputedRef<any>;
8
8
  anchorIdList: import("vue").Ref<{
9
9
  name: string;
@@ -3,7 +3,7 @@ import { useDebounceFn } from '@vueuse/core';
3
3
  import { isNumber } from 'lodash-es';
4
4
  import { ref, computed, watch, nextTick } from 'vue';
5
5
  import { FormItemLineBarDepKeyPrepend } from '../../../../packages/form-render/src/constants';
6
- import { traverseSchema, createLinebarId } from '../../../../packages/form-render/src/utils';
6
+ import { createLinebarId, traverseSchema } from '../../../../packages/form-render/src/utils';
7
7
 
8
8
  function useAnchor(props, collector) {
9
9
  const __currentAnchor = ref("");
@@ -44,13 +44,13 @@ function useAnchor(props, collector) {
44
44
  scrollLock = false;
45
45
  }
46
46
  }
47
- const onScroll = useDebounceFn(async function() {
47
+ const onScroll = useDebounceFn(function() {
48
48
  var _a;
49
49
  if (scrollLock || !scrollbarRef.value)
50
50
  return;
51
51
  const { scrollTop, clientHeight } = scrollbarRef.value;
52
52
  const result = anchorIdList.value.find((anchor) => {
53
- const node = scrollbarRef.value.querySelector(`#${anchor.name}`);
53
+ const node = scrollbarRef.value.querySelector(`#${createLinebarId(anchor.name)}`);
54
54
  if (!node)
55
55
  return;
56
56
  return node.offsetTop >= scrollTop || node.offsetTop < scrollTop && node.clientHeight + node.offsetTop > scrollTop + clientHeight;
@@ -120,7 +120,7 @@ function useAsyncQueue() {
120
120
  const { data, success } = res;
121
121
  if (!success)
122
122
  throw res;
123
- cb(void 0, data);
123
+ cb(void 0, Array.isArray(data) ? data : []);
124
124
  } catch (e) {
125
125
  cb(new Error(`Request error => ${e}`));
126
126
  removeCache();
@@ -1,7 +1,7 @@
1
1
  import { isObject } from '@vueuse/core';
2
- import { isArray, pick } from 'lodash-es';
2
+ import { pick } from 'lodash-es';
3
3
  import { useFormValidator, useTypeNormalize } from '../../../../packages/form-render';
4
- import { createLinebarId, arrayed, transformDateFormat } from '../utils/index.js';
4
+ import { fieldKeyEscape, arrayed, createLinebarId, transformDateFormat } from '../utils/index.js';
5
5
 
6
6
  function useFieldListAdaptor(collector, uuid) {
7
7
  const { createValidatorSchema } = useFormValidator();
@@ -80,7 +80,7 @@ function useFieldListAdaptor(collector, uuid) {
80
80
  const schema = createStandardSchema(item);
81
81
  Object.assign(schema["x-component-props"], {
82
82
  urlConfig: item.urlConfig,
83
- deep: (_a = item.wordbook) == null ? void 0 : _a.level_num,
83
+ depth: (_a = item.wordbook) == null ? void 0 : _a.level_num,
84
84
  options: item.option
85
85
  });
86
86
  return schema;
@@ -108,7 +108,9 @@ function useFieldListAdaptor(collector, uuid) {
108
108
  Object.assign(schema["x-component-props"], {
109
109
  precision: decimal_length || (validate == null ? void 0 : validate.decimal_length),
110
110
  max: validate == null ? void 0 : validate.max_value,
111
- min: validate == null ? void 0 : validate.min_value
111
+ min: validate == null ? void 0 : validate.min_value,
112
+ prefix: item.prefix,
113
+ suffix: item.suffix
112
114
  });
113
115
  return schema;
114
116
  };
@@ -174,13 +176,15 @@ function useFieldListAdaptor(collector, uuid) {
174
176
  return creator(item);
175
177
  };
176
178
  const createWidgetCombinationSchema = (item) => {
179
+ if (!item.suffixConfig)
180
+ return createWidgetSchema(item);
177
181
  const suffixList = arrayed(item.suffixConfig);
178
182
  const fieldList = [{ ...item, suffixConfig: void 0 }].concat(suffixList.map((suffix) => {
179
183
  return { ...suffix, is_show: item.is_show, alias: " " };
180
184
  }));
181
185
  return {
182
186
  type: "void",
183
- name: fieldList.map((f) => f.val_key).join("-"),
187
+ name: fieldKeyEscape(fieldList),
184
188
  title: item.alias || item.name,
185
189
  "x-component": "INPUT_GROUP",
186
190
  "x-component-props": { span: item.elem_width },
@@ -211,8 +215,8 @@ function useFieldListAdaptor(collector, uuid) {
211
215
  return schema;
212
216
  }
213
217
  function createFieldName(fieldItem) {
214
- if (isArray(fieldItem.suffixConfig)) {
215
- return [fieldItem.val_key, fieldItem.suffixConfig.map((f) => f.val_key)].join("-");
218
+ if (fieldItem.suffixConfig) {
219
+ return fieldKeyEscape([fieldItem, ...arrayed(fieldItem.suffixConfig)]);
216
220
  }
217
221
  return fieldItem.val_key;
218
222
  }
@@ -1,7 +1,7 @@
1
- import { Func } from '../../../../../es/src/types';
1
+ import { ArrayAble, Func } from '../../../../../es/src/types';
2
2
  export declare class FormItemDepsCollector {
3
3
  private readonly collector;
4
- setDeps(key: string, dependKey: string | string[], callback: Func): void;
4
+ setDeps(key: string, dependKeys: ArrayAble<string> | Record<string, string> | ArrayAble<Record<'paramName' | 'paramValue', string>>, callback: Func): void;
5
5
  trigger(dependKey: string, payload?: any): void;
6
6
  }
7
7
  export declare function useFormItemDeps(): {
@@ -1,16 +1,15 @@
1
1
  import { isFunction } from 'lodash-es';
2
- import { arrayed } from '../../../../packages/form-render/src/utils';
2
+ import { traverseDependKey } from '../../../../packages/form-render/src/utils';
3
3
 
4
4
  class FormItemDepsCollector {
5
5
  constructor() {
6
6
  this.collector = /* @__PURE__ */ new Map();
7
7
  }
8
- setDeps(key, dependKey, callback) {
9
- dependKey = arrayed(dependKey);
10
- dependKey.forEach((dependKey2) => {
11
- const map = this.collector.get(dependKey2) || /* @__PURE__ */ new Map();
8
+ setDeps(key, dependKeys, callback) {
9
+ traverseDependKey(dependKeys, (dependKey) => {
10
+ const map = this.collector.get(dependKey) || /* @__PURE__ */ new Map();
12
11
  map.set(key, callback);
13
- this.collector.set(dependKey2, map);
12
+ this.collector.set(dependKey, map);
14
13
  });
15
14
  }
16
15
  trigger(dependKey, payload) {
@@ -64,11 +64,12 @@ export declare type FieldItem = {
64
64
  urlConfig: Partial<{
65
65
  url: string;
66
66
  method: 'post' | 'get' | 'put' | 'patch' | 'delete';
67
- dependKey: string | string[];
67
+ dependKey: string | string[] | Record<string, string>;
68
68
  params: AnyObject;
69
69
  nameKey: string;
70
70
  valueKey: string;
71
71
  }>;
72
+ suffixConfig: FieldItem[] | FieldItem;
72
73
  fieldType: 'string' | 'object' | 'array' | 'number' | 'void' | 'boolean' | 'datetime';
73
74
  content: string | FormRenderer | Record<string, FormRenderer>;
74
75
  properties: FieldItem[];