@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.
Files changed (81) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +20 -20
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +20 -20
  11. package/es/components/page/index.js +1 -0
  12. package/es/index.d.ts +0 -3
  13. package/es/index.js +0 -3
  14. package/es/locales/en-US.d.ts +0 -2
  15. package/es/locales/en-US.js +1 -3
  16. package/es/locales/zh-CN.d.ts +0 -2
  17. package/es/locales/zh-CN.js +1 -3
  18. package/es/locales/zh-TW.d.ts +0 -2
  19. package/es/locales/zh-TW.js +1 -3
  20. package/lib/components/page/index.js +1 -0
  21. package/lib/index.d.ts +0 -3
  22. package/lib/index.js +0 -9
  23. package/lib/locales/en-US.d.ts +0 -2
  24. package/lib/locales/en-US.js +1 -3
  25. package/lib/locales/zh-CN.d.ts +0 -2
  26. package/lib/locales/zh-CN.js +1 -3
  27. package/lib/locales/zh-TW.d.ts +0 -2
  28. package/lib/locales/zh-TW.js +1 -3
  29. package/package.json +2 -2
  30. package/dist/umd/materials.min.css +0 -1
  31. package/dist/umd/materials.min.js +0 -1
  32. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  33. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  34. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  35. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  36. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  37. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
  38. package/es/components/select-time/RightPanel/index.d.ts +0 -9
  39. package/es/components/select-time/RightPanel/index.js +0 -45
  40. package/es/components/select-time/RightPanel/index.less +0 -22
  41. package/es/components/select-time/index.d.ts +0 -14
  42. package/es/components/select-time/index.js +0 -115
  43. package/es/components/select-time/index.less +0 -16
  44. package/es/components/select-time/utils.d.ts +0 -9
  45. package/es/components/select-time/utils.js +0 -42
  46. package/es/components/virtual-keyboard/Keyboard/index.d.ts +0 -18
  47. package/es/components/virtual-keyboard/Keyboard/index.js +0 -51
  48. package/es/components/virtual-keyboard/Keyboard/index.less +0 -32
  49. package/es/components/virtual-keyboard/Time/index.d.ts +0 -13
  50. package/es/components/virtual-keyboard/Time/index.js +0 -124
  51. package/es/components/virtual-keyboard/Time/index.less +0 -0
  52. package/es/components/virtual-keyboard/Time/utils.d.ts +0 -10
  53. package/es/components/virtual-keyboard/Time/utils.js +0 -153
  54. package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -9
  55. package/es/components/virtual-keyboard/VirtualKeyInput/index.js +0 -76
  56. package/es/components/virtual-keyboard/VirtualKeyInput/index.less +0 -52
  57. package/es/components/virtual-keyboard/index.d.ts +0 -14
  58. package/es/components/virtual-keyboard/index.js +0 -85
  59. package/es/components/virtual-keyboard/index.less +0 -17
  60. package/lib/components/select-time/RightPanel/index.d.ts +0 -9
  61. package/lib/components/select-time/RightPanel/index.js +0 -78
  62. package/lib/components/select-time/RightPanel/index.less +0 -22
  63. package/lib/components/select-time/index.d.ts +0 -14
  64. package/lib/components/select-time/index.js +0 -145
  65. package/lib/components/select-time/index.less +0 -16
  66. package/lib/components/select-time/utils.d.ts +0 -9
  67. package/lib/components/select-time/utils.js +0 -71
  68. package/lib/components/virtual-keyboard/Keyboard/index.d.ts +0 -18
  69. package/lib/components/virtual-keyboard/Keyboard/index.js +0 -81
  70. package/lib/components/virtual-keyboard/Keyboard/index.less +0 -32
  71. package/lib/components/virtual-keyboard/Time/index.d.ts +0 -13
  72. package/lib/components/virtual-keyboard/Time/index.js +0 -166
  73. package/lib/components/virtual-keyboard/Time/index.less +0 -0
  74. package/lib/components/virtual-keyboard/Time/utils.d.ts +0 -10
  75. package/lib/components/virtual-keyboard/Time/utils.js +0 -162
  76. package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -9
  77. package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +0 -90
  78. package/lib/components/virtual-keyboard/VirtualKeyInput/index.less +0 -52
  79. package/lib/components/virtual-keyboard/index.d.ts +0 -14
  80. package/lib/components/virtual-keyboard/index.js +0 -131
  81. package/lib/components/virtual-keyboard/index.less +0 -17
