@pisell/materials 1.0.359 → 1.0.360

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 (71) 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 +18 -27
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +20 -29
  11. package/es/components/date-picker/index.js +2 -2
  12. package/es/components/drag-sort-tree/index.d.ts +1 -0
  13. package/es/components/drag-sort-tree/index.js +1 -2
  14. package/es/components/table/Actions/component/ExportImport/index.js +4 -5
  15. package/es/components/table/BasicTable/index.d.ts +2 -2
  16. package/es/components/table/BasicTable/index.js +10 -10
  17. package/es/components/table/Table/utils.d.ts +2 -14
  18. package/es/components/table/Table/utils.js +2 -6
  19. package/es/components/table/hooks/useTableSetting.js +5 -26
  20. package/es/index.d.ts +0 -1
  21. package/es/index.js +0 -1
  22. package/es/locales/en-US.d.ts +0 -12
  23. package/es/locales/en-US.js +1 -14
  24. package/es/locales/zh-CN.d.ts +0 -12
  25. package/es/locales/zh-CN.js +1 -14
  26. package/es/locales/zh-TW.d.ts +0 -12
  27. package/es/locales/zh-TW.js +1 -14
  28. package/lib/components/date-picker/index.js +2 -2
  29. package/lib/components/drag-sort-tree/index.d.ts +1 -0
  30. package/lib/components/drag-sort-tree/index.js +1 -0
  31. package/lib/components/table/Actions/component/ExportImport/index.js +5 -5
  32. package/lib/components/table/BasicTable/index.d.ts +2 -2
  33. package/lib/components/table/BasicTable/index.js +2 -5
  34. package/lib/components/table/Table/utils.d.ts +2 -14
  35. package/lib/components/table/Table/utils.js +1 -7
  36. package/lib/components/table/hooks/useTableSetting.js +9 -23
  37. package/lib/index.d.ts +0 -1
  38. package/lib/index.js +0 -3
  39. package/lib/locales/en-US.d.ts +0 -12
  40. package/lib/locales/en-US.js +1 -14
  41. package/lib/locales/zh-CN.d.ts +0 -12
  42. package/lib/locales/zh-CN.js +1 -14
  43. package/lib/locales/zh-TW.d.ts +0 -12
  44. package/lib/locales/zh-TW.js +1 -14
  45. package/package.json +4 -4
  46. package/es/components/browserSelect/chevron-down.png +0 -0
  47. package/es/components/browserSelect/index.d.ts +0 -15
  48. package/es/components/browserSelect/index.js +0 -36
  49. package/es/components/browserSelect/index.less +0 -18
  50. package/es/components/date-picker/constants.d.ts +0 -39
  51. package/es/components/date-picker/constants.js +0 -76
  52. package/es/components/date-picker/datePickerCpt.d.ts +0 -8
  53. package/es/components/date-picker/datePickerCpt.js +0 -290
  54. package/es/components/date-picker/hooks/useMediaQuery.d.ts +0 -2
  55. package/es/components/date-picker/hooks/useMediaQuery.js +0 -28
  56. package/es/components/date-picker/index.less +0 -1847
  57. package/es/components/picker-view/index.d.ts +0 -2
  58. package/es/components/picker-view/index.js +0 -2
  59. package/lib/components/browserSelect/chevron-down.png +0 -0
  60. package/lib/components/browserSelect/index.d.ts +0 -15
  61. package/lib/components/browserSelect/index.js +0 -59
  62. package/lib/components/browserSelect/index.less +0 -18
  63. package/lib/components/date-picker/constants.d.ts +0 -39
  64. package/lib/components/date-picker/constants.js +0 -78
  65. package/lib/components/date-picker/datePickerCpt.d.ts +0 -8
  66. package/lib/components/date-picker/datePickerCpt.js +0 -297
  67. package/lib/components/date-picker/hooks/useMediaQuery.d.ts +0 -2
  68. package/lib/components/date-picker/hooks/useMediaQuery.js +0 -43
  69. package/lib/components/date-picker/index.less +0 -1847
  70. package/lib/components/picker-view/index.d.ts +0 -2
  71. package/lib/components/picker-view/index.js +0 -36
