cnhis-design-vue 3.1.9-beta.2 → 3.1.9-beta.3

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 (47) hide show
  1. package/README.md +22 -22
  2. package/es/packages/big-table/style/index.less +557 -557
  3. package/es/packages/bpmn-workflow/style/index.less +29 -29
  4. package/es/packages/button-print/style/index.less +30 -30
  5. package/es/packages/chunk-upload/src/chunk-upload-new.vue.d.ts +4 -6
  6. package/es/packages/chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +0 -3
  7. package/es/packages/chunk-upload/style/index.less +394 -394
  8. package/es/packages/drag-layout/src/DragLayout.vue.d.ts +5 -8
  9. package/es/packages/drag-layout/style/index.less +208 -208
  10. package/es/packages/field-set/style/index.less +157 -157
  11. package/es/packages/form-render/index.d.ts +1 -2
  12. package/es/packages/form-render/index.mjs +1 -1
  13. package/es/packages/form-render/src/FormRender.vue.d.ts +1 -2
  14. package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.mjs +11 -6
  15. package/es/packages/form-render/src/components/cascader.d.ts +6 -2
  16. package/es/packages/form-render/src/components/cascader.mjs +11 -5
  17. package/es/packages/form-render/src/components/select.d.ts +2 -0
  18. package/es/packages/form-render/src/components/select.mjs +16 -10
  19. package/es/packages/form-render/src/constants/index.d.ts +2 -1
  20. package/es/packages/form-render/src/constants/index.mjs +2 -1
  21. package/es/packages/form-render/src/hooks/index.d.ts +1 -1
  22. package/es/packages/form-render/src/hooks/index.mjs +1 -1
  23. package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +3 -1
  24. package/es/packages/form-render/src/hooks/useBusinessBinding.mjs +15 -15
  25. package/es/packages/form-render/src/hooks/useFormField.d.ts +1 -0
  26. package/es/packages/form-render/src/hooks/useFormField.mjs +7 -1
  27. package/es/packages/form-render/src/hooks/useFormItemDeps.d.ts +8 -0
  28. package/es/packages/form-render/src/hooks/useFormItemDeps.mjs +29 -0
  29. package/es/packages/form-render/src/utils/index.d.ts +5 -3
  30. package/es/packages/form-render/src/utils/index.mjs +13 -1
  31. package/es/packages/form-table/style/index.less +301 -301
  32. package/es/packages/grid/style/index.less +12 -12
  33. package/es/packages/index.less +2945 -2945
  34. package/es/packages/index.mjs +1 -1
  35. package/es/packages/info-header/style/index.less +153 -153
  36. package/es/packages/map/style/index.less +59 -59
  37. package/es/packages/scale-view/style/index.less +748 -748
  38. package/es/packages/select-label/src/LabelFormContent.vue.d.ts +0 -3
  39. package/es/packages/select-label/style/index.less +151 -151
  40. package/es/packages/select-person/style/index.less +229 -229
  41. package/es/packages/time-line/style/index.less +34 -34
  42. package/es/src/types/index.d.ts +1 -0
  43. package/global.d.ts +8 -8
  44. package/package.json +1 -1
  45. package/yarn-error.log +8659 -103
  46. package/es/packages/form-render/src/hooks/useUrlDeps.d.ts +0 -1
  47. package/es/packages/form-render/src/hooks/useUrlDeps.mjs +0 -4
