cnhis-design-vue 3.1.15-beta.7 → 3.1.15

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 (66) hide show
  1. package/es/packages/big-table/src/hooks/useAnnotation.js +1 -2
  2. package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +7 -2
  3. package/es/packages/big-table/src/hooks/useEdit.js +16 -8
  4. package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
  5. package/es/packages/fabric-chart/src/hooks/useLeft.js +1 -2
  6. package/es/packages/form-config/index.d.ts +13854 -0
  7. package/es/packages/form-config/index.js +10 -0
  8. package/es/packages/form-config/src/FormConfig.js +113 -0
  9. package/es/packages/form-config/src/FormConfig.vue.d.ts +13856 -0
  10. package/es/packages/form-config/src/components/FormConfigCreator.js +97 -0
  11. package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +5094 -0
  12. package/es/packages/form-config/src/components/FormConfigEdit.js +81 -0
  13. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +5336 -0
  14. package/es/packages/form-config/src/constants/index.d.ts +28 -0
  15. package/es/packages/form-config/src/constants/index.js +28 -0
  16. package/es/packages/form-config/src/hooks/index.d.ts +2 -0
  17. package/es/packages/form-config/src/hooks/index.js +2 -0
  18. package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +6 -0
  19. package/es/packages/form-config/src/hooks/useConfigurationField.js +103 -0
  20. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +5 -0
  21. package/es/packages/form-config/src/hooks/usePresetRenderer.js +117 -0
  22. package/es/packages/form-config/src/hooks/useSortable.d.ts +11 -0
  23. package/es/packages/form-config/src/hooks/useSortable.js +31 -0
  24. package/es/packages/form-config/src/types/index.d.ts +18 -0
  25. package/es/packages/form-config/src/types/index.js +1 -0
  26. package/es/packages/form-config/style/index.css +108 -0
  27. package/es/packages/form-render/index.d.ts +3 -3
  28. package/es/packages/form-render/src/FormRender.vue.d.ts +3 -3
  29. package/es/packages/form-render/src/components/renderer/combination/index.js +3 -3
  30. package/es/packages/form-render/src/components/renderer/date.d.ts +2 -2
  31. package/es/packages/form-render/src/components/renderer/formItem.js +3 -3
  32. package/es/packages/form-render/src/components/renderer/select.js +16 -9
  33. package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
  34. package/es/packages/form-render/src/hooks/useAsyncQueue.js +4 -8
  35. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -3
  36. package/es/packages/form-render/src/hooks/useFormContext.js +10 -4
  37. package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +2 -2
  38. package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
  39. package/es/packages/form-render/src/types/index.d.ts +7 -3
  40. package/es/packages/form-render/src/utils/index.d.ts +3 -2
  41. package/es/packages/form-render/src/utils/index.js +30 -7
  42. package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +1 -1
  43. package/es/packages/index.css +108 -0
  44. package/es/packages/index.d.ts +4 -1
  45. package/es/packages/index.js +5 -2
  46. package/es/packages/scale-view/src/hooks/scaleview-init.js +35 -35
  47. package/es/packages/shortcut-provider/index.d.ts +17 -2
  48. package/es/packages/shortcut-provider/index.js +1 -1
  49. package/es/packages/shortcut-provider/src/ShortcutProvider.js +5 -1
  50. package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +17 -2
  51. package/es/packages/shortcut-provider/src/hooks/index.js +1 -1
  52. package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +10 -10
  53. package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +45 -38
  54. package/es/packages/shortcut-provider/src/types/index.d.ts +2 -19
  55. package/es/packages/shortcut-setter/index.d.ts +1701 -4286
  56. package/es/packages/shortcut-setter/src/ShortcutSetter.js +63 -10
  57. package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +1723 -4306
  58. package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +26 -95
  59. package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +30 -3363
  60. package/es/packages/shortcut-setter/src/types/index.d.ts +6 -0
  61. package/es/packages/shortcut-setter/src/types/index.js +1 -0
  62. package/es/src/utils/state.d.ts +29 -0
  63. package/es/src/utils/state.js +44 -0
  64. package/package.json +2 -1
  65. package/es/packages/shortcut-setter/constant/index.d.ts +0 -4
  66. package/es/packages/shortcut-setter/constant/index.js +0 -7
