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,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _configProvider = require("antd/lib/config-provider");
|
|
10
|
+
var _progress = _interopRequireDefault(require("antd/lib/progress"));
|
|
11
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
var _ellipsis = _interopRequireDefault(require("../ellipsis"));
|
|
13
|
+
var _icon = _interopRequireDefault(require("../icon"));
|
|
14
|
+
require("./progress.less");
|
|
15
|
+
var _tooltip = require("antd/lib/tooltip");
|
|
16
|
+
Object.keys(_tooltip).forEach(function (key) {
|
|
17
|
+
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
|
+
if (key in exports && exports[key] === _tooltip[key]) return;
|
|
20
|
+
Object.defineProperty(exports, key, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _tooltip[key];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
28
|
+
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); }
|
|
29
|
+
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; }
|
|
30
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
31
|
+
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); }
|
|
32
|
+
var iconMap = {
|
|
33
|
+
line: {
|
|
34
|
+
success: 'check-circle',
|
|
35
|
+
exception: 'close-circle'
|
|
36
|
+
},
|
|
37
|
+
circle: {
|
|
38
|
+
success: 'check',
|
|
39
|
+
exception: 'close'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var ifPercentBottom = function ifPercentBottom(type, percentPosition) {
|
|
43
|
+
return type === 'line' && percentPosition === 'bottom';
|
|
44
|
+
};
|
|
45
|
+
var percentTransform = function percentTransform(percent) {
|
|
46
|
+
return percent >= 100 ? 100 : percent <= 0 ? 0 : percent;
|
|
47
|
+
};
|
|
48
|
+
var themeStrokeColor = function themeStrokeColor(status, strokeColor, percent) {
|
|
49
|
+
return status !== 'success' && status !== 'exception' && !strokeColor && percent !== 100 ? 'var(--blue-5)' : '';
|
|
50
|
+
};
|
|
51
|
+
var Progress = function Progress(props) {
|
|
52
|
+
var className = props.className,
|
|
53
|
+
_props$type = props.type,
|
|
54
|
+
type = _props$type === void 0 ? 'line' : _props$type,
|
|
55
|
+
_props$percentPositio = props.percentPosition,
|
|
56
|
+
percentPosition = _props$percentPositio === void 0 ? 'right' : _props$percentPositio,
|
|
57
|
+
_props$percent = props.percent,
|
|
58
|
+
percent = _props$percent === void 0 ? 0 : _props$percent,
|
|
59
|
+
format = props.format,
|
|
60
|
+
size = props.size,
|
|
61
|
+
label = props.label,
|
|
62
|
+
_props$width = props.width,
|
|
63
|
+
width = _props$width === void 0 ? 132 : _props$width,
|
|
64
|
+
status = props.status,
|
|
65
|
+
halfCircle = props.halfCircle,
|
|
66
|
+
_props$gapDegree = props.gapDegree,
|
|
67
|
+
gapDegree = _props$gapDegree === void 0 ? props.halfCircle ? 135 : props.gapDegree : _props$gapDegree,
|
|
68
|
+
strokeColor = props.strokeColor,
|
|
69
|
+
_props$strokeWidth = props.strokeWidth,
|
|
70
|
+
strokeWidth = _props$strokeWidth === void 0 ? 7 : _props$strokeWidth;
|
|
71
|
+
var _percent = percentTransform(percent);
|
|
72
|
+
var _strokeColor = themeStrokeColor(status, strokeColor, _percent);
|
|
73
|
+
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref) {
|
|
74
|
+
var getPrefixCls = _ref.getPrefixCls;
|
|
75
|
+
var prefixCls = getPrefixCls('progress');
|
|
76
|
+
var CusLabelOrPercent = function CusLabelOrPercent(props) {
|
|
77
|
+
var type = props.type,
|
|
78
|
+
theme = props.theme;
|
|
79
|
+
var labelPercentClassName = (0, _classnames["default"])("".concat(prefixCls, "-percent-bottom"), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-percent-bottom-").concat(size), size === 'small'), "".concat(prefixCls, "-percent-bottom-").concat(type), type === 'line'));
|
|
80
|
+
var showIcon = function showIcon(status) {
|
|
81
|
+
return _react["default"].createElement(_icon["default"], {
|
|
82
|
+
type: "".concat(iconMap[type][status]),
|
|
83
|
+
theme: theme,
|
|
84
|
+
className: (0, _classnames["default"])(_defineProperty({}, "".concat(labelPercentClassName, " ").concat(labelPercentClassName, "-").concat(status || 'success'), type === 'line'))
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
var showPercent = _react["default"].createElement("div", {
|
|
88
|
+
className: labelPercentClassName
|
|
89
|
+
}, format ? format === null || format === void 0 ? void 0 : format(_percent) : _percent + '%');
|
|
90
|
+
var displayContent;
|
|
91
|
+
if (status === 'success' || status === 'exception') {
|
|
92
|
+
displayContent = showIcon(status);
|
|
93
|
+
} else if (status === 'normal' || status === 'active') {
|
|
94
|
+
displayContent = showPercent;
|
|
95
|
+
} else {
|
|
96
|
+
// 如果状态为空
|
|
97
|
+
displayContent = _percent === 100 ? showIcon('success') : showPercent;
|
|
98
|
+
}
|
|
99
|
+
return displayContent;
|
|
100
|
+
};
|
|
101
|
+
var CusCircleAndDashboardFormat = function CusCircleAndDashboardFormat(props) {
|
|
102
|
+
var widthNum = props.widthNum;
|
|
103
|
+
return _react["default"].createElement("div", {
|
|
104
|
+
className: "".concat(prefixCls, "-cus-format")
|
|
105
|
+
}, !!label && _react["default"].createElement(_ellipsis["default"], {
|
|
106
|
+
className: "".concat(prefixCls, "-cus-format-label"),
|
|
107
|
+
title: label,
|
|
108
|
+
widthLimit: widthNum <= 64 ? widthNum : 'calc(100% - 50px)',
|
|
109
|
+
placement: widthNum <= 64 ? 'bottom' : 'top'
|
|
110
|
+
}), _react["default"].createElement(CusLabelOrPercent, {
|
|
111
|
+
type: "circle",
|
|
112
|
+
theme: "outlined"
|
|
113
|
+
}));
|
|
114
|
+
};
|
|
115
|
+
//line
|
|
116
|
+
var LineProgress = function LineProgress() {
|
|
117
|
+
return _react["default"].createElement(_progress["default"], Object.assign({
|
|
118
|
+
strokeColor: _strokeColor
|
|
119
|
+
}, props, {
|
|
120
|
+
className: (0, _classnames["default"])('tnt-progress', className, _defineProperty({}, "".concat(prefixCls, "-percent-bottom"), percentPosition === 'bottom'))
|
|
121
|
+
}));
|
|
122
|
+
};
|
|
123
|
+
//circle,dashboard (额外新增label和半圆选项)
|
|
124
|
+
var CircleAndDashboardProgress = function CircleAndDashboardProgress() {
|
|
125
|
+
var widthNum = Number(String(width).split('px').shift());
|
|
126
|
+
return _react["default"].createElement(_progress["default"], Object.assign({
|
|
127
|
+
gapDegree: gapDegree,
|
|
128
|
+
strokeColor: _strokeColor,
|
|
129
|
+
strokeWidth: strokeWidth
|
|
130
|
+
}, props, {
|
|
131
|
+
type: halfCircle ? 'dashboard' : type,
|
|
132
|
+
className: (0, _classnames["default"])('tnt-progress', "".concat(prefixCls, "-circle-progress"), className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-small-circle"), widthNum <= 64 && label), "".concat(prefixCls, "-large-circle"), widthNum > 64 && label), "".concat(prefixCls, "-small-half-circle"), halfCircle && widthNum <= 64 && label), "".concat(prefixCls, "-large-half-circle"), halfCircle && widthNum > 64 && label)),
|
|
133
|
+
format: function format() {
|
|
134
|
+
return _react["default"].createElement(CusCircleAndDashboardFormat, {
|
|
135
|
+
widthNum: widthNum
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
};
|
|
140
|
+
var progressMap = {
|
|
141
|
+
line: _react["default"].createElement(LineProgress, null),
|
|
142
|
+
circle: _react["default"].createElement(CircleAndDashboardProgress, null),
|
|
143
|
+
dashboard: _react["default"].createElement(CircleAndDashboardProgress, null)
|
|
144
|
+
};
|
|
145
|
+
return progressMap[type];
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
var _default = exports["default"] = Progress;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/progress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} from 'antd/lib/progress'\nimport type { ThemeType } from 'antd/lib/icon'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport AntdProgress from 'antd/lib/progress'\nimport classNames from 'classnames'\nimport Ellipsis from '../ellipsis'\nimport Icon from '../icon'\nimport './progress.less'\nexport * from 'antd/lib/tooltip'\n\ninterface ExtendsProgress {\n percentPosition?: 'bottom' | 'right'\n label?: React.ReactNode\n halfCircle?: boolean\n}\nconst iconMap = {\n line: {\n success: 'check-circle',\n exception: 'close-circle',\n },\n circle: {\n success: 'check',\n exception: 'close',\n },\n}\nconst ifPercentBottom = (type: string, percentPosition: string) => {\n return type === 'line' && percentPosition === 'bottom'\n}\nconst percentTransform = (percent: number) => {\n return percent >= 100 ? 100 : percent <= 0 ? 0 : percent\n}\n\nconst themeStrokeColor = (status?: string, strokeColor?: string | object, percent?: number) => {\n return status !== 'success' && status !== 'exception' && !strokeColor && percent !== 100\n ? 'var(--blue-5)'\n : ''\n}\n\nconst Progress: React.FC<ProgressProps & ExtendsProgress> = (props) => {\n const {\n className,\n type = 'line',\n percentPosition = 'right',\n percent = 0,\n format,\n size,\n label,\n width = 132,\n status,\n halfCircle,\n gapDegree = props.halfCircle ? 135 : props.gapDegree,\n strokeColor,\n strokeWidth = 7,\n } = props\n const _percent = percentTransform(percent)\n const _strokeColor = themeStrokeColor(status, strokeColor, _percent)\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('progress')\n\n const CusLabelOrPercent = (props: { type: 'line' | 'circle'; theme?: ThemeType }) => {\n const { type, theme } = props\n const labelPercentClassName = classNames(`${prefixCls}-percent-bottom`, {\n [`${prefixCls}-percent-bottom-${size}`]: size === 'small',\n [`${prefixCls}-percent-bottom-${type}`]: type === 'line',\n })\n\n const showIcon = (status: 'success' | 'exception') => (\n <Icon\n type={`${iconMap[type][status]}`}\n theme={theme}\n className={classNames({\n [`${labelPercentClassName} ${labelPercentClassName}-${status || 'success'}`]:\n type === 'line',\n })}\n />\n )\n const showPercent = (\n <div className={labelPercentClassName}>\n {format ? format?.(_percent) : _percent + '%'}\n </div>\n )\n\n let displayContent\n if (status === 'success' || status === 'exception') {\n displayContent = showIcon(status)\n } else if (status === 'normal' || status === 'active') {\n displayContent = showPercent\n } else {\n // 如果状态为空\n displayContent = _percent === 100 ? showIcon('success') : showPercent\n }\n return displayContent\n }\n\n const CusCircleAndDashboardFormat = (props: { widthNum: number }) => {\n const { widthNum } = props\n return (\n <div className={`${prefixCls}-cus-format`}>\n {!!label && (\n <Ellipsis\n className={`${prefixCls}-cus-format-label`}\n title={label}\n widthLimit={widthNum <= 64 ? widthNum : 'calc(100% - 50px)'}\n placement={widthNum <= 64 ? 'bottom' : 'top'}\n />\n )}\n <CusLabelOrPercent type=\"circle\" theme=\"outlined\" />\n </div>\n )\n }\n\n //line\n const LineProgress: React.FC = () => (\n <AntdProgress\n strokeColor={_strokeColor}\n {...props}\n className={classNames('tnt-progress', className, {\n [`${prefixCls}-percent-bottom`]: percentPosition === 'bottom',\n })}\n />\n )\n\n //circle,dashboard (额外新增label和半圆选项)\n const CircleAndDashboardProgress: React.FC = () => {\n const widthNum = Number(String(width).split('px').shift())\n return (\n <AntdProgress\n gapDegree={gapDegree}\n strokeColor={_strokeColor}\n strokeWidth={strokeWidth}\n {...props}\n type={halfCircle ? 'dashboard' : type}\n className={classNames('tnt-progress', `${prefixCls}-circle-progress`, className, {\n [`${prefixCls}-small-circle`]: widthNum <= 64 && label,\n [`${prefixCls}-large-circle`]: widthNum > 64 && label,\n [`${prefixCls}-small-half-circle`]: halfCircle && widthNum <= 64 && label,\n [`${prefixCls}-large-half-circle`]: halfCircle && widthNum > 64 && label,\n })}\n format={() => <CusCircleAndDashboardFormat widthNum={widthNum} />}\n />\n )\n }\n\n const progressMap = {\n line: <LineProgress />,\n circle: <CircleAndDashboardProgress />,\n dashboard: <CircleAndDashboardProgress />,\n }\n return progressMap[type]\n }}\n </ConfigConsumer>\n )\n}\n\nexport default Progress\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@import '../style/themes/index.less';
|
|
2
|
+
@import '../style/mixins/index';
|
|
3
|
+
@progress-prefix-cls: ~'@{ant-prefix}-progress';
|
|
4
|
+
.tnt-progress.@{progress-prefix-cls} {
|
|
5
|
+
.ant-progress-text{
|
|
6
|
+
// font-family: PingFang SC;
|
|
7
|
+
font-weight: 500;
|
|
8
|
+
}
|
|
9
|
+
.ant-progress-cus-format-label{
|
|
10
|
+
.ant-progress-cus-format-label{
|
|
11
|
+
padding-bottom: 4px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
&-percent-bottom{
|
|
15
|
+
.ant-progress-outer{
|
|
16
|
+
padding-right: 0;
|
|
17
|
+
}
|
|
18
|
+
.ant-progress-text{
|
|
19
|
+
width: 100%;
|
|
20
|
+
display: block;
|
|
21
|
+
text-align: right;
|
|
22
|
+
margin-left: 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
&-circle-progress{
|
|
26
|
+
.@{progress-prefix-cls}-cus-format{
|
|
27
|
+
height: 100%;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
&-small-circle{
|
|
35
|
+
.ant-progress-text{
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
|
38
|
+
.ant-progress-inner{
|
|
39
|
+
overflow:visible;
|
|
40
|
+
}
|
|
41
|
+
.tntd-ellipsis{
|
|
42
|
+
position: absolute;
|
|
43
|
+
bottom: -1.8em;
|
|
44
|
+
font-size: 0.75em;
|
|
45
|
+
// margin-bottom: 2px;
|
|
46
|
+
// color: #8B919E;
|
|
47
|
+
color:tint(@text-color, 50%);
|
|
48
|
+
font-family: Inter;
|
|
49
|
+
font-weight: 500;
|
|
50
|
+
text-align: center;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
&-large-circle{
|
|
54
|
+
.ant-progress-text{
|
|
55
|
+
height: 100%;
|
|
56
|
+
}
|
|
57
|
+
.tntd-ellipsis{
|
|
58
|
+
font-size: 0.55em;
|
|
59
|
+
// margin-bottom: 2px;
|
|
60
|
+
color:tint(@text-color, 50%);
|
|
61
|
+
font-family: Inter;
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
text-align: center;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
&-small-half-circle{
|
|
67
|
+
.ant-progress-text{
|
|
68
|
+
height: 40%;
|
|
69
|
+
}
|
|
70
|
+
.tntd-ellipsis{
|
|
71
|
+
bottom: -1.5em;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
&-large-half-circle{
|
|
75
|
+
.ant-progress-inner{
|
|
76
|
+
.ant-progress-text{
|
|
77
|
+
top: 42%
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function _default({ visible, setVisible, searchText, children, value, onChange, options, locale, searchTarget, setSearchTarget, clsPrefix, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
visible: any;
|
|
4
|
+
setVisible: any;
|
|
5
|
+
searchText: any;
|
|
6
|
+
children: any;
|
|
7
|
+
value: any;
|
|
8
|
+
onChange: any;
|
|
9
|
+
options: any;
|
|
10
|
+
locale: any;
|
|
11
|
+
searchTarget: any;
|
|
12
|
+
setSearchTarget: any;
|
|
13
|
+
clsPrefix: any;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
export default _default;
|
|
16
|
+
import React from "react";
|
|
17
|
+
//# sourceMappingURL=FieldPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldPopover.d.ts","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/FieldPopover.js"],"names":[],"mappings":"AAWe;;;;;;;;;;;;;sBAiRd"}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
9
|
+
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _popover = _interopRequireDefault(require("../../../popover"));
|
|
12
|
+
var _Select = _interopRequireDefault(require("./Select"));
|
|
13
|
+
var _utils = require("./utils");
|
|
14
|
+
var _fieldsMap = _interopRequireWildcard(require("../fieldsMap"));
|
|
15
|
+
require("./FieldPopover.less");
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
23
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
28
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
29
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
};
|
|
33
|
+
var isInput = function isInput(type) {
|
|
34
|
+
return ['input', 'string', 'search', 'number', 'inputNumber'].includes(type);
|
|
35
|
+
};
|
|
36
|
+
var _default = exports["default"] = function _default(_a) {
|
|
37
|
+
var visible = _a.visible,
|
|
38
|
+
setVisible = _a.setVisible,
|
|
39
|
+
searchText = _a.searchText,
|
|
40
|
+
children = _a.children,
|
|
41
|
+
value = _a.value,
|
|
42
|
+
onChange = _a.onChange,
|
|
43
|
+
options = _a.options,
|
|
44
|
+
locale = _a.locale,
|
|
45
|
+
searchTarget = _a.searchTarget,
|
|
46
|
+
setSearchTarget = _a.setSearchTarget,
|
|
47
|
+
clsPrefix = _a.clsPrefix,
|
|
48
|
+
props = __rest(_a, ["visible", "setVisible", "searchText", "children", "value", "onChange", "options", "locale", "searchTarget", "setSearchTarget", "clsPrefix"]);
|
|
49
|
+
var _useState = (0, _react.useState)(null),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
dataItem = _useState2[0],
|
|
52
|
+
setDataItem = _useState2[1];
|
|
53
|
+
var onPropsClick = function onPropsClick(propItem) {
|
|
54
|
+
var copyValue = (0, _cloneDeep2["default"])(value);
|
|
55
|
+
if (!(copyValue === null || copyValue === void 0 ? void 0 : copyValue.find(function (v) {
|
|
56
|
+
return v.key === propItem.name;
|
|
57
|
+
}))) {
|
|
58
|
+
copyValue.push({
|
|
59
|
+
key: propItem.name,
|
|
60
|
+
value: propItem.type === 'array' ? [] : '',
|
|
61
|
+
label: (propItem.propsTitle || propItem.title || propItem.name) + ':'
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (isInput(propItem.type)) {
|
|
65
|
+
var target = copyValue.find(function (v) {
|
|
66
|
+
return v.key === propItem.name;
|
|
67
|
+
});
|
|
68
|
+
onChange(target, true);
|
|
69
|
+
close();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
setDataItem(propItem);
|
|
73
|
+
onChange(copyValue);
|
|
74
|
+
};
|
|
75
|
+
var onSelectChange = function onSelectChange(v, isMultiple) {
|
|
76
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
77
|
+
var copyValue = (0, _cloneDeep2["default"])(value || []);
|
|
78
|
+
var index;
|
|
79
|
+
if (v.dataItem) {
|
|
80
|
+
var _index = copyValue.findIndex(function (vv) {
|
|
81
|
+
var _a;
|
|
82
|
+
return vv.key === ((_a = v.dataItem) === null || _a === void 0 ? void 0 : _a.name);
|
|
83
|
+
});
|
|
84
|
+
if (_index > -1) {
|
|
85
|
+
index = _index;
|
|
86
|
+
} else {
|
|
87
|
+
copyValue.push({
|
|
88
|
+
key: (_a = v.dataItem) === null || _a === void 0 ? void 0 : _a.name,
|
|
89
|
+
value: isMultiple ? [] : '',
|
|
90
|
+
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)) + ':'
|
|
91
|
+
});
|
|
92
|
+
index = copyValue.length - 1;
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
index = copyValue.findIndex(function (v) {
|
|
96
|
+
return v.key === (dataItem === null || dataItem === void 0 ? void 0 : dataItem.name);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (isMultiple) {
|
|
100
|
+
if (!((_f = (_e = copyValue[index]) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.length)) {
|
|
101
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + (v === null || v === void 0 ? void 0 : v.label);
|
|
102
|
+
copyValue[index].value = [v === null || v === void 0 ? void 0 : v.value];
|
|
103
|
+
} else {
|
|
104
|
+
if (((_g = copyValue[index].value) === null || _g === void 0 ? void 0 : _g.indexOf(v.value)) > -1) {
|
|
105
|
+
copyValue[index].value = copyValue[index].value.filter(function (val) {
|
|
106
|
+
return val !== v.value;
|
|
107
|
+
});
|
|
108
|
+
var regex = new RegExp("\\|?".concat(v.label), 'g'); //new RegExp(`\\|?${variable}`, 'g')
|
|
109
|
+
var result = copyValue[index].label.replace(regex, '');
|
|
110
|
+
copyValue[index].label = result;
|
|
111
|
+
} else {
|
|
112
|
+
copyValue[index].value.push(v.value);
|
|
113
|
+
copyValue[index].label += '|' + (v === null || v === void 0 ? void 0 : v.label);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
copyValue[index].value = v === null || v === void 0 ? void 0 : v.value;
|
|
118
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + (v === null || v === void 0 ? void 0 : v.label);
|
|
119
|
+
close();
|
|
120
|
+
}
|
|
121
|
+
onChange(copyValue, false, true);
|
|
122
|
+
};
|
|
123
|
+
var onFieldChange = function onFieldChange() {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
var _ref = dataItem || {},
|
|
126
|
+
type = _ref.type,
|
|
127
|
+
component = _ref.component,
|
|
128
|
+
fieldProps = _ref.props,
|
|
129
|
+
setLabel = _ref.setLabel;
|
|
130
|
+
var _ref2 = fieldProps || {},
|
|
131
|
+
onChangeCustom = _ref2.onChange,
|
|
132
|
+
options = _ref2.options;
|
|
133
|
+
onChangeCustom && onChangeCustom.apply(void 0, arguments);
|
|
134
|
+
var copyValue = (0, _cloneDeep2["default"])(value);
|
|
135
|
+
var index = copyValue.findIndex(function (v) {
|
|
136
|
+
return v.key === (dataItem === null || dataItem === void 0 ? void 0 : dataItem.name);
|
|
137
|
+
});
|
|
138
|
+
copyValue[index].value = arguments.length <= 0 ? undefined : arguments[0];
|
|
139
|
+
if (type === 'date') {
|
|
140
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + (arguments.length <= 1 ? undefined : arguments[1]);
|
|
141
|
+
close();
|
|
142
|
+
} else if (type === 'dateRange') {
|
|
143
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + ((_a = arguments.length <= 1 ? undefined : arguments[1]) === null || _a === void 0 ? void 0 : _a.join('~'));
|
|
144
|
+
if ((_b = arguments.length <= 1 ? undefined : arguments[1]) === null || _b === void 0 ? void 0 : _b[1]) {
|
|
145
|
+
close();
|
|
146
|
+
}
|
|
147
|
+
} else if (type === 'selectInput') {
|
|
148
|
+
var key = (0, _get2["default"])(Object.keys(arguments.length <= 0 ? undefined : arguments[0]), '0');
|
|
149
|
+
var val = (0, _get2["default"])(arguments.length <= 0 ? undefined : arguments[0], key);
|
|
150
|
+
var label = (0, _utils.getLabelFromOptions)(key, options);
|
|
151
|
+
copyValue[index].label = "".concat(label, ": ").concat(val);
|
|
152
|
+
} else if (type === 'checkbox') {
|
|
153
|
+
copyValue[index].label = "".concat(copyValue[index].label.match(/(.*:)/)[0], " ").concat((arguments.length <= 0 ? undefined : arguments[0]) ? local.Yes : local.No);
|
|
154
|
+
close();
|
|
155
|
+
} else if (!type && component) {
|
|
156
|
+
if (setLabel) {
|
|
157
|
+
// setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制
|
|
158
|
+
copyValue[index].label = setLabel(arguments.length <= 0 ? undefined : arguments[0]);
|
|
159
|
+
} else {
|
|
160
|
+
copyValue[index].label = copyValue[index].label.match(/(.*:)/)[0] + ((arguments.length <= 1 ? undefined : arguments[1]) || (arguments.length <= 0 ? undefined : arguments[0]));
|
|
161
|
+
}
|
|
162
|
+
close();
|
|
163
|
+
}
|
|
164
|
+
onChange(copyValue, false, true);
|
|
165
|
+
// close()
|
|
166
|
+
};
|
|
167
|
+
var close = function close() {
|
|
168
|
+
setVisible(false);
|
|
169
|
+
};
|
|
170
|
+
var handleVisibleChange = function handleVisibleChange(visible) {
|
|
171
|
+
setVisible(visible);
|
|
172
|
+
};
|
|
173
|
+
(0, _react.useEffect)(function () {
|
|
174
|
+
setDataItem(null);
|
|
175
|
+
}, [visible]);
|
|
176
|
+
(0, _react.useEffect)(function () {
|
|
177
|
+
var bool1 = false,
|
|
178
|
+
bool2 = false;
|
|
179
|
+
if (searchText) {
|
|
180
|
+
options === null || options === void 0 ? void 0 : options.forEach(function (v) {
|
|
181
|
+
var _ref3 = v.props || {},
|
|
182
|
+
name = _ref3.name,
|
|
183
|
+
propsTitle = _ref3.propsTitle,
|
|
184
|
+
title = _ref3.title,
|
|
185
|
+
type = _ref3.type,
|
|
186
|
+
props = _ref3.props;
|
|
187
|
+
var _propsTitle = propsTitle || title || name;
|
|
188
|
+
if ((_propsTitle === null || _propsTitle === void 0 ? void 0 : _propsTitle.indexOf(searchText)) > -1) {
|
|
189
|
+
bool1 = true;
|
|
190
|
+
}
|
|
191
|
+
var sOptions = type !== 'select' ? [] : (props === null || props === void 0 ? void 0 : props.options) || [];
|
|
192
|
+
var fieldNames = props === null || props === void 0 ? void 0 : props.fieldNames;
|
|
193
|
+
var target = sOptions === null || sOptions === void 0 ? void 0 : sOptions.find(function (item) {
|
|
194
|
+
var labelKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label';
|
|
195
|
+
var label = item instanceof Object ? item[labelKey] : item;
|
|
196
|
+
return (label === null || label === void 0 ? void 0 : label.indexOf(searchText)) > -1;
|
|
197
|
+
});
|
|
198
|
+
if (target) {
|
|
199
|
+
bool2 = true;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
setSearchTarget(!bool2 && !bool1 ? null : {
|
|
203
|
+
propsTitle: bool1,
|
|
204
|
+
propsValue: bool2
|
|
205
|
+
});
|
|
206
|
+
} else {
|
|
207
|
+
setSearchTarget(null);
|
|
208
|
+
}
|
|
209
|
+
}, [options, searchText]);
|
|
210
|
+
var renderFirstOptions = function renderFirstOptions(menu) {
|
|
211
|
+
return _react["default"].createElement("div", null, (!searchText || (searchTarget === null || searchTarget === void 0 ? void 0 : searchTarget.propsTitle)) && _react["default"].createElement("label", null, locale.propTitle), _react["default"].createElement("ul", {
|
|
212
|
+
className: "ant-select-dropdown-menu"
|
|
213
|
+
}, options === null || options === void 0 ? void 0 : options.map(function (v) {
|
|
214
|
+
var _ref4 = v.props || {},
|
|
215
|
+
name = _ref4.name,
|
|
216
|
+
propsTitle = _ref4.propsTitle,
|
|
217
|
+
title = _ref4.title,
|
|
218
|
+
type = _ref4.type,
|
|
219
|
+
props = _ref4.props;
|
|
220
|
+
var _propsTitle = propsTitle || title || name;
|
|
221
|
+
if (searchText) {
|
|
222
|
+
if ((_propsTitle === null || _propsTitle === void 0 ? void 0 : _propsTitle.indexOf(searchText)) > -1) {
|
|
223
|
+
return _react["default"].createElement("li", {
|
|
224
|
+
className: "ant-select-dropdown-menu-item",
|
|
225
|
+
key: name,
|
|
226
|
+
value: name,
|
|
227
|
+
onMouseDown: function onMouseDown(e) {
|
|
228
|
+
return e.preventDefault();
|
|
229
|
+
},
|
|
230
|
+
onClick: function onClick() {
|
|
231
|
+
onPropsClick(v.props);
|
|
232
|
+
}
|
|
233
|
+
}, _react["default"].createElement("span", {
|
|
234
|
+
dangerouslySetInnerHTML: {
|
|
235
|
+
__html: (0, _utils.highlightSubstring)(_propsTitle, searchText)
|
|
236
|
+
}
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
return '';
|
|
240
|
+
}
|
|
241
|
+
return _react["default"].createElement("li", {
|
|
242
|
+
className: "ant-select-dropdown-menu-item",
|
|
243
|
+
key: name,
|
|
244
|
+
value: name,
|
|
245
|
+
onMouseDown: function onMouseDown(e) {
|
|
246
|
+
return e.preventDefault();
|
|
247
|
+
},
|
|
248
|
+
onClick: function onClick() {
|
|
249
|
+
onPropsClick(v.props);
|
|
250
|
+
}
|
|
251
|
+
}, _propsTitle);
|
|
252
|
+
})), searchText && _react["default"].createElement("div", null, (searchTarget === null || searchTarget === void 0 ? void 0 : searchTarget.propsValue) && _react["default"].createElement("label", null, locale.propValue), _react["default"].createElement("ul", {
|
|
253
|
+
className: "ant-select-dropdown-menu"
|
|
254
|
+
}, options === null || options === void 0 ? void 0 : options.map(function (v) {
|
|
255
|
+
var _ref5 = v.props || {},
|
|
256
|
+
name = _ref5.name,
|
|
257
|
+
propsTitle = _ref5.propsTitle,
|
|
258
|
+
type = _ref5.type,
|
|
259
|
+
props = _ref5.props;
|
|
260
|
+
var target = value === null || value === void 0 ? void 0 : value.find(function (v) {
|
|
261
|
+
return v.key === name;
|
|
262
|
+
});
|
|
263
|
+
if (type === 'select' && props && props.options && props.options.length > 0) {
|
|
264
|
+
return _react["default"].createElement(_Select["default"], Object.assign({}, props, {
|
|
265
|
+
searchText: searchText,
|
|
266
|
+
onChange: onSelectChange,
|
|
267
|
+
value: target === null || target === void 0 ? void 0 : target.value,
|
|
268
|
+
dataItem: v.props
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
return;
|
|
272
|
+
}))));
|
|
273
|
+
};
|
|
274
|
+
var renderSecondOptions = function renderSecondOptions() {
|
|
275
|
+
var _a;
|
|
276
|
+
var _ref6 = dataItem || {},
|
|
277
|
+
name = _ref6.name,
|
|
278
|
+
propsTitle = _ref6.propsTitle,
|
|
279
|
+
title = _ref6.title,
|
|
280
|
+
type = _ref6.type,
|
|
281
|
+
className = _ref6.className,
|
|
282
|
+
component = _ref6.component,
|
|
283
|
+
fieldProps = _ref6.props;
|
|
284
|
+
var target = value === null || value === void 0 ? void 0 : value.find(function (v) {
|
|
285
|
+
return v.key === name;
|
|
286
|
+
});
|
|
287
|
+
var Field = component || _fieldsMap["default"][type];
|
|
288
|
+
return _react["default"].createElement("div", {
|
|
289
|
+
onClick: function onClick(e) {
|
|
290
|
+
return e.stopPropagation();
|
|
291
|
+
},
|
|
292
|
+
className: className
|
|
293
|
+
}, _react["default"].createElement("label", null, propsTitle || title || name), type === 'select' ? _react["default"].createElement(_Select["default"], Object.assign({}, fieldProps, {
|
|
294
|
+
onChange: onSelectChange,
|
|
295
|
+
value: target === null || target === void 0 ? void 0 : target.value
|
|
296
|
+
})) : _react["default"].createElement("div", {
|
|
297
|
+
className: "".concat(clsPrefix, "-field-popover-content"),
|
|
298
|
+
onClick: function onClick(e) {
|
|
299
|
+
return e.stopPropagation();
|
|
300
|
+
}
|
|
301
|
+
}, _react["default"].createElement(Field, Object.assign({
|
|
302
|
+
value: target === null || target === void 0 ? void 0 : target.value
|
|
303
|
+
}, fieldProps, {
|
|
304
|
+
style: Object.assign(Object.assign({}, fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.style), {
|
|
305
|
+
width: ((_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.style) === null || _a === void 0 ? void 0 : _a.width) || (0, _fieldsMap.getFieldWidth)(type)
|
|
306
|
+
}),
|
|
307
|
+
onChange: onFieldChange
|
|
308
|
+
}))));
|
|
309
|
+
};
|
|
310
|
+
return _react["default"].createElement(_popover["default"], Object.assign({
|
|
311
|
+
trigger: "click",
|
|
312
|
+
// onClick={(e) => e.stopPropagation()}
|
|
313
|
+
visible: visible,
|
|
314
|
+
placement: "bottom",
|
|
315
|
+
overlayClassName: "".concat(clsPrefix, "-field-popover"),
|
|
316
|
+
content: !dataItem ? renderFirstOptions() : renderSecondOptions(),
|
|
317
|
+
onVisibleChange: handleVisibleChange
|
|
318
|
+
}, props), children);
|
|
319
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldPopover.js","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/FieldPopover.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkD;AAClD,mCAAkC;AAClC,+DAAsC;AACtC,sDAAgC;AAChC,mCAAiE;AACjE,mCAA4B;AAE5B,0DAAuD;AACvD,+BAA4B;AAC5B,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAE/F,kBAAe,CAAC,EAaf,EAAE,EAAE;QAbW,EACd,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ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IAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,IAAI,CAC9E,CAAC,CAAC,CAAC,CACF,uCAAK,SAAS,EAAE,GAAG,SAAS,wBAAwB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE;gBACvF,8BAAC,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,IAAA,yBAAa,EAAC,IAAI,CAAC,KAExD,QAAQ,EAAE,aAAa,IACvB,CACE,CACP,CACG,CACP,CAAA;IACH,CAAC,CAAA;IAED,OAAO,CACL,8BAAC,iBAAO,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"]}
|