tntd 2.8.0-beta.3 → 3.0.0-beta
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 +70 -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/button/button.js +30 -3
- package/es/button/button.js.map +1 -1
- package/es/button/button.less +72 -0
- package/es/button/index.js +1 -0
- package/es/button/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/color-picker/index.less +4 -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/RangePicker.less +3 -3
- package/es/descriptions/descriptions.js +64 -21
- package/es/descriptions/descriptions.js.map +1 -1
- package/es/descriptions/descriptions.less +57 -60
- package/es/descriptions/index.js +2 -2
- package/es/descriptions/index.js.map +1 -1
- package/es/drawer/drawer.js +98 -13
- package/es/drawer/drawer.js.map +1 -1
- package/es/drawer/index.js +1 -1
- package/es/drawer/index.js.map +1 -1
- package/es/drawer/index.less +154 -0
- 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/form.js +3 -0
- package/es/form/form.js.map +1 -1
- package/es/form/form.less +36 -0
- package/es/icon/index.js +2 -0
- package/es/icon/index.js.map +1 -1
- package/es/icon/style/style.less +4 -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 -5
- package/es/input-number/index.js.map +1 -1
- package/es/input-number/inputNumber.js +29 -0
- package/es/input-number/inputNumber.js.map +1 -0
- package/es/input-number/inputNumber.less +12 -0
- package/es/locale/en_US.js +12 -1
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +12 -1
- 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 +104 -17
- 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/notification/assets/index.js +2 -0
- package/es/notification/assets/index.js.map +1 -0
- package/es/notification/assets/svg-error-tip.js +145 -0
- package/es/notification/assets/svg-error-tip.js.map +1 -0
- package/es/notification/assets/svg-success-tip.js +162 -0
- package/es/notification/assets/svg-success-tip.js.map +1 -0
- package/es/notification/index.js +1 -1
- package/es/notification/index.js.map +1 -1
- package/es/notification/notification.js +80 -0
- package/es/notification/notification.js.map +1 -0
- package/es/notification/notification.less +59 -0
- package/es/notification/style/index.less +2 -0
- package/es/popconfirm/index.js +2 -2
- package/es/popconfirm/index.js.map +1 -1
- package/es/popconfirm/index.less +26 -0
- package/es/popconfirm/popconfirm.js +40 -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 +51 -0
- package/es/popover/popover.js +33 -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/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 +284 -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 +108 -0
- package/es/query-form/Field/Composition/Select.js.map +1 -0
- package/es/query-form/Field/Composition/index.js +282 -0
- package/es/query-form/Field/Composition/index.js.map +1 -0
- package/es/query-form/Field/Composition/index.less +106 -0
- package/es/query-form/Field/Composition/utils.js +19 -0
- package/es/query-form/Field/Composition/utils.js.map +1 -0
- package/es/query-form/index.js +109 -125
- package/es/query-form/index.js.map +1 -1
- package/es/query-form/index.less +12 -9
- package/es/query-list-scene/index.less +4 -4
- 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/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/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 +3 -2
- package/es/switch/index.less +46 -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/style/index.less +51 -7
- package/es/table/style/size.less +5 -5
- package/es/table/table.js +37 -6
- package/es/table/table.js.map +1 -1
- package/es/table/table.less +33 -5
- 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 +22 -4
- package/es/tabs/tabs.js.map +1 -1
- package/es/tabs/tabs.less +114 -0
- package/es/tag/color.less +43 -0
- package/es/tag/index.js +11 -2
- package/es/tag/index.js.map +1 -1
- package/es/tag/tag.js +171 -0
- package/es/tag/tag.js.map +1 -0
- package/es/tag/tag.less +192 -0
- 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/tntd-action/Action.js +66 -0
- package/es/tntd-action/Action.js.map +1 -0
- package/es/tntd-action/index.js +64 -6
- package/es/tntd-action/index.js.map +1 -1
- package/es/tntd-action/index.less +36 -0
- package/es/tntd-cascader/AntdCascader/index.less +28 -27
- package/es/tooltip/index.js +2 -2
- package/es/tooltip/index.js.map +1 -1
- package/es/tooltip/index.less +24 -0
- package/es/tooltip/style/index.js +2 -1
- package/es/tooltip/style/index.js.map +1 -1
- package/es/tooltip/tooltip.js +32 -0
- package/es/tooltip/tooltip.js.map +1 -0
- package/es/utils/lang.js +8 -2
- package/es/utils/lang.js.map +1 -1
- package/lib/alert/alert.d.ts +12 -0
- package/lib/alert/alert.d.ts.map +1 -0
- package/lib/alert/alert.js +92 -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/button/button.d.ts +9 -4
- package/lib/button/button.d.ts.map +1 -1
- package/lib/button/button.js +27 -3
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.less +72 -0
- package/lib/button/index.d.ts +1 -0
- package/lib/button/index.d.ts.map +1 -1
- package/lib/button/index.js +6 -5
- package/lib/button/index.js.map +1 -1
- 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/index.less +4 -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/RangePicker.less +3 -3
- package/lib/descriptions/descriptions.d.ts +11 -6
- package/lib/descriptions/descriptions.d.ts.map +1 -1
- package/lib/descriptions/descriptions.js +68 -26
- package/lib/descriptions/descriptions.js.map +1 -1
- package/lib/descriptions/descriptions.less +57 -60
- 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/drawer/drawer.d.ts +22 -2
- package/lib/drawer/drawer.d.ts.map +1 -1
- package/lib/drawer/drawer.js +104 -13
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/index.d.ts +1 -1
- package/lib/drawer/index.d.ts.map +1 -1
- package/lib/drawer/index.js +5 -5
- package/lib/drawer/index.js.map +1 -1
- package/lib/drawer/index.less +154 -0
- 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/form/form.d.ts +1 -0
- package/lib/form/form.d.ts.map +1 -1
- package/lib/form/form.js +4 -0
- package/lib/form/form.js.map +1 -1
- package/lib/form/form.less +36 -0
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.d.ts.map +1 -1
- package/lib/icon/index.js +2 -1
- package/lib/icon/index.js.map +1 -1
- package/lib/icon/style/style.less +4 -0
- 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 +11 -20
- package/lib/input/input.js.map +1 -1
- package/lib/input/input.less +123 -20
- package/lib/input-number/index.d.ts +4 -8
- package/lib/input-number/index.d.ts.map +1 -1
- package/lib/input-number/index.js +3 -5
- 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 +48 -0
- package/lib/input-number/inputNumber.js.map +1 -0
- package/lib/input-number/inputNumber.less +12 -0
- package/lib/locale/default.d.ts +11 -0
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/en_US.d.ts +11 -0
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +12 -1
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +11 -0
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +12 -1
- 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/notification/assets/index.d.ts +3 -0
- package/lib/notification/assets/index.d.ts.map +1 -0
- package/lib/notification/assets/index.js +20 -0
- package/lib/notification/assets/index.js.map +1 -0
- package/lib/notification/assets/svg-error-tip.d.ts +4 -0
- package/lib/notification/assets/svg-error-tip.d.ts.map +1 -0
- package/lib/notification/assets/svg-error-tip.js +154 -0
- package/lib/notification/assets/svg-error-tip.js.map +1 -0
- package/lib/notification/assets/svg-success-tip.d.ts +4 -0
- package/lib/notification/assets/svg-success-tip.d.ts.map +1 -0
- package/lib/notification/assets/svg-success-tip.js +171 -0
- package/lib/notification/assets/svg-success-tip.js.map +1 -0
- package/lib/notification/index.d.ts +1 -1
- package/lib/notification/index.d.ts.map +1 -1
- package/lib/notification/index.js +7 -8
- package/lib/notification/index.js.map +1 -1
- package/lib/notification/notification.d.ts +9 -0
- package/lib/notification/notification.d.ts.map +1 -0
- package/lib/notification/notification.js +105 -0
- package/lib/notification/notification.js.map +1 -0
- package/lib/notification/notification.less +59 -0
- package/lib/notification/style/index.less +2 -0
- 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 +26 -0
- package/lib/popconfirm/popconfirm.d.ts +6 -0
- package/lib/popconfirm/popconfirm.d.ts.map +1 -0
- package/lib/popconfirm/popconfirm.js +58 -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 +51 -0
- package/lib/popover/popover.d.ts +13 -0
- package/lib/popover/popover.d.ts.map +1 -0
- package/lib/popover/popover.js +53 -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/preview-text/index.d.ts +1 -1
- package/lib/preview-text/index.d.ts.map +1 -1
- 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/Composition/FieldPopover.d.ts +17 -0
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.js +319 -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 +132 -0
- package/lib/query-form/Field/Composition/Select.js.map +1 -0
- package/lib/query-form/Field/Composition/index.d.ts +14 -0
- package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/index.js +337 -0
- package/lib/query-form/Field/Composition/index.js.map +1 -0
- package/lib/query-form/Field/Composition/index.less +106 -0
- package/lib/query-form/Field/Composition/utils.d.ts +6 -0
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/utils.js +27 -0
- package/lib/query-form/Field/Composition/utils.js.map +1 -0
- package/lib/query-form/index.d.ts +4 -7
- package/lib/query-form/index.d.ts.map +1 -1
- package/lib/query-form/index.js +137 -149
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-form/index.less +12 -9
- package/lib/query-list-scene/index.less +4 -4
- 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/segmented/index.d.ts +1 -1
- 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 +3 -4
- package/lib/select/select.js.map +1 -1
- package/lib/select/select.less +83 -9
- 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 +50 -22
- 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 +3 -2
- 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/switch/index.less +46 -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/style/index.less +51 -7
- package/lib/table/style/size.less +5 -5
- package/lib/table/table.d.ts +2 -1
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +35 -4
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.less +33 -5
- 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 +24 -3
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/tabs/tabs.less +114 -0
- package/lib/tag/color.less +43 -0
- package/lib/tag/index.d.ts +3 -2
- package/lib/tag/index.d.ts.map +1 -1
- package/lib/tag/index.js +15 -9
- package/lib/tag/index.js.map +1 -1
- package/lib/tag/tag.d.ts +41 -0
- package/lib/tag/tag.d.ts.map +1 -0
- package/lib/tag/tag.js +183 -0
- package/lib/tag/tag.js.map +1 -0
- package/lib/tag/tag.less +192 -0
- 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/tntd-action/Action.d.ts +6 -0
- package/lib/tntd-action/Action.d.ts.map +1 -0
- package/lib/tntd-action/Action.js +86 -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 +76 -5
- package/lib/tntd-action/index.js.map +1 -1
- package/lib/tntd-action/index.less +36 -0
- package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +1 -1
- package/lib/tntd-cascader/AntdCascader/index.less +28 -27
- package/lib/tntd-rc-select/_util/PurePanel.d.ts +1 -1
- package/lib/tooltip/index.d.ts +2 -2
- package/lib/tooltip/index.d.ts.map +1 -1
- package/lib/tooltip/index.js +2 -2
- package/lib/tooltip/index.js.map +1 -1
- package/lib/tooltip/index.less +24 -0
- 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.d.ts +8 -0
- package/lib/tooltip/tooltip.d.ts.map +1 -0
- package/lib/tooltip/tooltip.js +51 -0
- package/lib/tooltip/tooltip.js.map +1 -0
- package/lib/utils/lang.d.ts.map +1 -1
- package/lib/utils/lang.js +8 -2
- package/lib/utils/lang.js.map +1 -1
- package/package.json +3 -2
- package/themes/common/index.less +29 -27
- package/themes/default/colors.less +1 -1
- package/themes/default/lessVars2.x.less +2 -1
- package/themes/default/lessVars3.x.less +1 -0
- package/themes/default/variables.less +60 -36
- package/es/checkbox/checkbox-group.js +0 -5
- package/es/checkbox/checkbox-group.js.map +0 -1
- package/es/drawer/drawer.less +0 -20
- package/es/modal/modal.less +0 -18
- 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/drawer/drawer.less +0 -20
- package/lib/modal/modal.less +0 -18
- 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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Tabs 自定义梯形页签样式
|
|
2
|
+
@tab-prefix-cls: ~'@{ant-prefix}-tabs';
|
|
3
|
+
|
|
4
|
+
.tnt-tabs.@{tab-prefix-cls}.@{tab-prefix-cls}-ladder-card.@{tab-prefix-cls}-top {
|
|
5
|
+
|
|
6
|
+
padding: 0 12px;
|
|
7
|
+
position: relative;
|
|
8
|
+
left: -12px;
|
|
9
|
+
padding-bottom: 20px;
|
|
10
|
+
|
|
11
|
+
.@{tab-prefix-cls}-tab {
|
|
12
|
+
position: relative;
|
|
13
|
+
min-width: 106px;
|
|
14
|
+
height: 40px;
|
|
15
|
+
line-height: 40px;
|
|
16
|
+
border-top-left-radius: @border-radius-lg;
|
|
17
|
+
filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, 0.10));
|
|
18
|
+
box-shadow: 0px 0px 2px -5px rgba(0, 0, 0, 0.05);
|
|
19
|
+
border: none;
|
|
20
|
+
margin: 0px 30px 0px 0px;
|
|
21
|
+
padding: 0px 12px 0;
|
|
22
|
+
background: @fill-color-quaternary;
|
|
23
|
+
text-align: right;
|
|
24
|
+
color: @text-color-secondary;
|
|
25
|
+
|
|
26
|
+
&::after {
|
|
27
|
+
content: '';
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
right: -52px;
|
|
31
|
+
height: 100%;
|
|
32
|
+
width: 64px;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
background: inherit;
|
|
35
|
+
clip-path: path('M0 0H22.3875C28.4632 0 34.2094 2.76179 38.0049 7.5061L64 40H0V0Z');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.@{tab-prefix-cls}-nav {
|
|
41
|
+
margin-top: 12px;
|
|
42
|
+
padding-left: 12px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.@{tab-prefix-cls}-nav-container {
|
|
46
|
+
height: auto;
|
|
47
|
+
position: relative;
|
|
48
|
+
left: -12px;
|
|
49
|
+
width: calc(100% + 12px);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.@{tab-prefix-cls}-bar.@{tab-prefix-cls}-top-bar.@{tab-prefix-cls}-card-bar {
|
|
53
|
+
border-bottom: none;
|
|
54
|
+
margin-bottom: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
// 鼠标选中时,active状态在上层
|
|
59
|
+
.@{tab-prefix-cls}-tab-active {
|
|
60
|
+
z-index: 3;
|
|
61
|
+
background: @tabs-active-background;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.@{tab-prefix-cls}-tabpane{
|
|
65
|
+
background: @white;
|
|
66
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
|
|
67
|
+
padding: 20px 12px 12px;
|
|
68
|
+
border-bottom-right-radius: @border-radius-lg;
|
|
69
|
+
border-bottom-left-radius: @border-radius-lg;
|
|
70
|
+
border-top-right-radius: @border-radius-lg;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// // Tabs top类型 全局样式修改
|
|
75
|
+
.tnt-tabs.@{tab-prefix-cls}.@{tab-prefix-cls}-top.@{tab-prefix-cls}-line {
|
|
76
|
+
.@{tab-prefix-cls}-bar {
|
|
77
|
+
border-bottom: none !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.@{tab-prefix-cls}-nav-container {
|
|
81
|
+
margin-bottom: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.@{tab-prefix-cls}-tab {
|
|
85
|
+
border-bottom: 1px solid transparent;
|
|
86
|
+
margin-bottom: 1px;
|
|
87
|
+
height: 40px;
|
|
88
|
+
line-height: 37px;
|
|
89
|
+
padding: 2px 12px 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.@{tab-prefix-cls}-tab:hover{
|
|
93
|
+
border-color: @border-color-secondary;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.tnt-tabs.@{tab-prefix-cls} {
|
|
98
|
+
.@{tab-prefix-cls}-nav {
|
|
99
|
+
.@{tab-prefix-cls}-tab {
|
|
100
|
+
color: @tabs-tab-color;
|
|
101
|
+
// 自定义图标默认都是 16px
|
|
102
|
+
i.anticon {
|
|
103
|
+
font-size: @font-size-lg;
|
|
104
|
+
margin-right: 4px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.@{tab-prefix-cls}-tab.@{tab-prefix-cls}-tab-active {
|
|
108
|
+
color: @tabs-active-color;
|
|
109
|
+
}
|
|
110
|
+
.@{tab-prefix-cls}-tab.@{tab-prefix-cls}-tab:hover {
|
|
111
|
+
color: @tabs-hover-color;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@preset-colors-custom: grey, blue, green, red, gold, lightblue, bluegrey, purplegrey, purple, lightpurple, lightgreen, pink, rose, orange, magenta, volcano, yellow, cyan, lime, geekblue, tnt-pink, tnt-orange, tnt-purple;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@grey-7: @text-color-secondary;
|
|
5
|
+
@grey-4: @border-color-base;
|
|
6
|
+
@grey-1: @tag-default-bg;
|
|
7
|
+
|
|
8
|
+
@rose-7:#D8395E;
|
|
9
|
+
@rose-4: #FEA3B4;
|
|
10
|
+
@rose-1: #FFF1F3;
|
|
11
|
+
|
|
12
|
+
@lightblue-7: #1AA9E6;
|
|
13
|
+
@lightblue-4: #8FE0FF;
|
|
14
|
+
@lightblue-1: #F0F9FF;
|
|
15
|
+
|
|
16
|
+
@bluegrey-7: #486FBB;
|
|
17
|
+
@bluegrey-4: #A1BCEF;
|
|
18
|
+
@bluegrey-1: #F4F8FF;
|
|
19
|
+
|
|
20
|
+
@purplegrey-7: #4E5BA6;
|
|
21
|
+
@purplegrey-4: #AFB5D9;
|
|
22
|
+
@purplegrey-1: #F8F9FC;
|
|
23
|
+
|
|
24
|
+
@tnt-purple-7: #6E54D4;
|
|
25
|
+
@tnt-purple-4: #BDB4FE;
|
|
26
|
+
@tnt-purple-1: #F4F3FF;
|
|
27
|
+
|
|
28
|
+
@lightpurple-7: #5161D7;
|
|
29
|
+
@lightpurple-4: #A4BCFD;
|
|
30
|
+
@lightpurple-1: #EEF4FF;
|
|
31
|
+
|
|
32
|
+
@lightgreen-7: #2E9C98;
|
|
33
|
+
@lightgreen-4: #8CE0DD;
|
|
34
|
+
@lightgreen-1: #F1FBFB;
|
|
35
|
+
|
|
36
|
+
@tnt-pink-7: #D03E93;
|
|
37
|
+
@tnt-pink-4: #FAA7E0;
|
|
38
|
+
@tnt-pink-1: #FDF2FA;
|
|
39
|
+
|
|
40
|
+
@tnt-orange-7:#DF5F28;
|
|
41
|
+
@tnt-orange-4: #FEB173;
|
|
42
|
+
@tnt-orange-1: #FFF6ED;
|
|
43
|
+
|
package/lib/tag/index.d.ts
CHANGED
package/lib/tag/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":"AAQA,OAAO,SAAS,CAAA;AAChB,OAAO,YAAY,CAAA;AACnB,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE3B,cAAc,OAAO,CAAA;AAErB,eAAe,GAAG,CAAA"}
|
package/lib/tag/index.js
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
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
|
});
|
|
7
6
|
var _exportNames = {};
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
require("./style");
|
|
9
|
+
require("./tag.less");
|
|
10
|
+
var _tag2 = require("./tag");
|
|
11
|
+
Object.keys(_tag2).forEach(function (key) {
|
|
11
12
|
if (key === "default" || key === "__esModule") return;
|
|
12
13
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
13
|
-
if (key in exports && exports[key] ===
|
|
14
|
+
if (key in exports && exports[key] === _tag2[key]) return;
|
|
14
15
|
Object.defineProperty(exports, key, {
|
|
15
16
|
enumerable: true,
|
|
16
17
|
get: function get() {
|
|
17
|
-
return
|
|
18
|
+
return _tag2[key];
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/*
|
|
23
|
+
* @Author: 周泽飞 zefei.zhou@tongdun.net
|
|
24
|
+
* @Date: 2024-02-29 14:21:28
|
|
25
|
+
* @LastEditors: 周泽飞 zefei.zhou@tongdun.net
|
|
26
|
+
* @LastEditTime: 2024-03-05 14:05:27
|
|
27
|
+
* @FilePath: /tntd/packages/tntd/src/tag/index.ts
|
|
28
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
29
|
+
*/
|
|
30
|
+
var _default = exports["default"] = _tag2.Tag;
|
package/lib/tag/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,mBAAgB;AAChB,sBAAmB;AACnB,+BAA2B;AAE3B,wCAAqB;AAErB,kBAAe,SAAG,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2024-02-29 14:21:28\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-03-05 14:05:27\n * @FilePath: /tntd/packages/tntd/src/tag/index.ts\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport './style'\nimport './tag.less'\nimport { Tag } from './tag'\n\nexport * from './tag'\n\nexport default Tag\n"]}
|
package/lib/tag/tag.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TagProps as AntdTagProps } from 'antd/lib/tag';
|
|
3
|
+
import type { CheckableTagProps as AntdCheckableTagProps } from 'antd/lib/tag';
|
|
4
|
+
import { default as AntdTag } from 'antd/lib/tag';
|
|
5
|
+
export * from 'antd/lib/tag';
|
|
6
|
+
export declare enum TagColors {
|
|
7
|
+
grey = "grey",
|
|
8
|
+
rose = "rose",
|
|
9
|
+
lightblue = "lightblue",
|
|
10
|
+
bluegrey = "bluegrey",
|
|
11
|
+
purplegrey = "purplegrey",
|
|
12
|
+
lightpurple = "lightpurple",
|
|
13
|
+
lightgreen = "lightgreen",
|
|
14
|
+
'tnt-pink' = "tnt-pink",
|
|
15
|
+
'tnt-orange' = "tnt-orange",
|
|
16
|
+
'tnt-purple' = "tnt-purple"
|
|
17
|
+
}
|
|
18
|
+
export interface TagProps extends AntdTagProps {
|
|
19
|
+
color?: TagColors | string;
|
|
20
|
+
size?: 'small' | 'middle' | 'large';
|
|
21
|
+
border?: boolean;
|
|
22
|
+
addonContent?: React.ReactNode;
|
|
23
|
+
addonPosition?: 'prefix' | 'suffix';
|
|
24
|
+
addonType?: 'success' | 'info' | 'warning' | 'error';
|
|
25
|
+
ellipsisOptions?: {
|
|
26
|
+
Popover?: boolean;
|
|
27
|
+
emptyText?: string;
|
|
28
|
+
widthLimit?: number | string;
|
|
29
|
+
lines?: number;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface CheckableTagProps extends AntdCheckableTagProps {
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
border?: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface TagComponent extends React.ForwardRefExoticComponent<TagProps & React.RefAttributes<AntdTag>> {
|
|
38
|
+
CheckableTag: React.FC<CheckableTagProps>;
|
|
39
|
+
}
|
|
40
|
+
export declare const Tag: TagComponent;
|
|
41
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA8B,MAA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,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAChF,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAA;CAC1C;AAoCD,eAAO,MAAM,GAAG,cAmFE,CAAA"}
|
package/lib/tag/tag.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
TagColors: true,
|
|
8
|
+
Tag: true
|
|
9
|
+
};
|
|
10
|
+
exports.TagColors = exports.Tag = void 0;
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _configProvider = require("antd/lib/config-provider");
|
|
13
|
+
var _tag = _interopRequireWildcard(require("antd/lib/tag"));
|
|
14
|
+
Object.keys(_tag).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
+
if (key in exports && exports[key] === _tag[key]) return;
|
|
18
|
+
Object.defineProperty(exports, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _tag[key];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
26
|
+
var _ellipsis = _interopRequireDefault(require("../ellipsis"));
|
|
27
|
+
var _icon = _interopRequireDefault(require("../icon"));
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
+
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); }
|
|
30
|
+
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; }
|
|
31
|
+
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); }
|
|
32
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
34
|
+
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); }
|
|
35
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
38
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
39
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
/*
|
|
44
|
+
* @Author: 周泽飞 zefei.zhou@tongdun.net
|
|
45
|
+
* @Date: 2024-03-04 19:15:22
|
|
46
|
+
* @LastEditors: 周泽飞 zefei.zhou@tongdun.net
|
|
47
|
+
* @LastEditTime: 2024-03-11 10:10:31
|
|
48
|
+
* @FilePath: /tntd/packages/tntd/src/tag/tag.tsx
|
|
49
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
var TagColors;
|
|
53
|
+
(function (TagColors) {
|
|
54
|
+
TagColors["grey"] = "grey";
|
|
55
|
+
TagColors["rose"] = "rose";
|
|
56
|
+
TagColors["lightblue"] = "lightblue";
|
|
57
|
+
TagColors["bluegrey"] = "bluegrey";
|
|
58
|
+
TagColors["purplegrey"] = "purplegrey";
|
|
59
|
+
TagColors["lightpurple"] = "lightpurple";
|
|
60
|
+
TagColors["lightgreen"] = "lightgreen";
|
|
61
|
+
TagColors["tnt-pink"] = "tnt-pink";
|
|
62
|
+
TagColors["tnt-orange"] = "tnt-orange";
|
|
63
|
+
TagColors["tnt-purple"] = "tnt-purple";
|
|
64
|
+
})(TagColors || (exports.TagColors = TagColors = {}));
|
|
65
|
+
// 内置的状态
|
|
66
|
+
var statusMap = {
|
|
67
|
+
success: {
|
|
68
|
+
icon: 'check-circle',
|
|
69
|
+
color: 'green'
|
|
70
|
+
},
|
|
71
|
+
info: {
|
|
72
|
+
icon: 'info-circle',
|
|
73
|
+
color: 'blue'
|
|
74
|
+
},
|
|
75
|
+
error: {
|
|
76
|
+
icon: 'close-circle',
|
|
77
|
+
color: 'red'
|
|
78
|
+
},
|
|
79
|
+
warning: {
|
|
80
|
+
icon: 'info-circle',
|
|
81
|
+
color: 'orange'
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
var getDisplayEllipsisOptions = function getDisplayEllipsisOptions(props, prefixCls) {
|
|
85
|
+
var _a;
|
|
86
|
+
var _ref = props || {},
|
|
87
|
+
ellipsisOptions = _ref.ellipsisOptions,
|
|
88
|
+
addonContent = _ref.addonContent,
|
|
89
|
+
addonType = _ref.addonType,
|
|
90
|
+
addonPosition = _ref.addonPosition,
|
|
91
|
+
children = _ref.children;
|
|
92
|
+
var options = Object.assign({}, ellipsisOptions);
|
|
93
|
+
var addonContentInfo = null;
|
|
94
|
+
if (addonContent) {
|
|
95
|
+
addonContentInfo = addonContent;
|
|
96
|
+
} else if (addonType && statusMap[addonType]) {
|
|
97
|
+
addonContentInfo = _react["default"].createElement(_icon["default"], {
|
|
98
|
+
type: (_a = statusMap[addonType]) === null || _a === void 0 ? void 0 : _a.icon
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (addonContentInfo) {
|
|
102
|
+
addonContentInfo = _react["default"].createElement("span", {
|
|
103
|
+
className: "".concat(prefixCls, "-addon")
|
|
104
|
+
}, addonContentInfo);
|
|
105
|
+
if (addonPosition === 'prefix') {
|
|
106
|
+
options.prefix = addonContentInfo;
|
|
107
|
+
}
|
|
108
|
+
if (addonPosition === 'suffix') {
|
|
109
|
+
options.suffix = addonContentInfo;
|
|
110
|
+
}
|
|
111
|
+
if (options.Popover === true) {
|
|
112
|
+
options.content = children;
|
|
113
|
+
} else {
|
|
114
|
+
options.title = children;
|
|
115
|
+
}
|
|
116
|
+
options.contentInfo = addonContentInfo;
|
|
117
|
+
}
|
|
118
|
+
return options;
|
|
119
|
+
};
|
|
120
|
+
var Tag = exports.Tag = (0, _react.forwardRef)(function (props, ref) {
|
|
121
|
+
var _a;
|
|
122
|
+
var className = props.className,
|
|
123
|
+
_props$border = props.border,
|
|
124
|
+
border = _props$border === void 0 ? true : _props$border,
|
|
125
|
+
size = props.size,
|
|
126
|
+
addonType = props.addonType,
|
|
127
|
+
addonContent = props.addonContent,
|
|
128
|
+
_props$addonPosition = props.addonPosition,
|
|
129
|
+
addonPosition = _props$addonPosition === void 0 ? 'prefix' : _props$addonPosition,
|
|
130
|
+
ellipsisOptions = props.ellipsisOptions,
|
|
131
|
+
children = props.children,
|
|
132
|
+
restProps = __rest(props, ["className", "border", "size", "addonType", "addonContent", "addonPosition", "ellipsisOptions", "children"]);
|
|
133
|
+
var _ref2 = props || {},
|
|
134
|
+
color = _ref2.color;
|
|
135
|
+
if (!color && addonType) {
|
|
136
|
+
color = (_a = statusMap[addonType]) === null || _a === void 0 ? void 0 : _a.color;
|
|
137
|
+
}
|
|
138
|
+
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref3) {
|
|
139
|
+
var getPrefixCls = _ref3.getPrefixCls;
|
|
140
|
+
var _a, _b, _c, _d, _e;
|
|
141
|
+
var prefixCls = getPrefixCls('tag');
|
|
142
|
+
var displayEllipsisOptions = getDisplayEllipsisOptions({
|
|
143
|
+
ellipsisOptions: ellipsisOptions,
|
|
144
|
+
addonContent: addonContent,
|
|
145
|
+
addonType: addonType,
|
|
146
|
+
addonPosition: addonPosition,
|
|
147
|
+
children: children
|
|
148
|
+
}, prefixCls);
|
|
149
|
+
// 只有一个icon时 padding距离存在差异
|
|
150
|
+
var onlyIcon = _react["default"].isValidElement(children) && _react["default"].Children.only(children) && (children === null || children === void 0 ? void 0 : children.type) instanceof Function && ((_c = (_b = (_a = children === null || children === void 0 ? void 0 : children.type) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase) === null || _c === void 0 ? void 0 : _c.call(_b)) === 'icon';
|
|
151
|
+
// 前缀是图片 只处理一层节点下是图片的,否则就用户自定义样式
|
|
152
|
+
var addonIsImg = _react["default"].isValidElement(addonContent) && (addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) && typeof (addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) === 'string' && ((_e = (_d = addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) === null || _d === void 0 ? void 0 : _d.toLowerCase) === null || _e === void 0 ? void 0 : _e.call(_d)) === 'img';
|
|
153
|
+
return _react["default"].createElement(_tag["default"], Object.assign({
|
|
154
|
+
className: (0, _classnames["default"])(_defineProperty({}, "".concat(prefixCls, "-").concat(color), color && !!TagColors[color]), 'tnt-tag', "".concat(prefixCls, "-").concat(size || 'middle'), _defineProperty({}, "".concat(prefixCls, "-no-border"), !border), _defineProperty({}, "".concat(prefixCls, "-only-child"), !children || onlyIcon), _defineProperty({}, "".concat(prefixCls, "-addon-img"), !!addonIsImg), className || '')
|
|
155
|
+
}, restProps, {
|
|
156
|
+
color: !TagColors[color] ? color : '',
|
|
157
|
+
ref: ref
|
|
158
|
+
}), !addonContent && !addonType && !ellipsisOptions && children, (!!addonContent || !!addonType || !!ellipsisOptions) && _react["default"].createElement("span", {
|
|
159
|
+
className: "".concat(prefixCls, "-addon-wrap")
|
|
160
|
+
}, !!children && _react["default"].createElement(_ellipsis["default"], Object.assign({}, displayEllipsisOptions), children), !children && (displayEllipsisOptions === null || displayEllipsisOptions === void 0 ? void 0 : displayEllipsisOptions.contentInfo)));
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
Tag.CheckableTag = (0, _react.forwardRef)(function (props, ref) {
|
|
164
|
+
// 默认没有border
|
|
165
|
+
var _a = props || {},
|
|
166
|
+
onChange = _a.onChange,
|
|
167
|
+
disabled = _a.disabled,
|
|
168
|
+
_a$border = _a.border,
|
|
169
|
+
border = _a$border === void 0 ? false : _a$border,
|
|
170
|
+
className = _a.className,
|
|
171
|
+
rest = __rest(_a, ["onChange", "disabled", "border", "className"]);
|
|
172
|
+
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref4) {
|
|
173
|
+
var getPrefixCls = _ref4.getPrefixCls;
|
|
174
|
+
var prefixCls = getPrefixCls('tag-checkable');
|
|
175
|
+
return _react["default"].createElement(_tag["default"].CheckableTag, Object.assign({}, !disabled && {
|
|
176
|
+
onChange: onChange
|
|
177
|
+
}, {
|
|
178
|
+
className: (0, _classnames["default"])('tnt-tag', _defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-border"), !!border))
|
|
179
|
+
}, rest, {
|
|
180
|
+
ref: ref
|
|
181
|
+
}));
|
|
182
|
+
});
|
|
183
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAkD;AAGlD,6DAAwD;AACxD,sDAAgD;AAEhD,4DAAmC;AACnC,2DAAkC;AAClC,mDAA0B;AAE1B,8CAA2B;AAE3B,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,0BAAa,CAAA;IACb,oCAAuB,CAAA;IACvB,kCAAqB,CAAA;IACrB,sCAAyB,CAAA;IACzB,wCAA2B,CAAA;IAC3B,sCAAyB,CAAA;IACzB,kCAAuB,CAAA;IACvB,sCAA2B,CAAA;IAC3B,sCAA2B,CAAA;AAC7B,CAAC,EAXW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWpB;AAED,QAAQ;AACR,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,OAAO;KACf;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;QACL,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,KAAK;KACb;IACD,OAAO,EAAE;QACP,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,QAAQ;KAChB;CACF,CAAA;AA4BD,MAAM,yBAAyB,GAAG,CAAC,KAAe,EAAE,SAAiB,EAAE,EAAE;;IACvE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,IAAI,EAAE,CAAA;IACzF,MAAM,OAAO,qBACR,eAAe,CACnB,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AAQ,EAAE,CAAC,IAC/B,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE;gBAC/B,CAAC,GAAG,SAAS,WAAW,CAAC,EAAE,QAAQ;gBACnC,CAAC,GAAG,SAAS,SAAS,CAAC,EAAE,CAAC,CAAC,MAAM;aAClC,CAAC,IACE,IAAI,IACR,GAAG,EAAE,GAAG,IACR,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACF,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2024-03-04 19:15:22\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-03-11 10:10:31\n * @FilePath: /tntd/packages/tntd/src/tag/tag.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { useMemo, forwardRef } from 'react'\nimport type { TagProps as AntdTagProps } from 'antd/lib/tag'\nimport type { CheckableTagProps as AntdCheckableTagProps } from 'antd/lib/tag'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport { default as AntdTag } from 'antd/lib/tag'\nimport type AntdCheckableTag from 'antd/lib/tag/CheckableTag'\nimport classNames from 'classnames'\nimport Ellipsis from '../ellipsis'\nimport Icon from '../icon'\n\nexport * from 'antd/lib/tag'\n\nexport enum TagColors {\n grey = 'grey',\n rose = 'rose',\n lightblue = 'lightblue',\n bluegrey = 'bluegrey',\n purplegrey = 'purplegrey',\n lightpurple = 'lightpurple',\n lightgreen = 'lightgreen',\n 'tnt-pink' = 'tnt-pink',\n 'tnt-orange' = 'tnt-orange',\n 'tnt-purple' = 'tnt-purple',\n}\n\n// 内置的状态\nconst statusMap = {\n success: {\n icon: 'check-circle',\n color: 'green',\n },\n info: {\n icon: 'info-circle',\n color: 'blue',\n },\n error: {\n icon: 'close-circle',\n color: 'red',\n },\n warning: {\n icon: 'info-circle',\n color: 'orange',\n },\n}\n\nexport interface TagProps extends AntdTagProps {\n color?: TagColors | string\n size?: 'small' | 'middle' | 'large'\n border?: boolean\n addonContent?: React.ReactNode\n addonPosition?: 'prefix' | 'suffix'\n addonType?: 'success' | 'info' | 'warning' | 'error'\n ellipsisOptions?: {\n Popover?: boolean\n emptyText?: string\n widthLimit?: number | string\n lines?: number\n [key: string]: unknown\n }\n}\n\nexport interface CheckableTagProps extends AntdCheckableTagProps {\n disabled?: boolean\n border?: boolean\n}\n\ninterface TagComponent\n extends React.ForwardRefExoticComponent<TagProps & React.RefAttributes<AntdTag>> {\n CheckableTag: React.FC<CheckableTagProps>\n}\n\nconst getDisplayEllipsisOptions = (props: TagProps, prefixCls: string) => {\n const { ellipsisOptions, addonContent, addonType, addonPosition, children } = props || {}\n const options = {\n ...ellipsisOptions,\n }\n\n let addonContentInfo = null\n if (addonContent) {\n addonContentInfo = addonContent\n } else if (addonType && statusMap[addonType]) {\n addonContentInfo = <Icon type={statusMap[addonType]?.icon} />\n }\n\n if (addonContentInfo) {\n addonContentInfo = <span className={`${prefixCls}-addon`}>{addonContentInfo}</span>\n if (addonPosition === 'prefix') {\n options.prefix = addonContentInfo\n }\n\n if (addonPosition === 'suffix') {\n options.suffix = addonContentInfo\n }\n\n if (options.Popover === true) {\n options.content = children\n } else {\n options.title = children\n }\n options.contentInfo = addonContentInfo\n }\n\n return options\n}\n\nexport const Tag = forwardRef<AntdTag, TagProps & { capitalize?: boolean }>((props, ref) => {\n const {\n className,\n border = true,\n size,\n addonType,\n addonContent,\n addonPosition = 'prefix',\n ellipsisOptions,\n children,\n ...restProps\n } = props\n\n let { color } = props || {}\n if (!color && addonType) {\n color = statusMap[addonType]?.color\n }\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('tag')\n\n const displayEllipsisOptions = getDisplayEllipsisOptions(\n {\n ellipsisOptions,\n addonContent,\n addonType,\n addonPosition,\n children,\n },\n prefixCls\n )\n\n // 只有一个icon时 padding距离存在差异\n const onlyIcon =\n React.isValidElement(children) &&\n React.Children.only(children) &&\n children?.type instanceof Function &&\n children?.type?.name?.toLowerCase?.() === 'icon'\n\n // 前缀是图片 只处理一层节点下是图片的,否则就用户自定义样式\n const addonIsImg =\n React.isValidElement(addonContent) &&\n addonContent?.type &&\n typeof addonContent?.type === 'string' &&\n addonContent?.type?.toLowerCase?.() === 'img'\n\n return (\n <AntdTag\n className={classNames(\n {\n [`${prefixCls}-${color}`]: color && !!TagColors[color as keyof typeof TagColors],\n },\n 'tnt-tag',\n `${prefixCls}-${size || 'middle'}`,\n {\n [`${prefixCls}-no-border`]: !border,\n },\n {\n [`${prefixCls}-only-child`]: !children || onlyIcon,\n },\n {\n [`${prefixCls}-addon-img`]: !!addonIsImg,\n },\n className || ''\n )}\n {...restProps}\n color={!TagColors[color as keyof typeof TagColors] ? color : ''}\n ref={ref}\n >\n {!addonContent && !addonType && !ellipsisOptions && children}\n {(!!addonContent || !!addonType || !!ellipsisOptions) && (\n <span className={`${prefixCls}-addon-wrap`}>\n {!!children && <Ellipsis {...displayEllipsisOptions}>{children}</Ellipsis>}\n {!children && displayEllipsisOptions?.contentInfo}\n </span>\n )}\n </AntdTag>\n )\n }}\n </ConfigConsumer>\n )\n}) as TagComponent\n\nTag.CheckableTag = forwardRef<AntdCheckableTag, CheckableTagProps>(\n (props: CheckableTagProps, ref) => {\n // 默认没有border\n const { onChange, disabled, border = false, className, ...rest } = props || {}\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('tag-checkable')\n return (\n <AntdTag.CheckableTag\n {...(!disabled && { onChange })}\n className={classNames('tnt-tag', {\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-border`]: !!border,\n })}\n {...rest}\n ref={ref}\n />\n )\n }}\n </ConfigConsumer>\n )\n }\n)\n"]}
|
package/lib/tag/tag.less
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
@import '../style/mixins/index';
|
|
2
|
+
@import './color.less';
|
|
3
|
+
@tag-prefix-cls: ~'@{ant-prefix}-tag';
|
|
4
|
+
// 默认
|
|
5
|
+
@tag-height: 20px;
|
|
6
|
+
@tag-small-size: 0 8px;
|
|
7
|
+
@tag-middle-size: 1px 10px;
|
|
8
|
+
@tag-large-size: 3px 12px;
|
|
9
|
+
|
|
10
|
+
// img tag
|
|
11
|
+
@tag-img-small-size: 1px 5px 1px 3px;
|
|
12
|
+
@tag-img-middle-size: 2px 6px 2px 3px;
|
|
13
|
+
@tag-img-large-size: 3px 12px 3px 4px;
|
|
14
|
+
|
|
15
|
+
// 只有icon的尺寸
|
|
16
|
+
@tag-only-icon-small-size: 5px;
|
|
17
|
+
@tag-only-icon-middle-size: 6px;
|
|
18
|
+
@tag-only-icon-large-size: 7px;
|
|
19
|
+
|
|
20
|
+
.tnt-tag.@{tag-prefix-cls} {
|
|
21
|
+
line-height: @tag-height;
|
|
22
|
+
|
|
23
|
+
.@{iconfont-css-prefix}-close {
|
|
24
|
+
.iconfont-size-under-12px(12px);
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.anticon{
|
|
30
|
+
font-size: @font-size-sm;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 头像插件 可以为icon 图片
|
|
34
|
+
.@{tag-prefix-cls}-addon-wrap{
|
|
35
|
+
display: inline-block;
|
|
36
|
+
vertical-align: middle;
|
|
37
|
+
margin-top: -1px;
|
|
38
|
+
.@{tag-prefix-cls}-addon{
|
|
39
|
+
.iconfont-size-under-12px(12px);
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tntd-ellipsis,.tnt-ellipsis{
|
|
46
|
+
align-items: center;
|
|
47
|
+
.@{tag-prefix-cls}-addon{
|
|
48
|
+
>*{
|
|
49
|
+
border-radius: 100%;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
display: block;
|
|
52
|
+
}
|
|
53
|
+
+*{
|
|
54
|
+
margin-left: 4px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-small{
|
|
61
|
+
padding: @tag-small-size;
|
|
62
|
+
}
|
|
63
|
+
&-middle{
|
|
64
|
+
padding: @tag-middle-size;
|
|
65
|
+
}
|
|
66
|
+
&-large{
|
|
67
|
+
padding: @tag-large-size;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 不带边框
|
|
72
|
+
&.@{tag-prefix-cls}-no-border{
|
|
73
|
+
border-color:transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 只有一个icon
|
|
77
|
+
&.@{tag-prefix-cls}-only-child{
|
|
78
|
+
line-height: @font-size-sm;
|
|
79
|
+
&.@{tag-prefix-cls}-small{
|
|
80
|
+
padding: @tag-only-icon-small-size;
|
|
81
|
+
}
|
|
82
|
+
&.@{tag-prefix-cls}-middle{
|
|
83
|
+
padding: @tag-only-icon-middle-size;
|
|
84
|
+
}
|
|
85
|
+
&.@{tag-prefix-cls}-large{
|
|
86
|
+
padding: @tag-only-icon-large-size;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 带图片
|
|
91
|
+
&.@{tag-prefix-cls}-addon-img{
|
|
92
|
+
&.@{tag-prefix-cls}-small{
|
|
93
|
+
padding: @tag-img-small-size;
|
|
94
|
+
.@{tag-prefix-cls}-addon{
|
|
95
|
+
width: 16px;
|
|
96
|
+
height: 16px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
&.@{tag-prefix-cls}-middle{
|
|
100
|
+
padding: @tag-img-middle-size;
|
|
101
|
+
.@{tag-prefix-cls}-addon{
|
|
102
|
+
width: 18px;
|
|
103
|
+
height: 18px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
&.@{tag-prefix-cls}-large{
|
|
107
|
+
padding: @tag-img-large-size;
|
|
108
|
+
.@{tag-prefix-cls}-addon{
|
|
109
|
+
width: 20px;
|
|
110
|
+
height: 20px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// mixin to iterate over colors and create CSS class for each one
|
|
116
|
+
.make-color-classes(@i: length(@preset-colors-custom)) when (@i > 0) {
|
|
117
|
+
.make-color-classes(@i - 1);
|
|
118
|
+
@color: extract(@preset-colors-custom, @i);
|
|
119
|
+
@lightColor: '@{color}-1';
|
|
120
|
+
@lightBorderColor: '@{color}-4';
|
|
121
|
+
@darkColor: '@{color}-7';
|
|
122
|
+
&.@{tag-prefix-cls}-@{color} {
|
|
123
|
+
color: @@darkColor;
|
|
124
|
+
background: @@lightColor;
|
|
125
|
+
border-color: @@lightBorderColor;
|
|
126
|
+
>.@{iconfont-css-prefix}-close {
|
|
127
|
+
color: fade(@@darkColor,80%);
|
|
128
|
+
}
|
|
129
|
+
&.@{tag-prefix-cls}-no-border{
|
|
130
|
+
border-color:transparent;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
&.@{tag-prefix-cls}-@{color}-inverse {
|
|
134
|
+
color: @text-color-inverse;
|
|
135
|
+
background: @@darkColor;
|
|
136
|
+
border-color: @@darkColor;
|
|
137
|
+
|
|
138
|
+
&.@{tag-prefix-cls}-no-border{
|
|
139
|
+
border-color:transparent;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.make-color-classes();
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
// 可选
|
|
149
|
+
&.@{tag-prefix-cls}-checkable {
|
|
150
|
+
background-color: @tag-default-bg;
|
|
151
|
+
border-color: transparent;
|
|
152
|
+
padding: 2px 12px;
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
&-border{
|
|
155
|
+
border-color: @border-color-base;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:active,
|
|
159
|
+
&-checked {
|
|
160
|
+
color: @primary-7;
|
|
161
|
+
background-color: @primary-1;
|
|
162
|
+
&.@{tag-prefix-cls}-checkable-border{
|
|
163
|
+
border-color: @primary-3;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&-checked {
|
|
168
|
+
&.@{tag-prefix-cls}-checkable-disabled:hover {
|
|
169
|
+
color: @primary-color;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&:not(&-checked){
|
|
174
|
+
&.@{tag-prefix-cls}-checkable-disabled:hover {
|
|
175
|
+
color: inherit;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&-disabled{
|
|
180
|
+
opacity: 0.5;
|
|
181
|
+
cursor: not-allowed;
|
|
182
|
+
&:hover{
|
|
183
|
+
opacity: 0.5;
|
|
184
|
+
color: inherit;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|