@@ -0,0 +1,28 @@
1
+ import { WithUndefined } from '../../../../../es/src/types';
2
+ import { InjectionKey, Ref } from 'vue';
3
+ import { FieldItem } from '../../../../../es/packages/form-render';
4
+ export declare const WidgetTextMap: {
5
+ INPUT: string;
6
+ SELECT: string;
7
+ TEXTAREA: string;
8
+ CASCADER: string;
9
+ SWITCH: string;
10
+ RADIO: string;
11
+ TEXT: string;
12
+ BUTTON: string;
13
+ CHECKBOX: string;
14
+ LINEBAR: string;
15
+ LINE_BREAKS: string;
16
+ };
17
+ export declare enum EditAbleField {
18
+ ALIAS = "alias",
19
+ TIP = "tip",
20
+ DEFAULT_VAL = "default_val",
21
+ ELEM_WIDTH = "elem_width",
22
+ PLACEHOLDER = "placeholder",
23
+ IS_SHOW = "is_show",
24
+ IS_NOT_FOLD = "is_not_fold",
25
+ IS_NULL = "is_null",
26
+ IS_EDIT = "is_edit"
27
+ }
28
+ export declare const InjectionActiveFieldItem: InjectionKey<Ref<WithUndefined<FieldItem>>>;
@@ -0,0 +1,28 @@
1
+ const WidgetTextMap = {
2
+ INPUT: "\u8F93\u5165\u6846",
3
+ SELECT: "\u4E0B\u62C9\u6846",
4
+ TEXTAREA: "\u6587\u672C\u57DF",
5
+ CASCADER: "\u7EA7\u8054\u4E0B\u62C9\u6846",
6
+ SWITCH: "\u5F00\u5173",
7
+ RADIO: "\u5355\u9009",
8
+ TEXT: "\u6587\u672C",
9
+ BUTTON: "\u6309\u94AE",
10
+ CHECKBOX: "\u591A\u9009",
11
+ LINEBAR: "\u5206\u884C\u7B26",
12
+ LINE_BREAKS: "\u5206\u7EBF\u680F"
13
+ };
14
+ var EditAbleField = /* @__PURE__ */ ((EditAbleField2) => {
15
+ EditAbleField2["ALIAS"] = "alias";
16
+ EditAbleField2["TIP"] = "tip";
17
+ EditAbleField2["DEFAULT_VAL"] = "default_val";
18
+ EditAbleField2["ELEM_WIDTH"] = "elem_width";
19
+ EditAbleField2["PLACEHOLDER"] = "placeholder";
20
+ EditAbleField2["IS_SHOW"] = "is_show";
21
+ EditAbleField2["IS_NOT_FOLD"] = "is_not_fold";
22
+ EditAbleField2["IS_NULL"] = "is_null";
23
+ EditAbleField2["IS_EDIT"] = "is_edit";
24
+ return EditAbleField2;
25
+ })(EditAbleField || {});
26
+ const InjectionActiveFieldItem = Symbol("InjectionActiveFieldItem");
27
+
28
+ export { EditAbleField, InjectionActiveFieldItem, WidgetTextMap };
@@ -0,0 +1,2 @@
1
+ export * from './usePresetRenderer';
2
+ export * from './useSortable';
@@ -0,0 +1,2 @@
1
+ export { usePresetRenderer } from './usePresetRenderer.js';
2
+ export { useSortable } from './useSortable.js';
@@ -0,0 +1,6 @@
1
+ import { EditAbleField } from '../../../../../es/packages/form-config/src/constants';
2
+ import { FieldItem } from '../../../../../es/packages/form-render';
3
+ export declare function useConfigurationField(): {
4
+ generateFieldListByKeys: (keyList: EditAbleField[]) => FieldItem[];
5
+ generateFieldListByFieldItem: (fieldItem: FieldItem) => FieldItem[];
6
+ };
@@ -0,0 +1,103 @@
1
+ import { EditAbleField } from '../../../../packages/form-config/src/constants';
2
+
3
+ function useConfigurationField() {
4
+ const fieldMap = /* @__PURE__ */ new Map([
5
+ [EditAbleField.ALIAS, { alias: "\u540D\u79F0", elem_width: 12, is_null: "0", val_key: "alias", html_type: "INPUT" }],
6
+ [EditAbleField.TIP, { alias: "\u95EE\u53F7\u63D0\u793A", elem_width: 12, val_key: "tip", html_type: "INPUT" }],
7
+ [
8
+ EditAbleField.DEFAULT_VAL,
9
+ { alias: "\u9ED8\u8BA4\u503C", val_key: "default_val", elem_width: 12, html_type: "INPUT", validate: { max_length: 20 } }
10
+ ],
11
+ [
12
+ EditAbleField.ELEM_WIDTH,
13
+ {
14
+ alias: "\u5BBD\u5EA6",
15
+ fieldType: "number",
16
+ val_key: "elem_width",
17
+ html_type: "SELECT",
18
+ elem_width: 12,
19
+ option: [
20
+ { text: "\u6574\u884C", value: 12 },
21
+ { text: "\u534A\u884C", value: 6 },
22
+ { text: "5/6", value: 10 },
23
+ { text: "2/3", value: 8 },
24
+ { text: "1/3", value: 4 },
25
+ { text: "3/4", value: 9 },
26
+ { text: "1/4", value: 3 },
27
+ { text: "1/6", value: 2 }
28
+ ]
29
+ }
30
+ ],
31
+ [
32
+ EditAbleField.PLACEHOLDER,
33
+ { alias: "\u8BF4\u660E\u6587\u672C", elem_width: 12, val_key: "placeholder", html_type: "INPUT", validate: { max_length: 30 } }
34
+ ],
35
+ [
36
+ EditAbleField.IS_SHOW,
37
+ {
38
+ val_key: "is_show",
39
+ alias: "\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00",
40
+ html_type: "SWITCH",
41
+ elem_width: 12,
42
+ open: { describe: "\u9ED8\u8BA4\u5C55\u5F00", value: "1" },
43
+ close: { describe: "\u9ED8\u8BA4\u6536\u8D77", value: "0" }
44
+ }
45
+ ],
46
+ [
47
+ EditAbleField.IS_NOT_FOLD,
48
+ {
49
+ val_key: "is_not_fold",
50
+ alias: "\u662F\u5426\u53EF\u6298\u53E0",
51
+ html_type: "SWITCH",
52
+ elem_width: 12,
53
+ open: { describe: "\u53EF\u6298\u53E0", value: "0" },
54
+ close: { describe: "\u4E0D\u53EF\u6298\u53E0", value: "1" }
55
+ }
56
+ ],
57
+ [
58
+ EditAbleField.IS_EDIT,
59
+ {
60
+ val_key: "is_edit",
61
+ alias: "\u662F\u5426\u53EF\u7F16\u8F91",
62
+ html_type: "SWITCH",
63
+ elem_width: 12,
64
+ open: { describe: "\u53EF\u7F16\u8F91", value: "1" },
65
+ close: { describe: "\u4E0D\u53EF\u7F16\u8F91", value: "0" }
66
+ }
67
+ ],
68
+ [
69
+ EditAbleField.IS_NULL,
70
+ {
71
+ val_key: "is_null",
72
+ alias: "\u662F\u5426\u5FC5\u586B",
73
+ html_type: "SWITCH",
74
+ elem_width: 12,
75
+ open: { describe: "\u5FC5\u586B", value: "0" },
76
+ close: { describe: "\u4E0D\u5FC5\u586B", value: "1" }
77
+ }
78
+ ]
79
+ ]);
80
+ function generateFieldListByKeys(keyList) {
81
+ return keyList.map((key) => fieldMap.get(key));
82
+ }
83
+ function generateFieldListByFieldItem(fieldItem) {
84
+ const htmlMap = new Map([
85
+ ["LINEBAR", [EditAbleField.ALIAS, EditAbleField.ELEM_WIDTH, EditAbleField.IS_SHOW, EditAbleField.IS_NOT_FOLD]],
86
+ ...["LINE_BREAKS", "COMPLEX", "COMBINATION"].map((key) => [key, [EditAbleField.ALIAS, EditAbleField.ELEM_WIDTH]])
87
+ ]);
88
+ const defaultItems = [
89
+ EditAbleField.ALIAS,
90
+ EditAbleField.DEFAULT_VAL,
91
+ EditAbleField.ELEM_WIDTH,
92
+ EditAbleField.PLACEHOLDER,
93
+ EditAbleField.TIP,
94
+ EditAbleField.IS_EDIT,
95
+ EditAbleField.IS_NULL
96
+ ];
97
+ const keys = htmlMap.get(fieldItem.html_type) || defaultItems;
98
+ return generateFieldListByKeys(keys);
99
+ }
100
+ return { generateFieldListByKeys, generateFieldListByFieldItem };
101
+ }
102
+
103
+ export { useConfigurationField };
@@ -0,0 +1,5 @@
1
+ import { FieldItem } from '../../../../../es/packages/form-render';
2
+ import { FormConfigTextFormatter } from '../types';
3
+ export declare function usePresetRenderer(textFormatter: FormConfigTextFormatter): {
4
+ getRenderer: (fieldItem: FieldItem) => import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>;
5
+ };
@@ -0,0 +1,117 @@
1
+ import { defineComponent, computed, createVNode, mergeProps, inject } from 'vue';
2
+ import { isString, isArray, isFunction } from 'lodash-es';
3
+ import Draggable from 'vuedraggable';
4
+ import { InjectionActiveFieldItem, WidgetTextMap } from '../../../../packages/form-config/src/constants';
5
+ import { useSortable } from '../../../../packages/form-config/src/hooks';
6
+ import { NEllipsis } from 'naive-ui';
7
+
8
+ function usePresetRenderer(textFormatter) {
9
+ const renderDefaultNode = {
10
+ matcher: () => true,
11
+ renderer({
12
+ fieldItem
13
+ }) {
14
+ const currentActiveEditField = inject(InjectionActiveFieldItem);
15
+ return createVNode("section", {
16
+ "onClick": () => currentActiveEditField.value = fieldItem,
17
+ "class": {
18
+ "is-active": currentActiveEditField.value === fieldItem
19
+ }
20
+ }, [createVNode(NEllipsis, {
21
+ "class": ["form-config__renderer--default", {
22
+ "is-required": fieldItem.is_null === "0",
23
+ "is-disabled": fieldItem.is_edit === "0"
24
+ }]
25
+ }, {
26
+ default: () => getDisplayText()
27
+ })]);
28
+ function getDisplayText() {
29
+ return textFormatter(fieldItem, `${fieldItem.alias}(${WidgetTextMap[fieldItem.html_type] || "\u63A7\u4EF6"})`);
30
+ }
31
+ }
32
+ };
33
+ const renderComplexNode = {
34
+ matcher: ["COMPLEX", "COMBINATION"],
35
+ renderer: defineComponent({
36
+ props: {
37
+ fieldItem: {
38
+ type: Object,
39
+ required: true
40
+ }
41
+ },
42
+ setup(props) {
43
+ function fieldFor(key) {
44
+ return props.fieldItem[key];
45
+ }
46
+ const classList = computed(() => {
47
+ return `form-config__renderer--complex form-config__renderer--complex--${fieldFor("display") || "grid"}`;
48
+ });
49
+ const style = computed(() => {
50
+ return {
51
+ "--item-column": fieldFor("elem_width"),
52
+ ...fieldFor("wrapperStyle")
53
+ };
54
+ });
55
+ function renderField(fieldItem) {
56
+ const Renderer = getRenderer(fieldItem);
57
+ return createVNode("div", {
58
+ "class": "form-config__displayContentItem",
59
+ "style": {
60
+ "--item-column": fieldItem.elem_width
61
+ }
62
+ }, [createVNode(Renderer, {
63
+ "fieldItem": fieldItem
64
+ }, null)]);
65
+ }
66
+ const childrenList = computed({
67
+ get() {
68
+ return fieldFor("html_type") === "COMBINATION" ? fieldFor("children") : fieldFor("properties");
69
+ },
70
+ set(v) {
71
+ if (fieldFor("html_type") === "COMBINATION") {
72
+ props.fieldItem.children = v;
73
+ } else {
74
+ props.fieldItem.properties = v;
75
+ }
76
+ }
77
+ });
78
+ const {
79
+ commonConfig
80
+ } = useSortable();
81
+ const DraggableComponent = Draggable;
82
+ return () => createVNode(DraggableComponent, mergeProps(commonConfig, {
83
+ "class": classList.value,
84
+ "style": style.value,
85
+ "group": fieldFor("val_key"),
86
+ "modelValue": childrenList.value,
87
+ "onUpdate:modelValue": ($event) => childrenList.value = $event
88
+ }), {
89
+ item: ({
90
+ element
91
+ }) => renderField(element)
92
+ });
93
+ }
94
+ })
95
+ };
96
+ const rendererWithPreset = computed(() => {
97
+ return [renderComplexNode, renderDefaultNode];
98
+ });
99
+ function getRenderer(fieldItem) {
100
+ return rendererWithPreset.value.find(({
101
+ matcher
102
+ }) => {
103
+ if (isString(matcher))
104
+ return matcher === fieldItem.html_type;
105
+ if (isArray(matcher))
106
+ return matcher.includes(fieldItem.html_type);
107
+ if (isFunction(matcher))
108
+ return matcher(fieldItem.html_type);
109
+ return matcher.test(fieldItem.html_type);
110
+ }).renderer;
111
+ }
112
+ return {
113
+ getRenderer
114
+ };
115
+ }
116
+
117
+ export { usePresetRenderer };
@@ -0,0 +1,11 @@
1
+ import Sortable from 'sortablejs';
2
+ export declare function useSortable(): {
3
+ commonConfig: {
4
+ onMove: ({ to, from }: Sortable.SortableEvent) => void;
5
+ onChoose: ({ target, item }: Sortable.SortableEvent) => void;
6
+ onUnchoose: ({ from, to, target, item }: Sortable.SortableEvent) => void;
7
+ tag: string;
8
+ animation: string;
9
+ 'item-key': string;
10
+ };
11
+ };
@@ -0,0 +1,31 @@
1
+ function useSortable() {
2
+ let timer = null;
3
+ function onChoose({ target, item }) {
4
+ timer = setTimeout(() => {
5
+ target.classList.add("is-choosing-area");
6
+ item.classList.add("is-choosing");
7
+ }, 200);
8
+ }
9
+ function onUnchoose({ from, to, target, item }) {
10
+ clearTimeout(timer);
11
+ [from, to, target].forEach((ele) => {
12
+ ele.classList.remove("is-choosing-area");
13
+ });
14
+ item.classList.remove("is-choosing");
15
+ }
16
+ let prevTo;
17
+ function onMove({ to, from }) {
18
+ if (to === from) {
19
+ prevTo == null ? void 0 : prevTo.classList.remove("is-choosing-area");
20
+ prevTo = null;
21
+ } else {
22
+ from.classList.remove("is-choosing-area");
23
+ prevTo = to;
24
+ }
25
+ to.classList.add("is-choosing-area");
26
+ }
27
+ const commonConfig = { onMove, onChoose, onUnchoose, tag: "section", animation: "150", "item-key": "val_key" };
28
+ return { commonConfig };
29
+ }
30
+
31
+ export { useSortable };
@@ -0,0 +1,18 @@
1
+ import { Component, FunctionalComponent } from 'vue';
2
+ import { ArrayAble } from '../../../../../es/src/types';
3
+ import { FieldItem } from '../../../../../es/packages/form-render';
4
+ interface Matcher {
5
+ (type: string): boolean;
6
+ }
7
+ export declare type FormConfigRenderer = {
8
+ matcher: ArrayAble<string> | RegExp | Matcher;
9
+ renderer: Component | FunctionalComponent;
10
+ };
11
+ export interface FormConfigTextFormatter {
12
+ (fieldItem: FieldItem, parsedText: string): string;
13
+ }
14
+ export interface FormConfigExpose {
15
+ loadData(payload: Record<'fieldList' | 'materialList', FieldItem[]>): void;
16
+ getData(): Record<'fieldList' | 'materialList', FieldItem[]>;
17
+ }
18
+ export {};
@@ -0,0 +1,108 @@
1
+ .form-config {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ }
5
+ .form-config__material {
6
+ padding: 16px;
7
+ box-sizing: border-box;
8
+ width: 200px;
9
+ background: white;
10
+ }
11
+ .form-config__materialHeader {
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ height: 40px;
16
+ }
17
+ .form-config__materialContent {
18
+ padding: 8px;
19
+ min-height: 400px;
20
+ display: flex;
21
+ flex-direction: column;
22
+ gap: 8px;
23
+ }
24
+ .form-config__materialContentItem {
25
+ display: flex;
26
+ align-items: center;
27
+ padding: 8px;
28
+ border: 1px dashed #d9d9d9;
29
+ box-sizing: border-box;
30
+ background-color: #fafafa;
31
+ grid-column: span var(--item-column) / span var(--item-column);
32
+ }
33
+ .form-config__displayWrapper {
34
+ padding: 16px;
35
+ box-sizing: border-box;
36
+ flex: 1;
37
+ padding: 16px 0;
38
+ }
39
+ .form-config__displayHeader {
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: space-between;
43
+ height: 40px;
44
+ }
45
+ .form-config__displayContent {
46
+ padding: 16px;
47
+ box-sizing: border-box;
48
+ height: fit-content;
49
+ background: #eeeeee;
50
+ display: grid !important;
51
+ grid-template-columns: repeat(12, minmax(0px, 1fr));
52
+ gap: 8px 16px;
53
+ }
54
+ .form-config__displayContentItem {
55
+ grid-column: span var(--item-column) / span var(--item-column);
56
+ position: relative;
57
+ }
58
+ .form-config__config {
59
+ padding: 16px;
60
+ box-sizing: border-box;
61
+ width: 220px;
62
+ background: white;
63
+ }
64
+ .form-config__renderer--default {
65
+ display: flex;
66
+ align-items: center;
67
+ padding: 8px;
68
+ border: 1px dashed #d9d9d9;
69
+ box-sizing: border-box;
70
+ background-color: #fafafa;
71
+ user-select: none;
72
+ position: relative;
73
+ width: 100%;
74
+ }
75
+ .form-config__renderer--complex {
76
+ border: 1px dashed lightblue;
77
+ padding: 8px;
78
+ }
79
+ .form-config__renderer--complex--grid {
80
+ display: grid !important;
81
+ grid-template-columns: repeat(12, minmax(0px, 1fr));
82
+ gap: 8px 16px;
83
+ grid-column: span var(--item-column) / span var(--item-column);
84
+ }
85
+ .form-config__renderer--complex--flex {
86
+ display: flex;
87
+ }
88
+ .form-config .is-disabled {
89
+ background: #e5e5e5;
90
+ }
91
+ .form-config .is-required {
92
+ padding-left: 16px !important;
93
+ }
94
+ .form-config .is-required::before {
95
+ position: absolute;
96
+ content: '*';
97
+ left: 8px;
98
+ color: red;
99
+ }
100
+ .form-config .is-active {
101
+ color: #5585f5;
102
+ }
103
+ .form-config .is-choosing {
104
+ box-shadow: #5585f5 0 0 0 2px !important;
105
+ }
106
+ .form-config .is-choosing-area {
107
+ background: #f0f7ff;
108
+ }
@@ -113,7 +113,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
113
113
  type: import("vue").PropType<Partial<{
114
114
  onSetup(): void;
115
115
  beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
116
- afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
116
+ afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
117
117
  }>>;