@@ -1,157 +1,157 @@
1
- .c-field-set {
2
- ul {
3
- margin: 0;
4
- padding: 0;
5
- }
6
-
7
- .fields-set-content {
8
- height: 100%;
9
- display: flex;
10
- flex-direction: column;
11
- overflow: hidden;
12
- .fields-table {
13
- flex: 1;
14
- display: flex;
15
- flex-direction: column;
16
- overflow: auto;
17
- }
18
- }
19
-
20
- height: 100%;
21
- position: relative;
22
- .n-spin-container {
23
- width: 100%;
24
- height: 100%;
25
- }
26
- .n-spin-content {
27
- height: 100%;
28
- }
29
- .setting-title {
30
- background: #f2f2f4;
31
- border: 1px solid #f2f2f2;
32
- height: 52px;
33
- line-height: 52px;
34
- span {
35
- display: inline-block;
36
- }
37
- &.seting-title-api {
38
- .width-large {
39
- width: 15%;
40
- }
41
- }
42
- }
43
- .set-show {
44
- min-height: 100px;
45
- overflow-y: auto;
46
- &.set-show-api {
47
- .width-large {
48
- width: 15%;
49
- }
50
- }
51
-
52
- .left-style.sortable-chosen {
53
- background: #fafafa;
54
- box-shadow: 0px 0px 10px 0px #d5d5d5;
55
- }
56
-
57
- li {
58
- padding: 5px 0;
59
- display: flex;
60
- align-items: center;
61
- border-bottom: 1px solid #e8e8e8;
62
- height: 52px;
63
- line-height: 52px;
64
- }
65
- .alias-style {
66
- outline: none;
67
- border-radius: 4px 4px 4px 4px;
68
- border: solid 1px #d5d5d5;
69
- height: 32px;
70
- text-indent: 16px;
71
- color: #38454f;
72
- width: 100%;
73
- }
74
- .is-sort-style {
75
- outline: none;
76
- border-radius: 4px 4px 4px 4px;
77
- border: solid 1px #d5d5d5;
78
- height: 32px;
79
- text-indent: 6px;
80
- color: #38454f;
81
- width: 87px;
82
- margin-right: 5px;
83
- &:disabled {
84
- cursor: not-allowed;
85
- background: #f5f5f5;
86
- }
87
- }
88
- .col-width-style {
89
- width: 70px;
90
- }
91
- .title-item {
92
- display: inline-flex;
93
- justify-content: flex-start;
94
- align-items: center;
95
- text-align: left;
96
- > span {
97
- display: inline-block;
98
- max-width: calc(100% - 20px);
99
- overflow: hidden;
100
- white-space: nowrap;
101
- text-overflow: ellipsis;
102
- }
103
- }
104
- }
105
- .alias-style {
106
- outline: none;
107
- border-radius: 4px 4px 4px 4px;
108
- border: solid 1px rgba(212, 222, 229, 1);
109
- height: 32px;
110
- text-indent: 16px;
111
- color: #38454f;
112
- }
113
- .btn-operate {
114
- border-top: 1px solid #d5d5d5;
115
- padding: 12px 0 12px;
116
- }
117
-
118
- .width-show {
119
- display: inline-block;
120
- width: 10%;
121
- overflow: hidden;
122
- white-space: nowrap;
123
- text-overflow: ellipsis;
124
- }
125
- .drag-icon-wrap {
126
- width: 5% !important;
127
- cursor: pointer;
128
- text-align: center;
129
- }
130
- .width-showed {
131
- display: inline-block;
132
- width: 15%;
133
- overflow: hidden;
134
- white-space: nowrap;
135
- text-overflow: ellipsis;
136
- select {
137
- width: 90% !important;
138
- }
139
- }
140
- .width-word {
141
- display: inline-block;
142
- width: 20%;
143
- line-height: 52px;
144
- overflow: hidden;
145
- white-space: nowrap;
146
- input {
147
- width: 90% !important;
148
- }
149
- }
150
- .width-large {
151
- display: inline-block;
152
- width: 20%;
153
- overflow: hidden;
154
- white-space: nowrap;
155
- text-overflow: ellipsis;
156
- }
157
- }
1
+ .c-field-set {
2
+ ul {
3
+ margin: 0;
4
+ padding: 0;
5
+ }
6
+
7
+ .fields-set-content {
8
+ height: 100%;
9
+ display: flex;
10
+ flex-direction: column;
11
+ overflow: hidden;
12
+ .fields-table {
13
+ flex: 1;
14
+ display: flex;
15
+ flex-direction: column;
16
+ overflow: auto;
17
+ }
18
+ }
19
+
20
+ height: 100%;
21
+ position: relative;
22
+ .n-spin-container {
23
+ width: 100%;
24
+ height: 100%;
25
+ }
26
+ .n-spin-content {
27
+ height: 100%;
28
+ }
29
+ .setting-title {
30
+ background: #f2f2f4;
31
+ border: 1px solid #f2f2f2;
32
+ height: 52px;
33
+ line-height: 52px;
34
+ span {
35
+ display: inline-block;
36
+ }
37
+ &.seting-title-api {
38
+ .width-large {
39
+ width: 15%;
40
+ }
41
+ }
42
+ }
43
+ .set-show {
44
+ min-height: 100px;
45
+ overflow-y: auto;
46
+ &.set-show-api {
47
+ .width-large {
48
+ width: 15%;
49
+ }
50
+ }
51
+
52
+ .left-style.sortable-chosen {
53
+ background: #fafafa;
54
+ box-shadow: 0px 0px 10px 0px #d5d5d5;
55
+ }
56
+
57
+ li {
58
+ padding: 5px 0;
59
+ display: flex;
60
+ align-items: center;
61
+ border-bottom: 1px solid #e8e8e8;
62
+ height: 52px;
63
+ line-height: 52px;
64
+ }
65
+ .alias-style {
66
+ outline: none;
67
+ border-radius: 4px 4px 4px 4px;
68
+ border: solid 1px #d5d5d5;
69
+ height: 32px;
70
+ text-indent: 16px;
71
+ color: #38454f;
72
+ width: 100%;
73
+ }
74
+ .is-sort-style {
75
+ outline: none;
76
+ border-radius: 4px 4px 4px 4px;
77
+ border: solid 1px #d5d5d5;
78
+ height: 32px;
79
+ text-indent: 6px;
80
+ color: #38454f;
81
+ width: 87px;
82
+ margin-right: 5px;
83
+ &:disabled {
84
+ cursor: not-allowed;
85
+ background: #f5f5f5;
86
+ }
87
+ }
88
+ .col-width-style {
89
+ width: 70px;
90
+ }
91
+ .title-item {
92
+ display: inline-flex;
93
+ justify-content: flex-start;
94
+ align-items: center;
95
+ text-align: left;
96
+ > span {
97
+ display: inline-block;
98
+ max-width: calc(100% - 20px);
99
+ overflow: hidden;
100
+ white-space: nowrap;
101
+ text-overflow: ellipsis;
102
+ }
103
+ }
104
+ }
105
+ .alias-style {
106
+ outline: none;
107
+ border-radius: 4px 4px 4px 4px;
108
+ border: solid 1px rgba(212, 222, 229, 1);
109
+ height: 32px;
110
+ text-indent: 16px;
111
+ color: #38454f;
112
+ }
113
+ .btn-operate {
114
+ border-top: 1px solid #d5d5d5;
115
+ padding: 12px 0 12px;
116
+ }
117
+
118
+ .width-show {
119
+ display: inline-block;
120
+ width: 10%;
121
+ overflow: hidden;
122
+ white-space: nowrap;
123
+ text-overflow: ellipsis;
124
+ }
125
+ .drag-icon-wrap {
126
+ width: 5% !important;
127
+ cursor: pointer;
128
+ text-align: center;
129
+ }
130
+ .width-showed {
131
+ display: inline-block;
132
+ width: 15%;
133
+ overflow: hidden;
134
+ white-space: nowrap;
135
+ text-overflow: ellipsis;
136
+ select {
137
+ width: 90% !important;
138
+ }
139
+ }
140
+ .width-word {
141
+ display: inline-block;
142
+ width: 20%;
143
+ line-height: 52px;
144
+ overflow: hidden;
145
+ white-space: nowrap;
146
+ input {
147
+ width: 90% !important;
148
+ }
149
+ }
150
+ .width-large {
151
+ display: inline-block;
152
+ width: 20%;
153
+ overflow: hidden;
154
+ white-space: nowrap;
155
+ text-overflow: ellipsis;
156
+ }
157
+ }
@@ -186,10 +186,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
186
186
  onFormChange?: ((...args: any[]) => any) | undefined;
