cnhis-design-vue 3.1.17-beta.1 → 3.1.17-beta.4

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 (41) hide show
  1. package/es/packages/form-config/index.d.ts +8282 -6776
  2. package/es/packages/form-config/src/FormConfig.js +23 -26
  3. package/es/packages/form-config/src/FormConfig.vue.d.ts +8283 -6777
  4. package/es/packages/form-config/src/components/FormConfigCreator.js +3 -3
  5. package/es/packages/form-config/src/components/FormConfigDragDisplay.js +42 -0
  6. package/es/packages/form-config/src/components/FormConfigDragDisplay.vue.d.ts +106 -0
  7. package/es/packages/form-config/src/components/FormConfigEdit.js +1 -1
  8. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +2 -0
  9. package/es/packages/form-config/src/components/index.d.ts +5 -0
  10. package/es/packages/form-config/src/components/index.js +6 -0
  11. package/es/packages/form-config/src/components/renderer/CloseButton.js +45 -0
  12. package/es/packages/form-config/src/components/renderer/CloseButton.vue.d.ts +1499 -0
  13. package/es/packages/form-config/src/components/renderer/ComplexNode.js +44 -0
  14. package/es/packages/form-config/src/components/renderer/ComplexNode.vue.d.ts +1641 -0
  15. package/es/packages/form-config/src/components/renderer/DefaultNode.js +59 -0
  16. package/es/packages/form-config/src/components/renderer/DefaultNode.vue.d.ts +3266 -0
  17. package/es/packages/form-config/src/components/renderer/index.d.ts +4 -0
  18. package/es/packages/form-config/src/components/renderer/index.js +3 -0
  19. package/es/packages/form-config/src/constants/index.d.ts +2 -0
  20. package/es/packages/form-config/src/constants/index.js +5 -2
  21. package/es/packages/form-config/src/hooks/index.d.ts +1 -1
  22. package/es/packages/form-config/src/hooks/index.js +1 -1
  23. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -2
  24. package/es/packages/form-config/src/hooks/usePresetRenderer.js +5 -84
  25. package/es/packages/form-config/src/hooks/{useSortable.d.ts → useSortalbeConfig.d.ts} +2 -2
  26. package/es/packages/form-config/src/hooks/{useSortable.js → useSortalbeConfig.js} +7 -11
  27. package/es/packages/form-config/src/types/index.d.ts +2 -1
  28. package/es/packages/form-config/src/utils/index.d.ts +6 -1
  29. package/es/packages/form-config/src/utils/index.js +20 -9
  30. package/es/packages/form-config/style/index.css +35 -20
  31. package/es/packages/form-render/src/FormRender.js +5 -7
  32. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +1 -2
  33. package/es/packages/form-render/src/hooks/useFormContext.js +1 -4
  34. package/es/packages/form-render/src/hooks/useFormItemDeps.d.ts +1 -0
  35. package/es/packages/form-render/src/hooks/useFormItemDeps.js +5 -2
  36. package/es/packages/form-render/src/utils/index.js +1 -1
  37. package/es/packages/form-render/src/utils/schema.d.ts +0 -1
  38. package/es/packages/form-render/src/utils/schema.js +1 -12
  39. package/es/packages/index.css +35 -20
  40. package/es/packages/shortcut-setter/src/ShortcutSetter.js +2 -1
  41. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ import { defineComponent, inject, computed, openBlock, createBlock, unref, mergeProps, withModifiers, withCtx, createVNode, normalizeClass, createTextVNode, toDisplayString } from 'vue';
2
+ import { NButton, NEllipsis } from 'naive-ui';
3
+ import { CloseButton } from '../../../../../packages/form-config/src/components';
4
+ import { InjectionActiveFieldItem, WidgetTextMap } from '../../../../../packages/form-config/src/constants';
5
+ import { bindHover } from '../../../../../packages/form-config/src/utils';
6
+ import _export_sfc from '../../../../../_virtual/plugin-vue_export-helper.js';
7
+
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ __name: "DefaultNode",
10
+ props: {
11
+ fieldItem: { type: Object, required: true },
12
+ textFormatter: { type: Function, required: true }
13
+ },
14
+ setup(__props) {
15
+ const props = __props;
16
+ const currentActiveEditField = inject(InjectionActiveFieldItem);
17
+ function active() {
18
+ currentActiveEditField.value = props.fieldItem;
19
+ }
20
+ const classList = computed(() => {
21
+ return [{ "is-active": currentActiveEditField.value === props.fieldItem }, "form-config__renderer"];
22
+ });
23
+ const ellipsisClassList = computed(() => {
24
+ return ["form-config__renderer--default", { "is-required": props.fieldItem.required }];
25
+ });
26
+ const disabled = computed(() => {
27
+ return props.fieldItem.editable === false;
28
+ });
29
+ function getDisplayText() {
30
+ const type = WidgetTextMap.get(props.fieldItem.type);
31
+ return props.textFormatter(props.fieldItem, `${props.fieldItem.name}${type ? `(${type})` : ""}`);
32
+ }
33
+ return (_ctx, _cache) => {
34
+ return openBlock(), createBlock(unref(NButton), mergeProps({
35
+ secondary: !unref(disabled),
36
+ dashed: unref(disabled)
37
+ }, unref(bindHover)(__props.fieldItem), {
38
+ onClick: withModifiers(active, ["stop"]),
39
+ class: unref(classList)
40
+ }), {
41
+ default: withCtx(() => [
42
+ createVNode(unref(NEllipsis), {
43
+ class: normalizeClass(unref(ellipsisClassList))
44
+ }, {
45
+ default: withCtx(() => [
46
+ createTextVNode(toDisplayString(getDisplayText()), 1)
47
+ ]),
48
+ _: 1
49
+ }, 8, ["class"]),
50
+ createVNode(unref(CloseButton), { "field-item": __props.fieldItem }, null, 8, ["field-item"])
51
+ ]),
52
+ _: 1
53
+ }, 16, ["secondary", "dashed", "onClick", "class"]);
54
+ };
55
+ }
56
+ });
57
+ var DefaultNode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "DefaultNode.vue"]]);
58
+
59
+ export { DefaultNode as default };