@pisell/materials 1.0.63 → 1.0.65
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +11 -159
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -155
- 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/drawer/index.js +0 -1
- package/es/components/filter/components/FilterItem/index.js +3 -2
- package/es/components/table/BasicTable/index.js +49 -8
- package/es/components/table/Table/AddFieldModal/index.js +0 -1
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +0 -1
- package/es/components/table/Table/index.js +34 -1
- package/es/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
- package/es/components/table/Table/tableConfig/summary/index.js +0 -1
- package/es/components/table/Table/utils.d.ts +1 -0
- package/es/components/table/Table/utils.js +70 -0
- package/es/components/table/TableFilter/SortIcon.d.ts +6 -0
- package/es/components/table/TableFilter/SortIcon.js +30 -0
- package/es/components/table/TableFilter/index.less +14 -0
- package/es/components/table/TableFilter/numberFilter.d.ts +6 -0
- package/es/components/table/TableFilter/numberFilter.js +95 -0
- package/es/components/table/TableFilter/selectFilter.d.ts +10 -0
- package/es/components/table/TableFilter/selectFilter.js +126 -0
- package/es/components/table/TableFilter/stringFilter.d.ts +6 -0
- package/es/components/table/TableFilter/stringFilter.js +73 -0
- package/es/components/table/index.js +2 -1
- package/es/components/table/index.less +49 -1
- package/lib/components/drawer/index.js +0 -1
- package/lib/components/filter/components/FilterItem/index.js +1 -1
- package/lib/components/table/BasicTable/index.js +44 -8
- package/lib/components/table/Table/AddFieldModal/index.js +0 -1
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +0 -1
- package/lib/components/table/Table/index.js +25 -0
- package/lib/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
- package/lib/components/table/Table/tableConfig/summary/index.js +0 -1
- package/lib/components/table/Table/utils.d.ts +1 -0
- package/lib/components/table/Table/utils.js +108 -0
- package/lib/components/table/TableFilter/SortIcon.d.ts +6 -0
- package/lib/components/table/TableFilter/SortIcon.js +59 -0
- package/lib/components/table/TableFilter/index.less +14 -0
- package/lib/components/table/TableFilter/numberFilter.d.ts +6 -0
- package/lib/components/table/TableFilter/numberFilter.js +110 -0
- package/lib/components/table/TableFilter/selectFilter.d.ts +10 -0
- package/lib/components/table/TableFilter/selectFilter.js +123 -0
- package/lib/components/table/TableFilter/stringFilter.d.ts +6 -0
- package/lib/components/table/TableFilter/stringFilter.js +99 -0
- package/lib/components/table/index.js +1 -1
- package/lib/components/table/index.less +49 -1
- package/package.json +4 -4
|
@@ -0,0 +1,123 @@
|
|
|
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/TableFilter/selectFilter.tsx
|
|
30
|
+
var selectFilter_exports = {};
|
|
31
|
+
__export(selectFilter_exports, {
|
|
32
|
+
default: () => selectFilter_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(selectFilter_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_icon = require("@pisell/icon");
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var FilterDropdown = (props) => {
|
|
40
|
+
const { setSelectedKeys, selectedKeys, confirm, clearFilters, filters } = props;
|
|
41
|
+
const [value, setValue] = (0, import_react.useState)((selectedKeys == null ? void 0 : selectedKeys[0]) || []);
|
|
42
|
+
(0, import_react.useEffect)(() => {
|
|
43
|
+
setValue((selectedKeys == null ? void 0 : selectedKeys[0]) || []);
|
|
44
|
+
}, [selectedKeys == null ? void 0 : selectedKeys[0]]);
|
|
45
|
+
const items = (0, import_react.useMemo)(() => {
|
|
46
|
+
return filters.map((item) => ({
|
|
47
|
+
label: /* @__PURE__ */ import_react.default.createElement(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
onClick: (e) => {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { checked: value.includes(item.value) }, item.text)
|
|
55
|
+
),
|
|
56
|
+
key: item.value
|
|
57
|
+
}));
|
|
58
|
+
}, [filters, value]);
|
|
59
|
+
const handleClick = ({ key }) => {
|
|
60
|
+
setValue((v) => {
|
|
61
|
+
if (v.includes(key)) {
|
|
62
|
+
return v.filter((item) => item !== key);
|
|
63
|
+
}
|
|
64
|
+
return [...v, key];
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
(0, import_react.useEffect)(() => {
|
|
68
|
+
setSelectedKeys((value == null ? void 0 : value.length) ? [value] : []);
|
|
69
|
+
}, [value]);
|
|
70
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
74
|
+
className: "pisell-table-filter-dropdown"
|
|
75
|
+
},
|
|
76
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-table-filter-dropdown-top", style: { padding: 0 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
77
|
+
import_antd.Menu,
|
|
78
|
+
{
|
|
79
|
+
onClick: handleClick,
|
|
80
|
+
items,
|
|
81
|
+
selectedKeys: [],
|
|
82
|
+
style: { width: 272 }
|
|
83
|
+
}
|
|
84
|
+
)),
|
|
85
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
86
|
+
import_antd.Space,
|
|
87
|
+
{
|
|
88
|
+
className: "pisell-table-filter-dropdown-bottom",
|
|
89
|
+
styles: { item: { flex: 1 } }
|
|
90
|
+
},
|
|
91
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
92
|
+
import_antd.Button,
|
|
93
|
+
{
|
|
94
|
+
onClick: () => {
|
|
95
|
+
clearFilters && clearFilters();
|
|
96
|
+
confirm();
|
|
97
|
+
},
|
|
98
|
+
block: true,
|
|
99
|
+
style: { flex: 1 }
|
|
100
|
+
},
|
|
101
|
+
"Clear"
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
import_antd.Button,
|
|
105
|
+
{
|
|
106
|
+
type: "primary",
|
|
107
|
+
onClick: () => confirm(),
|
|
108
|
+
block: true,
|
|
109
|
+
style: { flex: 1 }
|
|
110
|
+
},
|
|
111
|
+
"Filter"
|
|
112
|
+
)
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
var getColumnSelectProps = ({
|
|
117
|
+
dataIndex,
|
|
118
|
+
filters
|
|
119
|
+
}) => ({
|
|
120
|
+
filterDropdown: (props) => /* @__PURE__ */ import_react.default.createElement(FilterDropdown, { ...props, filters }),
|
|
121
|
+
filterIcon: (filtered) => filtered ? /* @__PURE__ */ import_react.default.createElement(import_icon.FilterFunnel01Fill, { style: { color: "#7f56d9", fontSize: 14 } }) : /* @__PURE__ */ import_react.default.createElement(import_icon.FilterFunnel01, { style: { color: "#98A2B3", fontSize: 14 } })
|
|
122
|
+
});
|
|
123
|
+
var selectFilter_default = getColumnSelectProps;
|
|
@@ -0,0 +1,99 @@
|
|
|
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/TableFilter/stringFilter.tsx
|
|
30
|
+
var stringFilter_exports = {};
|
|
31
|
+
__export(stringFilter_exports, {
|
|
32
|
+
default: () => stringFilter_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(stringFilter_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_icon = require("@pisell/icon");
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var getColumnStringProps = ({
|
|
40
|
+
dataIndex
|
|
41
|
+
}) => ({
|
|
42
|
+
filterDropdown: ({
|
|
43
|
+
setSelectedKeys,
|
|
44
|
+
selectedKeys,
|
|
45
|
+
confirm,
|
|
46
|
+
clearFilters,
|
|
47
|
+
close
|
|
48
|
+
}) => /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
52
|
+
className: "pisell-table-filter-dropdown"
|
|
53
|
+
},
|
|
54
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-table-filter-dropdown-top" }, /* @__PURE__ */ import_react.default.createElement(
|
|
55
|
+
import_antd.Input,
|
|
56
|
+
{
|
|
57
|
+
prefix: /* @__PURE__ */ import_react.default.createElement(import_icon.SearchLg, null),
|
|
58
|
+
placeholder: "Search",
|
|
59
|
+
value: selectedKeys[0],
|
|
60
|
+
onChange: (e) => setSelectedKeys(e.target.value ? [e.target.value] : []),
|
|
61
|
+
onPressEnter: () => confirm(),
|
|
62
|
+
style: { width: 240 }
|
|
63
|
+
}
|
|
64
|
+
)),
|
|
65
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
import_antd.Space,
|
|
67
|
+
{
|
|
68
|
+
className: "pisell-table-filter-dropdown-bottom",
|
|
69
|
+
styles: { item: { flex: 1 } }
|
|
70
|
+
},
|
|
71
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
72
|
+
import_antd.Button,
|
|
73
|
+
{
|
|
74
|
+
onClick: () => {
|
|
75
|
+
clearFilters && clearFilters();
|
|
76
|
+
confirm({
|
|
77
|
+
closeDropdown: false
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
block: true,
|
|
81
|
+
style: { flex: 1 }
|
|
82
|
+
},
|
|
83
|
+
"Reset"
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
86
|
+
import_antd.Button,
|
|
87
|
+
{
|
|
88
|
+
type: "primary",
|
|
89
|
+
onClick: () => confirm(),
|
|
90
|
+
block: true,
|
|
91
|
+
style: { flex: 1 }
|
|
92
|
+
},
|
|
93
|
+
"Filter"
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
),
|
|
97
|
+
filterIcon: (filtered) => /* @__PURE__ */ import_react.default.createElement(import_icon.SearchLg, { style: { color: filtered ? "#7f56d9" : void 0, fontSize: 16 } })
|
|
98
|
+
});
|
|
99
|
+
var stringFilter_default = getColumnStringProps;
|
|
@@ -100,7 +100,7 @@ var GridView = (0, import_model.Provider)((props) => {
|
|
|
100
100
|
page: 1
|
|
101
101
|
};
|
|
102
102
|
} else {
|
|
103
|
-
if ((
|
|
103
|
+
if ((_a = other == null ? void 0 : other.pagination) == null ? void 0 : _a.localPagination) {
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -3,5 +3,53 @@
|
|
|
3
3
|
height: 100%;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
|
-
|
|
6
|
+
.pisell-lowcode-table-filter-column {
|
|
7
|
+
align-items: center;
|
|
8
|
+
.pisell-lowcode-dropdown-trigger {
|
|
9
|
+
width: 25px;
|
|
10
|
+
height: 25px;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
}
|
|
13
|
+
.pisell-lowcode-table-filter-trigger.active {
|
|
14
|
+
background: var(--primary-100, #F4EBFF);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
.pisell-lowcode-table-column-sorters {
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
.pisell-table-sorter-inner {
|
|
21
|
+
width: 25px;
|
|
22
|
+
height: 25px;
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
margin-inline-start: 4px;
|
|
27
|
+
color: rgba(0, 0, 0, 0.29);
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
transition: color 0.3s;
|
|
30
|
+
border-radius: 8px;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
&:hover {
|
|
33
|
+
background: var(--primary-100, #F4EBFF);
|
|
34
|
+
}
|
|
35
|
+
.pisell-table-column-sorter-up,.pisell-table-column-sorter-down {
|
|
36
|
+
color: rgba(102, 112, 133, 0.65);
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
}
|
|
39
|
+
.pisell-table-column-sorter-down {
|
|
40
|
+
margin-top: -0.3em;
|
|
41
|
+
}
|
|
42
|
+
.pisell-table-column-up {
|
|
43
|
+
font-size: 20px;
|
|
44
|
+
}
|
|
45
|
+
.pisell-table-column-down {
|
|
46
|
+
font-size: 20px;
|
|
47
|
+
transform: rotate(180deg);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.pisell-table-sorter-inner.active {
|
|
51
|
+
background: var(--primary-100, #F4EBFF);
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
color: #7F56D9
|
|
54
|
+
}
|
|
7
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.65",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"@dnd-kit/sortable": "^7.0.2",
|
|
55
55
|
"@dnd-kit/utilities": "^3.2.1",
|
|
56
56
|
"ahooks": "^3.7.6",
|
|
57
|
-
"@pisell/
|
|
58
|
-
"@pisell/
|
|
59
|
-
"@pisell/date-picker": "1.0.
|
|
57
|
+
"@pisell/icon": "0.0.8",
|
|
58
|
+
"@pisell/utils": "1.0.3",
|
|
59
|
+
"@pisell/date-picker": "1.0.23"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"react": "^18.0.0",
|