@pisell/materials 2.2.33 → 2.2.34
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/select-time/RightPanel/index.d.ts +2 -2
- package/es/components/select-time/RightPanel/index.js +7 -7
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Keyboard/index.js +10 -2
- package/lib/components/select-time/RightPanel/index.d.ts +2 -2
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Keyboard/index.js +15 -2
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useMemo, useEffect } from
|
|
1
|
+
import React, { useMemo, useEffect } from 'react';
|
|
2
2
|
import "./index.less";
|
|
3
3
|
import { sliceDayIntoFiveMinutes, findNextSlice } from "../utils";
|
|
4
|
-
import classNames from
|
|
4
|
+
import classNames from 'classnames';
|
|
5
5
|
var RightPanel = function RightPanel(props) {
|
|
6
6
|
var value = props.value,
|
|
7
7
|
onChange = props.onChange,
|
|
@@ -19,8 +19,8 @@ var RightPanel = function RightPanel(props) {
|
|
|
19
19
|
timeSlices: list,
|
|
20
20
|
date: value
|
|
21
21
|
});
|
|
22
|
-
var scrollDom = document.querySelector(
|
|
23
|
-
var timeDom = document.querySelector("#time".concat(nextTime.replace(
|
|
22
|
+
var scrollDom = document.querySelector('.select-time-right-panel-list');
|
|
23
|
+
var timeDom = document.querySelector("#time".concat(nextTime.replace(':', '')));
|
|
24
24
|
if (scrollDom && timeDom) {
|
|
25
25
|
scrollDom.scrollTop = timeDom.offsetTop;
|
|
26
26
|
}
|
|
@@ -31,11 +31,11 @@ var RightPanel = function RightPanel(props) {
|
|
|
31
31
|
className: "select-time-right-panel-list"
|
|
32
32
|
}, list.map(function (d) {
|
|
33
33
|
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
-
className: classNames(
|
|
35
|
-
|
|
34
|
+
className: classNames('select-time-right-panel-item', {
|
|
35
|
+
'select-time-right-panel-item-active': d.value === value
|
|
36
36
|
}),
|
|
37
37
|
key: d.value,
|
|
38
|
-
id:
|
|
38
|
+
id: 'time' + d.value.replace(':', ''),
|
|
39
39
|
onClick: function onClick() {
|
|
40
40
|
onChange(d.value);
|
|
41
41
|
}
|
|
@@ -15,6 +15,7 @@ export interface KeyboardProps {
|
|
|
15
15
|
onChange?: (value?: ItemValue) => void;
|
|
16
16
|
items?: Item[];
|
|
17
17
|
rightItems?: Item[];
|
|
18
|
+
keydown?: boolean;
|
|
18
19
|
}
|
|
19
20
|
declare const _default: React.MemoExoticComponent<(props: KeyboardProps) => React.JSX.Element>;
|
|
20
21
|
export default _default;
|
|
@@ -9,7 +9,7 @@ import { Button } from 'antd';
|
|
|
9
9
|
import "./index.less";
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import { useEventListener, useMemoizedFn, useSize } from 'ahooks';
|
|
12
|
-
var list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ok'];
|
|
12
|
+
var list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '+', 'ok'];
|
|
13
13
|
var defaultArr = [];
|
|
14
14
|
var Keyboard = function Keyboard(props) {
|
|
15
15
|
var _props$items = props.items,
|
|
@@ -17,15 +17,23 @@ var Keyboard = function Keyboard(props) {
|
|
|
17
17
|
className = props.className,
|
|
18
18
|
style = props.style,
|
|
19
19
|
onChange = props.onChange,
|
|
20
|
-
rightItems = props.rightItems
|
|
20
|
+
rightItems = props.rightItems,
|
|
21
|
+
_props$keydown = props.keydown,
|
|
22
|
+
keydown = _props$keydown === void 0 ? true : _props$keydown;
|
|
21
23
|
var contentRef = useRef(null);
|
|
22
24
|
var size = useSize(contentRef);
|
|
23
25
|
useEventListener('keydown', function (ev) {
|
|
24
26
|
console.log('ev', ev);
|
|
27
|
+
if (!keydown) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
25
30
|
var key = ev.key;
|
|
26
31
|
if (key === 'Enter') {
|
|
27
32
|
key = 'ok';
|
|
28
33
|
}
|
|
34
|
+
if (key === 'keydown') {
|
|
35
|
+
key = '+';
|
|
36
|
+
}
|
|
29
37
|
if (list.includes(key)) {
|
|
30
38
|
// let dom = document.querySelector(`#virtual-keyboard-${ev.key}`);
|
|
31
39
|
// if (dom) {
|
|
@@ -15,6 +15,7 @@ export interface KeyboardProps {
|
|
|
15
15
|
onChange?: (value?: ItemValue) => void;
|
|
16
16
|
items?: Item[];
|
|
17
17
|
rightItems?: Item[];
|
|
18
|
+
keydown?: boolean;
|
|
18
19
|
}
|
|
19
20
|
declare const _default: React.MemoExoticComponent<(props: KeyboardProps) => React.JSX.Element>;
|
|
20
21
|
export default _default;
|
|
@@ -37,18 +37,31 @@ var import_antd = require("antd");
|
|
|
37
37
|
var import_index = require("./index.less");
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
39
|
var import_ahooks = require("ahooks");
|
|
40
|
-
var list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ok"];
|
|
40
|
+
var list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "ok"];
|
|
41
41
|
var defaultArr = [];
|
|
42
42
|
var Keyboard = (props) => {
|
|
43
|
-
const {
|
|
43
|
+
const {
|
|
44
|
+
items = defaultArr,
|
|
45
|
+
className,
|
|
46
|
+
style,
|
|
47
|
+
onChange,
|
|
48
|
+
rightItems,
|
|
49
|
+
keydown = true
|
|
50
|
+
} = props;
|
|
44
51
|
const contentRef = (0, import_react.useRef)(null);
|
|
45
52
|
const size = (0, import_ahooks.useSize)(contentRef);
|
|
46
53
|
(0, import_ahooks.useEventListener)("keydown", (ev) => {
|
|
47
54
|
console.log("ev", ev);
|
|
55
|
+
if (!keydown) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
48
58
|
let key = ev.key;
|
|
49
59
|
if (key === "Enter") {
|
|
50
60
|
key = "ok";
|
|
51
61
|
}
|
|
62
|
+
if (key === "keydown") {
|
|
63
|
+
key = "+";
|
|
64
|
+
}
|
|
52
65
|
if (list.includes(key)) {
|
|
53
66
|
onChange == null ? void 0 : onChange(key);
|
|
54
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.34",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
64
64
|
"crypto-js": "^4.2.0",
|
|
65
65
|
"@zxing/library": "0.21.2",
|
|
66
|
-
"@pisell/icon": "0.0.11",
|
|
67
66
|
"@pisell/utils": "2.0.1",
|
|
68
|
-
"@pisell/date-picker": "1.0.100"
|
|
67
|
+
"@pisell/date-picker": "1.0.100",
|
|
68
|
+
"@pisell/icon": "0.0.11"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^18.0.0",
|