cnhis-design-vue 3.1.31-beta.2 → 3.1.31-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.
@@ -33,7 +33,7 @@ const ColumnComponent = defineComponent({
33
33
  }
34
34
  }, {
35
35
  default: () => props.field.title
36
- }))]]), vIf(hasAnnotation, createVNode(Annotation, {
36
+ }))]]), vIf(hasAnnotation, () => createVNode(Annotation, {
37
37
  "modelValue": props.annotation[props.field.field],
38
38
  "onUpdate:modelValue": ($event) => props.annotation[props.field.field] = $event
39
39
  }, null))]);
@@ -18,6 +18,9 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
18
18
  y: number;
19
19
  };
20
20
  };
21
+ defaultValue: {
22
+ type: NumberConstructor;
23
+ };
21
24
  }, {
22
25
  NUMBERKEYS: string;
23
26
  DAYS: number[];
@@ -44,6 +47,9 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
44
47
  y: number;
45
48
  };
46
49
  };
50
+ defaultValue: {
51
+ type: NumberConstructor;
52
+ };
47
53
  }>> & {
48
54
  onChange?: ((...args: any[]) => any) | undefined;
49
55
  onKeydown?: ((...args: any[]) => any) | undefined;
@@ -55,7 +61,6 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
55
61
  days: import("vue").Ref<number[]>;
56
62
  doses: import("vue").Ref<number[]>;
57
63
  englishKeys: import("vue").Ref<string[]>;
58
- value: import("vue").Ref<any>;
59
64
  inputValue: import("vue").Ref<string>;
60
65
  integerValue: import("vue").Ref<any>;
61
66
  numeratorValue: import("vue").Ref<any>;
@@ -162,6 +167,9 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
162
167
  y: number;
163
168
  };
164
169
  };
170
+ defaultValue: {
171
+ type: NumberConstructor;
172
+ };
165
173
  }>> & {
166
174
  onChange?: ((...args: any[]) => any) | undefined;
167
175
  onKeydown?: ((...args: any[]) => any) | undefined;
@@ -27,7 +27,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
27
  props: {
28
28
  mode: { type: String, default: "english" },
29
29
  dragable: { type: Boolean, default: false },
30
- positionInitialValue: { type: Object, default: () => ({ x: 0, y: 0 }) }
30
+ positionInitialValue: { type: Object, default: () => ({ x: 0, y: 0 }) },
31
+ defaultValue: { type: Number }
31
32
  },
32
33
  emits: [
33
34
  "change",
@@ -47,7 +48,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
47
48
  const days = ref(DAYS);
48
49
  const doses = ref([2, 3, 4, 5, 6, 7, 8]);
49
50
  const englishKeys = ref(ENGLISHKEYS.slice());
50
- const value = ref();
51
51
  const inputValue = ref("");
52
52
  const integerValue = ref();
53
53
  const numeratorValue = ref();
@@ -64,6 +64,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
64
  preventDefault: true,
65
65
  handle: keyboardDragRef
66
66
  });
67
+ if (props.defaultValue) {
68
+ inputValue.value = props.defaultValue.toString();
69
+ }
67
70
  function keydown(key) {
68
71
  var _a, _b;
69
72
  if (props.mode === "english") {
@@ -81,8 +84,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
84
  break;
82
85
  }
83
86
  case "Enter":
84
- value.value = +inputValue.value;
85
- emit("change", value.value);
87
+ emit("change", +inputValue.value);
86
88
  break;
87
89
  default:
88
90
  if (typeof key === "number") {
@@ -94,17 +96,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
96
  break;
95
97
  }
96
98
  }
97
- function updateFraction(value2) {
99
+ function updateFraction(value) {
98
100
  if (!setInputStatus(inputValue, inputValueStatus))
99
101
  return;
100
- inputValue.value = (Math.round(+inputValue.value * (1 / value2) * 100) / 100).toString();
102
+ inputValue.value = (Math.round(+inputValue.value * (1 / value) * 100) / 100).toString();
101
103
  setInputValueStatus();
102
104
  }
103
105
  function calculateFraction() {
104
106
  if (!setInputStatus(inputValue, inputValueStatus) || !setInputStatus(numeratorValue, numeratorValueStatus, true) || !setInputStatus(denominatorValue, denominatorValueStatus, true))
105
107
  return;
106
- const value2 = getNumber(integerValue.value) + getNumber(numeratorValue.value) / getNumber(denominatorValue.value);
107
- inputValue.value = (Math.round(+inputValue.value * value2 * 100) / 100).toString();
108
+ const value = getNumber(integerValue.value) + getNumber(numeratorValue.value) / getNumber(denominatorValue.value);
109
+ inputValue.value = (Math.round(+inputValue.value * value * 100) / 100).toString();
108
110
  setInputValueStatus();
109
111
  }
110
112
  function setInputStatus(valueRef, statusRef, isInteger) {
@@ -244,7 +246,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
244
246
  justify: "space-between",
245
247
  ref_key: "keyboardDragRef",
246
248
  ref: keyboardDragRef,
247
- style: { "cursor": "move" }
249
+ style: normalizeStyle({ cursor: __props.dragable ? "move" : "default" })
248
250
  }, {
249
251
  default: withCtx(() => [
250
252
  _hoisted_11,
@@ -254,7 +256,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
254
256
  }, null, 8, ["component"])
255
257
  ]),
