@sheinx/base 3.1.0-rc.2 → 3.1.0
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/cjs/button/button-group.d.ts.map +1 -1
- package/cjs/button/button-group.js +3 -0
- package/cjs/button/button.d.ts.map +1 -1
- package/cjs/button/button.js +5 -1
- package/cjs/card/card-header.d.ts.map +1 -1
- package/cjs/card/card-header.js +3 -0
- package/cjs/carousel/carousel.d.ts.map +1 -1
- package/cjs/carousel/carousel.js +6 -4
- package/cjs/cascader/cascader.d.ts.map +1 -1
- package/cjs/cascader/cascader.js +9 -7
- package/cjs/cascader/list.d.ts.map +1 -1
- package/cjs/cascader/list.js +3 -1
- package/cjs/cascader/list.type.d.ts +1 -1
- package/cjs/cascader/list.type.d.ts.map +1 -1
- package/cjs/cascader/node.d.ts.map +1 -1
- package/cjs/cascader/node.js +9 -10
- package/cjs/collapse/collapse-item.d.ts.map +1 -1
- package/cjs/collapse/collapse-item.js +5 -1
- package/cjs/common/use-tip.d.ts.map +1 -1
- package/cjs/common/use-tip.js +4 -1
- package/cjs/date-picker/date-picker.d.ts.map +1 -1
- package/cjs/date-picker/date-picker.js +7 -3
- package/cjs/date-picker/date-picker.type.d.ts +1 -0
- package/cjs/date-picker/date-picker.type.d.ts.map +1 -1
- package/cjs/date-picker/day.d.ts.map +1 -1
- package/cjs/date-picker/day.js +10 -1
- package/cjs/date-picker/month.d.ts.map +1 -1
- package/cjs/date-picker/month.js +8 -1
- package/cjs/date-picker/picker.js +4 -3
- package/cjs/date-picker/picker.type.d.ts +1 -0
- package/cjs/date-picker/picker.type.d.ts.map +1 -1
- package/cjs/date-picker/quarter.d.ts.map +1 -1
- package/cjs/date-picker/quarter.js +7 -1
- package/cjs/date-picker/result.d.ts +1 -1
- package/cjs/date-picker/result.d.ts.map +1 -1
- package/cjs/date-picker/result.js +19 -17
- package/cjs/date-picker/time.d.ts.map +1 -1
- package/cjs/date-picker/time.js +7 -4
- package/cjs/date-picker/year.d.ts.map +1 -1
- package/cjs/date-picker/year.js +7 -1
- package/cjs/dropdown/Item.d.ts.map +1 -1
- package/cjs/dropdown/Item.js +5 -3
- package/cjs/dropdown/dropdown.type.d.ts +1 -0
- package/cjs/dropdown/dropdown.type.d.ts.map +1 -1
- package/cjs/dropdown/dropdownIn.d.ts.map +1 -1
- package/cjs/dropdown/dropdownIn.js +30 -18
- package/cjs/form/form-item.d.ts.map +1 -1
- package/cjs/image/image-gallery.d.ts.map +1 -1
- package/cjs/image/image-gallery.js +6 -1
- package/cjs/input/input-group.d.ts.map +1 -1
- package/cjs/input/input-group.js +3 -0
- package/cjs/input/simple-input.d.ts.map +1 -1
- package/cjs/input/simple-input.js +3 -0
- package/cjs/input/use-input-common.d.ts.map +1 -1
- package/cjs/input/use-input-common.js +2 -1
- package/cjs/list/list.d.ts.map +1 -1
- package/cjs/list/list.js +4 -4
- package/cjs/menu/item.d.ts.map +1 -1
- package/cjs/menu/item.js +6 -0
- package/cjs/menu/scrollbar.d.ts.map +1 -1
- package/cjs/menu/scrollbar.js +1 -0
- package/cjs/pagination/pagination-buttons.d.ts.map +1 -1
- package/cjs/pagination/pagination-buttons.js +5 -4
- package/cjs/pagination/pagination-next.d.ts.map +1 -1
- package/cjs/pagination/pagination-next.js +6 -6
- package/cjs/pagination/pagination-prev.d.ts.map +1 -1
- package/cjs/pagination/pagination-prev.js +6 -6
- package/cjs/pagination/pagination.type.d.ts +0 -1
- package/cjs/pagination/pagination.type.d.ts.map +1 -1
- package/cjs/popover/popover.d.ts.map +1 -1
- package/cjs/popover/popover.js +3 -0
- package/cjs/rate/rate.d.ts.map +1 -1
- package/cjs/rate/rate.js +3 -0
- package/cjs/select/list-option.d.ts.map +1 -1
- package/cjs/select/list-option.js +4 -0
- package/cjs/select/result-input.d.ts.map +1 -1
- package/cjs/select/result-input.js +1 -4
- package/cjs/select/result.d.ts.map +1 -1
- package/cjs/select/result.js +44 -47
- package/cjs/select/result.type.d.ts +1 -0
- package/cjs/select/result.type.d.ts.map +1 -1
- package/cjs/select/select.d.ts.map +1 -1
- package/cjs/select/select.js +16 -23
- package/cjs/slider/slider.d.ts.map +1 -1
- package/cjs/slider/slider.js +9 -2
- package/cjs/steps/step.arrow.d.ts.map +1 -1
- package/cjs/steps/step.arrow.js +4 -0
- package/cjs/steps/step.d.ts.map +1 -1
- package/cjs/steps/step.default.d.ts.map +1 -1
- package/cjs/steps/step.default.js +6 -1
- package/cjs/steps/step.dot.d.ts.map +1 -1
- package/cjs/steps/step.dot.js +6 -1
- package/cjs/steps/step.js +3 -0
- package/cjs/switch/switch.d.ts.map +1 -1
- package/cjs/switch/switch.js +3 -0
- package/cjs/table/table.d.ts.map +1 -1
- package/cjs/table/table.js +71 -124
- package/cjs/table/table.type.d.ts +1 -0
- package/cjs/table/table.type.d.ts.map +1 -1
- package/cjs/table/thead.d.ts.map +1 -1
- package/cjs/table/thead.js +10 -3
- package/cjs/table/tr.d.ts.map +1 -1
- package/cjs/table/tr.js +13 -10
- package/cjs/tabs/tab.d.ts.map +1 -1
- package/cjs/tabs/tab.js +4 -0
- package/cjs/tabs/tabs-header.d.ts.map +1 -1
- package/cjs/tabs/tabs-header.js +47 -23
- package/cjs/tabs/tabs.d.ts.map +1 -1
- package/cjs/textarea/textarea.d.ts.map +1 -1
- package/cjs/textarea/textarea.js +1 -0
- package/cjs/textarea/use-auto-size.d.ts.map +1 -1
- package/cjs/textarea/use-auto-size.js +1 -0
- package/cjs/tooltip/tooltip.d.ts.map +1 -1
- package/cjs/tooltip/tooltip.js +3 -0
- package/cjs/transfer/transfer.d.ts.map +1 -1
- package/cjs/transfer/transfer.js +5 -2
- package/cjs/tree/tree-checkbox.d.ts.map +1 -1
- package/cjs/tree/tree-checkbox.js +8 -1
- package/cjs/tree/tree-content.d.ts.map +1 -1
- package/cjs/tree/tree-content.js +24 -4
- package/cjs/tree/tree-content.type.d.ts +1 -1
- package/cjs/tree/tree-content.type.d.ts.map +1 -1
- package/cjs/tree/tree-context.d.ts +3 -3
- package/cjs/tree/tree-context.d.ts.map +1 -1
- package/cjs/tree/tree-node.d.ts.map +1 -1
- package/cjs/tree/tree-node.js +3 -0
- package/cjs/tree/tree.d.ts.map +1 -1
- package/cjs/tree/tree.js +4 -13
- package/cjs/tree-select/tree-select.d.ts.map +1 -1
- package/cjs/tree-select/tree-select.js +109 -72
- package/cjs/tree-select/tree-select.type.d.ts +6 -0
- package/cjs/tree-select/tree-select.type.d.ts.map +1 -1
- package/cjs/upload/button.d.ts.map +1 -1
- package/cjs/upload/button.js +4 -3
- package/cjs/upload/result.d.ts.map +1 -1
- package/cjs/upload/result.js +3 -0
- package/cjs/virtual-scroll/scroll.d.ts.map +1 -1
- package/cjs/virtual-scroll/scroll.js +28 -14
- package/cjs/virtual-scroll/virtual-scroll-list.d.ts.map +1 -1
- package/cjs/virtual-scroll/virtual-scroll-list.js +2 -0
- package/esm/button/button-group.d.ts.map +1 -1
- package/esm/button/button-group.js +3 -0
- package/esm/button/button.d.ts.map +1 -1
- package/esm/button/button.js +5 -1
- package/esm/card/card-header.d.ts.map +1 -1
- package/esm/card/card-header.js +3 -0
- package/esm/carousel/carousel.d.ts.map +1 -1
- package/esm/carousel/carousel.js +6 -4
- package/esm/cascader/cascader.d.ts.map +1 -1
- package/esm/cascader/cascader.js +9 -7
- package/esm/cascader/list.d.ts.map +1 -1
- package/esm/cascader/list.js +3 -1
- package/esm/cascader/list.type.d.ts +1 -1
- package/esm/cascader/list.type.d.ts.map +1 -1
- package/esm/cascader/node.d.ts.map +1 -1
- package/esm/cascader/node.js +9 -10
- package/esm/collapse/collapse-item.d.ts.map +1 -1
- package/esm/collapse/collapse-item.js +5 -1
- package/esm/common/use-tip.d.ts.map +1 -1
- package/esm/common/use-tip.js +4 -1
- package/esm/date-picker/date-picker.d.ts.map +1 -1
- package/esm/date-picker/date-picker.js +9 -4
- package/esm/date-picker/date-picker.type.d.ts +1 -0
- package/esm/date-picker/date-picker.type.d.ts.map +1 -1
- package/esm/date-picker/day.d.ts.map +1 -1
- package/esm/date-picker/day.js +10 -1
- package/esm/date-picker/month.d.ts.map +1 -1
- package/esm/date-picker/month.js +8 -1
- package/esm/date-picker/picker.js +4 -3
- package/esm/date-picker/picker.type.d.ts +1 -0
- package/esm/date-picker/picker.type.d.ts.map +1 -1
- package/esm/date-picker/quarter.d.ts.map +1 -1
- package/esm/date-picker/quarter.js +7 -1
- package/esm/date-picker/result.d.ts +1 -1
- package/esm/date-picker/result.d.ts.map +1 -1
- package/esm/date-picker/result.js +6 -4
- package/esm/date-picker/time.d.ts.map +1 -1
- package/esm/date-picker/time.js +5 -2
- package/esm/date-picker/year.d.ts.map +1 -1
- package/esm/date-picker/year.js +7 -1
- package/esm/dropdown/Item.d.ts.map +1 -1
- package/esm/dropdown/Item.js +5 -3
- package/esm/dropdown/dropdown.type.d.ts +1 -0
- package/esm/dropdown/dropdown.type.d.ts.map +1 -1
- package/esm/dropdown/dropdownIn.d.ts.map +1 -1
- package/esm/dropdown/dropdownIn.js +30 -18
- package/esm/form/form-item.d.ts.map +1 -1
- package/esm/image/image-gallery.d.ts.map +1 -1
- package/esm/image/image-gallery.js +6 -1
- package/esm/input/input-group.d.ts.map +1 -1
- package/esm/input/input-group.js +3 -0
- package/esm/input/simple-input.d.ts.map +1 -1
- package/esm/input/simple-input.js +3 -0
- package/esm/input/use-input-common.d.ts.map +1 -1
- package/esm/input/use-input-common.js +3 -2
- package/esm/list/list.d.ts.map +1 -1
- package/esm/list/list.js +4 -4
- package/esm/menu/item.d.ts.map +1 -1
- package/esm/menu/item.js +6 -0
- package/esm/menu/scrollbar.d.ts.map +1 -1
- package/esm/menu/scrollbar.js +1 -0
- package/esm/pagination/pagination-buttons.d.ts.map +1 -1
- package/esm/pagination/pagination-buttons.js +5 -4
- package/esm/pagination/pagination-next.d.ts.map +1 -1
- package/esm/pagination/pagination-next.js +6 -6
- package/esm/pagination/pagination-prev.d.ts.map +1 -1
- package/esm/pagination/pagination-prev.js +6 -6
- package/esm/pagination/pagination.type.d.ts +0 -1
- package/esm/pagination/pagination.type.d.ts.map +1 -1
- package/esm/popover/popover.d.ts.map +1 -1
- package/esm/popover/popover.js +3 -0
- package/esm/rate/rate.d.ts.map +1 -1
- package/esm/rate/rate.js +3 -0
- package/esm/select/list-option.d.ts.map +1 -1
- package/esm/select/list-option.js +4 -0
- package/esm/select/result-input.d.ts.map +1 -1
- package/esm/select/result-input.js +1 -4
- package/esm/select/result.d.ts.map +1 -1
- package/esm/select/result.js +45 -48
- package/esm/select/result.type.d.ts +1 -0
- package/esm/select/result.type.d.ts.map +1 -1
- package/esm/select/select.d.ts.map +1 -1
- package/esm/select/select.js +16 -23
- package/esm/slider/slider.d.ts.map +1 -1
- package/esm/slider/slider.js +9 -2
- package/esm/steps/step.arrow.d.ts.map +1 -1
- package/esm/steps/step.arrow.js +4 -0
- package/esm/steps/step.d.ts.map +1 -1
- package/esm/steps/step.default.d.ts.map +1 -1
- package/esm/steps/step.default.js +6 -1
- package/esm/steps/step.dot.d.ts.map +1 -1
- package/esm/steps/step.dot.js +6 -1
- package/esm/steps/step.js +3 -0
- package/esm/switch/switch.d.ts.map +1 -1
- package/esm/switch/switch.js +3 -0
- package/esm/table/table.d.ts.map +1 -1
- package/esm/table/table.js +72 -125
- package/esm/table/table.type.d.ts +1 -0
- package/esm/table/table.type.d.ts.map +1 -1
- package/esm/table/thead.d.ts.map +1 -1
- package/esm/table/thead.js +10 -3
- package/esm/table/tr.d.ts.map +1 -1
- package/esm/table/tr.js +13 -10
- package/esm/tabs/tab.d.ts.map +1 -1
- package/esm/tabs/tab.js +4 -0
- package/esm/tabs/tabs-header.d.ts.map +1 -1
- package/esm/tabs/tabs-header.js +47 -23
- package/esm/tabs/tabs.d.ts.map +1 -1
- package/esm/textarea/textarea.d.ts.map +1 -1
- package/esm/textarea/textarea.js +1 -0
- package/esm/textarea/use-auto-size.d.ts.map +1 -1
- package/esm/textarea/use-auto-size.js +1 -0
- package/esm/tooltip/tooltip.d.ts.map +1 -1
- package/esm/tooltip/tooltip.js +3 -0
- package/esm/transfer/transfer.d.ts.map +1 -1
- package/esm/transfer/transfer.js +5 -2
- package/esm/tree/tree-checkbox.d.ts.map +1 -1
- package/esm/tree/tree-checkbox.js +8 -1
- package/esm/tree/tree-content.d.ts.map +1 -1
- package/esm/tree/tree-content.js +25 -5
- package/esm/tree/tree-content.type.d.ts +1 -1
- package/esm/tree/tree-content.type.d.ts.map +1 -1
- package/esm/tree/tree-context.d.ts +3 -3
- package/esm/tree/tree-context.d.ts.map +1 -1
- package/esm/tree/tree-node.d.ts.map +1 -1
- package/esm/tree/tree-node.js +3 -0
- package/esm/tree/tree.d.ts.map +1 -1
- package/esm/tree/tree.js +5 -14
- package/esm/tree-select/tree-select.d.ts.map +1 -1
- package/esm/tree-select/tree-select.js +110 -73
- package/esm/tree-select/tree-select.type.d.ts +6 -0
- package/esm/tree-select/tree-select.type.d.ts.map +1 -1
- package/esm/upload/button.d.ts.map +1 -1
- package/esm/upload/button.js +4 -3
- package/esm/upload/result.d.ts.map +1 -1
- package/esm/upload/result.js +3 -0
- package/esm/virtual-scroll/scroll.d.ts.map +1 -1
- package/esm/virtual-scroll/scroll.js +28 -14
- package/esm/virtual-scroll/virtual-scroll-list.d.ts.map +1 -1
- package/esm/virtual-scroll/virtual-scroll-list.js +2 -0
- package/package.json +9 -4
- package/cjs/table/temp/01-base.d.ts +0 -4
- package/cjs/table/temp/01-base.d.ts.map +0 -1
- package/cjs/table/temp/01-base.js +0 -199
- package/esm/table/temp/01-base.d.ts +0 -4
- package/esm/table/temp/01-base.d.ts.map +0 -1
- package/esm/table/temp/01-base.js +0 -194
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _2 = require("../..");
|
|
9
|
-
var _shineoutStyle = require("@sheinx/shineout-style");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
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); }
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
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."); }
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
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; } }
|
|
18
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
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; }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
23
|
-
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); } /**
|
|
24
|
-
* cn - 基本用法
|
|
25
|
-
* --
|
|
26
|
-
* en - Basic
|
|
27
|
-
* --
|
|
28
|
-
*/
|
|
29
|
-
var jssStyle = {
|
|
30
|
-
table: _shineoutStyle.useTableStyle,
|
|
31
|
-
radio: _shineoutStyle.useRadioStyle,
|
|
32
|
-
checkbox: _shineoutStyle.useCheckboxStyle
|
|
33
|
-
};
|
|
34
|
-
var id = 0;
|
|
35
|
-
var mockData = function mockData(i) {
|
|
36
|
-
var item = {
|
|
37
|
-
id: id++,
|
|
38
|
-
name: "Edward King Edward King Edward King Edward King ".concat(i),
|
|
39
|
-
age: Math.floor(Math.random() * 100),
|
|
40
|
-
address: "London, Park Lane no. ".concat(i),
|
|
41
|
-
sex: i % 2 === 0 ? 'man' : 'femail',
|
|
42
|
-
children: []
|
|
43
|
-
};
|
|
44
|
-
return item;
|
|
45
|
-
};
|
|
46
|
-
// mock 1000 rows 学生数据
|
|
47
|
-
var data = Array(10).fill(0).map(function (_, i) {
|
|
48
|
-
return _objectSpread({}, mockData(i));
|
|
49
|
-
});
|
|
50
|
-
var columns = [{
|
|
51
|
-
type: 'checkbox',
|
|
52
|
-
width: 20
|
|
53
|
-
}, {
|
|
54
|
-
type: 'expand',
|
|
55
|
-
width: 20,
|
|
56
|
-
render: function render() {
|
|
57
|
-
return function () {
|
|
58
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
59
|
-
style: {
|
|
60
|
-
padding: '12px'
|
|
61
|
-
},
|
|
62
|
-
children: "123213"
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}, {
|
|
67
|
-
title: 'ID2',
|
|
68
|
-
render: 'id',
|
|
69
|
-
width: 40,
|
|
70
|
-
treeColumnsName: 'children',
|
|
71
|
-
sorter: function sorter(order) {
|
|
72
|
-
return function (a, b) {
|
|
73
|
-
return order === 'asc' ? a.id - b.id : b.id - a.id;
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
defaultOrder: 'asc'
|
|
77
|
-
}, {
|
|
78
|
-
title: 'age2',
|
|
79
|
-
render: 'age',
|
|
80
|
-
width: 40,
|
|
81
|
-
sorter: function sorter(order) {
|
|
82
|
-
return function (a, b) {
|
|
83
|
-
return order === 'asc' ? a.age - b.age : b.age - a.age;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}, {
|
|
87
|
-
title: 'age',
|
|
88
|
-
render: 'age',
|
|
89
|
-
width: 40,
|
|
90
|
-
sorter: 'age',
|
|
91
|
-
rowSpan: function rowSpan(data, nextData) {
|
|
92
|
-
return data.age === nextData.age;
|
|
93
|
-
},
|
|
94
|
-
colSpan: function colSpan(data) {
|
|
95
|
-
return data.age % 2 === 0 ? 2 : 1;
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
title: 'Name',
|
|
99
|
-
render: 'name',
|
|
100
|
-
width: 80,
|
|
101
|
-
sorter: 'name'
|
|
102
|
-
}, {
|
|
103
|
-
title: 'Age',
|
|
104
|
-
render: 'age',
|
|
105
|
-
width: 100,
|
|
106
|
-
group: ['group1', 'group2']
|
|
107
|
-
}, {
|
|
108
|
-
title: 'Address',
|
|
109
|
-
render: 'address',
|
|
110
|
-
group: ['group1', 'group2'],
|
|
111
|
-
width: 100
|
|
112
|
-
}, {
|
|
113
|
-
title: 'Sex',
|
|
114
|
-
render: 'sex',
|
|
115
|
-
width: 50,
|
|
116
|
-
fixed: 'right'
|
|
117
|
-
}];
|
|
118
|
-
var sorters = {
|
|
119
|
-
id: function id(order) {
|
|
120
|
-
return function (a, b) {
|
|
121
|
-
return order === 'asc' ? a.id - b.id : b.id - a.id;
|
|
122
|
-
};
|
|
123
|
-
},
|
|
124
|
-
name: function name(order) {
|
|
125
|
-
return function (a, b) {
|
|
126
|
-
return order === 'asc' ? a.name.localeCompare(b.name) : b.name.localeCompare(a.name);
|
|
127
|
-
};
|
|
128
|
-
},
|
|
129
|
-
age: function age(order) {
|
|
130
|
-
return function (a, b) {
|
|
131
|
-
return order === 'asc' ? a.age - b.age : b.age - a.age;
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
var _default = exports.default = function _default() {
|
|
136
|
-
var _React$useState = _react.default.useState(1),
|
|
137
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
138
|
-
bordered = _React$useState2[0],
|
|
139
|
-
setBordered = _React$useState2[1];
|
|
140
|
-
var _React$useState3 = _react.default.useState('top'),
|
|
141
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
142
|
-
va = _React$useState4[0],
|
|
143
|
-
setVa = _React$useState4[1];
|
|
144
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
145
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
146
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
147
|
-
children: "bordered:"
|
|
148
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_2.RadioGroup, {
|
|
149
|
-
jssStyle: jssStyle,
|
|
150
|
-
data: [0, 1],
|
|
151
|
-
value: bordered,
|
|
152
|
-
onChange: function onChange(d) {
|
|
153
|
-
return setBordered(d);
|
|
154
|
-
},
|
|
155
|
-
keygen: true,
|
|
156
|
-
renderItem: function renderItem(d) {
|
|
157
|
-
return !!d ? 'true' : 'false';
|
|
158
|
-
}
|
|
159
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
160
|
-
children: "vertical:"
|
|
161
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_2.RadioGroup, {
|
|
162
|
-
jssStyle: jssStyle,
|
|
163
|
-
data: ['middle', 'top'],
|
|
164
|
-
value: va,
|
|
165
|
-
onChange: function onChange(d) {
|
|
166
|
-
return setVa(d);
|
|
167
|
-
},
|
|
168
|
-
keygen: true,
|
|
169
|
-
renderItem: function renderItem(d) {
|
|
170
|
-
return d;
|
|
171
|
-
}
|
|
172
|
-
})]
|
|
173
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_2.Table, {
|
|
174
|
-
sticky: {
|
|
175
|
-
top: 180
|
|
176
|
-
},
|
|
177
|
-
columnResizable: true,
|
|
178
|
-
bordered: !!bordered,
|
|
179
|
-
sorter: function sorter(key, order, list) {
|
|
180
|
-
console.log(key, order, list);
|
|
181
|
-
var orderFunc = sorters[key];
|
|
182
|
-
return orderFunc(order);
|
|
183
|
-
},
|
|
184
|
-
width: 1000,
|
|
185
|
-
style: {
|
|
186
|
-
height: ''
|
|
187
|
-
},
|
|
188
|
-
keygen: "id",
|
|
189
|
-
verticalAlign: va,
|
|
190
|
-
jssStyle: jssStyle,
|
|
191
|
-
data: data,
|
|
192
|
-
format: 'id',
|
|
193
|
-
columns: columns,
|
|
194
|
-
onRowSelect: function onRowSelect(value) {
|
|
195
|
-
console.log(value);
|
|
196
|
-
}
|
|
197
|
-
})]
|
|
198
|
-
});
|
|
199
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"01-base.d.ts","sourceRoot":"","sources":["01-base.tsx"],"names":[],"mappings":";;AA+GA,wBAgDE"}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
-
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."); }
|
|
4
|
-
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); }
|
|
5
|
-
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; }
|
|
6
|
-
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; } }
|
|
7
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
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
|
-
/**
|
|
14
|
-
* cn - 基本用法
|
|
15
|
-
* --
|
|
16
|
-
* en - Basic
|
|
17
|
-
* --
|
|
18
|
-
*/
|
|
19
|
-
import React from 'react';
|
|
20
|
-
import { Table, RadioGroup } from "../..";
|
|
21
|
-
import { useTableStyle, useRadioStyle, useCheckboxStyle } from '@sheinx/shineout-style';
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
var jssStyle = {
|
|
25
|
-
table: useTableStyle,
|
|
26
|
-
radio: useRadioStyle,
|
|
27
|
-
checkbox: useCheckboxStyle
|
|
28
|
-
};
|
|
29
|
-
var id = 0;
|
|
30
|
-
var mockData = function mockData(i) {
|
|
31
|
-
var item = {
|
|
32
|
-
id: id++,
|
|
33
|
-
name: "Edward King Edward King Edward King Edward King ".concat(i),
|
|
34
|
-
age: Math.floor(Math.random() * 100),
|
|
35
|
-
address: "London, Park Lane no. ".concat(i),
|
|
36
|
-
sex: i % 2 === 0 ? 'man' : 'femail',
|
|
37
|
-
children: []
|
|
38
|
-
};
|
|
39
|
-
return item;
|
|
40
|
-
};
|
|
41
|
-
// mock 1000 rows 学生数据
|
|
42
|
-
var data = Array(10).fill(0).map(function (_, i) {
|
|
43
|
-
return _objectSpread({}, mockData(i));
|
|
44
|
-
});
|
|
45
|
-
var columns = [{
|
|
46
|
-
type: 'checkbox',
|
|
47
|
-
width: 20
|
|
48
|
-
}, {
|
|
49
|
-
type: 'expand',
|
|
50
|
-
width: 20,
|
|
51
|
-
render: function render() {
|
|
52
|
-
return function () {
|
|
53
|
-
return /*#__PURE__*/_jsx("div", {
|
|
54
|
-
style: {
|
|
55
|
-
padding: '12px'
|
|
56
|
-
},
|
|
57
|
-
children: "123213"
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
title: 'ID2',
|
|
63
|
-
render: 'id',
|
|
64
|
-
width: 40,
|
|
65
|
-
treeColumnsName: 'children',
|
|
66
|
-
sorter: function sorter(order) {
|
|
67
|
-
return function (a, b) {
|
|
68
|
-
return order === 'asc' ? a.id - b.id : b.id - a.id;
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
defaultOrder: 'asc'
|
|
72
|
-
}, {
|
|
73
|
-
title: 'age2',
|
|
74
|
-
render: 'age',
|
|
75
|
-
width: 40,
|
|
76
|
-
sorter: function sorter(order) {
|
|
77
|
-
return function (a, b) {
|
|
78
|
-
return order === 'asc' ? a.age - b.age : b.age - a.age;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}, {
|
|
82
|
-
title: 'age',
|
|
83
|
-
render: 'age',
|
|
84
|
-
width: 40,
|
|
85
|
-
sorter: 'age',
|
|
86
|
-
rowSpan: function rowSpan(data, nextData) {
|
|
87
|
-
return data.age === nextData.age;
|
|
88
|
-
},
|
|
89
|
-
colSpan: function colSpan(data) {
|
|
90
|
-
return data.age % 2 === 0 ? 2 : 1;
|
|
91
|
-
}
|
|
92
|
-
}, {
|
|
93
|
-
title: 'Name',
|
|
94
|
-
render: 'name',
|
|
95
|
-
width: 80,
|
|
96
|
-
sorter: 'name'
|
|
97
|
-
}, {
|
|
98
|
-
title: 'Age',
|
|
99
|
-
render: 'age',
|
|
100
|
-
width: 100,
|
|
101
|
-
group: ['group1', 'group2']
|
|
102
|
-
}, {
|
|
103
|
-
title: 'Address',
|
|
104
|
-
render: 'address',
|
|
105
|
-
group: ['group1', 'group2'],
|
|
106
|
-
width: 100
|
|
107
|
-
}, {
|
|
108
|
-
title: 'Sex',
|
|
109
|
-
render: 'sex',
|
|
110
|
-
width: 50,
|
|
111
|
-
fixed: 'right'
|
|
112
|
-
}];
|
|
113
|
-
var sorters = {
|
|
114
|
-
id: function id(order) {
|
|
115
|
-
return function (a, b) {
|
|
116
|
-
return order === 'asc' ? a.id - b.id : b.id - a.id;
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
name: function name(order) {
|
|
120
|
-
return function (a, b) {
|
|
121
|
-
return order === 'asc' ? a.name.localeCompare(b.name) : b.name.localeCompare(a.name);
|
|
122
|
-
};
|
|
123
|
-
},
|
|
124
|
-
age: function age(order) {
|
|
125
|
-
return function (a, b) {
|
|
126
|
-
return order === 'asc' ? a.age - b.age : b.age - a.age;
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
export default (function () {
|
|
131
|
-
var _React$useState = React.useState(1),
|
|
132
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
133
|
-
bordered = _React$useState2[0],
|
|
134
|
-
setBordered = _React$useState2[1];
|
|
135
|
-
var _React$useState3 = React.useState('top'),
|
|
136
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
137
|
-
va = _React$useState4[0],
|
|
138
|
-
setVa = _React$useState4[1];
|
|
139
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
140
|
-
children: [/*#__PURE__*/_jsxs("div", {
|
|
141
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
142
|
-
children: "bordered:"
|
|
143
|
-
}), /*#__PURE__*/_jsx(RadioGroup, {
|
|
144
|
-
jssStyle: jssStyle,
|
|
145
|
-
data: [0, 1],
|
|
146
|
-
value: bordered,
|
|
147
|
-
onChange: function onChange(d) {
|
|
148
|
-
return setBordered(d);
|
|
149
|
-
},
|
|
150
|
-
keygen: true,
|
|
151
|
-
renderItem: function renderItem(d) {
|
|
152
|
-
return !!d ? 'true' : 'false';
|
|
153
|
-
}
|
|
154
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
155
|
-
children: "vertical:"
|
|
156
|
-
}), /*#__PURE__*/_jsx(RadioGroup, {
|
|
157
|
-
jssStyle: jssStyle,
|
|
158
|
-
data: ['middle', 'top'],
|
|
159
|
-
value: va,
|
|
160
|
-
onChange: function onChange(d) {
|
|
161
|
-
return setVa(d);
|
|
162
|
-
},
|
|
163
|
-
keygen: true,
|
|
164
|
-
renderItem: function renderItem(d) {
|
|
165
|
-
return d;
|
|
166
|
-
}
|
|
167
|
-
})]
|
|
168
|
-
}), /*#__PURE__*/_jsx(Table, {
|
|
169
|
-
sticky: {
|
|
170
|
-
top: 180
|
|
171
|
-
},
|
|
172
|
-
columnResizable: true,
|
|
173
|
-
bordered: !!bordered,
|
|
174
|
-
sorter: function sorter(key, order, list) {
|
|
175
|
-
console.log(key, order, list);
|
|
176
|
-
var orderFunc = sorters[key];
|
|
177
|
-
return orderFunc(order);
|
|
178
|
-
},
|
|
179
|
-
width: 1000,
|
|
180
|
-
style: {
|
|
181
|
-
height: ''
|
|
182
|
-
},
|
|
183
|
-
keygen: "id",
|
|
184
|
-
verticalAlign: va,
|
|
185
|
-
jssStyle: jssStyle,
|
|
186
|
-
data: data,
|
|
187
|
-
format: 'id',
|
|
188
|
-
columns: columns,
|
|
189
|
-
onRowSelect: function onRowSelect(value) {
|
|
190
|
-
console.log(value);
|
|
191
|
-
}
|
|
192
|
-
})]
|
|
193
|
-
});
|
|
194
|
-
});
|