@pisell/materials 3.0.13 → 3.0.15
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +20 -20
- package/dist/umd/materials.min.css +1 -0
- package/dist/umd/materials.min.js +1 -0
- package/dist/umd/static/DotsSix.57d66266.svg +1 -0
- package/dist/umd/static/arrow-left.e542294f.svg +1 -0
- package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
- package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
- package/dist/umd/static/help-circle.31c9be40.svg +1 -0
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/batch-editor/fields/Image/index.d.ts +7 -0
- package/es/components/batch-editor/fields/Image/index.js +14 -0
- package/es/components/batch-editor/fields/Image/index.less +6 -0
- package/es/components/batch-editor/fields/Price/index.d.ts +7 -0
- package/es/components/batch-editor/fields/Price/index.js +26 -0
- package/es/components/batch-editor/fields/Text/index.d.ts +6 -0
- package/es/components/batch-editor/fields/Text/index.js +8 -0
- package/es/components/batch-editor/fields/index.d.ts +7 -0
- package/es/components/batch-editor/fields/index.js +8 -0
- package/es/components/batch-editor/index.d.ts +11 -0
- package/es/components/batch-editor/index.js +465 -0
- package/es/components/batch-editor/index.less +50 -0
- package/es/components/page/index.js +12 -9
- package/es/components/select-time/RightPanel/index.d.ts +9 -0
- package/es/components/select-time/RightPanel/index.js +45 -0
- package/es/components/select-time/RightPanel/index.less +22 -0
- package/es/components/select-time/index.d.ts +14 -0
- package/es/components/select-time/index.js +115 -0
- package/es/components/select-time/index.less +16 -0
- package/es/components/select-time/utils.d.ts +9 -0
- package/es/components/select-time/utils.js +42 -0
- package/es/components/table/Table/fields/select/filterUtil/index.js +11 -1
- package/es/components/table/hooks/useTransDataSource.js +1 -0
- package/es/components/table/index.js +11 -3
- package/es/components/table/index.less +47 -2
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +18 -0
- package/es/components/virtual-keyboard/Keyboard/index.js +51 -0
- package/es/components/virtual-keyboard/Keyboard/index.less +32 -0
- package/es/components/virtual-keyboard/Time/index.d.ts +13 -0
- package/es/components/virtual-keyboard/Time/index.js +124 -0
- package/es/components/virtual-keyboard/Time/index.less +0 -0
- package/es/components/virtual-keyboard/Time/utils.d.ts +10 -0
- package/es/components/virtual-keyboard/Time/utils.js +153 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +9 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.js +76 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.less +52 -0
- package/es/components/virtual-keyboard/index.d.ts +14 -0
- package/es/components/virtual-keyboard/index.js +85 -0
- package/es/components/virtual-keyboard/index.less +17 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/locales/en-US.d.ts +14 -0
- package/es/locales/en-US.js +19 -1
- package/es/locales/zh-CN.d.ts +14 -0
- package/es/locales/zh-CN.js +19 -1
- package/es/locales/zh-TW.d.ts +14 -0
- package/es/locales/zh-TW.js +19 -1
- package/lib/components/batch-editor/fields/Image/index.d.ts +7 -0
- package/lib/components/batch-editor/fields/Image/index.js +48 -0
- package/lib/components/batch-editor/fields/Image/index.less +6 -0
- package/lib/components/batch-editor/fields/Price/index.d.ts +7 -0
- package/lib/components/batch-editor/fields/Price/index.js +55 -0
- package/lib/components/batch-editor/fields/Text/index.d.ts +6 -0
- package/lib/components/batch-editor/fields/Text/index.js +40 -0
- package/lib/components/batch-editor/fields/index.d.ts +7 -0
- package/lib/components/batch-editor/fields/index.js +42 -0
- package/lib/components/batch-editor/index.d.ts +11 -0
- package/lib/components/batch-editor/index.js +370 -0
- package/lib/components/batch-editor/index.less +50 -0
- package/lib/components/page/index.js +6 -7
- package/lib/components/select-time/RightPanel/index.d.ts +9 -0
- package/lib/components/select-time/RightPanel/index.js +78 -0
- package/lib/components/select-time/RightPanel/index.less +22 -0
- package/lib/components/select-time/index.d.ts +14 -0
- package/lib/components/select-time/index.js +145 -0
- package/lib/components/select-time/index.less +16 -0
- package/lib/components/select-time/utils.d.ts +9 -0
- package/lib/components/select-time/utils.js +71 -0
- package/lib/components/table/Table/fields/select/filterUtil/index.js +7 -1
- package/lib/components/table/hooks/useTransDataSource.js +1 -0
- package/lib/components/table/index.js +16 -4
- package/lib/components/table/index.less +47 -2
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +18 -0
- package/lib/components/virtual-keyboard/Keyboard/index.js +81 -0
- package/lib/components/virtual-keyboard/Keyboard/index.less +32 -0
- package/lib/components/virtual-keyboard/Time/index.d.ts +13 -0
- package/lib/components/virtual-keyboard/Time/index.js +166 -0
- package/lib/components/virtual-keyboard/Time/index.less +0 -0
- package/lib/components/virtual-keyboard/Time/utils.d.ts +10 -0
- package/lib/components/virtual-keyboard/Time/utils.js +162 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +9 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +90 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.less +52 -0
- package/lib/components/virtual-keyboard/index.d.ts +14 -0
- package/lib/components/virtual-keyboard/index.js +131 -0
- package/lib/components/virtual-keyboard/index.less +17 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/locales/en-US.d.ts +14 -0
- package/lib/locales/en-US.js +15 -1
- package/lib/locales/zh-CN.d.ts +14 -0
- package/lib/locales/zh-CN.js +15 -1
- package/lib/locales/zh-TW.d.ts +14 -0
- package/lib/locales/zh-TW.js +15 -1
- package/lowcode/batch-editor/meta.ts +93 -0
- package/lowcode/select-time/meta.ts +8 -8
- package/package.json +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, { useMemo, useEffect } from "react";
|
|
2
|
+
import VirtualKeyboard from "../index";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
import { formatStringToTime } from "./utils.tsx";
|
|
5
|
+
import { getText } from "../../../locales";
|
|
6
|
+
import dayjs from "dayjs";
|
|
7
|
+
var items = [{
|
|
8
|
+
value: 1,
|
|
9
|
+
label: "1",
|
|
10
|
+
disabled: false,
|
|
11
|
+
type: "text"
|
|
12
|
+
}, {
|
|
13
|
+
value: 2,
|
|
14
|
+
label: "2",
|
|
15
|
+
disabled: false,
|
|
16
|
+
type: "text"
|
|
17
|
+
}, {
|
|
18
|
+
value: 3,
|
|
19
|
+
label: "3",
|
|
20
|
+
disabled: false,
|
|
21
|
+
type: "text"
|
|
22
|
+
}, {
|
|
23
|
+
value: 4,
|
|
24
|
+
label: "4",
|
|
25
|
+
disabled: false,
|
|
26
|
+
type: "text"
|
|
27
|
+
}, {
|
|
28
|
+
value: 5,
|
|
29
|
+
label: "5",
|
|
30
|
+
disabled: false,
|
|
31
|
+
type: "text"
|
|
32
|
+
}, {
|
|
33
|
+
value: 6,
|
|
34
|
+
label: "6",
|
|
35
|
+
disabled: false,
|
|
36
|
+
type: "text"
|
|
37
|
+
}, {
|
|
38
|
+
value: 7,
|
|
39
|
+
label: "7",
|
|
40
|
+
disabled: false,
|
|
41
|
+
type: "text"
|
|
42
|
+
}, {
|
|
43
|
+
value: 8,
|
|
44
|
+
label: "8",
|
|
45
|
+
disabled: false,
|
|
46
|
+
type: "text"
|
|
47
|
+
}, {
|
|
48
|
+
value: 9,
|
|
49
|
+
label: "9",
|
|
50
|
+
disabled: false,
|
|
51
|
+
type: "text"
|
|
52
|
+
}, {
|
|
53
|
+
value: "now",
|
|
54
|
+
label: getText("virtual-keyboard-time-now"),
|
|
55
|
+
disabled: false,
|
|
56
|
+
type: "text",
|
|
57
|
+
style: {
|
|
58
|
+
color: "#7f56d9"
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
value: "0",
|
|
62
|
+
label: "0",
|
|
63
|
+
disabled: false,
|
|
64
|
+
type: "text"
|
|
65
|
+
}, {
|
|
66
|
+
value: "ok",
|
|
67
|
+
label: getText("virtual-keyboard-time-ok"),
|
|
68
|
+
disabled: false,
|
|
69
|
+
type: "primary"
|
|
70
|
+
}];
|
|
71
|
+
var VirtualKeyboardTime = function VirtualKeyboardTime(props) {
|
|
72
|
+
var _onChange2 = props.onChange,
|
|
73
|
+
onEnter = props.onEnter,
|
|
74
|
+
style = props.style,
|
|
75
|
+
className = props.className,
|
|
76
|
+
_props$value = props.value,
|
|
77
|
+
value = _props$value === void 0 ? "" : _props$value,
|
|
78
|
+
rightPanel = props.rightPanel;
|
|
79
|
+
useEffect(function () {
|
|
80
|
+
document.body.id = "body";
|
|
81
|
+
}, []);
|
|
82
|
+
var res = useMemo(function () {
|
|
83
|
+
return formatStringToTime(value);
|
|
84
|
+
}, [value]);
|
|
85
|
+
var _onChange = function _onChange(current) {
|
|
86
|
+
if (current === "ok") {
|
|
87
|
+
onEnter === null || onEnter === void 0 ? void 0 : onEnter(formatStringToTime(value));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (current === "now") {
|
|
91
|
+
onEnter === null || onEnter === void 0 ? void 0 : onEnter(dayjs().format("HH:mm"));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
var _val = res.valueString + current;
|
|
95
|
+
if (res.valueString.length === 4) {
|
|
96
|
+
_val = current + "";
|
|
97
|
+
}
|
|
98
|
+
if (document.querySelector(".virtual-keyboard-input-select")) {
|
|
99
|
+
_val = current + "";
|
|
100
|
+
}
|
|
101
|
+
_onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(formatStringToTime(_val));
|
|
102
|
+
};
|
|
103
|
+
return /*#__PURE__*/React.createElement(VirtualKeyboard, {
|
|
104
|
+
className: className,
|
|
105
|
+
style: style,
|
|
106
|
+
keyboardProps: {
|
|
107
|
+
items: items,
|
|
108
|
+
onChange: function onChange(current) {
|
|
109
|
+
_onChange(current);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
virtualKeyInputProps: {
|
|
113
|
+
value: value,
|
|
114
|
+
onChange: function onChange(e) {
|
|
115
|
+
_onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(formatStringToTime(e.target.value));
|
|
116
|
+
},
|
|
117
|
+
renderInput: function renderInput() {
|
|
118
|
+
return res === null || res === void 0 ? void 0 : res.previewValueArrayDom;
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
rightPanel: rightPanel
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
export default VirtualKeyboardTime;
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const formatStringToTime: (value: string) => {
|
|
3
|
+
valueArray: string[];
|
|
4
|
+
valueString: string;
|
|
5
|
+
previewValueArray: string[];
|
|
6
|
+
previewValueArrayDom: import("react").JSX.Element[];
|
|
7
|
+
previewValueString: string;
|
|
8
|
+
disabled: never[];
|
|
9
|
+
};
|
|
10
|
+
export declare const fn: () => void;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
var getStringAtPosition = function getStringAtPosition(str, pos) {
|
|
8
|
+
if (pos < 0 || pos >= str.length) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return str.charAt(pos);
|
|
12
|
+
};
|
|
13
|
+
var getNum1 = function getNum1(arr, str) {
|
|
14
|
+
var num1 = getStringAtPosition(str, 0);
|
|
15
|
+
// 第一位
|
|
16
|
+
if (Number(num1) < 3) {
|
|
17
|
+
arr[0] = num1;
|
|
18
|
+
return arr;
|
|
19
|
+
}
|
|
20
|
+
arr[0] = "0";
|
|
21
|
+
arr[1] = num1;
|
|
22
|
+
return arr;
|
|
23
|
+
};
|
|
24
|
+
var getNum2 = function getNum2(arr, num2) {
|
|
25
|
+
var num1 = arr[0];
|
|
26
|
+
// 0 1 2
|
|
27
|
+
if (arr.length < 2) {
|
|
28
|
+
// 0 1
|
|
29
|
+
if (Number(num1) < 2) {
|
|
30
|
+
arr[1] = num2;
|
|
31
|
+
return arr;
|
|
32
|
+
} else {
|
|
33
|
+
// 2
|
|
34
|
+
if (Number(num1) === 2) {
|
|
35
|
+
if (Number(num2) < 4) {
|
|
36
|
+
arr[1] = num2;
|
|
37
|
+
return arr;
|
|
38
|
+
} else {
|
|
39
|
+
if (Number(num2) <= 5) {
|
|
40
|
+
arr[1] = "0";
|
|
41
|
+
arr[2] = num2;
|
|
42
|
+
return arr;
|
|
43
|
+
}
|
|
44
|
+
arr[1] = "0";
|
|
45
|
+
arr[2] = "0";
|
|
46
|
+
arr[3] = num2;
|
|
47
|
+
return arr;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 03 04 05 06
|
|
54
|
+
if (Number(num2) < 6) {
|
|
55
|
+
arr[2] = num2;
|
|
56
|
+
return arr;
|
|
57
|
+
} else {
|
|
58
|
+
arr[2] = "0";
|
|
59
|
+
arr[3] = num2;
|
|
60
|
+
return arr;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var getNum3 = function getNum3(arr, num3) {
|
|
64
|
+
// 01 02 10 12 22 23
|
|
65
|
+
if (arr.length === 2) {
|
|
66
|
+
if (Number(num3) < 6) {
|
|
67
|
+
arr[2] = num3;
|
|
68
|
+
return arr;
|
|
69
|
+
} else {
|
|
70
|
+
arr[2] = "0";
|
|
71
|
+
arr[3] = num3;
|
|
72
|
+
return arr;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// 010 012 123 234
|
|
76
|
+
arr[3] = num3;
|
|
77
|
+
return arr;
|
|
78
|
+
};
|
|
79
|
+
var getNum4 = function getNum4(arr, num4) {
|
|
80
|
+
arr[3] = num4;
|
|
81
|
+
return arr;
|
|
82
|
+
};
|
|
83
|
+
var formatArray = function formatArray(arr) {
|
|
84
|
+
var _arr = _toConsumableArray(arr);
|
|
85
|
+
while (_arr.length < 4) {
|
|
86
|
+
_arr.push("0");
|
|
87
|
+
}
|
|
88
|
+
_arr.splice(2, "0", ":");
|
|
89
|
+
return _arr;
|
|
90
|
+
};
|
|
91
|
+
var formatRes = function formatRes(arr) {
|
|
92
|
+
var valueArray = _toConsumableArray(arr);
|
|
93
|
+
var previewValueArray = formatArray(arr);
|
|
94
|
+
var previewValueArrayDom = null;
|
|
95
|
+
if (valueArray.length > 2) {
|
|
96
|
+
valueArray.splice(2, "0", ":");
|
|
97
|
+
}
|
|
98
|
+
previewValueArrayDom = previewValueArray.map(function (d, i) {
|
|
99
|
+
if (valueArray[i]) {
|
|
100
|
+
return /*#__PURE__*/React.createElement("span", null, d);
|
|
101
|
+
} else {
|
|
102
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
103
|
+
style: {
|
|
104
|
+
color: "#98A2B3"
|
|
105
|
+
}
|
|
106
|
+
}, d);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
valueArray: valueArray,
|
|
111
|
+
valueString: arr.join(""),
|
|
112
|
+
previewValueArray: formatArray(arr),
|
|
113
|
+
previewValueArrayDom: previewValueArrayDom,
|
|
114
|
+
previewValueString: formatArray(arr).join(""),
|
|
115
|
+
disabled: []
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// 将字符串自动转换成Time
|
|
120
|
+
export var formatStringToTime = function formatStringToTime(value) {
|
|
121
|
+
var arr = [];
|
|
122
|
+
var str = value.replace(":", "");
|
|
123
|
+
if (str.length >= 5) {
|
|
124
|
+
str = "";
|
|
125
|
+
}
|
|
126
|
+
var num2 = getStringAtPosition(str, 1);
|
|
127
|
+
var num3 = getStringAtPosition(str, 2);
|
|
128
|
+
var num4 = getStringAtPosition(str, 3);
|
|
129
|
+
if (!str.length) {
|
|
130
|
+
return formatRes(arr);
|
|
131
|
+
}
|
|
132
|
+
arr = getNum1(arr, str);
|
|
133
|
+
// 第二位
|
|
134
|
+
|
|
135
|
+
if (num2 !== undefined) {
|
|
136
|
+
arr = getNum2(arr, num2);
|
|
137
|
+
if (arr.length === 4) {
|
|
138
|
+
return formatRes(arr);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (num3 !== undefined) {
|
|
142
|
+
arr = getNum3(arr, num3);
|
|
143
|
+
if (arr.length === 4) {
|
|
144
|
+
return formatRes(arr);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (num4 !== undefined) {
|
|
148
|
+
arr = getNum4(arr, num4);
|
|
149
|
+
return formatRes(arr);
|
|
150
|
+
}
|
|
151
|
+
return formatRes(arr);
|
|
152
|
+
};
|
|
153
|
+
export var fn = function fn() {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputProps } from "antd";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
export interface VirtualKeyInputProps extends InputProps {
|
|
5
|
+
previewValue?: string;
|
|
6
|
+
renderInput?: (props: any) => any;
|
|
7
|
+
}
|
|
8
|
+
declare const VirtualKeyInput: (props: VirtualKeyInputProps) => React.JSX.Element;
|
|
9
|
+
export default VirtualKeyInput;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
import React, { useEffect, useState } from "react";
|
|
9
|
+
import { Input } from "antd";
|
|
10
|
+
import { Delete } from "@pisell/icon";
|
|
11
|
+
import { useEventListener } from "ahooks";
|
|
12
|
+
import classNames from "classnames";
|
|
13
|
+
import "./index.less";
|
|
14
|
+
var list = ["Backspace"];
|
|
15
|
+
var VirtualKeyInput = function VirtualKeyInput(props) {
|
|
16
|
+
var _props$previewValue = props.previewValue,
|
|
17
|
+
previewValue = _props$previewValue === void 0 ? props.value : _props$previewValue,
|
|
18
|
+
value = props.value;
|
|
19
|
+
var _useState = useState(false),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
select = _useState2[0],
|
|
22
|
+
setSelect = _useState2[1];
|
|
23
|
+
useEventListener("keydown", function (ev) {
|
|
24
|
+
if (list.includes(ev.key)) {
|
|
25
|
+
_onDelete === null || _onDelete === void 0 ? void 0 : _onDelete();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
if (value) {
|
|
30
|
+
setSelect(false);
|
|
31
|
+
}
|
|
32
|
+
}, [value]);
|
|
33
|
+
var _onDelete = function _onDelete() {
|
|
34
|
+
if (select) {
|
|
35
|
+
var _props$onChange;
|
|
36
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
|
37
|
+
target: {
|
|
38
|
+
value: ""
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
setSelect(false);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
var _val = props.value + "";
|
|
45
|
+
_val = _val.slice(0, _val.length - 1);
|
|
46
|
+
props.onChange && props.onChange({
|
|
47
|
+
target: {
|
|
48
|
+
value: _val
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: "virtual-keyboard-input-wrap"
|
|
54
|
+
}, props.renderInput ? /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: classNames("virtual-keyboard-input", {
|
|
56
|
+
"virtual-keyboard-input-select": select
|
|
57
|
+
}),
|
|
58
|
+
onClick: function onClick() {
|
|
59
|
+
if (value) {
|
|
60
|
+
setSelect(!select);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, props.renderInput(props)) : /*#__PURE__*/React.createElement(Input, _extends({
|
|
64
|
+
className: "virtual-keyboard-input",
|
|
65
|
+
bordered: false
|
|
66
|
+
}, props, {
|
|
67
|
+
readOnly: true,
|
|
68
|
+
value: previewValue
|
|
69
|
+
})), value !== null && value !== void 0 && value.length ? /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: "virtual-keyboard-input-delete",
|
|
71
|
+
onClick: _onDelete
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Delete, {
|
|
73
|
+
className: "virtual-keyboard-input-delete-icon"
|
|
74
|
+
})) : null);
|
|
75
|
+
};
|
|
76
|
+
export default VirtualKeyInput;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.virtual-keyboard-input-wrap {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100px;
|
|
4
|
+
margin-bottom: 10px;
|
|
5
|
+
border-radius: 5px;
|
|
6
|
+
background: var(--Base-White, #FFF);
|
|
7
|
+
box-shadow: 0px 1px 0px 0px #898A8D;
|
|
8
|
+
position: relative;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
|
|
14
|
+
.virtual-keyboard-input-delete {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
padding-right: 30px;
|
|
20
|
+
padding-left: 12px;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
font-size: 50px;
|
|
23
|
+
background-color: #fff;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
user-select: none;
|
|
28
|
+
|
|
29
|
+
.virtual-keyboard-input-delete-icon {
|
|
30
|
+
font-size: 30px;
|
|
31
|
+
color: #000;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.virtual-keyboard-input {
|
|
36
|
+
height: 100%;
|
|
37
|
+
text-align: center;
|
|
38
|
+
color: var(--Base-Black, #000);
|
|
39
|
+
font-size: 60px;
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
letter-spacing: -1.2px;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
user-select: none;
|
|
46
|
+
|
|
47
|
+
&.virtual-keyboard-input-select {
|
|
48
|
+
background-color: #7f56d938;
|
|
49
|
+
border-radius: 8px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { KeyboardProps } from "./Keyboard";
|
|
3
|
+
import { VirtualKeyInputProps } from "./VirtualKeyInput";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
interface VirtualKeyboardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
keyboardProps?: KeyboardProps;
|
|
7
|
+
virtualKeyInputProps?: VirtualKeyInputProps;
|
|
8
|
+
rightPanel?: React.ReactNode;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
onChange?: (value?: any) => void;
|
|
11
|
+
value?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const VirtualKeyboard: (props: VirtualKeyboardProps) => React.JSX.Element;
|
|
14
|
+
export default VirtualKeyboard;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React, { useEffect } from "react";
|
|
3
|
+
import Keyboard from "./Keyboard";
|
|
4
|
+
import VirtualKeyInput from "./VirtualKeyInput";
|
|
5
|
+
import "./index.less";
|
|
6
|
+
import classNames from "classnames";
|
|
7
|
+
var items = [{
|
|
8
|
+
value: 1,
|
|
9
|
+
label: "1",
|
|
10
|
+
disabled: false,
|
|
11
|
+
type: "text"
|
|
12
|
+
}, {
|
|
13
|
+
value: 2,
|
|
14
|
+
label: "2",
|
|
15
|
+
disabled: false,
|
|
16
|
+
type: "text"
|
|
17
|
+
}, {
|
|
18
|
+
value: 3,
|
|
19
|
+
label: "3",
|
|
20
|
+
disabled: false,
|
|
21
|
+
type: "text"
|
|
22
|
+
}, {
|
|
23
|
+
value: 4,
|
|
24
|
+
label: "4",
|
|
25
|
+
disabled: false,
|
|
26
|
+
type: "text"
|
|
27
|
+
}, {
|
|
28
|
+
value: 5,
|
|
29
|
+
label: "5",
|
|
30
|
+
disabled: false,
|
|
31
|
+
type: "text"
|
|
32
|
+
}, {
|
|
33
|
+
value: 6,
|
|
34
|
+
label: "6",
|
|
35
|
+
disabled: false,
|
|
36
|
+
type: "text"
|
|
37
|
+
}, {
|
|
38
|
+
value: 7,
|
|
39
|
+
label: "7",
|
|
40
|
+
disabled: false,
|
|
41
|
+
type: "text"
|
|
42
|
+
}, {
|
|
43
|
+
value: 8,
|
|
44
|
+
label: "8",
|
|
45
|
+
disabled: false,
|
|
46
|
+
type: "text"
|
|
47
|
+
}, {
|
|
48
|
+
value: 9,
|
|
49
|
+
label: "9",
|
|
50
|
+
disabled: false,
|
|
51
|
+
type: "text"
|
|
52
|
+
}, {
|
|
53
|
+
value: "0",
|
|
54
|
+
label: "0",
|
|
55
|
+
disabled: false,
|
|
56
|
+
type: "text"
|
|
57
|
+
}, {
|
|
58
|
+
value: "ok",
|
|
59
|
+
label: "OK",
|
|
60
|
+
disabled: false,
|
|
61
|
+
type: "primary"
|
|
62
|
+
}];
|
|
63
|
+
var VirtualKeyboard = function VirtualKeyboard(props) {
|
|
64
|
+
var virtualKeyInputProps = props.virtualKeyInputProps,
|
|
65
|
+
style = props.style,
|
|
66
|
+
className = props.className,
|
|
67
|
+
keyboardProps = props.keyboardProps,
|
|
68
|
+
onChange = props.onChange,
|
|
69
|
+
value = props.value,
|
|
70
|
+
rightPanel = props.rightPanel;
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
document.body.id = "body";
|
|
73
|
+
}, []);
|
|
74
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: classNames("virtual-keyboard-component", className),
|
|
76
|
+
style: style
|
|
77
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: classNames("virtual-keyboard-component-left")
|
|
79
|
+
}, /*#__PURE__*/React.createElement(VirtualKeyInput, virtualKeyInputProps), /*#__PURE__*/React.createElement(Keyboard, _extends({
|
|
80
|
+
items: items
|
|
81
|
+
}, keyboardProps))), rightPanel ? /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: "virtual-keyboard-component-right"
|
|
83
|
+
}, rightPanel) : null);
|
|
84
|
+
};
|
|
85
|
+
export default VirtualKeyboard;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.virtual-keyboard-component {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 20px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.virtual-keyboard-component-left {
|
|
8
|
+
padding: 10px;
|
|
9
|
+
width: 380px;
|
|
10
|
+
border-radius: 10px;
|
|
11
|
+
background: var(--Gray-300, #D0D5DD);
|
|
12
|
+
backdrop-filter: blur(50px);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.virtual-keyboard-component-right {
|
|
16
|
+
align-self: stretch;
|
|
17
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -73,4 +73,8 @@ export { default as Sort } from "./components/sort";
|
|
|
73
73
|
export { default as InputNumberRange } from "./components/input-number-range";
|
|
74
74
|
export { default as LowCodePage } from "./components/lowCodePage";
|
|
75
75
|
export { default as Segmented } from "./components/segmented";
|
|
76
|
+
export { default as VirtualKeyboard } from "./components/virtual-keyboard";
|
|
77
|
+
export { default as VirtualKeyboardTime } from "./components/virtual-keyboard/Time";
|
|
78
|
+
export { default as SelectTime } from "./components/select-time";
|
|
76
79
|
export { default as AutoCompleteNumber } from "./components/auto-complete-number";
|
|
80
|
+
export { default as BatchEditor } from "./components/batch-editor";
|
package/es/index.js
CHANGED
|
@@ -93,4 +93,8 @@ export { default as Sort } from "./components/sort";
|
|
|
93
93
|
export { default as InputNumberRange } from "./components/input-number-range";
|
|
94
94
|
export { default as LowCodePage } from "./components/lowCodePage";
|
|
95
95
|
export { default as Segmented } from "./components/segmented";
|
|
96
|
-
export { default as
|
|
96
|
+
export { default as VirtualKeyboard } from "./components/virtual-keyboard";
|
|
97
|
+
export { default as VirtualKeyboardTime } from "./components/virtual-keyboard/Time";
|
|
98
|
+
export { default as SelectTime } from "./components/select-time";
|
|
99
|
+
export { default as AutoCompleteNumber } from "./components/auto-complete-number";
|
|
100
|
+
export { default as BatchEditor } from "./components/batch-editor";
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -35,5 +35,19 @@ declare const _default: {
|
|
|
35
35
|
"table-action-range-picker-presets-last-14-day": string;
|
|
36
36
|
"table-action-range-picker-presets-last-30-day": string;
|
|
37
37
|
"table-action-range-picker-presets-last-90-day": string;
|
|
38
|
+
"virtual-keyboard-time-now": string;
|
|
39
|
+
"virtual-keyboard-time-ok": string;
|
|
40
|
+
'batch-editor-batch-edit': string;
|
|
41
|
+
'batch-editor-actions': string;
|
|
42
|
+
'batch-editor-remove': string;
|
|
43
|
+
'batch-editor-price': string;
|
|
44
|
+
'batch-editor-cancel': string;
|
|
45
|
+
'batch-editor-search': string;
|
|
46
|
+
'batch-editor-confirm': string;
|
|
47
|
+
'batch-editor-batch-remove': string;
|
|
48
|
+
'batch-editor-quick-edit': string;
|
|
49
|
+
'batch-editor-what-price': string;
|
|
50
|
+
'batch-editor-quick-edit-title': (product: string, num: string) => string;
|
|
51
|
+
'batch-editor-quick-edit-title-2': (product: string) => string;
|
|
38
52
|
};
|
|
39
53
|
export default _default;
|
package/es/locales/en-US.js
CHANGED
|
@@ -40,5 +40,23 @@ export default {
|
|
|
40
40
|
"table-action-range-picker-presets-last-7-day": "Last 7 Days",
|
|
41
41
|
"table-action-range-picker-presets-last-14-day": "Last 14 Days",
|
|
42
42
|
"table-action-range-picker-presets-last-30-day": "Last 30 Days",
|
|
43
|
-
"table-action-range-picker-presets-last-90-day": "Last 90 Days"
|
|
43
|
+
"table-action-range-picker-presets-last-90-day": "Last 90 Days",
|
|
44
|
+
"virtual-keyboard-time-now": "Now",
|
|
45
|
+
"virtual-keyboard-time-ok": "OK",
|
|
46
|
+
'batch-editor-batch-edit': 'Batch edit',
|
|
47
|
+
'batch-editor-actions': 'Actions',
|
|
48
|
+
'batch-editor-remove': 'Remove',
|
|
49
|
+
'batch-editor-price': 'Price',
|
|
50
|
+
'batch-editor-cancel': 'Cancel',
|
|
51
|
+
'batch-editor-search': 'Search',
|
|
52
|
+
'batch-editor-confirm': 'Confirm',
|
|
53
|
+
'batch-editor-batch-remove': 'Batch remove',
|
|
54
|
+
'batch-editor-quick-edit': 'Quick edit',
|
|
55
|
+
'batch-editor-what-price': "What price",
|
|
56
|
+
'batch-editor-quick-edit-title': function batchEditorQuickEditTitle(product, num) {
|
|
57
|
+
return "You have selected ".concat(num, " products including ").concat(product);
|
|
58
|
+
},
|
|
59
|
+
'batch-editor-quick-edit-title-2': function batchEditorQuickEditTitle2(product) {
|
|
60
|
+
return "You have selected ".concat(product);
|
|
61
|
+
}
|
|
44
62
|
};
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -35,5 +35,19 @@ declare const _default: {
|
|
|
35
35
|
"table-action-range-picker-presets-last-14-day": string;
|
|
36
36
|
"table-action-range-picker-presets-last-30-day": string;
|
|
37
37
|
"table-action-range-picker-presets-last-90-day": string;
|
|
38
|
+
"virtual-keyboard-time-now": string;
|
|
39
|
+
"virtual-keyboard-time-ok": string;
|
|
40
|
+
'batch-editor-batch-edit': string;
|
|
41
|
+
'batch-editor-actions': string;
|
|
42
|
+
'batch-editor-remove': string;
|
|
43
|
+
'batch-editor-price': string;
|
|
44
|
+
'batch-editor-cancel': string;
|
|
45
|
+
'batch-editor-search': string;
|
|
46
|
+
'batch-editor-confirm': string;
|
|
47
|
+
'batch-editor-batch-remove': string;
|
|
48
|
+
'batch-editor-quick-edit': string;
|
|
49
|
+
'batch-editor-what-price': string;
|
|
50
|
+
'batch-editor-quick-edit-title': (product: string, num: string) => string;
|
|
51
|
+
'batch-editor-quick-edit-title-2': (product: string) => string;
|
|
38
52
|
};
|
|
39
53
|
export default _default;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -40,5 +40,23 @@ export default {
|
|
|
40
40
|
"table-action-range-picker-presets-last-7-day": "过去7天",
|
|
41
41
|
"table-action-range-picker-presets-last-14-day": "过去14天",
|
|
42
42
|
"table-action-range-picker-presets-last-30-day": "过去30天",
|
|
43
|
-
"table-action-range-picker-presets-last-90-day": "过去90天"
|
|
43
|
+
"table-action-range-picker-presets-last-90-day": "过去90天",
|
|
44
|
+
"virtual-keyboard-time-now": "此刻",
|
|
45
|
+
"virtual-keyboard-time-ok": "确定",
|
|
46
|
+
'batch-editor-batch-edit': '批量编辑',
|
|
47
|
+
'batch-editor-actions': '操作',
|
|
48
|
+
'batch-editor-remove': '移除',
|
|
49
|
+
'batch-editor-price': '价格',
|
|
50
|
+
'batch-editor-cancel': '取消',
|
|
51
|
+
'batch-editor-search': '搜索',
|
|
52
|
+
'batch-editor-confirm': '确认',
|
|
53
|
+
'batch-editor-batch-remove': '批量移除',
|
|
54
|
+
'batch-editor-quick-edit': '快速编辑',
|
|
55
|
+
'batch-editor-what-price': "什么价格",
|
|
56
|
+
'batch-editor-quick-edit-title': function batchEditorQuickEditTitle(product, num) {
|
|
57
|
+
return "\u60A8\u5DF2\u9009\u62E9 ".concat(product, " \u7B49").concat(num, "\u4EF6\u5546\u54C1");
|
|
58
|
+
},
|
|
59
|
+
'batch-editor-quick-edit-title-2': function batchEditorQuickEditTitle2(product) {
|
|
60
|
+
return "\u60A8\u5DF2\u9009\u62E9 ".concat(product);
|
|
61
|
+
}
|
|
44
62
|
};
|