tntd 3.0.28 → 3.0.29
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 +71 -0
- package/es/alert/alert.js.map +1 -0
- package/es/alert/alert.less +128 -0
- package/es/alert/index.js +1 -1
- package/es/alert/index.js.map +1 -1
- package/es/alert/style/index.less +1 -0
- package/es/array-input/index.js +14 -12
- package/es/array-input/index.js.map +1 -1
- package/es/button/button.js +30 -3
- package/es/button/button.js.map +1 -1
- package/es/button/button.less +72 -2
- 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/checkbox/check.png +0 -0
- package/es/checkbox/checkbox.js +48 -0
- package/es/checkbox/checkbox.js.map +1 -0
- package/es/checkbox/checkbox.less +69 -0
- package/es/checkbox/index.js +3 -7
- package/es/checkbox/index.js.map +1 -1
- package/es/date-picker/DatePicker.js +101 -0
- package/es/date-picker/DatePicker.js.map +1 -0
- package/es/date-picker/index.js +6 -12
- package/es/date-picker/index.js.map +1 -1
- package/es/date-picker/index.less +294 -0
- package/es/date-picker/style/Calendar.less +1 -1
- package/es/descriptions/descriptions.less +1 -0
- package/es/descriptions/index.js +2 -2
- package/es/descriptions/index.js.map +1 -1
- package/es/drawer/drawer.js +5 -5
- package/es/drawer/drawer.js.map +1 -1
- package/es/drawer/index.less +15 -1
- package/es/drawer/style/drawer.less +18 -3
- package/es/drawer/style/index.js +2 -1
- package/es/drawer/style/index.js.map +1 -1
- package/es/form/style/index.less +6 -0
- package/es/handle/index.js +9 -6
- package/es/handle/index.js.map +1 -1
- package/es/handle/index.less +16 -0
- package/es/input/index.js +1 -1
- package/es/input/index.js.map +1 -1
- package/es/input/input.js +21 -30
- package/es/input/input.js.map +1 -1
- package/es/input/input.less +123 -20
- package/es/input-number/index.js +4 -29
- package/es/input-number/index.js.map +1 -1
- package/es/input-number/inputNumber.js +34 -0
- package/es/input-number/inputNumber.js.map +1 -0
- package/es/input-number/inputNumber.less +12 -0
- package/es/locale/en_US.js +9 -5
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +7 -3
- package/es/locale/zh_CN.js.map +1 -1
- package/es/message/message.less +2 -1
- package/es/modal/index.js +2 -3
- package/es/modal/index.js.map +1 -1
- package/es/modal/index.less +36 -0
- package/es/modal/modal.js +103 -16
- package/es/modal/modal.js.map +1 -1
- package/es/modal/style/index.js +2 -1
- package/es/modal/style/index.js.map +1 -1
- package/es/modal/style/modal.less +15 -3
- package/es/notification/notification.less +27 -2
- package/es/notification/style/index.less +1 -0
- package/es/page-container/index.js +1 -1
- package/es/page-container/index.js.map +1 -1
- package/es/page-container/index.less +3 -2
- package/es/page-loading/index.js +1 -1
- package/es/page-loading/index.js.map +1 -1
- package/es/popconfirm/index.js +2 -2
- package/es/popconfirm/index.js.map +1 -1
- package/es/popconfirm/index.less +32 -0
- package/es/popconfirm/popconfirm.js +43 -0
- package/es/popconfirm/popconfirm.js.map +1 -0
- package/es/popconfirm/style/index.js +2 -1
- package/es/popconfirm/style/index.js.map +1 -1
- package/es/popover/index.js +2 -2
- package/es/popover/index.js.map +1 -1
- package/es/popover/index.less +57 -0
- package/es/popover/popover.js +34 -0
- package/es/popover/popover.js.map +1 -0
- package/es/popover/style/index.js +1 -0
- package/es/popover/style/index.js.map +1 -1
- package/es/prev-locale.js +1 -1
- package/es/prev-locale.js.map +1 -1
- package/es/preview-text/index.js.map +1 -1
- package/es/progress/index.js +2 -2
- package/es/progress/index.js.map +1 -1
- package/es/progress/progress.js +132 -0
- package/es/progress/progress.js.map +1 -0
- package/es/progress/progress.less +82 -0
- package/es/query-form/Field/Composition/FieldPopover.js +304 -0
- package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/es/query-form/Field/Composition/FieldPopover.less +35 -0
- package/es/query-form/Field/Composition/Select.js +122 -0
- package/es/query-form/Field/Composition/Select.js.map +1 -0
- package/es/query-form/Field/Composition/ValueTag.js +124 -0
- package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
- package/es/query-form/Field/Composition/index.js +233 -0
- package/es/query-form/Field/Composition/index.js.map +1 -0
- package/es/query-form/Field/Composition/index.less +120 -0
- package/es/query-form/Field/Composition/utils.js +154 -0
- package/es/query-form/Field/Composition/utils.js.map +1 -0
- package/es/query-form-backup/Field/Composition/FieldPopover.less +35 -0
- package/es/query-form-backup/Field/Composition/index.less +114 -0
- package/es/query-form-backup/index.less +90 -0
- package/es/query-form-v2/index.less +133 -0
- package/es/query-list-scene/List.js +3 -1
- package/es/query-list-scene/List.js.map +1 -1
- 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 +7 -7
- package/es/radio/index.js +3 -5
- package/es/radio/index.js.map +1 -1
- package/es/radio/radio.js +57 -0
- package/es/radio/radio.js.map +1 -0
- package/es/radio/radio.less +43 -0
- package/es/scroll-bar/Bar.js +56 -0
- package/es/scroll-bar/Bar.js.map +1 -0
- package/es/scroll-bar/Context.js +6 -0
- package/es/scroll-bar/Context.js.map +1 -0
- package/es/scroll-bar/ScrollBar.js +86 -0
- package/es/scroll-bar/ScrollBar.js.map +1 -0
- package/es/scroll-bar/Thumb.js +105 -0
- package/es/scroll-bar/Thumb.js.map +1 -0
- package/es/scroll-bar/index.js +3 -0
- package/es/scroll-bar/index.js.map +1 -0
- package/es/scroll-bar/scrollBar.less +59 -0
- package/es/scroll-bar/util.js +31 -0
- package/es/scroll-bar/util.js.map +1 -0
- package/es/segmented/index.less +126 -112
- package/es/select/index.js +1 -1
- package/es/select/index.js.map +1 -1
- package/es/select/select.js +5 -6
- package/es/select/select.js.map +1 -1
- package/es/select/select.less +83 -9
- package/es/select/style/index.less +4 -4
- package/es/spin/index.js +3 -2
- package/es/spin/index.js.map +1 -1
- package/es/spin/spin.js +36 -0
- package/es/spin/spin.js.map +1 -0
- package/es/spin/spin.less +9 -0
- package/es/steps/assets/background_left.svg +12 -0
- package/es/steps/assets/background_right.svg +12 -0
- package/es/steps/assets/horizontal_line.svg +3 -0
- package/es/steps/assets/vertical_line.svg +3 -0
- package/es/steps/index.js +9 -2
- package/es/steps/index.js.map +1 -1
- package/es/steps/stepStyle/icon.less +51 -0
- package/es/steps/stepStyle/index.less +173 -8
- package/es/steps/stepStyle/nav.less +51 -259
- package/es/steps/stepStyle/progress-dot.less +10 -0
- package/es/steps/stepStyle/variables.less +8 -0
- package/es/steps/stepStyle/vertical.less +41 -0
- package/es/steps/steps.js +53 -27
- package/es/steps/steps.js.map +1 -1
- package/es/steps/style/index.js +8 -0
- package/es/steps/style/index.js.map +1 -1
- package/es/style/themes/default.less +6 -5
- package/es/switch/index.less +45 -0
- package/es/switch/style/index.js +2 -1
- package/es/switch/style/index.js.map +1 -1
- package/es/switch/switch.js +40 -2
- package/es/switch/switch.js.map +1 -1
- package/es/table/hooks/use-expand-fixed.js.map +1 -1
- package/es/table/style/index.less +19 -21
- package/es/table/style/size.less +11 -12
- package/es/table/table.js +68 -40
- package/es/table/table.js.map +1 -1
- package/es/table/table.less +31 -6
- package/es/table/table.stories.js +3 -3
- package/es/table/table.stories.js.map +1 -1
- package/es/table-container/index.js +5 -2
- package/es/table-container/index.js.map +1 -1
- package/es/table-container/index.less +4 -1
- package/es/tabs/index.js +1 -0
- package/es/tabs/index.js.map +1 -1
- package/es/tabs/style/index.js.map +1 -1
- package/es/tabs/style/index.less +1 -0
- package/es/tabs/tabs.js +27 -3
- package/es/tabs/tabs.js.map +1 -1
- package/es/tabs/tabs.less +125 -0
- package/es/tabs-container/index.js +1 -1
- package/es/tabs-container/index.js.map +1 -1
- package/es/tag/tag.less +4 -3
- package/es/time-picker/TimePicker.js +36 -0
- package/es/time-picker/TimePicker.js.map +1 -0
- package/es/time-picker/index.js +2 -2
- package/es/time-picker/index.js.map +1 -1
- package/es/time-picker/index.less +38 -0
- package/es/title/index.less +47 -45
- package/es/tntd-action/Action.js +117 -0
- package/es/tntd-action/Action.js.map +1 -0
- package/es/tntd-action/index.js +69 -6
- package/es/tntd-action/index.js.map +1 -1
- package/es/tntd-action/index.less +59 -0
- package/es/tntd-cascader/AntdCascader/index.less +35 -29
- package/es/tntd-select/index.js +3 -4
- package/es/tntd-select/index.js.map +1 -1
- package/es/tntd-select/index.less +7 -0
- package/es/tntd-virtual-tree/index.less +2 -1
- package/es/tntd-virtual-tree-select/index.less +1 -1
- package/es/tooltip/index.less +4 -5
- package/es/tooltip/style/index.js +2 -1
- package/es/tooltip/style/index.js.map +1 -1
- package/es/upload/index.js +1 -2
- package/es/upload/index.js.map +1 -1
- package/es/upload/style/index.less +1 -1
- package/es/upload/upload.less +5 -12
- package/es/utils/index.js +0 -1
- package/es/utils/index.js.map +1 -1
- package/es/utils/lang.js +8 -2
- package/es/utils/lang.js.map +1 -1
- package/lib/_util/context.js +1 -1
- package/lib/_util/defaultRenderEmpty.js +1 -1
- package/lib/_util/hooks/useFlexGapSupport.js +4 -4
- package/lib/_util/hooks/useForceUpdate.js +4 -4
- package/lib/_util/responsiveObserve.js +1 -1
- package/lib/_util/styleChecker.js +1 -1
- package/lib/actions/index.js +1 -1
- package/lib/alert/alert.d.ts +12 -0
- package/lib/alert/alert.d.ts.map +1 -0
- package/lib/alert/alert.js +93 -0
- package/lib/alert/alert.js.map +1 -0
- package/lib/alert/alert.less +128 -0
- package/lib/alert/index.d.ts +1 -1
- package/lib/alert/index.d.ts.map +1 -1
- package/lib/alert/index.js +7 -8
- package/lib/alert/index.js.map +1 -1
- package/lib/alert/style/index.less +1 -0
- package/lib/array-input/index.d.ts.map +1 -1
- package/lib/array-input/index.js +26 -23
- package/lib/array-input/index.js.map +1 -1
- package/lib/button/button.d.ts +9 -4
- package/lib/button/button.d.ts.map +1 -1
- package/lib/button/button.js +28 -4
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.less +72 -2
- 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/group.js +8 -8
- package/lib/check-card/index.js +6 -6
- package/lib/checkbox/check.png +0 -0
- package/lib/checkbox/checkbox.d.ts +16 -0
- package/lib/checkbox/checkbox.d.ts.map +1 -0
- package/lib/checkbox/checkbox.js +65 -0
- package/lib/checkbox/checkbox.js.map +1 -0
- package/lib/checkbox/checkbox.less +69 -0
- package/lib/checkbox/index.d.ts +3 -3
- package/lib/checkbox/index.d.ts.map +1 -1
- package/lib/checkbox/index.js +2 -17
- package/lib/checkbox/index.js.map +1 -1
- package/lib/color-picker/ColorPicker.js +6 -6
- package/lib/color-picker/index.js +1 -1
- package/lib/columns/index.js +1 -1
- package/lib/config-provider/config-provider.js +1 -1
- package/lib/date-picker/DatePicker.d.ts +21 -0
- package/lib/date-picker/DatePicker.d.ts.map +1 -0
- package/lib/date-picker/DatePicker.js +128 -0
- package/lib/date-picker/DatePicker.js.map +1 -0
- package/lib/date-picker/index.d.ts +2 -6
- package/lib/date-picker/index.d.ts.map +1 -1
- package/lib/date-picker/index.js +6 -37
- package/lib/date-picker/index.js.map +1 -1
- package/lib/date-picker/index.less +294 -0
- package/lib/date-picker/style/Calendar.less +1 -1
- package/lib/descriptions/descriptions.js +5 -5
- package/lib/descriptions/descriptions.less +1 -0
- package/lib/descriptions/index.d.ts +1 -1
- package/lib/descriptions/index.d.ts.map +1 -1
- package/lib/descriptions/index.js +7 -7
- package/lib/descriptions/index.js.map +1 -1
- package/lib/development-login/LoginModal.js +6 -6
- package/lib/development-login/index.js +4 -4
- package/lib/drawer/drawer.d.ts +3 -3
- package/lib/drawer/drawer.d.ts.map +1 -1
- package/lib/drawer/drawer.js +7 -7
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/index.less +15 -1
- package/lib/drawer/style/drawer.less +18 -3
- package/lib/drawer/style/index.d.ts +1 -0
- package/lib/drawer/style/index.d.ts.map +1 -1
- package/lib/drawer/style/index.js +2 -1
- package/lib/drawer/style/index.js.map +1 -1
- package/lib/ellipsis/Svg/CopySVG.js +1 -1
- package/lib/ellipsis/Svg/TickSVG.js +1 -1
- package/lib/ellipsis/index.js +5 -5
- package/lib/empty/empty.js +2 -2
- package/lib/empty/empty.stories.js +2 -2
- package/lib/exception/exception.js +1 -1
- package/lib/form/form.js +2 -2
- package/lib/form/style/index.less +6 -0
- package/lib/grid-v4/col.js +2 -2
- package/lib/grid-v4/hooks/useBreakpoint.js +1 -1
- package/lib/grid-v4/index.js +1 -1
- package/lib/grid-v4/row.js +6 -6
- package/lib/handle/index.d.ts.map +1 -1
- package/lib/handle/index.js +16 -11
- package/lib/handle/index.js.map +1 -1
- package/lib/handle/index.less +16 -0
- package/lib/handle-icon/index.js +11 -11
- package/lib/icon/IconFont.js +1 -1
- package/lib/icon/components/Icon.js +9 -9
- package/lib/icon/components/index.js +1 -1
- package/lib/icon/components/utils.js +3 -3
- package/lib/icon/index.js +7 -7
- package/lib/icon/twoTonePrimaryColor.js +1 -1
- package/lib/icon/utils.js +1 -1
- package/lib/img/Contain.js +1 -1
- package/lib/img/Cover.js +5 -5
- package/lib/img/index.js +5 -5
- package/lib/index.js +1 -1
- package/lib/input/index.d.ts +1 -1
- package/lib/input/index.d.ts.map +1 -1
- package/lib/input/index.js +7 -7
- package/lib/input/index.js.map +1 -1
- package/lib/input/input.d.ts +5 -5
- package/lib/input/input.d.ts.map +1 -1
- package/lib/input/input.js +13 -22
- package/lib/input/input.js.map +1 -1
- package/lib/input/input.less +123 -20
- package/lib/input-number/index.d.ts +4 -10
- package/lib/input-number/index.d.ts.map +1 -1
- package/lib/input-number/index.js +5 -32
- package/lib/input-number/index.js.map +1 -1
- package/lib/input-number/inputNumber.d.ts +10 -0
- package/lib/input-number/inputNumber.d.ts.map +1 -0
- package/lib/input-number/inputNumber.js +54 -0
- package/lib/input-number/inputNumber.js.map +1 -0
- package/lib/input-number/inputNumber.less +12 -0
- package/lib/label/index.js +2 -2
- package/lib/loading-button/index.js +5 -5
- package/lib/locale/default.d.ts +7 -3
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/default.js +1 -1
- package/lib/locale/en_US.d.ts +7 -3
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +10 -6
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +7 -3
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +8 -4
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/message/message.less +2 -1
- package/lib/modal/index.d.ts +0 -1
- package/lib/modal/index.d.ts.map +1 -1
- package/lib/modal/index.js +2 -3
- package/lib/modal/index.js.map +1 -1
- package/lib/modal/index.less +36 -0
- package/lib/modal/modal.d.ts.map +1 -1
- package/lib/modal/modal.js +91 -16
- package/lib/modal/modal.js.map +1 -1
- package/lib/modal/style/index.d.ts +1 -0
- package/lib/modal/style/index.d.ts.map +1 -1
- package/lib/modal/style/index.js +2 -1
- package/lib/modal/style/index.js.map +1 -1
- package/lib/modal/style/modal.less +15 -3
- package/lib/notification/assets/index.js +1 -1
- package/lib/notification/assets/svg-error-tip.d.ts +1 -1
- package/lib/notification/assets/svg-success-tip.d.ts +1 -1
- package/lib/notification/index.js +1 -1
- package/lib/notification/notification.js +1 -1
- package/lib/notification/notification.less +27 -2
- package/lib/notification/style/index.less +1 -0
- package/lib/page/Box.js +1 -1
- package/lib/page/index.js +7 -7
- package/lib/page-container/index.js +2 -2
- package/lib/page-container/index.js.map +1 -1
- package/lib/page-container/index.less +3 -2
- package/lib/page-loading/index.js +2 -2
- package/lib/page-loading/index.js.map +1 -1
- package/lib/popconfirm/index.d.ts +2 -2
- package/lib/popconfirm/index.d.ts.map +1 -1
- package/lib/popconfirm/index.js +1 -1
- package/lib/popconfirm/index.js.map +1 -1
- package/lib/popconfirm/index.less +32 -0
- package/lib/popconfirm/popconfirm.d.ts +8 -0
- package/lib/popconfirm/popconfirm.d.ts.map +1 -0
- package/lib/popconfirm/popconfirm.js +61 -0
- package/lib/popconfirm/popconfirm.js.map +1 -0
- package/lib/popconfirm/style/index.d.ts +1 -0
- package/lib/popconfirm/style/index.d.ts.map +1 -1
- package/lib/popconfirm/style/index.js +2 -1
- package/lib/popconfirm/style/index.js.map +1 -1
- package/lib/popover/index.d.ts +2 -2
- package/lib/popover/index.d.ts.map +1 -1
- package/lib/popover/index.js +2 -2
- package/lib/popover/index.js.map +1 -1
- package/lib/popover/index.less +57 -0
- package/lib/popover/popover.d.ts +14 -0
- package/lib/popover/popover.d.ts.map +1 -0
- package/lib/popover/popover.js +55 -0
- package/lib/popover/popover.js.map +1 -0
- package/lib/popover/style/index.d.ts +1 -0
- package/lib/popover/style/index.d.ts.map +1 -1
- package/lib/popover/style/index.js +2 -1
- package/lib/popover/style/index.js.map +1 -1
- package/lib/prev-locale.d.ts +1 -1
- package/lib/prev-locale.d.ts.map +1 -1
- package/lib/prev-locale.js +1 -1
- package/lib/prev-locale.js.map +1 -1
- package/lib/preview-text/index.d.ts +1 -1
- package/lib/preview-text/index.d.ts.map +1 -1
- package/lib/preview-text/index.js +7 -7
- package/lib/preview-text/index.js.map +1 -1
- package/lib/progress/index.d.ts +2 -2
- package/lib/progress/index.d.ts.map +1 -1
- package/lib/progress/index.js +1 -1
- package/lib/progress/index.js.map +1 -1
- package/lib/progress/progress.d.ts +12 -0
- package/lib/progress/progress.d.ts.map +1 -0
- package/lib/progress/progress.js +148 -0
- package/lib/progress/progress.js.map +1 -0
- package/lib/progress/progress.less +82 -0
- package/lib/query-form/Field/Checkbox.js +1 -1
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +19 -0
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.js +338 -0
- package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.less +35 -0
- package/lib/query-form/Field/Composition/Select.d.ts +4 -0
- package/lib/query-form/Field/Composition/Select.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/Select.js +146 -0
- package/lib/query-form/Field/Composition/Select.js.map +1 -0
- package/lib/query-form/Field/Composition/ValueTag.d.ts +12 -0
- package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/ValueTag.js +153 -0
- package/lib/query-form/Field/Composition/ValueTag.js.map +1 -0
- package/lib/query-form/Field/Composition/index.d.ts +12 -0
- package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/index.js +277 -0
- package/lib/query-form/Field/Composition/index.js.map +1 -0
- package/lib/query-form/Field/Composition/index.less +120 -0
- package/lib/query-form/Field/Composition/utils.d.ts +22 -0
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/utils.js +168 -0
- package/lib/query-form/Field/Composition/utils.js.map +1 -0
- package/lib/query-form/Field/Select.js +6 -6
- package/lib/query-form/Field/SelectInput.js +6 -6
- package/lib/query-form/Field/fieldsMap.js +1 -1
- package/lib/query-form/Field/index.js +10 -10
- package/lib/query-form/createActions.js +1 -1
- package/lib/query-form/index.js +10 -10
- package/lib/query-form/useForm.js +1 -1
- package/lib/query-form-backup/Field/Composition/FieldPopover.less +35 -0
- package/lib/query-form-backup/Field/Composition/index.less +114 -0
- package/lib/query-form-backup/index.less +90 -0
- package/lib/query-form-v2/Field/Checkbox.d.ts +8 -0
- package/lib/query-form-v2/Field/Checkbox.d.ts.map +1 -0
- package/lib/query-form-v2/Field/Checkbox.js +28 -0
- package/lib/query-form-v2/Field/Checkbox.js.map +1 -0
- package/lib/query-form-v2/Field/Select.d.ts +4 -0
- package/lib/query-form-v2/Field/Select.d.ts.map +1 -0
- package/lib/query-form-v2/Field/Select.js +80 -0
- package/lib/query-form-v2/Field/Select.js.map +1 -0
- package/lib/query-form-v2/Field/SelectInput.d.ts +4 -0
- package/lib/query-form-v2/Field/SelectInput.d.ts.map +1 -0
- package/lib/query-form-v2/Field/SelectInput.js +88 -0
- package/lib/query-form-v2/Field/SelectInput.js.map +1 -0
- package/lib/query-form-v2/Field/fieldsMap.d.ts +24 -0
- package/lib/query-form-v2/Field/fieldsMap.d.ts.map +1 -0
- package/lib/query-form-v2/Field/fieldsMap.js +35 -0
- package/lib/query-form-v2/Field/fieldsMap.js.map +1 -0
- package/lib/query-form-v2/Field/index.d.ts +14 -0
- package/lib/query-form-v2/Field/index.d.ts.map +1 -0
- package/lib/query-form-v2/Field/index.js +146 -0
- package/lib/query-form-v2/Field/index.js.map +1 -0
- package/lib/query-form-v2/createActions.d.ts +14 -0
- package/lib/query-form-v2/createActions.d.ts.map +1 -0
- package/lib/query-form-v2/createActions.js +54 -0
- package/lib/query-form-v2/createActions.js.map +1 -0
- package/lib/query-form-v2/index.d.ts +39 -0
- package/lib/query-form-v2/index.d.ts.map +1 -0
- package/lib/query-form-v2/index.js +391 -0
- package/lib/query-form-v2/index.js.map +1 -0
- package/lib/query-form-v2/index.less +133 -0
- package/lib/query-form-v2/useForm.d.ts +13 -0
- package/lib/query-form-v2/useForm.d.ts.map +1 -0
- package/lib/query-form-v2/useForm.js +13 -0
- package/lib/query-form-v2/useForm.js.map +1 -0
- package/lib/query-form-v3/Field/Checkbox.d.ts +8 -0
- package/lib/query-form-v3/Field/Checkbox.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Checkbox.js +28 -0
- package/lib/query-form-v3/Field/Checkbox.js.map +1 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts +19 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.js +381 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.js.map +1 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.less +35 -0
- package/lib/query-form-v3/Field/Composition/Select.d.ts +4 -0
- package/lib/query-form-v3/Field/Composition/Select.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Composition/Select.js +131 -0
- package/lib/query-form-v3/Field/Composition/Select.js.map +1 -0
- package/lib/query-form-v3/Field/Composition/index.d.ts +10 -0
- package/lib/query-form-v3/Field/Composition/index.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Composition/index.js +255 -0
- package/lib/query-form-v3/Field/Composition/index.js.map +1 -0
- package/lib/query-form-v3/Field/Composition/index.less +118 -0
- package/lib/query-form-v3/Field/Composition/utils.d.ts +22 -0
- package/lib/query-form-v3/Field/Composition/utils.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Composition/utils.js +147 -0
- package/lib/query-form-v3/Field/Composition/utils.js.map +1 -0
- package/lib/query-form-v3/Field/Select.d.ts +4 -0
- package/lib/query-form-v3/Field/Select.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Select.js +80 -0
- package/lib/query-form-v3/Field/Select.js.map +1 -0
- package/lib/query-form-v3/Field/SelectInput.d.ts +4 -0
- package/lib/query-form-v3/Field/SelectInput.d.ts.map +1 -0
- package/lib/query-form-v3/Field/SelectInput.js +100 -0
- package/lib/query-form-v3/Field/SelectInput.js.map +1 -0
- package/lib/query-form-v3/Field/fieldsMap.d.ts +27 -0
- package/lib/query-form-v3/Field/fieldsMap.d.ts.map +1 -0
- package/lib/query-form-v3/Field/fieldsMap.js +35 -0
- package/lib/query-form-v3/Field/fieldsMap.js.map +1 -0
- package/lib/query-form-v3/Field/index.d.ts +14 -0
- package/lib/query-form-v3/Field/index.d.ts.map +1 -0
- package/lib/query-form-v3/Field/index.js +147 -0
- package/lib/query-form-v3/Field/index.js.map +1 -0
- package/lib/query-form-v3/createActions.d.ts +14 -0
- package/lib/query-form-v3/createActions.d.ts.map +1 -0
- package/lib/query-form-v3/createActions.js +54 -0
- package/lib/query-form-v3/createActions.js.map +1 -0
- package/lib/query-form-v3/index.d.ts +27 -0
- package/lib/query-form-v3/index.d.ts.map +1 -0
- package/lib/query-form-v3/index.js +206 -0
- package/lib/query-form-v3/index.js.map +1 -0
- package/lib/query-form-v3/index.less +91 -0
- package/lib/query-form-v3/useForm.d.ts +13 -0
- package/lib/query-form-v3/useForm.d.ts.map +1 -0
- package/lib/query-form-v3/useForm.js +13 -0
- package/lib/query-form-v3/useForm.js.map +1 -0
- package/lib/query-list-scene/List.d.ts.map +1 -1
- package/lib/query-list-scene/List.js +16 -14
- package/lib/query-list-scene/List.js.map +1 -1
- package/lib/query-list-scene/QueryForm.js +11 -12
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/query-list-scene/QueryListScene.js +10 -10
- package/lib/query-list-scene/Title.js +1 -1
- package/lib/query-list-scene/Toolbar.js +2 -2
- package/lib/query-list-scene/createActions.js +1 -1
- package/lib/query-list-scene/index.js +1 -1
- package/lib/query-list-scene/index.less +7 -7
- package/lib/query-list-scene/useActions.js +1 -1
- package/lib/radio/index.d.ts +3 -2
- package/lib/radio/index.d.ts.map +1 -1
- package/lib/radio/index.js +2 -5
- package/lib/radio/index.js.map +1 -1
- package/lib/radio/radio.d.ts +17 -0
- package/lib/radio/radio.d.ts.map +1 -0
- package/lib/radio/radio.js +75 -0
- package/lib/radio/radio.js.map +1 -0
- package/lib/radio/radio.less +43 -0
- package/lib/render-empty/render-empty.js +1 -1
- package/lib/scroll-bar/Bar.d.ts +4 -0
- package/lib/scroll-bar/Bar.d.ts.map +1 -0
- package/lib/scroll-bar/Bar.js +91 -0
- package/lib/scroll-bar/Bar.js.map +1 -0
- package/lib/scroll-bar/Context.d.ts +7 -0
- package/lib/scroll-bar/Context.d.ts.map +1 -0
- package/lib/scroll-bar/Context.js +13 -0
- package/lib/scroll-bar/Context.js.map +1 -0
- package/lib/scroll-bar/ScrollBar.d.ts +4 -0
- package/lib/scroll-bar/ScrollBar.d.ts.map +1 -0
- package/lib/scroll-bar/ScrollBar.js +97 -0
- package/lib/scroll-bar/ScrollBar.js.map +1 -0
- package/lib/scroll-bar/Thumb.d.ts +3 -0
- package/lib/scroll-bar/Thumb.d.ts.map +1 -0
- package/lib/scroll-bar/Thumb.js +125 -0
- package/lib/scroll-bar/Thumb.js.map +1 -0
- package/lib/scroll-bar/index.d.ts +3 -0
- package/lib/scroll-bar/index.d.ts.map +1 -0
- package/lib/scroll-bar/index.js +10 -0
- package/lib/scroll-bar/index.js.map +1 -0
- package/lib/scroll-bar/scrollBar.less +59 -0
- package/lib/scroll-bar/util.d.ts +40 -0
- package/lib/scroll-bar/util.d.ts.map +1 -0
- package/lib/scroll-bar/util.js +39 -0
- package/lib/scroll-bar/util.js.map +1 -0
- package/lib/segmented/index.d.ts +1 -1
- package/lib/segmented/index.js +2 -2
- package/lib/segmented/index.less +126 -112
- package/lib/select/index.d.ts +1 -1
- package/lib/select/index.d.ts.map +1 -1
- package/lib/select/index.js +6 -6
- package/lib/select/index.js.map +1 -1
- package/lib/select/select.d.ts +1 -1
- package/lib/select/select.d.ts.map +1 -1
- package/lib/select/select.js +5 -6
- package/lib/select/select.js.map +1 -1
- package/lib/select/select.less +83 -9
- package/lib/select/style/index.less +4 -4
- package/lib/spin/index.d.ts +3 -2
- package/lib/spin/index.d.ts.map +1 -1
- package/lib/spin/index.js +4 -6
- package/lib/spin/index.js.map +1 -1
- package/lib/spin/spin.d.ts +9 -0
- package/lib/spin/spin.d.ts.map +1 -0
- package/lib/spin/spin.js +44 -0
- package/lib/spin/spin.js.map +1 -0
- package/lib/spin/spin.less +9 -0
- package/lib/steps/assets/background_left.svg +12 -0
- package/lib/steps/assets/background_right.svg +12 -0
- package/lib/steps/assets/horizontal_line.svg +3 -0
- package/lib/steps/assets/vertical_line.svg +3 -0
- package/lib/steps/index.d.ts +1 -2
- package/lib/steps/index.d.ts.map +1 -1
- package/lib/steps/index.js +9 -2
- package/lib/steps/index.js.map +1 -1
- package/lib/steps/stepStyle/icon.less +51 -0
- package/lib/steps/stepStyle/index.less +173 -8
- package/lib/steps/stepStyle/nav.less +51 -259
- package/lib/steps/stepStyle/progress-dot.less +10 -0
- package/lib/steps/stepStyle/variables.less +8 -0
- package/lib/steps/stepStyle/vertical.less +41 -0
- package/lib/steps/steps.d.ts +10 -2
- package/lib/steps/steps.d.ts.map +1 -1
- package/lib/steps/steps.js +52 -24
- package/lib/steps/steps.js.map +1 -1
- package/lib/steps/style/index.d.ts.map +1 -1
- package/lib/steps/style/index.js.map +1 -1
- package/lib/style/themes/default.less +6 -5
- package/lib/svg-components/illustration-403.d.ts +1 -1
- package/lib/svg-components/illustration-404.d.ts +1 -1
- package/lib/svg-components/illustration-500.d.ts +1 -1
- package/lib/svg-components/illustration-empty.d.ts +1 -1
- package/lib/svg-components/illustration-failure.d.ts +1 -1
- package/lib/svg-components/illustration-no-access.d.ts +1 -1
- package/lib/svg-components/illustration-no-chart.d.ts +1 -1
- package/lib/svg-components/illustration-no-result.d.ts +1 -1
- package/lib/svg-components/illustration-offline.d.ts +1 -1
- package/lib/svg-components/illustration-success.d.ts +1 -1
- package/lib/svg-components/index.js +1 -1
- package/lib/switch/index.less +45 -0
- package/lib/switch/style/index.d.ts +1 -0
- package/lib/switch/style/index.d.ts.map +1 -1
- package/lib/switch/style/index.js +2 -1
- package/lib/switch/style/index.js.map +1 -1
- package/lib/switch/switch.d.ts +8 -0
- package/lib/switch/switch.d.ts.map +1 -1
- package/lib/switch/switch.js +40 -5
- package/lib/switch/switch.js.map +1 -1
- package/lib/table/assets/image-loading-background.d.ts +1 -1
- package/lib/table/assets/image-loading.d.ts +1 -1
- package/lib/table/hooks/use-column-setting.js +4 -4
- package/lib/table/hooks/use-expand-fixed.js +6 -6
- package/lib/table/hooks/use-expand-fixed.js.map +1 -1
- package/lib/table/resizableTable/index.js +6 -6
- package/lib/table/style/index.less +19 -21
- package/lib/table/style/size.less +11 -12
- package/lib/table/table-hoc.js +1 -1
- package/lib/table/table.d.ts +2 -1
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +63 -41
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.less +31 -6
- package/lib/table/table.stories.js +5 -5
- package/lib/table/table.stories.js.map +1 -1
- package/lib/table/total-shower.js +1 -1
- package/lib/table/utils.js +1 -1
- package/lib/table-container/index.d.ts.map +1 -1
- package/lib/table-container/index.js +7 -3
- package/lib/table-container/index.js.map +1 -1
- package/lib/table-container/index.less +4 -1
- package/lib/tabs/index.d.ts +1 -0
- package/lib/tabs/index.d.ts.map +1 -1
- package/lib/tabs/index.js +6 -5
- package/lib/tabs/index.js.map +1 -1
- package/lib/tabs/style/index.js.map +1 -1
- package/lib/tabs/style/index.less +1 -0
- package/lib/tabs/tabs.d.ts +3 -2
- package/lib/tabs/tabs.d.ts.map +1 -1
- package/lib/tabs/tabs.js +30 -3
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/tabs/tabs.less +125 -0
- package/lib/tabs-container/index.js +2 -2
- package/lib/tabs-container/index.js.map +1 -1
- package/lib/tag/tag.js +2 -2
- package/lib/tag/tag.less +4 -3
- package/lib/time-picker/TimePicker.d.ts +9 -0
- package/lib/time-picker/TimePicker.d.ts.map +1 -0
- package/lib/time-picker/TimePicker.js +55 -0
- package/lib/time-picker/TimePicker.js.map +1 -0
- package/lib/time-picker/index.d.ts +7 -6
- package/lib/time-picker/index.d.ts.map +1 -1
- package/lib/time-picker/index.js +4 -17
- package/lib/time-picker/index.js.map +1 -1
- package/lib/time-picker/index.less +38 -0
- package/lib/title/index.js +1 -1
- package/lib/title/index.less +47 -45
- package/lib/tntd-action/Action.d.ts +6 -0
- package/lib/tntd-action/Action.d.ts.map +1 -0
- package/lib/tntd-action/Action.js +141 -0
- package/lib/tntd-action/Action.js.map +1 -0
- package/lib/tntd-action/index.d.ts +4 -2
- package/lib/tntd-action/index.d.ts.map +1 -1
- package/lib/tntd-action/index.js +79 -5
- package/lib/tntd-action/index.js.map +1 -1
- package/lib/tntd-action/index.less +59 -0
- package/lib/tntd-cascader/AntdCascader/component/context.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
- package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +1 -1
- package/lib/tntd-cascader/AntdCascader/config/utils.js +2 -2
- package/lib/tntd-cascader/AntdCascader/index.js +7 -7
- package/lib/tntd-cascader/AntdCascader/index.less +35 -29
- package/lib/tntd-cascader/index.js +1 -1
- package/lib/tntd-cascader/rc-cascader/Cascader.js +8 -8
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
- package/lib/tntd-cascader/rc-cascader/index.js +1 -1
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
- package/lib/tntd-form/ErrorList.js +7 -7
- package/lib/tntd-form/Form.js +6 -6
- package/lib/tntd-form/FormItem/ItemHolder.js +6 -6
- package/lib/tntd-form/FormItem/index.js +8 -8
- package/lib/tntd-form/FormItemInput.js +1 -1
- package/lib/tntd-form/FormItemLabel.js +2 -2
- package/lib/tntd-form/FormList.js +1 -1
- package/lib/tntd-form/context.js +1 -1
- package/lib/tntd-form/hooks/useDebounce.js +4 -4
- package/lib/tntd-form/hooks/useForm.js +5 -5
- package/lib/tntd-form/hooks/useFormItemStatus.js +1 -1
- package/lib/tntd-form/hooks/useFrameState.js +5 -5
- package/lib/tntd-form/index.js +1 -1
- package/lib/tntd-icon/index.js +1 -1
- package/lib/tntd-layout/AppList.js +6 -6
- package/lib/tntd-layout/Application.js +6 -6
- package/lib/tntd-layout/Avatar.js +2 -2
- package/lib/tntd-layout/CompatibleLanguage.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
- package/lib/tntd-layout/EnterpriseLayout/Language.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/index.js +1 -1
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
- package/lib/tntd-layout/GlobalNavigation/index.js +9 -9
- package/lib/tntd-layout/Header.js +2 -2
- package/lib/tntd-layout/HeaderActions.js +2 -2
- package/lib/tntd-layout/HeaderNavs.js +6 -6
- package/lib/tntd-layout/HeaderTabs.js +7 -7
- package/lib/tntd-layout/Iconfont.js +1 -1
- package/lib/tntd-layout/Language.js +6 -6
- package/lib/tntd-layout/Layout.js +6 -6
- package/lib/tntd-layout/Logo.js +2 -2
- package/lib/tntd-layout/OrgAppList.js +6 -6
- package/lib/tntd-layout/SideMenu.js +6 -6
- package/lib/tntd-layout/Theme.js +6 -6
- package/lib/tntd-layout/createActions.js +1 -1
- package/lib/tntd-layout/images/index.js +1 -1
- package/lib/tntd-layout/index.js +1 -1
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
- package/lib/tntd-layout/paaslayout/Header.js +2 -2
- package/lib/tntd-layout/paaslayout/Logo.js +2 -2
- package/lib/tntd-layout/paaslayout/SideMenu.js +6 -6
- package/lib/tntd-layout/paaslayout/index.js +6 -6
- package/lib/tntd-layout/storage.js +1 -1
- package/lib/tntd-modal/index.js +6 -6
- package/lib/tntd-rc-select/_util/PurePanel.js +5 -5
- package/lib/tntd-rc-select/_util/context.js +1 -1
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
- package/lib/tntd-rc-select/_util/getIcons.js +1 -1
- package/lib/tntd-rc-select/_util/useCompactItemContext.js +2 -2
- package/lib/tntd-rc-select/index.js +2 -2
- package/lib/tntd-reference/AHref/index.js +1 -1
- package/lib/tntd-reference/ReferenceBatchCheck/index.js +1 -1
- package/lib/tntd-reference/ReferenceBatchDrawer/index.js +5 -5
- package/lib/tntd-reference/ReferenceCheck/index.js +1 -1
- package/lib/tntd-reference/ReferenceDrawer/index.js +5 -5
- package/lib/tntd-reference/ReferenceInfo/index.js +1 -1
- package/lib/tntd-reference/index.js +1 -1
- package/lib/tntd-second-page/index.js +1 -1
- package/lib/tntd-select/DropDownWrap.js +8 -8
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +13 -13
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tntd-select/index.less +7 -0
- package/lib/tntd-virtual-tree/index.js +8 -8
- package/lib/tntd-virtual-tree/index.less +2 -1
- package/lib/tntd-virtual-tree/utils.js +28 -28
- package/lib/tntd-virtual-tree-select/index.js +10 -10
- package/lib/tntd-virtual-tree-select/index.less +1 -1
- package/lib/tntd-virtual-tree-select/utils.js +9 -9
- package/lib/tooltip/index.less +4 -5
- package/lib/tooltip/style/index.d.ts +1 -0
- package/lib/tooltip/style/index.d.ts.map +1 -1
- package/lib/tooltip/style/index.js +2 -1
- package/lib/tooltip/style/index.js.map +1 -1
- package/lib/tooltip/tooltip.js +1 -1
- package/lib/upload/index.d.ts.map +1 -1
- package/lib/upload/index.js +7 -8
- package/lib/upload/index.js.map +1 -1
- package/lib/upload/style/index.less +1 -1
- package/lib/upload/svg/UploadSVG.js +1 -1
- package/lib/upload/upload.less +5 -12
- package/lib/utils/checkAuth.js +4 -4
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +9 -21
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/lang.d.ts.map +1 -1
- package/lib/utils/lang.js +10 -4
- package/lib/utils/lang.js.map +1 -1
- package/lib/water-mark/index.js +5 -5
- package/package.json +2 -2
- package/CHANGELOG.json +0 -1034
- package/CHANGELOG.md +0 -605
- package/es/checkbox/checkbox-group.js +0 -5
- package/es/checkbox/checkbox-group.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/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/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
|
@@ -8,14 +8,14 @@ exports.useExpandFixed = exports.findRowKey = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
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(
|
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
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(
|
|
14
|
-
function _arrayLikeToArray(
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
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(
|
|
17
|
-
function asyncGeneratorStep(
|
|
18
|
-
function _asyncToGenerator(
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
18
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
19
19
|
var useExpandFixed = exports.useExpandFixed = function useExpandFixed() {
|
|
20
20
|
var curTableKey = (0, _react.useRef)((0, _utils.makeRandomCode)());
|
|
21
21
|
var activeKeyRef = (0, _react.useRef)(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-expand-fixed.js","sourceRoot":"","sources":["../../../src/table/hooks/use-expand-fixed.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AACzC,oCAAyC;AAUlC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,WAAW,GAAG,IAAA,cAAM,EAAU,IAAA,sBAAc,GAAE,CAAC,CAAA;IACrD,MAAM,YAAY,GAAG,IAAA,cAAM,EAAgB,IAAI,CAAC,CAAA;IAChD,MAAM,eAAe,GAAG,IAAA,cAAM,EAAS;QACrC,IAAI,EAAE,IAAI;Q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AC,GAAW,EAAE,EAAE;QACpC,YAAY,CAAC,OAAO,GAAG,GAAG,CAAA;IAC5B,CAAC,CAAA;IAED,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE;QAC9B,aAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAA;QACrC,IAAI,CAAC,SAAS;YAAE,OAAM;QACtB,MAAM,GAAG,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,CACjC,IAAI,SAAS,iGAAiG,CAC/G,CAAA;QACD,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;IACzC,CAAC,CAAA;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,EAAE,EAAE,CAAA;IACN,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;IAEzB,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,OAAgC,CAAU,CAAA;AACzE,CAAC,CAAA;AAhGY,QAAA,cAAc,kBAgG1B;AAEM,MAAM,UAAU,GAAG,CACxB,MAAW,EACX,MAAyD,EACzD,EAAE;IACF,IAAI,GAAG,GAAoB,EAAE,CAAA;IAC7B,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;QAChC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;KAC9B;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACrC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;KACrB;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAZY,QAAA,UAAU,cAYtB","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 if(container.current) {\n observer.current.observe(container.current, {\n childList: true, // 子节点的变动\n attributes: true,\n })\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"]}
|
|
@@ -13,16 +13,16 @@ var _table = require("../table");
|
|
|
13
13
|
require("./index.less");
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
-
function _interopRequireDefault(
|
|
17
|
-
function _defineProperty(
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
19
|
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); }
|
|
20
|
-
function _slicedToArray(
|
|
20
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
21
21
|
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."); }
|
|
22
|
-
function _unsupportedIterableToArray(
|
|
23
|
-
function _arrayLikeToArray(
|
|
22
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
23
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
24
24
|
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; } }
|
|
25
|
-
function _arrayWithHoles(
|
|
25
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
26
26
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
27
27
|
var t = {};
|
|
28
28
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -229,28 +229,18 @@
|
|
|
229
229
|
transition: all 0.3s, border 0s;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
&-thead > tr,
|
|
233
232
|
&-tbody > tr {
|
|
234
233
|
transition: all 0.3s, height 0s;
|
|
235
234
|
&.@{table-prefix-cls}-row-hover,
|
|
236
235
|
&:hover {
|
|
237
|
-
&:not(.@{table-prefix-cls}-expanded-row)
|
|
238
|
-
|
|
236
|
+
&:not(.@{table-prefix-cls}-expanded-row) {
|
|
237
|
+
box-shadow: 0px 0px 5px -5px rgba(0, 0, 0, 0.05), 0px 0px 25px 0px rgba(0, 0, 0, 0.1);
|
|
238
|
+
position: relative;
|
|
239
|
+
> td {
|
|
240
|
+
background: @table-row-hover-bg;
|
|
241
|
+
}
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
|
-
// &.@{table-prefix-cls}-row-selected > td {
|
|
242
|
-
// &.@{table-prefix-cls}-column-sort {
|
|
243
|
-
// background: @table-body-selected-sort-bg;
|
|
244
|
-
// }
|
|
245
|
-
// }
|
|
246
|
-
// &:hover {
|
|
247
|
-
// &.@{table-prefix-cls}-row-selected > td {
|
|
248
|
-
// background: @table-selected-row-hover-bg;
|
|
249
|
-
// &.@{table-prefix-cls}-column-sort {
|
|
250
|
-
// background: @table-body-selected-sort-bg;
|
|
251
|
-
// }
|
|
252
|
-
// }
|
|
253
|
-
// }
|
|
254
244
|
}
|
|
255
245
|
|
|
256
246
|
&-thead > tr:hover {
|
|
@@ -342,7 +332,11 @@
|
|
|
342
332
|
background: @table-body-sort-bg;
|
|
343
333
|
}
|
|
344
334
|
|
|
345
|
-
&-thead > tr > th
|
|
335
|
+
&-thead > tr > th {
|
|
336
|
+
padding: calc(@table-padding-vertical - 4px) @table-padding-horizontal;
|
|
337
|
+
overflow-wrap: break-word;
|
|
338
|
+
}
|
|
339
|
+
|
|
346
340
|
&-tbody > tr > td {
|
|
347
341
|
padding: @table-padding-vertical @table-padding-horizontal;
|
|
348
342
|
overflow-wrap: break-word;
|
|
@@ -387,9 +381,9 @@
|
|
|
387
381
|
}
|
|
388
382
|
|
|
389
383
|
&-bordered {
|
|
390
|
-
border: @border-width-base @border-style-base @border-color-split;
|
|
391
|
-
border-radius: @border-radius-base;
|
|
392
|
-
overflow: hidden;
|
|
384
|
+
// border: @border-width-base @border-style-base @border-color-split;
|
|
385
|
+
// border-radius: @border-radius-base;
|
|
386
|
+
// overflow: hidden; // 姚姚和宏宇要求边框需要包括分页
|
|
393
387
|
// .@{table-prefix-cls}-header > table,
|
|
394
388
|
// .@{table-prefix-cls}-body > table,
|
|
395
389
|
// .@{table-prefix-cls}-fixed-left table,
|
|
@@ -400,6 +394,9 @@
|
|
|
400
394
|
// }
|
|
401
395
|
|
|
402
396
|
&.@{table-prefix-cls}-empty {
|
|
397
|
+
.@{table-prefix-cls}-body > table {
|
|
398
|
+
border-radius: @border-radius-base @border-radius-base 0 0;
|
|
399
|
+
}
|
|
403
400
|
.@{table-prefix-cls}-placeholder {
|
|
404
401
|
// border-right: @border-width-base @border-style-base @border-color-split;
|
|
405
402
|
// border-left: @border-width-base @border-style-base @border-color-split;
|
|
@@ -653,6 +650,7 @@
|
|
|
653
650
|
&-scroll {
|
|
654
651
|
overflow: auto;
|
|
655
652
|
overflow-x: hidden;
|
|
653
|
+
border-radius: @border-radius-base @border-radius-base 0 0;
|
|
656
654
|
table {
|
|
657
655
|
min-width: 100%;
|
|
658
656
|
|
|
@@ -683,7 +681,7 @@
|
|
|
683
681
|
&-fixed-header &-scroll &-header {
|
|
684
682
|
margin-bottom: -20px;
|
|
685
683
|
padding-bottom: 20px;
|
|
686
|
-
overflow: scroll;
|
|
684
|
+
// overflow: scroll; // mac没鼠标的时候行高变高
|
|
687
685
|
// Workaround for additional scroll bar on the table header
|
|
688
686
|
// https://github.com/ant-design/ant-design/issues/6515#issuecomment-419634369
|
|
689
687
|
opacity: 0.9999;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@table-padding-vertical-md: @table-padding-vertical * 3 / 4;
|
|
2
2
|
@table-padding-horizontal-md: @table-padding-horizontal / 2;
|
|
3
|
-
@table-padding-
|
|
4
|
-
@table-padding-vertical-sm: @table-padding-vertical / 2;
|
|
3
|
+
@table-padding-vertical-sm: @table-padding-vertical - 4px;
|
|
5
4
|
@table-padding-horizontal-sm: @table-padding-horizontal / 2;
|
|
6
5
|
|
|
7
6
|
.@{table-prefix-cls}-middle {
|
|
@@ -32,14 +31,14 @@
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
tr.@{table-prefix-cls}-expanded-row td > .@{table-prefix-cls}-wrapper {
|
|
35
|
-
margin: -@table-padding-vertical-md -@table-padding-horizontal / 2
|
|
36
|
-
1px);
|
|
34
|
+
margin: -@table-padding-vertical-md -@table-padding-horizontal / 2
|
|
35
|
+
calc(-@table-padding-vertical-md - 1px);
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
.@{table-prefix-cls}-small {
|
|
41
|
-
border: @border-width-base @border-style-base @border-color-split;
|
|
42
|
-
border-radius: @table-border-radius-base;
|
|
40
|
+
// border: @border-width-base @border-style-base @border-color-split;
|
|
41
|
+
// border-radius: @table-border-radius-base;
|
|
43
42
|
|
|
44
43
|
> .@{table-prefix-cls}-title,
|
|
45
44
|
> .@{table-prefix-cls}-content > .@{table-prefix-cls}-footer {
|
|
@@ -121,7 +120,7 @@
|
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
&.@{table-prefix-cls}-bordered {
|
|
124
|
-
border-right: 0;
|
|
123
|
+
// border-right: 0;
|
|
125
124
|
|
|
126
125
|
.@{table-prefix-cls}-title {
|
|
127
126
|
border: 0;
|
|
@@ -129,9 +128,9 @@
|
|
|
129
128
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
|
130
129
|
}
|
|
131
130
|
|
|
132
|
-
.@{table-prefix-cls}-content {
|
|
133
|
-
|
|
134
|
-
}
|
|
131
|
+
// .@{table-prefix-cls}-content {
|
|
132
|
+
// border-right: @border-width-base @border-style-base @border-color-split;
|
|
133
|
+
// }
|
|
135
134
|
|
|
136
135
|
.@{table-prefix-cls}-footer {
|
|
137
136
|
border: 0;
|
|
@@ -166,8 +165,8 @@
|
|
|
166
165
|
}
|
|
167
166
|
|
|
168
167
|
tr.@{table-prefix-cls}-expanded-row td > .@{table-prefix-cls}-wrapper {
|
|
169
|
-
margin: -@table-padding-vertical-sm -@table-padding-horizontal / 2
|
|
170
|
-
1px);
|
|
168
|
+
margin: -@table-padding-vertical-sm -@table-padding-horizontal / 2
|
|
169
|
+
calc(-@table-padding-vertical-sm - 1px);
|
|
171
170
|
}
|
|
172
171
|
|
|
173
172
|
// https://github.com/ant-design/ant-design/issues/19287#issuecomment-544368967
|
package/lib/table/table-hoc.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.Table = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _table = require("./table");
|
|
9
9
|
var _index = _interopRequireDefault(require("./resizableTable/index"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
11
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
12
12
|
var t = {};
|
|
13
13
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
package/lib/table/table.d.ts
CHANGED
|
@@ -18,9 +18,10 @@ export declare type TableProps<T> = Omit<AntdTableProps<T>, 'locale'> & {
|
|
|
18
18
|
unTooltip?: boolean;
|
|
19
19
|
smallPadding?: boolean;
|
|
20
20
|
upperCaseIgnore?: string[];
|
|
21
|
+
rowClassName?: (record: T, index: number) => string;
|
|
21
22
|
};
|
|
22
23
|
export declare const Table: {
|
|
23
|
-
<T>({ className, locale, bordered, size, storageKey, columns, children, sticky, shadowed, striped, showCellBorders, enableToolbar, refresh, upperCaseIgnore, unUpperConverted, unTooltip, smallPadding, ...rest }: TableProps<T>): React.JSX.Element;
|
|
24
|
+
<T>({ className, locale, bordered, size, storageKey, columns, children, sticky, shadowed, striped, showCellBorders, pagination, enableToolbar, refresh, upperCaseIgnore, unUpperConverted, unTooltip, smallPadding, rowClassName, ...rest }: TableProps<T>): React.JSX.Element;
|
|
24
25
|
Column: typeof Column;
|
|
25
26
|
ColumnGroup: typeof ColumnGroup;
|
|
26
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,KAAoC,MAAM,OAAO,CAAA;
|
|
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;AAkBxD,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;AAeD,eAAO,MAAM,KAAK;;;;;;CA2QjB,CAAA"}
|
package/lib/table/table.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.Table = void 0;
|
|
8
|
+
var _isString2 = _interopRequireDefault(require("lodash/isString"));
|
|
9
|
+
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
8
10
|
var _configProvider = require("../config-provider");
|
|
9
11
|
var _LocaleReceiver = _interopRequireDefault(require("antd/lib/locale-provider/LocaleReceiver"));
|
|
10
12
|
var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
@@ -17,21 +19,20 @@ var _context = require("./context");
|
|
|
17
19
|
var _hooks = require("./hooks");
|
|
18
20
|
var _utils = require("./utils");
|
|
19
21
|
var _lang = require("../utils/lang");
|
|
20
|
-
var _totalShower = require("./total-shower");
|
|
21
22
|
var _prevLocale = require("../prev-locale");
|
|
22
|
-
require("rc-resize-observer");
|
|
23
|
+
var _rcResizeObserver = _interopRequireDefault(require("rc-resize-observer"));
|
|
23
24
|
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); }
|
|
24
25
|
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; }
|
|
25
|
-
function _interopRequireDefault(
|
|
26
|
-
function _defineProperty(
|
|
26
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
27
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
27
28
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
28
29
|
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); }
|
|
29
|
-
function _slicedToArray(
|
|
30
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
30
31
|
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."); }
|
|
31
|
-
function _unsupportedIterableToArray(
|
|
32
|
-
function _arrayLikeToArray(
|
|
32
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
33
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
33
34
|
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; } }
|
|
34
|
-
function _arrayWithHoles(
|
|
35
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
35
36
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
36
37
|
var t = {};
|
|
37
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -46,16 +47,6 @@ var sizeWidthMap = {
|
|
|
46
47
|
small: 20,
|
|
47
48
|
xs: 16 // 8
|
|
48
49
|
};
|
|
49
|
-
var getDefaultPagination = function getDefaultPagination(locale) {
|
|
50
|
-
return {
|
|
51
|
-
showTotal: function showTotal(total) {
|
|
52
|
-
return _react["default"].createElement(_totalShower.TotalShower, {
|
|
53
|
-
total: total,
|
|
54
|
-
locale: locale
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
50
|
// 判断是否是特殊的tooltip
|
|
60
51
|
// const checkIsPrompt = (dom: any): boolean => {
|
|
61
52
|
// let isPrompt: boolean = false
|
|
@@ -80,9 +71,10 @@ var Table = exports.Table = function Table(_a) {
|
|
|
80
71
|
sticky = _a$sticky === void 0 ? false : _a$sticky,
|
|
81
72
|
shadowed = _a.shadowed,
|
|
82
73
|
_a$striped = _a.striped,
|
|
83
|
-
striped = _a$striped === void 0 ?
|
|
74
|
+
striped = _a$striped === void 0 ? true : _a$striped,
|
|
84
75
|
_a$showCellBorders = _a.showCellBorders,
|
|
85
76
|
showCellBorders = _a$showCellBorders === void 0 ? false : _a$showCellBorders,
|
|
77
|
+
pagination = _a.pagination,
|
|
86
78
|
_a$enableToolbar = _a.enableToolbar,
|
|
87
79
|
enableToolbar = _a$enableToolbar === void 0 ? false : _a$enableToolbar,
|
|
88
80
|
refresh = _a.refresh,
|
|
@@ -90,7 +82,8 @@ var Table = exports.Table = function Table(_a) {
|
|
|
90
82
|
unUpperConverted = _a.unUpperConverted,
|
|
91
83
|
unTooltip = _a.unTooltip,
|
|
92
84
|
smallPadding = _a.smallPadding,
|
|
93
|
-
|
|
85
|
+
rowClassName = _a.rowClassName,
|
|
86
|
+
rest = __rest(_a, ["className", "locale", "bordered", "size", "storageKey", "columns", "children", "sticky", "shadowed", "striped", "showCellBorders", "pagination", "enableToolbar", "refresh", "upperCaseIgnore", "unUpperConverted", "unTooltip", "smallPadding", "rowClassName"]);
|
|
94
87
|
var tableContainer = (0, _react.useRef)(null);
|
|
95
88
|
// const [innerSize, setInnerSize] = useLocalStorage<TableProps<T>['size']>(
|
|
96
89
|
// TABLE_SIZE_STORAGE_KEY,
|
|
@@ -104,6 +97,32 @@ var Table = exports.Table = function Table(_a) {
|
|
|
104
97
|
displayColumns = _useColumnSetting2[0],
|
|
105
98
|
columnSetting = _useColumnSetting2[1],
|
|
106
99
|
setColumnSetting = _useColumnSetting2[2];
|
|
100
|
+
var getRowClassName = function getRowClassName(prefixCls) {
|
|
101
|
+
var _a;
|
|
102
|
+
if (striped || rowClassName || ((_a = rest.rowSelection) === null || _a === void 0 ? void 0 : _a.getCheckboxProps)) {
|
|
103
|
+
return function (record, index) {
|
|
104
|
+
var back = [];
|
|
105
|
+
if (rowClassName) {
|
|
106
|
+
if ((0, _isFunction2["default"])(rowClassName)) {
|
|
107
|
+
back.push(rowClassName(record, index));
|
|
108
|
+
} else if ((0, _isString2["default"])(rowClassName)) {
|
|
109
|
+
back.push(rowClassName);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (striped && index % 2 === 1) {
|
|
113
|
+
back.push("".concat(prefixCls, "-row-even"));
|
|
114
|
+
}
|
|
115
|
+
// if (rest.rowSelection?.getCheckboxProps) {
|
|
116
|
+
// const checkboxProps: any = rest.rowSelection.getCheckboxProps(record)
|
|
117
|
+
// if (checkboxProps && checkboxProps.disabled) {
|
|
118
|
+
// back.push(`${prefixCls}-row-disabled`)
|
|
119
|
+
// }
|
|
120
|
+
// }
|
|
121
|
+
return back.join(' ');
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return rowClassName;
|
|
125
|
+
};
|
|
107
126
|
var _useState = (0, _react.useState)(Number),
|
|
108
127
|
_useState2 = _slicedToArray(_useState, 2),
|
|
109
128
|
fixedWidth = _useState2[0],
|
|
@@ -121,7 +140,7 @@ var Table = exports.Table = function Table(_a) {
|
|
|
121
140
|
title = title(options);
|
|
122
141
|
}
|
|
123
142
|
if (_react["default"].isValidElement(title)) {
|
|
124
|
-
var
|
|
143
|
+
var _renderChildren = function renderChildren(children) {
|
|
125
144
|
var _a;
|
|
126
145
|
if (_react["default"].isValidElement(children) || Array.isArray(children)) {
|
|
127
146
|
return (_a = _react["default"] === null || _react["default"] === void 0 ? void 0 : _react["default"].Children) === null || _a === void 0 ? void 0 : _a.map(children, function (child) {
|
|
@@ -129,7 +148,7 @@ var Table = exports.Table = function Table(_a) {
|
|
|
129
148
|
if (_react["default"].isValidElement(child)) {
|
|
130
149
|
var childProps = child.props || {};
|
|
131
150
|
return _react["default"].cloneElement(child, Object.assign(Object.assign({}, childProps), {
|
|
132
|
-
children: ((_a = childProps.children) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
151
|
+
children: ((_a = childProps.children) === null || _a === void 0 ? void 0 : _a.length) ? _renderChildren(childProps.children) : childProps.children,
|
|
133
152
|
title: (0, _lang.titleCaseUpper)(childProps === null || childProps === void 0 ? void 0 : childProps.title, upperCaseIgnore)
|
|
134
153
|
}));
|
|
135
154
|
} else {
|
|
@@ -139,7 +158,9 @@ var Table = exports.Table = function Table(_a) {
|
|
|
139
158
|
}
|
|
140
159
|
return (0, _lang.titleCaseUpper)(children, upperCaseIgnore);
|
|
141
160
|
};
|
|
142
|
-
return
|
|
161
|
+
return _react["default"].cloneElement(title, Object.assign(Object.assign({}, title.props), {
|
|
162
|
+
children: _renderChildren(title.props.children)
|
|
163
|
+
}));
|
|
143
164
|
}
|
|
144
165
|
if (typeof title === 'string') {
|
|
145
166
|
return (0, _lang.titleCaseUpper)(title, upperCaseIgnore);
|
|
@@ -233,24 +254,25 @@ var Table = exports.Table = function Table(_a) {
|
|
|
233
254
|
defaultLocale: locale
|
|
234
255
|
}, function (localeObject) {
|
|
235
256
|
// const locale = localeObject as Record<string, string>
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
257
|
+
var paginationConfig = pagination !== false ? Object.assign(Object.assign({}, pagination || {}), {
|
|
258
|
+
hideOnSinglePage: (pagination === null || pagination === void 0 ? void 0 : pagination.hideOnSinglePage) === false ? false : true
|
|
259
|
+
}) : pagination;
|
|
260
|
+
return _react["default"].createElement(_rcResizeObserver["default"], {
|
|
261
|
+
onResize: function onResize(_ref2) {
|
|
262
|
+
var width = _ref2.width;
|
|
263
|
+
setFixedWidth(width);
|
|
264
|
+
}
|
|
265
|
+
}, _react["default"].createElement(_table["default"], Object.assign({
|
|
266
|
+
className: (0, _classnames["default"])(
|
|
267
|
+
// prefixCls,
|
|
268
|
+
'tnt-table-wrapper', "".concat(tableKey, " collapse-panel"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-bordered-out"), !!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),
|
|
269
|
+
locale: locale,
|
|
270
|
+
bordered: bordered,
|
|
271
|
+
size: size,
|
|
272
|
+
columns: newColumns,
|
|
273
|
+
rowClassName: getRowClassName(prefixCls),
|
|
274
|
+
pagination: paginationConfig
|
|
275
|
+
}, rest, sticky ? stickyProps : {})));
|
|
254
276
|
}));
|
|
255
277
|
}));
|
|
256
278
|
};
|
package/lib/table/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table/table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAmD;AACnD,4FAAmE;AAOnE,0DAAoD;AACpD,kEAAyC;AACzC,4EAAmD;AACnD,4DAAmC;AACnC,+CAAwD;AACxD,2DAAkC;AAClC,uCAAwC;AACxC,mCAA0D;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antd/lib/locale-provider/LocaleReceiver'\nimport type {\n TableProps as AntdTableProps,\n ColumnProps,\n TableStateFilters,\n SortOrder,\n} from 'antd/lib/table'\nimport { default as AntdTable } from 'antd/lib/table'\nimport Column from 'antd/lib/table/Column'\nimport ColumnGroup from 'antd/lib/table/ColumnGroup'\nimport classNames from 'classnames'\nimport React, { useMemo, useRef, useState } from 'react'\nimport Ellipsis from '../ellipsis'\nimport { TableContext } from './context'\nimport { useColumnSetting, useExpandFixed } from './hooks'\nimport type { keyType } from './hooks'\nimport { normalizeColumns } from './utils'\nimport { titleCaseUpper } from '../utils/lang'\nimport { TotalShower } from './total-shower'\nimport { getLanguage } from '../prev-locale'\nimport ResizeObserver from 'rc-resize-observer'\nimport { debounce } from 'lodash'\n\nconst sizeWidthMap = {\n default: 40, //20\n middle: 20, //10\n small: 20, //10\n xs: 16, // 8\n}\n\nexport type TableProps<T> = Omit<AntdTableProps<T>, 'locale'> & {\n storageKey?: string\n enableToolbar?: boolean\n showCellBorders?: boolean\n striped?: boolean\n sticky?: boolean\n shadowed?: boolean\n locale?: AntdTableProps<T>['locale'] & {\n loadingDescription?: string\n emptyText?: string\n }\n refresh?(): void\n unUpperConverted?: boolean // 不要转换表头\n unTooltip?: boolean // 不要tooltip\n smallPadding?: boolean // 缩小间距\n upperCaseIgnore?: string[]\n}\n\nconst getDefaultPagination = (locale: NonNullable<AntdTableProps<unknown>['locale']>) => ({\n showTotal: (total: number) => <TotalShower total={total} locale={locale} />,\n})\n\n// 判断是否是特殊的tooltip\n// const checkIsPrompt = (dom: any): boolean => {\n// let isPrompt: boolean = false\n// if (React.isValidElement(dom)) {\n// if (dom?.type && typeof dom?.type === 'function') {\n// if (['Tooltip', 'Popconfirm'].includes(dom?.type?.name)) {\n// isPrompt = true\n// }\n// }\n// }\n// return isPrompt\n// }\n\nexport const Table = <T,>({\n className,\n locale,\n bordered,\n size,\n storageKey,\n columns,\n children,\n sticky = false,\n shadowed,\n striped = false,\n showCellBorders = false,\n // pagination,\n enableToolbar = false,\n refresh,\n upperCaseIgnore,\n unUpperConverted, // 强制不要转换\n unTooltip,\n smallPadding,\n\n ...rest\n}: TableProps<T>) => {\n const tableContainer = useRef<HTMLDivElement>(null)\n // const [innerSize, setInnerSize] = useLocalStorage<TableProps<T>['size']>(\n // TABLE_SIZE_STORAGE_KEY,\n // 'default'\n // )\n\n const normalizedColumns = useMemo(\n () => columns || normalizeColumns<T>(children as React.ReactChildren),\n [children, columns]\n )\n const [displayColumns, columnSetting, setColumnSetting] = useColumnSetting(\n normalizedColumns,\n storageKey\n )\n\n const [fixedWidth, setFixedWidth] = useState(Number)\n\n const lang = getLanguage()\n let newColumns = displayColumns\n // 非中文做处理\n if (lang !== 'cn') {\n if (!unUpperConverted) {\n newColumns = displayColumns?.map((column) => {\n return {\n ...column,\n title: (options: {\n filters: TableStateFilters\n sortOrder?: SortOrder\n sortColumn?: ColumnProps<T> | null\n }) => {\n let title = column.title\n if (typeof title === 'function') {\n title = title(options)\n }\n\n if (React.isValidElement(title)) {\n const renderChildren = (children: [] | string): React.ReactNode => {\n if (React.isValidElement(children) || Array.isArray(children)) {\n return React?.Children?.map(children, (child) => {\n if (React.isValidElement(child)) {\n const childProps = (child.props || {}) as any\n return React.cloneElement(child, {\n ...childProps,\n children: childProps.children?.length\n ? renderChildren(childProps.children)\n : childProps.children,\n title: titleCaseUpper(childProps?.title, upperCaseIgnore),\n })\n } else {\n return titleCaseUpper(child, upperCaseIgnore)\n }\n })\n }\n\n return titleCaseUpper(children, upperCaseIgnore)\n }\n\n return renderChildren(title.props.children)\n }\n\n if (typeof title === 'string') {\n return titleCaseUpper(title, upperCaseIgnore)\n }\n },\n }\n })\n }\n if (!unTooltip) {\n newColumns = newColumns?.map((column) => {\n if (!(column.width && !String(column.width).includes('%'))) {\n return column\n } else {\n return {\n ...column,\n title: (options: {\n filters: TableStateFilters\n sortOrder?: SortOrder\n sortColumn?: ColumnProps<T> | null\n }) => {\n let title = column.title\n if (typeof title === 'function') {\n title = title(options)\n }\n\n let widthLimitObj = {}\n if (column.width && !String(column.width).includes('%')) {\n let width = column.width\n if (typeof width === 'string') {\n width = width?.replace(/[^\\d]/g, ' ')\n }\n widthLimitObj = {\n widthLimit:\n Number(width) -\n Number(sizeWidthMap[size || 'default']) -\n (column.sorter ? 20 : 0),\n }\n }\n return (\n <Ellipsis\n {...widthLimitObj}\n placement={column?.placement || 'topLeft'}\n title={title}\n />\n )\n },\n }\n }\n })\n }\n }\n\n /**\n * update the innerSize when props size changes\n */\n // useEffect(() => {\n // if (size) {\n // setInnerSize(size)\n // }\n // }, [setInnerSize, size])\n\n /**\n * expand 与 fix 兼容,expand悬浮\n */\n const [tableKey, trigger] = useExpandFixed()\n\n const stickyProps = useMemo(() => {\n return {\n onExpandedRowsChange: (arg: string[] | number[]) => {\n const key: keyType = arg && arg[arg.length - 1]\n if (rest?.onExpandedRowsChange) rest?.onExpandedRowsChange([Number(key)])\n // 触发MutationObserver监听\n trigger(key as string)\n },\n expandedRowRender: rest?.expandedRowRender\n ? (record: T, index: number, indent: number, expanded: boolean) => {\n const padding = 0\n return (\n <div className=\"ant-table-expanded-row-fixed\" style={{ width: fixedWidth + padding }}>\n {rest?.expandedRowRender &&\n rest?.expandedRowRender(record, index, indent, expanded)}\n </div>\n )\n }\n : undefined,\n }\n }, [rest?.expandedRowRender, rest?.onExpandedRowsChange, trigger])\n\n return (\n <TableContext.Provider\n value={{\n // size: innerSize,\n tableContainer,\n columnSetting,\n refresh,\n upperCaseIgnore,\n // setSize: setInnerSize,\n setColumnSetting,\n }}\n >\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('table')\n return (\n <div ref={tableContainer}>\n <LocaleReceiver componentName=\"Table\" defaultLocale={locale}>\n {(localeObject) => {\n // const locale = localeObject as Record<string, string>\n // const paginationConfig = pagination ? getDefaultPagination(locale) : pagination\n return (\n // <ResizeObserver\n // onResize={({ width }) => {\n // setFixedWidth(width)\n // }}\n // >\n <AntdTable\n className={classNames(\n // prefixCls,\n 'tnt-table-wrapper',\n `${tableKey} collapse-panel`,\n {\n [`${prefixCls}-borderless`]: !bordered,\n [`${prefixCls}-hide-cell-borders`]: !showCellBorders,\n [`${prefixCls}-size-small`]: size === 'small',\n [`${prefixCls}-size-middle`]: size === 'middle',\n [`${prefixCls}-striped`]: striped,\n [`${prefixCls}-shadowed`]: shadowed,\n [`${prefixCls}-small-padding`]: smallPadding,\n [`${prefixCls}-sticky`]: sticky,\n },\n className\n )}\n locale={locale}\n bordered={bordered}\n size={size}\n columns={newColumns}\n {...rest}\n {...(sticky ? stickyProps : {})}\n />\n // </ResizeObserver>\n )\n }}\n </LocaleReceiver>\n </div>\n )\n }}\n </ConfigConsumer>\n </TableContext.Provider>\n )\n}\n\nTable.Column = Column\nTable.ColumnGroup = ColumnGroup\nTable.displayName = 'Table'\nTable.titleCaseUpper = titleCaseUpper\n"]}
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table/table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAmD;AACnD,4FAAmE;AAOnE,0DAAoD;AACpD,kEAAyC;AACzC,4EAAmD;AACnD,4DAAmC;AACnC,+CAAwD;AACxD,mCAA6C;AAC7C,2DAAkC;AAClC,uCAAwC;AACxC,mCAA0D;AAE1D,mCAA0C;AAC1C,wCAA8C;AAC9C,gDAA4C;AAC5C,4EAA+C;AAE/C,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,EAAE,EAAE,EAAE,EAAE,IAAI;CACb,CAAA;AAqBD,kBAAkB;AAClB,iDAAiD;AACjD,kCAAkC;AAClC,qCAAqC;AACrC,0DAA0D;AAC1D,mEAAmE;AACnE,0BAA0B;AAC1B,UAAU;AACV,QAAQ;AACR,MAAM;AACN,oBAAoB;AACpB,IAAI;AAEG,MAAM,KAAK,G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CAAC,GAAG,SAAS,aAAa,CAAC,EAAE,IAAI,CAAC,MAAM;gCACxC,CAAC,GAAG,SAAS,gBAAgB,CAAC,EAAE,YAAY;gCAC5C,CAAC,GAAG,SAAS,SAAS,CAAC,EAAE,MAAM;6BAChC,EACD,SAAS,CACV,EACD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,UAAU,EACnB,YAAY,EAAE,eAAe,CAAC,SAAS,CAAC,EACxC,UAAU,EAAE,gBAAgB,IACxB,IAAI,EACJ,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/B,CACa,CAClB,CAAA;gBACH,CAAC,CACc,CACb,CACP,CAAA;QACH,CAAC,CACc,CACK,CACzB,CAAA;AACH,CAAC,CAAA;AA3QY,QAAA,KAAK,SA2QjB;AAED,aAAK,CAAC,MAAM,GAAG,gBAAM,CAAA;AACrB,aAAK,CAAC,WAAW,GAAG,qBAAW,CAAA;AAC/B,aAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAC3B,aAAK,CAAC,cAAc,GAAG,qBAAc,CAAA","sourcesContent":["import { ConfigConsumer } from '../config-provider'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport type {\n TableProps as AntdTableProps,\n ColumnProps,\n TableStateFilters,\n SortOrder,\n} from 'antd/lib/table'\nimport { default as AntdTable } from 'antd/lib/table'\nimport Column from 'antd/lib/table/Column'\nimport ColumnGroup from 'antd/lib/table/ColumnGroup'\nimport classNames from 'classnames'\nimport React, { useMemo, useRef, useState } from 'react'\nimport { isFunction, isString } from 'lodash'\nimport Ellipsis from '../ellipsis'\nimport { TableContext } from './context'\nimport { useColumnSetting, useExpandFixed } from './hooks'\nimport type { keyType } from './hooks'\nimport { normalizeColumns } from './utils'\nimport { titleCaseUpper } from '../utils/lang'\nimport { getLanguage } from '../prev-locale'\nimport ResizeObserver from 'rc-resize-observer'\n\nconst sizeWidthMap = {\n default: 40, //20\n middle: 20, //10\n small: 20, //10\n xs: 16, // 8\n}\n\nexport type TableProps<T> = Omit<AntdTableProps<T>, 'locale'> & {\n storageKey?: string\n enableToolbar?: boolean\n showCellBorders?: boolean\n striped?: boolean\n sticky?: boolean\n shadowed?: boolean\n locale?: AntdTableProps<T>['locale'] & {\n loadingDescription?: string\n emptyText?: string\n }\n refresh?(): void\n unUpperConverted?: boolean // 不要转换表头\n unTooltip?: boolean // 不要tooltip\n smallPadding?: boolean // 缩小间距\n upperCaseIgnore?: string[]\n rowClassName?: (record: T, index: number) => string\n}\n\n// 判断是否是特殊的tooltip\n// const checkIsPrompt = (dom: any): boolean => {\n// let isPrompt: boolean = false\n// if (React.isValidElement(dom)) {\n// if (dom?.type && typeof dom?.type === 'function') {\n// if (['Tooltip', 'Popconfirm'].includes(dom?.type?.name)) {\n// isPrompt = true\n// }\n// }\n// }\n// return isPrompt\n// }\n\nexport const Table = <T,>({\n className,\n locale,\n bordered,\n size,\n storageKey,\n columns,\n children,\n sticky = false,\n shadowed,\n striped = true,\n showCellBorders = false,\n pagination,\n enableToolbar = false,\n refresh,\n upperCaseIgnore,\n unUpperConverted, // 强制不要转换\n unTooltip,\n smallPadding,\n rowClassName,\n ...rest\n}: TableProps<T>) => {\n const tableContainer = useRef<HTMLDivElement>(null)\n // const [innerSize, setInnerSize] = useLocalStorage<TableProps<T>['size']>(\n // TABLE_SIZE_STORAGE_KEY,\n // 'default'\n // )\n\n const normalizedColumns = useMemo(\n () => columns || normalizeColumns<T>(children as React.ReactChildren),\n [children, columns]\n )\n const [displayColumns, columnSetting, setColumnSetting] = useColumnSetting(\n normalizedColumns,\n storageKey\n )\n\n const getRowClassName = (prefixCls: string) => {\n if (striped || rowClassName || rest.rowSelection?.getCheckboxProps) {\n return (record: T, index: number) => {\n const back = []\n if (rowClassName) {\n if (isFunction(rowClassName)) {\n back.push(rowClassName(record, index))\n } else if (isString(rowClassName)) {\n back.push(rowClassName)\n }\n }\n if (striped && index % 2 === 1) {\n back.push(`${prefixCls}-row-even`)\n }\n // if (rest.rowSelection?.getCheckboxProps) {\n // const checkboxProps: any = rest.rowSelection.getCheckboxProps(record)\n // if (checkboxProps && checkboxProps.disabled) {\n // back.push(`${prefixCls}-row-disabled`)\n // }\n // }\n return back.join(' ')\n }\n }\n return rowClassName\n }\n const [fixedWidth, setFixedWidth] = useState(Number)\n\n const lang = getLanguage()\n let newColumns = displayColumns\n // 非中文做处理\n if (lang !== 'cn') {\n if (!unUpperConverted) {\n newColumns = displayColumns?.map((column) => {\n return {\n ...column,\n title: (options: {\n filters: TableStateFilters\n sortOrder?: SortOrder\n sortColumn?: ColumnProps<T> | null\n }) => {\n let title = column.title\n if (typeof title === 'function') {\n title = title(options)\n }\n\n if (React.isValidElement(title)) {\n const renderChildren = (children: [] | string): React.ReactNode => {\n if (React.isValidElement(children) || Array.isArray(children)) {\n return React?.Children?.map(children, (child) => {\n if (React.isValidElement(child)) {\n const childProps = (child.props || {}) as any\n return React.cloneElement(child, {\n ...childProps,\n children: childProps.children?.length\n ? renderChildren(childProps.children)\n : childProps.children,\n title: titleCaseUpper(childProps?.title, upperCaseIgnore),\n })\n } else {\n return titleCaseUpper(child, upperCaseIgnore)\n }\n })\n }\n return titleCaseUpper(children, upperCaseIgnore)\n }\n\n return React.cloneElement(title, {\n ...title.props,\n children: renderChildren(title.props.children),\n })\n }\n\n if (typeof title === 'string') {\n return titleCaseUpper(title, upperCaseIgnore)\n }\n },\n }\n })\n }\n if (!unTooltip) {\n newColumns = newColumns?.map((column) => {\n if (!(column.width && !String(column.width).includes('%'))) {\n return column\n } else {\n return {\n ...column,\n title: (options: {\n filters: TableStateFilters\n sortOrder?: SortOrder\n sortColumn?: ColumnProps<T> | null\n }) => {\n let title = column.title\n if (typeof title === 'function') {\n title = title(options)\n }\n\n let widthLimitObj = {}\n if (column.width && !String(column.width).includes('%')) {\n let width = column.width\n if (typeof width === 'string') {\n width = width?.replace(/[^\\d]/g, ' ')\n }\n widthLimitObj = {\n widthLimit:\n Number(width) -\n Number(sizeWidthMap[size || 'default']) -\n (column.sorter ? 20 : 0),\n }\n }\n return (\n <Ellipsis\n {...widthLimitObj}\n placement={column?.placement || 'topLeft'}\n title={title}\n />\n )\n },\n }\n }\n })\n }\n }\n\n /**\n * update the innerSize when props size changes\n */\n // useEffect(() => {\n // if (size) {\n // setInnerSize(size)\n // }\n // }, [setInnerSize, size])\n\n /**\n * expand 与 fix 兼容,expand悬浮\n */\n const [tableKey, trigger] = useExpandFixed()\n\n const stickyProps = useMemo(() => {\n return {\n onExpandedRowsChange: (arg: string[] | number[]) => {\n const key: keyType = arg && arg[arg.length - 1]\n if (rest?.onExpandedRowsChange) rest?.onExpandedRowsChange([Number(key)])\n // 触发MutationObserver监听\n trigger(key as string)\n },\n expandedRowRender: rest?.expandedRowRender\n ? (record: T, index: number, indent: number, expanded: boolean) => {\n const padding = 0\n return (\n <div className=\"ant-table-expanded-row-fixed\" style={{ width: fixedWidth + padding }}>\n {rest?.expandedRowRender &&\n rest?.expandedRowRender(record, index, indent, expanded)}\n </div>\n )\n }\n : undefined,\n }\n }, [rest?.expandedRowRender, rest?.onExpandedRowsChange, trigger])\n\n return (\n <TableContext.Provider\n value={{\n // size: innerSize,\n tableContainer,\n columnSetting,\n refresh,\n upperCaseIgnore,\n // setSize: setInnerSize,\n setColumnSetting,\n }}\n >\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('table')\n return (\n <div ref={tableContainer}>\n <LocaleReceiver componentName=\"Table\" defaultLocale={locale}>\n {(localeObject) => {\n // const locale = localeObject as Record<string, string>\n const paginationConfig =\n pagination !== false\n ? {\n ...(pagination || {}),\n hideOnSinglePage: pagination?.hideOnSinglePage === false ? false : true,\n }\n : pagination\n return (\n <ResizeObserver\n onResize={({ width }) => {\n setFixedWidth(width)\n }}\n >\n <AntdTable\n className={classNames(\n // prefixCls,\n 'tnt-table-wrapper',\n `${tableKey} collapse-panel`,\n {\n [`${prefixCls}-borderless`]: !bordered,\n [`${prefixCls}-bordered-out`]: !!bordered,\n [`${prefixCls}-hide-cell-borders`]: !showCellBorders,\n [`${prefixCls}-size-small`]: size === 'small',\n [`${prefixCls}-size-middle`]: size === 'middle',\n [`${prefixCls}-striped`]: striped,\n [`${prefixCls}-shadowed`]: shadowed,\n [`${prefixCls}-has-footer`]: rest.footer,\n [`${prefixCls}-small-padding`]: smallPadding,\n [`${prefixCls}-sticky`]: sticky,\n },\n className\n )}\n locale={locale}\n bordered={bordered}\n size={size}\n columns={newColumns}\n rowClassName={getRowClassName(prefixCls)}\n pagination={paginationConfig}\n {...rest}\n {...(sticky ? stickyProps : {})}\n />\n </ResizeObserver>\n )\n }}\n </LocaleReceiver>\n </div>\n )\n }}\n </ConfigConsumer>\n </TableContext.Provider>\n )\n}\n\nTable.Column = Column\nTable.ColumnGroup = ColumnGroup\nTable.displayName = 'Table'\nTable.titleCaseUpper = titleCaseUpper\n"]}
|