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,284 @@
|
|
|
1
|
+
import _get from "lodash/get";
|
|
2
|
+
import _cloneDeep from "lodash/cloneDeep";
|
|
3
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
import React, { useEffect, useState } from 'react';
|
|
12
|
+
import Popover from '../../../popover';
|
|
13
|
+
import SelectOpt from './Select';
|
|
14
|
+
import { highlightSubstring, getLabelFromOptions } from './utils';
|
|
15
|
+
import fieldsMap, { getFieldWidth } from '../fieldsMap';
|
|
16
|
+
import './FieldPopover.less';
|
|
17
|
+
const isInput = type => ['input', 'string', 'search', 'number', 'inputNumber'].includes(type);
|
|
18
|
+
export default (_a => {
|
|
19
|
+
var {
|
|
20
|
+
visible,
|
|
21
|
+
setVisible,
|
|
22
|
+
searchText,
|
|
23
|
+
children,
|
|
24
|
+
value,
|
|
25
|
+
onChange,
|
|
26
|
+
options,
|
|
27
|
+
locale,
|
|
28
|
+
searchTarget,
|
|
29
|
+
setSearchTarget,
|
|
30
|
+
clsPrefix
|
|
31
|
+
} = _a,
|
|
32
|
+
props = __rest(_a, ["visible", "setVisible", "searchText", "children", "value", "onChange", "options", "locale", "searchTarget", "setSearchTarget", "clsPrefix"]);
|
|
33
|
+
const [dataItem, setDataItem] = useState(null);
|
|
34
|
+
const onPropsClick = propItem => {
|
|
35
|
+
const copyValue = _cloneDeep(value);
|
|
36
|
+
if (!(copyValue === null || copyValue === void 0 ? void 0 : copyValue.find(v => v.key === propItem.name))) {
|
|
37
|
+
copyValue.push({
|
|
38
|
+
key: propItem.name,
|
|
39
|
+
value: propItem.type === 'array' ? [] : '',
|
|
40
|
+
label: (propItem.propsTitle || propItem.title || propItem.name) + ':'
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (isInput(propItem.type)) {
|
|
44
|
+
const target = copyValue.find(v => v.key === propItem.name);
|
|
45
|
+
onChange(target, true);
|
|
46
|
+
close();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setDataItem(propItem);
|
|
50
|
+
onChange(copyValue);
|
|
51
|
+
};
|
|
52
|
+
const onSelectChange = (v, isMultiple) => {
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
54
|
+
const copyValue = _cloneDeep(value || []);
|
|
55
|
+
let index;
|
|
56
|
+
if (v.dataItem) {
|
|
57
|
+
const _index = copyValue.findIndex(vv => {
|
|
58
|
+
var _a;
|
|
59
|
+
return vv.key === ((_a = v.dataItem) === null || _a === void 0 ? void 0 : _a.name);
|
|
60
|
+
});
|
|
61
|
+
if (_index > -1) {
|
|
62
|
+
index = _index;
|
|
63
|
+
} else {
|
|
64
|
+
copyValue.push({
|
|
65
|
+
key: (_a = v.dataItem) === null || _a === void 0 ? void 0 : _a.name,
|
|
66
|
+
value: isMultiple ? [] : '',
|
|
67
|
+
label: (((_b = v.dataItem) === null || _b === void 0 ? void 0 : _b.propsTitle) || ((_c = v.dataItem) === null || _c === void 0 ? void 0 : _c.title) || ((_d = v.dataItem) === null || _d === void 0 ? void 0 : _d.name)) + ':'
|
|
68
|
+
});
|
|
69
|
+
index = copyValue.length - 1;
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
index = copyValue.findIndex(v => v.key === (dataItem === null || dataItem === void 0 ? void 0 : dataItem.name));
|
|
73
|
+
}
|
|
74
|
+
if (isMultiple) {
|
|
75
|
+
if (!((_f = (_e = copyValue[index]) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.length)) {
|
|
76
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + (v === null || v === void 0 ? void 0 : v.label);
|
|
77
|
+
copyValue[index].value = [v === null || v === void 0 ? void 0 : v.value];
|
|
78
|
+
} else {
|
|
79
|
+
if (((_g = copyValue[index].value) === null || _g === void 0 ? void 0 : _g.indexOf(v.value)) > -1) {
|
|
80
|
+
copyValue[index].value = copyValue[index].value.filter(val => val !== v.value);
|
|
81
|
+
const regex = new RegExp(`\\|?${v.label}`, 'g'); //new RegExp(`\\|?${variable}`, 'g')
|
|
82
|
+
const result = copyValue[index].label.replace(regex, '');
|
|
83
|
+
copyValue[index].label = result;
|
|
84
|
+
} else {
|
|
85
|
+
copyValue[index].value.push(v.value);
|
|
86
|
+
copyValue[index].label += '|' + (v === null || v === void 0 ? void 0 : v.label);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
copyValue[index].value = v === null || v === void 0 ? void 0 : v.value;
|
|
91
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + (v === null || v === void 0 ? void 0 : v.label);
|
|
92
|
+
close();
|
|
93
|
+
}
|
|
94
|
+
onChange(copyValue, false, true);
|
|
95
|
+
};
|
|
96
|
+
const onFieldChange = (...args) => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
const {
|
|
99
|
+
type,
|
|
100
|
+
component,
|
|
101
|
+
props: fieldProps,
|
|
102
|
+
setLabel
|
|
103
|
+
} = dataItem || {};
|
|
104
|
+
const {
|
|
105
|
+
onChange: onChangeCustom,
|
|
106
|
+
options
|
|
107
|
+
} = fieldProps || {};
|
|
108
|
+
onChangeCustom && onChangeCustom(...args);
|
|
109
|
+
const copyValue = _cloneDeep(value);
|
|
110
|
+
const index = copyValue.findIndex(v => v.key === (dataItem === null || dataItem === void 0 ? void 0 : dataItem.name));
|
|
111
|
+
copyValue[index].value = args[0];
|
|
112
|
+
if (type === 'date') {
|
|
113
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + args[1];
|
|
114
|
+
close();
|
|
115
|
+
} else if (type === 'dateRange') {
|
|
116
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.join('~'));
|
|
117
|
+
if ((_b = args[1]) === null || _b === void 0 ? void 0 : _b[1]) {
|
|
118
|
+
close();
|
|
119
|
+
}
|
|
120
|
+
} else if (type === 'selectInput') {
|
|
121
|
+
const key = _get(Object.keys(args[0]), '0');
|
|
122
|
+
const val = _get(args[0], key);
|
|
123
|
+
const label = getLabelFromOptions(key, options);
|
|
124
|
+
copyValue[index].label = `${label}: ${val}`;
|
|
125
|
+
} else if (type === 'checkbox') {
|
|
126
|
+
copyValue[index].label = `${copyValue[index].label.match(/(.*:)/)[0]} ${args[0] ? local.Yes : local.No}`;
|
|
127
|
+
close();
|
|
128
|
+
} else if (!type && component) {
|
|
129
|
+
if (setLabel) {
|
|
130
|
+
// setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制
|
|
131
|
+
copyValue[index].label = setLabel(args[0]);
|
|
132
|
+
} else {
|
|
133
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + (args[1] || args[0]);
|
|
134
|
+
}
|
|
135
|
+
close();
|
|
136
|
+
}
|
|
137
|
+
onChange(copyValue, false, true);
|
|
138
|
+
// close()
|
|
139
|
+
};
|
|
140
|
+
const close = () => {
|
|
141
|
+
setVisible(false);
|
|
142
|
+
};
|
|
143
|
+
const handleVisibleChange = visible => {
|
|
144
|
+
setVisible(visible);
|
|
145
|
+
};
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
setDataItem(null);
|
|
148
|
+
}, [visible]);
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
let bool1 = false,
|
|
151
|
+
bool2 = false;
|
|
152
|
+
if (searchText) {
|
|
153
|
+
options === null || options === void 0 ? void 0 : options.forEach(v => {
|
|
154
|
+
const {
|
|
155
|
+
name,
|
|
156
|
+
propsTitle,
|
|
157
|
+
title,
|
|
158
|
+
type,
|
|
159
|
+
props
|
|
160
|
+
} = v.props || {};
|
|
161
|
+
const _propsTitle = propsTitle || title || name;
|
|
162
|
+
if ((_propsTitle === null || _propsTitle === void 0 ? void 0 : _propsTitle.indexOf(searchText)) > -1) {
|
|
163
|
+
bool1 = true;
|
|
164
|
+
}
|
|
165
|
+
const sOptions = type !== 'select' ? [] : (props === null || props === void 0 ? void 0 : props.options) || [];
|
|
166
|
+
const fieldNames = props === null || props === void 0 ? void 0 : props.fieldNames;
|
|
167
|
+
const target = sOptions === null || sOptions === void 0 ? void 0 : sOptions.find(item => {
|
|
168
|
+
const labelKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label';
|
|
169
|
+
const label = item instanceof Object ? item[labelKey] : item;
|
|
170
|
+
return (label === null || label === void 0 ? void 0 : label.indexOf(searchText)) > -1;
|
|
171
|
+
});
|
|
172
|
+
if (target) {
|
|
173
|
+
bool2 = true;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
setSearchTarget(!bool2 && !bool1 ? null : {
|
|
177
|
+
propsTitle: bool1,
|
|
178
|
+
propsValue: bool2
|
|
179
|
+
});
|
|
180
|
+
} else {
|
|
181
|
+
setSearchTarget(null);
|
|
182
|
+
}
|
|
183
|
+
}, [options, searchText]);
|
|
184
|
+
const renderFirstOptions = menu => {
|
|
185
|
+
return React.createElement("div", null, (!searchText || (searchTarget === null || searchTarget === void 0 ? void 0 : searchTarget.propsTitle)) && React.createElement("label", null, locale.propTitle), React.createElement("ul", {
|
|
186
|
+
className: "ant-select-dropdown-menu"
|
|
187
|
+
}, options === null || options === void 0 ? void 0 : options.map(v => {
|
|
188
|
+
const {
|
|
189
|
+
name,
|
|
190
|
+
propsTitle,
|
|
191
|
+
title,
|
|
192
|
+
type,
|
|
193
|
+
props
|
|
194
|
+
} = v.props || {};
|
|
195
|
+
const _propsTitle = propsTitle || title || name;
|
|
196
|
+
if (searchText) {
|
|
197
|
+
if ((_propsTitle === null || _propsTitle === void 0 ? void 0 : _propsTitle.indexOf(searchText)) > -1) {
|
|
198
|
+
return React.createElement("li", {
|
|
199
|
+
className: "ant-select-dropdown-menu-item",
|
|
200
|
+
key: name,
|
|
201
|
+
value: name,
|
|
202
|
+
onMouseDown: e => e.preventDefault(),
|
|
203
|
+
onClick: () => {
|
|
204
|
+
onPropsClick(v.props);
|
|
205
|
+
}
|
|
206
|
+
}, React.createElement("span", {
|
|
207
|
+
dangerouslySetInnerHTML: {
|
|
208
|
+
__html: highlightSubstring(_propsTitle, searchText)
|
|
209
|
+
}
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
return '';
|
|
213
|
+
}
|
|
214
|
+
return React.createElement("li", {
|
|
215
|
+
className: "ant-select-dropdown-menu-item",
|
|
216
|
+
key: name,
|
|
217
|
+
value: name,
|
|
218
|
+
onMouseDown: e => e.preventDefault(),
|
|
219
|
+
onClick: () => {
|
|
220
|
+
onPropsClick(v.props);
|
|
221
|
+
}
|
|
222
|
+
}, _propsTitle);
|
|
223
|
+
})), searchText && React.createElement("div", null, (searchTarget === null || searchTarget === void 0 ? void 0 : searchTarget.propsValue) && React.createElement("label", null, locale.propValue), React.createElement("ul", {
|
|
224
|
+
className: "ant-select-dropdown-menu"
|
|
225
|
+
}, options === null || options === void 0 ? void 0 : options.map(v => {
|
|
226
|
+
const {
|
|
227
|
+
name,
|
|
228
|
+
propsTitle,
|
|
229
|
+
type,
|
|
230
|
+
props
|
|
231
|
+
} = v.props || {};
|
|
232
|
+
const target = value === null || value === void 0 ? void 0 : value.find(v => v.key === name);
|
|
233
|
+
if (type === 'select' && props && props.options && props.options.length > 0) {
|
|
234
|
+
return React.createElement(SelectOpt, Object.assign({}, props, {
|
|
235
|
+
searchText: searchText,
|
|
236
|
+
onChange: onSelectChange,
|
|
237
|
+
value: target === null || target === void 0 ? void 0 : target.value,
|
|
238
|
+
dataItem: v.props
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}))));
|
|
243
|
+
};
|
|
244
|
+
const renderSecondOptions = () => {
|
|
245
|
+
var _a;
|
|
246
|
+
const {
|
|
247
|
+
name,
|
|
248
|
+
propsTitle,
|
|
249
|
+
title,
|
|
250
|
+
type,
|
|
251
|
+
className,
|
|
252
|
+
component,
|
|
253
|
+
props: fieldProps
|
|
254
|
+
} = dataItem || {};
|
|
255
|
+
const target = value === null || value === void 0 ? void 0 : value.find(v => v.key === name);
|
|
256
|
+
const Field = component || fieldsMap[type];
|
|
257
|
+
return React.createElement("div", {
|
|
258
|
+
onClick: e => e.stopPropagation(),
|
|
259
|
+
className: className
|
|
260
|
+
}, React.createElement("label", null, propsTitle || title || name), type === 'select' ? React.createElement(SelectOpt, Object.assign({}, fieldProps, {
|
|
261
|
+
onChange: onSelectChange,
|
|
262
|
+
value: target === null || target === void 0 ? void 0 : target.value
|
|
263
|
+
})) : React.createElement("div", {
|
|
264
|
+
className: `${clsPrefix}-field-popover-content`,
|
|
265
|
+
onClick: e => e.stopPropagation()
|
|
266
|
+
}, React.createElement(Field, Object.assign({
|
|
267
|
+
value: target === null || target === void 0 ? void 0 : target.value
|
|
268
|
+
}, fieldProps, {
|
|
269
|
+
style: Object.assign(Object.assign({}, fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.style), {
|
|
270
|
+
width: ((_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.style) === null || _a === void 0 ? void 0 : _a.width) || getFieldWidth(type)
|
|
271
|
+
}),
|
|
272
|
+
onChange: onFieldChange
|
|
273
|
+
}))));
|
|
274
|
+
};
|
|
275
|
+
return React.createElement(Popover, Object.assign({
|
|
276
|
+
trigger: "click",
|
|
277
|
+
// onClick={(e) => e.stopPropagation()}
|
|
278
|
+
visible: visible,
|
|
279
|
+
placement: "bottom",
|
|
280
|
+
overlayClassName: `${clsPrefix}-field-popover`,
|
|
281
|
+
content: !dataItem ? renderFirstOptions() : renderSecondOptions(),
|
|
282
|
+
onVisibleChange: handleVisibleChange
|
|
283
|
+
}, props), children);
|
|
284
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldPopover.js","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/FieldPopover.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,OAAO,MAAM,kBAAkB,CAAA;AACtC,OAAO,SAAS,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,qB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,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,SAAS;YAC5D,mCAAQ,UAAU,IAAI,KAAK,IAAI,IAAI,CAAS;YAC3C,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CACnB,oBAAC,SAAS,oBAAK,UAAU,IAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,IAAI,CAC9E,CAAC,CAAC,CAAC,CACF,6BAAK,SAAS,EAAE,GAAG,SAAS,wBAAwB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE;gBACvF,oBAAC,KAAK,kBACJ,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,IAChB,UAAU,IACd,KAAK,kCACA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KACpB,KAAK,EAAE,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,0CAAE,KAAK,KAAI,aAAa,CAAC,IAAI,CAAC,KAExD,QAAQ,EAAE,aAAa,IACvB,CACE,CACP,CACG,CACP,CAAA;IACH,CAAC,CAAA;IAED,OAAO,CACL,oBAAC,OAAO,kBACN,OAAO,EAAC,OAAO;QACf,wCAAwC;QACxC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,QAAQ,EAClB,gBAAgB,EAAE,GAAG,SAAS,gBAAgB,EAC9C,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,mBAAmB,EAAE,EACjE,eAAe,EAAE,mBAAmB,IAChC,KAAK,GAER,QAAQ,CACD,CACX,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { cloneDeep } from 'lodash'\nimport Popover from '../../../popover'\nimport SelectOpt from './Select'\nimport { highlightSubstring, getLabelFromOptions } from './utils'\nimport { get } from 'lodash'\n\nimport fieldsMap, { getFieldWidth } from '../fieldsMap'\nimport './FieldPopover.less'\nconst isInput = (type) => ['input', 'string', 'search', 'number', 'inputNumber'].includes(type)\n\nexport default ({\n visible,\n setVisible,\n searchText,\n children,\n value,\n onChange,\n options,\n locale,\n searchTarget,\n setSearchTarget,\n clsPrefix,\n ...props\n}) => {\n const [dataItem, setDataItem] = useState(null)\n\n const onPropsClick = (propItem) => {\n const copyValue = cloneDeep(value)\n\n if (!copyValue?.find((v) => v.key === propItem.name)) {\n copyValue.push({\n key: propItem.name,\n value: propItem.type === 'array' ? [] : '',\n label: (propItem.propsTitle || propItem.title || propItem.name) + ':',\n })\n }\n if (isInput(propItem.type)) {\n const target = copyValue.find((v) => v.key === propItem.name)\n onChange(target, true)\n close()\n return\n }\n setDataItem(propItem)\n onChange(copyValue)\n }\n\n const onSelectChange = (v, isMultiple) => {\n const copyValue = cloneDeep(value || [])\n let index\n if (v.dataItem) {\n const _index = copyValue.findIndex((vv) => vv.key === v.dataItem?.name)\n if (_index > -1) {\n index = _index\n } else {\n copyValue.push({\n key: v.dataItem?.name,\n value: isMultiple ? [] : '',\n label: (v.dataItem?.propsTitle || v.dataItem?.title || v.dataItem?.name) + ':',\n })\n index = copyValue.length - 1\n }\n } else {\n index = copyValue.findIndex((v) => v.key === dataItem?.name)\n }\n\n if (isMultiple) {\n if (!copyValue[index]?.value?.length) {\n copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + v?.label\n copyValue[index].value = [v?.value]\n } else {\n if (copyValue[index].value?.indexOf(v.value) > -1) {\n copyValue[index].value = copyValue[index].value.filter((val) => val !== v.value)\n const regex = new RegExp(`\\\\|?${v.label}`, 'g') //new RegExp(`\\\\|?${variable}`, 'g')\n const result = copyValue[index].label.replace(regex, '')\n copyValue[index].label = result\n } else {\n copyValue[index].value.push(v.value)\n copyValue[index].label += '|' + v?.label\n }\n }\n } else {\n copyValue[index].value = v?.value\n copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + v?.label\n close()\n }\n onChange(copyValue, false, true)\n }\n\n const onFieldChange = (...args) => {\n const { type, component, props: fieldProps, setLabel } = dataItem || {}\n const { onChange: onChangeCustom, options } = fieldProps || {}\n onChangeCustom && onChangeCustom(...args)\n const copyValue = cloneDeep(value)\n const index = copyValue.findIndex((v) => v.key === dataItem?.name)\n copyValue[index].value = args[0]\n if (type === 'date') {\n copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + args[1]\n close()\n } else if (type === 'dateRange') {\n copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + args[1]?.join('~')\n if (args[1]?.[1]) {\n close()\n }\n } else if (type === 'selectInput') {\n const key = get(Object.keys(args[0]), '0')\n const val = get(args[0], key)\n const label = getLabelFromOptions(key, options)\n copyValue[index].label = `${label}: ${val}`\n } else if (type === 'checkbox') {\n copyValue[index].label = `${copyValue[index].label.match(/(.*:)/)[0]} ${\n args[0] ? local.Yes : local.No\n }`\n close()\n } else if (!type && component) {\n if (setLabel) {\n // setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制\n copyValue[index].label = setLabel(args[0])\n } else {\n copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + (args[1] || args[0])\n }\n close()\n }\n onChange(copyValue, false, true)\n // close()\n }\n\n const close = () => {\n setVisible(false)\n }\n const handleVisibleChange = (visible) => {\n setVisible(visible)\n }\n useEffect(() => {\n setDataItem(null)\n }, [visible])\n\n useEffect(() => {\n let bool1 = false,\n bool2 = false\n if (searchText) {\n options?.forEach((v) => {\n const { name, propsTitle, title, type, props } = v.props || {}\n const _propsTitle = propsTitle || title || name\n if (_propsTitle?.indexOf(searchText) > -1) {\n bool1 = true\n }\n const sOptions = type !== 'select' ? [] : props?.options || []\n const fieldNames = props?.fieldNames\n const target = sOptions?.find((item) => {\n const labelKey = fieldNames?.label || 'label'\n const label = item instanceof Object ? item[labelKey] : item\n return label?.indexOf(searchText) > -1\n })\n if (target) {\n bool2 = true\n }\n })\n setSearchTarget(!bool2 && !bool1 ? null : { propsTitle: bool1, propsValue: bool2 })\n } else {\n setSearchTarget(null)\n }\n }, [options, searchText])\n const renderFirstOptions = (menu) => {\n return (\n <div>\n {(!searchText || searchTarget?.propsTitle) && <label>{locale.propTitle}</label>}\n <ul className=\"ant-select-dropdown-menu\">\n {options?.map((v) => {\n const { name, propsTitle, title, type, props } = v.props || {}\n const _propsTitle = propsTitle || title || name\n if (searchText) {\n if (_propsTitle?.indexOf(searchText) > -1) {\n return (\n <li\n className=\"ant-select-dropdown-menu-item\"\n key={name}\n value={name}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n onPropsClick(v.props)\n }}\n >\n <span\n dangerouslySetInnerHTML={{\n __html: highlightSubstring(_propsTitle, searchText),\n }}\n ></span>\n </li>\n )\n }\n return ''\n }\n return (\n <li\n className=\"ant-select-dropdown-menu-item\"\n key={name}\n value={name}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n onPropsClick(v.props)\n }}\n >\n {_propsTitle}\n </li>\n )\n })}\n </ul>\n {searchText && (\n <div>\n {searchTarget?.propsValue && <label>{locale.propValue}</label>}\n <ul className=\"ant-select-dropdown-menu\">\n {options?.map((v) => {\n const { name, propsTitle, type, props } = v.props || {}\n const target = value?.find((v) => v.key === name)\n if (type === 'select' && props && props.options && props.options.length > 0) {\n return (\n <SelectOpt\n {...props}\n searchText={searchText}\n onChange={onSelectChange}\n value={target?.value}\n dataItem={v.props}\n />\n )\n }\n return\n })}\n </ul>\n </div>\n )}\n </div>\n )\n }\n\n const renderSecondOptions = () => {\n const {\n name,\n propsTitle,\n title,\n type,\n className,\n component,\n props: fieldProps,\n } = dataItem || {}\n const target = value?.find((v) => v.key === name)\n const Field = component || fieldsMap[type]\n\n return (\n <div onClick={(e) => e.stopPropagation()} className={className}>\n <label>{propsTitle || title || name}</label>\n {type === 'select' ? (\n <SelectOpt {...fieldProps} onChange={onSelectChange} value={target?.value} />\n ) : (\n <div className={`${clsPrefix}-field-popover-content`} onClick={(e) => e.stopPropagation()}>\n <Field\n value={target?.value}\n {...fieldProps}\n style={{\n ...fieldProps?.style,\n width: fieldProps?.style?.width || getFieldWidth(type),\n }}\n onChange={onFieldChange}\n />\n </div>\n )}\n </div>\n )\n }\n\n return (\n <Popover\n trigger=\"click\"\n // onClick={(e) => e.stopPropagation()}\n visible={visible}\n placement=\"bottom\"\n overlayClassName={`${clsPrefix}-field-popover`}\n content={!dataItem ? renderFirstOptions() : renderSecondOptions()}\n onVisibleChange={handleVisibleChange}\n {...props}\n >\n {children}\n </Popover>\n )\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.tnt-queryform-field-popover {
|
|
2
|
+
min-width: 280px;
|
|
3
|
+
.ant-popover-inner-content {
|
|
4
|
+
padding: @padding-sm 0;
|
|
5
|
+
}
|
|
6
|
+
.ant-calendar-picker {
|
|
7
|
+
margin: @margin-xxs 0;
|
|
8
|
+
}
|
|
9
|
+
label {
|
|
10
|
+
color: tint(@text-color, 50%);
|
|
11
|
+
margin-bottom: @margin-xs;
|
|
12
|
+
display: block;
|
|
13
|
+
padding: 0 @padding-sm;
|
|
14
|
+
}
|
|
15
|
+
.ant-select-dropdown-menu {
|
|
16
|
+
&-item {
|
|
17
|
+
padding: @padding-xxs @padding-sm;
|
|
18
|
+
&:hover {
|
|
19
|
+
background-color: @bg-color-quaternary;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&-content {
|
|
24
|
+
padding: @padding-xxs @padding-sm;
|
|
25
|
+
}
|
|
26
|
+
.ant-select-selected-icon {
|
|
27
|
+
position: absolute;
|
|
28
|
+
right: @margin-base;
|
|
29
|
+
top: @margin-xs;
|
|
30
|
+
color: @blue-6;
|
|
31
|
+
}
|
|
32
|
+
.tnt-highlight {
|
|
33
|
+
color: @blue-6;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
import React, { useState, useEffect } from 'react';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import Icon from '../../../icon';
|
|
12
|
+
import { highlightSubstring } from './utils';
|
|
13
|
+
export default (props => {
|
|
14
|
+
const {
|
|
15
|
+
options,
|
|
16
|
+
params,
|
|
17
|
+
queryKey = 'name',
|
|
18
|
+
fieldNames = {
|
|
19
|
+
label: 'label',
|
|
20
|
+
value: 'value'
|
|
21
|
+
},
|
|
22
|
+
loadData,
|
|
23
|
+
onChange,
|
|
24
|
+
value: _value,
|
|
25
|
+
mode,
|
|
26
|
+
searchText,
|
|
27
|
+
dataItem
|
|
28
|
+
} = props,
|
|
29
|
+
rest = __rest(props, ["options", "params", "queryKey", "fieldNames", "loadData", "onChange", "value", "mode", "searchText", "dataItem"]);
|
|
30
|
+
const [items, setItems] = useState(options || []);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (loadData) {
|
|
33
|
+
loadData(Object.assign({
|
|
34
|
+
[queryKey]: searchText
|
|
35
|
+
}, params || {})).then(items => {
|
|
36
|
+
setItems(items);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}, [params, searchText]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
setItems(options || []);
|
|
42
|
+
}, [options]);
|
|
43
|
+
const onValueChange = item => {
|
|
44
|
+
onChange(item, mode === 'multiple' || mode === 'tags');
|
|
45
|
+
};
|
|
46
|
+
return React.createElement("ul", {
|
|
47
|
+
className: "ant-select-dropdown-menu"
|
|
48
|
+
}, items.map(item => {
|
|
49
|
+
const labelKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label';
|
|
50
|
+
const valueKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value';
|
|
51
|
+
const value = item instanceof Object ? item[valueKey] : item;
|
|
52
|
+
const label = item instanceof Object ? item[labelKey] : item;
|
|
53
|
+
const optionProps = item instanceof Object ? item : {};
|
|
54
|
+
console.log('value1', value);
|
|
55
|
+
console.log('value2', _value);
|
|
56
|
+
const isSelected = !_value ? false : typeof _value === 'string' ? value === _value : (_value === null || _value === void 0 ? void 0 : _value.indexOf(value)) > -1;
|
|
57
|
+
if (searchText) {
|
|
58
|
+
if ((label === null || label === void 0 ? void 0 : label.indexOf(searchText)) > -1) {
|
|
59
|
+
return React.createElement("li", {
|
|
60
|
+
className: classNames({
|
|
61
|
+
'ant-select-dropdown-menu-item': true,
|
|
62
|
+
// 'ant-select-dropdown-menu-item-active': value === _value,
|
|
63
|
+
'ant-select-dropdown-menu-item-selected': isSelected
|
|
64
|
+
}),
|
|
65
|
+
key: value,
|
|
66
|
+
value: value,
|
|
67
|
+
onMouseDown: e => e.preventDefault(),
|
|
68
|
+
onClick: () => {
|
|
69
|
+
onValueChange({
|
|
70
|
+
value,
|
|
71
|
+
label,
|
|
72
|
+
optionProps,
|
|
73
|
+
dataItem
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}, React.createElement("span", null, (dataItem === null || dataItem === void 0 ? void 0 : dataItem.propsTitle) || (dataItem === null || dataItem === void 0 ? void 0 : dataItem.name), ": "), React.createElement("span", {
|
|
77
|
+
dangerouslySetInnerHTML: {
|
|
78
|
+
__html: highlightSubstring(label, searchText)
|
|
79
|
+
}
|
|
80
|
+
}), isSelected && React.createElement(Icon, {
|
|
81
|
+
type: "check",
|
|
82
|
+
className: "ant-select-selected-icon"
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
87
|
+
return React.createElement("li", {
|
|
88
|
+
className: classNames({
|
|
89
|
+
'ant-select-dropdown-menu-item': true,
|
|
90
|
+
// 'ant-select-dropdown-menu-item-active': value === _value,
|
|
91
|
+
'ant-select-dropdown-menu-item-selected': isSelected
|
|
92
|
+
}),
|
|
93
|
+
key: value,
|
|
94
|
+
value: value,
|
|
95
|
+
onMouseDown: e => e.preventDefault(),
|
|
96
|
+
onClick: () => {
|
|
97
|
+
onValueChange({
|
|
98
|
+
value,
|
|
99
|
+
label,
|
|
100
|
+
optionProps
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}, label, isSelected && React.createElement(Icon, {
|
|
104
|
+
type: "check",
|
|
105
|
+
className: "ant-select-selected-icon"
|
|
106
|
+
}));
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/Select.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAElD,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,IAAI,MAAM,eAAe,CAAA;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EACJ,OAAO,EACP,MAAM,EACN,QAAQ,GAAG,MAAM,EACjB,UAAU,GAAG;QACX,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,OAAO;KACf,EACD,QAAQ,EACR,QAAQ,EACR,KAAK,EAAE,MAAM,EACb,IAAI,EACJ,UAAU,EACV,QAAQ,KAEN,KAAK,EADJ,IAAI,UACL,KAAK,EAfH,kHAeL,CAAQ,CAAA;IACT,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,OAAO,IA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aACF;YACD,OAAO,EAAE,CAAA;SACV;QACD,OAAO,CACL,4BACE,SAAS,EAAE,UAAU,CAAC;gBACpB,+BAA+B,EAAE,IAAI;gBACrC,4DAA4D;gBAC5D,wCAAwC,EAAE,UAAU;aACrD,CAAC,EACF,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;YAC9C,CAAC;YAEA,KAAK;YACL,UAAU,IAAI,oBAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,0BAA0B,GAAG,CACtE,CACN,CAAA;IACH,CAAC,CAAC,CACC,CACN,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { useState, useEffect } from 'react'\n\nimport classNames from 'classnames'\nimport Icon from '../../../icon'\nimport { highlightSubstring } from './utils'\n\nexport default (props) => {\n const {\n options,\n params,\n queryKey = 'name',\n fieldNames = {\n label: 'label',\n value: 'value',\n },\n loadData,\n onChange,\n value: _value,\n mode,\n searchText,\n dataItem,\n ...rest\n } = props\n const [items, setItems] = useState(options || [])\n\n useEffect(() => {\n if (loadData) {\n loadData({\n [queryKey]: searchText,\n ...(params || {}),\n }).then((items) => {\n setItems(items)\n })\n }\n }, [params, searchText])\n\n useEffect(() => {\n setItems(options || [])\n }, [options])\n\n const onValueChange = (item) => {\n onChange(item, mode === 'multiple' || mode === 'tags')\n }\n \n return (\n <ul className=\"ant-select-dropdown-menu\">\n {items.map((item) => {\n const labelKey = fieldNames?.label || 'label'\n const valueKey = fieldNames?.value || 'value'\n const value = item instanceof Object ? item[valueKey] : item\n const label = item instanceof Object ? item[labelKey] : item\n const optionProps = item instanceof Object ? item : {}\n console.log('value1', value)\n console.log('value2', _value)\n\n const isSelected = !_value ? false :\n (typeof _value === 'string' ? value === _value : _value?.indexOf(value) > -1)\n if (searchText) {\n if (label?.indexOf(searchText) > -1) {\n return (\n <li\n className={classNames({\n 'ant-select-dropdown-menu-item': true,\n // 'ant-select-dropdown-menu-item-active': value === _value,\n 'ant-select-dropdown-menu-item-selected': isSelected,\n })}\n key={value}\n value={value}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n onValueChange({ value, label, optionProps, dataItem, })\n }}\n >\n <span>{dataItem?.propsTitle||dataItem?.name}: </span>\n <span\n dangerouslySetInnerHTML={{\n __html: highlightSubstring(label, searchText),\n }}\n ></span>\n {isSelected && <Icon type=\"check\" className=\"ant-select-selected-icon\" />}\n </li>\n )\n }\n return ''\n }\n return (\n <li\n className={classNames({\n 'ant-select-dropdown-menu-item': true,\n // 'ant-select-dropdown-menu-item-active': value === _value,\n 'ant-select-dropdown-menu-item-selected': isSelected,\n })}\n key={value}\n value={value}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n onValueChange({ value, label, optionProps })\n }}\n >\n {label}\n {isSelected && <Icon type=\"check\" className=\"ant-select-selected-icon\" />}\n </li>\n )\n })}\n </ul>\n )\n}\n"]}
|