@pisell/materials 1.0.360 → 1.0.362

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 (76) hide show
  1. package/build/lowcode/assets-daily.json +13 -13
  2. package/build/lowcode/assets-dev.json +4 -4
  3. package/build/lowcode/assets-prod.json +13 -13
  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 +27 -18
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +29 -20
  11. package/es/components/browserSelect/chevron-down.png +0 -0
  12. package/es/components/browserSelect/index.d.ts +15 -0
  13. package/es/components/browserSelect/index.js +36 -0
  14. package/es/components/browserSelect/index.less +18 -0
  15. package/es/components/date-picker/constants.d.ts +39 -0
  16. package/es/components/date-picker/constants.js +76 -0
  17. package/es/components/date-picker/datePickerCpt.d.ts +8 -0
  18. package/es/components/date-picker/datePickerCpt.js +290 -0
  19. package/es/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
  20. package/es/components/date-picker/hooks/useMediaQuery.js +28 -0
  21. package/es/components/date-picker/index.js +2 -2
  22. package/es/components/date-picker/index.less +1847 -0
  23. package/es/components/drag-sort-tree/index.d.ts +0 -1
  24. package/es/components/drag-sort-tree/index.js +2 -1
  25. package/es/components/picker-view/index.d.ts +2 -0
  26. package/es/components/picker-view/index.js +2 -0
  27. package/es/components/sort/index.d.ts +3 -3
  28. package/es/components/sort/index.js +28 -28
  29. package/es/components/table/Actions/component/ExportImport/index.js +5 -4
  30. package/es/components/table/BasicTable/index.d.ts +2 -2
  31. package/es/components/table/BasicTable/index.js +10 -10
  32. package/es/components/table/Table/utils.d.ts +14 -2
  33. package/es/components/table/Table/utils.js +7 -3
  34. package/es/components/table/hooks/useTableSetting.js +26 -5
  35. package/es/index.d.ts +1 -0
  36. package/es/index.js +1 -0
  37. package/es/locales/en-US.d.ts +12 -0
  38. package/es/locales/en-US.js +14 -1
  39. package/es/locales/zh-CN.d.ts +12 -0
  40. package/es/locales/zh-CN.js +14 -1
  41. package/es/locales/zh-TW.d.ts +12 -0
  42. package/es/locales/zh-TW.js +14 -1
  43. package/lib/components/browserSelect/chevron-down.png +0 -0
  44. package/lib/components/browserSelect/index.d.ts +15 -0
  45. package/lib/components/browserSelect/index.js +59 -0
  46. package/lib/components/browserSelect/index.less +18 -0
  47. package/lib/components/date-picker/constants.d.ts +39 -0
  48. package/lib/components/date-picker/constants.js +78 -0
  49. package/lib/components/date-picker/datePickerCpt.d.ts +8 -0
  50. package/lib/components/date-picker/datePickerCpt.js +297 -0
  51. package/lib/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
  52. package/lib/components/date-picker/hooks/useMediaQuery.js +43 -0
  53. package/lib/components/date-picker/index.js +2 -2
  54. package/lib/components/date-picker/index.less +1847 -0
  55. package/lib/components/drag-sort-tree/index.d.ts +0 -1
  56. package/lib/components/drag-sort-tree/index.js +0 -1
  57. package/lib/components/picker-view/index.d.ts +2 -0
  58. package/lib/components/picker-view/index.js +36 -0
  59. package/lib/components/sort/index.d.ts +3 -3
  60. package/lib/components/sort/index.js +2 -2
  61. package/lib/components/table/Actions/component/ExportImport/index.js +5 -5
  62. package/lib/components/table/BasicTable/index.d.ts +2 -2
  63. package/lib/components/table/BasicTable/index.js +5 -2
  64. package/lib/components/table/Table/utils.d.ts +14 -2
  65. package/lib/components/table/Table/utils.js +8 -2
  66. package/lib/components/table/hooks/useTableSetting.js +23 -9
  67. package/lib/index.d.ts +1 -0
  68. package/lib/index.js +3 -0
  69. package/lib/locales/en-US.d.ts +12 -0
  70. package/lib/locales/en-US.js +14 -1
  71. package/lib/locales/zh-CN.d.ts +12 -0
  72. package/lib/locales/zh-CN.js +14 -1
  73. package/lib/locales/zh-TW.d.ts +12 -0
  74. package/lib/locales/zh-TW.js +14 -1
  75. package/lowcode/information-modal/meta.ts +1888 -0
  76. package/package.json +3 -3
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface BrowserSelectProps extends React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> {
4
+ options: any[];
5
+ }
6
+ /**
7
+ * @title: 系统级别的下拉框
8
+ * @description:
9
+ * @param {BrowserSelectProps} props
10
+ * @return {*}
11
+ * @Author: zhiwei.Wang
12
+ * @Date: 2024-01-30 16:43
13
+ */
14
+ declare const BrowserSelect: (props: BrowserSelectProps) => React.JSX.Element;
15
+ export default BrowserSelect;
@@ -0,0 +1,36 @@
1
+ var _excluded = ["options"];
2
+ 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); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import React, { useMemo } from "react";
6
+ import classNames from "classnames";
7
+ import "./index.less";
8
+ /**
9
+ * @title: 系统级别的下拉框
10
+ * @description:
11
+ * @param {BrowserSelectProps} props
12
+ * @return {*}
13
+ * @Author: zhiwei.Wang
14
+ * @Date: 2024-01-30 16:43
15
+ */
16
+ var BrowserSelect = function BrowserSelect(props) {
17
+ var options = props.options,
18
+ resetProps = _objectWithoutProperties(props, _excluded);
19
+ var _options = useMemo(function () {
20
+ return (props.options || []).map(function (d) {
21
+ return /*#__PURE__*/React.createElement("option", {
22
+ value: d.value,
23
+ key: d.value
24
+ }, d.label);
25
+ });
26
+ }, [props.options]);
27
+ return /*#__PURE__*/React.createElement("select", _extends({}, resetProps, {
28
+ className: classNames("date-picker-pisell-browser-select", resetProps.className),
29
+ onChange: function onChange(e) {
30
+ var _resetProps$onChange;
31
+ e.persist();
32
+ (_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0 ? void 0 : _resetProps$onChange.call(resetProps, e);
33
+ }
34
+ }), _options);
35
+ };
36
+ export default BrowserSelect;
@@ -0,0 +1,18 @@
1
+ .date-picker-pisell-browser-select {
2
+ padding: 9px 16px;
3
+ border-radius: 8px;
4
+ background-color: #fff;
5
+ background-image: url('./chevron-down.png');
6
+ color: var(--Gray-true-900, #141414);
7
+ font-size: 16px;
8
+ font-style: normal;
9
+ font-weight: 600;
10
+ border: 1px solid var(--Gray-300, #D0D5DD);
11
+ cursor: pointer;
12
+ appearance: none;
13
+ -webkit-appearance: none;
14
+ -moz-appearance: none;
15
+ background-position: right 10px center;
16
+ background-size: 12px;
17
+ background-repeat: no-repeat;
18
+ }
@@ -0,0 +1,39 @@
1
+ import dayjs from 'dayjs';
2
+ export declare const presetDetailMap: {
3
+ today: {
4
+ getValue: () => dayjs.Dayjs;
5
+ label: () => any;
6
+ };
7
+ yesterday: {
8
+ getValue: () => dayjs.Dayjs;
9
+ label: () => any;
10
+ };
11
+ tomorrow: {
12
+ getValue: () => dayjs.Dayjs;
13
+ label: () => any;
14
+ };
15
+ next_monday: {
16
+ getValue: () => dayjs.Dayjs;
17
+ label: () => any;
18
+ };
19
+ last_friday: {
20
+ getValue: () => dayjs.Dayjs;
21
+ label: () => any;
22
+ };
23
+ first_day_of_this_month: {
24
+ getValue: () => dayjs.Dayjs;
25
+ label: () => any;
26
+ };
27
+ last_day_of_this_month: {
28
+ getValue: () => dayjs.Dayjs;
29
+ label: () => any;
30
+ };
31
+ first_day_of_next_month: {
32
+ getValue: () => dayjs.Dayjs;
33
+ label: () => any;
34
+ };
35
+ last_day_of_last_month: {
36
+ getValue: () => dayjs.Dayjs;
37
+ label: () => any;
38
+ };
39
+ };
@@ -0,0 +1,76 @@
1
+ import dayjs from 'dayjs';
2
+ import { getText } from "../../locales";
3
+ export var presetDetailMap = {
4
+ today: {
5
+ getValue: function getValue() {
6
+ return dayjs().startOf('day');
7
+ },
8
+ label: function label() {
9
+ return getText('date-picker-today');
10
+ }
11
+ },
12
+ yesterday: {
13
+ getValue: function getValue() {
14
+ return dayjs().add(-1, 'd').startOf('day');
15
+ },
16
+ label: function label() {
17
+ return getText('date-picker-yesterday');
18
+ }
19
+ },
20
+ tomorrow: {
21
+ getValue: function getValue() {
22
+ return dayjs().add(1, 'd').startOf('day');
23
+ },
24
+ label: function label() {
25
+ return getText('date-picker-tomorrow');
26
+ }
27
+ },
28
+ next_monday: {
29
+ getValue: function getValue() {
30
+ return dayjs().startOf('week').add(8, 'day').startOf('day');
31
+ },
32
+ label: function label() {
33
+ return getText('date-picker-next_monday');
34
+ }
35
+ },
36
+ last_friday: {
37
+ getValue: function getValue() {
38
+ return dayjs().subtract(1, 'week').startOf('week').add(5, 'day').startOf('day');
39
+ },
40
+ label: function label() {
41
+ return getText('date-picker-last_friday');
42
+ }
43
+ },
44
+ first_day_of_this_month: {
45
+ getValue: function getValue() {
46
+ return dayjs().startOf('month').startOf('day');
47
+ },
48
+ label: function label() {
49
+ return getText('date-picker-first_day_of_this_month');
50
+ }
51
+ },
52
+ last_day_of_this_month: {
53
+ getValue: function getValue() {
54
+ return dayjs().endOf('month').startOf('day');
55
+ },
56
+ label: function label() {
57
+ return getText('date-picker-last_day_of_this_month');
58
+ }
59
+ },
60
+ first_day_of_next_month: {
61
+ getValue: function getValue() {
62
+ return dayjs().endOf('month').add(1, 'day').startOf('day');
63
+ },
64
+ label: function label() {
65
+ return getText('date-picker-first_day_of_next_month');
66
+ }
67
+ },
68
+ last_day_of_last_month: {
69
+ getValue: function getValue() {
70
+ return dayjs().startOf('month').subtract(1, 'day').startOf('day');
71
+ },
72
+ label: function label() {
73
+ return getText('date-picker-last_day_of_last_month');
74
+ }
75
+ }
76
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { PickerDateProps } from 'antd/es/date-picker/generatePicker';
3
+ import { Dayjs } from 'dayjs';
4
+ import './index.less';
5
+ interface DatePickerCptProps extends PickerDateProps<Dayjs> {
6
+ }
7
+ declare const DatePickerCpt: (props: DatePickerCptProps) => React.JSX.Element;
8
+ export default DatePickerCpt;
@@ -0,0 +1,290 @@
1
+ var _excluded = ["mode", "onChange", "value", "format", "defaultValue"];
2
+ 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); }
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ 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."); }
5
+ 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); }
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
+ 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; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
+ import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
12
+ import dayjs from 'dayjs';
13
+ import { Button, ConfigProvider, DatePicker, Drawer, Input, Modal } from 'antd';
14
+ import BrowserSelect from "../browserSelect";
15
+ import { isFunction } from '@pisell/utils';
16
+ import { presetDetailMap } from "./constants";
17
+ import { getText } from "../../locales";
18
+ import useResponsive, { configResponsive } from "../../hooks/useResponsive";
19
+ import "./index.less";
20
+ var isValidDate = function isValidDate(dateString, format) {
21
+ var date = window.dayjs(dateString, format, true);
22
+ return date.isValid();
23
+ };
24
+ configResponsive({
25
+ phone: 0,
26
+ ipad: 768,
27
+ pc: 1080
28
+ });
29
+ var DatePickerCpt = function DatePickerCpt(props) {
30
+ var mode = props.mode,
31
+ onChange = props.onChange,
32
+ value = props.value,
33
+ propsFormat = props.format,
34
+ defaultValue = props.defaultValue,
35
+ others = _objectWithoutProperties(props, _excluded);
36
+ var _useContext = useContext(ConfigProvider.ConfigContext),
37
+ locale = _useContext.locale;
38
+ var _useState = useState(''),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ currentShortcut = _useState2[0],
41
+ setCurrentShortcut = _useState2[1];
42
+ var _useState3 = useState(false),
43
+ _useState4 = _slicedToArray(_useState3, 2),
44
+ open = _useState4[0],
45
+ setOpen = _useState4[1];
46
+ var _useState5 = useState(false),
47
+ _useState6 = _slicedToArray(_useState5, 2),
48
+ popupOpen = _useState6[0],
49
+ setPopupOpen = _useState6[1];
50
+ var _useState7 = useState(value),
51
+ _useState8 = _slicedToArray(_useState7, 2),
52
+ _value = _useState8[0],
53
+ setValue = _useState8[1];
54
+ var _useState9 = useState(''),
55
+ _useState10 = _slicedToArray(_useState9, 2),
56
+ valueStr = _useState10[0],
57
+ setValueStr = _useState10[1];
58
+ var _useState11 = useState(false),
59
+ _useState12 = _slicedToArray(_useState11, 2),
60
+ error = _useState12[0],
61
+ setError = _useState12[1];
62
+ var ref = useRef(null);
63
+ var canClose = useRef(true);
64
+
65
+ // const isDesktop = useMediaQuery('@media (pointer: fine)');
66
+
67
+ var responsive = useResponsive();
68
+ var isDesktop = !('ontouchstart' in window || navigator.maxTouchPoints);
69
+ useEffect(function () {
70
+ document.body.id = 'body';
71
+ }, []);
72
+ useEffect(function () {
73
+ setValue(value);
74
+ }, [value]);
75
+ useEffect(function () {
76
+ setValueStr((_value === null || _value === void 0 ? void 0 : _value.format(format)) || '');
77
+ }, [_value]);
78
+ var customPresetItems = useMemo(function () {
79
+ var preset = [{
80
+ label: presetDetailMap['today'].label(),
81
+ value: 'today'
82
+ }, {
83
+ label: presetDetailMap['yesterday'].label(),
84
+ value: 'yesterday'
85
+ }, {
86
+ label: presetDetailMap['tomorrow'].label(),
87
+ value: 'tomorrow'
88
+ }, {
89
+ label: presetDetailMap['next_monday'].label(),
90
+ value: 'next_monday'
91
+ }, {
92
+ label: presetDetailMap['last_friday'].label(),
93
+ value: 'last_friday'
94
+ }, {
95
+ label: presetDetailMap['first_day_of_this_month'].label(),
96
+ value: 'first_day_of_this_month'
97
+ }, {
98
+ label: presetDetailMap['last_day_of_this_month'].label(),
99
+ value: 'last_day_of_this_month'
100
+ }, {
101
+ label: presetDetailMap['first_day_of_next_month'].label(),
102
+ value: 'first_day_of_next_month'
103
+ }, {
104
+ label: presetDetailMap['last_day_of_last_month'].label(),
105
+ value: 'last_day_of_last_month'
106
+ }];
107
+ if (!currentShortcut) {
108
+ preset.push({
109
+ label: getText('date-picker-shortcut-custom'),
110
+ value: 'custom'
111
+ });
112
+ }
113
+ return preset;
114
+ }, [currentShortcut]);
115
+ var format = useMemo(function () {
116
+ if (propsFormat) {
117
+ if (isFunction(propsFormat)) {
118
+ return propsFormat(value);
119
+ }
120
+ return propsFormat;
121
+ }
122
+ var localeValue = locale === null || locale === void 0 ? void 0 : locale.locale;
123
+ return localeValue === 'en' || localeValue === 'en-US' ? 'DD/MM/YYYY' : 'YYYY/MM/DD';
124
+ }, [propsFormat, locale]);
125
+ var handleSelectChange = function handleSelectChange(e) {
126
+ var _presetDetailMap;
127
+ var shortcut = e.target.value;
128
+ setCurrentShortcut(shortcut);
129
+ var date = (_presetDetailMap = presetDetailMap[shortcut]) === null || _presetDetailMap === void 0 ? void 0 : _presetDetailMap.getValue();
130
+ setValue(date);
131
+ handleOk(date);
132
+ };
133
+ var handleTodayClick = function handleTodayClick() {
134
+ var val = dayjs().startOf('day');
135
+ handleChange(val);
136
+ };
137
+ var handleOpenChange = function handleOpenChange(visible) {
138
+ if (!visible) {
139
+ setOpen(visible);
140
+ setTimeout(function () {
141
+ var _ref$current;
142
+ setPopupOpen(visible);
143
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.blur();
144
+ });
145
+ return;
146
+ }
147
+ setOpen(visible);
148
+ setPopupOpen(visible);
149
+ };
150
+ var handleOk = function handleOk(val) {
151
+ var returnValue = val || _value;
152
+ onChange === null || onChange === void 0 ? void 0 : onChange(returnValue, returnValue === null || returnValue === void 0 ? void 0 : returnValue.format(format));
153
+ handleOpenChange(false);
154
+ };
155
+ var handleChange = function handleChange(val, valStr) {
156
+ canClose.current = true;
157
+ setError(false);
158
+ setCurrentShortcut('');
159
+ setValue(val);
160
+ handleOk(val);
161
+ };
162
+ var handleApply = function handleApply() {
163
+ if (error) return;
164
+ handleOk();
165
+ };
166
+ var handleDataStrChange = function handleDataStrChange(e) {
167
+ var val = e.target.value;
168
+ setValueStr(val);
169
+ if (isValidDate(val, format)) {
170
+ setError(false);
171
+ var valDate = dayjs(val, format);
172
+ setValue(valDate);
173
+ } else {
174
+ setError(true);
175
+ }
176
+ };
177
+ if (!mode || mode === 'date') {
178
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DatePicker, _extends({}, others, {
179
+ ref: ref,
180
+ defaultValue: defaultValue,
181
+ showNow: false,
182
+ onChange: handleChange,
183
+ open: popupOpen,
184
+ value: _value,
185
+ onOpenChange: function onOpenChange(o) {
186
+ if (!o && !canClose.current) {
187
+ return;
188
+ }
189
+ handleOpenChange(o);
190
+ },
191
+ mode: "date",
192
+ picker: "date",
193
+ popupClassName: "date-picker-popup-wrap",
194
+ format: currentShortcut ? function () {
195
+ return presetDetailMap[currentShortcut].label();
196
+ } : format,
197
+ panelRender: function panelRender(panelNode) {
198
+ var dom = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
199
+ className: "pisell-lowcode-date-picker-custom-wrap"
200
+ }, /*#__PURE__*/React.createElement("div", {
201
+ className: "pisell-lowcode-date-picker-custom-action",
202
+ onMouseDown: function onMouseDown(e) {
203
+ canClose.current = false;
204
+ e.stopPropagation();
205
+ }
206
+ }, /*#__PURE__*/React.createElement("div", {
207
+ style: {
208
+ width: '50%'
209
+ }
210
+ }, /*#__PURE__*/React.createElement(Input, {
211
+ size: "large",
212
+ placeholder: dayjs().format(format),
213
+ value: valueStr,
214
+ onChange: handleDataStrChange
215
+ }), error && /*#__PURE__*/React.createElement("span", {
216
+ className: "date-picker-error"
217
+ }, getText('date-picker-invalid-date'))), /*#__PURE__*/React.createElement(BrowserSelect
218
+ // @ts-ignore
219
+ , {
220
+ value: currentShortcut || 'custom',
221
+ className: "date-picker-toolbar-select",
222
+ options: customPresetItems
223
+ // @ts-ignore
224
+ ,
225
+ size: 'large',
226
+ onChange: handleSelectChange,
227
+ style: {
228
+ width: '50%'
229
+ }
230
+ })), panelNode), /*#__PURE__*/React.createElement("div", {
231
+ className: "pisell-lowcode-custom-footer"
232
+ }, /*#__PURE__*/React.createElement("span", {
233
+ className: "pisell-lowcode-custom-footer-today",
234
+ onClick: handleTodayClick
235
+ }, getText('date-picker-today')), /*#__PURE__*/React.createElement(Button, {
236
+ type: "primary",
237
+ size: "large",
238
+ onClick: handleApply
239
+ }, getText('date-picker-apply'))));
240
+ if (isDesktop) {
241
+ return /*#__PURE__*/React.createElement("div", {
242
+ className: "pisell-lowcode-date-picker-custom-popup-wrap pisell-lowcode-date-picker-dropdown-mode"
243
+ }, /*#__PURE__*/React.createElement("div", {
244
+ className: "pisell-lowcode-date-picker-custom-wrap"
245
+ }, dom));
246
+ }
247
+ if (responsive === 'phone') {
248
+ return /*#__PURE__*/React.createElement(Drawer, {
249
+ placement: "bottom",
250
+ open: open,
251
+ height: 565,
252
+ closable: false,
253
+ styles: {
254
+ content: {
255
+ borderRadius: '8px 8px 0 0'
256
+ }
257
+ },
258
+ bodyStyle: {
259
+ padding: 0
260
+ },
261
+ maskClosable: false
262
+ }, /*#__PURE__*/React.createElement("div", {
263
+ className: "pisell-lowcode-picker-custom-dropdown pisell-lowcode-date-picker-custom-popup-wrap",
264
+ onMouseDown: function onMouseDown(e) {
265
+ return e.stopPropagation();
266
+ }
267
+ }, /*#__PURE__*/React.createElement("div", {
268
+ className: "pisell-lowcode-picker-panel-container pisell-lowcode-picker-date-panel-container"
269
+ }, dom)));
270
+ }
271
+ return /*#__PURE__*/React.createElement(Modal, {
272
+ width: 458,
273
+ open: open,
274
+ footer: null,
275
+ closable: false,
276
+ wrapClassName: 'pisell-lowcode-date-picker-modal'
277
+ }, /*#__PURE__*/React.createElement("div", {
278
+ className: "pisell-lowcode-picker-custom-dropdown pisell-lowcode-date-picker-custom-popup-wrap",
279
+ onMouseDown: function onMouseDown(e) {
280
+ return e.stopPropagation();
281
+ }
282
+ }, /*#__PURE__*/React.createElement("div", {
283
+ className: "pisell-lowcode-picker-panel-container pisell-lowcode-picker-date-panel-container"
284
+ }, dom)));
285
+ }
286
+ })));
287
+ }
288
+ return /*#__PURE__*/React.createElement(DatePicker, props);
289
+ };
290
+ export default DatePickerCpt;
@@ -0,0 +1,2 @@
1
+ declare const useMediaQuery: (query: string) => boolean;
2
+ export default useMediaQuery;
@@ -0,0 +1,28 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
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 _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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useEffect, useState } from 'react';
8
+ var useMediaQuery = function useMediaQuery(query) {
9
+ var _useState = useState(false),
10
+ _useState2 = _slicedToArray(_useState, 2),
11
+ matches = _useState2[0],
12
+ setMatches = _useState2[1];
13
+ useEffect(function () {
14
+ var mediaQuery = window.matchMedia(query);
15
+ if (mediaQuery.matches !== matches) {
16
+ setMatches(mediaQuery.matches);
17
+ }
18
+ var handleMediaQueryChange = function handleMediaQueryChange(event) {
19
+ setMatches(event.matches);
20
+ };
21
+ mediaQuery.addEventListener('change', handleMediaQueryChange);
22
+ return function () {
23
+ mediaQuery.removeEventListener('change', handleMediaQueryChange);
24
+ };
25
+ }, [query]);
26
+ return matches;
27
+ };
28
+ export default useMediaQuery;
@@ -1,15 +1,15 @@
1
- import { DatePicker as OriginalDatePicker } from 'antd';
2
1
  import { withMomentProps } from "../../utils/hoc";
3
2
  import dayjs from 'dayjs';
4
3
  import { RangePicker, OldPisellDateRangePicker } from "@pisell/date-picker";
5
4
  import localeData from 'dayjs/plugin/localeData';
6
5
  import weekday from 'dayjs/plugin/weekday';
6
+ import DatePickerCpt from "./datePickerCpt";
7
7
  dayjs.extend(weekday);
8
8
  dayjs.extend(localeData);
9
9
 
10
10
  // const OriginalRangePicker = OriginalDatePicker.RangePicker;
11
11
 
12
- var DatePicker = withMomentProps(OriginalDatePicker, ['defaultPickerValue', 'defaultValue', 'showTime.defaultValue', 'value']);
12
+ var DatePicker = withMomentProps(DatePickerCpt, ['defaultPickerValue', 'defaultValue', 'showTime.defaultValue', 'value']);
13
13
 
14
14
  // const RangePicker = withMomentProps(OriginalRangePicker, [
15
15
  // 'defaultPickerValue',