tntd 3.0.0-beta.2 → 3.0.0-beta.20
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/es/alert/alert.js +5 -4
- package/es/alert/alert.js.map +1 -1
- package/es/array-input/index.js +57 -42
- package/es/array-input/index.js.map +1 -1
- package/es/array-input/index.less +4 -1
- package/es/button/button.less +17 -12
- package/es/cascader/cascader.js +30 -0
- package/es/cascader/cascader.js.map +1 -0
- package/es/cascader/cascader.less +16 -0
- package/es/cascader/index.js +3 -6
- package/es/cascader/index.js.map +1 -1
- package/es/check-card/index.js +2 -3
- package/es/check-card/index.js.map +1 -1
- package/es/checkbox/checkbox.js +5 -5
- package/es/checkbox/checkbox.js.map +1 -1
- package/es/collapse/collapse.less +3 -3
- package/es/color-picker/ColorPicker.js +4 -6
- package/es/color-picker/ColorPicker.js.map +1 -1
- package/es/descriptions/descriptions.js +35 -17
- package/es/descriptions/descriptions.js.map +1 -1
- package/es/descriptions/descriptions.less +6 -2
- package/es/descriptions/style/index.less +1 -0
- package/es/drawer/drawer.js +34 -24
- package/es/drawer/drawer.js.map +1 -1
- package/es/drawer/index.less +8 -12
- package/es/drawer/style/drawer.less +2 -4
- package/es/form/form.js +5 -3
- package/es/form/form.js.map +1 -1
- package/es/form/form.less +12 -6
- package/es/form/style/index.less +6 -6
- package/es/handle/index.js +9 -6
- package/es/handle/index.js.map +1 -1
- package/es/handle/index.less +16 -0
- package/es/handle-icon/index.js +201 -0
- package/es/handle-icon/index.js.map +1 -0
- package/es/handle-icon/index.less +53 -0
- package/es/icon/style/style.less +1 -1
- package/es/index.js +5 -0
- package/es/index.js.map +1 -1
- package/es/input/input.js +10 -6
- package/es/input/input.js.map +1 -1
- package/es/input/style/mixin.less +2 -3
- package/es/locale/en_US.js +6 -0
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +6 -0
- package/es/locale/zh_CN.js.map +1 -1
- package/es/modal/style/confirm.less +6 -10
- package/es/modal/style/modal.less +1 -1
- package/es/page-container/index.js +13 -0
- package/es/page-container/index.js.map +1 -0
- package/es/page-container/index.less +38 -0
- package/es/page-loading/index.js +29 -0
- package/es/page-loading/index.js.map +1 -0
- package/es/page-loading/index.less +38 -0
- package/es/page-loading/loading.gif +0 -0
- package/es/query-form/index.js +125 -109
- package/es/query-form/index.js.map +1 -1
- package/es/query-form/index.less +9 -12
- package/es/{query-form → query-form-backup}/Field/Composition/index.less +11 -3
- package/es/query-form-backup/index.less +90 -0
- package/es/query-list-scene/QueryForm.js +1 -3
- package/es/query-list-scene/QueryForm.js.map +1 -1
- package/es/query-list-scene/index.less +3 -3
- package/es/radio/radio.js +4 -4
- package/es/radio/radio.js.map +1 -1
- package/es/select/select.js +5 -3
- package/es/select/select.js.map +1 -1
- package/es/select/select.less +1 -1
- package/es/select/style/index.less +4 -4
- package/es/style/themes/default.less +3 -3
- package/es/table/expand.less +49 -0
- package/es/table/hooks/index.js +2 -1
- package/es/table/hooks/index.js.map +1 -1
- package/es/table/hooks/use-expand-fixed.js +78 -0
- package/es/table/hooks/use-expand-fixed.js.map +1 -0
- package/es/table/index.js +1 -0
- package/es/table/index.js.map +1 -1
- package/es/table/style/index.less +61 -68
- package/es/table/style/size.less +4 -4
- package/es/table/table.js +49 -15
- package/es/table/table.js.map +1 -1
- package/es/table/table.less +13 -22
- package/es/table/table.stories.js +413 -2
- package/es/table/table.stories.js.map +1 -1
- package/es/table/utils.js +11 -0
- package/es/table/utils.js.map +1 -1
- package/es/table-container/index.js +15 -0
- package/es/table-container/index.js.map +1 -0
- package/es/table-container/index.less +16 -0
- package/es/tabs/tabs.less +23 -25
- package/es/tabs-container/index.js +13 -0
- package/es/tabs-container/index.js.map +1 -0
- package/es/tabs-container/index.less +51 -0
- package/es/tag/color.less +28 -18
- package/es/tag/index.js +1 -1
- package/es/tag/index.js.map +1 -1
- package/es/tag/tag.less +41 -5
- package/es/title/index.js +4 -3
- package/es/title/index.js.map +1 -1
- package/es/tntd-action/Action.js +60 -13
- package/es/tntd-action/Action.js.map +1 -1
- package/es/tntd-action/index.js +5 -5
- package/es/tntd-action/index.js.map +1 -1
- package/es/tntd-action/index.less +5 -3
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +7 -8
- package/es/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/index.js +4 -5
- package/es/tntd-cascader/AntdCascader/index.js.map +1 -1
- package/es/tntd-form/FormItem/ItemHolder.js +1 -6
- package/es/tntd-form/FormItem/ItemHolder.js.map +1 -1
- package/es/tntd-rc-select/_util/getIcons.js +7 -8
- package/es/tntd-rc-select/_util/getIcons.js.map +1 -1
- package/es/tntd-select/index.js +9 -8
- package/es/tntd-select/index.js.map +1 -1
- package/es/tntd-select/index.less +7 -0
- package/es/tooltip/index.js +1 -0
- package/es/tooltip/index.js.map +1 -1
- package/es/tooltip/index.less +1 -2
- package/lib/alert/alert.d.ts.map +1 -1
- package/lib/alert/alert.js +4 -3
- package/lib/alert/alert.js.map +1 -1
- package/lib/array-input/index.d.ts +1 -12
- package/lib/array-input/index.d.ts.map +1 -1
- package/lib/array-input/index.js +62 -55
- package/lib/array-input/index.js.map +1 -1
- package/lib/array-input/index.less +4 -1
- package/lib/button/button.less +17 -12
- package/lib/cascader/cascader.d.ts +10 -0
- package/lib/cascader/cascader.d.ts.map +1 -0
- package/lib/cascader/cascader.js +49 -0
- package/lib/cascader/cascader.js.map +1 -0
- package/lib/cascader/cascader.less +16 -0
- package/lib/cascader/index.d.ts +3 -7
- package/lib/cascader/index.d.ts.map +1 -1
- package/lib/cascader/index.js +5 -10
- package/lib/cascader/index.js.map +1 -1
- package/lib/check-card/index.js +1 -2
- package/lib/check-card/index.js.map +1 -1
- package/lib/checkbox/checkbox.d.ts +2 -2
- package/lib/checkbox/checkbox.d.ts.map +1 -1
- package/lib/checkbox/checkbox.js +5 -5
- package/lib/checkbox/checkbox.js.map +1 -1
- package/lib/collapse/collapse.less +3 -3
- package/lib/color-picker/ColorPicker.d.ts.map +1 -1
- package/lib/color-picker/ColorPicker.js +2 -4
- package/lib/color-picker/ColorPicker.js.map +1 -1
- package/lib/descriptions/descriptions.d.ts.map +1 -1
- package/lib/descriptions/descriptions.js +38 -19
- package/lib/descriptions/descriptions.js.map +1 -1
- package/lib/descriptions/descriptions.less +6 -2
- package/lib/descriptions/style/index.less +1 -0
- package/lib/drawer/drawer.d.ts +5 -0
- package/lib/drawer/drawer.d.ts.map +1 -1
- package/lib/drawer/drawer.js +34 -23
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/index.less +8 -12
- package/lib/drawer/style/drawer.less +2 -4
- package/lib/form/form.js +5 -3
- package/lib/form/form.js.map +1 -1
- package/lib/form/form.less +12 -6
- package/lib/form/style/index.less +6 -6
- package/lib/handle/index.d.ts.map +1 -1
- package/lib/handle/index.js +15 -10
- package/lib/handle/index.js.map +1 -1
- package/lib/handle/index.less +16 -0
- package/lib/handle-icon/index.d.ts +7 -0
- package/lib/handle-icon/index.d.ts.map +1 -0
- package/lib/handle-icon/index.js +221 -0
- package/lib/handle-icon/index.js.map +1 -0
- package/lib/handle-icon/index.less +53 -0
- package/lib/icon/style/style.less +1 -1
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +35 -0
- package/lib/index.js.map +1 -1
- package/lib/input/input.js +8 -4
- package/lib/input/input.js.map +1 -1
- package/lib/input/style/mixin.less +2 -3
- package/lib/locale/default.d.ts +6 -0
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/en_US.d.ts +6 -0
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +6 -0
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +6 -0
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +6 -0
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/modal/style/confirm.less +6 -10
- package/lib/modal/style/modal.less +1 -1
- package/lib/page-container/index.d.ts +4 -0
- package/lib/page-container/index.d.ts.map +1 -0
- package/lib/page-container/index.js +22 -0
- package/lib/page-container/index.js.map +1 -0
- package/lib/page-container/index.less +38 -0
- package/lib/{query-form/Field/Composition/Select.d.ts → page-loading/index.d.ts} +1 -1
- package/lib/page-loading/index.d.ts.map +1 -0
- package/lib/page-loading/index.js +34 -0
- package/lib/page-loading/index.js.map +1 -0
- package/lib/page-loading/index.less +38 -0
- package/lib/page-loading/loading.gif +0 -0
- package/lib/query-form/index.d.ts +7 -4
- package/lib/query-form/index.d.ts.map +1 -1
- package/lib/query-form/index.js +149 -137
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-form/index.less +9 -12
- package/lib/{query-form → query-form-backup}/Field/Composition/index.less +11 -3
- package/lib/query-form-backup/index.less +90 -0
- package/lib/query-list-scene/QueryForm.js +2 -3
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/query-list-scene/index.less +3 -3
- package/lib/radio/radio.d.ts +2 -2
- package/lib/radio/radio.d.ts.map +1 -1
- package/lib/radio/radio.js +4 -4
- package/lib/radio/radio.js.map +1 -1
- package/lib/select/select.d.ts.map +1 -1
- package/lib/select/select.js +4 -2
- package/lib/select/select.js.map +1 -1
- package/lib/select/select.less +1 -1
- package/lib/select/style/index.less +4 -4
- package/lib/style/themes/default.less +3 -3
- package/lib/table/expand.less +49 -0
- package/lib/table/hooks/index.d.ts +1 -0
- package/lib/table/hooks/index.d.ts.map +1 -1
- package/lib/table/hooks/index.js +11 -0
- package/lib/table/hooks/index.js.map +1 -1
- package/lib/table/hooks/use-expand-fixed.d.ts +4 -0
- package/lib/table/hooks/use-expand-fixed.d.ts.map +1 -0
- package/lib/table/hooks/use-expand-fixed.js +108 -0
- package/lib/table/hooks/use-expand-fixed.js.map +1 -0
- package/lib/table/index.d.ts +1 -0
- package/lib/table/index.d.ts.map +1 -1
- package/lib/table/index.js +1 -0
- package/lib/table/index.js.map +1 -1
- package/lib/table/style/index.less +61 -68
- package/lib/table/style/size.less +4 -4
- package/lib/table/table.d.ts +3 -1
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +50 -13
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.less +13 -22
- package/lib/table/table.stories.d.ts +106 -29
- package/lib/table/table.stories.d.ts.map +1 -1
- package/lib/table/table.stories.js +426 -3
- package/lib/table/table.stories.js.map +1 -1
- package/lib/table/utils.d.ts +1 -0
- package/lib/table/utils.d.ts.map +1 -1
- package/lib/table/utils.js +13 -0
- package/lib/table/utils.js.map +1 -1
- package/lib/table-container/index.d.ts +3 -0
- package/lib/table-container/index.d.ts.map +1 -0
- package/lib/table-container/index.js +25 -0
- package/lib/table-container/index.js.map +1 -0
- package/lib/table-container/index.less +16 -0
- package/lib/tabs/tabs.less +23 -25
- package/lib/tabs-container/index.d.ts +4 -0
- package/lib/tabs-container/index.d.ts.map +1 -0
- package/lib/tabs-container/index.js +22 -0
- package/lib/tabs-container/index.js.map +1 -0
- package/lib/tabs-container/index.less +51 -0
- package/lib/tag/color.less +28 -18
- package/lib/tag/index.js +1 -1
- package/lib/tag/index.js.map +1 -1
- package/lib/tag/tag.less +41 -5
- package/lib/title/index.d.ts +1 -0
- package/lib/title/index.d.ts.map +1 -1
- package/lib/title/index.js +3 -2
- package/lib/title/index.js.map +1 -1
- package/lib/tntd-action/Action.d.ts +1 -1
- package/lib/tntd-action/Action.js +65 -14
- package/lib/tntd-action/Action.js.map +1 -1
- package/lib/tntd-action/index.js +6 -8
- package/lib/tntd-action/index.js.map +1 -1
- package/lib/tntd-action/index.less +5 -3
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +2 -3
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/index.d.ts.map +1 -1
- package/lib/tntd-cascader/AntdCascader/index.js +1 -2
- package/lib/tntd-cascader/AntdCascader/index.js.map +1 -1
- package/lib/tntd-form/FormItem/ItemHolder.js +1 -6
- package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -1
- package/lib/tntd-rc-select/_util/getIcons.js +2 -3
- package/lib/tntd-rc-select/_util/getIcons.js.map +1 -1
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +8 -7
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tntd-select/index.less +7 -0
- package/lib/tooltip/index.d.ts +1 -0
- package/lib/tooltip/index.d.ts.map +1 -1
- package/lib/tooltip/index.js +1 -0
- package/lib/tooltip/index.js.map +1 -1
- package/lib/tooltip/index.less +1 -2
- package/package.json +5 -4
- package/themes/common/css2.x.css +1 -0
- package/themes/common/css3.x.css +1 -0
- package/themes/default/lessVars3.x.less +4 -6
- package/themes/default/variables.less +3 -3
- package/themes/default/variablesVar.less +3 -3
- package/es/array-input/icon.js +0 -25
- package/es/array-input/icon.js.map +0 -1
- package/es/checkbox/checkbox-group.js +0 -5
- package/es/checkbox/checkbox-group.js.map +0 -1
- package/es/drawer/drawer.less +0 -20
- package/es/grid/RowContext.js +0 -3
- package/es/grid/RowContext.js.map +0 -1
- package/es/grid/col.js +0 -103
- package/es/grid/col.js.map +0 -1
- package/es/grid/hooks/useBreakpoint.js +0 -18
- package/es/grid/hooks/useBreakpoint.js.map +0 -1
- package/es/grid/row.js +0 -154
- package/es/grid/row.js.map +0 -1
- package/es/grid/style/rtl.less +0 -69
- package/es/modal/modal.less +0 -18
- package/es/query-form/Field/Composition/FieldPopover.js +0 -284
- package/es/query-form/Field/Composition/FieldPopover.js.map +0 -1
- package/es/query-form/Field/Composition/Select.js +0 -108
- package/es/query-form/Field/Composition/Select.js.map +0 -1
- package/es/query-form/Field/Composition/index.js +0 -275
- package/es/query-form/Field/Composition/index.js.map +0 -1
- package/es/query-form/Field/Composition/utils.js +0 -19
- package/es/query-form/Field/Composition/utils.js.map +0 -1
- package/es/radio/radio-group.js +0 -5
- package/es/radio/radio-group.js.map +0 -1
- package/es/steps/stepStyle/small.less +0 -5
- package/lib/array-input/icon.d.ts +0 -4
- package/lib/array-input/icon.d.ts.map +0 -1
- package/lib/array-input/icon.js +0 -32
- package/lib/array-input/icon.js.map +0 -1
- package/lib/checkbox/checkbox-group.d.ts +0 -8
- package/lib/checkbox/checkbox-group.d.ts.map +0 -1
- package/lib/checkbox/checkbox-group.js +0 -12
- package/lib/checkbox/checkbox-group.js.map +0 -1
- package/lib/drawer/drawer.less +0 -20
- package/lib/grid/RowContext.d.ts +0 -9
- package/lib/grid/RowContext.d.ts.map +0 -1
- package/lib/grid/RowContext.js +0 -9
- package/lib/grid/RowContext.js.map +0 -1
- package/lib/grid/col.d.ts +0 -29
- package/lib/grid/col.d.ts.map +0 -1
- package/lib/grid/col.js +0 -100
- package/lib/grid/col.js.map +0 -1
- package/lib/grid/hooks/useBreakpoint.d.ts +0 -4
- package/lib/grid/hooks/useBreakpoint.d.ts.map +0 -1
- package/lib/grid/hooks/useBreakpoint.js +0 -28
- package/lib/grid/hooks/useBreakpoint.js.map +0 -1
- package/lib/grid/row.d.ts +0 -21
- package/lib/grid/row.d.ts.map +0 -1
- package/lib/grid/row.js +0 -183
- package/lib/grid/row.js.map +0 -1
- package/lib/grid/style/rtl.less +0 -69
- package/lib/modal/modal.less +0 -18
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +0 -17
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/FieldPopover.js +0 -319
- package/lib/query-form/Field/Composition/FieldPopover.js.map +0 -1
- package/lib/query-form/Field/Composition/Select.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/Select.js +0 -132
- package/lib/query-form/Field/Composition/Select.js.map +0 -1
- package/lib/query-form/Field/Composition/index.d.ts +0 -14
- package/lib/query-form/Field/Composition/index.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/index.js +0 -330
- package/lib/query-form/Field/Composition/index.js.map +0 -1
- package/lib/query-form/Field/Composition/utils.d.ts +0 -6
- package/lib/query-form/Field/Composition/utils.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/utils.js +0 -27
- package/lib/query-form/Field/Composition/utils.js.map +0 -1
- package/lib/radio/radio-group.d.ts +0 -8
- package/lib/radio/radio-group.d.ts.map +0 -1
- package/lib/radio/radio-group.js +0 -12
- package/lib/radio/radio-group.js.map +0 -1
- package/lib/steps/stepStyle/small.less +0 -5
- /package/es/{query-form → query-form-backup}/Field/Composition/FieldPopover.less +0 -0
- /package/lib/{query-form → query-form-backup}/Field/Composition/FieldPopover.less +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
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.useExpandFixed = exports.findRowKey = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _utils = require("../utils");
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
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."); }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
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; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
18
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
19
|
+
var useExpandFixed = exports.useExpandFixed = function useExpandFixed() {
|
|
20
|
+
var curTableKey = (0, _react.useRef)((0, _utils.makeRandomCode)());
|
|
21
|
+
var activeKeyRef = (0, _react.useRef)(null);
|
|
22
|
+
var oldActiveKeyRef = (0, _react.useRef)({
|
|
23
|
+
main: null,
|
|
24
|
+
right: null,
|
|
25
|
+
left: null
|
|
26
|
+
});
|
|
27
|
+
var container = (0, _react.useRef)(null);
|
|
28
|
+
var observer = (0, _react.useRef)(null);
|
|
29
|
+
var getDom = function getDom(key) {
|
|
30
|
+
var main = document.querySelector(".".concat(curTableKey.current, " .ant-table-scroll [data-row-key=\"").concat(key, "-extra-row\"]")) || document.querySelector(".".concat(curTableKey.current, " .ant-table-default [data-row-key=\"").concat(key, "-extra-row\"]"));
|
|
31
|
+
var right = document.querySelector(".".concat(curTableKey.current, " .ant-table-fixed-right [data-row-key=\"").concat(key, "-extra-row\"]"));
|
|
32
|
+
var left = document.querySelector(".".concat(curTableKey.current, " .ant-table-fixed-left [data-row-key=\"").concat(key, "-extra-row\"]"));
|
|
33
|
+
return [main, right, left];
|
|
34
|
+
};
|
|
35
|
+
var expand = /*#__PURE__*/function () {
|
|
36
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37
|
+
var _getDom, _getDom2, main, right, left, border, height, td, colspan, Oldcolspan, newColspan;
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_getDom = getDom(String(activeKeyRef.current) || ''), _getDom2 = _slicedToArray(_getDom, 3), main = _getDom2[0], right = _getDom2[1], left = _getDom2[2];
|
|
42
|
+
border = 2;
|
|
43
|
+
height = (main === null || main === void 0 ? void 0 : main.offsetHeight) - border || 0;
|
|
44
|
+
if (right) {
|
|
45
|
+
right.setAttribute('style', "display: inline-block; height: ".concat(height, "px; overflow: hidden;"));
|
|
46
|
+
}
|
|
47
|
+
if (left) {
|
|
48
|
+
left.setAttribute('style', "display: inline-block; height: ".concat(height, "px; overflow: hidden;"));
|
|
49
|
+
}
|
|
50
|
+
if (main) {
|
|
51
|
+
// 解决 expandIconAsCell为true 且 iconCell的td元素为display: none;时, 展开内容滚动到最右边,会多出一部分iconCell所占据的空间 的问题
|
|
52
|
+
td = main.childNodes[1];
|
|
53
|
+
colspan = td.getAttribute('colspan') || 0;
|
|
54
|
+
Oldcolspan = td.getAttribute('oldcolspan') || 0;
|
|
55
|
+
newColspan = Oldcolspan ? Oldcolspan : Number(colspan) + 1 + '';
|
|
56
|
+
if (!Oldcolspan) td.setAttribute('oldcolspan', newColspan);
|
|
57
|
+
td.setAttribute('colspan', newColspan);
|
|
58
|
+
//
|
|
59
|
+
}
|
|
60
|
+
oldActiveKeyRef.current = {
|
|
61
|
+
main: main,
|
|
62
|
+
right: right,
|
|
63
|
+
left: left
|
|
64
|
+
};
|
|
65
|
+
case 7:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
68
|
+
}
|
|
69
|
+
}, _callee);
|
|
70
|
+
}));
|
|
71
|
+
return function expand() {
|
|
72
|
+
return _ref.apply(this, arguments);
|
|
73
|
+
};
|
|
74
|
+
}();
|
|
75
|
+
var ob = function ob() {
|
|
76
|
+
var classname = curTableKey.current;
|
|
77
|
+
if (!classname) return;
|
|
78
|
+
container.current = document.querySelector(".".concat(classname, ".ant-table-wrapper.collapse-panel > .ant-spin-nested-loading > .ant-spin-container > .ant-table"));
|
|
79
|
+
observer.current = new MutationObserver(expand);
|
|
80
|
+
observer.current.observe(container.current, {
|
|
81
|
+
childList: true,
|
|
82
|
+
attributes: true
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
var setChangedKey = function setChangedKey(key) {
|
|
86
|
+
activeKeyRef.current = key;
|
|
87
|
+
};
|
|
88
|
+
var trigger = function trigger(key) {
|
|
89
|
+
setChangedKey(key);
|
|
90
|
+
var className = curTableKey.current;
|
|
91
|
+
if (!className) return;
|
|
92
|
+
var dom = document === null || document === void 0 ? void 0 : document.querySelector(".".concat(className, ".ant-table-wrapper.collapse-panel > .ant-spin-nested-loading > .ant-spin-container > .ant-table"));
|
|
93
|
+
dom === null || dom === void 0 ? void 0 : dom.setAttribute('c-data', 'Mutation');
|
|
94
|
+
};
|
|
95
|
+
(0, _react.useEffect)(function () {
|
|
96
|
+
ob();
|
|
97
|
+
}, [curTableKey.current]);
|
|
98
|
+
return [curTableKey.current, trigger];
|
|
99
|
+
};
|
|
100
|
+
var findRowKey = exports.findRowKey = function findRowKey(record, rowKey) {
|
|
101
|
+
var res = '';
|
|
102
|
+
if (typeof rowKey === 'function') {
|
|
103
|
+
res = [record].map(rowKey)[0];
|
|
104
|
+
} else if (typeof rowKey === 'string') {
|
|
105
|
+
res = record[rowKey];
|
|
106
|
+
}
|
|
107
|
+
return res;
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-expand-fixed.js","sourceRoot":"","sources":["../../../src/table/hooks/use-expand-fixed.ts"],"names":[],"mappings":"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","sourcesContent":["import { useEffect, useRef } from 'react'\nimport { makeRandomCode } from '../utils'\n\nexport type keyType = string | number | null\n\ninterface OldDom {\n main: HTMLDivElement | null\n right: HTMLDivElement | null\n left: HTMLDivElement | null\n}\n\nexport const useExpandFixed = () => {\n const curTableKey = useRef<keyType>(makeRandomCode())\n const activeKeyRef = useRef<string | null>(null)\n const oldActiveKeyRef = useRef<OldDom>({\n main: null,\n right: null,\n left: null,\n })\n const container = useRef<HTMLDivElement | null>(null)\n const observer = useRef<MutationObserver | null>(null)\n\n const getDom = (key: string | number | undefined) => {\n const main =\n (document.querySelector(\n `.${curTableKey.current} .ant-table-scroll [data-row-key=\"${key}-extra-row\"]`\n ) as HTMLDivElement) ||\n (document.querySelector(\n `.${curTableKey.current} .ant-table-default [data-row-key=\"${key}-extra-row\"]`\n ) as HTMLDivElement)\n const right = document.querySelector(\n `.${curTableKey.current} .ant-table-fixed-right [data-row-key=\"${key}-extra-row\"]`\n ) as HTMLDivElement\n const left = document.querySelector(\n `.${curTableKey.current} .ant-table-fixed-left [data-row-key=\"${key}-extra-row\"]`\n ) as HTMLDivElement\n return [main, right, left]\n }\n\n const expand = async () => {\n const [main, right, left] = getDom(String(activeKeyRef.current) || '')\n const border = 2\n const height = main?.offsetHeight - border || 0\n if (right) {\n right.setAttribute('style', `display: inline-block; height: ${height}px; overflow: hidden;`)\n }\n\n if (left) {\n left.setAttribute('style', `display: inline-block; height: ${height}px; overflow: hidden;`)\n }\n\n if (main) {\n // 解决 expandIconAsCell为true 且 iconCell的td元素为display: none;时, 展开内容滚动到最右边,会多出一部分iconCell所占据的空间 的问题\n const td = main.childNodes[1] as HTMLDivElement\n\n const colspan = td.getAttribute('colspan') || 0\n const Oldcolspan = td.getAttribute('oldcolspan') || 0\n const newColspan = Oldcolspan ? Oldcolspan : Number(colspan) + 1 + ''\n if (!Oldcolspan) td.setAttribute('oldcolspan', newColspan)\n\n td.setAttribute('colspan', newColspan)\n //\n }\n\n oldActiveKeyRef.current = {\n main,\n right,\n left,\n }\n }\n\n const ob = () => {\n const classname = curTableKey.current\n if (!classname) return\n\n container.current = document.querySelector(\n `.${classname}.ant-table-wrapper.collapse-panel > .ant-spin-nested-loading > .ant-spin-container > .ant-table`\n ) as HTMLDivElement\n\n observer.current = new MutationObserver(expand)\n observer.current.observe(container.current, {\n childList: true, // 子节点的变动\n attributes: true,\n })\n }\n\n const setChangedKey = (key: string) => {\n activeKeyRef.current = key\n }\n\n const trigger = (key: string) => {\n setChangedKey(key)\n const className = curTableKey.current\n if (!className) return\n const dom = document?.querySelector(\n `.${className}.ant-table-wrapper.collapse-panel > .ant-spin-nested-loading > .ant-spin-container > .ant-table`\n )\n dom?.setAttribute('c-data', 'Mutation')\n }\n\n useEffect(() => {\n ob()\n }, [curTableKey.current])\n\n return [curTableKey.current, trigger as (key: string) => void] as const\n}\n\nexport const findRowKey = (\n record: any,\n rowKey: string | ((record: any, index: number) => string)\n) => {\n let res: string | number = ''\n if (typeof rowKey === 'function') {\n res = [record].map(rowKey)[0]\n } else if (typeof rowKey === 'string') {\n res = record[rowKey]\n }\n\n return res\n}\n"]}
|
package/lib/table/index.d.ts
CHANGED
package/lib/table/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAChB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAChB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,cAAc,CAAA;AACrB,OAAO,eAAe,CAAA;AAEtB,cAAc,SAAS,CAAA;AAEvB,eAAe,KAAK,CAAA"}
|
package/lib/table/index.js
CHANGED
package/lib/table/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mBAAgB;AAChB,mCAA+B;AAC/B,wBAAqB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mBAAgB;AAChB,mCAA+B;AAC/B,wBAAqB;AACrB,yBAAsB;AAEtB,0CAAuB;AAEvB,kBAAe,aAAK,CAAA","sourcesContent":["import './style'\nimport { Table } from './table'\nimport './table.less'\nimport './expand.less'\n\nexport * from './table'\n\nexport default Table\n"]}
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
.@{table-prefix-cls}-column-sorter-up,
|
|
96
96
|
.@{table-prefix-cls}-column-sorter-down {
|
|
97
97
|
.iconfont-size-under-12px(11px);
|
|
98
|
-
|
|
98
|
+
font-size: 12px !important;
|
|
99
99
|
display: block;
|
|
100
100
|
height: 1em;
|
|
101
101
|
line-height: 1em;
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
transition: all 0.3s, height 0s;
|
|
234
234
|
&.@{table-prefix-cls}-row-hover,
|
|
235
235
|
&:hover {
|
|
236
|
-
&:not(.@{table-prefix-cls}-expanded-row)
|
|
236
|
+
&:not(.@{table-prefix-cls}-expanded-row) {
|
|
237
237
|
box-shadow: 0px 0px 5px -5px rgba(0, 0, 0, 0.05), 0px 0px 25px 0px rgba(0, 0, 0, 0.1);
|
|
238
238
|
position: relative;
|
|
239
239
|
> td {
|
|
@@ -243,45 +243,16 @@
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
&-thead > tr,
|
|
247
|
-
&-tbody > tr {
|
|
248
|
-
transition: all 0.3s, height 0s;
|
|
249
|
-
// &.@{table-prefix-cls}-row-hover,
|
|
250
|
-
// &:hover {
|
|
251
|
-
// &:not(.@{table-prefix-cls}-expanded-row):not(.@{table-prefix-cls}-row-selected) {
|
|
252
|
-
// box-shadow: 0px 0px 5px -5px rgba(0, 0, 0, 0.05), 0px 0px 25px 0px rgba(0, 0, 0, 0.1);
|
|
253
|
-
// position: relative;
|
|
254
|
-
// > td {
|
|
255
|
-
// background: @table-row-hover-bg;
|
|
256
|
-
// }
|
|
257
|
-
// }
|
|
258
|
-
// }
|
|
259
|
-
&.@{table-prefix-cls}-row-selected > td {
|
|
260
|
-
&.@{table-prefix-cls}-column-sort {
|
|
261
|
-
background: @table-body-selected-sort-bg;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
&:hover {
|
|
265
|
-
&.@{table-prefix-cls}-row-selected > td {
|
|
266
|
-
background: @table-selected-row-hover-bg;
|
|
267
|
-
&.@{table-prefix-cls}-column-sort {
|
|
268
|
-
background: @table-body-selected-sort-bg;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
246
|
&-thead > tr:hover {
|
|
275
247
|
background: none;
|
|
276
248
|
}
|
|
277
249
|
|
|
278
250
|
&-footer {
|
|
279
|
-
position: relative;
|
|
251
|
+
// position: relative;
|
|
280
252
|
padding: @table-padding-vertical @table-padding-horizontal;
|
|
281
253
|
color: @table-footer-color;
|
|
282
254
|
background: @table-footer-bg;
|
|
283
255
|
border-top: @border-width-base @border-style-base @border-color-split;
|
|
284
|
-
border-radius: 0 0 @table-border-radius-base @table-border-radius-base;
|
|
285
256
|
&::before {
|
|
286
257
|
position: absolute;
|
|
287
258
|
top: -1px;
|
|
@@ -293,26 +264,25 @@
|
|
|
293
264
|
}
|
|
294
265
|
}
|
|
295
266
|
|
|
296
|
-
&.@{table-prefix-cls}-bordered &-footer {
|
|
297
|
-
|
|
298
|
-
}
|
|
267
|
+
// &.@{table-prefix-cls}-bordered &-footer {
|
|
268
|
+
// border: @border-width-base @border-style-base @border-color-split;
|
|
269
|
+
// }
|
|
299
270
|
|
|
300
271
|
&-title {
|
|
301
|
-
position: relative;
|
|
302
|
-
top: 1px;
|
|
272
|
+
// position: relative;
|
|
273
|
+
// top: 1px;
|
|
303
274
|
padding: @table-padding-vertical 0;
|
|
304
|
-
border-radius: @table-border-radius-base @table-border-radius-base 0 0;
|
|
305
275
|
}
|
|
306
276
|
|
|
307
277
|
&.@{table-prefix-cls}-bordered &-title {
|
|
308
278
|
padding-right: @table-padding-horizontal;
|
|
309
279
|
padding-left: @table-padding-horizontal;
|
|
310
|
-
border: @border-width-base @border-style-base @border-color-split;
|
|
280
|
+
border-bottom: @border-width-base @border-style-base @border-color-split;
|
|
311
281
|
}
|
|
312
282
|
|
|
313
283
|
&-title + &-content {
|
|
314
|
-
position: relative;
|
|
315
|
-
border-radius: @table-border-radius-base @table-border-radius-base 0 0;
|
|
284
|
+
// position: relative;
|
|
285
|
+
// border-radius: @table-border-radius-base @table-border-radius-base 0 0;
|
|
316
286
|
|
|
317
287
|
.@{table-prefix-cls}-bordered & {
|
|
318
288
|
&,
|
|
@@ -336,8 +306,22 @@
|
|
|
336
306
|
}
|
|
337
307
|
|
|
338
308
|
&-tbody > tr.@{table-prefix-cls}-row-selected td {
|
|
339
|
-
color: @table-selected-row-color;
|
|
340
|
-
background: @table-selected-row-bg;
|
|
309
|
+
// color: @table-selected-row-color;
|
|
310
|
+
// background: @table-selected-row-bg;
|
|
311
|
+
&.@{table-prefix-cls}-selection-column {
|
|
312
|
+
position: relative;
|
|
313
|
+
&::after {
|
|
314
|
+
content: ' ';
|
|
315
|
+
width: 4px;
|
|
316
|
+
height: calc(100% - 10px);
|
|
317
|
+
background: @blue-5;
|
|
318
|
+
display: block;
|
|
319
|
+
position: absolute;
|
|
320
|
+
top: 5px;
|
|
321
|
+
left: 0;
|
|
322
|
+
border-radius: 0 4px 4px 0;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
341
325
|
}
|
|
342
326
|
|
|
343
327
|
&-thead > tr > th.@{table-prefix-cls}-column-sort {
|
|
@@ -397,23 +381,26 @@
|
|
|
397
381
|
}
|
|
398
382
|
|
|
399
383
|
&-bordered {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
.@{table-prefix-cls}-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}
|
|
384
|
+
border: @border-width-base @border-style-base @border-color-split;
|
|
385
|
+
border-radius: @border-radius-base;
|
|
386
|
+
overflow: hidden;
|
|
387
|
+
// .@{table-prefix-cls}-header > table,
|
|
388
|
+
// .@{table-prefix-cls}-body > table,
|
|
389
|
+
// .@{table-prefix-cls}-fixed-left table,
|
|
390
|
+
// .@{table-prefix-cls}-fixed-right table {
|
|
391
|
+
// border: @border-width-base @border-style-base @border-color-split;
|
|
392
|
+
// border-right: 0;
|
|
393
|
+
// border-bottom: 0;
|
|
394
|
+
// }
|
|
412
395
|
|
|
413
396
|
&.@{table-prefix-cls}-empty {
|
|
397
|
+
.@{table-prefix-cls}-body > table {
|
|
398
|
+
border-radius: @border-radius-base @border-radius-base 0 0;
|
|
399
|
+
}
|
|
414
400
|
.@{table-prefix-cls}-placeholder {
|
|
415
|
-
border-right: @border-width-base @border-style-base @border-color-split;
|
|
416
|
-
border-left: @border-width-base @border-style-base @border-color-split;
|
|
401
|
+
// border-right: @border-width-base @border-style-base @border-color-split;
|
|
402
|
+
// border-left: @border-width-base @border-style-base @border-color-split;
|
|
403
|
+
border-bottom: 0;
|
|
417
404
|
}
|
|
418
405
|
}
|
|
419
406
|
|
|
@@ -440,22 +427,28 @@
|
|
|
440
427
|
.@{table-prefix-cls}-thead > tr > th,
|
|
441
428
|
.@{table-prefix-cls}-tbody > tr > td {
|
|
442
429
|
border-right: @border-width-base @border-style-base @border-color-split;
|
|
430
|
+
&:last-child {
|
|
431
|
+
border-right: 0;
|
|
432
|
+
}
|
|
443
433
|
}
|
|
444
|
-
.@{table-prefix-cls}-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
&:
|
|
448
|
-
border-
|
|
434
|
+
.@{table-prefix-cls}-fixed-left {
|
|
435
|
+
.@{table-prefix-cls}-thead > tr > th,
|
|
436
|
+
.@{table-prefix-cls}-tbody > tr > td {
|
|
437
|
+
&:last-child {
|
|
438
|
+
border-right: @border-width-base @border-style-base @border-color-split;
|
|
449
439
|
}
|
|
450
440
|
}
|
|
451
441
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
442
|
+
.@{table-prefix-cls}-content:has(.@{table-prefix-cls}-fixed-right) .@{table-prefix-cls}-scroll {
|
|
443
|
+
.@{table-prefix-cls}-thead > tr > th {
|
|
444
|
+
&:last-child {
|
|
445
|
+
border-right: @border-width-base @border-style-base @border-color-split;
|
|
446
|
+
}
|
|
457
447
|
}
|
|
458
448
|
}
|
|
449
|
+
.@{table-prefix-cls}-tbody > tr:last-child > td {
|
|
450
|
+
border-bottom: 0;
|
|
451
|
+
}
|
|
459
452
|
}
|
|
460
453
|
|
|
461
454
|
&-placeholder {
|
|
@@ -469,7 +462,7 @@
|
|
|
469
462
|
background: @component-background;
|
|
470
463
|
border-top: @border-width-base @border-style-base @border-color-split;
|
|
471
464
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
|
472
|
-
border-radius: 0 0 @border-radius-base @border-radius-base;
|
|
465
|
+
// border-radius: 0 0 @border-radius-base @border-radius-base;
|
|
473
466
|
}
|
|
474
467
|
|
|
475
468
|
&-pagination.@{ant-prefix}-pagination {
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
&.@{table-prefix-cls}-bordered {
|
|
123
|
-
border-right: 0;
|
|
123
|
+
// border-right: 0;
|
|
124
124
|
|
|
125
125
|
.@{table-prefix-cls}-title {
|
|
126
126
|
border: 0;
|
|
@@ -128,9 +128,9 @@
|
|
|
128
128
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
.@{table-prefix-cls}-content {
|
|
132
|
-
|
|
133
|
-
}
|
|
131
|
+
// .@{table-prefix-cls}-content {
|
|
132
|
+
// border-right: @border-width-base @border-style-base @border-color-split;
|
|
133
|
+
// }
|
|
134
134
|
|
|
135
135
|
.@{table-prefix-cls}-footer {
|
|
136
136
|
border: 0;
|
package/lib/table/table.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare type TableProps<T> = Omit<AntdTableProps<T>, 'locale'> & {
|
|
|
7
7
|
enableToolbar?: boolean;
|
|
8
8
|
showCellBorders?: boolean;
|
|
9
9
|
striped?: boolean;
|
|
10
|
+
sticky?: boolean;
|
|
10
11
|
shadowed?: boolean;
|
|
11
12
|
locale?: AntdTableProps<T>['locale'] & {
|
|
12
13
|
loadingDescription?: string;
|
|
@@ -15,11 +16,12 @@ export declare type TableProps<T> = Omit<AntdTableProps<T>, 'locale'> & {
|
|
|
15
16
|
refresh?(): void;
|
|
16
17
|
unUpperConverted?: boolean;
|
|
17
18
|
unTooltip?: boolean;
|
|
19
|
+
smallPadding?: boolean;
|
|
18
20
|
upperCaseIgnore?: string[];
|
|
19
21
|
rowClassName?: (record: T, index: number) => string;
|
|
20
22
|
};
|
|
21
23
|
export declare const Table: {
|
|
22
|
-
<T>({ className, locale, bordered, size, storageKey, columns, children, shadowed, striped, showCellBorders, enableToolbar, refresh, upperCaseIgnore, unUpperConverted, unTooltip, rowClassName, ...rest }: TableProps<T>): React.JSX.Element;
|
|
24
|
+
<T>({ className, locale, bordered, size, storageKey, columns, children, sticky, shadowed, striped, showCellBorders, enableToolbar, refresh, upperCaseIgnore, unUpperConverted, unTooltip, smallPadding, rowClassName, ...rest }: TableProps<T>): React.JSX.Element;
|
|
23
25
|
Column: typeof Column;
|
|
24
26
|
ColumnGroup: typeof ColumnGroup;
|
|
25
27
|
displayName: string;
|
package/lib/table/table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/table/table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,IAAI,cAAc,EAI7B,MAAM,eAAe,CAAA;AAEtB,OAAO,MAAM,MAAM,sBAAsB,CAAA;AACzC,OAAO,WAAW,MAAM,2BAA2B,CAAA;AAEnD,OAAO,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/table/table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,IAAI,cAAc,EAI7B,MAAM,eAAe,CAAA;AAEtB,OAAO,MAAM,MAAM,sBAAsB,CAAA;AACzC,OAAO,WAAW,MAAM,2BAA2B,CAAA;AAEnD,OAAO,KAAoC,MAAM,OAAO,CAAA;AAmBxD,oBAAY,UAAU,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG;QACrC,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,OAAO,CAAC,IAAI,IAAI,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CACpD,CAAA;AAmBD,eAAO,MAAM,KAAK;;;;;;CAiQjB,CAAA"}
|
package/lib/table/table.js
CHANGED
|
@@ -21,6 +21,7 @@ var _utils = require("./utils");
|
|
|
21
21
|
var _lang = require("../utils/lang");
|
|
22
22
|
var _totalShower = require("./total-shower");
|
|
23
23
|
var _prevLocale = require("../prev-locale");
|
|
24
|
+
var _rcResizeObserver = _interopRequireDefault(require("rc-resize-observer"));
|
|
24
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
26
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -77,8 +78,9 @@ var Table = exports.Table = function Table(_a) {
|
|
|
77
78
|
storageKey = _a.storageKey,
|
|
78
79
|
columns = _a.columns,
|
|
79
80
|
children = _a.children,
|
|
80
|
-
_a$
|
|
81
|
-
|
|
81
|
+
_a$sticky = _a.sticky,
|
|
82
|
+
sticky = _a$sticky === void 0 ? false : _a$sticky,
|
|
83
|
+
shadowed = _a.shadowed,
|
|
82
84
|
_a$striped = _a.striped,
|
|
83
85
|
striped = _a$striped === void 0 ? true : _a$striped,
|
|
84
86
|
_a$showCellBorders = _a.showCellBorders,
|
|
@@ -89,8 +91,9 @@ var Table = exports.Table = function Table(_a) {
|
|
|
89
91
|
upperCaseIgnore = _a.upperCaseIgnore,
|
|
90
92
|
unUpperConverted = _a.unUpperConverted,
|
|
91
93
|
unTooltip = _a.unTooltip,
|
|
94
|
+
smallPadding = _a.smallPadding,
|
|
92
95
|
rowClassName = _a.rowClassName,
|
|
93
|
-
rest = __rest(_a, ["className", "locale", "bordered", "size", "storageKey", "columns", "children", "shadowed", "striped", "showCellBorders", "enableToolbar", "refresh", "upperCaseIgnore", "unUpperConverted", "unTooltip", "rowClassName"]);
|
|
96
|
+
rest = __rest(_a, ["className", "locale", "bordered", "size", "storageKey", "columns", "children", "sticky", "shadowed", "striped", "showCellBorders", "enableToolbar", "refresh", "upperCaseIgnore", "unUpperConverted", "unTooltip", "smallPadding", "rowClassName"]);
|
|
94
97
|
var tableContainer = (0, _react.useRef)(null);
|
|
95
98
|
// const [innerSize, setInnerSize] = useLocalStorage<TableProps<T>['size']>(
|
|
96
99
|
// TABLE_SIZE_STORAGE_KEY,
|
|
@@ -108,7 +111,6 @@ var Table = exports.Table = function Table(_a) {
|
|
|
108
111
|
var _a;
|
|
109
112
|
if (striped || rowClassName || ((_a = rest.rowSelection) === null || _a === void 0 ? void 0 : _a.getCheckboxProps)) {
|
|
110
113
|
return function (record, index) {
|
|
111
|
-
var _a;
|
|
112
114
|
var back = [];
|
|
113
115
|
if (rowClassName) {
|
|
114
116
|
if ((0, _isFunction2["default"])(rowClassName)) {
|
|
@@ -120,17 +122,21 @@ var Table = exports.Table = function Table(_a) {
|
|
|
120
122
|
if (striped && index % 2 === 1) {
|
|
121
123
|
back.push("".concat(prefixCls, "-row-even"));
|
|
122
124
|
}
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
125
|
+
// if (rest.rowSelection?.getCheckboxProps) {
|
|
126
|
+
// const checkboxProps: any = rest.rowSelection.getCheckboxProps(record)
|
|
127
|
+
// if (checkboxProps && checkboxProps.disabled) {
|
|
128
|
+
// back.push(`${prefixCls}-row-disabled`)
|
|
129
|
+
// }
|
|
130
|
+
// }
|
|
129
131
|
return back.join(' ');
|
|
130
132
|
};
|
|
131
133
|
}
|
|
132
134
|
return rowClassName;
|
|
133
135
|
};
|
|
136
|
+
var _useState = (0, _react.useState)(Number),
|
|
137
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
138
|
+
fixedWidth = _useState2[0],
|
|
139
|
+
setFixedWidth = _useState2[1];
|
|
134
140
|
var lang = (0, _prevLocale.getLanguage)();
|
|
135
141
|
var newColumns = displayColumns;
|
|
136
142
|
// 非中文做处理
|
|
@@ -210,6 +216,32 @@ var Table = exports.Table = function Table(_a) {
|
|
|
210
216
|
// setInnerSize(size)
|
|
211
217
|
// }
|
|
212
218
|
// }, [setInnerSize, size])
|
|
219
|
+
/**
|
|
220
|
+
* expand 与 fix 兼容,expand悬浮
|
|
221
|
+
*/
|
|
222
|
+
var _useExpandFixed = (0, _hooks.useExpandFixed)(),
|
|
223
|
+
_useExpandFixed2 = _slicedToArray(_useExpandFixed, 2),
|
|
224
|
+
tableKey = _useExpandFixed2[0],
|
|
225
|
+
trigger = _useExpandFixed2[1];
|
|
226
|
+
var stickyProps = (0, _react.useMemo)(function () {
|
|
227
|
+
return {
|
|
228
|
+
onExpandedRowsChange: function onExpandedRowsChange(arg) {
|
|
229
|
+
var key = arg && arg[arg.length - 1];
|
|
230
|
+
if (rest === null || rest === void 0 ? void 0 : rest.onExpandedRowsChange) rest === null || rest === void 0 ? void 0 : rest.onExpandedRowsChange([Number(key)]);
|
|
231
|
+
// 触发MutationObserver监听
|
|
232
|
+
trigger(key);
|
|
233
|
+
},
|
|
234
|
+
expandedRowRender: (rest === null || rest === void 0 ? void 0 : rest.expandedRowRender) ? function (record, index, indent, expanded) {
|
|
235
|
+
var padding = 0;
|
|
236
|
+
return _react["default"].createElement("div", {
|
|
237
|
+
className: "ant-table-expanded-row-fixed",
|
|
238
|
+
style: {
|
|
239
|
+
width: fixedWidth + padding
|
|
240
|
+
}
|
|
241
|
+
}, (rest === null || rest === void 0 ? void 0 : rest.expandedRowRender) && (rest === null || rest === void 0 ? void 0 : rest.expandedRowRender(record, index, indent, expanded)));
|
|
242
|
+
} : undefined
|
|
243
|
+
};
|
|
244
|
+
}, [rest === null || rest === void 0 ? void 0 : rest.expandedRowRender, rest === null || rest === void 0 ? void 0 : rest.onExpandedRowsChange, trigger]);
|
|
213
245
|
return _react["default"].createElement(_context.TableContext.Provider, {
|
|
214
246
|
value: {
|
|
215
247
|
// size: innerSize,
|
|
@@ -231,16 +263,21 @@ var Table = exports.Table = function Table(_a) {
|
|
|
231
263
|
}, function (localeObject) {
|
|
232
264
|
// const locale = localeObject as Record<string, string>
|
|
233
265
|
// const paginationConfig = pagination ? getDefaultPagination(locale) : pagination
|
|
234
|
-
return _react["default"].createElement(
|
|
266
|
+
return _react["default"].createElement(_rcResizeObserver["default"], {
|
|
267
|
+
onResize: function onResize(_ref2) {
|
|
268
|
+
var width = _ref2.width;
|
|
269
|
+
setFixedWidth(width);
|
|
270
|
+
}
|
|
271
|
+
}, _react["default"].createElement(_table["default"], Object.assign({
|
|
235
272
|
className: (0, _classnames["default"])(
|
|
236
273
|
// prefixCls,
|
|
237
|
-
'tnt-table-wrapper', _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-hide-cell-borders"), !showCellBorders), "".concat(prefixCls, "-size-small"), size === 'small'), "".concat(prefixCls, "-size-middle"), size === 'middle'), "".concat(prefixCls, "-striped"), striped), "".concat(prefixCls, "-shadowed"), shadowed), "".concat(prefixCls, "-has-footer"), rest.footer), className),
|
|
274
|
+
'tnt-table-wrapper', "".concat(tableKey, " collapse-panel"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-hide-cell-borders"), !showCellBorders), "".concat(prefixCls, "-size-small"), size === 'small'), "".concat(prefixCls, "-size-middle"), size === 'middle'), "".concat(prefixCls, "-striped"), striped), "".concat(prefixCls, "-shadowed"), shadowed), "".concat(prefixCls, "-has-footer"), rest.footer), "".concat(prefixCls, "-small-padding"), smallPadding), "".concat(prefixCls, "-sticky"), sticky), className),
|
|
238
275
|
locale: locale,
|
|
239
276
|
bordered: bordered,
|
|
240
277
|
size: size,
|
|
241
278
|
columns: newColumns,
|
|
242
279
|
rowClassName: getRowClassName(prefixCls)
|
|
243
|
-
}, rest));
|
|
280
|
+
}, rest, sticky ? stickyProps : {})));
|
|
244
281
|
}));
|
|
245
282
|
}));
|
|
246
283
|
};
|