cnhis-design-vue 3.1.23-beta.3 → 3.1.23-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.
@@ -2149,8 +2149,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2149
2149
  }, {
2150
2150
  immediate: true
2151
2151
  });
2152
- nextTick(() => {
2153
- loadData(props.data);
2152
+ watch([() => props.data, () => {
2153
+ var _a;
2154
+ return (_a = props.data) == null ? void 0 : _a.length;
2155
+ }], async ([value]) => {
2156
+ await nextTick();
2157
+ loadData(value);
2158
+ }, {
2159
+ immediate: true
2154
2160
  });
2155
2161
  watch(() => currentCheckedKeys, (val) => {
2156
2162
  setVisibleCheckAllWrap(state, props, currentCheckedKeys.value);
@@ -29,9 +29,8 @@ function useCanvasEvent(canvas, propItems, emits) {
29
29
  canvas.value.add(rect);
30
30
  return rect;
31
31
  }
32
+ let selections = [];
32
33
  function initSelection() {
33
- if (typeof (selectionStyle == null ? void 0 : selectionStyle.evented) === "boolean" && !(selectionStyle == null ? void 0 : selectionStyle.evented))
34
- return;
35
34
  const selections2 = [];
36
35
  selections2.push(drawRect({
37
36
  left: iconsWidth,
@@ -91,7 +90,6 @@ function useCanvasEvent(canvas, propItems, emits) {
91
90
  canvas.value.renderAll();
92
91
  return selections2;
93
92
  }
94
- const selections = initSelection();
95
93
  function addSelectionListener() {
96
94
  canvas.value.on("selection:cleared", selectionCB);
97
95
  canvas.value.on("selection:updated", selectionCB);
@@ -102,13 +100,19 @@ function useCanvasEvent(canvas, propItems, emits) {
102
100
  });
103
101
  }
104
102
  }
105
- addSelectionListener();
106
103
  function select(key) {
107
104
  canvas.value.discardActiveObject().renderAll();
108
105
  const obj = selections == null ? void 0 : selections.find((obj2) => obj2.key === key);
109
106
  obj == null ? void 0 : obj.bringToFront();
110
107
  obj && canvas.value.setActiveObject(obj);
111
108
  }
109
+ function init() {
110
+ if (typeof (selectionStyle == null ? void 0 : selectionStyle.evented) === "boolean" && !(selectionStyle == null ? void 0 : selectionStyle.evented))
111
+ return;
112
+ selections = initSelection();
113
+ addSelectionListener();
114
+ }
115
+ init();
112
116
  return { select };
113
117
  }
114
118
 
@@ -940,6 +940,12 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
940
940
  search_key?: string[] | undefined;
941
941
  type?: string | undefined;
942
942
  value_key?: string | undefined;
943
+ level_key?: string | undefined;
944
+ link_key?: string | undefined;
945
+ link_key_split?: string | undefined;
946
+ show_key?: string | undefined;
947
+ conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
948
+ conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
943
949
  } | undefined;
944
950
  open?: {
945
951
  value?: any;
@@ -942,6 +942,12 @@ declare const _default: import("vue").DefineComponent<{
942
942
  search_key?: string[] | undefined;
943
943
  type?: string | undefined;
944
944
  value_key?: string | undefined;
945
+ level_key?: string | undefined;
946
+ link_key?: string | undefined;
947
+ link_key_split?: string | undefined;
948
+ show_key?: string | undefined;
949
+ conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
950
+ conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
945
951
  } | undefined;
946
952
  open?: {
947
953
  value?: any;
@@ -69,6 +69,12 @@ declare const _default: import("vue").DefineComponent<{}, {
69
69
  search_key?: string[] | undefined;
70
70
  type?: string | undefined;
71
71
  value_key?: string | undefined;
72
+ level_key?: string | undefined;
73
+ link_key?: string | undefined;
74
+ link_key_split?: string | undefined;
75
+ show_key?: string | undefined;
76
+ conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
77
+ conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
72
78
  } | undefined;
73
79
  open?: {
74
80
  value?: any;
@@ -1,4 +1,4 @@
1
- import { Func } from '../../../../../../es/shared/types';
1
+ import { AnyObject, Func } from '../../../../../../es/shared/types';
2
2
  import { PropType } from 'vue';
3
3
  export declare const SEARCH: import("vue").DefineComponent<{
4
4
  value: {
@@ -21,6 +21,12 @@ export declare const SEARCH: import("vue").DefineComponent<{
21
21
  search_key: string[];
22
22
  type: string;
23
23
  value_key: string;
24
+ level_key: string;
25
+ link_key: string;
26
+ link_key_split: string;
27
+ show_key: string;
28
+ conObj: AnyObject[];
29
+ conObjFirstLevel: AnyObject[];
24
30
  }>>;
25
31
  required: true;
26
32
  };
@@ -49,6 +55,12 @@ export declare const SEARCH: import("vue").DefineComponent<{
49
55
  search_key: string[];
50
56
  type: string;
51
57
  value_key: string;
58
+ level_key: string;
59
+ link_key: string;
60
+ link_key_split: string;
61
+ show_key: string;
62
+ conObj: AnyObject[];
63
+ conObjFirstLevel: AnyObject[];
52
64
  }>>;
53
65
  required: true;
54
66
  };
@@ -0,0 +1,63 @@
1
+ import { AnyObject, Func } from '../../../../../../es/shared/types';
2
+ import { PropType } from 'vue';
3
+ export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
4
+ options: {
5
+ type: PropType<AnyObject[]>;
6
+ default: () => never[];
7
+ };
8
+ onFocus: {
9
+ type: PropType<Func<any[], any>>;
10
+ };
11
+ wordbook: {
12
+ type: PropType<Partial<{
13
+ level_num: number;
14
+ id: string;
15
+ name: string;
16
+ render_key: string[];
17
+ search_key: string[];
18
+ type: string;
19
+ value_key: string;
20
+ level_key: string;
21
+ link_key: string;
22
+ link_key_split: string;
23
+ show_key: string;
24
+ conObj: AnyObject[];
25
+ conObjFirstLevel: AnyObject[];
26
+ }>>;
27
+ required: true;
28
+ };
29
+ onChange: {};
30
+ value: {};
31
+ }, () => void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
32
+ options: {
33
+ type: PropType<AnyObject[]>;
34
+ default: () => never[];
35
+ };
36
+ onFocus: {
37
+ type: PropType<Func<any[], any>>;
38
+ };
39
+ wordbook: {
40
+ type: PropType<Partial<{
41
+ level_num: number;
42
+ id: string;
43
+ name: string;
44
+ render_key: string[];
45
+ search_key: string[];
46
+ type: string;
47
+ value_key: string;
48
+ level_key: string;
49
+ link_key: string;
50
+ link_key_split: string;
51
+ show_key: string;
52
+ conObj: AnyObject[];
53
+ conObjFirstLevel: AnyObject[];
54
+ }>>;
55
+ required: true;
56
+ };
57
+ onChange: {};
58
+ value: {};
59
+ }>> & {
60
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
61
+ }, {
62
+ options: AnyObject[];
63
+ }>;
@@ -74,6 +74,12 @@ export declare type FormWordbook = Partial<{
74
74
  search_key: string[];
75
75
  type: string;
76
76
  value_key: string;
77
+ level_key: string;
78
+ link_key: string;
79
+ link_key_split: string;
80
+ show_key: string;
81
+ conObj: AnyObject[];
82
+ conObjFirstLevel: AnyObject[];
77
83
  }>;
78
84
  export declare type FieldItem = {
79
85
  /**
@@ -48,7 +48,7 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
48
48
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
49
49
  }>>;
50
50
  emits: (event: "update:value", ...args: any[]) => void;
51
- emitValue: (value: unknown) => void;
51
+ emitValue: (value: string | import("../../../es/shared/types").AnyObject[]) => void;
52
52
  onClear: () => void;
53
53
  cssVariable: {
54
54
  '--menu-width': number;
@@ -23,8 +23,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
23
  emits: ["update:value"],
24
24
  setup(__props, { expose, emit: emits }) {
25
25
  const props = __props;
26
+ function emitValue(value) {
27
+ Promise.resolve(isFunction(props.beforeSetValue) ? props.beforeSetValue(value) : value).then((result) => {
28
+ emits("update:value", result);
29
+ }, () => {
30
+ });
31
+ }
26
32
  function onClear() {
27
- emits("update:value", []);
33
+ emitValue([]);
28
34
  }
29
35
  const cssVariable = useCssVariable();
30
36
  const optionsRef = ref([{}]);
@@ -98,7 +104,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
98
104
  const search = useDebounceFn(async (node, keyword) => {
99
105
  var _a;
100
106
  if (!isFunction(props.fetchOptions)) {
101
- emits("update:value", node ? [node] : []);
107
+ emitValue(node ? [node] : []);
102
108
  return closeMenu();
103
109
  }
104
110
  loadingNode.value = node;
@@ -108,7 +114,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
108
114
  if (!node)
109
115
  return;
110
116
  node.isLeaf = true;
111
- emits("update:value", getParentNodeList(node));
117
+ emitValue(getParentNodeList(node));
112
118
  return closeMenu();
113
119
  }
114
120
  if (node) {
@@ -50,7 +50,7 @@ declare const _default: import("vue").DefineComponent<{
50
50
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
51
51
  }>>;
52
52
  emits: (event: "update:value", ...args: any[]) => void;
53
- emitValue: (value: unknown) => void;
53
+ emitValue: (value: ValueType) => void;
54
54
  onClear: () => void;
55
55
  cssVariable: {
56
56
  '--menu-width': number;
@@ -100,6 +100,12 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
100
100
  search_key?: string[] | undefined;
101
101
  type?: string | undefined;
102
102
  value_key?: string | undefined;
103
+ level_key?: string | undefined;
104
+ link_key?: string | undefined;
105
+ link_key_split?: string | undefined;
106
+ show_key?: string | undefined;
107
+ conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
108
+ conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
103
109
  } | undefined;
104
110
  open?: {
105
111
  value?: any;
@@ -102,6 +102,12 @@ declare const _default: import("vue").DefineComponent<{
102
102
  search_key?: string[] | undefined;
103
103
  type?: string | undefined;
104
104
  value_key?: string | undefined;
105
+ level_key?: string | undefined;
106
+ link_key?: string | undefined;
107
+ link_key_split?: string | undefined;
108
+ show_key?: string | undefined;
109
+ conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
110
+ conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
105
111
  } | undefined;
106
112
  open?: {
107
113
  value?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.23-beta.3",
3
+ "version": "3.1.23-beta.4",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -66,5 +66,5 @@
66
66
  "iOS 7",
67
67
  "last 3 iOS versions"
68
68
  ],
69
- "gitHead": "fc4cb95b64ccae99fa48c41ec63096b66458930e"
69
+ "gitHead": "245fefa8f22925d581e522aa2b2d8422d65b93a0"
70
70
  }