@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,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getRequestParams = void 0;
|
|
8
|
+
var _excluded = ["current", "pageSize"];
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
+
var DEFAULT_PAGE = 1;
|
|
23
|
+
var DEFAULT_PAGE_SIZE = 20;
|
|
24
|
+
var FILTER_VALUE_ALL = 'all';
|
|
25
|
+
var filterAllValues = function filterAllValues(fields) {
|
|
26
|
+
return Object.fromEntries(Object.entries(fields).filter(function (_ref) {
|
|
27
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
28
|
+
value = _ref2[1];
|
|
29
|
+
return value !== FILTER_VALUE_ALL;
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
var buildSortby = function buildSortby(sorter) {
|
|
33
|
+
var entries = Object.entries(sorter);
|
|
34
|
+
if (entries.length === 0) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
var _entries$ = _slicedToArray(entries[0], 2),
|
|
38
|
+
field = _entries$[0],
|
|
39
|
+
direction = _entries$[1];
|
|
40
|
+
if (!direction) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return "".concat(field, " ").concat(direction === 'ascend' ? 'ASC' : 'DESC');
|
|
44
|
+
};
|
|
45
|
+
var getRequestParams = exports.getRequestParams = function getRequestParams(_ref3) {
|
|
46
|
+
var params = _ref3.params,
|
|
47
|
+
_ref3$sorter = _ref3.sorter,
|
|
48
|
+
sorter = _ref3$sorter === void 0 ? {} : _ref3$sorter,
|
|
49
|
+
_ref3$filter = _ref3.filter,
|
|
50
|
+
_ = _ref3$filter === void 0 ? {} : _ref3$filter;
|
|
51
|
+
var _ref4 = params || {},
|
|
52
|
+
current = _ref4.current,
|
|
53
|
+
pageSize = _ref4.pageSize,
|
|
54
|
+
rawFields = _objectWithoutProperties(_ref4, _excluded);
|
|
55
|
+
var filteredFields = filterAllValues(rawFields);
|
|
56
|
+
var sortby = buildSortby(sorter);
|
|
57
|
+
return _objectSpread(_objectSpread({
|
|
58
|
+
page: current !== null && current !== void 0 ? current : DEFAULT_PAGE,
|
|
59
|
+
rows: pageSize !== null && pageSize !== void 0 ? pageSize : DEFAULT_PAGE_SIZE
|
|
60
|
+
}, sortby ? {
|
|
61
|
+
sortby: sortby
|
|
62
|
+
} : {}), filteredFields);
|
|
63
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ColumnItem {
|
|
3
|
+
dataIndex: string | string[];
|
|
4
|
+
width?: string | number;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface ColumnsMap {
|
|
8
|
+
[key: string]: {
|
|
9
|
+
width?: string | number;
|
|
10
|
+
dataIndex?: string | string[];
|
|
11
|
+
render?: (...args: unknown[]) => React.ReactNode;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface GetTableListColumnsParams {
|
|
16
|
+
columns: ColumnItem[];
|
|
17
|
+
module: string;
|
|
18
|
+
columnsMap: ColumnsMap;
|
|
19
|
+
}
|
|
20
|
+
export declare const getTableListColumns: ({ columns, module, columnsMap }: GetTableListColumnsParams) => ColumnItem[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTableListColumns = void 0;
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
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); }
|
|
13
|
+
var DEFAULT_WIDTH = 'auto';
|
|
14
|
+
var NESTED_SEPARATOR = '.';
|
|
15
|
+
var normalizeDataIndexToString = function normalizeDataIndexToString(dataIndex) {
|
|
16
|
+
return Array.isArray(dataIndex) ? dataIndex.join(NESTED_SEPARATOR) : dataIndex;
|
|
17
|
+
};
|
|
18
|
+
var shouldConvertToArray = function shouldConvertToArray(dataIndex) {
|
|
19
|
+
return typeof dataIndex === 'string' && dataIndex.includes(NESTED_SEPARATOR);
|
|
20
|
+
};
|
|
21
|
+
var convertToArrayDataIndex = function convertToArrayDataIndex(dataIndex) {
|
|
22
|
+
return dataIndex.split(NESTED_SEPARATOR);
|
|
23
|
+
};
|
|
24
|
+
var getTableListColumns = exports.getTableListColumns = function getTableListColumns(_ref) {
|
|
25
|
+
var columns = _ref.columns,
|
|
26
|
+
module = _ref.module,
|
|
27
|
+
columnsMap = _ref.columnsMap;
|
|
28
|
+
return columns.map(function (item) {
|
|
29
|
+
var _ref2, _normalizedFieldMap$w;
|
|
30
|
+
var dataIndexString = normalizeDataIndexToString(item.dataIndex);
|
|
31
|
+
var mapKey = "".concat(module, ".").concat(dataIndexString);
|
|
32
|
+
var fieldMap = columnsMap[mapKey];
|
|
33
|
+
var normalizedFieldMap = fieldMap && shouldConvertToArray(fieldMap.dataIndex) ? _objectSpread(_objectSpread({}, fieldMap), {}, {
|
|
34
|
+
dataIndex: convertToArrayDataIndex(fieldMap.dataIndex)
|
|
35
|
+
}) : fieldMap;
|
|
36
|
+
return _objectSpread(_objectSpread(_objectSpread({}, item), {}, {
|
|
37
|
+
dataIndex: shouldConvertToArray(item.dataIndex) ? convertToArrayDataIndex(item.dataIndex) : item.dataIndex
|
|
38
|
+
}, normalizedFieldMap), {}, {
|
|
39
|
+
width: (_ref2 = (_normalizedFieldMap$w = normalizedFieldMap === null || normalizedFieldMap === void 0 ? void 0 : normalizedFieldMap.width) !== null && _normalizedFieldMap$w !== void 0 ? _normalizedFieldMap$w : item.width) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_WIDTH
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _attachPropertiesToComponent = require("./attachPropertiesToComponent");
|
|
7
|
+
Object.keys(_attachPropertiesToComponent).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _attachPropertiesToComponent[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _attachPropertiesToComponent[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _getRequestParams = require("./getRequestParams");
|
|
18
|
+
Object.keys(_getRequestParams).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _getRequestParams[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _getRequestParams[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _getTableListColumns = require("./getTableListColumns");
|
|
29
|
+
Object.keys(_getTableListColumns).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _getTableListColumns[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _getTableListColumns[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _loading = require("./loading");
|
|
40
|
+
Object.keys(_loading).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _loading[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _loading[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type TableLoadingConfig } from '@hanwenbo/x-web-ui/table';
|
|
2
|
+
export declare const mergeBooleanLoading: (controlledLoading: boolean | undefined, requestLoading: boolean) => boolean;
|
|
3
|
+
export declare const mergeTableLoading: (controlledLoading: TableLoadingConfig | undefined, requestLoading: boolean) => TableLoadingConfig | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mergeTableLoading = exports.mergeBooleanLoading = void 0;
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
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); }
|
|
13
|
+
var mergeBooleanLoading = exports.mergeBooleanLoading = function mergeBooleanLoading(controlledLoading, requestLoading) {
|
|
14
|
+
return Boolean(controlledLoading || requestLoading);
|
|
15
|
+
};
|
|
16
|
+
var mergeTableLoading = exports.mergeTableLoading = function mergeTableLoading(controlledLoading, requestLoading) {
|
|
17
|
+
if (controlledLoading == null) {
|
|
18
|
+
return requestLoading ? true : undefined;
|
|
19
|
+
}
|
|
20
|
+
if (typeof controlledLoading === 'boolean') {
|
|
21
|
+
return controlledLoading || requestLoading;
|
|
22
|
+
}
|
|
23
|
+
if (!Object.keys(controlledLoading).length) {
|
|
24
|
+
return requestLoading ? {
|
|
25
|
+
spinning: true
|
|
26
|
+
} : undefined;
|
|
27
|
+
}
|
|
28
|
+
return _objectSpread(_objectSpread({}, controlledLoading), {}, {
|
|
29
|
+
spinning: controlledLoading.spinning === undefined ? true : Boolean(controlledLoading.spinning || requestLoading)
|
|
30
|
+
});
|
|
31
|
+
};
|
package/lib/version.d.ts
ADDED
package/lib/version.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hanwenbo/x-web-pro-components",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Enterprise-ready pro components built on x-web-ui",
|
|
5
|
+
"author": "9476400@qq.com",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"module": "es/index.js",
|
|
9
|
+
"types": "lib/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/index.d.ts",
|
|
13
|
+
"import": "./es/index.js",
|
|
14
|
+
"require": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
"./types": {
|
|
18
|
+
"types": "./lib/types.d.ts",
|
|
19
|
+
"import": "./es/types.js",
|
|
20
|
+
"require": "./lib/types.js"
|
|
21
|
+
},
|
|
22
|
+
"./version": {
|
|
23
|
+
"types": "./lib/version.d.ts",
|
|
24
|
+
"import": "./es/version.js",
|
|
25
|
+
"require": "./lib/version.js"
|
|
26
|
+
},
|
|
27
|
+
"./utils": {
|
|
28
|
+
"types": "./lib/utils/index.d.ts",
|
|
29
|
+
"import": "./es/utils/index.js",
|
|
30
|
+
"require": "./lib/utils/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./utils/*": {
|
|
33
|
+
"types": "./lib/utils/*.d.ts",
|
|
34
|
+
"import": "./es/utils/*.js",
|
|
35
|
+
"require": "./lib/utils/*.js"
|
|
36
|
+
},
|
|
37
|
+
"./*": {
|
|
38
|
+
"types": "./lib/components/*/index.d.ts",
|
|
39
|
+
"import": "./es/components/*/index.js",
|
|
40
|
+
"require": "./lib/components/*/index.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"sideEffects": false,
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"dayjs": "^1.11.3",
|
|
46
|
+
"lucide-react": "^0.460.0",
|
|
47
|
+
"@hanwenbo/x-web-ui": "0.0.1"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": ">=18.0.0",
|
|
51
|
+
"react-dom": ">=18.0.0",
|
|
52
|
+
"react-native-web": ">=0.18.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"react-native-web": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"files": [
|
|
60
|
+
"lib",
|
|
61
|
+
"es",
|
|
62
|
+
"LICENSE"
|
|
63
|
+
],
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public",
|
|
66
|
+
"registry": "https://registry.npmjs.org/"
|
|
67
|
+
}
|
|
68
|
+
}
|