@@ -1,16 +0,0 @@
1
- body {
2
- &.hide-scroll {
3
-
4
- &::-webkit-scrollbar {
5
- display: none;
6
- }
7
-
8
- &::-webkit-scrollbar-thumb {
9
- display: none;
10
- }
11
-
12
- &::-webkit-scrollbar-track {
13
- display: none;
14
- }
15
- }
16
- }
@@ -1,9 +0,0 @@
1
- export declare const sliceDayIntoFiveMinutes: (slice: number) => {
2
- label: string;
3
- value: string;
4
- }[];
5
- export declare const findNextSlice: ({ timeSlices, index, date }: {
6
- timeSlices: any[];
7
- index?: number | undefined;
8
- date?: string | undefined;
9
- }) => any;
@@ -1,71 +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/utils.ts
30
- var utils_exports = {};
31
- __export(utils_exports, {
32
- findNextSlice: () => findNextSlice,
33
- sliceDayIntoFiveMinutes: () => sliceDayIntoFiveMinutes
34
- });
35
- module.exports = __toCommonJS(utils_exports);
36
- var import_dayjs = __toESM(require("dayjs"));
37
- var sliceDayIntoFiveMinutes = (slice) => {
38
- const startTime = (0, import_dayjs.default)().startOf("day");
39
- const endTime = (0, import_dayjs.default)().endOf("day");
40
- const timeSlice = slice || 5;
41
- let timeSlices = [];
42
- let currentTime = startTime;
43
- while (currentTime.isBefore(endTime)) {
44
- const timeLabel = currentTime.format("HH:mm");
45
- const timeValue = currentTime.format("HH:mm");
46
- timeSlices.push({ label: timeLabel, value: timeValue });
47
- const nextTime = currentTime.add(timeSlice, "minute");
48
- currentTime = nextTime;
49
- }
50
- return timeSlices;
51
- };
52
- var findNextSlice = ({
53
- timeSlices = [],
54
- index = 0,
55
- date = ""
56
- }) => {
57
- const currentTimeValue = date || (0, import_dayjs.default)().format("HH:mm");
58
- for (let i = 0; i < timeSlices.length; i++) {
59
- if (timeSlices[i].value !== "now") {
60
- if (timeSlices[i].value >= currentTimeValue) {
61
- return timeSlices[i].value;
62
- }
63
- }
64
- }
65
- return timeSlices[index].value;
66
- };
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
69
- findNextSlice,
70
- sliceDayIntoFiveMinutes
71
- });
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import "./index.less";
3
- export declare type ItemValue = string | number;
4
- export interface Item {
5
- value: ItemValue;
6
- label: string;
7
- disabled: boolean;
8
- type: "text" | "primary";
9
- style?: React.CSSProperties;
10
- }
11
- export interface KeyboardProps {
12
- className?: string;
13
- style?: React.CSSProperties;
14
- onChange?: (value?: ItemValue) => void;
15
- items?: Item[];
16
- }
17
- declare const Keyboard: (props: KeyboardProps) => React.JSX.Element;
18
- export default Keyboard;
@@ -1,81 +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/virtual-keyboard/Keyboard/index.tsx
30
- var Keyboard_exports = {};
31
- __export(Keyboard_exports, {
32
- default: () => Keyboard_default
33
- });
34
- module.exports = __toCommonJS(Keyboard_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_antd = require("antd");
37
- var import_index = require("./index.less");
38
- var import_classnames = __toESM(require("classnames"));
39
- var import_ahooks = require("ahooks");
40
- var list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ok"];
41
- var Keyboard = (props) => {
42
- const { items = [], className, style, onChange } = props;
43
- (0, import_ahooks.useEventListener)("keydown", (ev) => {
44
- console.log("ev", ev);
45
- let key = ev.key;
46
- if (key === "Enter") {
47
- key = "ok";
48
- }
49
- if (list.includes(key)) {
50
- onChange == null ? void 0 : onChange(key);
51
- }
52
- });
53
- return /* @__PURE__ */ import_react.default.createElement(
54
- "div",
55
- {
56
- className: (0, import_classnames.default)("virtual-keyboard-wrap", className),
57
- style
58
- },
59
- items.map((item) => {
60
- var _a;
61
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "virtual-keyboard-item", style: item.style }, /* @__PURE__ */ import_react.default.createElement(
62
- import_antd.Button,
63
- {
64
- id: `virtual-keyboard-${item.value}`,
65
- key: item.value,
66
- type: item.type,
67
- className: "virtual-keyboard-item-button",
68
- style: {
69
- color: item.type === "primary" ? "#fff" : ((_a = item.style) == null ? void 0 : _a.color) || void 0
70
- },
71
- disabled: item.disabled,
72
- onClick: (e) => {
73
- onChange == null ? void 0 : onChange(item.value);
74
- }
75
- },
76
- item.label
77
- ));
78
- })
79
- );
80
- };
81
- var Keyboard_default = Keyboard;
@@ -1,32 +0,0 @@
1
- .virtual-keyboard-wrap {
2
- width: 100%;
3
- display: flex;
4
- flex-wrap: wrap;
5
- align-items: center;
6
- justify-content: flex-end;
7
- gap: 7px;
8
-
9
- .virtual-keyboard-item {
10
- border-radius: 5px;
11
- background: var(--Base-White, #FFF);
12
- box-shadow: 0px 1px 0px 0px #898A8D;
13
- overflow: hidden;
14
- width: calc((100% - 14px) / 3 * 1);
15
- padding-top: 25%;
16
- position: relative;
17
-
18
- .virtual-keyboard-item-button {
19
- position: absolute;
20
- left: 0;
21
- top: 0;
22
- width: 100%;
23
- height: 100%;
24
- border-radius: 5px;
25
- color: var(--Base-Black, #000);
26
- font-size: 25px;
27
- font-style: normal;
28
- font-weight: 400;
29
- box-shadow: none;
30
- }
31
- }
32
- }
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { Item } from "../Keyboard";
3
- import "./index.less";
4
- export interface VirtualKeyboardTimeProps extends React.HTMLAttributes<HTMLDivElement> {
5
- style?: React.CSSProperties;
6
- onChange?: (value?: any) => void;
7
- value?: any;
8
- items?: Item[];
9
- onEnter?: (value: any) => void;
10
- rightPanel?: React.ReactNode;
11
- }
12
- declare const VirtualKeyboardTime: (props: VirtualKeyboardTimeProps) => React.JSX.Element;
13
- export default VirtualKeyboardTime;
@@ -1,166 +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/virtual-keyboard/Time/index.tsx
30
- var Time_exports = {};
31
- __export(Time_exports, {
32
- default: () => Time_default
33
- });
34
- module.exports = __toCommonJS(Time_exports);
35
- var import_react = __toESM(require("react"));
36
- var import__ = __toESM(require("../index"));
37
- var import_index = require("./index.less");
38
- var import_utils = require("./utils.tsx");
39
- var import_locales = require("../../../locales");
40
- var import_dayjs = __toESM(require("dayjs"));
41
- var items = [
42
- {
43
- value: 1,
44
- label: "1",
45
- disabled: false,
46
- type: "text"
47
- },
48
- {
49
- value: 2,
50
- label: "2",
51
- disabled: false,
52
- type: "text"
53
- },
54
- {
55
- value: 3,
56
- label: "3",
57
- disabled: false,
58
- type: "text"
59
- },
60
- {
61
- value: 4,
62
- label: "4",
63
- disabled: false,
64
- type: "text"
65
- },
66
- {
67
- value: 5,
68
- label: "5",
69
- disabled: false,
70
- type: "text"
71
- },
72
- {
73
- value: 6,
74
- label: "6",
75
- disabled: false,
76
- type: "text"
77
- },
78
- {
79
- value: 7,
80
- label: "7",
81
- disabled: false,
82
- type: "text"
83
- },
84
- {
85
- value: 8,
86
- label: "8",
87
- disabled: false,
88
- type: "text"
89
- },
90
- {
91
- value: 9,
92
- label: "9",
93
- disabled: false,
94
- type: "text"
95
- },
96
- {
97
- value: "now",
98
- label: (0, import_locales.getText)("virtual-keyboard-time-now"),
99
- disabled: false,
100
- type: "text",
101
- style: { color: "#7f56d9" }
102
- },
103
- {
104
- value: "0",
105
- label: "0",
106
- disabled: false,
107
- type: "text"
108
- },
109
- {
110
- value: "ok",
111
- label: (0, import_locales.getText)("virtual-keyboard-time-ok"),
112
- disabled: false,
113
- type: "primary"
114
- }
115
- ];
116
- var VirtualKeyboardTime = (props) => {
117
- const { onChange, onEnter, style, className, value = "", rightPanel } = props;
118
- (0, import_react.useEffect)(() => {
119
- document.body.id = "body";
120
- }, []);
121
- const res = (0, import_react.useMemo)(() => {
122
- return (0, import_utils.formatStringToTime)(value);
123
- }, [value]);
124
- const _onChange = (current) => {
125
- if (current === "ok") {
126
- onEnter == null ? void 0 : onEnter((0, import_utils.formatStringToTime)(value));
127
- return;
128
- }
129
- if (current === "now") {
130
- onEnter == null ? void 0 : onEnter((0, import_dayjs.default)().format("HH:mm"));
131
- return;
132
- }
133
- let _val = res.valueString + current;
134
- if (res.valueString.length === 4) {
135
- _val = current + "";
136
- }
137
- if (document.querySelector(".virtual-keyboard-input-select")) {
138
- _val = current + "";
139
- }
140
- onChange == null ? void 0 : onChange((0, import_utils.formatStringToTime)(_val));
141
- };
142
- return /* @__PURE__ */ import_react.default.createElement(
143
- import__.default,
144
- {
145
- className,
146
- style,
147
- keyboardProps: {
148
- items,
149
- onChange: (current) => {
150
- _onChange(current);
151
- }
152
- },
153
- virtualKeyInputProps: {
154
- value,
155
- onChange: (e) => {
156
- onChange == null ? void 0 : onChange((0, import_utils.formatStringToTime)(e.target.value));
157
- },
158
- renderInput: () => {
159
- return res == null ? void 0 : res.previewValueArrayDom;
160
- }
161
- },
162
- rightPanel
163
- }
164
- );
165
- };
166
- var Time_default = VirtualKeyboardTime;
File without changes
@@ -1,10 +0,0 @@
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;
@@ -1,162 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/components/virtual-keyboard/Time/utils.tsx
20
- var utils_exports = {};
21
- __export(utils_exports, {
22
- fn: () => fn,
23
- formatStringToTime: () => formatStringToTime
24
- });
25
- module.exports = __toCommonJS(utils_exports);
26
- var getStringAtPosition = (str, pos) => {
27
- if (pos < 0 || pos >= str.length) {
28
- return void 0;
29
- }
30
- return str.charAt(pos);
31
- };
32
- var getNum1 = (arr, str) => {
33
- let num1 = getStringAtPosition(str, 0);
34
- if (Number(num1) < 3) {
35
- arr[0] = num1;
36
- return arr;
37
- }
38
- arr[0] = "0";
39
- arr[1] = num1;
40
- return arr;
41
- };
42
- var getNum2 = (arr, num2) => {
43
- let num1 = arr[0];
44
- if (arr.length < 2) {
45
- if (Number(num1) < 2) {
46
- arr[1] = num2;
47
- return arr;
48
- } else {
49
- if (Number(num1) === 2) {
50
- if (Number(num2) < 4) {
51
- arr[1] = num2;
52
- return arr;
53
- } else {
54
- if (Number(num2) <= 5) {
55
- arr[1] = "0";
56
- arr[2] = num2;
57
- return arr;
58
- }
59
- arr[1] = "0";
60
- arr[2] = "0";
61
- arr[3] = num2;
62
- return arr;
63
- }
64
- }
65
- }
66
- }
67
- if (Number(num2) < 6) {
68
- arr[2] = num2;
69
- return arr;
70
- } else {
71
- arr[2] = "0";
72
- arr[3] = num2;
73
- return arr;
74
- }
75
- };
76
- var getNum3 = (arr, num3) => {
77
- if (arr.length === 2) {
78
- if (Number(num3) < 6) {
79
- arr[2] = num3;
80
- return arr;
81
- } else {
82
- arr[2] = "0";
83
- arr[3] = num3;
84
- return arr;
85
- }
86
- }
87
- arr[3] = num3;
88
- return arr;
89
- };
90
- var getNum4 = (arr, num4) => {
91
- arr[3] = num4;
92
- return arr;
93
- };
94
- var formatArray = (arr) => {
95
- let _arr = [...arr];
96
- while (_arr.length < 4) {
97
- _arr.push("0");
98
- }
99
- _arr.splice(2, "0", ":");
100
- return _arr;
101
- };
102
- var formatRes = (arr) => {
103
- let valueArray = [...arr];
104
- let previewValueArray = formatArray(arr);
105
- let previewValueArrayDom = null;
106
- if (valueArray.length > 2) {
107
- valueArray.splice(2, "0", ":");
108
- }
109
- previewValueArrayDom = previewValueArray.map((d, i) => {
110
- if (valueArray[i]) {
111
- return /* @__PURE__ */ React.createElement("span", null, d);
112
- } else {
113
- return /* @__PURE__ */ React.createElement("span", { style: { color: "#98A2B3" } }, d);
114
- }
115
- });
116
- return {
117
- valueArray,
118
- valueString: arr.join(""),
119
- previewValueArray: formatArray(arr),
120
- previewValueArrayDom,
121
- previewValueString: formatArray(arr).join(""),
122
- disabled: []
123
- };
124
- };
125
- var formatStringToTime = (value) => {
126
- let arr = [];
127
- let str = value.replace(":", "");
128
- if (str.length >= 5) {
129
- str = "";
130
- }
131
- let num2 = getStringAtPosition(str, 1);
132
- let num3 = getStringAtPosition(str, 2);
133
- let num4 = getStringAtPosition(str, 3);
134
- if (!str.length) {
135
- return formatRes(arr);
136
- }
137
- arr = getNum1(arr, str);
138
- if (num2 !== void 0) {
139
- arr = getNum2(arr, num2);
140
- if (arr.length === 4) {
141
- return formatRes(arr);
142
- }
143
- }
144
- if (num3 !== void 0) {
145
- arr = getNum3(arr, num3);
146
- if (arr.length === 4) {
147
- return formatRes(arr);
148
- }
149
- }
150
- if (num4 !== void 0) {
151
- arr = getNum4(arr, num4);
152
- return formatRes(arr);
153
- }
154
- return formatRes(arr);
155
- };
156
- var fn = () => {
157
- };
158
- // Annotate the CommonJS export names for ESM import in node:
159
- 0 && (module.exports = {
160
- fn,
161
- formatStringToTime
162
- });
@@ -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,90 +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/virtual-keyboard/VirtualKeyInput/index.tsx
30
- var VirtualKeyInput_exports = {};
31
- __export(VirtualKeyInput_exports, {
32
- default: () => VirtualKeyInput_default
33
- });
34
- module.exports = __toCommonJS(VirtualKeyInput_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_antd = require("antd");
37
- var import_icon = require("@pisell/icon");
38
- var import_ahooks = require("ahooks");
39
- var import_classnames = __toESM(require("classnames"));
40
- var import_index = require("./index.less");
41
- var list = ["Backspace"];
42
- var VirtualKeyInput = (props) => {
43
- const { previewValue = props.value, value } = props;
44
- const [select, setSelect] = (0, import_react.useState)(false);
45
- (0, import_ahooks.useEventListener)("keydown", (ev) => {
46
- if (list.includes(ev.key)) {
47
- _onDelete == null ? void 0 : _onDelete();
48
- }
49
- });
50
- (0, import_react.useEffect)(() => {
51
- if (value) {
52
- setSelect(false);
53
- }
54
- }, [value]);
55
- const _onDelete = () => {
56
- var _a;
57
- if (select) {
58
- (_a = props.onChange) == null ? void 0 : _a.call(props, { target: { value: "" } });
59
- setSelect(false);
60
- return;
61
- }
62
- let _val = props.value + "";
63
- _val = _val.slice(0, _val.length - 1);
64
- props.onChange && props.onChange({ target: { value: _val } });
65
- };
66
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "virtual-keyboard-input-wrap" }, props.renderInput ? /* @__PURE__ */ import_react.default.createElement(
67
- "div",
68
- {
69
- className: (0, import_classnames.default)("virtual-keyboard-input", {
70
- "virtual-keyboard-input-select": select
71
- }),
72
- onClick: () => {
73
- if (value) {
74
- setSelect(!select);
75
- }
76
- }
77
- },
78
- props.renderInput(props)
79
- ) : /* @__PURE__ */ import_react.default.createElement(
80
- import_antd.Input,
81
- {
82
- className: "virtual-keyboard-input",
83
- bordered: false,
84
- ...props,
85
- readOnly: true,
86
- value: previewValue
87
- }
88
- ), (value == null ? void 0 : value.length) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "virtual-keyboard-input-delete", onClick: _onDelete }, /* @__PURE__ */ import_react.default.createElement(import_icon.Delete, { className: "virtual-keyboard-input-delete-icon" })) : null);
89
- };
90
- var VirtualKeyInput_default = VirtualKeyInput;