@pisell/materials 1.0.351 → 1.0.353
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +14 -14
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +13 -13
- package/es/components/browserSelect/chevron-down.png +0 -0
- package/es/components/browserSelect/index.d.ts +15 -0
- package/es/components/browserSelect/index.js +36 -0
- package/es/components/browserSelect/index.less +18 -0
- package/es/components/date-picker/constants.d.ts +39 -0
- package/es/components/date-picker/constants.js +76 -0
- package/es/components/date-picker/datePickerCpt.d.ts +8 -0
- package/es/components/date-picker/datePickerCpt.js +280 -0
- package/es/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
- package/es/components/date-picker/hooks/useMediaQuery.js +28 -0
- package/es/components/date-picker/index.js +2 -2
- package/es/components/date-picker/index.less +1847 -0
- package/es/components/drag-sort-tree/TreeItem/index.js +29 -11
- package/es/components/drag-sort-tree/TreeItem/index.less +9 -2
- package/es/locales/en-US.d.ts +12 -0
- package/es/locales/en-US.js +14 -1
- package/es/locales/zh-CN.d.ts +12 -0
- package/es/locales/zh-CN.js +14 -1
- package/es/locales/zh-TW.d.ts +12 -0
- package/es/locales/zh-TW.js +14 -1
- package/lib/components/browserSelect/chevron-down.png +0 -0
- package/lib/components/browserSelect/index.d.ts +15 -0
- package/lib/components/browserSelect/index.js +59 -0
- package/lib/components/browserSelect/index.less +18 -0
- package/lib/components/date-picker/constants.d.ts +39 -0
- package/lib/components/date-picker/constants.js +78 -0
- package/lib/components/date-picker/datePickerCpt.d.ts +8 -0
- package/lib/components/date-picker/datePickerCpt.js +292 -0
- package/lib/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
- package/lib/components/date-picker/hooks/useMediaQuery.js +43 -0
- package/lib/components/date-picker/index.js +2 -2
- package/lib/components/date-picker/index.less +1847 -0
- package/lib/components/drag-sort-tree/TreeItem/index.js +43 -17
- package/lib/components/drag-sort-tree/TreeItem/index.less +9 -2
- package/lib/locales/en-US.d.ts +12 -0
- package/lib/locales/en-US.js +14 -1
- package/lib/locales/zh-CN.d.ts +12 -0
- package/lib/locales/zh-CN.js +14 -1
- package/lib/locales/zh-TW.d.ts +12 -0
- package/lib/locales/zh-TW.js +14 -1
- package/lowcode/drag-sort-tree/meta.ts +1 -1
- package/package.json +3 -3
|
@@ -4,18 +4,18 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
4
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
11
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
12
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
13
|
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."); }
|
|
9
14
|
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); }
|
|
10
15
|
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; }
|
|
11
16
|
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; } }
|
|
12
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
-
import React, { useMemo } from 'react';
|
|
18
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
19
19
|
import { useSortable } from '@dnd-kit/sortable';
|
|
20
20
|
import { DndContext } from '@dnd-kit/core';
|
|
21
21
|
import { Tooltip } from 'antd';
|
|
@@ -46,6 +46,10 @@ var TreeItem = function TreeItem(props) {
|
|
|
46
46
|
transform = _useSortable.transform,
|
|
47
47
|
transition = _useSortable.transition,
|
|
48
48
|
isDragging = _useSortable.isDragging;
|
|
49
|
+
var _useState = useState(window.innerWidth < 600),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
isMobile = _useState2[0],
|
|
52
|
+
setIsMobile = _useState2[1];
|
|
49
53
|
var style = {
|
|
50
54
|
transform: CSS.Transform.toString(transform && _objectSpread(_objectSpread({}, transform), {}, {
|
|
51
55
|
scaleY: 1
|
|
@@ -167,6 +171,17 @@ var TreeItem = function TreeItem(props) {
|
|
|
167
171
|
}
|
|
168
172
|
}))) : null;
|
|
169
173
|
}, [childrenProps === null || childrenProps === void 0 ? void 0 : childrenProps.hiddenWarningIcon, item === null || item === void 0 ? void 0 : item.is_available]);
|
|
174
|
+
var handleWindowResize = function handleWindowResize() {
|
|
175
|
+
// 获取当前窗口的宽度
|
|
176
|
+
var windowWidth = window.innerWidth;
|
|
177
|
+
setIsMobile(windowWidth < 600);
|
|
178
|
+
};
|
|
179
|
+
useEffect(function () {
|
|
180
|
+
window.addEventListener('resize', handleWindowResize);
|
|
181
|
+
return function () {
|
|
182
|
+
window.removeEventListener('resize', handleWindowResize);
|
|
183
|
+
};
|
|
184
|
+
}, []);
|
|
170
185
|
return /*#__PURE__*/React.createElement(DndContext, {
|
|
171
186
|
sensors: sensors,
|
|
172
187
|
modifiers: [restrictToVerticalAxis, restrictToParentElement],
|
|
@@ -174,8 +189,8 @@ var TreeItem = function TreeItem(props) {
|
|
|
174
189
|
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
175
190
|
ref: setNodeRef,
|
|
176
191
|
style: style
|
|
177
|
-
}, attributes, listeners), /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
className: classNames("".concat(prefix, "-drag-sort-tree"), childrenProps === null || childrenProps === void 0 ? void 0 : childrenProps.className),
|
|
192
|
+
}, attributes, !isMobile ? listeners : {}), /*#__PURE__*/React.createElement("div", {
|
|
193
|
+
className: classNames("".concat(prefix, "-drag-sort-tree"), childrenProps === null || childrenProps === void 0 ? void 0 : childrenProps.className, isMobile ? "".concat(prefix, "-drag-sort-phone-tree") : ''),
|
|
179
194
|
style: {
|
|
180
195
|
paddingLeft: !depth ? '10px' : "".concat(depth * 40, "px"),
|
|
181
196
|
cursor: isDragging ? 'grabbing' : 'grab'
|
|
@@ -183,9 +198,12 @@ var TreeItem = function TreeItem(props) {
|
|
|
183
198
|
onClick: onSelect
|
|
184
199
|
}, /*#__PURE__*/React.createElement("div", {
|
|
185
200
|
className: classNames("".concat(prefix, "-drag-sort-tree-item"))
|
|
186
|
-
}, !(childrenProps !== null && childrenProps !== void 0 && childrenProps.hiddenDraggableIcon) ? /*#__PURE__*/React.createElement(DotsSix, {
|
|
187
|
-
className: classNames("".concat(prefix, "-drag-sort-tree-item-dot-icon"))
|
|
188
|
-
|
|
201
|
+
}, !(childrenProps !== null && childrenProps !== void 0 && childrenProps.hiddenDraggableIcon) ? /*#__PURE__*/React.createElement(DotsSix, _extends({}, isMobile ? listeners : {}, {
|
|
202
|
+
className: classNames("".concat(prefix, "-drag-sort-tree-item-dot-icon")),
|
|
203
|
+
style: {
|
|
204
|
+
left: isMobile ? !depth ? '-14px' : '12px' : 0
|
|
205
|
+
}
|
|
206
|
+
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
189
207
|
className: "".concat(prefix, "-drag-sort-tree-title")
|
|
190
208
|
}, (childrenProps === null || childrenProps === void 0 ? void 0 : childrenProps.titleRender) || (item === null || item === void 0 ? void 0 : item.title))), !depth ? rightIcon : warningIcon), renderChildren));
|
|
191
209
|
};
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -97,5 +97,17 @@ declare const _default: {
|
|
|
97
97
|
'table-action-export-import-log-copy': string;
|
|
98
98
|
'table-action-export-import-table-success-copy': string;
|
|
99
99
|
'drag-sort-tree-unavailable-today-tip': string;
|
|
100
|
+
'date-picker-today': string;
|
|
101
|
+
'date-picker-yesterday': string;
|
|
102
|
+
'date-picker-tomorrow': string;
|
|
103
|
+
'date-picker-next_monday': string;
|
|
104
|
+
'date-picker-last_friday': string;
|
|
105
|
+
'date-picker-first_day_of_this_month': string;
|
|
106
|
+
'date-picker-last_day_of_this_month': string;
|
|
107
|
+
'date-picker-first_day_of_next_month': string;
|
|
108
|
+
'date-picker-last_day_of_last_month': string;
|
|
109
|
+
'date-picker-invalid-date': string;
|
|
110
|
+
"date-picker-apply": string;
|
|
111
|
+
'date-picker-shortcut-custom': string;
|
|
100
112
|
};
|
|
101
113
|
export default _default;
|
package/es/locales/en-US.js
CHANGED
|
@@ -118,5 +118,18 @@ export default {
|
|
|
118
118
|
'table-action-export-import-log-err-log': 'Failure Log',
|
|
119
119
|
'table-action-export-import-log-copy': 'Copy',
|
|
120
120
|
'table-action-export-import-table-success-copy': 'Copy Success',
|
|
121
|
-
'drag-sort-tree-unavailable-today-tip': 'Unavailable today'
|
|
121
|
+
'drag-sort-tree-unavailable-today-tip': 'Unavailable today',
|
|
122
|
+
// 日期组件
|
|
123
|
+
'date-picker-today': 'Today',
|
|
124
|
+
'date-picker-yesterday': 'Yesterday',
|
|
125
|
+
'date-picker-tomorrow': 'Tomorrow',
|
|
126
|
+
'date-picker-next_monday': 'Next monday',
|
|
127
|
+
'date-picker-last_friday': 'Last friday',
|
|
128
|
+
'date-picker-first_day_of_this_month': 'First day of this month',
|
|
129
|
+
'date-picker-last_day_of_this_month': 'Last day of this month',
|
|
130
|
+
'date-picker-first_day_of_next_month': 'First day of next month',
|
|
131
|
+
'date-picker-last_day_of_last_month': 'Last day of last month',
|
|
132
|
+
'date-picker-invalid-date': 'Invalid date',
|
|
133
|
+
"date-picker-apply": "Apply",
|
|
134
|
+
'date-picker-shortcut-custom': 'Custom'
|
|
122
135
|
};
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -97,5 +97,17 @@ declare const _default: {
|
|
|
97
97
|
'table-action-export-import-log-copy': string;
|
|
98
98
|
'table-action-export-import-table-success-copy': string;
|
|
99
99
|
'drag-sort-tree-unavailable-today-tip': string;
|
|
100
|
+
'date-picker-today': string;
|
|
101
|
+
'date-picker-yesterday': string;
|
|
102
|
+
'date-picker-tomorrow': string;
|
|
103
|
+
'date-picker-next_monday': string;
|
|
104
|
+
'date-picker-last_friday': string;
|
|
105
|
+
'date-picker-first_day_of_this_month': string;
|
|
106
|
+
'date-picker-last_day_of_this_month': string;
|
|
107
|
+
'date-picker-first_day_of_next_month': string;
|
|
108
|
+
'date-picker-last_day_of_last_month': string;
|
|
109
|
+
'date-picker-invalid-date': string;
|
|
110
|
+
"date-picker-apply": string;
|
|
111
|
+
'date-picker-shortcut-custom': string;
|
|
100
112
|
};
|
|
101
113
|
export default _default;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -118,5 +118,18 @@ export default {
|
|
|
118
118
|
'table-action-export-import-log-err-log': '失败日志',
|
|
119
119
|
'table-action-export-import-log-copy': '复制',
|
|
120
120
|
'table-action-export-import-table-success-copy': '复制成功',
|
|
121
|
-
'drag-sort-tree-unavailable-today-tip': '今日不可用'
|
|
121
|
+
'drag-sort-tree-unavailable-today-tip': '今日不可用',
|
|
122
|
+
// 日期组件
|
|
123
|
+
'date-picker-today': '今天',
|
|
124
|
+
'date-picker-yesterday': '昨天',
|
|
125
|
+
'date-picker-tomorrow': '明天',
|
|
126
|
+
'date-picker-next_monday': '下个星期一',
|
|
127
|
+
'date-picker-last_friday': '上个星期五',
|
|
128
|
+
'date-picker-first_day_of_this_month': '本月的第一天',
|
|
129
|
+
'date-picker-last_day_of_this_month': '本月的最后一天',
|
|
130
|
+
'date-picker-first_day_of_next_month': '下个月的第一天',
|
|
131
|
+
'date-picker-last_day_of_last_month': '上个月的最后一天',
|
|
132
|
+
'date-picker-invalid-date': '无效日期',
|
|
133
|
+
"date-picker-apply": "确定",
|
|
134
|
+
'date-picker-shortcut-custom': '自定义'
|
|
122
135
|
};
|
package/es/locales/zh-TW.d.ts
CHANGED
|
@@ -97,5 +97,17 @@ declare const _default: {
|
|
|
97
97
|
'table-action-export-import-log-copy': string;
|
|
98
98
|
'table-action-export-import-table-success-copy': string;
|
|
99
99
|
'drag-sort-tree-unavailable-today-tip': string;
|
|
100
|
+
'date-picker-today': string;
|
|
101
|
+
'date-picker-yesterday': string;
|
|
102
|
+
'date-picker-tomorrow': string;
|
|
103
|
+
'date-picker-next_monday': string;
|
|
104
|
+
'date-picker-last_friday': string;
|
|
105
|
+
'date-picker-first_day_of_this_month': string;
|
|
106
|
+
'date-picker-last_day_of_this_month': string;
|
|
107
|
+
'date-picker-first_day_of_next_month': string;
|
|
108
|
+
'date-picker-last_day_of_last_month': string;
|
|
109
|
+
'date-picker-invalid-date': string;
|
|
110
|
+
"date-picker-apply": string;
|
|
111
|
+
'date-picker-shortcut-custom': string;
|
|
100
112
|
};
|
|
101
113
|
export default _default;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -118,5 +118,18 @@ export default {
|
|
|
118
118
|
'table-action-export-import-log-err-log': '失敗日誌',
|
|
119
119
|
'table-action-export-import-log-copy': '復製',
|
|
120
120
|
'table-action-export-import-table-success-copy': '復製成功',
|
|
121
|
-
'drag-sort-tree-unavailable-today-tip': '今日不可用'
|
|
121
|
+
'drag-sort-tree-unavailable-today-tip': '今日不可用',
|
|
122
|
+
// 日期组件
|
|
123
|
+
'date-picker-today': '今天',
|
|
124
|
+
'date-picker-yesterday': '昨天',
|
|
125
|
+
'date-picker-tomorrow': '明天',
|
|
126
|
+
'date-picker-next_monday': '下個星期一',
|
|
127
|
+
'date-picker-last_friday': '上個星期五',
|
|
128
|
+
'date-picker-first_day_of_this_month': '本月的第一天',
|
|
129
|
+
'date-picker-last_day_of_this_month': '本月的最後一天',
|
|
130
|
+
'date-picker-first_day_of_next_month': '下個月的第一天',
|
|
131
|
+
'date-picker-last_day_of_last_month': '上個月的最後一天',
|
|
132
|
+
'date-picker-invalid-date': '無效日期',
|
|
133
|
+
"date-picker-apply": "确定",
|
|
134
|
+
'date-picker-shortcut-custom': '自定義'
|
|
122
135
|
};
|
|
Binary file
|
|
@@ -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,59 @@
|
|
|
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;
|
|
@@ -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,78 @@
|
|
|
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
|
+
});
|
|
@@ -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;
|