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
package/lib/array-input/index.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = WarpArrayInput;
|
|
8
|
-
var _sumBy2 = _interopRequireDefault(require("lodash/sumBy"));
|
|
9
8
|
var _sum2 = _interopRequireDefault(require("lodash/sum"));
|
|
10
9
|
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
11
10
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
@@ -26,20 +25,20 @@ var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
|
26
25
|
require("./index.less");
|
|
27
26
|
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); }
|
|
28
27
|
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; }
|
|
29
|
-
function _interopRequireDefault(
|
|
30
|
-
function _toConsumableArray(
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
29
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
31
30
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
-
function _iterableToArray(
|
|
33
|
-
function _arrayWithoutHoles(
|
|
34
|
-
function _defineProperty(
|
|
31
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
32
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
33
|
+
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; }
|
|
35
34
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
36
35
|
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); }
|
|
37
|
-
function _slicedToArray(
|
|
36
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
38
37
|
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."); }
|
|
39
|
-
function _unsupportedIterableToArray(
|
|
40
|
-
function _arrayLikeToArray(
|
|
38
|
+
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; } }
|
|
39
|
+
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; }
|
|
41
40
|
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; } }
|
|
42
|
-
function _arrayWithHoles(
|
|
41
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
43
42
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
44
43
|
var t = {};
|
|
45
44
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -50,9 +49,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
50
49
|
};
|
|
51
50
|
var Column = _table["default"].Column;
|
|
52
51
|
var RowContext = _react["default"].createContext({});
|
|
53
|
-
var getWidth = function getWidth(span) {
|
|
54
|
-
return 1000 / span;
|
|
55
|
-
};
|
|
56
52
|
var key = 1;
|
|
57
53
|
function DragHandle() {
|
|
58
54
|
var _useContext = (0, _react.useContext)(RowContext),
|
|
@@ -118,7 +114,11 @@ function ArrayInput(_ref) {
|
|
|
118
114
|
locale = _ref.locale,
|
|
119
115
|
_ref$xProps = _ref.xProps,
|
|
120
116
|
xProps = _ref$xProps === void 0 ? {} : _ref$xProps,
|
|
121
|
-
renderAction = _ref.renderAction
|
|
117
|
+
renderAction = _ref.renderAction,
|
|
118
|
+
_ref$actionWidth = _ref.actionWidth,
|
|
119
|
+
actionWidth = _ref$actionWidth === void 0 ? 80 : _ref$actionWidth,
|
|
120
|
+
_ref$disabled = _ref.disabled,
|
|
121
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
122
122
|
if (!(0, _isFunction2["default"])(children)) {
|
|
123
123
|
throw new Error(locale.error);
|
|
124
124
|
}
|
|
@@ -230,9 +230,10 @@ function ArrayInput(_ref) {
|
|
|
230
230
|
fieldChange && fieldChange(e, index, changeValue);
|
|
231
231
|
var newValue = e.target ? e.target.value : e;
|
|
232
232
|
changeValue(index, name, newValue);
|
|
233
|
-
}
|
|
233
|
+
},
|
|
234
|
+
disabled: disabled
|
|
234
235
|
}, other)));
|
|
235
|
-
}), _react["default"].createElement(_col["default"], {
|
|
236
|
+
}), !disabled && _react["default"].createElement(_col["default"], {
|
|
236
237
|
span: actionSpan
|
|
237
238
|
}, _react["default"].createElement("span", {
|
|
238
239
|
className: "tntd-array-input-action"
|
|
@@ -251,7 +252,7 @@ function ArrayInput(_ref) {
|
|
|
251
252
|
}, _react["default"].createElement(_icon["default"], {
|
|
252
253
|
type: "delete"
|
|
253
254
|
}))))));
|
|
254
|
-
}), _react["default"].createElement(_button["default"], {
|
|
255
|
+
}), !disabled && _react["default"].createElement(_button["default"], {
|
|
255
256
|
type: "link",
|
|
256
257
|
onClick: function onClick() {
|
|
257
258
|
return onAdd();
|
|
@@ -305,13 +306,14 @@ function ArrayInput(_ref) {
|
|
|
305
306
|
}), fields.map(function (field) {
|
|
306
307
|
var _ref3 = (field === null || field === void 0 ? void 0 : field.props) || {},
|
|
307
308
|
name = _ref3.name,
|
|
308
|
-
|
|
309
|
+
_ref3$width = _ref3.width,
|
|
310
|
+
width = _ref3$width === void 0 ? 160 : _ref3$width,
|
|
309
311
|
title = _ref3.title;
|
|
310
312
|
return _react["default"].createElement(Column, {
|
|
311
313
|
key: name,
|
|
312
314
|
dataIndex: name,
|
|
313
315
|
title: title,
|
|
314
|
-
width:
|
|
316
|
+
width: width,
|
|
315
317
|
render: function render(field, row, index) {
|
|
316
318
|
if (!(0, _react.isValidElement)(field)) {
|
|
317
319
|
return field;
|
|
@@ -323,15 +325,16 @@ function ArrayInput(_ref) {
|
|
|
323
325
|
fieldChange && fieldChange(e, index, changeValue);
|
|
324
326
|
var newValue = e.target ? e.target.value : e;
|
|
325
327
|
changeValue(index, name, newValue);
|
|
326
|
-
}
|
|
328
|
+
},
|
|
329
|
+
disabled: disabled
|
|
327
330
|
});
|
|
328
331
|
}
|
|
329
332
|
});
|
|
330
|
-
}), _react["default"].createElement(Column, {
|
|
333
|
+
}), !disabled && _react["default"].createElement(Column, {
|
|
331
334
|
key: "action",
|
|
332
335
|
dataIndex: "action",
|
|
333
336
|
title: locale.action,
|
|
334
|
-
width:
|
|
337
|
+
width: actionWidth,
|
|
335
338
|
render: function render(text, row, index) {
|
|
336
339
|
if (renderAction) {
|
|
337
340
|
return renderAction(row, index, onDelete, onAdd);
|
|
@@ -354,7 +357,7 @@ function ArrayInput(_ref) {
|
|
|
354
357
|
type: "delete"
|
|
355
358
|
})));
|
|
356
359
|
}
|
|
357
|
-
})))), _react["default"].createElement(_button["default"], {
|
|
360
|
+
})))), !disabled && _react["default"].createElement(_button["default"], {
|
|
358
361
|
type: "dashed",
|
|
359
362
|
block: true,
|
|
360
363
|
className: "mt10",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/array-input/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA0C;AAC1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AAE,QAAQ,EAAE,KAAK,CAAC,CAAA;iCACjD;gCACD,OAAO,CACL,wCAAM,SAAS,EAAC,yBAAyB,IACtC,SAAS,CAAC,CAAC,CAAC,CACX,8BAAC,iBAAO,IAAC,KAAK,EAAE,SAAS;oCACvB,wCAAM,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;wCAClC,8BAAC,cAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,CACjB,CACC,CACX,CAAC,CAAC,CAAC,CACF,wCAAM,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;oCAClC,8BAAC,cAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,CACjB,CACR,CACI,CACR,CAAA;4BACH,CAAC,GACO,CACJ,CACQ,CACP;YACb,8BAAC,gBAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,QAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE;gBACjE,8BAAC,cAAI,IAAC,IAAI,EAAC,MAAM,GAAG;gBACnB,OAAO,CACD,CACL,CACP,CAAA;KACF;AACH,CAAC;AAED,SAAwB,cAAc,CAAC,KAAK;IAC1C,OAAO,CACL,8BAAC,wBAAc,IAAC,aAAa,EAAC,YAAY,IACvC,CAAC,MAAM,EAAE,EAAE;QACV,OAAO,8BAAC,UAAU,oBAAK,KAAK,IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;IAClD,CAAC,CACc,CAClB,CAAA;AACH,CAAC;AARD,iCAQC","sourcesContent":["import { DndContext } from '@dnd-kit/core'\nimport { restrictToVerticalAxis } from '@dnd-kit/modifiers'\nimport {\n SortableContext,\n arrayMove,\n useSortable,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable'\nimport { CSS } from '@dnd-kit/utilities'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport { get, isArray, isFunction, set, sum, sumBy } from 'lodash'\nimport React, { isValidElement, useCallback, useContext, useEffect, useMemo, useState } from 'react'\nimport Button from '../button'\nimport Col from '../col'\nimport Icon from '../icon'\nimport Row from '../row'\nimport Table from '../table'\nimport Tooltip from '../tooltip'\nimport './index.less'\n\nconst { Column } = Table\nconst RowContext = React.createContext({})\nconst getWidth = (span) => 1000 / span\nlet key = 1\n\nfunction DragHandle() {\n const { setActivatorNodeRef, listeners } = useContext(RowContext)\n return (\n <Button\n className=\"drag-btn\"\n type=\"tertiary\"\n size=\"small\"\n icon=\"drag\"\n ref={setActivatorNodeRef}\n {...listeners}\n />\n )\n}\nfunction BodyRow(props) {\n const {\n attributes,\n listeners,\n setNodeRef,\n setActivatorNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id: props['data-row-key'],\n })\n const style = {\n ...props.style,\n transform: CSS.Translate.toString(transform),\n transition,\n ...(isDragging\n ? {\n position: 'relative',\n zIndex: 9999,\n }\n : {}),\n }\n const contextValue = useMemo(\n () => ({\n setActivatorNodeRef,\n listeners,\n }),\n [setActivatorNodeRef, listeners]\n )\n return (\n <RowContext.Provider value={contextValue}>\n <tr {...props} ref={setNodeRef} style={style} {...attributes} />\n </RowContext.Provider>\n )\n}\n\nfunction ArrayInput({\n children,\n defaultValue,\n value,\n onChange,\n mode = 'list',\n drag = false, // 只做了table的拖拽排序\n gutter = 10,\n require = false,\n deleteTip = '',\n plusTip = '',\n addText,\n locale,\n xProps = {},\n renderAction,\n}) {\n if (!isFunction(children)) {\n throw new Error(locale.error)\n }\n if (addText === undefined) {\n addText = locale?.add\n }\n\n const [_value, setValue] = useState(value || defaultValue)\n\n useEffect(() => {\n let newValue = value\n // 如果数组没有key\n if (Array.isArray(value) && value.some((obj) => !obj.key)) {\n newValue = value.map((obj) => ({ ...obj, key: obj.key || key++ }))\n _onChange(newValue)\n } else {\n setValue(newValue)\n }\n }, [value])\n\n const _onChange = useCallback((value) => {\n if (onChange) {\n onChange(value)\n } else {\n setValue(value)\n }\n }, [])\n\n let inValue = _value || []\n if (require && inValue.length === 0) {\n inValue = [{ key: key++ }]\n }\n\n const changeValue = (index, name, value) => {\n inValue[index] = {\n ...inValue[index],\n [name]: value,\n }\n _onChange([...inValue])\n }\n\n const onAdd = (index) => {\n if (index === undefined) {\n _onChange([...inValue, { key: key++ }])\n } else {\n inValue.splice(index + 1, 0, { key: key++ })\n _onChange([...inValue])\n }\n }\n\n const onDelete = (i) => {\n inValue.splice(i, 1)\n _onChange([...inValue])\n }\n\n const onDragEnd = ({ active, over }) => {\n if (active.id !== over?.id) {\n _onChange((prevState) => {\n const activeIndex = prevState.findIndex((record) => record.key === active?.id)\n const overIndex = prevState.findIndex((record) => record.key === over?.id)\n return arrayMove(prevState, activeIndex, overIndex)\n })\n }\n }\n\n if (mode === 'list') {\n return (\n <div className=\"tntd-array-input\">\n {inValue.map((item, index) => {\n let fields = children(item, index)\n if (!isArray(fields)) {\n fields = get(fields, 'props.children', [])\n }\n const actionSpan = 24 - (sum(fields.map((f) => get(f, 'props.span', 4))) % 24)\n return (\n <Row gutter={gutter} key={index} className=\"tntd-array-input-item\">\n {fields.map((field, i) => {\n if (!isValidElement(field)) {\n return field ? (\n <Col span={4} key={i}>\n {field}\n </Col>\n ) : (\n ''\n )\n }\n const { name, span = 4, onChange: fieldChange, ...other } = field?.props\n return (\n <Col span={span} key={i}>\n {React.cloneElement(field, {\n value: item[name] || undefined,\n onChange: (e) => {\n fieldChange && fieldChange(e, index, changeValue)\n const newValue = e.target ? e.target.value : e\n changeValue(index, name, newValue)\n },\n ...other,\n })}\n </Col>\n )\n })}\n <Col span={actionSpan}>\n <span className=\"tntd-array-input-action\">\n {renderAction ? (\n renderAction(item, index, onDelete, onAdd)\n ) : (\n <>\n {deleteTip ? (\n <Tooltip title={deleteTip}>\n <span onClick={() => onDelete(index)}>\n <Icon type=\"delete\" />\n </span>\n </Tooltip>\n ) : (\n <span onClick={() => onDelete(index)}>\n <Icon type=\"delete\" />\n </span>\n )}\n </>\n )}\n </span>\n </Col>\n </Row>\n )\n })}\n <Button type=\"link\" onClick={() => onAdd()}>\n <Icon type=\"plus\" />\n {addText}\n </Button>\n </div>\n )\n } else {\n let fields = children({}, 0)\n if (!isArray(fields)) {\n fields = get(fields, 'props.children', [])\n }\n const dataSource = inValue.map((value, index) => {\n const fields = children(value, index)\n const back = { key: value.key }\n fields.forEach((field) => {\n const name = field?.props?.name\n name && set(back, name, field)\n })\n return back\n })\n\n return (\n <div className=\"tntd-array-input\">\n <DndContext modifiers={[restrictToVerticalAxis]} onDragEnd={onDragEnd}>\n <SortableContext\n items={dataSource.map((i) => i.key)}\n strategy={verticalListSortingStrategy}\n >\n <Table\n dataSource={dataSource}\n pagination={false}\n components={{\n body: {\n row: BodyRow,\n },\n }}\n bordered\n {...xProps}\n >\n {drag && (\n <Column\n key=\"dragger\"\n dataIndex=\"dragger\"\n width={60}\n render={() => <DragHandle />}\n ></Column>\n )}\n {fields.map((field) => {\n const { name, span, title } = field?.props || {}\n return (\n <Column\n key={name}\n dataIndex={name}\n title={title}\n width={getWidth(span || 24 / (fields.length + 1))}\n render={(field, row, index) => {\n if (!isValidElement(field)) {\n return field\n }\n const { onChange: fieldChange } = field.props\n return React.cloneElement(field, {\n value: inValue[index][name] || undefined,\n onChange: (e) => {\n fieldChange && fieldChange(e, index, changeValue)\n const newValue = e.target ? e.target.value : e\n changeValue(index, name, newValue)\n },\n })\n }}\n ></Column>\n )\n })}\n <Column\n key=\"action\"\n dataIndex=\"action\"\n title={locale.action}\n width={getWidth(24 - (sumBy(fields, 'props.span') % 24))}\n render={(text, row, index) => {\n if (renderAction) {\n return renderAction(row, index, onDelete, onAdd)\n }\n return (\n <span className=\"tntd-array-input-action\">\n {deleteTip ? (\n <Tooltip title={deleteTip}>\n <span onClick={() => onDelete(index)}>\n <Icon type=\"delete\" />\n </span>\n </Tooltip>\n ) : (\n <span onClick={() => onDelete(index)}>\n <Icon type=\"delete\" />\n </span>\n )}\n </span>\n )\n }}\n ></Column>\n </Table>\n </SortableContext>\n </DndContext>\n <Button type=\"dashed\" block className=\"mt10\" onClick={() => onAdd()}>\n <Icon type=\"plus\" />\n {addText}\n </Button>\n </div>\n )\n }\n}\n\nexport default function WarpArrayInput(props) {\n return (\n <LocaleReceiver componentName=\"ArrayInput\">\n {(locale) => {\n return <ArrayInput {...props} locale={locale} />\n }}\n </LocaleReceiver>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/array-input/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA0C;AAC1C,kDAA2D;AAC3D,gDAK0B;AAC1B,kDAAwC;AACxC,4FAAmE;AACnE,mCAAkE;AAClE,+CAAoG;AACpG,uDAA8B;AAC9B,iDAAwB;AACxB,mDAA0B;AAC1B,iDAAwB;AACxB,qDAA4B;AAC5B,yDAAgC;AAChC,wBAAqB;AAErB,MAAM,EAAE,MAAM,EAAE,GAAG,eAAK,CAAA;AACxB,MAAM,UAAU,GAAG,eAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;AAC1C,IAAI,GAAG,GAAG,CAAC,CAAA;AAEX,SAAS,UAAU;IACjB,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAA;IACjE,OAAO,CACL,8BAAC,gBAAM,kBACL,SAAS,EAAC,UAAU,EACpB,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,mBAAmB,IACpB,SAAS,EACb,CACH,CAAA;AACH,CAAC;AACD,SAAS,OAAO,CAAC,KAAK;IACpB,MAAM,EACJ,UAAU,EACV,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,UAAU,GACX,GAAG,IAAA,sBAAW,EAAC;QACd,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC;KAC1B,CAAC,CAAA;IACF,MAAM,KAAK,iD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AA;IAClD,CAAC,CACc,CAClB,CAAA;AACH,CAAC;AARD,iCAQC","sourcesContent":["import { DndContext } from '@dnd-kit/core'\nimport { restrictToVerticalAxis } from '@dnd-kit/modifiers'\nimport {\n SortableContext,\n arrayMove,\n useSortable,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable'\nimport { CSS } from '@dnd-kit/utilities'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport { get, isArray, isFunction, set, sum, sumBy } from 'lodash'\nimport React, { isValidElement, useCallback, useContext, useEffect, useMemo, useState } from 'react'\nimport Button from '../button'\nimport Col from '../col'\nimport Icon from '../icon'\nimport Row from '../row'\nimport Table from '../table'\nimport Tooltip from '../tooltip'\nimport './index.less'\n\nconst { Column } = Table\nconst RowContext = React.createContext({})\nlet key = 1\n\nfunction DragHandle() {\n const { setActivatorNodeRef, listeners } = useContext(RowContext)\n return (\n <Button\n className=\"drag-btn\"\n type=\"tertiary\"\n size=\"small\"\n icon=\"drag\"\n ref={setActivatorNodeRef}\n {...listeners}\n />\n )\n}\nfunction BodyRow(props) {\n const {\n attributes,\n listeners,\n setNodeRef,\n setActivatorNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id: props['data-row-key'],\n })\n const style = {\n ...props.style,\n transform: CSS.Translate.toString(transform),\n transition,\n ...(isDragging\n ? {\n position: 'relative',\n zIndex: 9999,\n }\n : {}),\n }\n const contextValue = useMemo(\n () => ({\n setActivatorNodeRef,\n listeners,\n }),\n [setActivatorNodeRef, listeners]\n )\n return (\n <RowContext.Provider value={contextValue}>\n <tr {...props} ref={setNodeRef} style={style} {...attributes} />\n </RowContext.Provider>\n )\n}\n\nfunction ArrayInput({\n children,\n defaultValue,\n value,\n onChange,\n mode = 'list',\n drag = false, // 只做了table的拖拽排序\n gutter = 10,\n require = false,\n deleteTip = '',\n plusTip = '',\n addText,\n locale,\n xProps = {},\n renderAction,\n actionWidth = 80,\n disabled = false,\n}) {\n if (!isFunction(children)) {\n throw new Error(locale.error)\n }\n if (addText === undefined) {\n addText = locale?.add\n }\n\n const [_value, setValue] = useState(value || defaultValue)\n\n useEffect(() => {\n let newValue = value\n // 如果数组没有key\n if (Array.isArray(value) && value.some((obj) => !obj.key)) {\n newValue = value.map((obj) => ({ ...obj, key: obj.key || key++ }))\n _onChange(newValue)\n } else {\n setValue(newValue)\n }\n }, [value])\n\n const _onChange = useCallback((value) => {\n if (onChange) {\n onChange(value)\n } else {\n setValue(value)\n }\n }, [])\n\n let inValue = _value || []\n if (require && inValue.length === 0) {\n inValue = [{ key: key++ }]\n }\n\n const changeValue = (index, name, value) => {\n inValue[index] = {\n ...inValue[index],\n [name]: value,\n }\n _onChange([...inValue])\n }\n\n const onAdd = (index) => {\n if (index === undefined) {\n _onChange([...inValue, { key: key++ }])\n } else {\n inValue.splice(index + 1, 0, { key: key++ })\n _onChange([...inValue])\n }\n }\n\n const onDelete = (i) => {\n inValue.splice(i, 1)\n _onChange([...inValue])\n }\n\n const onDragEnd = ({ active, over }) => {\n if (active.id !== over?.id) {\n _onChange((prevState) => {\n const activeIndex = prevState.findIndex((record) => record.key === active?.id)\n const overIndex = prevState.findIndex((record) => record.key === over?.id)\n return arrayMove(prevState, activeIndex, overIndex)\n })\n }\n }\n\n if (mode === 'list') {\n return (\n <div className=\"tntd-array-input\">\n {inValue.map((item, index) => {\n let fields = children(item, index)\n if (!isArray(fields)) {\n fields = get(fields, 'props.children', [])\n }\n const actionSpan = 24 - (sum(fields.map((f) => get(f, 'props.span', 4))) % 24)\n return (\n <Row gutter={gutter} key={index} className=\"tntd-array-input-item\">\n {fields.map((field, i) => {\n if (!isValidElement(field)) {\n return field ? (\n <Col span={4} key={i}>\n {field}\n </Col>\n ) : (\n ''\n )\n }\n const { name, span = 4, onChange: fieldChange, ...other } = field?.props\n return (\n <Col span={span} key={i}>\n {React.cloneElement(field, {\n value: item[name] || undefined,\n onChange: (e) => {\n fieldChange && fieldChange(e, index, changeValue)\n const newValue = e.target ? e.target.value : e\n changeValue(index, name, newValue)\n },\n disabled,\n ...other,\n })}\n </Col>\n )\n })}\n {!disabled && (\n <Col span={actionSpan}>\n <span className=\"tntd-array-input-action\">\n {renderAction ? (\n renderAction(item, index, onDelete, onAdd)\n ) : (\n <>\n {deleteTip ? (\n <Tooltip title={deleteTip}>\n <span onClick={() => onDelete(index)}>\n <Icon type=\"delete\" />\n </span>\n </Tooltip>\n ) : (\n <span onClick={() => onDelete(index)}>\n <Icon type=\"delete\" />\n </span>\n )}\n </>\n )}\n </span>\n </Col>\n )}\n </Row>\n )\n })}\n {!disabled && (\n <Button type=\"link\" onClick={() => onAdd()}>\n <Icon type=\"plus\" />\n {addText}\n </Button>\n )}\n </div>\n )\n } else {\n let fields = children({}, 0)\n if (!isArray(fields)) {\n fields = get(fields, 'props.children', [])\n }\n const dataSource = inValue.map((value, index) => {\n const fields = children(value, index)\n const back = { key: value.key }\n fields.forEach((field) => {\n const name = field?.props?.name\n name && set(back, name, field)\n })\n return back\n })\n\n return (\n <div className=\"tntd-array-input\">\n <DndContext modifiers={[restrictToVerticalAxis]} onDragEnd={onDragEnd}>\n <SortableContext\n items={dataSource.map((i) => i.key)}\n strategy={verticalListSortingStrategy}\n >\n <Table\n dataSource={dataSource}\n pagination={false}\n components={{\n body: {\n row: BodyRow,\n },\n }}\n bordered\n {...xProps}\n >\n {drag && (\n <Column\n key=\"dragger\"\n dataIndex=\"dragger\"\n width={60}\n render={() => <DragHandle />}\n ></Column>\n )}\n {fields.map((field) => {\n const { name, width = 160, title } = field?.props || {}\n return (\n <Column\n key={name}\n dataIndex={name}\n title={title}\n width={width}\n render={(field, row, index) => {\n if (!isValidElement(field)) {\n return field\n }\n const { onChange: fieldChange } = field.props\n return React.cloneElement(field, {\n value: inValue[index][name] || undefined,\n onChange: (e) => {\n fieldChange && fieldChange(e, index, changeValue)\n const newValue = e.target ? e.target.value : e\n changeValue(index, name, newValue)\n },\n disabled,\n })\n }}\n ></Column>\n )\n })}\n {!disabled && (\n <Column\n key=\"action\"\n dataIndex=\"action\"\n title={locale.action}\n width={actionWidth}\n render={(text, row, index) => {\n if (renderAction) {\n return renderAction(row, index, onDelete, onAdd)\n }\n return (\n <span className=\"tntd-array-input-action\">\n {deleteTip ? (\n <Tooltip title={deleteTip}>\n <span onClick={() => onDelete(index)}>\n <Icon type=\"delete\" />\n </span>\n </Tooltip>\n ) : (\n <span onClick={() => onDelete(index)}>\n <Icon type=\"delete\" />\n </span>\n )}\n </span>\n )\n }}\n ></Column>\n )}\n </Table>\n </SortableContext>\n </DndContext>\n {!disabled && (\n <Button type=\"dashed\" block className=\"mt10\" onClick={() => onAdd()}>\n <Icon type=\"plus\" />\n {addText}\n </Button>\n )}\n </div>\n )\n }\n}\n\nexport default function WarpArrayInput(props) {\n return (\n <LocaleReceiver componentName=\"ArrayInput\">\n {(locale) => {\n return <ArrayInput {...props} locale={locale} />\n }}\n </LocaleReceiver>\n )\n}\n"]}
|
package/lib/button/button.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ButtonProps as AntdButtonProps } from 'antd/lib/button';
|
|
2
|
+
import type { ButtonProps as AntdButtonProps, ButtonGroupProps as AntdButtonGroupProps, ButtonType } from 'antd/lib/button';
|
|
3
3
|
import { default as AntdButton } from 'antd/lib/button';
|
|
4
4
|
export * from 'antd/lib/button';
|
|
5
|
-
export
|
|
6
|
-
export interface ButtonProps extends AntdButtonProps {
|
|
5
|
+
export declare type TntButtonType = ButtonType | 'tertiary';
|
|
6
|
+
export interface ButtonProps extends Omit<AntdButtonProps, 'size' | 'type'> {
|
|
7
7
|
upperCaseIgnore?: [];
|
|
8
8
|
unUpperConverted?: boolean;
|
|
9
|
+
size?: 'large' | 'default' | 'small' | 'mini';
|
|
10
|
+
type?: 'default' | 'primary' | 'tertiary' | 'ghost' | 'dashed' | 'danger' | 'link';
|
|
11
|
+
}
|
|
12
|
+
export interface ButtonGroupProps extends Omit<AntdButtonGroupProps, 'size'> {
|
|
13
|
+
size?: 'large' | 'default' | 'small' | 'mini';
|
|
9
14
|
}
|
|
10
15
|
interface ButtonComponent extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<AntdButton>> {
|
|
11
|
-
Group:
|
|
16
|
+
Group: React.FC<ButtonGroupProps>;
|
|
12
17
|
}
|
|
13
18
|
export declare const Button: ButtonComponent;
|
|
14
19
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,gBAAgB,IAAI,oBAAoB,EACxC,UAAU,EACX,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAItD,cAAc,gBAAgB,CAAA;AAE9B,oBAAY,aAAa,GAAG,UAAU,GAAG,UAAU,CAAA;AACnD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IACzE,eAAe,CAAC,EAAE,EAAE,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;CACnF;AACD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC1E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;CAC9C;AAED,UAAU,eACR,SAAQ,KAAK,CAAC,yBAAyB,CAAC,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACtF,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAA;CAClC;AAID,eAAO,MAAM,MAAM,iBA0BC,CAAA"}
|
package/lib/button/button.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -23,8 +22,14 @@ Object.keys(_button).forEach(function (key) {
|
|
|
23
22
|
});
|
|
24
23
|
});
|
|
25
24
|
var _lang = require("../utils/lang");
|
|
25
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
26
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
26
27
|
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); }
|
|
27
28
|
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; }
|
|
29
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
30
|
+
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; }
|
|
31
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
32
|
+
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); }
|
|
28
33
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
29
34
|
var t = {};
|
|
30
35
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -42,11 +47,15 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
42
47
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
43
48
|
*/
|
|
44
49
|
|
|
50
|
+
var tntPrefixCls = 'tnt-btn';
|
|
45
51
|
var Button = exports.Button = (0, _react.forwardRef)(function (_a, ref) {
|
|
46
|
-
var
|
|
52
|
+
var className = _a.className,
|
|
53
|
+
size = _a.size,
|
|
54
|
+
type = _a.type,
|
|
55
|
+
children = _a.children,
|
|
47
56
|
unUpperConverted = _a.unUpperConverted,
|
|
48
57
|
upperCaseIgnore = _a.upperCaseIgnore,
|
|
49
|
-
rest = __rest(_a, ["children", "unUpperConverted", "upperCaseIgnore"]);
|
|
58
|
+
rest = __rest(_a, ["className", "size", "type", "children", "unUpperConverted", "upperCaseIgnore"]);
|
|
50
59
|
var newChildren = children;
|
|
51
60
|
if (!unUpperConverted) {
|
|
52
61
|
newChildren = (0, _lang.doUpperTitle)(newChildren, upperCaseIgnore);
|
|
@@ -54,9 +63,24 @@ var Button = exports.Button = (0, _react.forwardRef)(function (_a, ref) {
|
|
|
54
63
|
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref) {
|
|
55
64
|
var getPrefixCls = _ref.getPrefixCls;
|
|
56
65
|
return _react["default"].createElement(_button["default"], Object.assign({}, rest, {
|
|
66
|
+
type: type === 'tertiary' ? undefined : type,
|
|
67
|
+
size: size === 'mini' ? undefined : size,
|
|
68
|
+
className: (0, _classnames["default"])(className, tntPrefixCls, _defineProperty(_defineProperty({}, "".concat(tntPrefixCls, "-mini"), size === 'mini'), "".concat(tntPrefixCls, "-tertiary"), type === 'tertiary')),
|
|
57
69
|
children: newChildren,
|
|
58
70
|
ref: ref
|
|
59
71
|
}));
|
|
60
72
|
});
|
|
61
73
|
});
|
|
62
|
-
|
|
74
|
+
var ButtonGroup = function ButtonGroup(_a) {
|
|
75
|
+
var className = _a.className,
|
|
76
|
+
size = _a.size,
|
|
77
|
+
rest = __rest(_a, ["className", "size"]);
|
|
78
|
+
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref2) {
|
|
79
|
+
var getPrefixCls = _ref2.getPrefixCls;
|
|
80
|
+
return _react["default"].createElement(_button["default"].Group, Object.assign({}, rest, {
|
|
81
|
+
size: size === 'mini' ? undefined : size,
|
|
82
|
+
className: (0, _classnames["default"])(className, _defineProperty({}, "".concat(tntPrefixCls, "-group-mini"), size === 'mini'))
|
|
83
|
+
}));
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
Button.Group = ButtonGroup;
|
package/lib/button/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAyC;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAyC;AAMzC,wDAAmD;AACnD,4DAAsD;AACtD,wCAA4C;AAC5C,4DAAmC;AAEnC,iDAA8B;AAkB9B,MAAM,YAAY,GAAG,SAAS,CAAA;AAEjB,QAAA,MAAM,GAAG,IAAA,kBAAU,EAC9B,CAAC,EAA+E,EAAE,GAAG,EAAE,EAAE;QAAxF,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,OAAW,EAAN,IAAI,cAA7E,gFAA+E,CAAF;IAC5E,IAAI,WAAW,GAAG,QAAQ,CAAA;IAC1B,IAAI,CAAC,gBAAgB,EAAE;QACrB,WAAW,GAAG,IAAA,mBAAY,EAAC,WAAW,EAAE,eAAe,CAAC,CAAA;KACzD;IACD,OAAO,CACL,8BAAC,gCAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,OAAO,CACL,8BAAC,gBAAU,oBACL,IAAI,IACR,IAAI,EAAE,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAC5C,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACxC,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,YAAY,EAAE;gBAC7C,CAAC,GAAG,YAAY,OAAO,CAAC,EAAE,IAAI,KAAK,MAAM;gBACzC,CAAC,GAAG,YAAY,WAAW,CAAC,EAAE,IAAI,KAAK,UAAU;aAClD,CAAC,EACF,QAAQ,EAAE,WAAW,EACrB,GAAG,EAAE,GAAG,IACR,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACiB,CAAA;AAEpB,MAAM,WAAW,GAA+B,CAAC,EAA4B,EAAE,EAAE;QAAhC,EAAE,SAAS,EAAE,IAAI,OAAW,EAAN,IAAI,cAA1B,qBAA4B,CAAF;IACzE,OAAO,CACL,8BAAC,gCAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,OAAO,CACL,8BAAC,gBAAU,CAAC,KAAK,oBACX,IAAI,IACR,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACxC,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE;gBAC/B,CAAC,GAAG,YAAY,aAAa,CAAC,EAAE,IAAI,KAAK,MAAM;aAChD,CAAC,IACF,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,cAAM,CAAC,KAAK,GAAG,WAAW,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2023-10-26 09:46:28\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2023-10-31 09:59:35\n * @FilePath: /tntd/packages/tntd/src/button/button.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { forwardRef } from 'react'\nimport type {\n ButtonProps as AntdButtonProps,\n ButtonGroupProps as AntdButtonGroupProps,\n ButtonType,\n} from 'antd/lib/button'\nimport { ConfigConsumer } from '../config-provider'\nimport { default as AntdButton } from 'antd/lib/button'\nimport { doUpperTitle } from '../utils/lang'\nimport classNames from 'classnames'\n\nexport * from 'antd/lib/button'\n\nexport type TntButtonType = ButtonType | 'tertiary'\nexport interface ButtonProps extends Omit<AntdButtonProps, 'size' | 'type'> {\n upperCaseIgnore?: []\n unUpperConverted?: boolean\n size?: 'large' | 'default' | 'small' | 'mini'\n type?: 'default' | 'primary' | 'tertiary' | 'ghost' | 'dashed' | 'danger' | 'link'\n}\nexport interface ButtonGroupProps extends Omit<AntdButtonGroupProps, 'size'> {\n size?: 'large' | 'default' | 'small' | 'mini'\n}\n\ninterface ButtonComponent\n extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<AntdButton>> {\n Group: React.FC<ButtonGroupProps>\n}\n\nconst tntPrefixCls = 'tnt-btn'\n\nexport const Button = forwardRef<AntdButton, ButtonProps>(\n ({ className, size, type, children, unUpperConverted, upperCaseIgnore, ...rest }, ref) => {\n let newChildren = children\n if (!unUpperConverted) {\n newChildren = doUpperTitle(newChildren, upperCaseIgnore)\n }\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <AntdButton\n {...rest}\n type={type === 'tertiary' ? undefined : type}\n size={size === 'mini' ? undefined : size}\n className={classNames(className, tntPrefixCls, {\n [`${tntPrefixCls}-mini`]: size === 'mini',\n [`${tntPrefixCls}-tertiary`]: type === 'tertiary',\n })}\n children={newChildren}\n ref={ref}\n />\n )\n }}\n </ConfigConsumer>\n )\n }\n) as ButtonComponent\n\nconst ButtonGroup: React.FC<ButtonGroupProps> = ({ className, size, ...rest }) => {\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <AntdButton.Group\n {...rest}\n size={size === 'mini' ? undefined : size}\n className={classNames(className, {\n [`${tntPrefixCls}-group-mini`]: size === 'mini',\n })}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nButton.Group = ButtonGroup\n"]}
|
package/lib/button/button.less
CHANGED
|
@@ -1,7 +1,77 @@
|
|
|
1
|
+
@import './style/mixin.less';
|
|
2
|
+
@import '../style/mixins/size.less';
|
|
3
|
+
|
|
1
4
|
@btn-prefix-cls: ~'@{ant-prefix}-btn';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
.tnt-btn {
|
|
7
|
+
&.tnt-btn-mini {
|
|
8
|
+
.button-size(@btn-height-mini; @btn-padding-mini; @btn-font-size-mini; @btn-border-radius-sm);
|
|
9
|
+
&.@{btn-prefix-cls}-icon-only {
|
|
10
|
+
.square(@btn-height-mini);
|
|
11
|
+
padding-right: 0;
|
|
12
|
+
padding-left: 0;
|
|
13
|
+
}
|
|
14
|
+
&.@{btn-prefix-cls}-circle {
|
|
15
|
+
min-width: @btn-height-mini;
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
}
|
|
18
|
+
&.@{btn-prefix-cls}-round {
|
|
19
|
+
.button-size(@btn-circle-size-mini; 0 @btn-circle-size-mini / 2; @btn-font-size-mini; @btn-circle-size-mini);
|
|
20
|
+
&.@{btn-prefix-cls}-icon-only {
|
|
21
|
+
width: auto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
&-group-mini {
|
|
26
|
+
& > .@{btn-prefix-cls},
|
|
27
|
+
& > span > .@{btn-prefix-cls} {
|
|
28
|
+
.button-size(@btn-height-mini; @btn-padding-mini; @btn-font-size-mini; 0);
|
|
29
|
+
line-height: calc(@btn-height-mini - 2px);
|
|
30
|
+
}
|
|
31
|
+
& > .@{btn-prefix-cls}.@{btn-prefix-cls}-icon-only {
|
|
32
|
+
.square(@btn-height-mini);
|
|
33
|
+
padding-right: 0;
|
|
34
|
+
padding-left: 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
&-tertiary {
|
|
38
|
+
.button-variant-tertiary(@btn-default-color, @primary-color, @btn-tertiary-bg);
|
|
39
|
+
}
|
|
40
|
+
&.@{btn-prefix-cls}-primary {
|
|
41
|
+
.button-disabled(@btn-primary-color, @blue-3, @blue-3);
|
|
42
|
+
}
|
|
43
|
+
&.@{btn-prefix-cls}-danger {
|
|
44
|
+
.button-disabled(@btn-primary-color, @red-3, @red-3);
|
|
45
|
+
}
|
|
46
|
+
&.@{btn-prefix-cls}-link {
|
|
47
|
+
.button-disabled(@blue-3, transparent, transparent);
|
|
5
48
|
padding: 0;
|
|
6
49
|
}
|
|
50
|
+
> .@{iconfont-css-prefix} + span,
|
|
51
|
+
> span + .@{iconfont-css-prefix} {
|
|
52
|
+
margin-left: 4px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.button-variant-tertiary(@color; @hover-color; @background) {
|
|
57
|
+
.button-color(@color; @background; @background);
|
|
58
|
+
|
|
59
|
+
text-shadow: @btn-text-shadow;
|
|
60
|
+
box-shadow: @btn-primary-shadow;
|
|
61
|
+
|
|
62
|
+
&:hover,
|
|
63
|
+
&:focus {
|
|
64
|
+
.button-color(
|
|
65
|
+
@hover-color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:active,
|
|
70
|
+
&.active {
|
|
71
|
+
.button-color(
|
|
72
|
+
@hover-color; ~`colorPalette('@{background}', 6) `; ~`colorPalette('@{background}', 6) `
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.button-disabled(@btn-disable-color; @btn-disable-bg; transparent);
|
|
7
77
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CascaderProps as AntdCascaderProps } from 'antd/lib/cascader';
|
|
2
|
+
import AntdCascader from 'antd/lib/cascader';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export * from 'antd/lib/cascader';
|
|
5
|
+
export declare type CascaderProps = AntdCascaderProps & {
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<AntdCascaderProps & React.RefAttributes<AntdCascader>, "key" | keyof AntdCascaderProps> & React.RefAttributes<unknown>>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=cascader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascader.d.ts","sourceRoot":"","sources":["../../src/cascader/cascader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,YAAY,MAAM,kBAAkB,CAAA;AAG3C,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,cAAc,kBAAkB,CAAA;AAEhC,oBAAY,aAAa,GAAG,iBAAiB,GAAG;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;;AAuBD,wBAAuE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
var _exportNames = {};
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _cascader = _interopRequireWildcard(require("antd/lib/cascader"));
|
|
10
|
+
Object.keys(_cascader).forEach(function (key) {
|
|
11
|
+
if (key === "default" || key === "__esModule") return;
|
|
12
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
13
|
+
if (key in exports && exports[key] === _cascader[key]) return;
|
|
14
|
+
Object.defineProperty(exports, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _cascader[key];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
var _configProvider = require("antd/lib/config-provider");
|
|
22
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
24
|
+
var _connect = require("../connect");
|
|
25
|
+
var _previewText = require("../preview-text");
|
|
26
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
27
|
+
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); }
|
|
28
|
+
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; }
|
|
29
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
30
|
+
var t = {};
|
|
31
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
32
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
};
|
|
37
|
+
var tntPrefixCls = 'tnt-cascader';
|
|
38
|
+
var Cascader = (0, _react.forwardRef)(function (_a, ref) {
|
|
39
|
+
var className = _a.className,
|
|
40
|
+
children = _a.children,
|
|
41
|
+
rest = __rest(_a, ["className", "children"]);
|
|
42
|
+
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function () {
|
|
43
|
+
return _react["default"].createElement(_cascader["default"], Object.assign({}, rest, {
|
|
44
|
+
ref: ref,
|
|
45
|
+
className: (0, _classnames["default"])(className, tntPrefixCls)
|
|
46
|
+
}), children);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
var _default = exports["default"] = (0, _connect.connectReadonlyComponent)(Cascader, _previewText.PreviewText.Cascader);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascader.js","sourceRoot":"","sources":["../../src/cascader/cascader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gEAA2C;AAC3C,6DAAwD;AACxD,4DAAmC;AACnC,+CAAyC;AACzC,wCAAqD;AACrD,kDAA6C;AAE7C,mDAAgC;AAShC,MAAM,YAAY,GAAG,cAAc,CAAA;AAEnC,MAAM,QAAQ,GAAG,IAAA,kBAAU,EACzB,CAAC,EAAgC,EAAE,GAAG,EAAE,EAAE;QAAzC,EAAE,SAAS,EAAE,QAAQ,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAC7B,OAAO,CACL,8BAAC,gCAAc,QACZ,GAAG,EAAE;QACJ,OAAO,CACL,8BAAC,kBAAY,oBAAK,IAAI,IAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,YAAY,CAAC,KAC7E,QAAQ,CACI,CAChB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACmB,CAAA;AAEtB,kBAAe,IAAA,kCAAwB,EAAC,QAAQ,EAAE,0BAAW,CAAC,QAAQ,CAAC,CAAA","sourcesContent":["import type { CascaderProps as AntdCascaderProps } from 'antd/lib/cascader'\nimport AntdCascader from 'antd/lib/cascader'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport classNames from 'classnames'\nimport React, { forwardRef } from 'react'\nimport { connectReadonlyComponent } from '../connect'\nimport { PreviewText } from '../preview-text'\n\nexport * from 'antd/lib/cascader'\n\nexport type CascaderProps = AntdCascaderProps & {\n readonly?: boolean\n}\n\ninterface CascaderComponent\n extends React.ForwardRefExoticComponent<AntdCascaderProps & React.RefAttributes<AntdCascader>> {}\n\nconst tntPrefixCls = 'tnt-cascader'\n\nconst Cascader = forwardRef<AntdCascader, AntdCascaderProps>(\n ({ className, children, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {() => {\n return (\n <AntdCascader {...rest} ref={ref} className={classNames(className, tntPrefixCls)}>\n {children}\n </AntdCascader>\n )\n }}\n </ConfigConsumer>\n )\n }\n) as CascaderComponent\n\nexport default connectReadonlyComponent(Cascader, PreviewText.Cascader)\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@cascader-prefix-cls: ~'@{ant-prefix}-cascader';
|
|
2
|
+
|
|
3
|
+
.tnt-cascader {
|
|
4
|
+
.@{cascader-prefix-cls}-picker {
|
|
5
|
+
&-clear {
|
|
6
|
+
width: 16px;
|
|
7
|
+
height: 16px;
|
|
8
|
+
font-size: initial;
|
|
9
|
+
margin-top: -8px;
|
|
10
|
+
}
|
|
11
|
+
&-arrow {
|
|
12
|
+
width: 16px;
|
|
13
|
+
height: 16px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/lib/cascader/index.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import type { CascaderProps as AntdCascaderProps } from 'antd/lib/cascader';
|
|
1
|
+
import Cascader from './cascader';
|
|
3
2
|
import './style';
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
readonly?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const Cascader: import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<unknown>>;
|
|
3
|
+
import './cascader.less';
|
|
4
|
+
export * from './cascader';
|
|
9
5
|
export default Cascader;
|
|
10
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cascader/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cascader/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,SAAS,CAAA;AAChB,OAAO,iBAAiB,CAAA;AAExB,cAAc,YAAY,CAAA;AAE1B,eAAe,QAAQ,CAAA"}
|
package/lib/cascader/index.js
CHANGED
|
@@ -4,11 +4,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
var _exportNames = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports["default"] = exports.Cascader = void 0;
|
|
11
|
-
var _cascader = _interopRequireWildcard(require("antd/lib/cascader"));
|
|
7
|
+
var _exportNames = {};
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _cascader = _interopRequireWildcard(require("./cascader"));
|
|
12
10
|
Object.keys(_cascader).forEach(function (key) {
|
|
13
11
|
if (key === "default" || key === "__esModule") return;
|
|
14
12
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -20,11 +18,8 @@ Object.keys(_cascader).forEach(function (key) {
|
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
});
|
|
23
|
-
var _connect = require("../connect");
|
|
24
|
-
var _previewText = require("../preview-text");
|
|
25
21
|
require("./style");
|
|
22
|
+
require("./cascader.less");
|
|
26
23
|
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); }
|
|
27
24
|
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; }
|
|
28
|
-
|
|
29
|
-
var Cascader = exports.Cascader = (0, _connect.connectReadonlyComponent)(_cascader["default"], _previewText.PreviewText.Cascader);
|
|
30
|
-
var _default = exports["default"] = Cascader;
|
|
25
|
+
var _default = exports["default"] = _cascader["default"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cascader/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cascader/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,0DAAiC;AACjC,mBAAgB;AAChB,2BAAwB;AAExB,6CAA0B;AAE1B,kBAAe,kBAAQ,CAAA","sourcesContent":["import Cascader from './cascader'\nimport './style'\nimport './cascader.less'\n\nexport * from './cascader'\n\nexport default Cascader\n"]}
|