118
118
  };
119
119
  }, {
@@ -228,7 +228,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
228
228
  type: import("vue").PropType<Partial<{
229
229
  onSetup(): void;
230
230
  beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
231
- afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
231
+ afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
232
232
  }>>;
233
233
  };
234
234
  }>> & {
@@ -1730,7 +1730,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
1730
1730
  type: import("vue").PropType<Partial<{
1731
1731
  onSetup(): void;
1732
1732
  beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
1733
- afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
1733
+ afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
1734
1734
  }>>;
1735
1735
  };
1736
1736
  }>> & {
@@ -113,7 +113,7 @@ declare const _default: import("vue").DefineComponent<{
113
113
  type: PropType<Partial<{
114
114
  onSetup(): void;
115
115
  beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
116
- afterRequest(fieldKey: string, payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
116
+ afterRequest(fieldKey: string, payload?: any): AnyObject[];
117
117
  }>>;
118
118
  };
119
119
  }, {
@@ -228,7 +228,7 @@ declare const _default: import("vue").DefineComponent<{
228
228
  type: PropType<Partial<{
229
229
  onSetup(): void;
230
230
  beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
231
- afterRequest(fieldKey: string, payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
231
+ afterRequest(fieldKey: string, payload?: any): AnyObject[];
232
232
  }>>;
233
233
  };
234
234
  }>> & {
@@ -1730,7 +1730,7 @@ declare const _default: import("vue").DefineComponent<{
1730
1730
  type: PropType<Partial<{
1731
1731
  onSetup(): void;
1732
1732
  beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
1733
- afterRequest(fieldKey: string, payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
1733
+ afterRequest(fieldKey: string, payload?: any): AnyObject[];
1734
1734
  }>>;
1735
1735
  };
1736
1736
  }>> & {
@@ -37,20 +37,20 @@ const script = defineComponent({
37
37
  const emitChange = useDebounceFn(function emitChange2() {
38
38
  emit("update:value", JSON.stringify(combinationData.value));
39
39
  }, 300);
40
- const combinationData = ref([{}]);
40
+ const combinationData = ref([]);
41
41
  const currentGroupNum = computed(() => combinationData.value.length);
42
42
  function setCombinationData(data, withInitialData = false) {
43
43
  const parsedData = getParsedData(data);
44
44
  if (!needLoad(parsedData))
45
45
  return;
46
46
  parsedData.splice(maxGroupNum.value);
47
- parsedData.forEach(setCombinationData2);
47
+ parsedData.forEach(setCombinationItemData);
48
48
  combinationData.value.splice(parsedData.length);
49
49
  combinationData.value.forEach(setFormRenderData);
50
50
  function needLoad(_data) {
51
51
  return !!_data && !isEqual(_data, combinationData.value);
52
52
  }
53
- function setCombinationData2(v, idx) {
53
+ function setCombinationItemData(v, idx) {
54
54
  if (!isObject(v))
55
55
  return;
56
56
  combinationData.value[idx] = v;
@@ -5,7 +5,7 @@ export declare const DATE: import("vue").DefineComponent<{
5
5
  validate: {
6
6
  type: PropType<Partial<{
7
7
  [key: string]: any;
8
- obj_type: "password" | "sex" | "age" | "email" | "birthday" | "id_card" | "age_unit" | "mobile" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
8
+ obj_type: "password" | "sex" | "age" | "email" | "id_card" | "age_unit" | "mobile" | "telephone" | "birthday" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
9
9
  vali_obj: string;
10
10
  max_value: string | number;
11
11
  min_value: string | number;
@@ -22,7 +22,7 @@ export declare const DATE: import("vue").DefineComponent<{
22
22
  validate: {
23
23
  type: PropType<Partial<{
24
24
  [key: string]: any;
25
- obj_type: "password" | "sex" | "age" | "email" | "birthday" | "id_card" | "age_unit" | "mobile" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
25
+ obj_type: "password" | "sex" | "age" | "email" | "id_card" | "age_unit" | "mobile" | "telephone" | "birthday" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
26
26
  vali_obj: string;
27
27
  max_value: string | number;
28
28
  min_value: string | number;
@@ -1,7 +1,6 @@
1
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 { isBoolean } from 'lodash-es';
5
4
  import { NFormItem } from 'naive-ui';
6
5
  import AnnotationEdit from '../../../../../packages/annotation-edit';
7
6
  import { InjectionAnnotation } from '../../../../../packages/form-render/src/constants';
@@ -18,7 +17,8 @@ const script = defineComponent({
18
17
  const annotation = inject(InjectionAnnotation);
19
18
  const annotationContent = computed({
20
19
  get() {
21
- return annotation.value[props.propertyKey];
20
+ var _a, _b;
21
+ return (_b = (_a = annotation.value) == null ? void 0 : _a[props.propertyKey]) != null ? _b : "";
22
22
  },
23
23
  set(value) {
24
24
  annotation.value = {
@@ -35,7 +35,7 @@ const script = defineComponent({
35
35
  }, null);
36
36
  }
37
37
  const showAnnotation = computed(() => {
38
- return annotation.value && (!isBoolean(props.annotation) || props.annotation);
38
+ return annotation.value && props.annotation !== false;
39
39
  });
40
40
  const showLabel = computed(() => props.label && props.label !== " ");
41
41
  function renderLabel() {
@@ -51,7 +51,6 @@ const script = defineComponent({
51
51
  emit("update:value", v);
52
52
  }
53
53
  const {
54
- title,
55
54
  field,
56
55
  fieldKey
57
56
  } = useFormField();
@@ -64,16 +63,23 @@ const script = defineComponent({
64
63
  if (remoteOptions.value)
65
64
  return;
66
65
  remoteOptions.value = await asyncQueue.addAsync({
67
- ...createParams(configFor(props), field.value, fieldKey.value)
66
+ ...await createParams(configFor(props), field.value, fieldKey.value)
68
67
  });
69
- function createParams(config, field2, key) {
68
+ async function createParams(config, field2, key) {
70
69
  const _params = {};
71
- traverseDependKey(config.dependKey, (dependKey, valueKey2) => {
72
- const _field = field2.query(dependKey).take();
73
- if (isField(_field)) {
74
- _params[valueKey2] = _field.value;
75
- }
76
- });
70
+ try {
71
+ traverseDependKey(config.dependKey, (dependKey, valueKey2, required) => {
72
+ const _field = field2.query(dependKey).take();
73
+ if (isField(_field)) {
74
+ if (required && _field.value == null) {
75
+ throw `\u7F3A\u5C11\u5FC5\u987B\u7684\u53C2\u6570=>${dependKey}`;
76
+ }
77
+ _params[valueKey2] = _field.value;
78
+ }
79
+ });
80
+ } catch (e) {
81
+ return Promise.reject(e);
82
+ }
77
83
  return {
78
84
  ...config,
79
85
  params: Object.assign({}, config.params, _params),
@@ -106,6 +112,7 @@ const script = defineComponent({
106
112
  formItemDepsCollector.setDeps(fieldKey.value, config.dependKey || [], async () => {
107
113
  remoteOptions.value = null;
108
114
  emit("update:value", null);
115
+ !props.lazyRequest && await fetchData();
109
116
  });
110
117
  (props.value || !props.lazyRequest) && fetchData();
111
118
  }, {
@@ -1,8 +1,8 @@
1
1
  import { AnyObject, WithUndefined } from '../../../../../es/src/types';
2
2
  import { FormAsyncQueueItem } from '../types';
3
3
  declare type ProcessorOption = Partial<{
4
- afterRequest(key: string, payload?: AnyObject[]): WithUndefined<AnyObject[]> | void;
5
- beforeRequest(key: string, params?: AnyObject): WithUndefined<AnyObject> | void;
4
+ afterRequest(key: string, payload?: unknown): AnyObject[];
5
+ beforeRequest(key: string, params?: unknown): WithUndefined<AnyObject> | void;
6
6
  }>;
7
7
  interface EntryCallback {
8
8
  (err?: any, result?: any): void;