187
187
  }>>;
188
188
  emit: (event: "formChange", ...args: any[]) => void;
189
- create: () => import("./src/hooks").BusinessCollector;
190
- trigger: (collector: import("./src/hooks").BusinessCollector, formModel: import("@formily/core").Form<any>, fieldName: string, value: unknown) => void;
191
189
  businessCollector: import("./src/hooks").BusinessCollector;
192
190
  changeContextCollector: import("./src/hooks").ContextCollector;
191
+ formItemDepsCollector: import("./src/hooks").FormItemDepsCollector;
193
192
  formModel: import("@formily/core").Form<{
194
193
  [x: string]: any;
195
194
  }>;
@@ -12,7 +12,7 @@ export { useTypeNormalize } from './src/hooks/useTypeNormalize.mjs';
12
12
  export { useFormValidator } from './src/hooks/useFormValidator.mjs';
13
13
  export { BusinessCollector, useBusinessBinding } from './src/hooks/useBusinessBinding.mjs';
14
14
  export { ContextCollector, useChangeContext } from './src/hooks/useChangeContext.mjs';
15
- export { useUrlDeps } from './src/hooks/useUrlDeps.mjs';
15
+ export { FormItemDepsCollector, useFormItemDeps } from './src/hooks/useFormItemDeps.mjs';
16
16
 
