@pisell/materials 3.0.12 → 3.0.13
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/es/components/page/index.js +1 -0
- package/es/index.d.ts +0 -3
- package/es/index.js +0 -3
- package/es/locales/en-US.d.ts +0 -2
- package/es/locales/en-US.js +1 -3
- package/es/locales/zh-CN.d.ts +0 -2
- package/es/locales/zh-CN.js +1 -3
- package/es/locales/zh-TW.d.ts +0 -2
- package/es/locales/zh-TW.js +1 -3
- package/lib/components/page/index.js +1 -0
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -9
- package/lib/locales/en-US.d.ts +0 -2
- package/lib/locales/en-US.js +1 -3
- package/lib/locales/zh-CN.d.ts +0 -2
- package/lib/locales/zh-CN.js +1 -3
- package/lib/locales/zh-TW.d.ts +0 -2
- package/lib/locales/zh-TW.js +1 -3
- package/package.json +2 -2
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
- package/es/components/select-time/RightPanel/index.d.ts +0 -9
- package/es/components/select-time/RightPanel/index.js +0 -45
- package/es/components/select-time/RightPanel/index.less +0 -22
- package/es/components/select-time/index.d.ts +0 -14
- package/es/components/select-time/index.js +0 -115
- package/es/components/select-time/index.less +0 -16
- package/es/components/select-time/utils.d.ts +0 -9
- package/es/components/select-time/utils.js +0 -42
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +0 -18
- package/es/components/virtual-keyboard/Keyboard/index.js +0 -51
- package/es/components/virtual-keyboard/Keyboard/index.less +0 -32
- package/es/components/virtual-keyboard/Time/index.d.ts +0 -13
- package/es/components/virtual-keyboard/Time/index.js +0 -124
- package/es/components/virtual-keyboard/Time/index.less +0 -0
- package/es/components/virtual-keyboard/Time/utils.d.ts +0 -10
- package/es/components/virtual-keyboard/Time/utils.js +0 -153
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -9
- package/es/components/virtual-keyboard/VirtualKeyInput/index.js +0 -76
- package/es/components/virtual-keyboard/VirtualKeyInput/index.less +0 -52
- package/es/components/virtual-keyboard/index.d.ts +0 -14
- package/es/components/virtual-keyboard/index.js +0 -85
- package/es/components/virtual-keyboard/index.less +0 -17
- package/lib/components/select-time/RightPanel/index.d.ts +0 -9
- package/lib/components/select-time/RightPanel/index.js +0 -78
- package/lib/components/select-time/RightPanel/index.less +0 -22
- package/lib/components/select-time/index.d.ts +0 -14
- package/lib/components/select-time/index.js +0 -145
- package/lib/components/select-time/index.less +0 -16
- package/lib/components/select-time/utils.d.ts +0 -9
- package/lib/components/select-time/utils.js +0 -71
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +0 -18
- package/lib/components/virtual-keyboard/Keyboard/index.js +0 -81
- package/lib/components/virtual-keyboard/Keyboard/index.less +0 -32
- package/lib/components/virtual-keyboard/Time/index.d.ts +0 -13
- package/lib/components/virtual-keyboard/Time/index.js +0 -166
- package/lib/components/virtual-keyboard/Time/index.less +0 -0
- package/lib/components/virtual-keyboard/Time/utils.d.ts +0 -10
- package/lib/components/virtual-keyboard/Time/utils.js +0 -162
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -9
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +0 -90
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.less +0 -52
- package/lib/components/virtual-keyboard/index.d.ts +0 -14
- package/lib/components/virtual-keyboard/index.js +0 -131
- package/lib/components/virtual-keyboard/index.less +0 -17
|
@@ -1,153 +0,0 @@
|
|
|
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() {};
|
|
@@ -1,9 +0,0 @@
|
|
|
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;
|
|
@@ -1,76 +0,0 @@
|
|
|
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;
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
|
@@ -1,85 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/components/select-time/RightPanel/index.tsx
|
|
30
|
-
var RightPanel_exports = {};
|
|
31
|
-
__export(RightPanel_exports, {
|
|
32
|
-
default: () => RightPanel_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(RightPanel_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_index = require("./index.less");
|
|
37
|
-
var import_utils = require("../utils");
|
|
38
|
-
var import_classnames = __toESM(require("classnames"));
|
|
39
|
-
var RightPanel = (props) => {
|
|
40
|
-
const { value, onChange, slice = 5 } = props;
|
|
41
|
-
const list = (0, import_react.useMemo)(() => {
|
|
42
|
-
return (0, import_utils.sliceDayIntoFiveMinutes)(slice);
|
|
43
|
-
}, [slice]);
|
|
44
|
-
(0, import_react.useEffect)(() => {
|
|
45
|
-
console.log(
|
|
46
|
-
(0, import_utils.findNextSlice)({
|
|
47
|
-
timeSlices: list,
|
|
48
|
-
date: value
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
let nextTime = (0, import_utils.findNextSlice)({
|
|
52
|
-
timeSlices: list,
|
|
53
|
-
date: value
|
|
54
|
-
});
|
|
55
|
-
let scrollDom = document.querySelector(".select-time-right-panel-list");
|
|
56
|
-
const timeDom = document.querySelector(`#time${nextTime.replace(":", "")}`);
|
|
57
|
-
if (scrollDom && timeDom) {
|
|
58
|
-
scrollDom.scrollTop = timeDom.offsetTop;
|
|
59
|
-
}
|
|
60
|
-
}, [value]);
|
|
61
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "select-time-right-panel" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "select-time-right-panel-list" }, list.map((d) => {
|
|
62
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
className: (0, import_classnames.default)("select-time-right-panel-item", {
|
|
66
|
-
"select-time-right-panel-item-active": d.value === value
|
|
67
|
-
}),
|
|
68
|
-
key: d.value,
|
|
69
|
-
id: "time" + d.value.replace(":", ""),
|
|
70
|
-
onClick: () => {
|
|
71
|
-
onChange(d.value);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
d.label
|
|
75
|
-
);
|
|
76
|
-
})));
|
|
77
|
-
};
|
|
78
|
-
var RightPanel_default = RightPanel;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
.select-time-right-panel {}
|
|
2
|
-
|
|
3
|
-
.select-time-right-panel-list {
|
|
4
|
-
width: 184px;
|
|
5
|
-
max-height: 511px;
|
|
6
|
-
overflow: auto;
|
|
7
|
-
|
|
8
|
-
.select-time-right-panel-item {
|
|
9
|
-
padding: 16px 8px;
|
|
10
|
-
border-radius: 8px;
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
color: var(--Text-Text_1, #1B1B1B);
|
|
13
|
-
font-size: 24px;
|
|
14
|
-
font-style: normal;
|
|
15
|
-
font-weight: 500;
|
|
16
|
-
|
|
17
|
-
&.select-time-right-panel-item-active,
|
|
18
|
-
&:hover {
|
|
19
|
-
background: var(--Gray-100, #F2F4F7);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VirtualKeyboardTimeProps } from "../virtual-keyboard/Time";
|
|
3
|
-
import { PopoverProps, TimePickerProps } from "antd";
|
|
4
|
-
import "./index.less";
|
|
5
|
-
interface SelectTimeProps {
|
|
6
|
-
value: any;
|
|
7
|
-
onChange: (e: string) => void;
|
|
8
|
-
popoverProps: PopoverProps;
|
|
9
|
-
timePickerProps: TimePickerProps;
|
|
10
|
-
timeProps: VirtualKeyboardTimeProps;
|
|
11
|
-
slice: number;
|
|
12
|
-
}
|
|
13
|
-
declare const SelectTime: (props: SelectTimeProps) => React.JSX.Element;
|
|
14
|
-
export default SelectTime;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/components/select-time/index.tsx
|
|
30
|
-
var select_time_exports = {};
|
|
31
|
-
__export(select_time_exports, {
|
|
32
|
-
default: () => select_time_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(select_time_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_Time = __toESM(require("../virtual-keyboard/Time"));
|
|
37
|
-
var import_antd = require("antd");
|
|
38
|
-
var import_RightPanel = __toESM(require("./RightPanel"));
|
|
39
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
40
|
-
var import_index = require("./index.less");
|
|
41
|
-
var SelectTime = (props) => {
|
|
42
|
-
const { onChange, value, popoverProps, timePickerProps, timeProps, slice } = props;
|
|
43
|
-
const [open, setOpen] = (0, import_react.useState)(false);
|
|
44
|
-
const [_value, set_value] = (0, import_react.useState)("");
|
|
45
|
-
(0, import_react.useEffect)(() => {
|
|
46
|
-
set_value(value);
|
|
47
|
-
}, [value]);
|
|
48
|
-
const valueString = (0, import_react.useMemo)(() => {
|
|
49
|
-
if (!_value) {
|
|
50
|
-
return void 0;
|
|
51
|
-
}
|
|
52
|
-
if (typeof _value === "string") {
|
|
53
|
-
return _value;
|
|
54
|
-
}
|
|
55
|
-
return _value == null ? void 0 : _value.valueString;
|
|
56
|
-
}, [_value]);
|
|
57
|
-
const previewValueString = (0, import_react.useMemo)(() => {
|
|
58
|
-
if (!_value) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
if (typeof _value === "string") {
|
|
62
|
-
return _value;
|
|
63
|
-
}
|
|
64
|
-
return _value == null ? void 0 : _value.previewValueString;
|
|
65
|
-
}, [_value]);
|
|
66
|
-
const timePickerValue = (0, import_react.useMemo)(() => {
|
|
67
|
-
if (!previewValueString) {
|
|
68
|
-
return void 0;
|
|
69
|
-
}
|
|
70
|
-
return (0, import_dayjs.default)((0, import_dayjs.default)().format("YYYY-MM-DD") + " " + previewValueString);
|
|
71
|
-
}, [previewValueString]);
|
|
72
|
-
const _onChange = (e) => {
|
|
73
|
-
if (!open) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
set_value(e);
|
|
77
|
-
};
|
|
78
|
-
const onEnter = (e) => {
|
|
79
|
-
_onChange(e);
|
|
80
|
-
onOpenChange(false, (e == null ? void 0 : e.previewValueString) || e);
|
|
81
|
-
};
|
|
82
|
-
const onOpenChange = (e, _val = previewValueString) => {
|
|
83
|
-
setOpen(e);
|
|
84
|
-
if (e) {
|
|
85
|
-
} else {
|
|
86
|
-
if (_val === value) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
onChange == null ? void 0 : onChange(_val);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
(0, import_react.useEffect)(() => {
|
|
93
|
-
if (open) {
|
|
94
|
-
document.body.classList.add("hide-scroll");
|
|
95
|
-
} else {
|
|
96
|
-
setTimeout(() => {
|
|
97
|
-
document.body.classList.remove("hide-scroll");
|
|
98
|
-
}, 150);
|
|
99
|
-
}
|
|
100
|
-
}, [open]);
|
|
101
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
102
|
-
import_antd.Popover,
|
|
103
|
-
{
|
|
104
|
-
destroyTooltipOnHide: true,
|
|
105
|
-
content: /* @__PURE__ */ import_react.default.createElement(
|
|
106
|
-
import_Time.default,
|
|
107
|
-
{
|
|
108
|
-
onChange: _onChange,
|
|
109
|
-
value: valueString,
|
|
110
|
-
onEnter: (e) => {
|
|
111
|
-
onEnter(e);
|
|
112
|
-
},
|
|
113
|
-
rightPanel: /* @__PURE__ */ import_react.default.createElement(
|
|
114
|
-
import_RightPanel.default,
|
|
115
|
-
{
|
|
116
|
-
value: previewValueString,
|
|
117
|
-
onChange: onEnter,
|
|
118
|
-
slice
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
...timeProps
|
|
122
|
-
}
|
|
123
|
-
),
|
|
124
|
-
open,
|
|
125
|
-
placement: "bottom",
|
|
126
|
-
arrow: false,
|
|
127
|
-
onOpenChange,
|
|
128
|
-
trigger: ["click"],
|
|
129
|
-
...popoverProps
|
|
130
|
-
},
|
|
131
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
132
|
-
import_antd.TimePicker,
|
|
133
|
-
{
|
|
134
|
-
format: "HH:mm",
|
|
135
|
-
size: "large",
|
|
136
|
-
inputReadOnly: true,
|
|
137
|
-
allowClear: false,
|
|
138
|
-
open: false,
|
|
139
|
-
value: timePickerValue,
|
|
140
|
-
...timePickerProps
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
));
|
|
144
|
-
};
|
|
145
|
-
var select_time_default = SelectTime;
|