@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
|
@@ -6,7 +6,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
6
6
|
import React from "react";
|
|
7
7
|
import ConfigProvider from "../config-provider";
|
|
8
8
|
import { AdapterDayjs } from "@pisell/date-picker/es/AdapterDayjs";
|
|
9
|
-
import { LocalizationProvider, createTheme, ThemeProvider } from "@pisell/date-picker";
|
|
9
|
+
import { LocalizationProvider, createTheme, ThemeProvider, LocaleProvider } from "@pisell/date-picker";
|
|
10
10
|
import enUS from "antd/locale/en_US";
|
|
11
11
|
import zhCN from "antd/locale/zh_CN";
|
|
12
12
|
import zhTW from "antd/locale/zh_TW";
|
|
@@ -89,13 +89,13 @@ var theme = {
|
|
|
89
89
|
colorBgContainerDisabled: "#F9FAFB",
|
|
90
90
|
colorTextDisabled: "#98A2B3"
|
|
91
91
|
},
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
Input: {
|
|
93
|
+
fontSizeIcon: 16
|
|
94
94
|
// "lineHeight": 1
|
|
95
95
|
},
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
Select: {
|
|
98
|
+
fontSizeIcon: 16
|
|
99
99
|
// "lineHeight": 1
|
|
100
100
|
}
|
|
101
101
|
},
|
|
@@ -179,7 +179,7 @@ var localeDateMap = {
|
|
|
179
179
|
"en-US": {
|
|
180
180
|
adapterLocale: "en"
|
|
181
181
|
},
|
|
182
|
-
|
|
182
|
+
en: {
|
|
183
183
|
adapterLocale: "en"
|
|
184
184
|
},
|
|
185
185
|
"zh-TW": {
|
|
@@ -198,18 +198,21 @@ var Page = function Page(props) {
|
|
|
198
198
|
style = props.style,
|
|
199
199
|
locale = props.locale,
|
|
200
200
|
others = _objectWithoutProperties(props, _excluded);
|
|
201
|
-
console.log(locale, 'locale', props);
|
|
202
201
|
return /*#__PURE__*/React.createElement(ConfigProvider, _extends({}, others, {
|
|
203
202
|
locale: localMap[locale],
|
|
204
203
|
prefixCls: props.prefixCls || "pisell-lowcode",
|
|
205
204
|
theme: props.theme || theme
|
|
206
205
|
}), /*#__PURE__*/React.createElement(LocalizationProvider, {
|
|
207
206
|
dateAdapter: AdapterDayjs,
|
|
208
|
-
adapterLocale: (localeDateMap === null || localeDateMap === void 0 ? void 0 : (_localeDateMap = localeDateMap[locale]) === null || _localeDateMap === void 0 ? void 0 : _localeDateMap.adapterLocale) ||
|
|
207
|
+
adapterLocale: (localeDateMap === null || localeDateMap === void 0 ? void 0 : (_localeDateMap = localeDateMap[locale]) === null || _localeDateMap === void 0 ? void 0 : _localeDateMap.adapterLocale) || "en"
|
|
209
208
|
}, /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
210
209
|
theme: datePickerTheme
|
|
210
|
+
}, /*#__PURE__*/React.createElement(LocaleProvider, {
|
|
211
|
+
value: {
|
|
212
|
+
locale: locale
|
|
213
|
+
}
|
|
211
214
|
}, /*#__PURE__*/React.createElement("div", {
|
|
212
215
|
style: style
|
|
213
|
-
}, children))));
|
|
216
|
+
}, children)))));
|
|
214
217
|
};
|
|
215
218
|
export default Page;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useMemo, useEffect } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
import { sliceDayIntoFiveMinutes, findNextSlice } from "../utils";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
var RightPanel = function RightPanel(props) {
|
|
6
|
+
var value = props.value,
|
|
7
|
+
onChange = props.onChange,
|
|
8
|
+
_props$slice = props.slice,
|
|
9
|
+
slice = _props$slice === void 0 ? 5 : _props$slice;
|
|
10
|
+
var list = useMemo(function () {
|
|
11
|
+
return sliceDayIntoFiveMinutes(slice);
|
|
12
|
+
}, [slice]);
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
console.log(findNextSlice({
|
|
15
|
+
timeSlices: list,
|
|
16
|
+
date: value
|
|
17
|
+
}));
|
|
18
|
+
var nextTime = findNextSlice({
|
|
19
|
+
timeSlices: list,
|
|
20
|
+
date: value
|
|
21
|
+
});
|
|
22
|
+
var scrollDom = document.querySelector(".select-time-right-panel-list");
|
|
23
|
+
var timeDom = document.querySelector("#time".concat(nextTime.replace(":", "")));
|
|
24
|
+
if (scrollDom && timeDom) {
|
|
25
|
+
scrollDom.scrollTop = timeDom.offsetTop;
|
|
26
|
+
}
|
|
27
|
+
}, [value]);
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "select-time-right-panel"
|
|
30
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "select-time-right-panel-list"
|
|
32
|
+
}, list.map(function (d) {
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: classNames("select-time-right-panel-item", {
|
|
35
|
+
"select-time-right-panel-item-active": d.value === value
|
|
36
|
+
}),
|
|
37
|
+
key: d.value,
|
|
38
|
+
id: "time" + d.value.replace(":", ""),
|
|
39
|
+
onClick: function onClick() {
|
|
40
|
+
onChange(d.value);
|
|
41
|
+
}
|
|
42
|
+
}, d.label);
|
|
43
|
+
})));
|
|
44
|
+
};
|
|
45
|
+
export default RightPanel;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -0,0 +1,115 @@
|
|
|
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, { useState, useMemo, useEffect } from "react";
|
|
9
|
+
import Time from "../virtual-keyboard/Time";
|
|
10
|
+
import { TimePicker, Popover } from "antd";
|
|
11
|
+
import RightPanel from "./RightPanel";
|
|
12
|
+
import dayjs from "dayjs";
|
|
13
|
+
import "./index.less";
|
|
14
|
+
var SelectTime = function SelectTime(props) {
|
|
15
|
+
var onChange = props.onChange,
|
|
16
|
+
value = props.value,
|
|
17
|
+
popoverProps = props.popoverProps,
|
|
18
|
+
timePickerProps = props.timePickerProps,
|
|
19
|
+
timeProps = props.timeProps,
|
|
20
|
+
slice = props.slice;
|
|
21
|
+
var _useState = useState(false),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
open = _useState2[0],
|
|
24
|
+
setOpen = _useState2[1];
|
|
25
|
+
var _useState3 = useState(""),
|
|
26
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
+
_value = _useState4[0],
|
|
28
|
+
set_value = _useState4[1];
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
set_value(value);
|
|
31
|
+
}, [value]);
|
|
32
|
+
var valueString = useMemo(function () {
|
|
33
|
+
if (!_value) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
if (typeof _value === "string") {
|
|
37
|
+
return _value;
|
|
38
|
+
}
|
|
39
|
+
return _value === null || _value === void 0 ? void 0 : _value.valueString;
|
|
40
|
+
}, [_value]);
|
|
41
|
+
var previewValueString = useMemo(function () {
|
|
42
|
+
if (!_value) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
if (typeof _value === "string") {
|
|
46
|
+
return _value;
|
|
47
|
+
}
|
|
48
|
+
return _value === null || _value === void 0 ? void 0 : _value.previewValueString;
|
|
49
|
+
}, [_value]);
|
|
50
|
+
var timePickerValue = useMemo(function () {
|
|
51
|
+
if (!previewValueString) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return dayjs(dayjs().format("YYYY-MM-DD") + " " + previewValueString);
|
|
55
|
+
}, [previewValueString]);
|
|
56
|
+
var _onChange = function _onChange(e) {
|
|
57
|
+
if (!open) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
set_value(e);
|
|
61
|
+
};
|
|
62
|
+
var _onEnter = function onEnter(e) {
|
|
63
|
+
_onChange(e);
|
|
64
|
+
onOpenChange(false, (e === null || e === void 0 ? void 0 : e.previewValueString) || e);
|
|
65
|
+
};
|
|
66
|
+
var onOpenChange = function onOpenChange(e) {
|
|
67
|
+
var _val = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : previewValueString;
|
|
68
|
+
setOpen(e);
|
|
69
|
+
if (e) {} else {
|
|
70
|
+
if (_val === value) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_val);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// 防止页面过小时出现滚动条 造成页面滚动
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
if (open) {
|
|
80
|
+
document.body.classList.add("hide-scroll");
|
|
81
|
+
} else {
|
|
82
|
+
setTimeout(function () {
|
|
83
|
+
document.body.classList.remove("hide-scroll");
|
|
84
|
+
}, 150);
|
|
85
|
+
}
|
|
86
|
+
}, [open]);
|
|
87
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popover, _extends({
|
|
88
|
+
destroyTooltipOnHide: true,
|
|
89
|
+
content: /*#__PURE__*/React.createElement(Time, _extends({
|
|
90
|
+
onChange: _onChange,
|
|
91
|
+
value: valueString,
|
|
92
|
+
onEnter: function onEnter(e) {
|
|
93
|
+
_onEnter(e);
|
|
94
|
+
},
|
|
95
|
+
rightPanel: /*#__PURE__*/React.createElement(RightPanel, {
|
|
96
|
+
value: previewValueString,
|
|
97
|
+
onChange: _onEnter,
|
|
98
|
+
slice: slice
|
|
99
|
+
})
|
|
100
|
+
}, timeProps)),
|
|
101
|
+
open: open,
|
|
102
|
+
placement: "bottom",
|
|
103
|
+
arrow: false,
|
|
104
|
+
onOpenChange: onOpenChange,
|
|
105
|
+
trigger: ["click"]
|
|
106
|
+
}, popoverProps), /*#__PURE__*/React.createElement(TimePicker, _extends({
|
|
107
|
+
format: "HH:mm",
|
|
108
|
+
size: "large",
|
|
109
|
+
inputReadOnly: true,
|
|
110
|
+
allowClear: false,
|
|
111
|
+
open: false,
|
|
112
|
+
value: timePickerValue
|
|
113
|
+
}, timePickerProps))));
|
|
114
|
+
};
|
|
115
|
+
export default SelectTime;
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(slice) {
|
|
3
|
+
var startTime = dayjs().startOf("day");
|
|
4
|
+
var endTime = dayjs().endOf("day");
|
|
5
|
+
var timeSlice = slice || 5; // 切片时间间隔(分钟)
|
|
6
|
+
|
|
7
|
+
var timeSlices = [];
|
|
8
|
+
var currentTime = startTime;
|
|
9
|
+
while (currentTime.isBefore(endTime)) {
|
|
10
|
+
var timeLabel = currentTime.format("HH:mm");
|
|
11
|
+
var timeValue = currentTime.format("HH:mm");
|
|
12
|
+
timeSlices.push({
|
|
13
|
+
label: timeLabel,
|
|
14
|
+
value: timeValue
|
|
15
|
+
});
|
|
16
|
+
var nextTime = currentTime.add(timeSlice, "minute");
|
|
17
|
+
currentTime = nextTime;
|
|
18
|
+
}
|
|
19
|
+
return timeSlices;
|
|
20
|
+
};
|
|
21
|
+
export var findNextSlice = function findNextSlice(_ref) {
|
|
22
|
+
var _ref$timeSlices = _ref.timeSlices,
|
|
23
|
+
timeSlices = _ref$timeSlices === void 0 ? [] : _ref$timeSlices,
|
|
24
|
+
_ref$index = _ref.index,
|
|
25
|
+
index = _ref$index === void 0 ? 0 : _ref$index,
|
|
26
|
+
_ref$date = _ref.date,
|
|
27
|
+
date = _ref$date === void 0 ? '' : _ref$date;
|
|
28
|
+
var currentTimeValue = date || dayjs().format('HH:mm');
|
|
29
|
+
|
|
30
|
+
// 遍历时间切片数组,找到最接近的下一个切片时间
|
|
31
|
+
for (var i = 0; i < timeSlices.length; i++) {
|
|
32
|
+
// 排除掉当前时间
|
|
33
|
+
if (timeSlices[i].value !== 'now') {
|
|
34
|
+
if (timeSlices[i].value >= currentTimeValue) {
|
|
35
|
+
return timeSlices[i].value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 如果没有找到比当前时间大的切片时间,则返回第一个切片时间作为下一个切片时间
|
|
41
|
+
return timeSlices[index].value;
|
|
42
|
+
};
|
|
@@ -14,5 +14,15 @@ export default function (_ref) {
|
|
|
14
14
|
|
|
15
15
|
// 如果value是数组,检查dataValue是否包含在value中
|
|
16
16
|
// 如果value是字符串,检查dataValue是否等于value
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
// 如果value是数组, 则检查dataValue是否包含在value中
|
|
19
|
+
if (isArr(value)) {
|
|
20
|
+
return value.includes(dataValue);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// 如果value是字符串,则检查dataValue是否为数组, 如果是数组检查是否包含
|
|
24
|
+
if (isArr(dataValue)) {
|
|
25
|
+
return dataValue.includes(value);
|
|
26
|
+
}
|
|
27
|
+
return value === dataValue;
|
|
18
28
|
}
|
|
@@ -86,6 +86,7 @@ var useTransDataSource = function useTransDataSource(params) {
|
|
|
86
86
|
}
|
|
87
87
|
return newDataSource;
|
|
88
88
|
}, [pDataSource, localPagination, sortObj, groupDetail, filterLocalArr, filters]);
|
|
89
|
+
console.log('dataSourcedataSource', dataSource);
|
|
89
90
|
return dataSource;
|
|
90
91
|
};
|
|
91
92
|
export default useTransDataSource;
|
|
@@ -110,9 +110,17 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
110
110
|
}
|
|
111
111
|
return viewMode || defaultViewMode;
|
|
112
112
|
}, [viewMode, defaultViewMode, multiple]);
|
|
113
|
+
var removeTitleColumns = useMemo(function () {
|
|
114
|
+
var _columns = columns.map(function (item) {
|
|
115
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
116
|
+
title: undefined
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
return _columns;
|
|
120
|
+
}, [columns]);
|
|
113
121
|
var currentSettingHash = useMemo(function () {
|
|
114
|
-
return currentSettingKey || getHash(
|
|
115
|
-
}, [currentSettingKey, JSON.stringify(
|
|
122
|
+
return currentSettingKey || getHash(removeTitleColumns) || "";
|
|
123
|
+
}, [currentSettingKey, JSON.stringify(removeTitleColumns)]);
|
|
116
124
|
useEffect(function () {
|
|
117
125
|
var setting = getTableSettingFromLocalStorage(tableId);
|
|
118
126
|
if (setting.currentSettingHash !== currentSettingHash) {
|
|
@@ -232,7 +240,7 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
232
240
|
form.setFieldValue("column_setting", {});
|
|
233
241
|
form.setFieldValue("column_setting", tableSettingRef.current.column_setting);
|
|
234
242
|
// JSON.stringify会丢失 render函数变更的监听 使用自定义stringify处理
|
|
235
|
-
}, [stringify(
|
|
243
|
+
}, [stringify(removeTitleColumns)]);
|
|
236
244
|
useEffect(function () {
|
|
237
245
|
form.setFieldsValue(initialValuesRef.current);
|
|
238
246
|
// ArraySetter在面板state变更时指针改变
|
|
@@ -2,34 +2,67 @@
|
|
|
2
2
|
height: 100%;
|
|
3
3
|
flex: 1;
|
|
4
4
|
}
|
|
5
|
+
|
|
5
6
|
.materials-grid {
|
|
6
7
|
width: 100%;
|
|
7
8
|
height: 100%;
|
|
8
9
|
display: flex;
|
|
9
10
|
flex-direction: column;
|
|
11
|
+
|
|
10
12
|
.pisell-lowcode-table-thead {
|
|
11
13
|
.pisell-lowcode-table-cell {
|
|
12
14
|
padding: 0 14px;
|
|
13
15
|
height: 44px;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
18
|
+
|
|
16
19
|
.pisell-lowcode-table-cell {
|
|
17
20
|
padding: 12px;
|
|
21
|
+
|
|
22
|
+
.pisell-lowcode-table-selection {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
|
|
26
|
+
.pisell-lowcode-checkbox-wrapper {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cell-provider {
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
.pisell-lowcode-checkbox-wrapper {
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
}
|
|
18
46
|
}
|
|
47
|
+
|
|
19
48
|
.pisell-lowcode-table-filter-column {
|
|
20
49
|
align-items: center;
|
|
50
|
+
|
|
21
51
|
.pisell-lowcode-dropdown-trigger {
|
|
22
52
|
width: 25px;
|
|
23
53
|
height: 25px;
|
|
24
54
|
justify-content: center;
|
|
25
55
|
}
|
|
56
|
+
|
|
26
57
|
.pisell-lowcode-table-filter-trigger.active {
|
|
27
58
|
background: var(--primary-100, #F4EBFF);
|
|
28
59
|
}
|
|
29
60
|
}
|
|
61
|
+
|
|
30
62
|
.pisell-lowcode-table-column-sorters {
|
|
31
63
|
cursor: pointer;
|
|
32
64
|
}
|
|
65
|
+
|
|
33
66
|
.pisell-table-sorter-inner {
|
|
34
67
|
width: 25px;
|
|
35
68
|
height: 25px;
|
|
@@ -42,47 +75,59 @@
|
|
|
42
75
|
transition: color 0.3s;
|
|
43
76
|
border-radius: 8px;
|
|
44
77
|
justify-content: center;
|
|
78
|
+
|
|
45
79
|
&:hover {
|
|
46
80
|
background: var(--primary-100, #F4EBFF);
|
|
47
81
|
}
|
|
48
|
-
|
|
82
|
+
|
|
83
|
+
.pisell-table-column-sorter-up,
|
|
84
|
+
.pisell-table-column-sorter-down {
|
|
49
85
|
color: rgba(102, 112, 133, 0.65);
|
|
50
86
|
font-size: 12px;
|
|
51
87
|
}
|
|
88
|
+
|
|
52
89
|
.pisell-table-column-sorter-down {
|
|
53
90
|
margin-top: -0.3em;
|
|
54
91
|
}
|
|
92
|
+
|
|
55
93
|
.pisell-table-column-up {
|
|
56
94
|
font-size: 20px;
|
|
57
95
|
}
|
|
96
|
+
|
|
58
97
|
.pisell-table-column-down {
|
|
59
98
|
font-size: 20px;
|
|
60
99
|
transform: rotate(180deg);
|
|
61
100
|
}
|
|
62
101
|
}
|
|
102
|
+
|
|
63
103
|
.pisell-table-sorter-inner.active {
|
|
64
104
|
background: var(--primary-100, #F4EBFF);
|
|
65
105
|
cursor: pointer;
|
|
66
106
|
color: #7F56D9
|
|
67
107
|
}
|
|
68
108
|
|
|
69
|
-
.pisell-lowcode-table-wrapper .pisell-lowcode-table.pisell-lowcode-table-bordered
|
|
109
|
+
.pisell-lowcode-table-wrapper .pisell-lowcode-table.pisell-lowcode-table-bordered>.pisell-lowcode-table-container {
|
|
70
110
|
border-left: none;
|
|
71
111
|
}
|
|
112
|
+
|
|
72
113
|
.pisell-lowcode-table-wrapper .pisell-lowcode-table-bordered .pisell-lowcode-table-thead tr td:first-child {
|
|
73
114
|
border-left: 1px solid #EAECF0;
|
|
74
115
|
}
|
|
116
|
+
|
|
75
117
|
.pisell-lowcode-table-wrapper .pisell-lowcode-table-bordered .pisell-lowcode-table-thead tr th:first-child {
|
|
76
118
|
border-left: 1px solid #EAECF0;
|
|
77
119
|
}
|
|
120
|
+
|
|
78
121
|
div.pisell-lowcode-table-selection-column {
|
|
79
122
|
display: flex;
|
|
80
123
|
align-items: center;
|
|
81
124
|
justify-content: center;
|
|
82
125
|
}
|
|
126
|
+
|
|
83
127
|
.pisell-lowcode-table-bordered .pisell-lowcode-table-tbody .pisell-lowcode-table-selection-column {
|
|
84
128
|
border-left: 1px solid #EAECF0;
|
|
85
129
|
}
|
|
130
|
+
|
|
86
131
|
.drag-sort-cell {
|
|
87
132
|
.editable-cell-value-wrap {
|
|
88
133
|
display: flex;
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "antd";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { useEventListener } from "ahooks";
|
|
6
|
+
var list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ok"];
|
|
7
|
+
var Keyboard = function Keyboard(props) {
|
|
8
|
+
var _props$items = props.items,
|
|
9
|
+
items = _props$items === void 0 ? [] : _props$items,
|
|
10
|
+
className = props.className,
|
|
11
|
+
style = props.style,
|
|
12
|
+
onChange = props.onChange;
|
|
13
|
+
useEventListener("keydown", function (ev) {
|
|
14
|
+
console.log("ev", ev);
|
|
15
|
+
var key = ev.key;
|
|
16
|
+
if (key === "Enter") {
|
|
17
|
+
key = "ok";
|
|
18
|
+
}
|
|
19
|
+
if (list.includes(key)) {
|
|
20
|
+
// let dom = document.querySelector(`#virtual-keyboard-${ev.key}`);
|
|
21
|
+
// if (dom) {
|
|
22
|
+
// dom.click();
|
|
23
|
+
// }
|
|
24
|
+
|
|
25
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(key);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: classNames("virtual-keyboard-wrap", className),
|
|
30
|
+
style: style
|
|
31
|
+
}, items.map(function (item) {
|
|
32
|
+
var _item$style;
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: "virtual-keyboard-item",
|
|
35
|
+
style: item.style
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
id: "virtual-keyboard-".concat(item.value),
|
|
38
|
+
key: item.value,
|
|
39
|
+
type: item.type,
|
|
40
|
+
className: "virtual-keyboard-item-button",
|
|
41
|
+
style: {
|
|
42
|
+
color: item.type === "primary" ? "#fff" : ((_item$style = item.style) === null || _item$style === void 0 ? void 0 : _item$style.color) || undefined
|
|
43
|
+
},
|
|
44
|
+
disabled: item.disabled,
|
|
45
|
+
onClick: function onClick(e) {
|
|
46
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(item.value);
|
|
47
|
+
}
|
|
48
|
+
}, item.label));
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
export default Keyboard;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|