17
17
  const FormRender = script;
18
18
  FormRender.install = function(app) {
@@ -186,10 +186,9 @@ declare const _default: import("vue").DefineComponent<{
186
186
  onFormChange?: ((...args: any[]) => any) | undefined;
187
187
  }>>;
188
188
  emit: (event: "formChange", ...args: any[]) => void;
189
- create: () => import("./hooks").BusinessCollector;
190
- trigger: (collector: import("./hooks").BusinessCollector, formModel: import("@formily/core").Form<any>, fieldName: string, value: unknown) => void;
191
189
  businessCollector: import("./hooks").BusinessCollector;
192
190
  changeContextCollector: import("./hooks").ContextCollector;
191
+ formItemDepsCollector: import("./hooks").FormItemDepsCollector;
193
192
  formModel: import("@formily/core").Form<{
194
193
  [x: string]: any;
195
194
  }>;
@@ -1,13 +1,14 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, renderSlot, createBlock, createElementVNode, toDisplayString, createCommentVNode } from 'vue';
1
+ import { defineComponent, provide, computed, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, renderSlot, createBlock, createElementVNode, toDisplayString, createCommentVNode } from 'vue';
2
2
  import { injectOrProvide } from './utils/index.mjs';
3
3
  import { cloneDeep } from 'lodash-es';
4
- import { InjectionBusinessCollector, InjectAsyncQueue, InjectionChangeContextCollector, InjectionSchemaField } from './constants/index.mjs';
4
+ import { InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectAsyncQueue, InjectionSchemaField } from './constants/index.mjs';
5
5
  import * as index from './components/index.mjs';
6
6
  import { createForm, onFieldValueChange } from '@formily/core';
7
7
  import { FormProvider, FormConsumer, createSchemaField } from '@formily/vue';
8
8
  import { useBusinessBinding } from './hooks/useBusinessBinding.mjs';
9
9
  import { useAsyncQueue } from './hooks/useAsyncQueue.mjs';
10
10
  import { useChangeContext } from './hooks/useChangeContext.mjs';
