cnhis-design-vue 3.1.34 → 3.1.35-beta.10
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.
- package/es/components/big-table/index.d.ts +14 -0
- package/es/components/big-table/src/BigTable.vue.d.ts +17 -9
- package/es/components/big-table/src/BigTable.vue2.js +602 -15
- package/es/components/big-table/src/components/edit-form/edit-separate.vue.d.ts +4 -0
- package/es/components/big-table/src/components/separate.vue.d.ts +1 -0
- package/es/components/big-table/src/hooks/useEdit.d.ts +4 -0
- package/es/components/big-table/src/hooks/useSeparateRow.d.ts +11 -1
- package/es/components/big-table/src/hooks/useSeparateRow.js +56 -12
- package/es/components/big-table/style/index.css +1 -1
- package/es/components/fabric-chart/src/hooks/useCenter.js +3 -3
- package/es/components/fabric-chart/src/hooks/useLeft.js +3 -3
- package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +2 -1
- package/es/components/fabric-chart/src/utils/utils.d.ts +2 -0
- package/es/components/fabric-chart/src/utils/utils.js +7 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.js +1 -0
- package/es/components/form-config/src/hooks/useConfigurationField.js +7 -1
- package/es/components/form-render/src/components/renderer/combination.js +11 -3
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +20 -4
- package/es/components/form-render/src/components/renderer/jsonCombination/index.js +7 -3
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +12 -2
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.js +7 -14
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +12 -2
- package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +13 -0
- package/es/components/form-render/src/components/tooltipMessage.vue.js +37 -0
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -0
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/src/IhoTable.vue.js +3 -3
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +45 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +39 -6
- package/es/components/info-header/src/InfoHeader.vue.js +40 -29
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/keyboard/index.d.ts +34 -6
- package/es/components/keyboard/src/Keyboard.vue.d.ts +34 -6
- package/es/components/keyboard/src/Keyboard.vue.js +16 -12
- package/es/components/keyboard/src/components/InputNumber.vue.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +14 -4
- package/es/components/keyboard/src/components/NumberPanel.vue.js +88 -30
- package/es/components/keyboard/style/index.css +1 -1
- package/package.json +2 -2
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, openBlock, createElementBlock, normalizeClass, normalizeStyle, unref, createElementVNode, createVNode, withCtx, Fragment, renderList, toDisplayString, createBlock, createCommentVNode } from 'vue';
|
|
1
|
+
import { defineComponent, computed, ref, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, unref, createElementVNode, createVNode, withCtx, Fragment, renderList, toDisplayString, createBlock, createCommentVNode } from 'vue';
|
|
2
2
|
import { NSpace, NIcon } from 'naive-ui';
|
|
3
3
|
import { ArrowUndoSharp } from '@vicons/ionicons5';
|
|
4
4
|
import InputNumber from './InputNumber.vue.js';
|
|
5
|
-
import {
|
|
5
|
+
import { useDraggable } from '@vueuse/core';
|
|
6
6
|
import { getNumber } from '../utils/index.js';
|
|
7
7
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
8
8
|
|
|
9
|
-
const _hoisted_1 = { class: "
|
|
10
|
-
const _hoisted_2 =
|
|
9
|
+
const _hoisted_1 = { class: "keys" };
|
|
10
|
+
const _hoisted_2 = ["onClick"];
|
|
11
11
|
const _hoisted_3 = ["onClick"];
|
|
12
|
-
const _hoisted_4 =
|
|
13
|
-
const _hoisted_5 =
|
|
14
|
-
const _hoisted_6 =
|
|
15
|
-
const _hoisted_7 = { class: "inputs" };
|
|
16
|
-
const _hoisted_8 =
|
|
17
|
-
const _hoisted_9 = /* @__PURE__ */ createElementVNode("hr", null, null, -1);
|
|
12
|
+
const _hoisted_4 = { class: "btns" };
|
|
13
|
+
const _hoisted_5 = ["onClick"];
|
|
14
|
+
const _hoisted_6 = { class: "inputs" };
|
|
15
|
+
const _hoisted_7 = { class: "inputs-right" };
|
|
16
|
+
const _hoisted_8 = /* @__PURE__ */ createElementVNode("hr", null, null, -1);
|
|
18
17
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
18
|
__name: "NumberPanel",
|
|
20
19
|
props: {
|
|
21
20
|
defaultValue: { type: Number },
|
|
21
|
+
value: { type: Number },
|
|
22
22
|
mode: { type: String },
|
|
23
23
|
positionInitialValue: { type: Object, default: () => ({ x: 0, y: 0 }) },
|
|
24
24
|
moveOffset: { type: Object, default: () => ({ x: 0, y: 0 }) },
|
|
@@ -29,10 +29,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
const props = __props;
|
|
30
30
|
const NUMBERKEYS = "1234567890.";
|
|
31
31
|
const DAYS = [3, 7, 14, 30];
|
|
32
|
+
const DOSENUMBERKEYS = "123/456*789-0.+";
|
|
33
|
+
const CALCULATIONSYMBOLS = ["+", "-", "*", "/"];
|
|
32
34
|
const isNumber = computed(() => props.mode === "number");
|
|
33
35
|
const isDay = computed(() => props.mode === "day" && !isNumber.value);
|
|
34
36
|
const isDose = computed(() => props.mode === "dose" && !isNumber.value);
|
|
35
|
-
const numberKeys =
|
|
37
|
+
const numberKeys = computed(() => (isDose.value ? DOSENUMBERKEYS : NUMBERKEYS).split(""));
|
|
36
38
|
const days = ref(DAYS);
|
|
37
39
|
const doses = ref([2, 3, 4, 5, 6, 7, 8]);
|
|
38
40
|
const inputValue = ref("");
|
|
@@ -43,7 +45,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
45
|
const numeratorValueStatus = ref("success");
|
|
44
46
|
const denominatorValueStatus = ref("success");
|
|
45
47
|
const keyboardRef = ref(null);
|
|
46
|
-
const { history, undo, redo } = useRefHistory(inputValue);
|
|
47
48
|
const style = init();
|
|
48
49
|
function init() {
|
|
49
50
|
if (props.defaultValue) {
|
|
@@ -65,23 +66,71 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
66
|
var _a, _b;
|
|
66
67
|
switch (key) {
|
|
67
68
|
case "Undo": {
|
|
68
|
-
|
|
69
|
+
doDelete();
|
|
69
70
|
setInputValueStatus();
|
|
70
71
|
break;
|
|
71
72
|
}
|
|
72
|
-
case "Enter":
|
|
73
|
-
|
|
73
|
+
case "Enter": {
|
|
74
|
+
if (!validator()) {
|
|
75
|
+
inputValueStatus.value = "error";
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
emit("change", eval(inputValue.value));
|
|
74
79
|
break;
|
|
80
|
+
}
|
|
75
81
|
default:
|
|
76
82
|
if (typeof key === "number") {
|
|
77
83
|
inputValue.value = key.toString();
|
|
78
84
|
} else {
|
|
79
|
-
|
|
85
|
+
if (CALCULATIONSYMBOLS.includes(key) && CALCULATIONSYMBOLS.includes(inputValue.value.at(-1))) {
|
|
86
|
+
const arr = inputValue.value.split("");
|
|
87
|
+
arr.splice(-1, 1, key);
|
|
88
|
+
inputValue.value = arr.join("");
|
|
89
|
+
} else {
|
|
90
|
+
inputValue.value = (((_b = (_a = inputValue.value) == null ? void 0 : _a.toString) == null ? void 0 : _b.call(_a)) || "") + key;
|
|
91
|
+
}
|
|
80
92
|
}
|
|
81
93
|
setInputValueStatus();
|
|
82
94
|
break;
|
|
83
95
|
}
|
|
84
96
|
}
|
|
97
|
+
function validator() {
|
|
98
|
+
if (!inputValue.value)
|
|
99
|
+
return false;
|
|
100
|
+
if (CALCULATIONSYMBOLS.slice(2).includes(inputValue.value.at(0))) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
if (CALCULATIONSYMBOLS.includes(inputValue.value.at(-1))) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
const arr = [];
|
|
107
|
+
let _arr = [];
|
|
108
|
+
const values = inputValue.value.split("");
|
|
109
|
+
values.forEach((str, index) => {
|
|
110
|
+
if (CALCULATIONSYMBOLS.includes(str)) {
|
|
111
|
+
arr.push(_arr.join(""));
|
|
112
|
+
_arr = [];
|
|
113
|
+
} else {
|
|
114
|
+
_arr.push(str);
|
|
115
|
+
if (index === values.length - 1)
|
|
116
|
+
arr.push(_arr.join(""));
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const isSuccess = arr.every((value, index) => {
|
|
120
|
+
if (index === 0 && !value)
|
|
121
|
+
return true;
|
|
122
|
+
return /^\d*(.\d+)?$/.test(value);
|
|
123
|
+
});
|
|
124
|
+
if (!isSuccess)
|
|
125
|
+
return false;
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
function doDelete() {
|
|
129
|
+
if (!inputValue.value)
|
|
130
|
+
return;
|
|
131
|
+
const value = inputValue.value;
|
|
132
|
+
inputValue.value = value.slice(0, value.length - 1);
|
|
133
|
+
}
|
|
85
134
|
function updateFraction(value) {
|
|
86
135
|
if (!setInputStatus(inputValue, inputValueStatus))
|
|
87
136
|
return;
|
|
@@ -105,6 +154,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
105
154
|
function setInputValueStatus() {
|
|
106
155
|
inputValueStatus.value = !inputValue.value ? "error" : "success";
|
|
107
156
|
}
|
|
157
|
+
watch(
|
|
158
|
+
() => props.value,
|
|
159
|
+
(value) => inputValue.value = (value || "").toString(),
|
|
160
|
+
{
|
|
161
|
+
immediate: true
|
|
162
|
+
}
|
|
163
|
+
);
|
|
108
164
|
return (_ctx, _cache) => {
|
|
109
165
|
return openBlock(), createElementBlock("div", {
|
|
110
166
|
class: normalizeClass(["c-keyboard", { isFixed: __props.drag }]),
|
|
@@ -112,22 +168,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
112
168
|
ref: keyboardRef,
|
|
113
169
|
style: normalizeStyle(unref(style))
|
|
114
170
|
}, [
|
|
115
|
-
createElementVNode("div",
|
|
171
|
+
createElementVNode("div", {
|
|
172
|
+
class: normalizeClass(["left", { isDose: unref(isDose) }])
|
|
173
|
+
}, [
|
|
116
174
|
createVNode(InputNumber, {
|
|
117
175
|
modelValue: inputValue.value,
|
|
118
176
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
119
177
|
status: inputValueStatus.value,
|
|
120
178
|
"onUpdate:status": _cache[1] || (_cache[1] = ($event) => inputValueStatus.value = $event)
|
|
121
179
|
}, null, 8, ["modelValue", "status"]),
|
|
122
|
-
createElementVNode("div",
|
|
180
|
+
createElementVNode("div", _hoisted_1, [
|
|
123
181
|
createVNode(unref(NSpace), null, {
|
|
124
182
|
default: withCtx(() => [
|
|
125
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(numberKeys
|
|
183
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(numberKeys), (key2) => {
|
|
126
184
|
return openBlock(), createElementBlock("span", {
|
|
127
|
-
key,
|
|
128
|
-
class: normalizeClass(
|
|
129
|
-
onClick: ($event) => keydown(
|
|
130
|
-
}, toDisplayString(
|
|
185
|
+
key: key2,
|
|
186
|
+
class: normalizeClass(key2 === "0" ? "is-0" : ""),
|
|
187
|
+
onClick: ($event) => keydown(key2)
|
|
188
|
+
}, toDisplayString(key2), 11, _hoisted_2);
|
|
131
189
|
}), 128))
|
|
132
190
|
]),
|
|
133
191
|
_: 1
|
|
@@ -148,7 +206,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
206
|
_: 1
|
|
149
207
|
})
|
|
150
208
|
])
|
|
151
|
-
]),
|
|
209
|
+
], 2),
|
|
152
210
|
unref(isDay) ? (openBlock(), createBlock(unref(NSpace), {
|
|
153
211
|
key: 0,
|
|
154
212
|
class: "right-days",
|
|
@@ -161,7 +219,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
161
219
|
class: "btn",
|
|
162
220
|
key: day,
|
|
163
221
|
onClick: ($event) => keydown(day)
|
|
164
|
-
}, toDisplayString(day) + "\u5929", 9,
|
|
222
|
+
}, toDisplayString(day) + "\u5929", 9, _hoisted_3);
|
|
165
223
|
}), 128))
|
|
166
224
|
]),
|
|
167
225
|
_: 1
|
|
@@ -172,13 +230,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
172
230
|
"wrap-item": false
|
|
173
231
|
}, {
|
|
174
232
|
default: withCtx(() => [
|
|
175
|
-
createElementVNode("div",
|
|
233
|
+
createElementVNode("div", _hoisted_4, [
|
|
176
234
|
(openBlock(true), createElementBlock(Fragment, null, renderList(doses.value, (dose) => {
|
|
177
235
|
return openBlock(), createElementBlock("span", {
|
|
178
236
|
class: "btn",
|
|
179
237
|
key: dose,
|
|
180
238
|
onClick: ($event) => updateFraction(dose)
|
|
181
|
-
}, "1/" + toDisplayString(dose), 9,
|
|
239
|
+
}, "1/" + toDisplayString(dose), 9, _hoisted_5);
|
|
182
240
|
}), 128))
|
|
183
241
|
]),
|
|
184
242
|
createVNode(unref(NSpace), {
|
|
@@ -186,13 +244,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
186
244
|
vertical: ""
|
|
187
245
|
}, {
|
|
188
246
|
default: withCtx(() => [
|
|
189
|
-
createElementVNode("div",
|
|
247
|
+
createElementVNode("div", _hoisted_6, [
|
|
190
248
|
createVNode(InputNumber, {
|
|
191
249
|
integer: "",
|
|
192
250
|
modelValue: integerValue.value,
|
|
193
251
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => integerValue.value = $event)
|
|
194
252
|
}, null, 8, ["modelValue"]),
|
|
195
|
-
createElementVNode("div",
|
|
253
|
+
createElementVNode("div", _hoisted_7, [
|
|
196
254
|
createVNode(InputNumber, {
|
|
197
255
|
integer: "",
|
|
198
256
|
modelValue: numeratorValue.value,
|
|
@@ -200,7 +258,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
200
258
|
status: numeratorValueStatus.value,
|
|
201
259
|
"onUpdate:status": _cache[6] || (_cache[6] = ($event) => numeratorValueStatus.value = $event)
|
|
202
260
|
}, null, 8, ["modelValue", "status"]),
|
|
203
|
-
|
|
261
|
+
_hoisted_8,
|
|
204
262
|
createVNode(InputNumber, {
|
|
205
263
|
integer: "",
|
|
206
264
|
modelValue: denominatorValue.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.c-keyboard span,.c-keyboard-english .keys span{cursor:pointer}.c-keyboard{background:#fff;display:flex;height:160px}.c-keyboard.isFixed{position:fixed;z-index:1}.c-keyboard .btn{align-items:center;background:linear-gradient(180deg,#fff,#f2f2f2);border-radius:2px;box-shadow:0 2px 2px #00000036;box-sizing:border-box;display:inline-flex;font-size:14px;justify-content:center;text-align:center}.c-keyboard .btn:hover{background:#2474ff33;border:1px solid #2474ff}.c-keyboard .btn:active{background:#2474ff;color:#fff}.c-keyboard .btn:hover{box-shadow:none}.c-keyboard .left{box-sizing:border-box;padding:6px;width:
|
|
1
|
+
.c-keyboard span,.c-keyboard-english .keys span{cursor:pointer}.c-keyboard{background:#fff;display:flex;height:160px}.c-keyboard.isFixed{position:fixed;z-index:1}.c-keyboard .btn{align-items:center;background:linear-gradient(180deg,#fff,#f2f2f2);border-radius:2px;box-shadow:0 2px 2px #00000036;box-sizing:border-box;display:inline-flex;font-size:14px;justify-content:center;text-align:center}.c-keyboard .btn:hover{background:#2474ff33;border:1px solid #2474ff}.c-keyboard .btn:active{background:#2474ff;color:#fff}.c-keyboard .btn:hover{box-shadow:none}.c-keyboard .left{box-sizing:border-box;padding:6px;width:128px}.c-keyboard .left.isDose{width:158px}.c-keyboard .left .n-input{height:28px;width:100%}.c-keyboard .left .n-input .n-input__input-el{height:28px}.c-keyboard .left .keys{display:flex;margin-top:5px}.c-keyboard .left .keys .n-space{gap:4px 4px!important}.c-keyboard .left .keys span{align-items:center;background-color:#e8e8e8;border-radius:2px;box-sizing:border-box;display:inline-flex;font-size:14px;height:26px;justify-content:center;text-align:center;width:26px}.c-keyboard .left .keys span:hover{background:#2474ff33;border:1px solid #2474ff}.c-keyboard .left .keys span:active{background:#2474ff;color:#fff}.c-keyboard .left .keys span.opt{height:56px}.c-keyboard .left .keys span.is-0{width:56px}.c-keyboard .right-days,.c-keyboard .right-dose{border-left:1px solid #d5d5d5}.c-keyboard .right-days{padding:0 12px}.c-keyboard .right-days .btn{height:26px;width:56px}.c-keyboard .right-dose{gap:8px 8px!important;padding:5px 12px 5px 5px}.c-keyboard .right-dose .btn{height:32px;width:100px}.c-keyboard .right-dose .btns{display:flex;flex-flow:column nowrap;height:100%;overflow-y:scroll;padding-right:6px}.c-keyboard .right-dose .btns .btn{height:20px;margin-top:4px;width:40px}.c-keyboard .right-dose .btns::-webkit-scrollbar{height:1px;width:2px}.c-keyboard .right-dose .btns::-webkit-scrollbar-track{background:#d8d8d8;border-radius:2px;box-shadow:inset 0 0 5px #fff}.c-keyboard .right-dose .btns::-webkit-scrollbar-thumb{background:#535353;border-radius:2px;box-shadow:inset 0 0 5px #fff}.c-keyboard .right-dose .inputs{align-items:center;display:flex;gap:8px}.c-keyboard .right-dose .inputs .n-input{height:32px;width:46px}.c-keyboard .right-dose .inputs .n-input .n-input__input-el{height:32px}.c-keyboard .n-input .n-input-wrapper{padding-right:5px}.c-keyboard .n-input .n-input-wrapper .n-input__suffix{line-height:0}.c-keyboard .n-input .n-input-wrapper .n-input__suffix .n-space{gap:0 0!important}.c-keyboard .n-input .n-input-wrapper .n-input__suffix .n-space .n-icon{cursor:pointer}.c-keyboard-english{background:#fff;box-sizing:border-box;padding:10px 6px;width:308px}.c-keyboard-english.isFixed{position:fixed;z-index:1}.c-keyboard-english .n-space span{font-size:12px}.c-keyboard-english .n-space .n-icon{cursor:pointer}.c-keyboard-english .keys{display:flex;flex-flow:row wrap;gap:4px 4px;margin-top:5px}.c-keyboard-english .keys span{align-items:center;background-color:#e8e8e8;border-radius:2px;box-sizing:border-box;display:inline-flex;font-size:14px;height:26px;justify-content:center;text-align:center;width:26px}.c-keyboard-english .keys span:hover{background:#2474ff33;border:1px solid #2474ff}.c-keyboard-english .keys span:active{background:#2474ff;color:#fff}.c-keyboard-english .keys span.key10,.c-keyboard-english .keys span.key27{margin-left:16px}.c-keyboard-english .keys span.key26{margin-right:25px}.c-keyboard-english .keys span.key19{margin-left:31px}.c-keyboard-english .keys span.key28{width:146px}.c-keyboard-english .keys span.key30{width:56px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.35-beta.10",
|
|
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": "
|
|
64
|
+
"gitHead": "9658d752799ec597e0b67572018a9f9af0fc6a97"
|
|
65
65
|
}
|