@pisell/materials 1.0.402 → 1.0.404
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 +13 -13
- package/build/lowcode/assets-dev.json +4 -4
- package/build/lowcode/assets-prod.json +13 -13
- 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 +16 -59
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +19 -62
- 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/date-picker/index.js +2 -2
- package/es/components/drag-sort-tree/index.d.ts +1 -0
- package/es/components/drag-sort-tree/index.js +1 -2
- package/es/components/pisell-config-provider/index.js +0 -2
- package/es/components/pisellModal/components/functions/index.d.ts +5 -23
- package/es/components/pisellModal/components/functions/index.js +2 -7
- package/es/components/pisellModal/index.d.ts +5 -20
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +26 -30
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +1 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +21 -25
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +31 -34
- package/es/components/table/Actions/component/ExportImport/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/index.js +25 -32
- package/es/components/table/BasicTable/index.js +2 -1
- package/es/components/table/Gallery/index.js +1 -2
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +11 -13
- package/es/components/table/Table/index.d.ts +2 -2
- package/es/components/table/Table/index.js +42 -68
- package/es/components/table/Table/index.less +0 -3
- package/es/components/table/Table/utils.d.ts +3 -15
- package/es/components/table/Table/utils.js +2 -6
- package/es/components/table/View/index.d.ts +2 -2
- package/es/components/table/View/index.js +16 -20
- package/es/components/table/hooks/useTableSetting.js +7 -29
- package/es/components/table/hooks/useTransDataSource.d.ts +0 -1
- package/es/components/table/hooks/useTransDataSource.js +4 -6
- package/es/components/table/index.js +5 -8
- package/es/components/table/index.less +0 -4
- package/es/components/table/serve.d.ts +0 -1
- package/es/components/table/serve.js +7 -38
- package/es/components/table/types.d.ts +0 -2
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -3
- package/es/locales/en-US.d.ts +0 -12
- package/es/locales/en-US.js +0 -13
- package/es/locales/zh-CN.d.ts +0 -12
- package/es/locales/zh-CN.js +0 -13
- package/es/locales/zh-TW.d.ts +0 -12
- package/es/locales/zh-TW.js +0 -13
- package/lib/components/date-picker/index.js +2 -2
- package/lib/components/drag-sort-tree/index.d.ts +1 -0
- package/lib/components/drag-sort-tree/index.js +1 -0
- package/lib/components/pisell-config-provider/index.js +0 -2
- package/lib/components/pisellModal/components/functions/index.d.ts +5 -23
- package/lib/components/pisellModal/components/functions/index.js +7 -13
- package/lib/components/pisellModal/index.d.ts +5 -20
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +2 -6
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +1 -2
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +2 -6
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +2 -4
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/index.js +8 -13
- package/lib/components/table/BasicTable/index.js +2 -1
- package/lib/components/table/Gallery/index.js +1 -2
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +9 -1
- package/lib/components/table/Table/index.d.ts +2 -2
- package/lib/components/table/Table/index.js +34 -61
- package/lib/components/table/Table/index.less +0 -3
- package/lib/components/table/Table/utils.d.ts +3 -15
- package/lib/components/table/Table/utils.js +1 -7
- package/lib/components/table/View/index.d.ts +2 -2
- package/lib/components/table/View/index.js +19 -23
- package/lib/components/table/hooks/useTableSetting.js +11 -26
- package/lib/components/table/hooks/useTransDataSource.d.ts +0 -1
- package/lib/components/table/hooks/useTransDataSource.js +4 -5
- package/lib/components/table/index.js +4 -5
- package/lib/components/table/index.less +0 -4
- package/lib/components/table/serve.d.ts +0 -1
- package/lib/components/table/serve.js +4 -24
- package/lib/components/table/types.d.ts +0 -2
- package/lib/index.d.ts +1 -3
- package/lib/index.js +0 -6
- package/lib/locales/en-US.d.ts +0 -12
- package/lib/locales/en-US.js +0 -13
- package/lib/locales/zh-CN.d.ts +0 -12
- package/lib/locales/zh-CN.js +0 -13
- package/lib/locales/zh-TW.d.ts +0 -12
- package/lib/locales/zh-TW.js +0 -13
- package/package.json +3 -3
- package/es/components/browserSelect/chevron-down.png +0 -0
- package/es/components/browserSelect/index.d.ts +0 -15
- package/es/components/browserSelect/index.js +0 -36
- package/es/components/browserSelect/index.less +0 -18
- package/es/components/date-picker/constants.d.ts +0 -39
- package/es/components/date-picker/constants.js +0 -76
- package/es/components/date-picker/datePickerCpt.d.ts +0 -8
- package/es/components/date-picker/datePickerCpt.js +0 -370
- package/es/components/date-picker/hooks/useMediaQuery.d.ts +0 -2
- package/es/components/date-picker/hooks/useMediaQuery.js +0 -28
- package/es/components/date-picker/index.less +0 -1880
- package/es/components/picker-view/index.d.ts +0 -2
- package/es/components/picker-view/index.js +0 -2
- package/es/components/pisellTags/index.d.ts +0 -13
- package/es/components/pisellTags/index.js +0 -83
- package/es/components/pisellTags/index.less +0 -17
- package/es/components/pisellTags/utils.d.ts +0 -1
- package/es/components/pisellTags/utils.js +0 -89
- package/lib/components/browserSelect/chevron-down.png +0 -0
- package/lib/components/browserSelect/index.d.ts +0 -15
- package/lib/components/browserSelect/index.js +0 -59
- package/lib/components/browserSelect/index.less +0 -18
- package/lib/components/date-picker/constants.d.ts +0 -39
- package/lib/components/date-picker/constants.js +0 -78
- package/lib/components/date-picker/datePickerCpt.d.ts +0 -8
- package/lib/components/date-picker/datePickerCpt.js +0 -403
- package/lib/components/date-picker/hooks/useMediaQuery.d.ts +0 -2
- package/lib/components/date-picker/hooks/useMediaQuery.js +0 -43
- package/lib/components/date-picker/index.less +0 -1880
- package/lib/components/picker-view/index.d.ts +0 -2
- package/lib/components/picker-view/index.js +0 -36
- package/lib/components/pisellTags/index.d.ts +0 -13
- package/lib/components/pisellTags/index.js +0 -113
- package/lib/components/pisellTags/index.less +0 -17
- package/lib/components/pisellTags/utils.d.ts +0 -1
- package/lib/components/pisellTags/utils.js +0 -86
|
@@ -1,403 +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_classnames = __toESM(require("classnames"));
|
|
38
|
-
var import_antd = require("antd");
|
|
39
|
-
var import_browserSelect = __toESM(require("../browserSelect"));
|
|
40
|
-
var import_utils = require("@pisell/utils");
|
|
41
|
-
var import_constants = require("./constants");
|
|
42
|
-
var import_locales = require("../../locales");
|
|
43
|
-
var import_useResponsive = __toESM(require("../../hooks/useResponsive"));
|
|
44
|
-
var import_index = require("./index.less");
|
|
45
|
-
var isValidDate = (dateString, format) => {
|
|
46
|
-
const date = window.dayjs(dateString, format, true);
|
|
47
|
-
return date.isValid();
|
|
48
|
-
};
|
|
49
|
-
(0, import_useResponsive.configResponsive)({
|
|
50
|
-
phone: 0,
|
|
51
|
-
ipad: 768,
|
|
52
|
-
pc: 1080
|
|
53
|
-
});
|
|
54
|
-
var DatePickerCpt = (props) => {
|
|
55
|
-
const {
|
|
56
|
-
picker,
|
|
57
|
-
onChange,
|
|
58
|
-
value,
|
|
59
|
-
format: propsFormat,
|
|
60
|
-
defaultValue,
|
|
61
|
-
showTime,
|
|
62
|
-
...others
|
|
63
|
-
} = props;
|
|
64
|
-
const { locale } = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
|
|
65
|
-
const [currentShortcut, setCurrentShortcut] = (0, import_react.useState)("");
|
|
66
|
-
const [open, setOpen] = (0, import_react.useState)(false);
|
|
67
|
-
const [popupOpen, setPopupOpen] = (0, import_react.useState)(false);
|
|
68
|
-
const [_value, setValue] = (0, import_react.useState)(value);
|
|
69
|
-
const [valueStr, setValueStr] = (0, import_react.useState)("");
|
|
70
|
-
const [error, setError] = (0, import_react.useState)(false);
|
|
71
|
-
const ref = (0, import_react.useRef)(null);
|
|
72
|
-
const panelRef = (0, import_react.useRef)(null);
|
|
73
|
-
const canClose = (0, import_react.useRef)(true);
|
|
74
|
-
const [panelTimeWidth, setPanelTimeWidth] = (0, import_react.useState)(0);
|
|
75
|
-
const responsive = (0, import_useResponsive.default)();
|
|
76
|
-
const isDesktop = !("ontouchstart" in window || navigator.maxTouchPoints);
|
|
77
|
-
(0, import_react.useEffect)(() => {
|
|
78
|
-
document.body.id = "body";
|
|
79
|
-
}, []);
|
|
80
|
-
(0, import_react.useEffect)(() => {
|
|
81
|
-
setValue(value);
|
|
82
|
-
}, [value]);
|
|
83
|
-
(0, import_react.useEffect)(() => {
|
|
84
|
-
setValueStr((_value == null ? void 0 : _value.format(format || "YYYY-MM-DD")) || "");
|
|
85
|
-
}, [_value]);
|
|
86
|
-
const customPresetItems = (0, import_react.useMemo)(() => {
|
|
87
|
-
const preset = [
|
|
88
|
-
{
|
|
89
|
-
label: import_constants.presetDetailMap["today"].label(),
|
|
90
|
-
value: "today"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
label: import_constants.presetDetailMap["yesterday"].label(),
|
|
94
|
-
value: "yesterday"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
label: import_constants.presetDetailMap["tomorrow"].label(),
|
|
98
|
-
value: "tomorrow"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
label: import_constants.presetDetailMap["next_monday"].label(),
|
|
102
|
-
value: "next_monday"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
label: import_constants.presetDetailMap["last_friday"].label(),
|
|
106
|
-
value: "last_friday"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
label: import_constants.presetDetailMap["first_day_of_this_month"].label(),
|
|
110
|
-
value: "first_day_of_this_month"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
label: import_constants.presetDetailMap["last_day_of_this_month"].label(),
|
|
114
|
-
value: "last_day_of_this_month"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
label: import_constants.presetDetailMap["first_day_of_next_month"].label(),
|
|
118
|
-
value: "first_day_of_next_month"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
label: import_constants.presetDetailMap["last_day_of_last_month"].label(),
|
|
122
|
-
value: "last_day_of_last_month"
|
|
123
|
-
}
|
|
124
|
-
];
|
|
125
|
-
if (!currentShortcut) {
|
|
126
|
-
preset.push({
|
|
127
|
-
label: (0, import_locales.getText)("date-picker-shortcut-custom"),
|
|
128
|
-
value: "custom"
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return preset;
|
|
132
|
-
}, [currentShortcut]);
|
|
133
|
-
const format = (0, import_react.useMemo)(() => {
|
|
134
|
-
if (propsFormat) {
|
|
135
|
-
if ((0, import_utils.isFunction)(propsFormat)) {
|
|
136
|
-
return propsFormat(value);
|
|
137
|
-
}
|
|
138
|
-
return propsFormat;
|
|
139
|
-
}
|
|
140
|
-
let localeValue = locale == null ? void 0 : locale.locale;
|
|
141
|
-
return localeValue === "en" || localeValue === "en-US" ? "DD/MM/YYYY" : "YYYY/MM/DD";
|
|
142
|
-
}, [propsFormat, locale]);
|
|
143
|
-
const handleSelectChange = (e) => {
|
|
144
|
-
var _a;
|
|
145
|
-
canClose.current = true;
|
|
146
|
-
const shortcut = e.target.value;
|
|
147
|
-
setCurrentShortcut(shortcut);
|
|
148
|
-
const date = (_a = import_constants.presetDetailMap[shortcut]) == null ? void 0 : _a.getValue();
|
|
149
|
-
setValue(date);
|
|
150
|
-
handleOk(date);
|
|
151
|
-
};
|
|
152
|
-
const handleTodayClick = () => {
|
|
153
|
-
const val = (0, import_dayjs.default)().startOf("day");
|
|
154
|
-
handleChange(val);
|
|
155
|
-
handleOpenChange(false);
|
|
156
|
-
};
|
|
157
|
-
const handleOpenChange = (visible) => {
|
|
158
|
-
if (!visible) {
|
|
159
|
-
setOpen(visible);
|
|
160
|
-
setTimeout(() => {
|
|
161
|
-
var _a;
|
|
162
|
-
setPopupOpen(visible);
|
|
163
|
-
(_a = ref.current) == null ? void 0 : _a.blur();
|
|
164
|
-
});
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
setOpen(visible);
|
|
168
|
-
setPopupOpen(visible);
|
|
169
|
-
};
|
|
170
|
-
const handleOk = (val) => {
|
|
171
|
-
const returnValue = val || _value;
|
|
172
|
-
onChange == null ? void 0 : onChange(returnValue, returnValue == null ? void 0 : returnValue.format("YYYY-MM-DD"));
|
|
173
|
-
handleOpenChange(false);
|
|
174
|
-
};
|
|
175
|
-
const handleChange = (val, valStr, isNotChange) => {
|
|
176
|
-
if (!showTime) {
|
|
177
|
-
canClose.current = true;
|
|
178
|
-
}
|
|
179
|
-
setError(false);
|
|
180
|
-
setCurrentShortcut("");
|
|
181
|
-
setValue(val);
|
|
182
|
-
if (!isNotChange) {
|
|
183
|
-
handleOk(val);
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
const handleApply = () => {
|
|
187
|
-
if (error)
|
|
188
|
-
return;
|
|
189
|
-
handleOk();
|
|
190
|
-
};
|
|
191
|
-
const handleDataStrChange = (e) => {
|
|
192
|
-
const val = e.target.value;
|
|
193
|
-
setValueStr(val);
|
|
194
|
-
if (isValidDate(val, format)) {
|
|
195
|
-
setError(false);
|
|
196
|
-
const valDate = (0, import_dayjs.default)(val, format);
|
|
197
|
-
setValue(valDate);
|
|
198
|
-
} else {
|
|
199
|
-
setError(true);
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
(0, import_react.useEffect)(() => {
|
|
203
|
-
var _a;
|
|
204
|
-
let width = 0;
|
|
205
|
-
const childElements = ((_a = panelRef.current) == null ? void 0 : _a.getElementsByClassName(
|
|
206
|
-
"pisell-lowcode-picker-time-panel"
|
|
207
|
-
)) || [];
|
|
208
|
-
if (childElements.length > 0) {
|
|
209
|
-
const childElement = childElements[0];
|
|
210
|
-
width = childElement.offsetWidth;
|
|
211
|
-
}
|
|
212
|
-
if (width > 0) {
|
|
213
|
-
setPanelTimeWidth(width);
|
|
214
|
-
}
|
|
215
|
-
}, [open]);
|
|
216
|
-
const handleSelect = (val) => {
|
|
217
|
-
canClose.current = !showTime;
|
|
218
|
-
setValue(val);
|
|
219
|
-
};
|
|
220
|
-
const handleTimeChange = (val) => {
|
|
221
|
-
setValue(
|
|
222
|
-
(preVal) => {
|
|
223
|
-
var _a, _b;
|
|
224
|
-
return ((_b = (_a = preVal == null ? void 0 : preVal.set("hour", (val == null ? void 0 : val.get("hour")) || 0)) == null ? void 0 : _a.set("minute", (val == null ? void 0 : val.get("minute")) || 0)) == null ? void 0 : _b.set("second", (val == null ? void 0 : val.get("second")) || 0)) || null;
|
|
225
|
-
}
|
|
226
|
-
);
|
|
227
|
-
};
|
|
228
|
-
const timeInputProps = (0, import_react.useMemo)(() => {
|
|
229
|
-
let step = 1;
|
|
230
|
-
let _format = "";
|
|
231
|
-
if ((showTime == null ? void 0 : showTime.format) === "HH:mm") {
|
|
232
|
-
step = void 0;
|
|
233
|
-
_format = "HH:mm";
|
|
234
|
-
} else if ((showTime == null ? void 0 : showTime.format) === "HH:mm:ss" || showTime) {
|
|
235
|
-
step = 1;
|
|
236
|
-
_format = "HH:mm:ss";
|
|
237
|
-
}
|
|
238
|
-
return {
|
|
239
|
-
step,
|
|
240
|
-
onChange: (e) => {
|
|
241
|
-
const val = e.target.value;
|
|
242
|
-
handleTimeChange(window.dayjs(val, _format));
|
|
243
|
-
},
|
|
244
|
-
value: _value == null ? void 0 : _value.format(_format)
|
|
245
|
-
};
|
|
246
|
-
}, [showTime, _value]);
|
|
247
|
-
if (!picker || picker === "date") {
|
|
248
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
249
|
-
import_antd.DatePicker,
|
|
250
|
-
{
|
|
251
|
-
...others,
|
|
252
|
-
ref,
|
|
253
|
-
onSelect: handleSelect,
|
|
254
|
-
showTime: isDesktop ? showTime : false,
|
|
255
|
-
defaultValue,
|
|
256
|
-
showNow: false,
|
|
257
|
-
onChange: (val, valStr) => handleChange(val, valStr, !isDesktop && showTime),
|
|
258
|
-
open: popupOpen,
|
|
259
|
-
renderExtraFooter: !(!showTime || isDesktop) ? () => {
|
|
260
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
261
|
-
"div",
|
|
262
|
-
{
|
|
263
|
-
onMouseDown: (e) => {
|
|
264
|
-
canClose.current = false;
|
|
265
|
-
e.stopPropagation();
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-time-label" }, "Time"),
|
|
269
|
-
/* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
270
|
-
"input",
|
|
271
|
-
{
|
|
272
|
-
type: "time",
|
|
273
|
-
className: "date-picker-input-time",
|
|
274
|
-
...timeInputProps
|
|
275
|
-
}
|
|
276
|
-
))
|
|
277
|
-
);
|
|
278
|
-
} : void 0,
|
|
279
|
-
className: (0, import_classnames.default)(
|
|
280
|
-
"pisell-lowcode-mode-date-picker",
|
|
281
|
-
others.className
|
|
282
|
-
),
|
|
283
|
-
value: _value,
|
|
284
|
-
onOpenChange: (o) => {
|
|
285
|
-
if (!o && (!canClose.current || showTime)) {
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
handleOpenChange(o);
|
|
289
|
-
},
|
|
290
|
-
mode: "date",
|
|
291
|
-
picker: "date",
|
|
292
|
-
popupClassName: "date-picker-popup-wrap",
|
|
293
|
-
format: currentShortcut ? () => import_constants.presetDetailMap[currentShortcut].label() : format,
|
|
294
|
-
panelRender: (panelNode) => {
|
|
295
|
-
const dom = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
296
|
-
"div",
|
|
297
|
-
{
|
|
298
|
-
className: (0, import_classnames.default)(
|
|
299
|
-
"pisell-lowcode-date-picker-custom-wrap",
|
|
300
|
-
{
|
|
301
|
-
["pisell-lowcode-date-picker-custom-wrap-show-time"]: showTime
|
|
302
|
-
}
|
|
303
|
-
),
|
|
304
|
-
ref: panelRef
|
|
305
|
-
},
|
|
306
|
-
!showTime && /* @__PURE__ */ import_react.default.createElement(
|
|
307
|
-
"div",
|
|
308
|
-
{
|
|
309
|
-
className: "pisell-lowcode-date-picker-custom-action",
|
|
310
|
-
onMouseDown: (e) => {
|
|
311
|
-
canClose.current = false;
|
|
312
|
-
e.stopPropagation();
|
|
313
|
-
},
|
|
314
|
-
style: {
|
|
315
|
-
width: `calc(100% - 48px - ${panelTimeWidth}px)`
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
/* @__PURE__ */ import_react.default.createElement("div", { style: { width: "50%" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
319
|
-
import_antd.Input,
|
|
320
|
-
{
|
|
321
|
-
size: "large",
|
|
322
|
-
placeholder: (0, import_dayjs.default)().format(
|
|
323
|
-
format || "YYYY-MM-DD"
|
|
324
|
-
),
|
|
325
|
-
value: valueStr,
|
|
326
|
-
onChange: handleDataStrChange
|
|
327
|
-
}
|
|
328
|
-
), error && /* @__PURE__ */ import_react.default.createElement("span", { className: "date-picker-error" }, (0, import_locales.getText)("date-picker-invalid-date"))),
|
|
329
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
330
|
-
import_browserSelect.default,
|
|
331
|
-
{
|
|
332
|
-
value: currentShortcut || "custom",
|
|
333
|
-
className: "date-picker-toolbar-select",
|
|
334
|
-
options: customPresetItems,
|
|
335
|
-
size: "large",
|
|
336
|
-
onChange: handleSelectChange,
|
|
337
|
-
style: { width: "50%" }
|
|
338
|
-
}
|
|
339
|
-
)
|
|
340
|
-
),
|
|
341
|
-
panelNode
|
|
342
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-custom-footer" }, /* @__PURE__ */ import_react.default.createElement(
|
|
343
|
-
"span",
|
|
344
|
-
{
|
|
345
|
-
className: "pisell-lowcode-custom-footer-today",
|
|
346
|
-
onClick: handleTodayClick
|
|
347
|
-
},
|
|
348
|
-
(0, import_locales.getText)("date-picker-today")
|
|
349
|
-
), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "primary", size: "large", onClick: handleApply }, (0, import_locales.getText)("date-picker-apply"))));
|
|
350
|
-
if (isDesktop) {
|
|
351
|
-
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));
|
|
352
|
-
}
|
|
353
|
-
if (responsive === "phone") {
|
|
354
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
355
|
-
import_antd.Drawer,
|
|
356
|
-
{
|
|
357
|
-
placement: "bottom",
|
|
358
|
-
open,
|
|
359
|
-
height: "auto",
|
|
360
|
-
closable: false,
|
|
361
|
-
styles: {
|
|
362
|
-
content: {
|
|
363
|
-
borderRadius: "8px 8px 0 0"
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
bodyStyle: { padding: 0 },
|
|
367
|
-
maskClosable: false
|
|
368
|
-
},
|
|
369
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
370
|
-
"div",
|
|
371
|
-
{
|
|
372
|
-
className: "pisell-lowcode-picker-custom-dropdown pisell-lowcode-date-picker-custom-popup-wrap",
|
|
373
|
-
onMouseDown: (e) => e.stopPropagation()
|
|
374
|
-
},
|
|
375
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-picker-panel-container pisell-lowcode-picker-date-panel-container" }, dom)
|
|
376
|
-
)
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
380
|
-
import_antd.Modal,
|
|
381
|
-
{
|
|
382
|
-
width: 458,
|
|
383
|
-
open,
|
|
384
|
-
footer: null,
|
|
385
|
-
closable: false,
|
|
386
|
-
wrapClassName: "pisell-lowcode-date-picker-modal"
|
|
387
|
-
},
|
|
388
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
389
|
-
"div",
|
|
390
|
-
{
|
|
391
|
-
className: "pisell-lowcode-picker-custom-dropdown pisell-lowcode-date-picker-custom-popup-wrap",
|
|
392
|
-
onMouseDown: (e) => e.stopPropagation()
|
|
393
|
-
},
|
|
394
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-picker-panel-container pisell-lowcode-picker-date-panel-container" }, dom)
|
|
395
|
-
)
|
|
396
|
-
);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
));
|
|
400
|
-
}
|
|
401
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.DatePicker, { ...props });
|
|
402
|
-
};
|
|
403
|
-
var datePickerCpt_default = DatePickerCpt;
|
|
@@ -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;
|