@pisell/materials 3.0.1 → 3.0.2
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 +5 -5
- 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 +20 -20
- 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/MultipleContainersSortList/index.js +2 -1
- package/es/components/dropdown/index.d.ts +2 -2
- package/es/components/dropdown/index.js +4 -2
- package/es/components/filter/components/Dropdown/index.less +3 -1
- package/es/components/filter/components/FilterButton/index.js +3 -1
- package/es/components/filter/index.js +30 -2
- package/es/components/list/index.js +2 -1
- package/es/components/segmented/index.d.ts +4 -0
- package/es/components/segmented/index.js +6 -0
- package/es/components/sort/index.js +3 -2
- package/es/components/table/Actions/component/ColumnsSetting/PopoverContent.js +4 -2
- package/es/components/table/Actions/component/ColumnsSetting/PopoverContent.less +4 -0
- package/es/components/table/Actions/index.js +10 -2
- package/es/components/table/Gallery/components/VirtualGrid/index.js +9 -0
- package/es/components/table/Gallery/components/VirtualGrid/useGenGridProps.js +1 -1
- package/es/components/table/Gallery/index.less +1 -0
- package/es/components/table/Header/Buttons/index.d.ts +1 -1
- package/es/components/table/Header/Buttons/index.js +12 -2
- package/es/components/table/Table/fields/image/Edit/index.js +8 -3
- package/es/components/table/Table/fields/number/Edit/index.js +8 -3
- package/es/components/table/Table/fields/search/filterUtil/index.js +3 -2
- package/es/components/table/Table/index.js +1 -0
- package/es/components/table/Table/utils.d.ts +2 -1
- package/es/components/table/Table/utils.js +8 -0
- package/es/components/table/hooks/useTransFilterSetting.js +3 -1
- package/es/components/table/index.js +8 -5
- package/es/components/tabs/index.d.ts +1 -0
- package/es/components/tabs/index.js +7 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -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/es/utils/platform.js +1 -1
- package/lib/components/MultipleContainersSortList/index.js +2 -1
- package/lib/components/dropdown/index.d.ts +2 -2
- package/lib/components/dropdown/index.js +4 -2
- package/lib/components/filter/components/Dropdown/index.less +3 -1
- package/lib/components/filter/components/FilterButton/index.js +3 -1
- package/lib/components/filter/index.js +25 -1
- package/lib/components/list/index.js +2 -1
- package/lib/components/segmented/index.d.ts +4 -0
- package/lib/components/segmented/index.js +40 -0
- package/lib/components/sort/index.js +3 -2
- package/lib/components/table/Actions/component/ColumnsSetting/PopoverContent.js +2 -2
- package/lib/components/table/Actions/component/ColumnsSetting/PopoverContent.less +4 -0
- package/lib/components/table/Actions/index.js +23 -1
- package/lib/components/table/Gallery/components/VirtualGrid/index.js +4 -0
- package/lib/components/table/Gallery/components/VirtualGrid/useGenGridProps.js +1 -1
- package/lib/components/table/Gallery/index.less +1 -0
- package/lib/components/table/Header/Buttons/index.d.ts +1 -1
- package/lib/components/table/Header/Buttons/index.js +2 -2
- package/lib/components/table/Table/fields/image/Edit/index.js +2 -1
- package/lib/components/table/Table/fields/number/Edit/index.js +2 -1
- package/lib/components/table/Table/fields/search/filterUtil/index.js +3 -2
- package/lib/components/table/Table/index.js +1 -0
- package/lib/components/table/Table/utils.d.ts +2 -1
- package/lib/components/table/Table/utils.js +12 -2
- package/lib/components/table/hooks/useTransFilterSetting.js +3 -1
- package/lib/components/table/index.js +4 -4
- package/lib/components/tabs/index.d.ts +1 -0
- package/lib/components/tabs/index.js +5 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- 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/lib/utils/platform.js +1 -1
- package/lowcode/date-picker.range-picker/meta.ts +19 -10
- package/lowcode/dropdown.button/__screenshots__/dropdown.button.png +0 -0
- package/lowcode/dropdown.button/meta.ts +221 -0
- package/lowcode/dropdown.button/snippets.ts +42 -0
- package/lowcode/segmented/meta.ts +165 -0
- package/lowcode/segmented/snippets.ts +25 -0
- package/lowcode/tabs/meta.ts +8 -0
- package/package.json +3 -3
package/es/locales/zh-TW.js
CHANGED
|
@@ -32,5 +32,6 @@ export default {
|
|
|
32
32
|
"table-action-group-by-title-tip": "請從下拉式選單中選擇要分組的字段,以便更好地組織和瀏覽數據。",
|
|
33
33
|
"table-action-column-title": "表頭設置",
|
|
34
34
|
"table-column-group-records": "條記錄",
|
|
35
|
-
"table-column-drag-sort-disabled-tip": "已開啟自動排序,無法手動拖曳"
|
|
35
|
+
"table-column-drag-sort-disabled-tip": "已開啟自動排序,無法手動拖曳",
|
|
36
|
+
"table-action-filter-no-filter": "沒有可用的篩選器。"
|
|
36
37
|
};
|
package/es/utils/platform.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isMobile as isMobileUtils } from "@pisell/utils";
|
|
|
2
2
|
import { isBrowser } from "./index";
|
|
3
3
|
export var isMobile = function isMobile() {
|
|
4
4
|
if (isBrowser) {
|
|
5
|
-
return window.innerWidth <= 768
|
|
5
|
+
return window.innerWidth <= 768 && isMobileUtils();
|
|
6
6
|
}
|
|
7
7
|
return isMobileUtils();
|
|
8
8
|
};
|
|
@@ -39,6 +39,7 @@ var import_utils = require("@pisell/utils");
|
|
|
39
39
|
var import_react = __toESM(require("react"));
|
|
40
40
|
var import_DragSortList = require("../DragSortList");
|
|
41
41
|
var import_index = require("./index.less");
|
|
42
|
+
var import_locales = require("../../locales");
|
|
42
43
|
var TRASH_ID = "void";
|
|
43
44
|
var DefaultRenderContainer = (props) => {
|
|
44
45
|
const { id, children, renderContainer } = props;
|
|
@@ -182,7 +183,7 @@ var MultipleContainersSortList = (props) => {
|
|
|
182
183
|
index
|
|
183
184
|
},
|
|
184
185
|
children
|
|
185
|
-
)) : /* @__PURE__ */ import_react.default.createElement("span", { className: "materials-sort-list-empty" },
|
|
186
|
+
)) : /* @__PURE__ */ import_react.default.createElement("span", { className: "materials-sort-list-empty" }, (0, import_locales.getText)("table-action-filter-no-filter"))
|
|
186
187
|
)
|
|
187
188
|
))));
|
|
188
189
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const Dropdown: (props: any) => React.JSX.Element;
|
|
3
|
+
export default Dropdown;
|
|
@@ -35,11 +35,13 @@ module.exports = __toCommonJS(dropdown_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_hoc = require("../../utils/hoc");
|
|
38
|
-
var
|
|
38
|
+
var _Dropdown = (props) => {
|
|
39
39
|
const innerProps = {};
|
|
40
40
|
if (props.__designMode === "design") {
|
|
41
41
|
innerProps.open = true;
|
|
42
42
|
}
|
|
43
43
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Dropdown, { ...props, ...innerProps });
|
|
44
44
|
};
|
|
45
|
-
var
|
|
45
|
+
var Dropdown = (0, import_hoc.withSingleChild)(_Dropdown, ["children", "overlay"]);
|
|
46
|
+
Dropdown.Button = import_antd.Dropdown.Button;
|
|
47
|
+
var dropdown_default = Dropdown;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
.filter-dropdown-wrap {
|
|
2
2
|
width: 400px;
|
|
3
|
-
max-width: calc(100vw - 24px);
|
|
4
3
|
min-width: 250px;
|
|
5
4
|
padding: 4px;
|
|
6
5
|
display: flex;
|
|
7
6
|
flex-direction: column;
|
|
7
|
+
max-height: 60vh;
|
|
8
|
+
max-width: 80vw;
|
|
9
|
+
overflow: auto;
|
|
8
10
|
.filter-dropdown-wrap-content {
|
|
9
11
|
flex: 1;
|
|
10
12
|
}
|
|
@@ -37,6 +37,7 @@ var import_antd = require("antd");
|
|
|
37
37
|
var import_FilterLines = __toESM(require("@pisell/icon/es/FilterLines"));
|
|
38
38
|
var import_Dropdown = __toESM(require("../Dropdown"));
|
|
39
39
|
var import_locales = require("../../../../locales");
|
|
40
|
+
var import_platform = require("../../../../utils/platform");
|
|
40
41
|
var Filter = ({
|
|
41
42
|
value,
|
|
42
43
|
onChange,
|
|
@@ -65,6 +66,7 @@ var Filter = ({
|
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
68
|
}, [quickFilter, otherFilter, quickFilterMaxLength, formFiltersPrefix]);
|
|
69
|
+
const isMobileBool = (0, import_platform.isMobile)();
|
|
68
70
|
return /* @__PURE__ */ import_react.default.createElement("div", { ref }, /* @__PURE__ */ import_react.default.createElement(
|
|
69
71
|
import_antd.Popover,
|
|
70
72
|
{
|
|
@@ -73,7 +75,7 @@ var Filter = ({
|
|
|
73
75
|
arrow: false,
|
|
74
76
|
getPopupContainer: () => ref.current
|
|
75
77
|
},
|
|
76
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.Button, { icon: /* @__PURE__ */ import_react.default.createElement(import_FilterLines.default, null), size: "large" }, (0, import_locales.getText)("table-action-filter-button"))
|
|
78
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Button, { icon: /* @__PURE__ */ import_react.default.createElement(import_FilterLines.default, null), size: "large" }, isMobileBool ? null : (0, import_locales.getText)("table-action-filter-button"))
|
|
77
79
|
));
|
|
78
80
|
};
|
|
79
81
|
var FilterButton_default = Filter;
|
|
@@ -36,11 +36,34 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_FilterButton = __toESM(require("./components/FilterButton"));
|
|
38
38
|
var import_QuickFilter = __toESM(require("./components/QuickFilter"));
|
|
39
|
+
var import_platform = require("../../utils/platform");
|
|
39
40
|
var formFiltersPrefix = "filters";
|
|
40
41
|
var Filter = (props) => {
|
|
41
42
|
const { filter, isRenderFormContent = true, onValuesChange } = props;
|
|
42
43
|
const { show, quickFilterMaxLength, sortButtonShow, list } = filter || {};
|
|
43
|
-
const
|
|
44
|
+
const [form] = import_antd.Form.useForm();
|
|
45
|
+
const isMobileBool = (0, import_platform.isMobile)();
|
|
46
|
+
const isShowQuickFilter = (0, import_react.useMemo)(() => {
|
|
47
|
+
if (isMobileBool && show && sortButtonShow) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}, [show, sortButtonShow, isMobileBool]);
|
|
52
|
+
(0, import_react.useEffect)(() => {
|
|
53
|
+
if (isRenderFormContent) {
|
|
54
|
+
form.setFieldsValue({
|
|
55
|
+
filter_setting: {
|
|
56
|
+
notSortFilter: list
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, [isRenderFormContent, list]);
|
|
61
|
+
const content = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, isShowQuickFilter && /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "filter_setting", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
62
|
+
import_QuickFilter.default,
|
|
63
|
+
{
|
|
64
|
+
formFiltersPrefix: isRenderFormContent ? "" : formFiltersPrefix
|
|
65
|
+
}
|
|
66
|
+
)), show && sortButtonShow ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "filter_setting", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
44
67
|
import_FilterButton.default,
|
|
45
68
|
{
|
|
46
69
|
formFiltersPrefix,
|
|
@@ -54,6 +77,7 @@ var Filter = (props) => {
|
|
|
54
77
|
import_antd.Form,
|
|
55
78
|
{
|
|
56
79
|
onValuesChange,
|
|
80
|
+
form,
|
|
57
81
|
initialValues: {
|
|
58
82
|
filter_setting: {
|
|
59
83
|
notSortFilter: list
|
|
@@ -91,6 +91,7 @@ var List = (props) => {
|
|
|
91
91
|
/* @__PURE__ */ import_react.default.createElement(
|
|
92
92
|
import_react_infinite_scroll_component.default,
|
|
93
93
|
{
|
|
94
|
+
key: `${document.getElementById(scrollListId)}`,
|
|
94
95
|
dataLength: props.dataSource.length,
|
|
95
96
|
next: loadMoreData,
|
|
96
97
|
hasMore: props.dataSource.length < ((pagination == null ? void 0 : pagination.total) || 999999),
|
|
@@ -127,7 +128,7 @@ var List = (props) => {
|
|
|
127
128
|
})
|
|
128
129
|
}
|
|
129
130
|
);
|
|
130
|
-
}, [props, _footer, isShowDownArrow, isShowUpArrow]);
|
|
131
|
+
}, [props, _footer, isShowDownArrow, isShowUpArrow, scrollListId]);
|
|
131
132
|
return list;
|
|
132
133
|
};
|
|
133
134
|
List.Item = import_antd.List.Item;
|
|
@@ -0,0 +1,40 @@
|
|
|
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/segmented/index.tsx
|
|
30
|
+
var segmented_exports = {};
|
|
31
|
+
__export(segmented_exports, {
|
|
32
|
+
default: () => segmented_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(segmented_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var Segmented = (props) => {
|
|
38
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Segmented, { ...props });
|
|
39
|
+
};
|
|
40
|
+
var segmented_default = Segmented;
|
|
@@ -114,6 +114,7 @@ var Sort = ({
|
|
|
114
114
|
}
|
|
115
115
|
onChange == null ? void 0 : onChange((_b = detail == null ? void 0 : detail.keyPath) == null ? void 0 : _b[0], detail);
|
|
116
116
|
};
|
|
117
|
+
const isMobileBool = (0, import_platform.isMobile)();
|
|
117
118
|
const btnContent = (0, import_react.useMemo)(() => {
|
|
118
119
|
return button || /* @__PURE__ */ import_react.default.createElement(
|
|
119
120
|
import_antd.Button,
|
|
@@ -125,9 +126,9 @@ var Sort = ({
|
|
|
125
126
|
}),
|
|
126
127
|
size: "large"
|
|
127
128
|
},
|
|
128
|
-
(0, import_locales.getText)("sort-button-text")
|
|
129
|
+
isMobileBool ? null : (0, import_locales.getText)("sort-button-text")
|
|
129
130
|
);
|
|
130
|
-
}, [button, style, value]);
|
|
131
|
+
}, [button, style, value, isMobileBool]);
|
|
131
132
|
const content = (0, import_react.useMemo)(() => {
|
|
132
133
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
133
134
|
import_InlineMenu.default,
|
|
@@ -83,7 +83,7 @@ var PopoverContent = (props) => {
|
|
|
83
83
|
};
|
|
84
84
|
onChange == null ? void 0 : onChange([...value]);
|
|
85
85
|
};
|
|
86
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}table-action-column-popover-content-wrap` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}table-action-column-header` }, isShowTitle && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}table-action-column-header-title` }, (0, import_locales.getText)("table-action-column-title")), headerContent && headerContent), /* @__PURE__ */ import_react.default.createElement(
|
|
86
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}table-action-column-popover-content-wrap` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}table-action-column-header` }, isShowTitle && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}table-action-column-header-title` }, (0, import_locales.getText)("table-action-column-title")), headerContent && headerContent), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}table-action-column-content` }, /* @__PURE__ */ import_react.default.createElement(
|
|
87
87
|
import_DragSortList.default,
|
|
88
88
|
{
|
|
89
89
|
list: value,
|
|
@@ -145,6 +145,6 @@ var PopoverContent = (props) => {
|
|
|
145
145
|
)))
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
));
|
|
148
|
+
)));
|
|
149
149
|
};
|
|
150
150
|
var PopoverContent_default = PopoverContent;
|
|
@@ -42,6 +42,7 @@ var import_Buttons = __toESM(require("../Header/Buttons"));
|
|
|
42
42
|
var import_ViewMode = __toESM(require("./component/ViewMode"));
|
|
43
43
|
var import_GallerySetting = __toESM(require("./component/GallerySetting"));
|
|
44
44
|
var import_index = require("./index.less");
|
|
45
|
+
var import_platform = require("../../../utils/platform");
|
|
45
46
|
var Actions = ({
|
|
46
47
|
filter,
|
|
47
48
|
sort,
|
|
@@ -67,6 +68,7 @@ var Actions = ({
|
|
|
67
68
|
dataSourceGroup == null ? void 0 : dataSourceGroup.show,
|
|
68
69
|
view.multiple
|
|
69
70
|
]);
|
|
71
|
+
const isMobileBool = (0, import_platform.isMobile)();
|
|
70
72
|
return showActions ? /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-actions" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "left-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
71
73
|
import_filter.default,
|
|
72
74
|
{
|
|
@@ -75,6 +77,26 @@ var Actions = ({
|
|
|
75
77
|
tableId,
|
|
76
78
|
viewMode
|
|
77
79
|
}
|
|
78
|
-
)), /* @__PURE__ */ import_react.default.createElement(
|
|
80
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: "right-wrap",
|
|
84
|
+
style: {
|
|
85
|
+
gap: isMobileBool ? 0 : 12
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
view.multiple && /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "view_mode", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_ViewMode.default, { view })),
|
|
89
|
+
(dataSourceGroup == null ? void 0 : dataSourceGroup.show) && viewMode === "grid" && /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "group_by", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_Group.default, { setting: dataSourceGroup })),
|
|
90
|
+
(columnSetting == null ? void 0 : columnSetting.show) && viewMode === "grid" && /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: ["column_setting"], noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_ColumnsSetting.default, null)),
|
|
91
|
+
(columnSetting == null ? void 0 : columnSetting.show) && viewMode === "gallery" && /* @__PURE__ */ import_react.default.createElement(import_GallerySetting.default, { setting: gallery, currentViewMode: viewMode }),
|
|
92
|
+
(sort == null ? void 0 : sort.show) ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "order_by", noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_sort.default, { list: (sort == null ? void 0 : sort.list) || [], localPagination })) : null,
|
|
93
|
+
!!(buttons == null ? void 0 : buttons.length) && /* @__PURE__ */ import_react.default.createElement(
|
|
94
|
+
import_Buttons.default,
|
|
95
|
+
{
|
|
96
|
+
list: buttons,
|
|
97
|
+
style: isMobileBool ? { marginLeft: 8 } : {}
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
)) : null;
|
|
79
101
|
};
|
|
80
102
|
var Actions_default = Actions;
|
|
@@ -37,6 +37,7 @@ var import_react_window = require("react-window");
|
|
|
37
37
|
var import_react_virtualized_auto_sizer = __toESM(require("react-virtualized-auto-sizer"));
|
|
38
38
|
var import_useGenGridProps = __toESM(require("./useGenGridProps"));
|
|
39
39
|
var import_useGapSize = __toESM(require("./useGapSize"));
|
|
40
|
+
var import_antd = require("antd");
|
|
40
41
|
var Cell = (props) => {
|
|
41
42
|
const { columnIndex, rowIndex, style, isScrolling, data } = props;
|
|
42
43
|
const { renderItem, gap, columnCount, dataSource, paddingTop } = data;
|
|
@@ -117,6 +118,9 @@ var VirtualGrid = (props) => {
|
|
|
117
118
|
rowHeight,
|
|
118
119
|
paddingTop = 0
|
|
119
120
|
} = props;
|
|
121
|
+
if (dataSource.length === 0) {
|
|
122
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Empty, { style: { marginTop: 32 }, image: import_antd.Empty.PRESENTED_IMAGE_SIMPLE });
|
|
123
|
+
}
|
|
120
124
|
return /* @__PURE__ */ import_react.default.createElement(import_react_virtualized_auto_sizer.default, null, ({ height, width }) => /* @__PURE__ */ import_react.default.createElement(
|
|
121
125
|
GridComponent,
|
|
122
126
|
{
|
|
@@ -35,7 +35,7 @@ var useGenGridProps = (params) => {
|
|
|
35
35
|
const columnCount = (0, import_react.useMemo)(() => {
|
|
36
36
|
const minCount = Math.floor(width / itemMinWidth);
|
|
37
37
|
const maxCount = Math.floor(width / itemMaxWidth);
|
|
38
|
-
return Math.floor((minCount + maxCount) / 2);
|
|
38
|
+
return Math.max(Math.floor((minCount + maxCount) / 2), 1);
|
|
39
39
|
}, [width, itemMinWidth, itemMaxWidth]);
|
|
40
40
|
const columnWidth = (0, import_react.useMemo)(() => {
|
|
41
41
|
return (width - horizontal * (columnCount - 1) - 17) / columnCount;
|
|
@@ -35,9 +35,9 @@ module.exports = __toCommonJS(Buttons_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_index = require("./index.less");
|
|
38
|
-
var Buttons = ({ list }) => {
|
|
38
|
+
var Buttons = ({ list, style }) => {
|
|
39
39
|
return (list || []).map((d) => {
|
|
40
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { ...d }, d.title);
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { ...d, style: { ...d.style || {}, ...style || {} } }, d.title);
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
var Buttons_default = Buttons;
|
|
@@ -35,10 +35,11 @@ module.exports = __toCommonJS(Edit_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_input = __toESM(require("../../../../../input"));
|
|
37
37
|
var Edit = (props, ref) => {
|
|
38
|
-
const { value, onChange, onPressEnter, onBlur, style, bordered } = props;
|
|
38
|
+
const { value, onChange, onPressEnter, onBlur, style, bordered, ...others } = props;
|
|
39
39
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
40
40
|
import_input.default,
|
|
41
41
|
{
|
|
42
|
+
...others,
|
|
42
43
|
bordered,
|
|
43
44
|
ref,
|
|
44
45
|
value,
|
|
@@ -36,10 +36,11 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_react2 = require("react");
|
|
37
37
|
var import_antd = require("antd");
|
|
38
38
|
var Edit = (props, ref) => {
|
|
39
|
-
const { value, onChange, onPressEnter, onBlur, style, bordered } = props;
|
|
39
|
+
const { value, onChange, onPressEnter, onBlur, style, bordered, ...others } = props;
|
|
40
40
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
41
41
|
import_antd.InputNumber,
|
|
42
42
|
{
|
|
43
|
+
...others,
|
|
43
44
|
controls: false,
|
|
44
45
|
ref,
|
|
45
46
|
value,
|
|
@@ -32,11 +32,12 @@ function filterUtil_default({
|
|
|
32
32
|
if (!(0, import_utils.isString)(value)) {
|
|
33
33
|
return true;
|
|
34
34
|
}
|
|
35
|
+
const lowerCaseValue = value.toLowerCase();
|
|
35
36
|
if (key === "keywords") {
|
|
36
|
-
return JSON.stringify(item).includes(
|
|
37
|
+
return JSON.stringify(item).toLowerCase().includes(lowerCaseValue);
|
|
37
38
|
}
|
|
38
39
|
const dataValue = (0, import_utils2.getValueByKeys)(item, key);
|
|
39
40
|
if ((0, import_utils.isString)(dataValue) || (0, import_utils.isNumber)(dataValue)) {
|
|
40
|
-
return `${dataValue}`.includes(
|
|
41
|
+
return `${dataValue}`.toLowerCase().includes(lowerCaseValue);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -130,6 +130,7 @@ var GridViewTable = ({ tableProps, filter, setTableSetting }) => {
|
|
|
130
130
|
/* @__PURE__ */ import_react.default.createElement(
|
|
131
131
|
import_BasicTable.default,
|
|
132
132
|
{
|
|
133
|
+
key: scroll == null ? void 0 : scroll.y,
|
|
133
134
|
dataSource,
|
|
134
135
|
columns,
|
|
135
136
|
className: "grid-view-table",
|
|
@@ -146,6 +146,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
146
146
|
sort?: SortType | undefined;
|
|
147
147
|
mode: "" | "localStorage" | "remote";
|
|
148
148
|
currentViewMode: ModeType;
|
|
149
|
-
}) => ("
|
|
149
|
+
}) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
150
150
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
151
|
+
export declare const stringify: (obj: Record<string, any>) => string;
|
|
151
152
|
export {};
|
|
@@ -44,7 +44,8 @@ __export(utils_exports, {
|
|
|
44
44
|
omit: () => omit,
|
|
45
45
|
setFormValuesToLocalStorage: () => setFormValuesToLocalStorage,
|
|
46
46
|
setTableSettingToLocalStorage: () => setTableSettingToLocalStorage,
|
|
47
|
-
sortDataSource: () => sortDataSource
|
|
47
|
+
sortDataSource: () => sortDataSource,
|
|
48
|
+
stringify: () => stringify
|
|
48
49
|
});
|
|
49
50
|
module.exports = __toCommonJS(utils_exports);
|
|
50
51
|
var import_dayjs = __toESM(require("dayjs"));
|
|
@@ -439,6 +440,14 @@ var omit = (obj, keys) => {
|
|
|
439
440
|
}
|
|
440
441
|
return shallowCopy;
|
|
441
442
|
};
|
|
443
|
+
var stringify = (obj) => {
|
|
444
|
+
return JSON.stringify(obj, (key, value) => {
|
|
445
|
+
if ((0, import_utils.isFunction)(value)) {
|
|
446
|
+
return value.toString();
|
|
447
|
+
}
|
|
448
|
+
return value;
|
|
449
|
+
});
|
|
450
|
+
};
|
|
442
451
|
// Annotate the CommonJS export names for ESM import in node:
|
|
443
452
|
0 && (module.exports = {
|
|
444
453
|
calcFilterSort,
|
|
@@ -456,5 +465,6 @@ var omit = (obj, keys) => {
|
|
|
456
465
|
omit,
|
|
457
466
|
setFormValuesToLocalStorage,
|
|
458
467
|
setTableSettingToLocalStorage,
|
|
459
|
-
sortDataSource
|
|
468
|
+
sortDataSource,
|
|
469
|
+
stringify
|
|
460
470
|
});
|
|
@@ -23,6 +23,7 @@ __export(useTransFilterSetting_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(useTransFilterSetting_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
|
+
var import_platform = require("../../../utils/platform");
|
|
26
27
|
var useTransFilterSetting = (params) => {
|
|
27
28
|
const { filter, originColumnsMap } = params;
|
|
28
29
|
return (0, import_react.useMemo)(() => {
|
|
@@ -39,7 +40,8 @@ var useTransFilterSetting = (params) => {
|
|
|
39
40
|
return {
|
|
40
41
|
...item,
|
|
41
42
|
name,
|
|
42
|
-
label
|
|
43
|
+
label,
|
|
44
|
+
sort: (0, import_platform.isMobile)() ? true : item.sort
|
|
43
45
|
};
|
|
44
46
|
})
|
|
45
47
|
};
|
|
@@ -187,7 +187,7 @@ var GridView = (0, import_model.Provider)(
|
|
|
187
187
|
setTimeout(() => {
|
|
188
188
|
document.body.id = "body";
|
|
189
189
|
}, 200);
|
|
190
|
-
}, [
|
|
190
|
+
}, []);
|
|
191
191
|
const filterDefaultValues = (0, import_react.useMemo)(() => {
|
|
192
192
|
var _a2, _b2;
|
|
193
193
|
const defaultValues = ((filter == null ? void 0 : filter.list) || []).reduce(
|
|
@@ -224,12 +224,12 @@ var GridView = (0, import_model.Provider)(
|
|
|
224
224
|
return wrapRef.current;
|
|
225
225
|
});
|
|
226
226
|
(0, import_react.useEffect)(() => {
|
|
227
|
-
form.resetFields();
|
|
228
227
|
form.setFieldsValue(initialValuesRef.current);
|
|
229
228
|
}, [currentViewMode]);
|
|
230
229
|
(0, import_react.useEffect)(() => {
|
|
231
|
-
form.
|
|
232
|
-
|
|
230
|
+
form.setFieldValue("column_setting", {});
|
|
231
|
+
form.setFieldValue("column_setting", tableSettingRef.current.column_setting);
|
|
232
|
+
}, [(0, import_utils.stringify)(columns)]);
|
|
233
233
|
(0, import_react.useEffect)(() => {
|
|
234
234
|
form.setFieldsValue(initialValuesRef.current);
|
|
235
235
|
}, [JSON.stringify(propsFilter)]);
|
|
@@ -9,6 +9,7 @@ declare class Tabs extends Component<any> {
|
|
|
9
9
|
setActiveKey: (key: string) => void;
|
|
10
10
|
getActiveKey: () => any;
|
|
11
11
|
renderIconLabelTabBar: TabsProps["renderTabBar"];
|
|
12
|
+
filterHiddenTabs: (tabs: any[]) => any[];
|
|
12
13
|
render(): React.JSX.Element;
|
|
13
14
|
}
|
|
14
15
|
export default Tabs;
|
|
@@ -79,7 +79,7 @@ var Tabs = class extends import_react.Component {
|
|
|
79
79
|
),
|
|
80
80
|
style: wrapStyle
|
|
81
81
|
},
|
|
82
|
-
items.map((item) => {
|
|
82
|
+
this.filterHiddenTabs(items).map((item) => {
|
|
83
83
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
@@ -96,6 +96,9 @@ var Tabs = class extends import_react.Component {
|
|
|
96
96
|
props.extra
|
|
97
97
|
);
|
|
98
98
|
};
|
|
99
|
+
this.filterHiddenTabs = (tabs) => {
|
|
100
|
+
return tabs.filter((item) => !item.hidden);
|
|
101
|
+
};
|
|
99
102
|
}
|
|
100
103
|
render() {
|
|
101
104
|
const { props } = this;
|
|
@@ -119,6 +122,7 @@ var Tabs = class extends import_react.Component {
|
|
|
119
122
|
return null;
|
|
120
123
|
}).filter(Boolean);
|
|
121
124
|
}
|
|
125
|
+
items = this.filterHiddenTabs(items);
|
|
122
126
|
if (type === "icon-label") {
|
|
123
127
|
otherProps = {
|
|
124
128
|
renderTabBar: this.renderIconLabelTabBar,
|
package/lib/index.d.ts
CHANGED
|
@@ -72,3 +72,4 @@ export { default as List } from "./components/list";
|
|
|
72
72
|
export { default as Sort } from "./components/sort";
|
|
73
73
|
export { default as InputNumberRange } from "./components/input-number-range";
|
|
74
74
|
export { default as LowCodePage } from "./components/lowCodePage";
|
|
75
|
+
export { default as Segmented } from "./components/segmented";
|
package/lib/index.js
CHANGED
|
@@ -78,6 +78,7 @@ __export(src_exports, {
|
|
|
78
78
|
RecordView: () => import_record_view.default,
|
|
79
79
|
Result: () => import_antd27.Result,
|
|
80
80
|
Row: () => import_antd28.Row,
|
|
81
|
+
Segmented: () => import_segmented.default,
|
|
81
82
|
Select: () => import_select.default,
|
|
82
83
|
Skeleton: () => import_skeleton.default,
|
|
83
84
|
Slider: () => import_slider.default,
|
|
@@ -179,6 +180,7 @@ var import_list = __toESM(require("./components/list"));
|
|
|
179
180
|
var import_sort = __toESM(require("./components/sort"));
|
|
180
181
|
var import_input_number_range = __toESM(require("./components/input-number-range"));
|
|
181
182
|
var import_lowCodePage = __toESM(require("./components/lowCodePage"));
|
|
183
|
+
var import_segmented = __toESM(require("./components/segmented"));
|
|
182
184
|
// Annotate the CommonJS export names for ESM import in node:
|
|
183
185
|
0 && (module.exports = {
|
|
184
186
|
Affix,
|
|
@@ -230,6 +232,7 @@ var import_lowCodePage = __toESM(require("./components/lowCodePage"));
|
|
|
230
232
|
RecordView,
|
|
231
233
|
Result,
|
|
232
234
|
Row,
|
|
235
|
+
Segmented,
|
|
233
236
|
Select,
|
|
234
237
|
Skeleton,
|
|
235
238
|
Slider,
|
package/lib/locales/en-US.d.ts
CHANGED
package/lib/locales/en-US.js
CHANGED
|
@@ -50,5 +50,6 @@ var en_US_default = {
|
|
|
50
50
|
"table-action-group-by-title-tip": "Please select the field from the dropdown menu to group the data for better organization and browsing.",
|
|
51
51
|
"table-action-column-title": "Header settings",
|
|
52
52
|
"table-column-group-records": "records",
|
|
53
|
-
"table-column-drag-sort-disabled-tip": "Automatic sorting is enabled, manual dragging is disabled."
|
|
53
|
+
"table-column-drag-sort-disabled-tip": "Automatic sorting is enabled, manual dragging is disabled.",
|
|
54
|
+
"table-action-filter-no-filter": "No filter options available."
|
|
54
55
|
};
|
package/lib/locales/zh-CN.d.ts
CHANGED
package/lib/locales/zh-CN.js
CHANGED
|
@@ -50,5 +50,6 @@ var zh_CN_default = {
|
|
|
50
50
|
"table-action-group-by-title-tip": "请从下拉菜单中选择要分组的字段,以便更好地组织和浏览数据。",
|
|
51
51
|
"table-action-column-title": "表头设置",
|
|
52
52
|
"table-column-group-records": "条记录",
|
|
53
|
-
"table-column-drag-sort-disabled-tip": "已开启自动排序,无法手动拖拽"
|
|
53
|
+
"table-column-drag-sort-disabled-tip": "已开启自动排序,无法手动拖拽",
|
|
54
|
+
"table-action-filter-no-filter": "没有可用的筛选器。"
|
|
54
55
|
};
|
package/lib/locales/zh-TW.d.ts
CHANGED
package/lib/locales/zh-TW.js
CHANGED
|
@@ -50,5 +50,6 @@ var zh_TW_default = {
|
|
|
50
50
|
"table-action-group-by-title-tip": "請從下拉式選單中選擇要分組的字段,以便更好地組織和瀏覽數據。",
|
|
51
51
|
"table-action-column-title": "表頭設置",
|
|
52
52
|
"table-column-group-records": "條記錄",
|
|
53
|
-
"table-column-drag-sort-disabled-tip": "已開啟自動排序,無法手動拖曳"
|
|
53
|
+
"table-column-drag-sort-disabled-tip": "已開啟自動排序,無法手動拖曳",
|
|
54
|
+
"table-action-filter-no-filter": "沒有可用的篩選器。"
|
|
54
55
|
};
|
package/lib/utils/platform.js
CHANGED
|
@@ -26,7 +26,7 @@ var import_utils = require("@pisell/utils");
|
|
|
26
26
|
var import_index = require("./index");
|
|
27
27
|
var isMobile = () => {
|
|
28
28
|
if (import_index.isBrowser) {
|
|
29
|
-
return window.innerWidth <= 768
|
|
29
|
+
return window.innerWidth <= 768 && (0, import_utils.isMobile)();
|
|
30
30
|
}
|
|
31
31
|
return (0, import_utils.isMobile)();
|
|
32
32
|
};
|