@pisell/materials 2.2.10 → 2.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +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/Pagination/index.d.ts +1 -1
- package/es/components/date-picker/index.js +2 -1
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +4 -1
- package/es/components/drag-sort-tree/TreeItem/index.js +45 -31
- package/es/components/drag-sort-tree/TreeItem/index.less +44 -13
- package/es/components/drag-sort-tree/index.js +40 -16
- package/es/components/drag-sort-tree/types.d.ts +5 -1
- package/es/components/sort/index.d.ts +3 -3
- package/es/components/sort/index.js +28 -28
- package/es/components/table/BasicTable/index.d.ts +2 -2
- package/es/components/table/BasicTable/index.js +11 -10
- package/es/components/table/Table/fields/index.d.ts +31 -0
- package/es/components/table/Table/fields/index.js +5 -2
- package/es/components/table/Table/fields/oldRangePicker/Config/index.d.ts +3 -0
- package/es/components/table/Table/fields/oldRangePicker/Config/index.js +5 -0
- package/es/components/table/Table/fields/oldRangePicker/Edit/index.d.ts +4 -0
- package/es/components/table/Table/fields/oldRangePicker/Edit/index.js +106 -0
- package/es/components/table/Table/fields/oldRangePicker/Show/index.d.ts +4 -0
- package/es/components/table/Table/fields/oldRangePicker/Show/index.js +17 -0
- package/es/components/table/Table/fields/oldRangePicker/Sort/index.d.ts +3 -0
- package/es/components/table/Table/fields/oldRangePicker/Sort/index.js +5 -0
- package/es/components/table/Table/fields/oldRangePicker/filterUtil/index.d.ts +13 -0
- package/es/components/table/Table/fields/oldRangePicker/filterUtil/index.js +50 -0
- package/es/components/table/Table/fields/oldRangePicker/index.d.ts +16 -0
- package/es/components/table/Table/fields/oldRangePicker/index.js +19 -0
- package/es/components/table/Table/utils.js +1 -1
- package/es/locales/en-US.d.ts +1 -0
- package/es/locales/en-US.js +2 -1
- package/es/locales/zh-CN.d.ts +1 -0
- package/es/locales/zh-CN.js +2 -1
- package/es/locales/zh-TW.d.ts +1 -0
- package/es/locales/zh-TW.js +2 -1
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/date-picker/index.js +1 -0
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +4 -1
- package/lib/components/drag-sort-tree/TreeItem/index.js +86 -29
- package/lib/components/drag-sort-tree/TreeItem/index.less +44 -13
- package/lib/components/drag-sort-tree/index.js +28 -13
- package/lib/components/drag-sort-tree/types.d.ts +5 -1
- package/lib/components/sort/index.d.ts +3 -3
- package/lib/components/sort/index.js +2 -2
- package/lib/components/table/BasicTable/index.d.ts +2 -2
- package/lib/components/table/BasicTable/index.js +6 -2
- package/lib/components/table/Table/fields/index.d.ts +31 -0
- package/lib/components/table/Table/fields/index.js +5 -2
- package/lib/components/table/Table/fields/oldRangePicker/Config/index.d.ts +3 -0
- package/lib/components/table/Table/fields/oldRangePicker/Config/index.js +39 -0
- package/lib/components/table/Table/fields/oldRangePicker/Edit/index.d.ts +4 -0
- package/lib/components/table/Table/fields/oldRangePicker/Edit/index.js +131 -0
- package/lib/components/table/Table/fields/oldRangePicker/Show/index.d.ts +4 -0
- package/lib/components/table/Table/fields/oldRangePicker/Show/index.js +48 -0
- package/lib/components/table/Table/fields/oldRangePicker/Sort/index.d.ts +3 -0
- package/lib/components/table/Table/fields/oldRangePicker/Sort/index.js +39 -0
- package/lib/components/table/Table/fields/oldRangePicker/filterUtil/index.d.ts +13 -0
- package/lib/components/table/Table/fields/oldRangePicker/filterUtil/index.js +61 -0
- package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +16 -0
- package/lib/components/table/Table/fields/oldRangePicker/index.js +53 -0
- package/lib/components/table/Table/utils.js +1 -1
- package/lib/locales/en-US.d.ts +1 -0
- package/lib/locales/en-US.js +2 -1
- package/lib/locales/zh-CN.d.ts +1 -0
- package/lib/locales/zh-CN.js +2 -1
- package/lib/locales/zh-TW.d.ts +1 -0
- package/lib/locales/zh-TW.js +2 -1
- package/lowcode/date-picker.old-range-picker/__screenshots__/date-picker-range-picker-1.png +0 -0
- package/lowcode/date-picker.old-range-picker/__screenshots__/date-picker-range-picker-2.png +0 -0
- package/lowcode/date-picker.old-range-picker/__screenshots__/date-picker-range-picker-3.png +0 -0
- package/lowcode/date-picker.old-range-picker/__screenshots__/date-picker-range-picker-4.png +0 -0
- package/lowcode/date-picker.old-range-picker/meta.ts +305 -0
- package/lowcode/date-picker.old-range-picker/snippets.ts +11 -0
- package/lowcode/drag-sort-tree/meta.ts +10 -1
- package/lowcode/table/meta.ts +18 -0
- package/package.json +4 -4
|
@@ -5,38 +5,69 @@
|
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: space-between;
|
|
8
|
-
font-size:
|
|
9
|
-
cursor: pointer;
|
|
8
|
+
font-size: 14px;
|
|
10
9
|
touch-action: none !important;
|
|
11
10
|
width: 100%;
|
|
12
11
|
color: #101828;
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
padding: 9px 10px;
|
|
13
|
+
height: auto;
|
|
14
|
+
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
&:hover {
|
|
17
|
+
background: #F9FAFB;
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
}
|
|
15
20
|
}
|
|
16
21
|
|
|
17
|
-
&-drag-sort-tree
|
|
18
|
-
|
|
19
|
-
border-radius: 6px;
|
|
22
|
+
&-drag-sort-tree-item{
|
|
23
|
+
flex: 1;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
&-drag-sort-tree-item {
|
|
23
27
|
display: flex;
|
|
24
28
|
align-items: center;
|
|
25
29
|
}
|
|
26
|
-
|
|
30
|
+
|
|
27
31
|
&-drag-sort-tree &-drag-sort-tree-title {
|
|
28
32
|
margin-left: 10px;
|
|
29
33
|
font-size: 14px;
|
|
34
|
+
line-height: 20px;
|
|
35
|
+
margin-right: 30px;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
&-drag-sort-tree-icon,
|
|
33
|
-
&-drag-sort-tree-item-icon
|
|
34
|
-
|
|
35
|
-
width: 30px;
|
|
39
|
+
&-drag-sort-tree-item-icon,
|
|
40
|
+
&-drag-sort-tree-item-dot-icon {
|
|
36
41
|
display: flex;
|
|
37
42
|
align-items: center;
|
|
38
43
|
justify-content: center;
|
|
39
44
|
}
|
|
40
|
-
}
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
&-drag-sort-tree-icon,
|
|
47
|
+
&-drag-sort-tree-item-icon{
|
|
48
|
+
height: 40px;
|
|
49
|
+
width: 40px;
|
|
50
|
+
position: absolute;
|
|
51
|
+
right: 0;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&-drag-sort-tree-icon{
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&-drag-sort-tree-item-dot-icon{
|
|
60
|
+
height: 20px;
|
|
61
|
+
width: 20px;
|
|
62
|
+
color: #344054;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// 移动端
|
|
66
|
+
&-drag-sort-phone-tree &-drag-sort-tree-item-dot-icon {
|
|
67
|
+
position: absolute;
|
|
68
|
+
color: #344054;
|
|
69
|
+
top: 0;
|
|
70
|
+
width: 40px;
|
|
71
|
+
height: 40px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -39,9 +39,16 @@ var import_TreeItem = __toESM(require("./TreeItem"));
|
|
|
39
39
|
var import_modifiers = require("@dnd-kit/modifiers");
|
|
40
40
|
var import_index = require("./index.less");
|
|
41
41
|
var DragSortTree = (props) => {
|
|
42
|
-
const { value, rowKey, tabKey, onChange } = props;
|
|
42
|
+
const { value, rowKey, tabKey, hiddenKeys, onChange } = props;
|
|
43
43
|
const [items, setItems] = (0, import_react.useState)(value || []);
|
|
44
|
-
const [
|
|
44
|
+
const [expandedKeys, setExpandedKeys] = (0, import_react.useState)([]);
|
|
45
|
+
(0, import_react.useEffect)(() => {
|
|
46
|
+
let keys = value == null ? void 0 : value.map((item) => item[rowKey]);
|
|
47
|
+
keys = keys.filter(
|
|
48
|
+
(key) => (hiddenKeys == null ? void 0 : hiddenKeys.length) ? !hiddenKeys.includes(key) : key
|
|
49
|
+
);
|
|
50
|
+
setExpandedKeys([...keys]);
|
|
51
|
+
}, [hiddenKeys]);
|
|
45
52
|
(0, import_react.useEffect)(() => {
|
|
46
53
|
setItems(value || []);
|
|
47
54
|
}, [tabKey]);
|
|
@@ -53,23 +60,30 @@ var DragSortTree = (props) => {
|
|
|
53
60
|
})
|
|
54
61
|
);
|
|
55
62
|
const handleDragStart = (event) => {
|
|
63
|
+
var _a, _b;
|
|
56
64
|
const { active } = event;
|
|
57
|
-
|
|
65
|
+
const activeId = (_b = (_a = active == null ? void 0 : active.id) == null ? void 0 : _a.split("-")) == null ? void 0 : _b[1];
|
|
66
|
+
const _keys = expandedKeys == null ? void 0 : expandedKeys.filter((key) => key != activeId);
|
|
67
|
+
setExpandedKeys([..._keys]);
|
|
58
68
|
};
|
|
59
69
|
const handleDragEnd = (event) => {
|
|
70
|
+
var _a, _b, _c, _d;
|
|
60
71
|
const { active, over } = event;
|
|
61
|
-
setActiveId(null);
|
|
62
72
|
if (!over || !active)
|
|
63
73
|
return;
|
|
64
74
|
try {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (
|
|
75
|
+
let activeId = (_b = (_a = active == null ? void 0 : active.id) == null ? void 0 : _a.split("-")) == null ? void 0 : _b[1];
|
|
76
|
+
let overId = (_d = (_c = over == null ? void 0 : over.id) == null ? void 0 : _c.split("-")) == null ? void 0 : _d[1];
|
|
77
|
+
if (activeId !== overId) {
|
|
78
|
+
if (!(hiddenKeys == null ? void 0 : hiddenKeys.includes(Number(activeId)))) {
|
|
79
|
+
const _keys = [...expandedKeys, Number(activeId)];
|
|
80
|
+
setExpandedKeys([..._keys]);
|
|
81
|
+
}
|
|
68
82
|
const activeIndex = items.findIndex(
|
|
69
|
-
(item) => item[rowKey]
|
|
83
|
+
(item) => item[rowKey] == activeId
|
|
70
84
|
);
|
|
71
85
|
const overIndex = items.findIndex(
|
|
72
|
-
(item) => item[rowKey]
|
|
86
|
+
(item) => item[rowKey] == overId
|
|
73
87
|
);
|
|
74
88
|
const _lists = (0, import_sortable.arrayMove)(items, activeIndex, overIndex);
|
|
75
89
|
handleChange(_lists);
|
|
@@ -92,20 +106,21 @@ var DragSortTree = (props) => {
|
|
|
92
106
|
/* @__PURE__ */ import_react.default.createElement(
|
|
93
107
|
import_sortable.SortableContext,
|
|
94
108
|
{
|
|
95
|
-
items: items.map((item) => item[rowKey]),
|
|
109
|
+
items: items.map((item) => `0-${item[rowKey]}`),
|
|
96
110
|
strategy: import_sortable.verticalListSortingStrategy
|
|
97
111
|
},
|
|
98
112
|
items.map((item) => /* @__PURE__ */ import_react.default.createElement(
|
|
99
113
|
import_TreeItem.default,
|
|
100
114
|
{
|
|
101
|
-
key: item[rowKey]
|
|
102
|
-
id: item[rowKey]
|
|
115
|
+
key: `0-${item[rowKey]}`,
|
|
116
|
+
id: `0-${item[rowKey]}`,
|
|
103
117
|
item,
|
|
104
118
|
depth: 0,
|
|
105
119
|
sensors,
|
|
106
|
-
activeId,
|
|
107
120
|
childrenProps: props,
|
|
108
121
|
lists: items,
|
|
122
|
+
expandedKeys,
|
|
123
|
+
setExpandedKeys,
|
|
109
124
|
onChange: handleChange
|
|
110
125
|
}
|
|
111
126
|
))
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
declare type IdType = string | number;
|
|
2
3
|
export declare type ValueProps = {
|
|
3
|
-
id:
|
|
4
|
+
id: IdType;
|
|
4
5
|
title: string;
|
|
5
6
|
show?: boolean;
|
|
6
7
|
is_available?: boolean;
|
|
@@ -16,5 +17,8 @@ export declare type SortType = {
|
|
|
16
17
|
hiddenRightIcon?: boolean;
|
|
17
18
|
hiddenWarningIcon?: boolean;
|
|
18
19
|
tabKey?: string;
|
|
20
|
+
hiddenKeys?: IdType[];
|
|
21
|
+
onHiddenChange?: (value: IdType[]) => void;
|
|
19
22
|
onChange?: (value: ValueProps[]) => void;
|
|
20
23
|
};
|
|
24
|
+
export {};
|
|
@@ -48,11 +48,11 @@ var Label = ({ content }) => {
|
|
|
48
48
|
var sortChildrenMap = {
|
|
49
49
|
date: (key, isLocal) => [
|
|
50
50
|
{
|
|
51
|
-
key: `${key}:
|
|
51
|
+
key: `${key}:asc${isLocal ? ":date" : ""}`,
|
|
52
52
|
label: /* @__PURE__ */ import_react.default.createElement(Label, { content: (0, import_locales.getText)("sort-oldest-to-newest") })
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
key: `${key}:
|
|
55
|
+
key: `${key}:desc${isLocal ? ":date" : ""}`,
|
|
56
56
|
label: /* @__PURE__ */ import_react.default.createElement(Label, { content: (0, import_locales.getText)("sort-newest-to-oldest") })
|
|
57
57
|
}
|
|
58
58
|
],
|
|
@@ -45,7 +45,10 @@ var BasicTable = (props) => {
|
|
|
45
45
|
const [filter, setFilter] = (0, import_react.useState)();
|
|
46
46
|
const [sort, setSort] = (0, import_react.useState)();
|
|
47
47
|
const form = import_antd.Form.useFormInstance();
|
|
48
|
-
const formPagination = import_antd.Form.useWatch("pagination", {
|
|
48
|
+
const formPagination = import_antd.Form.useWatch("pagination", {
|
|
49
|
+
form,
|
|
50
|
+
preserve: true
|
|
51
|
+
}) || {
|
|
49
52
|
page: 1,
|
|
50
53
|
size: 10
|
|
51
54
|
};
|
|
@@ -90,6 +93,7 @@ var BasicTable = (props) => {
|
|
|
90
93
|
sort,
|
|
91
94
|
other.columns
|
|
92
95
|
]);
|
|
96
|
+
console.log(pagination, "wh8888");
|
|
93
97
|
const total = (0, import_react.useMemo)(() => {
|
|
94
98
|
if (localPagination) {
|
|
95
99
|
return (_dataSource == null ? void 0 : _dataSource.total) || 0;
|
|
@@ -144,7 +148,7 @@ var BasicTable = (props) => {
|
|
|
144
148
|
defaultExpandAllRows: true
|
|
145
149
|
}
|
|
146
150
|
}
|
|
147
|
-
), total > ((pagination == null ? void 0 : pagination.pageSize) || ((_a = pagination == null ? void 0 : pagination.pageSizeOptions) == null ? void 0 : _a[0]) || 10) ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "pagination" }, /* @__PURE__ */ import_react.default.createElement(
|
|
151
|
+
), total > ((pagination == null ? void 0 : pagination.pageSize) || ((_a = pagination == null ? void 0 : pagination.pageSizeOptions) == null ? void 0 : _a[0]) || 10) || (pagination == null ? void 0 : pagination.showPagination) && total > 10 ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "pagination" }, /* @__PURE__ */ import_react.default.createElement(
|
|
148
152
|
import_Pagination.FormPagination,
|
|
149
153
|
{
|
|
150
154
|
...pagination,
|
|
@@ -140,6 +140,19 @@ export declare const fieldMaps: {
|
|
|
140
140
|
show: (props: import("./types").FieldPropsType) => import("react").JSX.Element;
|
|
141
141
|
filterFn: typeof import("./treeSelect/filterUtil").default;
|
|
142
142
|
};
|
|
143
|
+
oldRangePicker: {
|
|
144
|
+
field: {
|
|
145
|
+
field_icon: string;
|
|
146
|
+
field_name: string;
|
|
147
|
+
field_type: string;
|
|
148
|
+
default_value: string;
|
|
149
|
+
};
|
|
150
|
+
config: () => import("react").JSX.Element;
|
|
151
|
+
edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
|
|
152
|
+
sort: () => import("react").JSX.Element;
|
|
153
|
+
show: (props: import("./types").FieldPropsType) => import("react").JSX.Element;
|
|
154
|
+
filterFn: typeof import("./oldRangePicker/filterUtil").default;
|
|
155
|
+
};
|
|
143
156
|
};
|
|
144
157
|
export declare const fieldList: ({
|
|
145
158
|
field_icon: string;
|
|
@@ -196,6 +209,11 @@ export declare const fieldList: ({
|
|
|
196
209
|
field_name: string;
|
|
197
210
|
field_type: string;
|
|
198
211
|
default_value: string;
|
|
212
|
+
} | {
|
|
213
|
+
field_icon: string;
|
|
214
|
+
field_name: string;
|
|
215
|
+
field_type: string;
|
|
216
|
+
default_value: string;
|
|
199
217
|
})[];
|
|
200
218
|
export declare const getFieldByType: (type: string) => {
|
|
201
219
|
field: {
|
|
@@ -351,5 +369,18 @@ declare const _default: {
|
|
|
351
369
|
show: (props: import("./types").FieldPropsType) => import("react").JSX.Element;
|
|
352
370
|
filterFn: typeof import("./treeSelect/filterUtil").default;
|
|
353
371
|
};
|
|
372
|
+
oldRangePicker: {
|
|
373
|
+
field: {
|
|
374
|
+
field_icon: string;
|
|
375
|
+
field_name: string;
|
|
376
|
+
field_type: string;
|
|
377
|
+
default_value: string;
|
|
378
|
+
};
|
|
379
|
+
config: () => import("react").JSX.Element;
|
|
380
|
+
edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
|
|
381
|
+
sort: () => import("react").JSX.Element;
|
|
382
|
+
show: (props: import("./types").FieldPropsType) => import("react").JSX.Element;
|
|
383
|
+
filterFn: typeof import("./oldRangePicker/filterUtil").default;
|
|
384
|
+
};
|
|
354
385
|
};
|
|
355
386
|
export default _default;
|
|
@@ -46,6 +46,7 @@ var import_rangePicker = __toESM(require("./rangePicker"));
|
|
|
46
46
|
var import_search = __toESM(require("./search"));
|
|
47
47
|
var import_pSwitch = __toESM(require("./pSwitch"));
|
|
48
48
|
var import_treeSelect = __toESM(require("./treeSelect"));
|
|
49
|
+
var import_oldRangePicker = __toESM(require("./oldRangePicker"));
|
|
49
50
|
var fieldMaps = {
|
|
50
51
|
text: import_text.default,
|
|
51
52
|
link: import_link.default,
|
|
@@ -57,7 +58,8 @@ var fieldMaps = {
|
|
|
57
58
|
search: import_search.default,
|
|
58
59
|
pSwitch: import_pSwitch.default,
|
|
59
60
|
numberRange: import_numberRange.default,
|
|
60
|
-
treeSelect: import_treeSelect.default
|
|
61
|
+
treeSelect: import_treeSelect.default,
|
|
62
|
+
oldRangePicker: import_oldRangePicker.default
|
|
61
63
|
};
|
|
62
64
|
var fieldList = Object.values(fieldMaps).map((d) => {
|
|
63
65
|
return d.field;
|
|
@@ -76,7 +78,8 @@ var fields_default = {
|
|
|
76
78
|
search: import_search.default,
|
|
77
79
|
pSwitch: import_pSwitch.default,
|
|
78
80
|
numberRange: import_numberRange.default,
|
|
79
|
-
treeSelect: import_treeSelect.default
|
|
81
|
+
treeSelect: import_treeSelect.default,
|
|
82
|
+
oldRangePicker: import_oldRangePicker.default
|
|
80
83
|
};
|
|
81
84
|
// Annotate the CommonJS export names for ESM import in node:
|
|
82
85
|
0 && (module.exports = {
|
|
@@ -0,0 +1,39 @@
|
|
|
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/table/Table/fields/oldRangePicker/Config/index.tsx
|
|
30
|
+
var Config_exports = {};
|
|
31
|
+
__export(Config_exports, {
|
|
32
|
+
default: () => Config_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Config_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var Config = () => {
|
|
37
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null);
|
|
38
|
+
};
|
|
39
|
+
var Config_default = Config;
|
|
@@ -0,0 +1,131 @@
|
|
|
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/table/Table/fields/oldRangePicker/Edit/index.tsx
|
|
30
|
+
var Edit_exports = {};
|
|
31
|
+
__export(Edit_exports, {
|
|
32
|
+
default: () => Edit_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Edit_exports);
|
|
35
|
+
var import_utils = require("@pisell/utils");
|
|
36
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_date_picker = __toESM(require("../../../../../date-picker"));
|
|
39
|
+
var import_locales = require("../../../../../../locales");
|
|
40
|
+
var { OldRangePicker: RangePicker } = import_date_picker.default;
|
|
41
|
+
var defaultFormat = "YYYY-MM-DD HH:mm:ss";
|
|
42
|
+
var Edit = (props, ref) => {
|
|
43
|
+
const {
|
|
44
|
+
value,
|
|
45
|
+
onChange,
|
|
46
|
+
onPressEnter,
|
|
47
|
+
onBlur,
|
|
48
|
+
style,
|
|
49
|
+
bordered,
|
|
50
|
+
presets,
|
|
51
|
+
showTime,
|
|
52
|
+
format,
|
|
53
|
+
...others
|
|
54
|
+
} = props;
|
|
55
|
+
const dayjsVal = (0, import_react.useMemo)(() => {
|
|
56
|
+
if ((0, import_utils.isString)(value)) {
|
|
57
|
+
return (0, import_dayjs.default)(value);
|
|
58
|
+
}
|
|
59
|
+
if ((0, import_utils.isArr)(value)) {
|
|
60
|
+
if (value.some((item) => !item)) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
return value.map((item) => (0, import_dayjs.default)(item));
|
|
64
|
+
}
|
|
65
|
+
return value;
|
|
66
|
+
}, [value]);
|
|
67
|
+
const rangePresets = [
|
|
68
|
+
{ label: (0, import_locales.getText)("table-action-range-picker-presets-today"), value: [(0, import_dayjs.default)().startOf("day"), (0, import_dayjs.default)().endOf("day")] },
|
|
69
|
+
{
|
|
70
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-yesterday"),
|
|
71
|
+
value: [
|
|
72
|
+
(0, import_dayjs.default)().add(-1, "d").startOf("day"),
|
|
73
|
+
(0, import_dayjs.default)().add(-1, "d").endOf("day")
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-3-day"),
|
|
78
|
+
value: [(0, import_dayjs.default)().add(-3, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-7-day"),
|
|
82
|
+
value: [(0, import_dayjs.default)().add(-7, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-14-day"),
|
|
86
|
+
value: [(0, import_dayjs.default)().add(-14, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-30-day"),
|
|
90
|
+
value: [(0, import_dayjs.default)().add(-30, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-90-day"),
|
|
94
|
+
value: [(0, import_dayjs.default)().add(-90, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
95
|
+
}
|
|
96
|
+
];
|
|
97
|
+
const _showTime = (0, import_react.useMemo)(() => {
|
|
98
|
+
if ((0, import_utils.isBoolean)(showTime)) {
|
|
99
|
+
return showTime;
|
|
100
|
+
} else if (typeof showTime === "object") {
|
|
101
|
+
return showTime;
|
|
102
|
+
}
|
|
103
|
+
return true;
|
|
104
|
+
}, [showTime]);
|
|
105
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
106
|
+
RangePicker,
|
|
107
|
+
{
|
|
108
|
+
...others,
|
|
109
|
+
format,
|
|
110
|
+
showTime: _showTime,
|
|
111
|
+
presets: presets || rangePresets,
|
|
112
|
+
ref,
|
|
113
|
+
value: dayjsVal,
|
|
114
|
+
onChange: (date) => {
|
|
115
|
+
onChange == null ? void 0 : onChange(date == null ? void 0 : date.map((item) => {
|
|
116
|
+
var _a;
|
|
117
|
+
return ((_a = item == null ? void 0 : item.format) == null ? void 0 : _a.call(item, defaultFormat)) || null;
|
|
118
|
+
}));
|
|
119
|
+
},
|
|
120
|
+
onPressEnter,
|
|
121
|
+
onBlur,
|
|
122
|
+
style: { width: "220px", ...style },
|
|
123
|
+
bordered,
|
|
124
|
+
onClick: (e) => e.stopPropagation(),
|
|
125
|
+
panelRender: (dom) => {
|
|
126
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { onClick: (e) => e.stopPropagation() }, dom);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
var Edit_default = (0, import_react.forwardRef)(Edit);
|
|
@@ -0,0 +1,48 @@
|
|
|
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/table/Table/fields/oldRangePicker/Show/index.tsx
|
|
30
|
+
var Show_exports = {};
|
|
31
|
+
__export(Show_exports, {
|
|
32
|
+
default: () => Show_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Show_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var Show = (props) => {
|
|
37
|
+
const {
|
|
38
|
+
title,
|
|
39
|
+
editable,
|
|
40
|
+
dataIndex,
|
|
41
|
+
field_type,
|
|
42
|
+
record,
|
|
43
|
+
handleSave,
|
|
44
|
+
...restProps
|
|
45
|
+
} = props;
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, record[dataIndex]);
|
|
47
|
+
};
|
|
48
|
+
var Show_default = Show;
|
|
@@ -0,0 +1,39 @@
|
|
|
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/table/Table/fields/oldRangePicker/Sort/index.tsx
|
|
30
|
+
var Sort_exports = {};
|
|
31
|
+
__export(Sort_exports, {
|
|
32
|
+
default: () => Sort_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Sort_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var Sort = () => {
|
|
37
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null);
|
|
38
|
+
};
|
|
39
|
+
var Sort_default = Sort;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Dayjs } from "dayjs";
|
|
2
|
+
/**
|
|
3
|
+
* 判断dataSource日期是否在filters范围内
|
|
4
|
+
* @param value 日期数组
|
|
5
|
+
* @param key 对应日期在对象中的键
|
|
6
|
+
* @param item 包含日期的对象
|
|
7
|
+
* @returns 如果日期在给定范围内返回true,否则返回false
|
|
8
|
+
*/
|
|
9
|
+
export default function ({ value, key, item, }: {
|
|
10
|
+
value: (string | Dayjs)[];
|
|
11
|
+
key: string | string[];
|
|
12
|
+
item: Record<string, any>;
|
|
13
|
+
}): boolean;
|