cnhis-design-vue 3.1.17-beta.2 → 3.1.17-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 (28) hide show
  1. package/es/packages/big-table/src/components/separate.js +1 -1
  2. package/es/packages/big-table/src/hooks/useSeparateRow.js +2 -2
  3. package/es/packages/form-config/index.d.ts +115 -1
  4. package/es/packages/form-config/src/FormConfig.js +11 -17
  5. package/es/packages/form-config/src/FormConfig.vue.d.ts +115 -1
  6. package/es/packages/form-config/src/components/CloseButton.js +45 -0
  7. package/es/packages/form-config/src/components/CloseButton.vue.d.ts +1499 -0
  8. package/es/packages/form-config/src/components/ComplexNode.js +45 -0
  9. package/es/packages/form-config/src/components/ComplexNode.vue.d.ts +1661 -0
  10. package/es/packages/form-config/src/components/DefaultNode.js +54 -0
  11. package/es/packages/form-config/src/components/DefaultNode.vue.d.ts +1543 -0
  12. package/es/packages/form-config/src/components/FormConfigCreator.js +3 -3
  13. package/es/packages/form-config/src/components/FormConfigDragDisplay.js +43 -0
  14. package/es/packages/form-config/src/components/FormConfigDragDisplay.vue.d.ts +114 -0
  15. package/es/packages/form-config/src/components/FormConfigEdit.js +1 -1
  16. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +2 -0
  17. package/es/packages/form-config/src/constants/index.d.ts +2 -0
  18. package/es/packages/form-config/src/constants/index.js +5 -2
  19. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -2
  20. package/es/packages/form-config/src/hooks/usePresetRenderer.js +6 -84
  21. package/es/packages/form-config/src/hooks/useSortable.js +3 -7
  22. package/es/packages/form-config/src/types/index.d.ts +2 -1
  23. package/es/packages/form-config/src/utils/index.d.ts +8 -1
  24. package/es/packages/form-config/src/utils/index.js +23 -9
  25. package/es/packages/form-config/style/index.css +26 -5
  26. package/es/packages/index.css +26 -5
  27. package/global.d.ts +8 -8
  28. package/package.json +1 -1
@@ -0,0 +1,54 @@
1
+ import { defineComponent, inject, computed, resolveComponent, openBlock, createElementBlock, mergeProps, unref, withModifiers, createVNode, normalizeClass, withCtx, createTextVNode, toDisplayString } from 'vue';
2
+ import { InjectionActiveFieldItem, WidgetTextMap } from '../../../../packages/form-config/src/constants';
3
+ import { bindHover } from '../../../../packages/form-config/src/utils';
4
+ import CloseButton from '../../../../packages/form-config/src/components/CloseButton';
5
+ import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
6
+
7
+ const _hoisted_1 = ["onClick"];
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 [
25
+ "form-config__renderer--default",
26
+ { "is-required": props.fieldItem.required, "is-disabled": props.fieldItem.editable === false }
27
+ ];
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
+ const _component_n_ellipsis = resolveComponent("n-ellipsis");
35
+ return openBlock(), createElementBlock("section", mergeProps(unref(bindHover)(__props.fieldItem), {
36
+ onClick: withModifiers(active, ["stop"]),
37
+ class: unref(classList)
38
+ }), [
39
+ createVNode(_component_n_ellipsis, {
40
+ class: normalizeClass(unref(ellipsisClassList))
41
+ }, {
42
+ default: withCtx(() => [
43
+ createTextVNode(toDisplayString(getDisplayText()), 1)
44
+ ]),
45
+ _: 1
46
+ }, 8, ["class"]),
47
+ createVNode(CloseButton, { "field-item": __props.fieldItem }, null, 8, ["field-item"])
48
+ ], 16, _hoisted_1);
49
+ };
50
+ }
51
+ });
52
+ var DefaultNode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "DefaultNode.vue"]]);
53
+
54
+ export { DefaultNode as default };