11
+ import { useFormItemDeps } from './hooks/useFormItemDeps.mjs';
11
12
  import { useFieldVisitor } from './hooks/useFieldVisitor.mjs';
12
13
  import { useFieldList2Schema } from './hooks/useFieldList2Schema.mjs';
13
14
 
@@ -33,10 +34,13 @@ var script = /* @__PURE__ */ defineComponent({
33
34
  ],
34
35
  setup(__props, { expose, emit }) {
35
36
  const props = __props;
36
- const { create, trigger } = useBusinessBinding();
37
- const businessCollector = injectOrProvide(InjectionBusinessCollector, create);
38
37
  injectOrProvide(InjectAsyncQueue, () => useAsyncQueue().create(props.parallelism));
39
- const changeContextCollector = injectOrProvide(InjectionChangeContextCollector, useChangeContext().create);
38
+ const businessCollector = useBusinessBinding().create();
39
+ provide(InjectionBusinessCollector, businessCollector);
40
+ const changeContextCollector = useChangeContext().create();
41
+ provide(InjectionChangeContextCollector, changeContextCollector);
42
+ const formItemDepsCollector = useFormItemDeps().create();
43
+ provide(InjectionFormItemDepsCollector, formItemDepsCollector);
40
44
  const formModel = createForm({
41
45
  initialValues: props.initialData,
42
46
  effects() {
@@ -49,7 +53,8 @@ var script = /* @__PURE__ */ defineComponent({
49
53
  value: field.value,
50
54
  context: changeContextCollector.getContext(fieldKey)
51
55
  });
52
- trigger(businessCollector, formModel, fieldKey, field.value);
56
+ businessCollector.trigger(formModel, fieldKey, field.value);
57
+ formItemDepsCollector.trigger(fieldKey);
53
58
  });
54
59
  }
55
60
  });
@@ -1,10 +1,14 @@
1
- import { AnyObject } from 'cnhis-design-vue/es/src/types';
1
+ import { AnyObject, ArrayAble } from 'cnhis-design-vue/es/src/types';
2
2
  import { FormRequestType } from '../types';
3
3
  import { PropType } from 'vue';
4
+ declare type DependKeyObj = {
5
+ paramName: string;
6
+ paramValue: string;
7
+ };
4
8
  declare type UrlConfig = {
5
9
  method: FormRequestType;
6
10
  nameKey: string;
7
- dependKey: string;
11
+ dependKey: ArrayAble<string> | ArrayAble<DependKeyObj>;
8
12
  url: string;
9
13
  valueKey: string;
10
14
  };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, inject, computed, watch, createVNode } from 'vue';
2
+ import { isObject, isString } from 'lodash-es';
2
3
  import { InjectAsyncQueue } from '../constants/index.mjs';
3
- import { assignUpdateValue, formRenderLog } from '../utils/index.mjs';
4
- import { isObject } from '@vueuse/core';
4
+ import { assignUpdateValue, formRenderLog, arrayed } from '../utils/index.mjs';
5
5
  import { connect, mapProps } from '@formily/vue';
6
6
  import { NCascader } from 'naive-ui';
7
7
  import { useFormField } from '../hooks/useFormField.mjs';
