@hanwenbo/x-web-pro-components 0.0.1
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/LICENSE +21 -0
- package/es/blocks/index.d.ts +1 -0
- package/es/blocks/index.js +2 -0
- package/es/blocks/shared.d.ts +24 -0
- package/es/blocks/shared.js +77 -0
- package/es/components/card/index.d.ts +82 -0
- package/es/components/card/index.js +361 -0
- package/es/components/descriptions/index.d.ts +31 -0
- package/es/components/descriptions/index.js +434 -0
- package/es/components/field/index.d.ts +75 -0
- package/es/components/field/index.js +761 -0
- package/es/components/form/captcha.d.ts +19 -0
- package/es/components/form/captcha.js +165 -0
- package/es/components/form/colorPicker.d.ts +7 -0
- package/es/components/form/colorPicker.js +73 -0
- package/es/components/form/fieldControls.d.ts +43 -0
- package/es/components/form/fieldControls.js +282 -0
- package/es/components/form/index.d.ts +285 -0
- package/es/components/form/index.js +2268 -0
- package/es/components/form/loginForm.d.ts +22 -0
- package/es/components/form/loginForm.js +159 -0
- package/es/components/form/schemaForm.d.ts +30 -0
- package/es/components/form/schemaForm.js +644 -0
- package/es/components/form/stepsForm.d.ts +26 -0
- package/es/components/form/stepsForm.js +183 -0
- package/es/components/form/uploadButton.d.ts +20 -0
- package/es/components/form/uploadButton.js +134 -0
- package/es/components/form/uploadDragger.d.ts +13 -0
- package/es/components/form/uploadDragger.js +144 -0
- package/es/components/index.d.ts +9 -0
- package/es/components/index.js +9 -0
- package/es/components/layout/components/Help/index.d.ts +72 -0
- package/es/components/layout/components/Help/index.js +350 -0
- package/es/components/layout/index.d.ts +182 -0
- package/es/components/layout/index.js +892 -0
- package/es/components/list/index.d.ts +80 -0
- package/es/components/list/index.js +431 -0
- package/es/components/provider/context.d.ts +7 -0
- package/es/components/provider/context.js +21 -0
- package/es/components/provider/index.d.ts +28 -0
- package/es/components/provider/index.js +117 -0
- package/es/components/provider/intl.d.ts +38 -0
- package/es/components/provider/intl.js +112 -0
- package/es/components/provider/types.d.ts +37 -0
- package/es/components/provider/types.js +1 -0
- package/es/components/provider/useStyle/index.d.ts +28 -0
- package/es/components/provider/useStyle/index.js +208 -0
- package/es/components/skeleton/index.d.ts +61 -0
- package/es/components/skeleton/index.js +388 -0
- package/es/components/table/dragSortTable.d.ts +8 -0
- package/es/components/table/dragSortTable.js +229 -0
- package/es/components/table/editableTable.d.ts +31 -0
- package/es/components/table/editableTable.js +507 -0
- package/es/components/table/index.d.ts +52 -0
- package/es/components/table/index.js +1554 -0
- package/es/components/table/listToolBar.d.ts +48 -0
- package/es/components/table/listToolBar.js +194 -0
- package/es/components/table/search.d.ts +5 -0
- package/es/components/table/search.js +13 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +4 -0
- package/es/types.d.ts +219 -0
- package/es/types.js +1 -0
- package/es/utils/attachPropertiesToComponent.d.ts +1 -0
- package/es/utils/attachPropertiesToComponent.js +6 -0
- package/es/utils/getRequestParams.d.ts +19 -0
- package/es/utils/getRequestParams.js +57 -0
- package/es/utils/getTableListColumns.d.ts +20 -0
- package/es/utils/getTableListColumns.js +36 -0
- package/es/utils/index.d.ts +4 -0
- package/es/utils/index.js +4 -0
- package/es/utils/loading.d.ts +3 -0
- package/es/utils/loading.js +25 -0
- package/es/version.d.ts +2 -0
- package/es/version.js +2 -0
- package/lib/blocks/index.d.ts +1 -0
- package/lib/blocks/index.js +5 -0
- package/lib/blocks/shared.d.ts +24 -0
- package/lib/blocks/shared.js +83 -0
- package/lib/components/card/index.d.ts +82 -0
- package/lib/components/card/index.js +368 -0
- package/lib/components/descriptions/index.d.ts +31 -0
- package/lib/components/descriptions/index.js +440 -0
- package/lib/components/field/index.d.ts +75 -0
- package/lib/components/field/index.js +767 -0
- package/lib/components/form/captcha.d.ts +19 -0
- package/lib/components/form/captcha.js +172 -0
- package/lib/components/form/colorPicker.d.ts +7 -0
- package/lib/components/form/colorPicker.js +79 -0
- package/lib/components/form/fieldControls.d.ts +43 -0
- package/lib/components/form/fieldControls.js +288 -0
- package/lib/components/form/index.d.ts +285 -0
- package/lib/components/form/index.js +2332 -0
- package/lib/components/form/loginForm.d.ts +22 -0
- package/lib/components/form/loginForm.js +165 -0
- package/lib/components/form/schemaForm.d.ts +30 -0
- package/lib/components/form/schemaForm.js +651 -0
- package/lib/components/form/stepsForm.d.ts +26 -0
- package/lib/components/form/stepsForm.js +189 -0
- package/lib/components/form/uploadButton.d.ts +20 -0
- package/lib/components/form/uploadButton.js +141 -0
- package/lib/components/form/uploadDragger.d.ts +13 -0
- package/lib/components/form/uploadDragger.js +151 -0
- package/lib/components/index.d.ts +9 -0
- package/lib/components/index.js +104 -0
- package/lib/components/layout/components/Help/index.d.ts +72 -0
- package/lib/components/layout/components/Help/index.js +356 -0
- package/lib/components/layout/index.d.ts +182 -0
- package/lib/components/layout/index.js +930 -0
- package/lib/components/list/index.d.ts +80 -0
- package/lib/components/list/index.js +438 -0
- package/lib/components/provider/context.d.ts +7 -0
- package/lib/components/provider/context.js +27 -0
- package/lib/components/provider/index.d.ts +28 -0
- package/lib/components/provider/index.js +174 -0
- package/lib/components/provider/intl.d.ts +38 -0
- package/lib/components/provider/intl.js +118 -0
- package/lib/components/provider/types.d.ts +37 -0
- package/lib/components/provider/types.js +5 -0
- package/lib/components/provider/useStyle/index.d.ts +28 -0
- package/lib/components/provider/useStyle/index.js +217 -0
- package/lib/components/skeleton/index.d.ts +61 -0
- package/lib/components/skeleton/index.js +394 -0
- package/lib/components/table/dragSortTable.d.ts +8 -0
- package/lib/components/table/dragSortTable.js +236 -0
- package/lib/components/table/editableTable.d.ts +31 -0
- package/lib/components/table/editableTable.js +514 -0
- package/lib/components/table/index.d.ts +52 -0
- package/lib/components/table/index.js +1699 -0
- package/lib/components/table/listToolBar.d.ts +48 -0
- package/lib/components/table/listToolBar.js +200 -0
- package/lib/components/table/search.d.ts +5 -0
- package/lib/components/table/search.js +20 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +49 -0
- package/lib/types.d.ts +219 -0
- package/lib/types.js +5 -0
- package/lib/utils/attachPropertiesToComponent.d.ts +1 -0
- package/lib/utils/attachPropertiesToComponent.js +12 -0
- package/lib/utils/getRequestParams.d.ts +19 -0
- package/lib/utils/getRequestParams.js +63 -0
- package/lib/utils/getTableListColumns.d.ts +20 -0
- package/lib/utils/getTableListColumns.js +42 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.js +49 -0
- package/lib/utils/loading.d.ts +3 -0
- package/lib/utils/loading.js +31 -0
- package/lib/version.d.ts +2 -0
- package/lib/version.js +8 -0
- package/package.json +68 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PageHeaderSkeletonProps {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ListToolbarSkeletonProps {
|
|
7
|
+
active?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ListSkeletonItemProps {
|
|
11
|
+
active?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ListSkeletonProps {
|
|
15
|
+
active?: boolean;
|
|
16
|
+
itemCount?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ListPageSkeletonProps extends ListSkeletonProps {
|
|
20
|
+
pageHeader?: false;
|
|
21
|
+
statistic?: number | false;
|
|
22
|
+
actionButton?: React.ReactNode | false;
|
|
23
|
+
toolbar?: false;
|
|
24
|
+
list?: number | false;
|
|
25
|
+
}
|
|
26
|
+
export interface TableSkeletonProps {
|
|
27
|
+
active?: boolean;
|
|
28
|
+
rowCount?: number;
|
|
29
|
+
columnCount?: number;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DescriptionsSkeletonProps {
|
|
33
|
+
active?: boolean;
|
|
34
|
+
column?: number;
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface DescriptionsPageSkeletonProps extends DescriptionsSkeletonProps {
|
|
38
|
+
pageHeader?: false;
|
|
39
|
+
list?: false | number;
|
|
40
|
+
}
|
|
41
|
+
export interface ProSkeletonProps extends ListPageSkeletonProps, TableSkeletonProps, DescriptionsSkeletonProps {
|
|
42
|
+
type?: 'list' | 'result' | 'descriptions' | 'table' | 'pageHeader';
|
|
43
|
+
pageHeader?: false;
|
|
44
|
+
toolbar?: false;
|
|
45
|
+
statistic?: number | false;
|
|
46
|
+
actionButton?: React.ReactNode | false;
|
|
47
|
+
list?: number | false;
|
|
48
|
+
}
|
|
49
|
+
export declare const PageHeaderSkeleton: React.FC<PageHeaderSkeletonProps>;
|
|
50
|
+
export declare const ListToolbarSkeleton: React.FC<ListToolbarSkeletonProps>;
|
|
51
|
+
export declare const ListSkeletonItem: React.FC<ListSkeletonItemProps>;
|
|
52
|
+
export declare const ListSkeleton: React.FC<ListSkeletonProps>;
|
|
53
|
+
export declare const TableItemSkeleton: React.FC<TableSkeletonProps>;
|
|
54
|
+
export declare const TableSkeleton: React.FC<TableSkeletonProps>;
|
|
55
|
+
export declare const DescriptionsSkeleton: React.FC<DescriptionsSkeletonProps>;
|
|
56
|
+
export declare const ProSkeleton: React.FC<ProSkeletonProps>;
|
|
57
|
+
export declare const ListPageSkeleton: React.FC<ProSkeletonProps>;
|
|
58
|
+
export declare const DescriptionsPageSkeleton: React.FC<ProSkeletonProps>;
|
|
59
|
+
export declare const ResultPageSkeleton: React.FC<ProSkeletonProps>;
|
|
60
|
+
export type { ListPageSkeletonProps as ProListPageSkeletonProps, DescriptionsPageSkeletonProps as ProDescriptionsPageSkeletonProps };
|
|
61
|
+
export default ProSkeleton;
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.TableSkeleton = exports.TableItemSkeleton = exports.ResultPageSkeleton = exports.ProSkeleton = exports.PageHeaderSkeleton = exports.ListToolbarSkeleton = exports.ListSkeletonItem = exports.ListSkeleton = exports.ListPageSkeleton = exports.DescriptionsSkeleton = exports.DescriptionsPageSkeleton = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _card = require("@hanwenbo/x-web-ui/card");
|
|
9
|
+
var _skeleton = require("@hanwenbo/x-web-ui/skeleton");
|
|
10
|
+
var _cn = require("@hanwenbo/x-web-ui/utils/cn");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
var PageHeaderSkeleton = exports.PageHeaderSkeleton = function PageHeaderSkeleton(_ref) {
|
|
20
|
+
var _ref$active = _ref.active,
|
|
21
|
+
active = _ref$active === void 0 ? true : _ref$active,
|
|
22
|
+
className = _ref.className;
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
24
|
+
className: (0, _cn.cn)('rounded-2xl border border-border bg-card p-5', className),
|
|
25
|
+
"data-pro-skeleton": "page-header",
|
|
26
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonTitle, {
|
|
27
|
+
animated: active,
|
|
28
|
+
width: "32%",
|
|
29
|
+
className: "mb-3"
|
|
30
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonParagraph, {
|
|
31
|
+
animated: active,
|
|
32
|
+
lineCount: 2
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var ListToolbarSkeleton = exports.ListToolbarSkeleton = function ListToolbarSkeleton(_ref2) {
|
|
37
|
+
var _ref2$active = _ref2.active,
|
|
38
|
+
active = _ref2$active === void 0 ? true : _ref2$active,
|
|
39
|
+
className = _ref2.className;
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
41
|
+
className: (0, _cn.cn)('flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-border bg-card p-4', className),
|
|
42
|
+
"data-pro-skeleton": "list-toolbar",
|
|
43
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonTitle, {
|
|
44
|
+
animated: active,
|
|
45
|
+
width: 180,
|
|
46
|
+
className: "mb-0"
|
|
47
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
48
|
+
className: "flex items-center gap-3",
|
|
49
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonInput, {
|
|
50
|
+
animated: active,
|
|
51
|
+
width: 200
|
|
52
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
53
|
+
animated: active,
|
|
54
|
+
width: 96,
|
|
55
|
+
height: 40,
|
|
56
|
+
borderRadius: 10
|
|
57
|
+
})]
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var ListSkeletonItem = exports.ListSkeletonItem = function ListSkeletonItem(_ref3) {
|
|
62
|
+
var _ref3$active = _ref3.active,
|
|
63
|
+
active = _ref3$active === void 0 ? true : _ref3$active,
|
|
64
|
+
className = _ref3.className;
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
66
|
+
className: (0, _cn.cn)('rounded-2xl border border-border bg-card p-4', className),
|
|
67
|
+
"data-pro-skeleton": "list-item",
|
|
68
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
69
|
+
className: "flex items-start gap-4",
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonAvatar, {
|
|
71
|
+
animated: active,
|
|
72
|
+
size: 48
|
|
73
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
74
|
+
className: "min-w-0 flex-1 space-y-3",
|
|
75
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonTitle, {
|
|
76
|
+
animated: active,
|
|
77
|
+
width: "28%",
|
|
78
|
+
className: "mb-0 block"
|
|
79
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonParagraph, {
|
|
80
|
+
animated: active,
|
|
81
|
+
lineCount: 2
|
|
82
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
83
|
+
className: "flex items-center gap-2",
|
|
84
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
85
|
+
animated: active,
|
|
86
|
+
width: 72,
|
|
87
|
+
height: 28,
|
|
88
|
+
borderRadius: 999
|
|
89
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
90
|
+
animated: active,
|
|
91
|
+
width: 72,
|
|
92
|
+
height: 28,
|
|
93
|
+
borderRadius: 999
|
|
94
|
+
})]
|
|
95
|
+
})]
|
|
96
|
+
})]
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
var ListSkeleton = exports.ListSkeleton = function ListSkeleton(_ref4) {
|
|
101
|
+
var _ref4$active = _ref4.active,
|
|
102
|
+
active = _ref4$active === void 0 ? true : _ref4$active,
|
|
103
|
+
_ref4$itemCount = _ref4.itemCount,
|
|
104
|
+
itemCount = _ref4$itemCount === void 0 ? 3 : _ref4$itemCount,
|
|
105
|
+
className = _ref4.className;
|
|
106
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
107
|
+
className: (0, _cn.cn)('space-y-4', className),
|
|
108
|
+
"data-pro-skeleton": "list",
|
|
109
|
+
children: Array.from({
|
|
110
|
+
length: itemCount
|
|
111
|
+
}).map(function (_, index) {
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ListSkeletonItem, {
|
|
113
|
+
active: active
|
|
114
|
+
}, index);
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
var TableItemSkeleton = exports.TableItemSkeleton = function TableItemSkeleton(_ref5) {
|
|
119
|
+
var _ref5$active = _ref5.active,
|
|
120
|
+
active = _ref5$active === void 0 ? true : _ref5$active,
|
|
121
|
+
_ref5$rowCount = _ref5.rowCount,
|
|
122
|
+
rowCount = _ref5$rowCount === void 0 ? 5 : _ref5$rowCount,
|
|
123
|
+
_ref5$columnCount = _ref5.columnCount,
|
|
124
|
+
columnCount = _ref5$columnCount === void 0 ? 4 : _ref5$columnCount,
|
|
125
|
+
className = _ref5.className;
|
|
126
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
127
|
+
className: (0, _cn.cn)('overflow-hidden rounded-2xl border border-border bg-card', className),
|
|
128
|
+
"data-pro-skeleton": "table",
|
|
129
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
130
|
+
className: "bg-muted/20 grid gap-3 border-b border-border px-4 py-3",
|
|
131
|
+
style: {
|
|
132
|
+
gridTemplateColumns: "repeat(".concat(columnCount, ", minmax(0, 1fr))")
|
|
133
|
+
},
|
|
134
|
+
children: Array.from({
|
|
135
|
+
length: columnCount
|
|
136
|
+
}).map(function (_, index) {
|
|
137
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
138
|
+
animated: active,
|
|
139
|
+
height: 14,
|
|
140
|
+
width: "72%"
|
|
141
|
+
}, index);
|
|
142
|
+
})
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
144
|
+
className: "space-y-3 px-4 py-4",
|
|
145
|
+
children: Array.from({
|
|
146
|
+
length: rowCount
|
|
147
|
+
}).map(function (_, rowIndex) {
|
|
148
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
149
|
+
className: "grid gap-3",
|
|
150
|
+
style: {
|
|
151
|
+
gridTemplateColumns: "repeat(".concat(columnCount, ", minmax(0, 1fr))")
|
|
152
|
+
},
|
|
153
|
+
children: Array.from({
|
|
154
|
+
length: columnCount
|
|
155
|
+
}).map(function (__, columnIndex) {
|
|
156
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
157
|
+
animated: active,
|
|
158
|
+
height: 14,
|
|
159
|
+
width: columnIndex === columnCount - 1 ? '54%' : '88%'
|
|
160
|
+
}, columnIndex);
|
|
161
|
+
})
|
|
162
|
+
}, rowIndex);
|
|
163
|
+
})
|
|
164
|
+
})]
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
var TableSkeleton = exports.TableSkeleton = TableItemSkeleton;
|
|
168
|
+
var DescriptionsSkeleton = exports.DescriptionsSkeleton = function DescriptionsSkeleton(_ref6) {
|
|
169
|
+
var _ref6$active = _ref6.active,
|
|
170
|
+
active = _ref6$active === void 0 ? true : _ref6$active,
|
|
171
|
+
_ref6$column = _ref6.column,
|
|
172
|
+
column = _ref6$column === void 0 ? 3 : _ref6$column,
|
|
173
|
+
className = _ref6.className;
|
|
174
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
175
|
+
className: (0, _cn.cn)('grid gap-4', className),
|
|
176
|
+
style: {
|
|
177
|
+
gridTemplateColumns: "repeat(".concat(Math.max(1, column), ", minmax(0, 1fr))")
|
|
178
|
+
},
|
|
179
|
+
"data-pro-skeleton": "descriptions",
|
|
180
|
+
children: Array.from({
|
|
181
|
+
length: Math.max(column, 3)
|
|
182
|
+
}).map(function (_, index) {
|
|
183
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_card.Card, {
|
|
184
|
+
bodyClassName: "space-y-3",
|
|
185
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
186
|
+
animated: active,
|
|
187
|
+
height: 14,
|
|
188
|
+
width: "32%",
|
|
189
|
+
className: "block"
|
|
190
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonTitle, {
|
|
191
|
+
animated: active,
|
|
192
|
+
width: "56%",
|
|
193
|
+
className: "mb-0 block"
|
|
194
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonParagraph, {
|
|
195
|
+
animated: active,
|
|
196
|
+
lineCount: 2
|
|
197
|
+
})]
|
|
198
|
+
}, index);
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
var ResultPageSkeletonView = function ResultPageSkeletonView(_ref7) {
|
|
203
|
+
var _ref7$active = _ref7.active,
|
|
204
|
+
active = _ref7$active === void 0 ? true : _ref7$active,
|
|
205
|
+
className = _ref7.className,
|
|
206
|
+
_ref7$pageHeader = _ref7.pageHeader,
|
|
207
|
+
pageHeader = _ref7$pageHeader === void 0 ? true : _ref7$pageHeader;
|
|
208
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_card.Card, {
|
|
209
|
+
className: (0, _cn.cn)('flex min-h-[320px] flex-col items-center justify-center gap-5', className),
|
|
210
|
+
"data-pro-skeleton": "result",
|
|
211
|
+
children: [pageHeader !== false ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
212
|
+
className: "self-stretch",
|
|
213
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonTitle, {
|
|
214
|
+
animated: active,
|
|
215
|
+
width: "32%",
|
|
216
|
+
className: "mb-3"
|
|
217
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
218
|
+
animated: active,
|
|
219
|
+
width: 200,
|
|
220
|
+
height: 14
|
|
221
|
+
})]
|
|
222
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
223
|
+
animated: active,
|
|
224
|
+
width: 72,
|
|
225
|
+
height: 72,
|
|
226
|
+
borderRadius: 999
|
|
227
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
228
|
+
className: "flex w-full max-w-[420px] flex-col items-center gap-3",
|
|
229
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonTitle, {
|
|
230
|
+
animated: active,
|
|
231
|
+
width: "44%",
|
|
232
|
+
className: "mb-0"
|
|
233
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonParagraph, {
|
|
234
|
+
animated: active,
|
|
235
|
+
lineCount: 2,
|
|
236
|
+
className: "w-full"
|
|
237
|
+
})]
|
|
238
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
239
|
+
className: "flex items-center gap-3",
|
|
240
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
241
|
+
animated: active,
|
|
242
|
+
width: 108,
|
|
243
|
+
height: 40,
|
|
244
|
+
borderRadius: 10
|
|
245
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
246
|
+
animated: active,
|
|
247
|
+
width: 108,
|
|
248
|
+
height: 40,
|
|
249
|
+
borderRadius: 10
|
|
250
|
+
})]
|
|
251
|
+
})]
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
var ProSkeleton = exports.ProSkeleton = function ProSkeleton(_ref8) {
|
|
255
|
+
var _ref8$type = _ref8.type,
|
|
256
|
+
type = _ref8$type === void 0 ? 'list' : _ref8$type,
|
|
257
|
+
_ref8$active = _ref8.active,
|
|
258
|
+
active = _ref8$active === void 0 ? true : _ref8$active,
|
|
259
|
+
_ref8$pageHeader = _ref8.pageHeader,
|
|
260
|
+
pageHeader = _ref8$pageHeader === void 0 ? true : _ref8$pageHeader,
|
|
261
|
+
_ref8$toolbar = _ref8.toolbar,
|
|
262
|
+
toolbar = _ref8$toolbar === void 0 ? true : _ref8$toolbar,
|
|
263
|
+
_ref8$itemCount = _ref8.itemCount,
|
|
264
|
+
itemCount = _ref8$itemCount === void 0 ? 5 : _ref8$itemCount,
|
|
265
|
+
_ref8$rowCount = _ref8.rowCount,
|
|
266
|
+
rowCount = _ref8$rowCount === void 0 ? 5 : _ref8$rowCount,
|
|
267
|
+
_ref8$columnCount = _ref8.columnCount,
|
|
268
|
+
columnCount = _ref8$columnCount === void 0 ? 4 : _ref8$columnCount,
|
|
269
|
+
_ref8$column = _ref8.column,
|
|
270
|
+
column = _ref8$column === void 0 ? 3 : _ref8$column,
|
|
271
|
+
_ref8$statistic = _ref8.statistic,
|
|
272
|
+
statistic = _ref8$statistic === void 0 ? false : _ref8$statistic,
|
|
273
|
+
actionButton = _ref8.actionButton,
|
|
274
|
+
className = _ref8.className,
|
|
275
|
+
list = _ref8.list;
|
|
276
|
+
var normalizeListCount = function normalizeListCount(size, fallback) {
|
|
277
|
+
if (size === false) {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
if (typeof size === 'number' && Number.isFinite(size) && size >= 0) {
|
|
281
|
+
return size;
|
|
282
|
+
}
|
|
283
|
+
return fallback;
|
|
284
|
+
};
|
|
285
|
+
var listCount = normalizeListCount(list, itemCount);
|
|
286
|
+
if (type === 'result') {
|
|
287
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ResultPageSkeletonView, {
|
|
288
|
+
active: active,
|
|
289
|
+
className: className,
|
|
290
|
+
pageHeader: pageHeader
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (type === 'descriptions') {
|
|
294
|
+
var descriptionsListCount = normalizeListCount(list, 4);
|
|
295
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
296
|
+
className: (0, _cn.cn)('space-y-4', className),
|
|
297
|
+
children: [pageHeader !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PageHeaderSkeleton, {
|
|
298
|
+
active: active
|
|
299
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(DescriptionsSkeleton, {
|
|
300
|
+
active: active,
|
|
301
|
+
column: column
|
|
302
|
+
}), descriptionsListCount !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(TableSkeleton, {
|
|
303
|
+
active: active,
|
|
304
|
+
rowCount: descriptionsListCount
|
|
305
|
+
}) : null]
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
if (type === 'table') {
|
|
309
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
310
|
+
className: (0, _cn.cn)('space-y-4', className),
|
|
311
|
+
children: [pageHeader !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PageHeaderSkeleton, {
|
|
312
|
+
active: active
|
|
313
|
+
}) : null, toolbar !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ListToolbarSkeleton, {
|
|
314
|
+
active: active
|
|
315
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(TableSkeleton, {
|
|
316
|
+
active: active,
|
|
317
|
+
rowCount: rowCount,
|
|
318
|
+
columnCount: columnCount
|
|
319
|
+
})]
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
if (type === 'pageHeader') {
|
|
323
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PageHeaderSkeleton, {
|
|
324
|
+
active: active,
|
|
325
|
+
className: className
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
329
|
+
className: (0, _cn.cn)('space-y-4', className),
|
|
330
|
+
children: [pageHeader !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PageHeaderSkeleton, {
|
|
331
|
+
active: active
|
|
332
|
+
}) : null, statistic !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
333
|
+
className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
334
|
+
children: Array.from({
|
|
335
|
+
length: typeof statistic === 'number' ? statistic : 3
|
|
336
|
+
}).map(function (_, index) {
|
|
337
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_card.Card, {
|
|
338
|
+
bodyClassName: "space-y-3",
|
|
339
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonTitle, {
|
|
340
|
+
animated: active,
|
|
341
|
+
width: "24%",
|
|
342
|
+
className: "mb-0 block"
|
|
343
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
344
|
+
animated: active,
|
|
345
|
+
width: "60%",
|
|
346
|
+
height: 28,
|
|
347
|
+
className: "block"
|
|
348
|
+
})]
|
|
349
|
+
}, index);
|
|
350
|
+
})
|
|
351
|
+
}) : null, toolbar !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ListToolbarSkeleton, {
|
|
352
|
+
active: active
|
|
353
|
+
}) : null, actionButton !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
354
|
+
className: "flex items-center justify-end",
|
|
355
|
+
children: actionButton || /*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.Skeleton, {
|
|
356
|
+
animated: active,
|
|
357
|
+
width: 96,
|
|
358
|
+
height: 40
|
|
359
|
+
})
|
|
360
|
+
}) : null, listCount !== false ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
361
|
+
className: "grid gap-4 xl:grid-cols-[1.2fr_0.8fr]",
|
|
362
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ListSkeleton, {
|
|
363
|
+
active: active,
|
|
364
|
+
itemCount: listCount
|
|
365
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
366
|
+
className: "space-y-4",
|
|
367
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_skeleton.SkeletonImage, {
|
|
368
|
+
animated: active,
|
|
369
|
+
height: 180
|
|
370
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(TableSkeleton, {
|
|
371
|
+
active: active,
|
|
372
|
+
rowCount: rowCount,
|
|
373
|
+
columnCount: columnCount
|
|
374
|
+
})]
|
|
375
|
+
})]
|
|
376
|
+
}) : null]
|
|
377
|
+
});
|
|
378
|
+
};
|
|
379
|
+
var ListPageSkeleton = exports.ListPageSkeleton = function ListPageSkeleton(props) {
|
|
380
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ProSkeleton, _objectSpread(_objectSpread({}, props), {}, {
|
|
381
|
+
type: "list"
|
|
382
|
+
}));
|
|
383
|
+
};
|
|
384
|
+
var DescriptionsPageSkeleton = exports.DescriptionsPageSkeleton = function DescriptionsPageSkeleton(props) {
|
|
385
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ProSkeleton, _objectSpread(_objectSpread({}, props), {}, {
|
|
386
|
+
type: "descriptions"
|
|
387
|
+
}));
|
|
388
|
+
};
|
|
389
|
+
var ResultPageSkeleton = exports.ResultPageSkeleton = function ResultPageSkeleton(props) {
|
|
390
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ProSkeleton, _objectSpread(_objectSpread({}, props), {}, {
|
|
391
|
+
type: "result"
|
|
392
|
+
}));
|
|
393
|
+
};
|
|
394
|
+
var _default = exports.default = ProSkeleton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ProTableProps } from '../../types';
|
|
3
|
+
export interface DragSortTableProps<RecordType extends Record<string, any> = Record<string, any>> extends Omit<ProTableProps<RecordType>, 'request'> {
|
|
4
|
+
dragSortKey?: string;
|
|
5
|
+
onDragSortEnd?: (beforeIndex: number, afterIndex: number, newDataSource: RecordType[]) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const DragSortTable: <RecordType extends Record<string, any> = Record<string, any>>({ rowKey, dataSource: controlledDataSource, columns, dragSortKey, onDataSourceChange, onDragSortEnd, headerTitle, toolBarRender, className, ...tableProps }: DragSortTableProps<RecordType>) => React.JSX.Element;
|
|
8
|
+
export default DragSortTable;
|