256
258
  _: 1
257
- }, 512),
259
+ }, 8, ["style"]),
258
260
  createElementVNode("div", _hoisted_12, [
259
261
  (openBlock(true), createElementBlock(Fragment, null, renderList(englishKeys.value, (key, index) => {
260
262
  return openBlock(), createElementBlock("span", {
@@ -19,6 +19,9 @@ declare const _default: import("vue").DefineComponent<{
19
19
  y: number;
20
20
  };
21
21
  };
22
+ defaultValue: {
23
+ type: NumberConstructor;
24
+ };
22
25
  }, {
23
26
  NUMBERKEYS: string;
24
27
  DAYS: number[];
@@ -42,6 +45,9 @@ declare const _default: import("vue").DefineComponent<{
42
45
  y: number;
43
46
  };
44
47
  };
48
+ defaultValue: {
49
+ type: NumberConstructor;
50
+ };
45
51
  }>> & {
46
52
  onChange?: ((...args: any[]) => any) | undefined;
47
53
  onKeydown?: ((...args: any[]) => any) | undefined;
@@ -53,7 +59,6 @@ declare const _default: import("vue").DefineComponent<{
53
59
  days: Ref<number[]>;
54
60
  doses: Ref<number[]>;
55
61
  englishKeys: Ref<string[]>;
56
- value: Ref<any>;
57
62
  inputValue: Ref<string>;
58
63
  integerValue: Ref<any>;
59
64
  numeratorValue: Ref<any>;
@@ -157,6 +162,9 @@ declare const _default: import("vue").DefineComponent<{
157
162
  y: number;
158
163
  };
159
164
  };
165
+ defaultValue: {
166
+ type: NumberConstructor;
167
+ };
160
168
  }>> & {
161
169
  onChange?: ((...args: any[]) => any) | undefined;
162
170
  onKeydown?: ((...args: any[]) => any) | undefined;
@@ -1,9 +1,9 @@
1
- import { defineComponent, computed, inject, createVNode, withModifiers, ref, createTextVNode } from 'vue';
1
+ import { defineComponent, computed, inject, createVNode, ref, withModifiers, createTextVNode } from 'vue';
2
2
  import { vIf, traverse } from '../../../../shared/utils/index.js';
3
3
  import { Reload, ChevronForward } from '@vicons/ionicons5';
4
4
  import { NOOP } from '@vue/shared';
5
5
  import { useVirtualList } from '@vueuse/core';
6
- import { isNumber, isArray, isEqual, isString, isFunction } from 'lodash-es';
6
+ import { isNumber, isArray, isFunction, isEqual, isString } from 'lodash-es';
7
7
  import { NCheckbox } from 'naive-ui';
8
8
  import { InjectionSearchCascaderLoadingNode, InjectionSearchCascaderValue, InjectionSearchCascaderCheckAbleLevel } from '../constants/index.js';
9
9
 
@@ -102,7 +102,7 @@ const SearchMenuList = defineComponent({
102
102
  "title": item.data[props.labelKey]
103
103
  }, [createVNode("div", {
104
104
  "class": "search-cascader__optionText"
105
- }, [vIf(showCheckbox.value, createVNode(NCheckbox, {
105
+ }, [vIf(showCheckbox.value, () => createVNode(NCheckbox, {
106
106
  "style": {
107
107
  marginRight: "8px"
108
108
  },
@@ -11,4 +11,4 @@ export declare function deepOmit<T extends AnyObject>(target: T, keys: Array<key
11
11
  export declare function separateMetaModule<T extends AnyObject>(modules: Record<string, unknown>): T;
12
12
  export declare function findAncestor(ele: HTMLElement | null, finder: (ele: HTMLElement) => boolean): HTMLElement | null;
13
13
  export declare function widthAppend(value: string | number, append?: string): string;
14
- export declare function vIf(solution: unknown, node: unknown): unknown;
14
+ export declare function vIf(solution: unknown, getNode: () => unknown): unknown;
@@ -136,8 +136,8 @@ function widthAppend(value, append = "px") {
136
136
  return value.endsWith(append) ? value : `${value}${append}`;
137
137
  throw new Error(`invalid width value ${value}, it need to be a string or number!`);
138
138
  }
139
- function vIf(solution, node) {
140
- return solution ? node : null;
139
+ function vIf(solution, getNode) {
140
+ return solution ? getNode() : null;
141
141
  }
142
142
 
143
143
  export { DMZ, arrayed, deepOmit, findAncestor, generateTimeFormat, getStringWidth, safeComponentRegister, separateMetaModule, traverse, uuidGenerator, vIf, widthAppend };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.31-beta.2",
3
+ "version": "3.1.31-beta.3",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "e88e2a027d3e80c600af95e026ea502b33b3a64f"
64
+ "gitHead": "559e8746f97e7089a0005e8d097ec9a420588652"
65
65
  }