@@ -1,2 +0,0 @@
1
- import PickerView from 'antd-mobile/es/components/picker-view';
2
- export default PickerView;
@@ -1,2 +0,0 @@
1
- import PickerView from 'antd-mobile/es/components/picker-view';
2
- export default PickerView;
@@ -1,15 +0,0 @@
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;
@@ -1,59 +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/browserSelect/index.tsx
30
- var browserSelect_exports = {};
31
- __export(browserSelect_exports, {
32
- default: () => browserSelect_default
33
- });
34
- module.exports = __toCommonJS(browserSelect_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_classnames = __toESM(require("classnames"));
37
- var import_index = require("./index.less");
38
- var BrowserSelect = (props) => {
39
- const { options, ...resetProps } = props;
40
- const _options = (0, import_react.useMemo)(() => {
41
- return (props.options || []).map((d) => {
42
- return /* @__PURE__ */ import_react.default.createElement("option", { value: d.value, key: d.value }, d.label);
43
- });
44
- }, [props.options]);
45
- return /* @__PURE__ */ import_react.default.createElement(
46
- "select",
47
- {
48
- ...resetProps,
49
- className: (0, import_classnames.default)("date-picker-pisell-browser-select", resetProps.className),
50
- onChange: (e) => {
51
- var _a;
52
- e.persist();
53
- (_a = resetProps.onChange) == null ? void 0 : _a.call(resetProps, e);
54
- }
55
- },
56
- _options
57
- );
58
- };
59
- var browserSelect_default = BrowserSelect;
@@ -1,18 +0,0 @@
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
- }
@@ -1,39 +0,0 @@
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
- };
@@ -1,78 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/date-picker/constants.ts
30
- var constants_exports = {};
31
- __export(constants_exports, {
32
- presetDetailMap: () => presetDetailMap
33
- });
34
- module.exports = __toCommonJS(constants_exports);
35
- var import_dayjs = __toESM(require("dayjs"));
36
- var import_locales = require("../../locales");
37
- var presetDetailMap = {
38
- today: {
39
- getValue: () => (0, import_dayjs.default)().startOf("day"),
40
- label: () => (0, import_locales.getText)("date-picker-today")
41
- },
42
- yesterday: {
43
- getValue: () => (0, import_dayjs.default)().add(-1, "d").startOf("day"),
44
- label: () => (0, import_locales.getText)("date-picker-yesterday")
45
- },
46
- tomorrow: {
47
- getValue: () => (0, import_dayjs.default)().add(1, "d").startOf("day"),
48
- label: () => (0, import_locales.getText)("date-picker-tomorrow")
49
- },
50
- next_monday: {
51
- getValue: () => (0, import_dayjs.default)().startOf("week").add(8, "day").startOf("day"),
52
- label: () => (0, import_locales.getText)("date-picker-next_monday")
53
- },
54
- last_friday: {
55
- getValue: () => (0, import_dayjs.default)().subtract(1, "week").startOf("week").add(5, "day").startOf("day"),
56
- label: () => (0, import_locales.getText)("date-picker-last_friday")
57
- },
58
- first_day_of_this_month: {
59
- getValue: () => (0, import_dayjs.default)().startOf("month").startOf("day"),
60
- label: () => (0, import_locales.getText)("date-picker-first_day_of_this_month")
61
- },
62
- last_day_of_this_month: {
63
- getValue: () => (0, import_dayjs.default)().endOf("month").startOf("day"),
64
- label: () => (0, import_locales.getText)("date-picker-last_day_of_this_month")
65
- },
66
- first_day_of_next_month: {
67
- getValue: () => (0, import_dayjs.default)().endOf("month").add(1, "day").startOf("day"),
68
- label: () => (0, import_locales.getText)("date-picker-first_day_of_next_month")
69
- },
70
- last_day_of_last_month: {
71
- getValue: () => (0, import_dayjs.default)().startOf("month").subtract(1, "day").startOf("day"),
72
- label: () => (0, import_locales.getText)("date-picker-last_day_of_last_month")
73
- }
74
- };
75
- // Annotate the CommonJS export names for ESM import in node:
76
- 0 && (module.exports = {
77
- presetDetailMap
78
- });
@@ -1,8 +0,0 @@
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;
@@ -1,297 +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/date-picker/datePickerCpt.tsx
30
- var datePickerCpt_exports = {};
31
- __export(datePickerCpt_exports, {
32
- default: () => datePickerCpt_default
33
- });
34
- module.exports = __toCommonJS(datePickerCpt_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_dayjs = __toESM(require("dayjs"));
37
- var import_antd = require("antd");
38
- var import_browserSelect = __toESM(require("../browserSelect"));
39
- var import_utils = require("@pisell/utils");
40
- var import_constants = require("./constants");
41
- var import_locales = require("../../locales");
42
- var import_useResponsive = __toESM(require("../../hooks/useResponsive"));
43
- var import_index = require("./index.less");
44
- var isValidDate = (dateString, format) => {
45
- const date = window.dayjs(dateString, format, true);
46
- return date.isValid();
47
- };
48
- (0, import_useResponsive.configResponsive)({
49
- phone: 0,
50
- ipad: 768,
51
- pc: 1080
52
- });
53
- var DatePickerCpt = (props) => {
54
- const { mode, onChange, value, format: propsFormat, defaultValue, ...others } = props;
55
- const { locale } = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
56
- const [currentShortcut, setCurrentShortcut] = (0, import_react.useState)("");
57
- const [open, setOpen] = (0, import_react.useState)(false);
58
- const [popupOpen, setPopupOpen] = (0, import_react.useState)(false);
59
- const [_value, setValue] = (0, import_react.useState)(value);
60
- const [valueStr, setValueStr] = (0, import_react.useState)("");
61
- const [error, setError] = (0, import_react.useState)(false);
62
- const ref = (0, import_react.useRef)(null);
63
- const canClose = (0, import_react.useRef)(true);
64
- const responsive = (0, import_useResponsive.default)();
65
- const isDesktop = !("ontouchstart" in window || navigator.maxTouchPoints);
66
- (0, import_react.useEffect)(() => {
67
- document.body.id = "body";
68
- }, []);
69
- (0, import_react.useEffect)(() => {
70
- setValue(value);
71
- }, [value]);
72
- (0, import_react.useEffect)(() => {
73
- setValueStr((_value == null ? void 0 : _value.format(format)) || "");
74
- }, [_value]);
75
- const customPresetItems = (0, import_react.useMemo)(() => {
76
- const preset = [
77
- {
78
- label: import_constants.presetDetailMap["today"].label(),
79
- value: "today"
80
- },
81
- {
82
- label: import_constants.presetDetailMap["yesterday"].label(),
83
- value: "yesterday"
84
- },
85
- {
86
- label: import_constants.presetDetailMap["tomorrow"].label(),
87
- value: "tomorrow"
88
- },
89
- {
90
- label: import_constants.presetDetailMap["next_monday"].label(),
91
- value: "next_monday"
92
- },
93
- {
94
- label: import_constants.presetDetailMap["last_friday"].label(),
95
- value: "last_friday"
96
- },
97
- {
98
- label: import_constants.presetDetailMap["first_day_of_this_month"].label(),
99
- value: "first_day_of_this_month"
100
- },
101
- {
102
- label: import_constants.presetDetailMap["last_day_of_this_month"].label(),
103
- value: "last_day_of_this_month"
104
- },
105
- {
106
- label: import_constants.presetDetailMap["first_day_of_next_month"].label(),
107
- value: "first_day_of_next_month"
108
- },
109
- {
110
- label: import_constants.presetDetailMap["last_day_of_last_month"].label(),
111
- value: "last_day_of_last_month"
112
- }
113
- ];
114
- if (!currentShortcut) {
115
- preset.push({
116
- label: (0, import_locales.getText)("date-picker-shortcut-custom"),
117
- value: "custom"
118
- });
119
- }
120
- return preset;
121
- }, [currentShortcut]);
122
- const format = (0, import_react.useMemo)(() => {
123
- if (propsFormat) {
124
- if ((0, import_utils.isFunction)(propsFormat)) {
125
- return propsFormat(value);
126
- }
127
- return propsFormat;
128
- }
129
- let localeValue = locale == null ? void 0 : locale.locale;
130
- return localeValue === "en" || localeValue === "en-US" ? "DD/MM/YYYY" : "YYYY/MM/DD";
131
- }, [propsFormat, locale]);
132
- const handleSelectChange = (e) => {
133
- var _a;
134
- const shortcut = e.target.value;
135
- setCurrentShortcut(shortcut);
136
- const date = (_a = import_constants.presetDetailMap[shortcut]) == null ? void 0 : _a.getValue();
137
- setValue(date);
138
- handleOk(date);
139
- };
140
- const handleTodayClick = () => {
141
- const val = (0, import_dayjs.default)().startOf("day");
142
- handleChange(val);
143
- };
144
- const handleOpenChange = (visible) => {
145
- if (!visible) {
146
- setOpen(visible);
147
- setTimeout(() => {
148
- var _a;
149
- setPopupOpen(visible);
150
- (_a = ref.current) == null ? void 0 : _a.blur();
151
- });
152
- return;
153
- }
154
- setOpen(visible);
155
- setPopupOpen(visible);
156
- };
157
- const handleOk = (val) => {
158
- const returnValue = val || _value;
159
- onChange == null ? void 0 : onChange(returnValue, returnValue == null ? void 0 : returnValue.format(format));
160
- handleOpenChange(false);
161
- };
162
- const handleChange = (val, valStr) => {
163
- canClose.current = true;
164
- setError(false);
165
- setCurrentShortcut("");
166
- setValue(val);
167
- handleOk(val);
168
- };
169
- const handleApply = () => {
170
- if (error)
171
- return;
172
- handleOk();
173
- };
174
- const handleDataStrChange = (e) => {
175
- const val = e.target.value;
176
- setValueStr(val);
177
- if (isValidDate(val, format)) {
178
- setError(false);
179
- const valDate = (0, import_dayjs.default)(val, format);
180
- setValue(valDate);
181
- } else {
182
- setError(true);
183
- }
184
- };
185
- if (!mode || mode === "date") {
186
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
187
- import_antd.DatePicker,
188
- {
189
- ...others,
190
- ref,
191
- defaultValue,
192
- showNow: false,
193
- onChange: handleChange,
194
- open: popupOpen,
195
- value: _value,
196
- onOpenChange: (o) => {
197
- if (!o && !canClose.current) {
198
- return;
199
- }
200
- handleOpenChange(o);
201
- },
202
- mode: "date",
203
- picker: "date",
204
- popupClassName: "date-picker-popup-wrap",
205
- format: currentShortcut ? () => import_constants.presetDetailMap[currentShortcut].label() : format,
206
- panelRender: (panelNode) => {
207
- const dom = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-date-picker-custom-wrap" }, /* @__PURE__ */ import_react.default.createElement(
208
- "div",
209
- {
210
- className: "pisell-lowcode-date-picker-custom-action",
211
- onMouseDown: (e) => {
212
- canClose.current = false;
213
- e.stopPropagation();
214
- }
215
- },
216
- /* @__PURE__ */ import_react.default.createElement("div", { style: { width: "50%" } }, /* @__PURE__ */ import_react.default.createElement(
217
- import_antd.Input,
218
- {
219
- size: "large",
220
- placeholder: (0, import_dayjs.default)().format(format),
221
- value: valueStr,
222
- onChange: handleDataStrChange
223
- }
224
- ), error && /* @__PURE__ */ import_react.default.createElement("span", { className: "date-picker-error" }, (0, import_locales.getText)("date-picker-invalid-date"))),
225
- /* @__PURE__ */ import_react.default.createElement(
226
- import_browserSelect.default,
227
- {
228
- value: currentShortcut || "custom",
229
- className: "date-picker-toolbar-select",
230
- options: customPresetItems,
231
- size: "large",
232
- onChange: handleSelectChange,
233
- style: { width: "50%" }
234
- }
235
- )
236
- ), panelNode), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-custom-footer" }, /* @__PURE__ */ import_react.default.createElement(
237
- "span",
238
- {
239
- className: "pisell-lowcode-custom-footer-today",
240
- onClick: handleTodayClick
241
- },
242
- (0, import_locales.getText)("date-picker-today")
243
- ), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "primary", size: "large", onClick: handleApply }, (0, import_locales.getText)("date-picker-apply"))));
244
- if (isDesktop) {
245
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-date-picker-custom-popup-wrap pisell-lowcode-date-picker-dropdown-mode" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-date-picker-custom-wrap" }, dom));
246
- }
247
- if (responsive === "phone") {
248
- return /* @__PURE__ */ import_react.default.createElement(
249
- import_antd.Drawer,
250
- {
251
- placement: "bottom",
252
- open,
253
- height: 565,
254
- closable: false,
255
- styles: {
256
- content: {
257
- borderRadius: "8px 8px 0 0"
258
- }
259
- },
260
- bodyStyle: { padding: 0 },
261
- maskClosable: false
262
- },
263
- /* @__PURE__ */ import_react.default.createElement(
264
- "div",
265
- {
266
- className: "pisell-lowcode-picker-custom-dropdown pisell-lowcode-date-picker-custom-popup-wrap",
267
- onMouseDown: (e) => e.stopPropagation()
268
- },
269
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-picker-panel-container pisell-lowcode-picker-date-panel-container" }, dom)
270
- )
271
- );
272
- }
273
- return /* @__PURE__ */ import_react.default.createElement(
274
- import_antd.Modal,
275
- {
276
- width: 458,
277
- open,
278
- footer: null,
279
- closable: false,
280
- wrapClassName: "pisell-lowcode-date-picker-modal"
281
- },
282
- /* @__PURE__ */ import_react.default.createElement(
283
- "div",
284
- {
285
- className: "pisell-lowcode-picker-custom-dropdown pisell-lowcode-date-picker-custom-popup-wrap",
286
- onMouseDown: (e) => e.stopPropagation()
287
- },
288
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-picker-panel-container pisell-lowcode-picker-date-panel-container" }, dom)
289
- )
290
- );
291
- }
292
- }
293
- ));
294
- }
295
- return /* @__PURE__ */ import_react.default.createElement(import_antd.DatePicker, { ...props });
296
- };
297
- var datePickerCpt_default = DatePickerCpt;
@@ -1,2 +0,0 @@
1
- declare const useMediaQuery: (query: string) => boolean;
2
- export default useMediaQuery;
@@ -1,43 +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/date-picker/hooks/useMediaQuery.ts
20
- var useMediaQuery_exports = {};
21
- __export(useMediaQuery_exports, {
22
- default: () => useMediaQuery_default
23
- });
24
- module.exports = __toCommonJS(useMediaQuery_exports);
25
- var import_react = require("react");
26
- var useMediaQuery = (query) => {
27
- const [matches, setMatches] = (0, import_react.useState)(false);
28
- (0, import_react.useEffect)(() => {
29
- const mediaQuery = window.matchMedia(query);
30
- if (mediaQuery.matches !== matches) {
31
- setMatches(mediaQuery.matches);
32
- }
33
- const handleMediaQueryChange = (event) => {
34
- setMatches(event.matches);
35
- };
36
- mediaQuery.addEventListener("change", handleMediaQueryChange);
37
- return () => {
38
- mediaQuery.removeEventListener("change", handleMediaQueryChange);
39
- };
40
- }, [query]);
41
- return matches;
42
- };
43
- var useMediaQuery_default = useMediaQuery;