cnhis-design-vue 3.1.15-beta.6 → 3.1.15-beta.9

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 (43) hide show
  1. package/es/packages/form-config/index.d.ts +12105 -0
  2. package/es/packages/form-config/index.js +10 -0
  3. package/es/packages/form-config/src/FormConfig.js +113 -0
  4. package/es/packages/form-config/src/FormConfig.vue.d.ts +12107 -0
  5. package/es/packages/form-config/src/components/FormConfigCreator.js +97 -0
  6. package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +5094 -0
  7. package/es/packages/form-config/src/components/FormConfigEdit.js +81 -0
  8. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +3589 -0
  9. package/es/packages/form-config/src/constants/index.d.ts +28 -0
  10. package/es/packages/form-config/src/constants/index.js +28 -0
  11. package/es/packages/form-config/src/hooks/index.d.ts +2 -0
  12. package/es/packages/form-config/src/hooks/index.js +2 -0
  13. package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +6 -0
  14. package/es/packages/form-config/src/hooks/useConfigurationField.js +103 -0
  15. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +5 -0
  16. package/es/packages/form-config/src/hooks/usePresetRenderer.js +117 -0
  17. package/es/packages/form-config/src/hooks/useSortable.d.ts +11 -0
  18. package/es/packages/form-config/src/hooks/useSortable.js +31 -0
  19. package/es/packages/form-config/src/types/index.d.ts +18 -0
  20. package/es/packages/form-config/src/types/index.js +1 -0
  21. package/es/packages/form-config/style/index.css +108 -0
  22. package/es/packages/form-render/index.d.ts +6 -6
  23. package/es/packages/form-render/src/FormRender.vue.d.ts +6 -6
  24. package/es/packages/form-render/src/components/renderer/formItem.js +2 -1
  25. package/es/packages/form-render/src/components/renderer/select.js +16 -9
  26. package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
  27. package/es/packages/form-render/src/hooks/useAsyncQueue.js +6 -10
  28. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +2 -1
  29. package/es/packages/form-render/src/hooks/useFormContext.js +12 -6
  30. package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +4 -4
  31. package/es/packages/form-render/src/types/index.d.ts +8 -4
  32. package/es/packages/form-render/src/utils/index.d.ts +2 -2
  33. package/es/packages/form-render/src/utils/index.js +22 -6
  34. package/es/packages/index.css +108 -0
  35. package/es/packages/index.d.ts +3 -1
  36. package/es/packages/index.js +4 -1
  37. package/es/packages/shortcut-setter/index.d.ts +8 -8
  38. package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +8 -8
  39. package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +1 -1
  40. package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +2 -2
  41. package/es/src/utils/state.d.ts +29 -0
  42. package/es/src/utils/state.js +44 -0
  43. package/package.json +2 -1
@@ -0,0 +1,97 @@
1
+ import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, createTextVNode } from 'vue';
2
+ import { NButtonGroup, NPopconfirm, NButton } from 'naive-ui';
3
+ import { EditAbleField } from '../../../../packages/form-config/src/constants';
4
+ import { useConfigurationField } from '../../../../packages/form-config/src/hooks/useConfigurationField';
5
+ import '../../../index.js';
6
+ import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
7
+ import FormRender from '../../../form-render/index.js';
8
+
9
+ const _hoisted_1 = /* @__PURE__ */ createTextVNode("\u65B0\u5EFA\u5206\u884C\u7B26");
10
+ const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u65B0\u5EFA\u5206\u7EBF\u680F");
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ __name: "FormConfigCreator",
13
+ emits: {
14
+ submit: (payload) => payload
15
+ },
16
+ setup(__props, { emit }) {
17
+ const linebarField = useConfigurationField().generateFieldListByKeys([
18
+ EditAbleField.ALIAS,
19
+ EditAbleField.ELEM_WIDTH,
20
+ EditAbleField.IS_SHOW,
21
+ EditAbleField.IS_NOT_FOLD
22
+ ]);
23
+ const linebarFormRef = ref();
24
+ const lineBreakFormRef = ref();
25
+ const initialData = { is_show: "1", is_not_fold: "0" };
26
+ async function submit(html_type, formRef) {
27
+ if (!formRef)
28
+ return;
29
+ await formRef.validate();
30
+ const formData = formRef.getFormValues();
31
+ emit("submit", { ...formData, html_type, val_key: formData.alias, elem_width: 12 });
32
+ }
33
+ return (_ctx, _cache) => {
34
+ return openBlock(), createBlock(unref(NButtonGroup), { size: "small" }, {
35
+ default: withCtx(() => [
36
+ createVNode(unref(NPopconfirm), {
37
+ width: "200px",
38
+ "show-icon": false,
39
+ "show-arrow": false,
40
+ onPositiveClick: _cache[0] || (_cache[0] = ($event) => submit("LINE_BREAKS", lineBreakFormRef.value))
41
+ }, {
42
+ trigger: withCtx(() => [
43
+ createVNode(unref(NButton), null, {
44
+ default: withCtx(() => [
45
+ _hoisted_1
46
+ ]),
47
+ _: 1
48
+ })
49
+ ]),
50
+ default: withCtx(() => [
51
+ createVNode(unref(FormRender), {
52
+ ref_key: "lineBreakFormRef",
53
+ ref: lineBreakFormRef,
54
+ size: "small",
55
+ "label-width": "auto",
56
+ "label-placement": "left",
57
+ fieldList: unref(linebarField).slice(0, 1)
58
+ }, null, 8, ["fieldList"])
59
+ ]),
60
+ _: 1
61
+ }),
62
+ createVNode(unref(NPopconfirm), {
63
+ width: "300px",
64
+ "show-icon": false,
65
+ "show-arrow": false,
66
+ onPositiveClick: _cache[1] || (_cache[1] = ($event) => submit("LINEBAR", linebarFormRef.value))
67
+ }, {
68
+ trigger: withCtx(() => [
69
+ createVNode(unref(NButton), null, {
70
+ default: withCtx(() => [
71
+ _hoisted_2
72
+ ]),
73
+ _: 1
74
+ })
75
+ ]),
76
+ default: withCtx(() => [
77
+ createVNode(unref(FormRender), {
78
+ ref_key: "linebarFormRef",
79
+ ref: linebarFormRef,
80
+ "initial-data": initialData,
81
+ size: "small",
82
+ "label-width": "auto",
83
+ "label-placement": "left",
84
+ fieldList: unref(linebarField)
85
+ }, null, 8, ["fieldList"])
86
+ ]),
87
+ _: 1
88
+ })
89
+ ]),
90
+ _: 1
91
+ });
92
+ };
93
+ }
94
+ });
95
+ var FormConfigCreator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "FormConfigCreator.vue"]]);
96
+
97
+ export { FormConfigCreator as default };