@@ -52,11 +52,17 @@ const script = defineComponent({
52
52
  lvlnr: parentDepth + 1 + ""
53
53
  };
54
54
  if (option) {
55
- if (!props.urlConfig.dependKey) {
56
- formRenderLog(`invalid urlConfig.dependKey ${props.urlConfig.dependKey} in CASCADER => ${title.value}`, "warn");
55
+ if (!config.dependKey) {
56
+ formRenderLog(`invalid urlConfig.dependKey ${config.dependKey} in CASCADER => ${title.value}`, "warn");
57
57
  return;
58
58
  }
59
- params[props.urlConfig.dependKey] = option[config.valueKey];
59
+ arrayed(config.dependKey).forEach((key) => {
60
+ if (isString(key)) {
61
+ params[key] = option[config.valueKey];
62
+ } else if (isObject(key)) {
63
+ params[key.paramName] = option[key.paramValue];
64
+ }
65
+ });
60
66
  }
61
67
  const data = await asyncQueue.addAsync({
62
68
  ...config,
@@ -3,8 +3,10 @@ import { FormRequestType } from '../types';
3
3
  import { PropType } from 'vue';
4
4
  declare type UrlConfig = {
5
5
  method: FormRequestType;
6
+ dependKey?: string | string[];
6
7
  nameKey: string;
7
8
  url: string;
9
+ params?: AnyObject;
8
10
  valueKey: string;
9
11
  };
10
12
  export declare const SELECT: import("vue").DefineComponent<{
@@ -1,9 +1,9 @@
1
1
  import { defineComponent, ref, inject, computed, watch, createVNode } from 'vue';
2
2
  import { cloneDeep } from 'lodash-es';
3
- import { InjectAsyncQueue, InjectionChangeContextCollector } from '../constants/index.mjs';
4
- import { assignUpdateValue, formRenderLog } from '../utils/index.mjs';
3
+ import { InjectAsyncQueue, InjectionFormItemDepsCollector, InjectionChangeContextCollector } from '../constants/index.mjs';
4
+ import { assignUpdateValue, formRenderLog, generateUrlParams } from '../utils/index.mjs';
5
5
  import { isObject } from '@vueuse/core';
6
- import { useField, connect, mapProps } from '@formily/vue';
6
+ import { connect, mapProps } from '@formily/vue';
7
7
  import { NSelect } from 'naive-ui';
8
8
  import { useFormField } from '../hooks/useFormField.mjs';
9
9
 
@@ -35,7 +35,9 @@ const script = defineComponent({
35
35
  let lastSearch;
36
36
  const asyncQueue = inject(InjectAsyncQueue);
37
37
  const {
38
- title
38
+ title,
39
+ field,
40
+ fieldKey
39
41
  } = useFormField();
40
42
  async function fetchData(content) {
41
43
  if (content === lastSearch && cachedOptions)
@@ -58,7 +60,8 @@ const script = defineComponent({
58
60
  try {
59
61
  const data = await asyncQueue.addAsync({
60
62
  ...config,
61
- key: title.value
63
+ key: title.value,
64
+ params: Object.assign({}, config.params, generateUrlParams(field.value, config.dependKey))
62
65
  });
63
66
  _options.value = data.reduce((res, d) => {
64
67
  var _a;
@@ -75,8 +78,15 @@ const script = defineComponent({
75
78
  const renderOptions = computed(() => {
76
79
  return _options.value || props.options || [];
77
80
  });
78
- watch(() => props.urlConfig, () => {
81
+ const formItemDepsCollector = inject(InjectionFormItemDepsCollector);
82
+ watch(() => props.urlConfig, (config) => {
79
83
  cachedOptions = null;
84
+ config && formItemDepsCollector.setDeps(fieldKey.value, config.dependKey || [], () => {
85
+ cachedOptions = null;
86
+ props.value && fetchData();
87
+ });
88
+ }, {
89
+ immediate: true
80
90
  });
81
91
  watch(() => attrs.value, (n, o) => {
82
92
  if (o == null && n != null) {
@@ -85,10 +95,6 @@ const script = defineComponent({
85
95
  }, {
86
96
  immediate: true
87
97
  });
88
- const field = useField();
89
- const fieldKey = computed(() => {
90
- return field.value.props.name.toString();
91
- });
92
98
  const changeContextCollector = inject(InjectionChangeContextCollector);
93
99
  function update(v, option) {
94
100
  changeContextCollector == null ? void 0 : changeContextCollector.setContext(fieldKey.value, "currentOption", cloneDeep(option));
@@ -1,11 +1,12 @@
1
1
  import { ContextCollector } from 'cnhis-design-vue/es/packages/form-render/src/hooks/useChangeContext';
2
- import { BusinessCollector } from '../hooks';
2
+ import { BusinessCollector, FormItemDepsCollector } from '../hooks';
3
3
  import { FormAsyncQueue } from '../types';
4
4
  import { Component, InjectionKey } from 'vue';
5
5
  export declare const InjectAsyncQueue: InjectionKey<FormAsyncQueue>;
6
6
  export declare const InjectionSchemaField: InjectionKey<Component>;
7
7
  export declare const InjectionBusinessCollector: InjectionKey<BusinessCollector>;
8
8
  export declare const InjectionChangeContextCollector: InjectionKey<ContextCollector>;
9
+ export declare const InjectionFormItemDepsCollector: InjectionKey<FormItemDepsCollector>;
9
10
  export declare enum FIELD_BUSINESS_TYPE {
10
11
  PASSWORD = "password",
11
12
  ID_CARD = "id_card",
@@ -2,6 +2,7 @@ const InjectAsyncQueue = Symbol("InjectAsyncQueue");
2
2
  const InjectionSchemaField = Symbol("InjectionSchemaField");
3
3
  const InjectionBusinessCollector = Symbol("InjectionBusinessCollector");
4
4
  const InjectionChangeContextCollector = Symbol("InjectionChangeContextCollector");
5
+ const InjectionFormItemDepsCollector = Symbol("InjectionFormItemDepsCollector");
5
6
  var FIELD_BUSINESS_TYPE = /* @__PURE__ */ ((FIELD_BUSINESS_TYPE2) => {
6
7
  FIELD_BUSINESS_TYPE2["PASSWORD"] = "password";
7
8
  FIELD_BUSINESS_TYPE2["ID_CARD"] = "id_card";
@@ -24,4 +25,4 @@ var FIELD_SEX_VALUE = /* @__PURE__ */ ((FIELD_SEX_VALUE2) => {
24
25
  return FIELD_SEX_VALUE2;
25
26
  })(FIELD_SEX_VALUE || {});
26
27
 
27
- export { FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, InjectAsyncQueue, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionSchemaField };
28
+ export { FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, InjectAsyncQueue, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionSchemaField };
@@ -8,4 +8,4 @@ export * from './useTypeNormalize';
8
8
  export * from './useFormValidator';
9
9
  export * from './useBusinessBinding';
10
10
  export * from './useChangeContext';
11
- export * from './useUrlDeps';
11
+ export * from './useFormItemDeps';
@@ -8,4 +8,4 @@ export { useTypeNormalize } from './useTypeNormalize.mjs';
8
8
  export { useFormValidator } from './useFormValidator.mjs';
9
9
  export { BusinessCollector, useBusinessBinding } from './useBusinessBinding.mjs';
10
10
  export { ContextCollector, useChangeContext } from './useChangeContext.mjs';
11
- export { useUrlDeps } from './useUrlDeps.mjs';
11
+ export { FormItemDepsCollector, useFormItemDeps } from './useFormItemDeps.mjs';
@@ -6,8 +6,10 @@ export declare class BusinessCollector {
6
6
  collect(type: FIELD_BUSINESS_TYPE, fieldName: string): void;
7
7
  getField(type: FIELD_BUSINESS_TYPE): string[];
8
8
  getType(fieldName: string): FIELD_BUSINESS_TYPE | undefined;
9
+ handlerIdCardType(formModel: Form, value: unknown): void;
10
+ handlerMap: Map<FIELD_BUSINESS_TYPE, (formModel: Form, value: unknown) => void>;
11
+ trigger(formModel: Form, fieldName: string, value: unknown): void;
9
12
  }
10
13
  export declare function useBusinessBinding(): {
11
14
  create: () => BusinessCollector;
12
- trigger: (collector: BusinessCollector, formModel: Form, fieldName: string, value: unknown) => void;
13
15
  };
@@ -6,6 +6,7 @@ class BusinessCollector {
6
6
  constructor() {
7
7
  this.typeCollector = /* @__PURE__ */ new Map();
8
8
  this.fieldNameCollector = /* @__PURE__ */ new Map();
9
+ this.handlerMap = /* @__PURE__ */ new Map([[FIELD_BUSINESS_TYPE.ID_CARD, this.handlerIdCardType.bind(this)]]);
9
10
  }
10
11
  collect(type, fieldName) {
11
12
  const set = this.typeCollector.get(type) || /* @__PURE__ */ new Set();
@@ -19,42 +20,41 @@ class BusinessCollector {
19
20
  getType(fieldName) {
20
21
  return this.fieldNameCollector.get(fieldName);
21
22
  }
22
- }
23
- function useBusinessBinding() {
24
- function create() {
25
- return new BusinessCollector();
26
- }
27
- function handlerIdCardType(formModel, collector, value) {
23
+ handlerIdCardType(formModel, value) {
28
24
  if (!value || !isString(value) || !isIdCard(value))
29
25
  return;
30
26
  const info = parseIdCard(value);
31
- const ageFields = collector.getField(FIELD_BUSINESS_TYPE.AGE);
27
+ const ageFields = this.getField(FIELD_BUSINESS_TYPE.AGE);
32
28
  ageFields.forEach((field) => {
33
29
  formModel.setFieldState(field, (state) => {
34
30
  state.value = info.age;
35
31
  });
36
32
  });
37
- const sexFields = collector.getField(FIELD_BUSINESS_TYPE.SEX);
33
+ const sexFields = this.getField(FIELD_BUSINESS_TYPE.SEX);
38
34
  sexFields.forEach((field) => {
39
35
  formModel.setFieldState(field, (state) => {
40
36
  state.value = info.sex;
41
37
  });
42
38
  });
43
- const birthdayFields = collector.getField(FIELD_BUSINESS_TYPE.BIRTHDAY);
39
+ const birthdayFields = this.getField(FIELD_BUSINESS_TYPE.BIRTHDAY);
44
40
  birthdayFields.forEach((field) => {
45
41
  formModel.setFieldState(field, (state) => {
46
42
  state.value = info.birthday;
47
43
  });
48
44
  });
49
45
  }
50
- const handlerMap = /* @__PURE__ */ new Map([[FIELD_BUSINESS_TYPE.ID_CARD, handlerIdCardType]]);
51
- function trigger(collector, formModel, fieldName, value) {
52
- const type = collector.getType(fieldName);
53
- if (!type || !handlerMap.has(type))
46
+ trigger(formModel, fieldName, value) {
47
+ const type = this.getType(fieldName);
48
+ if (!type || !this.handlerMap.has(type))
54
49
  return;
55
- handlerMap.get(type)(formModel, collector, value);
50
+ this.handlerMap.get(type)(formModel, value);
51
+ }
52
+ }
53
+ function useBusinessBinding() {
54
+ function create() {
55
+ return new BusinessCollector();
56
56
  }
57
- return { create, trigger };
57
+ return { create };
58
58
  }
59
59
 
60
60
  export { BusinessCollector, useBusinessBinding };
@@ -1,4 +1,5 @@
1
1
  export declare function useFormField(): {
2
2
  field: import("vue").Ref<import("@formily/core").GeneralField>;
3
3
  title: import("vue").ComputedRef<any>;
4
+ fieldKey: import("vue").ComputedRef<string>;
4
5
  };
@@ -3,7 +3,13 @@ import { computed } from 'vue';
3
3
 
4
4
  function useFormField() {
5
5
  const field = useField();
6
- return { field, title: computed(() => field.value.title) };
6
+ return {
7
+ field,
8
+ title: computed(() => field.value.title),
9
+ fieldKey: computed(() => {
10
+ return field.value.props.name.toString();
11
+ })
12
+ };
7
13
  }
8
14
 
9
15
  export { useFormField };