iglooform 2.5.52 → 3.0.0-alpha
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/.dumi/overrides.less +70 -0
- package/.dumi/tmp/core/EmptyRoute.tsx +9 -0
- package/.dumi/tmp/core/defineApp.ts +17 -0
- package/.dumi/tmp/core/exportStaticRuntimePlugin.ts +11 -0
- package/.dumi/tmp/core/helmet.ts +10 -0
- package/.dumi/tmp/core/helmetContext.ts +4 -0
- package/.dumi/tmp/core/history.ts +66 -0
- package/.dumi/tmp/core/historyIntelli.ts +132 -0
- package/.dumi/tmp/core/plugin.ts +60 -0
- package/.dumi/tmp/core/pluginConfig.ts +292 -0
- package/.dumi/tmp/core/pluginConfigJoi.d.ts +54 -0
- package/.dumi/tmp/core/polyfill.ts +201 -0
- package/.dumi/tmp/core/route.tsx +50 -0
- package/.dumi/tmp/core/terminal.ts +37 -0
- package/.dumi/tmp/dumi/exports.ts +5 -0
- package/.dumi/tmp/dumi/locales/config.ts +87 -0
- package/.dumi/tmp/dumi/locales/runtime.tsx +39 -0
- package/.dumi/tmp/dumi/meta/atoms.ts +4 -0
- package/.dumi/tmp/dumi/meta/index.ts +255 -0
- package/.dumi/tmp/dumi/meta/runtime.ts +31 -0
- package/.dumi/tmp/dumi/meta/tabs.ts +5 -0
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +58 -0
- package/.dumi/tmp/dumi/theme/builtins/API.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +4 -0
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +4 -0
- package/.dumi/tmp/dumi/theme/nprogress.css +59 -0
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Content.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Features.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Header.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +5 -0
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +4 -0
- package/.dumi/tmp/exports.ts +17 -0
- package/.dumi/tmp/plugin-antd/runtime.tsx +65 -0
- package/.dumi/tmp/plugin-antd/runtimeConfig.d.ts +6 -0
- package/.dumi/tmp/plugin-antd/types.d.ts +14 -0
- package/.dumi/tmp/plugin-html2sketch/index.ts +35 -0
- package/.dumi/tmp/testBrowser.tsx +90 -0
- package/.dumi/tmp/umi.ts +106 -0
- package/.dumirc.ts +27 -0
- package/es/admin-upload/float.d.ts +2 -2
- package/es/admin-upload/float.js +30 -42
- package/es/admin-upload/index.js +178 -242
- package/es/admin-upload/job-list.js +90 -105
- package/es/admin-upload/modal.d.ts +2 -2
- package/es/admin-upload/modal.js +31 -45
- package/es/admin-upload/style/index.js +1 -1
- package/es/admin-upload/style/index.less +6 -6
- package/es/alert-message/index.js +23 -36
- package/es/alert-message/style/index.js +1 -1
- package/es/alert-message/style/index.less +1 -1
- package/es/amount/index.js +17 -25
- package/es/amount/style/index.d.ts +0 -1
- package/es/amount/style/index.js +0 -1
- package/es/back-top/index.js +18 -32
- package/es/back-top/style/index.js +1 -1
- package/es/back-top/style/index.less +36 -25
- package/es/button/index.js +57 -88
- package/es/button/style/index.js +1 -1
- package/es/button/style/index.less +159 -109
- package/es/card-detail/card-group.d.ts +2 -2
- package/es/card-detail/card-group.js +14 -22
- package/es/card-detail/card-item.d.ts +2 -2
- package/es/card-detail/card-item.js +12 -23
- package/es/card-detail/card-page.js +18 -24
- package/es/card-detail/card.js +21 -32
- package/es/card-detail/index.js +4 -4
- package/es/card-detail/style/index.js +1 -1
- package/es/card-detail/style/index.less +4 -4
- package/es/card-detail/utils.d.ts +2 -2
- package/es/card-detail/utils.js +15 -21
- package/es/checkbox/index.d.ts +3 -2
- package/es/checkbox/index.js +73 -96
- package/es/checkbox/style/index.js +1 -1
- package/es/checkbox/style/index.less +42 -20
- package/es/claim-list/index.d.ts +1 -1
- package/es/claim-list/index.js +83 -129
- package/es/claim-list/style/index.js +1 -1
- package/es/claim-list/style/index.less +14 -8
- package/es/confirmation/index.js +29 -47
- package/es/confirmation/style/index.d.ts +0 -1
- package/es/confirmation/style/index.js +0 -1
- package/es/currency-context/style/index.d.ts +0 -1
- package/es/currency-context/style/index.js +0 -1
- package/es/date-picker/buddhist.js +31 -46
- package/es/date-picker/index.d.ts +2 -2
- package/es/date-picker/index.js +89 -118
- package/es/date-picker/style/index.js +1 -1
- package/es/date-picker/style/index.less +43 -22
- package/es/declaration/index.js +21 -34
- package/es/declaration/style/index.js +1 -1
- package/es/declaration/style/index.less +3 -3
- package/es/detail-panel/index.d.ts +2 -2
- package/es/detail-panel/index.js +48 -67
- package/es/detail-panel/style/index.js +1 -1
- package/es/detail-panel/style/index.less +3 -3
- package/es/documents/index.js +55 -73
- package/es/documents/style/index.js +1 -1
- package/es/filter/checkBox.d.ts +1 -1
- package/es/filter/checkBox.js +43 -64
- package/es/filter/customize.d.ts +1 -1
- package/es/filter/customize.js +8 -10
- package/es/filter/index.d.ts +1 -1
- package/es/filter/index.js +261 -359
- package/es/filter/radioBox.d.ts +1 -1
- package/es/filter/radioBox.js +26 -35
- package/es/filter/rangePicker.d.ts +1 -1
- package/es/filter/rangePicker.js +64 -83
- package/es/filter/style/index.js +1 -1
- package/es/filter/style/index.less +11 -11
- package/es/form/addable-section/index.js +71 -110
- package/es/form/addable-section/style/index.js +1 -1
- package/es/form/divider/index.js +11 -18
- package/es/form/divider/style/index.js +1 -1
- package/es/form/element/index.js +81 -140
- package/es/form/element/style/index.js +1 -1
- package/es/form/element/style/index.less +5 -5
- package/es/form/elements.js +15 -18
- package/es/form/hstep/index.js +53 -77
- package/es/form/hstep/style/index.js +1 -1
- package/es/form/hstep/style/index.less +2 -2
- package/es/form/hsteps/index.js +187 -245
- package/es/form/hsteps/style/index.js +1 -1
- package/es/form/index.js +133 -194
- package/es/form/login/index.js +24 -35
- package/es/form/login/style/index.js +1 -1
- package/es/form/login/style/index.less +1 -1
- package/es/form/page/index.js +42 -60
- package/es/form/page/style/index.js +1 -1
- package/es/form/pages/index.js +102 -139
- package/es/form/pages/style/index.js +1 -1
- package/es/form/render/index.js +12 -17
- package/es/form/render/style/index.js +1 -1
- package/es/form/section/index.js +58 -81
- package/es/form/section/style/index.js +1 -1
- package/es/form/step/index.js +57 -84
- package/es/form/step/style/index.js +1 -1
- package/es/form/step/style/index.less +3 -3
- package/es/form/steps/index.js +129 -174
- package/es/form/steps/style/index.js +1 -1
- package/es/form/style/index.js +1 -1
- package/es/form/style/index.less +1 -1
- package/es/form-context.d.ts +1 -1
- package/es/form-step-context.d.ts +1 -1
- package/es/free-form/addable-section/index.js +79 -137
- package/es/free-form/addable-section/style/index.js +1 -1
- package/es/free-form/element/index.js +63 -115
- package/es/free-form/element/style/index.js +1 -1
- package/es/free-form/element/style/index.less +4 -4
- package/es/free-form/index.d.ts +2 -2
- package/es/free-form/index.js +107 -157
- package/es/free-form/page/index.js +106 -144
- package/es/free-form/page/style/index.js +1 -1
- package/es/free-form/pages/index.js +17 -36
- package/es/free-form/pages/style/index.js +1 -1
- package/es/free-form/section/index.js +49 -87
- package/es/free-form/section/style/index.js +1 -1
- package/es/free-form/step/index.js +141 -197
- package/es/free-form/step/style/index.js +1 -1
- package/es/free-form/step/style/index.less +3 -3
- package/es/free-form/steps/index.d.ts +2 -2
- package/es/free-form/steps/index.js +37 -60
- package/es/free-form/steps/style/index.js +1 -1
- package/es/free-form/style/index.js +1 -1
- package/es/free-form/style/index.less +1 -1
- package/es/global-message/index.d.ts +1 -1
- package/es/global-message/index.js +23 -35
- package/es/global-message/style/index.js +1 -1
- package/es/global-message/style/index.less +4 -0
- package/es/home-menu/index.d.ts +1 -1
- package/es/home-menu/index.js +46 -63
- package/es/home-menu/style/index.js +1 -1
- package/es/home-menu/style/index.less +12 -7
- package/es/index.js +44 -44
- package/es/input/amount.js +28 -44
- package/es/input/credit-card.js +40 -78
- package/es/input/email.js +13 -16
- package/es/input/expiry-date.js +59 -96
- package/es/input/index.js +12 -12
- package/es/input/input-date.js +48 -88
- package/es/input/input-id.js +18 -31
- package/es/input/input-number.js +19 -35
- package/es/input/input.js +17 -27
- package/es/input/otp.d.ts +1 -1
- package/es/input/otp.js +51 -79
- package/es/input/password.js +15 -19
- package/es/input/phone-number.js +31 -50
- package/es/input/style/index.js +1 -1
- package/es/input/style/index.less +68 -70
- package/es/input/text-area.js +31 -55
- package/es/layout/defaultFooter.js +38 -43
- package/es/layout/defaultHeader.js +11 -16
- package/es/layout/footer.js +79 -85
- package/es/layout/header.js +61 -94
- package/es/layout/index.d.ts +2 -3
- package/es/layout/index.js +32 -48
- package/es/layout/style/index.js +1 -1
- package/es/layout/style/index.less +2 -2
- package/es/locale/en-US.js +1 -2
- package/es/locale/format-message.js +2 -6
- package/es/locale/formatted-message.js +2 -3
- package/es/locale/id-ID.js +1 -2
- package/es/locale/index.js +4 -4
- package/es/locale/locale-context.js +2 -4
- package/es/locale/locale-provider.d.ts +2 -1
- package/es/locale/locale-provider.js +20 -28
- package/es/locale/ms-MY.js +1 -2
- package/es/locale/th-TH.js +1 -2
- package/es/locale/vi-VN.js +1 -2
- package/es/locale/zh-CN.js +1 -2
- package/es/locale/zh-TW.js +1 -2
- package/es/login-page/index.d.ts +2 -2
- package/es/login-page/index.js +24 -29
- package/es/login-page/style/index.js +1 -1
- package/es/media/index.js +59 -104
- package/es/media/media.js +27 -45
- package/es/media/preview.js +103 -149
- package/es/media/style/index.js +1 -1
- package/es/media/style/index.less +6 -6
- package/es/mobile-insurer-detail/index.d.ts +1 -1
- package/es/mobile-insurer-detail/index.js +52 -59
- package/es/mobile-insurer-detail/style/index.js +1 -1
- package/es/mobile-insurer-list/index.d.ts +1 -1
- package/es/mobile-insurer-list/index.js +34 -37
- package/es/mobile-insurer-list/style/index.js +1 -1
- package/es/modal/index.d.ts +2 -2
- package/es/modal/index.js +136 -154
- package/es/modal/style/index.js +1 -1
- package/es/modal/style/index.less +59 -51
- package/es/platform/index.js +2 -2
- package/es/platform/platform-card/index.js +18 -29
- package/es/platform/platform-card/style/index.js +1 -1
- package/es/platform/switch-platform/index.js +29 -53
- package/es/platform/switch-platform/style/index.js +1 -1
- package/es/platform/switch-platform/style/index.less +1 -1
- package/es/policy-list/index.d.ts +1 -1
- package/es/policy-list/index.js +21 -30
- package/es/policy-list/policy-card.d.ts +1 -1
- package/es/policy-list/policy-card.js +107 -142
- package/es/policy-list/style/index.js +1 -1
- package/es/policy-list/style/index.less +1 -0
- package/es/radio/index.d.ts +2 -1
- package/es/radio/index.js +65 -85
- package/es/radio/radio-group-with-other.d.ts +3 -2
- package/es/radio/radio-group-with-other.js +30 -55
- package/es/radio/style/index.js +1 -1
- package/es/radio/style/index.less +63 -45
- package/es/search-box/index.js +66 -98
- package/es/search-box/style/index.js +1 -1
- package/es/search-box/style/index.less +2 -2
- package/es/select/attached-select.d.ts +3 -3
- package/es/select/attached-select.js +67 -107
- package/es/select/index.js +3 -3
- package/es/select/select.d.ts +3 -3
- package/es/select/select.js +33 -50
- package/es/select/style/index.js +1 -1
- package/es/select/style/index.less +154 -112
- package/es/select/time-select.js +64 -108
- package/es/status-box/index.d.ts +2 -3
- package/es/status-box/index.js +14 -16
- package/es/status-box/style/index.js +1 -1
- package/es/status-box/style/index.less +2 -2
- package/es/table/index.js +119 -168
- package/es/table/style/index.js +1 -1
- package/es/table/style/index.less +137 -109
- package/es/tabs/index.d.ts +4 -3
- package/es/tabs/index.js +12 -16
- package/es/tabs/style/index.js +1 -1
- package/es/types.d.ts +1 -2
- package/es/types.js +2 -1
- package/es/typography/index.d.ts +2 -1
- package/es/typography/index.js +11 -17
- package/es/typography/style/index.js +1 -1
- package/es/typography/style/index.less +4 -0
- package/es/upload/index.js +253 -335
- package/es/upload/style/index.js +1 -1
- package/es/upload/style/index.less +8 -6
- package/es/upload-photo/index.js +321 -450
- package/es/upload-photo/media.js +16 -29
- package/es/upload-photo/style/index.js +1 -1
- package/es/upload-photo/style/index.less +4 -4
- package/es/upload-preview/index.js +63 -85
- package/es/upload-preview/media.js +42 -77
- package/es/upload-preview/style/index.js +1 -1
- package/es/upload-preview/style/index.less +1 -1
- package/es/utils/form-methods.js +1 -1
- package/es/utils/form-utils.d.ts +9 -8
- package/es/utils/form-utils.js +162 -260
- package/es/utils/option-utils.d.ts +3 -2
- package/es/utils/option-utils.js +106 -163
- package/es/utils/tools.js +0 -8
- package/lib/admin-upload/float.d.ts +2 -2
- package/lib/admin-upload/float.js +27 -46
- package/lib/admin-upload/index.js +171 -251
- package/lib/admin-upload/job-list.js +82 -109
- package/lib/admin-upload/modal.d.ts +2 -2
- package/lib/admin-upload/modal.js +27 -52
- package/lib/admin-upload/style/index.less +6 -6
- package/lib/alert-message/index.js +21 -43
- package/lib/alert-message/style/index.less +1 -1
- package/lib/amount/index.js +15 -31
- package/lib/amount/style/index.d.ts +0 -1
- package/lib/back-top/index.js +17 -39
- package/lib/back-top/style/index.less +36 -25
- package/lib/button/index.js +54 -101
- package/lib/button/style/index.less +159 -109
- package/lib/card-detail/card-group.d.ts +2 -2
- package/lib/card-detail/card-group.js +11 -29
- package/lib/card-detail/card-item.d.ts +2 -2
- package/lib/card-detail/card-item.js +9 -27
- package/lib/card-detail/card-page.js +14 -29
- package/lib/card-detail/card.js +17 -37
- package/lib/card-detail/index.js +0 -5
- package/lib/card-detail/style/index.less +4 -4
- package/lib/card-detail/utils.d.ts +2 -2
- package/lib/card-detail/utils.js +13 -28
- package/lib/checkbox/index.d.ts +3 -2
- package/lib/checkbox/index.js +64 -107
- package/lib/checkbox/style/index.less +42 -20
- package/lib/claim-list/index.d.ts +1 -1
- package/lib/claim-list/index.js +75 -143
- package/lib/claim-list/style/index.less +14 -8
- package/lib/confirmation/index.js +22 -50
- package/lib/confirmation/style/index.d.ts +0 -1
- package/lib/currency-context/index.js +0 -3
- package/lib/currency-context/style/index.d.ts +0 -1
- package/lib/date-picker/buddhist.js +34 -61
- package/lib/date-picker/index.d.ts +2 -2
- package/lib/date-picker/index.js +98 -145
- package/lib/date-picker/style/index.less +43 -22
- package/lib/declaration/index.js +17 -42
- package/lib/declaration/style/index.less +3 -3
- package/lib/detail-panel/index.d.ts +2 -2
- package/lib/detail-panel/index.js +44 -77
- package/lib/detail-panel/style/index.less +3 -3
- package/lib/documents/index.js +56 -78
- package/lib/filter/checkBox.d.ts +1 -1
- package/lib/filter/checkBox.js +40 -74
- package/lib/filter/customize.d.ts +1 -1
- package/lib/filter/customize.js +6 -14
- package/lib/filter/index.d.ts +1 -1
- package/lib/filter/index.js +258 -382
- package/lib/filter/radioBox.d.ts +1 -1
- package/lib/filter/radioBox.js +24 -45
- package/lib/filter/rangePicker.d.ts +1 -1
- package/lib/filter/rangePicker.js +64 -96
- package/lib/filter/style/index.less +11 -11
- package/lib/form/addable-section/index.js +65 -121
- package/lib/form/divider/index.js +9 -24
- package/lib/form/element/index.js +73 -156
- package/lib/form/element/style/index.less +5 -5
- package/lib/form/elements.js +1 -24
- package/lib/form/hstep/index.js +44 -87
- package/lib/form/hstep/style/index.less +2 -2
- package/lib/form/hsteps/index.js +177 -257
- package/lib/form/index.js +124 -201
- package/lib/form/login/index.js +18 -46
- package/lib/form/login/style/index.less +1 -1
- package/lib/form/page/index.js +35 -69
- package/lib/form/pages/index.js +94 -148
- package/lib/form/render/index.js +15 -21
- package/lib/form/section/index.js +52 -92
- package/lib/form/step/index.js +50 -96
- package/lib/form/step/style/index.less +3 -3
- package/lib/form/steps/index.js +125 -179
- package/lib/form/style/index.less +1 -1
- package/lib/form-context.d.ts +1 -1
- package/lib/form-context.js +0 -4
- package/lib/form-step-context.d.ts +1 -1
- package/lib/form-step-context.js +0 -4
- package/lib/free-form/addable-section/index.js +73 -148
- package/lib/free-form/element/index.js +58 -131
- package/lib/free-form/element/style/index.less +4 -4
- package/lib/free-form/index.d.ts +2 -2
- package/lib/free-form/index.js +104 -164
- package/lib/free-form/page/index.js +99 -150
- package/lib/free-form/pages/index.js +18 -39
- package/lib/free-form/section/index.js +46 -94
- package/lib/free-form/step/index.js +135 -209
- package/lib/free-form/step/style/index.less +3 -3
- package/lib/free-form/steps/index.d.ts +2 -2
- package/lib/free-form/steps/index.js +34 -66
- package/lib/free-form/style/index.less +1 -1
- package/lib/global-message/index.d.ts +1 -1
- package/lib/global-message/index.js +22 -40
- package/lib/global-message/style/index.less +4 -0
- package/lib/home-menu/index.d.ts +1 -1
- package/lib/home-menu/index.js +43 -74
- package/lib/home-menu/style/index.less +12 -7
- package/lib/index.js +0 -50
- package/lib/input/amount.js +25 -50
- package/lib/input/credit-card.js +37 -85
- package/lib/input/email.js +11 -20
- package/lib/input/expiry-date.js +54 -102
- package/lib/input/index.js +0 -14
- package/lib/input/input-date.js +46 -98
- package/lib/input/input-id.js +15 -35
- package/lib/input/input-number.js +16 -39
- package/lib/input/input.js +14 -33
- package/lib/input/otp.d.ts +1 -1
- package/lib/input/otp.js +47 -87
- package/lib/input/password.js +14 -25
- package/lib/input/phone-number.js +27 -56
- package/lib/input/style/index.less +68 -70
- package/lib/input/text-area.js +27 -61
- package/lib/layout/defaultFooter.js +33 -49
- package/lib/layout/defaultHeader.js +10 -21
- package/lib/layout/footer.js +74 -93
- package/lib/layout/header.js +56 -110
- package/lib/layout/index.d.ts +2 -3
- package/lib/layout/index.js +26 -52
- package/lib/layout/style/index.less +2 -2
- package/lib/locale/en-US.js +1 -3
- package/lib/locale/format-message.js +1 -7
- package/lib/locale/formatted-message.js +1 -6
- package/lib/locale/id-ID.js +1 -3
- package/lib/locale/index.js +0 -5
- package/lib/locale/locale-context.js +1 -7
- package/lib/locale/locale-provider.d.ts +2 -1
- package/lib/locale/locale-provider.js +18 -49
- package/lib/locale/ms-MY.js +1 -3
- package/lib/locale/th-TH.js +1 -3
- package/lib/locale/vi-VN.js +1 -3
- package/lib/locale/zh-CN.js +1 -3
- package/lib/locale/zh-TW.js +1 -3
- package/lib/login-page/index.d.ts +2 -2
- package/lib/login-page/index.js +22 -34
- package/lib/media/index.js +57 -110
- package/lib/media/media.js +28 -51
- package/lib/media/preview.js +99 -159
- package/lib/media/style/index.less +6 -6
- package/lib/mobile-insurer-detail/index.d.ts +1 -1
- package/lib/mobile-insurer-detail/index.js +46 -62
- package/lib/mobile-insurer-list/index.d.ts +1 -1
- package/lib/mobile-insurer-list/index.js +30 -42
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.js +130 -163
- package/lib/modal/style/index.less +59 -51
- package/lib/platform/index.js +0 -3
- package/lib/platform/platform-card/index.js +15 -34
- package/lib/platform/switch-platform/index.js +26 -64
- package/lib/platform/switch-platform/style/index.less +1 -1
- package/lib/policy-list/index.d.ts +1 -1
- package/lib/policy-list/index.js +18 -35
- package/lib/policy-list/policy-card.d.ts +1 -1
- package/lib/policy-list/policy-card.js +101 -152
- package/lib/policy-list/style/index.less +1 -0
- package/lib/radio/index.d.ts +2 -1
- package/lib/radio/index.js +58 -97
- package/lib/radio/radio-group-with-other.d.ts +3 -2
- package/lib/radio/radio-group-with-other.js +26 -58
- package/lib/radio/style/index.less +63 -45
- package/lib/search-box/index.js +57 -103
- package/lib/search-box/style/index.less +2 -2
- package/lib/select/attached-select.d.ts +3 -3
- package/lib/select/attached-select.js +59 -118
- package/lib/select/index.js +0 -5
- package/lib/select/select.d.ts +3 -3
- package/lib/select/select.js +29 -61
- package/lib/select/style/index.less +154 -112
- package/lib/select/time-select.js +58 -115
- package/lib/status-box/index.d.ts +2 -3
- package/lib/status-box/index.js +12 -19
- package/lib/status-box/style/index.less +2 -2
- package/lib/table/index.js +115 -196
- package/lib/table/style/index.less +137 -109
- package/lib/tabs/index.d.ts +4 -3
- package/lib/tabs/index.js +11 -23
- package/lib/types.d.ts +1 -2
- package/lib/types.js +8 -1
- package/lib/typography/index.d.ts +2 -1
- package/lib/typography/index.js +10 -20
- package/lib/typography/style/index.less +4 -0
- package/lib/upload/index.js +242 -344
- package/lib/upload/style/index.less +8 -6
- package/lib/upload-photo/index.js +309 -467
- package/lib/upload-photo/media.js +18 -32
- package/lib/upload-photo/style/index.less +4 -4
- package/lib/upload-preview/index.js +55 -90
- package/lib/upload-preview/media.js +36 -87
- package/lib/upload-preview/style/index.less +1 -1
- package/lib/utils/agent-detect.js +0 -1
- package/lib/utils/form-methods.js +1 -1
- package/lib/utils/form-utils.d.ts +9 -8
- package/lib/utils/form-utils.js +168 -288
- package/lib/utils/option-utils.d.ts +3 -2
- package/lib/utils/option-utils.js +105 -173
- package/lib/utils/tools.js +0 -11
- package/package.json +15 -18
- package/lib/global.less +0 -63
- /package/{es → .dumi}/global.less +0 -0
package/lib/filter/index.js
CHANGED
|
@@ -4,149 +4,92 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
require("antd/es/dropdown/style");
|
|
9
|
-
|
|
10
|
-
var _dropdown = _interopRequireDefault(require("antd/es/dropdown"));
|
|
11
|
-
|
|
12
|
-
require("antd/es/input/style");
|
|
13
|
-
|
|
14
|
-
var _input = _interopRequireDefault(require("antd/es/input"));
|
|
15
|
-
|
|
16
|
-
require("antd/es/button/style");
|
|
17
|
-
|
|
18
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
19
|
-
|
|
20
|
-
require("antd/es/divider/style");
|
|
21
|
-
|
|
22
|
-
var _divider = _interopRequireDefault(require("antd/es/divider"));
|
|
23
|
-
|
|
24
|
-
require("antd/es/space/style");
|
|
25
|
-
|
|
26
|
-
var _space = _interopRequireDefault(require("antd/es/space"));
|
|
27
|
-
|
|
28
|
-
require("antd/es/menu/style");
|
|
29
|
-
|
|
30
|
-
var _menu = _interopRequireDefault(require("antd/es/menu"));
|
|
31
|
-
|
|
32
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
|
-
|
|
34
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
35
|
-
|
|
7
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
36
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
37
|
-
|
|
38
9
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
39
|
-
|
|
40
10
|
var _react = require("react");
|
|
41
|
-
|
|
11
|
+
var _antd = require("antd");
|
|
42
12
|
var _iglooicon = require("iglooicon");
|
|
43
|
-
|
|
44
13
|
require("./style/index");
|
|
45
|
-
|
|
46
14
|
var _locale = require("../locale");
|
|
47
|
-
|
|
48
15
|
var _rangePicker = _interopRequireDefault(require("./rangePicker"));
|
|
49
|
-
|
|
50
16
|
var _checkBox = _interopRequireDefault(require("./checkBox"));
|
|
51
|
-
|
|
52
17
|
var _radioBox = _interopRequireDefault(require("./radioBox"));
|
|
53
|
-
|
|
54
18
|
var _customize = _interopRequireDefault(require("./customize"));
|
|
55
|
-
|
|
56
19
|
var _typography = _interopRequireDefault(require("../typography"));
|
|
57
|
-
|
|
58
20
|
var _select = _interopRequireDefault(require("../select"));
|
|
59
|
-
|
|
21
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
60
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
61
|
-
|
|
62
23
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
63
|
-
|
|
64
24
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
65
|
-
|
|
66
25
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
67
|
-
|
|
68
26
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
69
|
-
|
|
70
27
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
71
|
-
|
|
72
28
|
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."); }
|
|
73
|
-
|
|
74
29
|
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); }
|
|
75
|
-
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
79
|
-
|
|
30
|
+
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; }
|
|
31
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
80
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
81
|
-
|
|
82
33
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
83
|
-
|
|
84
34
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
85
|
-
|
|
86
|
-
function
|
|
87
|
-
|
|
35
|
+
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; }
|
|
36
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
37
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
88
38
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
89
|
-
|
|
90
39
|
var defaultFormat = 'DD / MM / YYYY';
|
|
91
|
-
|
|
92
40
|
function handleFilterDisable() {
|
|
93
41
|
var all = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
94
42
|
var disable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
95
|
-
|
|
96
43
|
if (disable.length === 0) {
|
|
97
44
|
return all;
|
|
98
45
|
}
|
|
99
|
-
|
|
100
46
|
return all.filter(function (item) {
|
|
101
47
|
return !disable.includes(item);
|
|
102
48
|
});
|
|
103
49
|
}
|
|
104
|
-
|
|
105
50
|
function getDefaultOptions(params) {
|
|
106
51
|
return params.reduce(function (res, item) {
|
|
107
52
|
var key = item.key,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
53
|
+
defaultChoosed = item.default,
|
|
54
|
+
_item$disabled = item.disabled,
|
|
55
|
+
disabled = _item$disabled === void 0 ? [] : _item$disabled,
|
|
56
|
+
type = item.type,
|
|
57
|
+
disabledDate = item.disabledDate;
|
|
113
58
|
|
|
59
|
+
// 判定一下默认时间在不在 不可选时间中
|
|
114
60
|
if (type === 'date' && typeof disabledDate === 'function' && defaultChoosed && defaultChoosed.length) {
|
|
115
61
|
// 判定的时候需要以 '天'作为最小单位
|
|
116
|
-
var begin = (0,
|
|
117
|
-
var end = (0,
|
|
62
|
+
var begin = (0, _dayjs.default)(defaultChoosed[0]).endOf('day');
|
|
63
|
+
var end = (0, _dayjs.default)(defaultChoosed[1]).endOf('day');
|
|
118
64
|
(0, _invariant.default)(!disabledDate(begin) && !disabledDate(end), 'The default date is within a non-selectable time range');
|
|
119
65
|
}
|
|
120
|
-
|
|
121
66
|
if (type === 'single') {
|
|
122
67
|
(0, _invariant.default)(_typeof(defaultChoosed) !== 'object', 'The radio default value can not be a object');
|
|
123
68
|
(0, _invariant.default)(disabled.indexOf(defaultChoosed) === -1, 'The default value cannot be in the non-selectable range');
|
|
124
69
|
return defaultChoosed ? _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, defaultChoosed)) : res;
|
|
125
70
|
}
|
|
126
|
-
|
|
127
71
|
return defaultChoosed ? _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, handleFilterDisable(defaultChoosed, disabled))) : res;
|
|
128
72
|
}, {});
|
|
129
|
-
}
|
|
130
|
-
|
|
73
|
+
}
|
|
131
74
|
|
|
75
|
+
// 在getDefaultOptions之后执行 就不用再判断 默认时间不合法的问题了
|
|
132
76
|
function getChoosedTags(params, choosed) {
|
|
133
77
|
return params.reduce(function (res, item) {
|
|
134
78
|
var key = item.key,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
79
|
+
type = item.type,
|
|
80
|
+
_item$format = item.format,
|
|
81
|
+
format = _item$format === void 0 ? defaultFormat : _item$format,
|
|
82
|
+
options = item.options,
|
|
83
|
+
_item$canNotDelete = item.canNotDelete,
|
|
84
|
+
canNotDelete = _item$canNotDelete === void 0 ? false : _item$canNotDelete,
|
|
85
|
+
filterItemTitle = item.filterItemTitle,
|
|
86
|
+
tagTitle = item.tagTitle;
|
|
143
87
|
var choosedOption = {
|
|
144
88
|
label: '',
|
|
145
89
|
key: '',
|
|
146
90
|
type: '',
|
|
147
91
|
optionValue: ''
|
|
148
92
|
};
|
|
149
|
-
|
|
150
93
|
if (choosed[key]) {
|
|
151
94
|
switch (type) {
|
|
152
95
|
case 'customize':
|
|
@@ -157,22 +100,18 @@ function getChoosedTags(params, choosed) {
|
|
|
157
100
|
choosedOption.type = type;
|
|
158
101
|
res.push(choosedOption);
|
|
159
102
|
break;
|
|
160
|
-
|
|
161
103
|
case 'date':
|
|
162
|
-
var beginTime = (0,
|
|
163
|
-
var endTime = (0,
|
|
104
|
+
var beginTime = (0, _dayjs.default)(choosed[key][0]).format(format);
|
|
105
|
+
var endTime = (0, _dayjs.default)(choosed[key][1]).format(format);
|
|
164
106
|
choosedOption.label = "".concat(filterItemTitle, ":").concat(beginTime, "-").concat(endTime);
|
|
165
107
|
choosedOption.key = key;
|
|
166
108
|
choosedOption.type = type;
|
|
167
109
|
choosedOption.optionValue = choosed[key];
|
|
168
|
-
|
|
169
110
|
if (canNotDelete) {
|
|
170
111
|
choosedOption.canNotDelete = canNotDelete;
|
|
171
112
|
}
|
|
172
|
-
|
|
173
113
|
res.push(choosedOption);
|
|
174
114
|
break;
|
|
175
|
-
|
|
176
115
|
case 'mult':
|
|
177
116
|
options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
178
117
|
var multChoosed = {
|
|
@@ -182,8 +121,7 @@ function getChoosedTags(params, choosed) {
|
|
|
182
121
|
optionValue: ''
|
|
183
122
|
};
|
|
184
123
|
var label = item.label,
|
|
185
|
-
|
|
186
|
-
|
|
124
|
+
value = item.value;
|
|
187
125
|
if (choosed[key].indexOf(value) !== -1) {
|
|
188
126
|
multChoosed.key = key;
|
|
189
127
|
multChoosed.label = label;
|
|
@@ -193,95 +131,78 @@ function getChoosedTags(params, choosed) {
|
|
|
193
131
|
}
|
|
194
132
|
});
|
|
195
133
|
break;
|
|
196
|
-
|
|
197
134
|
case 'single':
|
|
198
135
|
options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
199
136
|
var label = item.label,
|
|
200
|
-
|
|
201
|
-
|
|
137
|
+
value = item.value;
|
|
202
138
|
if (choosed[key] === value) {
|
|
203
139
|
choosedOption.key = key;
|
|
204
140
|
choosedOption.label = label;
|
|
205
141
|
choosedOption.type = type;
|
|
206
142
|
choosedOption.optionValue = value;
|
|
207
|
-
|
|
208
143
|
if (canNotDelete) {
|
|
209
144
|
choosedOption.canNotDelete = canNotDelete;
|
|
210
145
|
}
|
|
211
|
-
|
|
212
146
|
res.push(choosedOption);
|
|
213
147
|
}
|
|
214
148
|
});
|
|
215
149
|
break;
|
|
216
|
-
|
|
217
150
|
default:
|
|
218
151
|
break;
|
|
219
152
|
}
|
|
220
153
|
}
|
|
221
|
-
|
|
222
154
|
return res;
|
|
223
155
|
}, []);
|
|
224
156
|
}
|
|
225
|
-
|
|
226
157
|
function optionsChange(state, action) {
|
|
227
158
|
var type = action.type,
|
|
228
|
-
|
|
229
|
-
|
|
159
|
+
value = action.value;
|
|
230
160
|
switch (type) {
|
|
231
161
|
case 'default':
|
|
232
162
|
return value;
|
|
233
|
-
|
|
234
163
|
case 'deleteOne':
|
|
235
164
|
return value;
|
|
236
|
-
|
|
237
165
|
case 'deleteAll':
|
|
238
166
|
return value;
|
|
239
|
-
|
|
240
167
|
default:
|
|
241
168
|
break;
|
|
242
169
|
}
|
|
243
|
-
|
|
244
170
|
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, type, value));
|
|
245
171
|
}
|
|
246
|
-
|
|
247
172
|
function dataPickerOpenStatusReducer(state, action) {
|
|
248
173
|
var type = action.type,
|
|
249
|
-
|
|
174
|
+
value = action.value;
|
|
250
175
|
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, type, value));
|
|
251
176
|
}
|
|
252
|
-
|
|
253
177
|
function getCheckBoxSelectedAll(params) {
|
|
254
178
|
return params.reduce(function (res, item) {
|
|
255
179
|
var key = item.key,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
180
|
+
_item$options = item.options,
|
|
181
|
+
options = _item$options === void 0 ? [] : _item$options,
|
|
182
|
+
type = item.type;
|
|
259
183
|
var allSelected = options.map(function (option) {
|
|
260
184
|
return option.value;
|
|
261
185
|
});
|
|
262
186
|
return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, allSelected));
|
|
263
187
|
}, {});
|
|
264
188
|
}
|
|
265
|
-
|
|
266
189
|
function getTimePickerOPtionsKey(params) {
|
|
267
190
|
return params.filter(function (item) {
|
|
268
191
|
return item.type === 'date';
|
|
269
192
|
}).map(function (item) {
|
|
270
193
|
return item.key;
|
|
271
194
|
});
|
|
272
|
-
}
|
|
273
|
-
|
|
195
|
+
}
|
|
274
196
|
|
|
197
|
+
// cbFucs :callBack functions
|
|
275
198
|
function deleteSomeOne(optionsConfirmed, optionItem, cbFucs) {
|
|
276
199
|
var key = optionItem.key,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
200
|
+
type = optionItem.type,
|
|
201
|
+
optionValue = optionItem.optionValue;
|
|
280
202
|
switch (type) {
|
|
281
203
|
case 'date':
|
|
282
204
|
delete optionsConfirmed[key];
|
|
283
205
|
break;
|
|
284
|
-
|
|
285
206
|
case 'mult':
|
|
286
207
|
// 通过useReducer之后的数据 和 optionsAllSelected[key] 存在引用关系处理一下
|
|
287
208
|
optionsConfirmed[key] = optionsConfirmed[key].map(function (e) {
|
|
@@ -290,27 +211,22 @@ function deleteSomeOne(optionsConfirmed, optionItem, cbFucs) {
|
|
|
290
211
|
var deletedIndex = optionsConfirmed[key].indexOf(optionValue);
|
|
291
212
|
optionsConfirmed[key].splice(deletedIndex, 1);
|
|
292
213
|
break;
|
|
293
|
-
|
|
294
214
|
case 'single':
|
|
295
215
|
delete optionsConfirmed[key];
|
|
296
216
|
break;
|
|
297
|
-
|
|
298
217
|
case 'customize':
|
|
299
218
|
delete optionsConfirmed[key];
|
|
300
219
|
break;
|
|
301
220
|
}
|
|
302
|
-
|
|
303
221
|
var cbArr = typeof cbFucs === 'function' ? [cbFucs] : cbFucs;
|
|
304
222
|
cbArr.forEach(function (item) {
|
|
305
223
|
item(optionsConfirmed);
|
|
306
224
|
});
|
|
307
225
|
}
|
|
308
|
-
|
|
309
226
|
var getTextWidth = function getTextWidth(str) {
|
|
310
227
|
if (typeof document === 'undefined') {
|
|
311
228
|
return str.length * 12;
|
|
312
229
|
}
|
|
313
|
-
|
|
314
230
|
var ele = document.createElement('span');
|
|
315
231
|
ele.style.fontSize = '12px';
|
|
316
232
|
ele.style.opacity = '0';
|
|
@@ -319,23 +235,21 @@ var getTextWidth = function getTextWidth(str) {
|
|
|
319
235
|
var width = ele.offsetWidth;
|
|
320
236
|
document.body.removeChild(ele);
|
|
321
237
|
return width + 8 * 2 + 8 + 24;
|
|
322
|
-
};
|
|
323
|
-
|
|
238
|
+
};
|
|
324
239
|
|
|
240
|
+
// 将对象的数组属性排序, 这样通过JSON 字符串比较的时候才不会有顺序问题
|
|
325
241
|
function sortObjArr(obj) {
|
|
326
242
|
var keys = Object.keys(obj);
|
|
327
243
|
return keys.reduce(function (res, item) {
|
|
328
244
|
var prop = obj[item];
|
|
329
|
-
|
|
330
245
|
if (Array.isArray(prop)) {
|
|
331
246
|
return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, item, prop.sort()));
|
|
332
247
|
}
|
|
333
|
-
|
|
334
248
|
return res;
|
|
335
249
|
}, {});
|
|
336
|
-
}
|
|
337
|
-
|
|
250
|
+
}
|
|
338
251
|
|
|
252
|
+
// 需要将日期的部分精确到天
|
|
339
253
|
function judgeChange(defaultOptions, newOptions, timePickerKey) {
|
|
340
254
|
// 先将newOptions中的空数组去掉
|
|
341
255
|
var newChoosedKeys = Object.keys(newOptions);
|
|
@@ -344,228 +258,217 @@ function judgeChange(defaultOptions, newOptions, timePickerKey) {
|
|
|
344
258
|
delete newOptions[key];
|
|
345
259
|
}
|
|
346
260
|
});
|
|
347
|
-
|
|
348
261
|
if (Object.keys(defaultOptions).length !== Object.keys(newOptions).length) {
|
|
349
262
|
return true;
|
|
350
263
|
}
|
|
351
|
-
|
|
352
264
|
if (timePickerKey.length === 0) {
|
|
353
265
|
return JSON.stringify(sortObjArr(defaultOptions)) !== JSON.stringify(sortObjArr(newOptions));
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
|
|
266
|
+
}
|
|
267
|
+
// 不再引库了
|
|
357
268
|
var JsonDefault = JSON.parse(JSON.stringify(defaultOptions));
|
|
358
269
|
var JsonNew = JSON.parse(JSON.stringify(newOptions));
|
|
359
270
|
timePickerKey.forEach(function (item) {
|
|
360
271
|
if (JsonDefault[item]) {
|
|
361
272
|
var beginTime = JsonDefault[item][0];
|
|
362
273
|
var endTime = JsonDefault[item][1];
|
|
363
|
-
var date = [(0,
|
|
274
|
+
var date = [(0, _dayjs.default)(beginTime).format('YYYY-MM-DD'), (0, _dayjs.default)(endTime).format('YYYY-MM-DD')];
|
|
364
275
|
JsonDefault[item] = date;
|
|
365
276
|
}
|
|
366
|
-
|
|
367
277
|
if (JsonNew[item]) {
|
|
368
278
|
var _beginTime = JsonNew[item][0];
|
|
369
279
|
var _endTime = JsonNew[item][1];
|
|
370
|
-
var _date = [(0,
|
|
280
|
+
var _date = [(0, _dayjs.default)(_beginTime).format('YYYY-MM-DD'), (0, _dayjs.default)(_endTime).format('YYYY-MM-DD')];
|
|
371
281
|
JsonNew[item] = _date;
|
|
372
282
|
}
|
|
373
283
|
});
|
|
374
284
|
return JSON.stringify(sortObjArr(JsonDefault)) !== JSON.stringify(sortObjArr(JsonNew));
|
|
375
285
|
}
|
|
376
|
-
|
|
377
286
|
var FilterComponent = function FilterComponent(props) {
|
|
378
287
|
var Option = _select.default.Option;
|
|
379
|
-
|
|
380
288
|
var _useContext = (0, _react.useContext)(_locale.LocaleContext),
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
289
|
+
formatMessage = _useContext.formatMessage,
|
|
290
|
+
currentLang = _useContext.currentLang;
|
|
384
291
|
var showDefaultOptions = props.showDefaultOptions,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
292
|
+
_props$onFilter = props.onFilter,
|
|
293
|
+
onFilter = _props$onFilter === void 0 ? function () {} : _props$onFilter,
|
|
294
|
+
placeholder = props.placeholder,
|
|
295
|
+
_props$parentFilterCa = props.parentFilterCallBack,
|
|
296
|
+
parentFilterCallBack = _props$parentFilterCa === void 0 ? function () {} : _props$parentFilterCa,
|
|
297
|
+
_props$deleteAllTagsT = props.deleteAllTagsType,
|
|
298
|
+
deleteAllTagsType = _props$deleteAllTagsT === void 0 ? 'restFilters' : _props$deleteAllTagsT,
|
|
299
|
+
_props$searchWithFilt = props.searchWithFilter,
|
|
300
|
+
searchWithFilter = _props$searchWithFilt === void 0 ? false : _props$searchWithFilt,
|
|
301
|
+
searchInputDefault = props.searchInputDefault,
|
|
302
|
+
initValue = props.initValue,
|
|
303
|
+
inputOnly = props.inputOnly,
|
|
304
|
+
beforeOpenFilter = props.beforeOpenFilter,
|
|
305
|
+
resetCallBack = props.resetCallBack;
|
|
399
306
|
var filterTitle = props.filterTitle,
|
|
400
|
-
|
|
401
|
-
|
|
307
|
+
_props$filterItems = props.filterItems,
|
|
308
|
+
filterItems = _props$filterItems === void 0 ? [] : _props$filterItems;
|
|
402
309
|
|
|
310
|
+
// id controller
|
|
403
311
|
var showIdSelect = props.showIdSelect,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
312
|
+
_props$idKeyTypes = props.idKeyTypes,
|
|
313
|
+
idKeyTypes = _props$idKeyTypes === void 0 ? [] : _props$idKeyTypes,
|
|
314
|
+
idKeyTypeDefault = props.idKeyTypeDefault;
|
|
408
315
|
var _useState = (0, _react.useState)(idKeyTypeDefault),
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
316
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
317
|
+
idName = _useState2[0],
|
|
318
|
+
setIdName = _useState2[1];
|
|
413
319
|
(0, _invariant.default)(!showIdSelect || idKeyTypes.length !== 0, 'must set idKeyTypes while showIdSelect is true');
|
|
414
|
-
(0, _invariant.default)(typeof onFilter === 'function', 'filterCallBack must be a function');
|
|
320
|
+
(0, _invariant.default)(typeof onFilter === 'function', 'filterCallBack must be a function');
|
|
415
321
|
|
|
416
|
-
|
|
322
|
+
// option controller
|
|
323
|
+
var dropDownContainerRef = (0, _react.useRef)();
|
|
417
324
|
|
|
418
|
-
|
|
325
|
+
// 处理antd日期组件选择完还有高亮问题
|
|
326
|
+
var invisibleRef = (0, _react.useRef)();
|
|
419
327
|
|
|
420
|
-
|
|
328
|
+
// 控制 展开框的关闭
|
|
329
|
+
var openStatusTagRef = (0, _react.useRef)(undefined);
|
|
421
330
|
|
|
331
|
+
// 需要做高度动态效果,需要获取一下内容的高度
|
|
422
332
|
var heightRef = (0, _react.useRef)(undefined);
|
|
423
|
-
|
|
424
333
|
var _useState3 = (0, _react.useState)(48),
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
334
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
335
|
+
openTagsHeight = _useState4[0],
|
|
336
|
+
setOpenTagHeight = _useState4[1];
|
|
429
337
|
|
|
430
|
-
|
|
338
|
+
// 用来控制 search input的高亮和 切换
|
|
339
|
+
var searchInput = (0, _react.useRef)(null);
|
|
431
340
|
|
|
341
|
+
//inner options controller
|
|
432
342
|
var _useState5 = (0, _react.useState)(function () {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
343
|
+
return getDefaultOptions(filterItems);
|
|
344
|
+
}),
|
|
345
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
346
|
+
defaultOptions = _useState6[0];
|
|
438
347
|
var _useState7 = (0, _react.useState)({}),
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
348
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
349
|
+
optionsAllSelected = _useState8[0],
|
|
350
|
+
setOptionsAllSelected = _useState8[1];
|
|
443
351
|
var _useReducer = (0, _react.useReducer)(optionsChange, initValue ? _objectSpread({}, initValue) : _objectSpread({}, defaultOptions)),
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
352
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
353
|
+
optionsChanged = _useReducer2[0],
|
|
354
|
+
dispatchOptionsChange = _useReducer2[1];
|
|
448
355
|
var _useState9 = (0, _react.useState)(initValue ? _objectSpread({}, initValue) : _objectSpread({}, defaultOptions)),
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
356
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
357
|
+
confirmed = _useState10[0],
|
|
358
|
+
setConfimed = _useState10[1];
|
|
453
359
|
|
|
360
|
+
//dropDown visible
|
|
454
361
|
var _useState11 = (0, _react.useState)(false),
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
362
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
363
|
+
dropVisible = _useState12[0],
|
|
364
|
+
setDropVisible = _useState12[1];
|
|
459
365
|
|
|
366
|
+
//filter button high light
|
|
460
367
|
var _useState13 = (0, _react.useState)(false),
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
368
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
369
|
+
hightLightFilterButton = _useState14[0],
|
|
370
|
+
setHighLightFilter = _useState14[1];
|
|
465
371
|
|
|
372
|
+
// type-> 0:custom 1:last day 2:last 7 Days 3:last month 4:this month
|
|
466
373
|
var _useState15 = (0, _react.useState)(-1),
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
374
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
375
|
+
timeRangeType = _useState16[0],
|
|
376
|
+
setTimeRangeType = _useState16[1];
|
|
471
377
|
var _useState17 = (0, _react.useState)(-1),
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
378
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
379
|
+
confirmedTimeRange = _useState18[0],
|
|
380
|
+
setConfirmTimeRange = _useState18[1];
|
|
476
381
|
|
|
382
|
+
//对时间比较的时候需要只精确到 “天”,预先拿到那些key是代表日期的
|
|
477
383
|
var _useState19 = (0, _react.useState)(getTimePickerOPtionsKey(filterItems)),
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
384
|
+
_useState20 = _slicedToArray(_useState19, 1),
|
|
385
|
+
timePickerKey = _useState20[0];
|
|
481
386
|
var _useReducer3 = (0, _react.useReducer)(dataPickerOpenStatusReducer, timePickerKey.reduce(function (res, key) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
387
|
+
res[key] = false;
|
|
388
|
+
return res;
|
|
389
|
+
}, {})),
|
|
390
|
+
_useReducer4 = _slicedToArray(_useReducer3, 2),
|
|
391
|
+
dataPickerOpenStatus = _useReducer4[0],
|
|
392
|
+
setPickerOpenStatus = _useReducer4[1];
|
|
393
|
+
|
|
394
|
+
// 对于已选择部分在 ‘input’ 上的展开控制
|
|
490
395
|
var _useState21 = (0, _react.useState)(false),
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
396
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
397
|
+
inputExtend = _useState22[0],
|
|
398
|
+
extendInputContent = _useState22[1];
|
|
495
399
|
var _useState23 = (0, _react.useState)([]),
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
400
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
401
|
+
maxTagsWhenClosed = _useState24[0],
|
|
402
|
+
setMaxTagsWhenClosed = _useState24[1];
|
|
500
403
|
var _useState25 = (0, _react.useState)(false),
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
404
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
405
|
+
oneLineCanShow = _useState26[0],
|
|
406
|
+
setOneLineCanShow = _useState26[1];
|
|
505
407
|
|
|
408
|
+
// 不管是默认还是 之后手动选择的 filter的名字
|
|
506
409
|
var _useState27 = (0, _react.useState)(function () {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
410
|
+
return getChoosedTags(filterItems, defaultOptions);
|
|
411
|
+
}),
|
|
412
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
413
|
+
choosedTags = _useState28[0],
|
|
414
|
+
setChoosedTags = _useState28[1];
|
|
513
415
|
|
|
416
|
+
// 如果没有filter选项 需要展示出input框
|
|
514
417
|
var _useState29 = (0, _react.useState)(false),
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
418
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
419
|
+
noFilters = _useState30[0],
|
|
420
|
+
setNoFilters = _useState30[1];
|
|
519
421
|
|
|
422
|
+
// 这个状态标志着 此时只有不能删除的 filters(根据业务来的)
|
|
520
423
|
var _useState31 = (0, _react.useState)(false),
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
424
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
425
|
+
onlyHaveCanNotDeleteTags = _useState32[0],
|
|
426
|
+
setOnlyHaveCanNotDeleteTags = _useState32[1];
|
|
525
427
|
|
|
428
|
+
// 在onlyOneTagAndCanNotDelete状态下 开启input 输入框 进行search 搜索
|
|
526
429
|
var _useState33 = (0, _react.useState)(false),
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
430
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
431
|
+
showSearchInputWhenHasTag = _useState34[0],
|
|
432
|
+
setShowSearchInputWhenHasTag = _useState34[1];
|
|
531
433
|
|
|
434
|
+
// 删除tags的过程中 需要一直展示tags Input
|
|
532
435
|
var _useState35 = (0, _react.useState)(false),
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
436
|
+
_useState36 = _slicedToArray(_useState35, 2),
|
|
437
|
+
stillHaveTagsToDelete = _useState36[0],
|
|
438
|
+
setStillHaveTagsToDelete = _useState36[1];
|
|
537
439
|
var _useState37 = (0, _react.useState)(),
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
440
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
441
|
+
searchInputValue = _useState38[0],
|
|
442
|
+
setSearchInputValue = _useState38[1];
|
|
542
443
|
var _useState39 = (0, _react.useState)(searchInputDefault !== undefined ? true : false),
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
444
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
445
|
+
showSearchInputDefault = _useState40[0],
|
|
446
|
+
setShowSearchInputDefault = _useState40[1];
|
|
547
447
|
|
|
448
|
+
// 处理options 中 data?.map data 初始化为[] 没有数据的情况
|
|
548
449
|
(0, _react.useEffect)(function () {
|
|
549
450
|
setOptionsAllSelected(getCheckBoxSelectedAll(filterItems));
|
|
550
|
-
}, [JSON.stringify(filterItems)]);
|
|
451
|
+
}, [JSON.stringify(filterItems)]);
|
|
551
452
|
|
|
453
|
+
// 设置tag框 高度改变动效
|
|
552
454
|
(0, _react.useLayoutEffect)(function () {
|
|
553
455
|
var timer = setTimeout(function () {
|
|
554
456
|
var _heightRef$current;
|
|
555
|
-
|
|
556
457
|
setOpenTagHeight((_heightRef$current = heightRef.current) === null || _heightRef$current === void 0 ? void 0 : _heightRef$current.offsetHeight);
|
|
557
458
|
}, 0);
|
|
558
459
|
return function () {
|
|
559
460
|
return clearTimeout(timer);
|
|
560
461
|
};
|
|
561
|
-
}, [inputExtend, JSON.stringify(confirmed)]);
|
|
462
|
+
}, [inputExtend, JSON.stringify(confirmed)]);
|
|
562
463
|
|
|
464
|
+
// 针对删除了所有可删除的filter tags情况,自动聚焦到seatch Input
|
|
563
465
|
(0, _react.useLayoutEffect)(function () {
|
|
564
466
|
if (noFilters || showSearchInputWhenHasTag) {
|
|
565
467
|
searchInput.current.focus();
|
|
566
468
|
}
|
|
567
|
-
}, [noFilters, showSearchInputWhenHasTag]);
|
|
469
|
+
}, [noFilters, showSearchInputWhenHasTag]);
|
|
568
470
|
|
|
471
|
+
// filter 改变之后更新选中的tags
|
|
569
472
|
(0, _react.useEffect)(function () {
|
|
570
473
|
if (hightLightFilterButton || showDefaultOptions || stillHaveTagsToDelete || initValue) {
|
|
571
474
|
// 判定filter高亮
|
|
@@ -574,10 +477,10 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
574
477
|
} else {
|
|
575
478
|
setHighLightFilter(false);
|
|
576
479
|
}
|
|
577
|
-
|
|
578
480
|
var tags = getChoosedTags(filterItems, confirmed);
|
|
579
|
-
setChoosedTags(tags);
|
|
481
|
+
setChoosedTags(tags);
|
|
580
482
|
|
|
483
|
+
// 选择的filter 数量控制 input和tags 框谁展示
|
|
581
484
|
if (tags.length === 0) {
|
|
582
485
|
setNoFilters(true);
|
|
583
486
|
extendInputContent(false);
|
|
@@ -586,7 +489,6 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
586
489
|
setNoFilters(false);
|
|
587
490
|
setShowSearchInputWhenHasTag(false);
|
|
588
491
|
}
|
|
589
|
-
|
|
590
492
|
if (tags.every(function (tag) {
|
|
591
493
|
return tag.canNotDelete === true;
|
|
592
494
|
})) {
|
|
@@ -594,110 +496,100 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
594
496
|
} else {
|
|
595
497
|
setOnlyHaveCanNotDeleteTags(false);
|
|
596
498
|
}
|
|
597
|
-
|
|
598
499
|
var tagsWidth = tags.map(function (item) {
|
|
599
500
|
return getTextWidth(item.label);
|
|
600
501
|
});
|
|
601
|
-
var maxTagContentWidth = showIdSelect ? 388 : 488;
|
|
602
|
-
|
|
502
|
+
var maxTagContentWidth = showIdSelect ? 388 : 488;
|
|
503
|
+
// 减去的是函数中算padding多加的
|
|
603
504
|
var ellipsisWidth = getTextWidth('...') - (8 * 2 + 8 + 24);
|
|
604
|
-
var canShowTags = [];
|
|
505
|
+
var canShowTags = [];
|
|
605
506
|
|
|
507
|
+
// -12:reduce函数中多加了一个12
|
|
606
508
|
var currentWidth = -12;
|
|
607
509
|
var tagsOnelineWidth = tagsWidth.reduce(function (res, item) {
|
|
608
510
|
// 12是每一个 tag之前的margin值
|
|
609
511
|
return res += item + 12;
|
|
610
512
|
}, currentWidth);
|
|
611
|
-
|
|
612
513
|
if (tagsOnelineWidth <= maxTagContentWidth) {
|
|
613
514
|
setMaxTagsWhenClosed(tags);
|
|
614
515
|
setOneLineCanShow(true);
|
|
615
516
|
return;
|
|
616
517
|
}
|
|
617
|
-
|
|
618
518
|
currentWidth = ellipsisWidth;
|
|
619
519
|
setOneLineCanShow(false);
|
|
620
|
-
|
|
621
520
|
for (var i = 0; i < tags.length; i++) {
|
|
622
521
|
if (maxTagContentWidth >= currentWidth + tagsWidth[i]) {
|
|
623
522
|
currentWidth += tagsWidth[i] + 12;
|
|
624
523
|
canShowTags.push(tags[i]);
|
|
625
524
|
}
|
|
626
525
|
}
|
|
627
|
-
|
|
628
526
|
setMaxTagsWhenClosed(canShowTags);
|
|
629
527
|
}
|
|
630
|
-
}, [hightLightFilterButton, showDefaultOptions, JSON.stringify(confirmed), currentLang]);
|
|
528
|
+
}, [hightLightFilterButton, showDefaultOptions, JSON.stringify(confirmed), currentLang]);
|
|
631
529
|
|
|
530
|
+
// 用于关闭开启的 tag框
|
|
632
531
|
(0, _react.useEffect)(function () {
|
|
633
532
|
if (!inputExtend) return;
|
|
634
|
-
|
|
635
533
|
function closeTagContent(e) {
|
|
636
534
|
if (!openStatusTagRef.current) return;
|
|
637
|
-
|
|
638
535
|
if (!openStatusTagRef.current.contains(e.target)) {
|
|
639
536
|
extendInputContent(false);
|
|
640
537
|
}
|
|
641
538
|
}
|
|
642
|
-
|
|
643
539
|
window.addEventListener('click', closeTagContent);
|
|
644
540
|
return function () {
|
|
645
541
|
window.removeEventListener('click', closeTagContent);
|
|
646
542
|
};
|
|
647
543
|
}, [inputExtend]);
|
|
648
|
-
var menu = (0, _jsxRuntime.jsx)(
|
|
649
|
-
children: (0, _jsxRuntime.jsxs)(
|
|
650
|
-
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
544
|
+
var menu = /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Menu, {
|
|
545
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Menu.Item, {
|
|
546
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
651
547
|
className: "igloo-form-filter-drop-down-container-content",
|
|
652
|
-
children: [(0, _jsxRuntime.jsxs)(
|
|
653
|
-
children: [(0, _jsxRuntime.jsx)(_iglooicon.FilterOutlined, {
|
|
548
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
549
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.FilterOutlined, {
|
|
654
550
|
style: {
|
|
655
551
|
fontSize: '24px',
|
|
656
552
|
color: '#666666'
|
|
657
553
|
}
|
|
658
|
-
}), (0, _jsxRuntime.jsx)(_typography.default, {
|
|
554
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
659
555
|
level: "h4",
|
|
660
556
|
children: filterTitle
|
|
661
557
|
})]
|
|
662
|
-
}), (0, _jsxRuntime.jsx)(
|
|
558
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Divider, {
|
|
663
559
|
style: {
|
|
664
560
|
margin: '16px 0px'
|
|
665
561
|
}
|
|
666
562
|
}), filterItems.map(function (item) {
|
|
667
563
|
var type = item.type,
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
564
|
+
options = item.options,
|
|
565
|
+
filterItemTitle = item.filterItemTitle,
|
|
566
|
+
key = item.key,
|
|
567
|
+
disabled = item.disabled,
|
|
568
|
+
disabledDate = item.disabledDate,
|
|
569
|
+
_item$format2 = item.format,
|
|
570
|
+
format = _item$format2 === void 0 ? defaultFormat : _item$format2,
|
|
571
|
+
dateRangeConfig = item.dateRangeConfig,
|
|
572
|
+
render = item.render,
|
|
573
|
+
tagTitle = item.tagTitle,
|
|
574
|
+
onChangeProps = item.onChange;
|
|
680
575
|
switch (type) {
|
|
681
576
|
case 'customize':
|
|
682
577
|
(0, _invariant.default)(typeof render === 'function', 'render is required of customize filter option');
|
|
683
578
|
(0, _invariant.default)(typeof tagTitle === 'function', 'tagTitle is required of customize filter option');
|
|
684
|
-
|
|
685
|
-
var onChange = function onChange(value) {
|
|
579
|
+
var _onChange = function _onChange(value) {
|
|
686
580
|
return dispatchOptionsChange({
|
|
687
581
|
type: key,
|
|
688
582
|
value: value
|
|
689
583
|
});
|
|
690
584
|
};
|
|
691
|
-
|
|
692
|
-
return (0, _jsxRuntime.jsx)(_customize.default, {
|
|
585
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_customize.default, {
|
|
693
586
|
optionKey: key,
|
|
694
587
|
value: optionsChanged[key],
|
|
695
|
-
onChange:
|
|
588
|
+
onChange: _onChange,
|
|
696
589
|
render: render
|
|
697
590
|
}, key);
|
|
698
|
-
|
|
699
591
|
case 'date':
|
|
700
|
-
return (0, _jsxRuntime.jsx)(_rangePicker.default, {
|
|
592
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rangePicker.default, {
|
|
701
593
|
title: filterItemTitle || formatMessage({
|
|
702
594
|
id: 'Date'
|
|
703
595
|
}),
|
|
@@ -714,10 +606,9 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
714
606
|
setPickerOpenStatus: setPickerOpenStatus,
|
|
715
607
|
onChange: onChangeProps
|
|
716
608
|
}, key);
|
|
717
|
-
|
|
718
609
|
case 'mult':
|
|
719
610
|
(0, _invariant.default)(Array.isArray(options), 'options is required');
|
|
720
|
-
return (0, _jsxRuntime.jsx)(_checkBox.default, {
|
|
611
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_checkBox.default, {
|
|
721
612
|
title: filterItemTitle,
|
|
722
613
|
configList: options,
|
|
723
614
|
optionKey: key,
|
|
@@ -728,10 +619,9 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
728
619
|
setConfirmValue: setConfimed,
|
|
729
620
|
onChange: onChangeProps
|
|
730
621
|
}, key);
|
|
731
|
-
|
|
732
622
|
case 'single':
|
|
733
623
|
(0, _invariant.default)(Array.isArray(options), 'options is required');
|
|
734
|
-
return (0, _jsxRuntime.jsx)(_radioBox.default, {
|
|
624
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_radioBox.default, {
|
|
735
625
|
title: filterItemTitle,
|
|
736
626
|
configList: options,
|
|
737
627
|
optionKey: key,
|
|
@@ -743,12 +633,12 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
743
633
|
}, key);
|
|
744
634
|
}
|
|
745
635
|
})]
|
|
746
|
-
}), (0, _jsxRuntime.jsxs)("div", {
|
|
636
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
747
637
|
className: "igloo-form-filter-drop-down-footer",
|
|
748
638
|
onClick: function onClick(e) {
|
|
749
639
|
return e.stopPropagation();
|
|
750
640
|
},
|
|
751
|
-
children: [(0, _jsxRuntime.jsx)("span", {
|
|
641
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
752
642
|
onClick: function onClick() {
|
|
753
643
|
typeof resetCallBack === 'function' && resetCallBack(_objectSpread({}, defaultOptions));
|
|
754
644
|
setTimeout(function () {
|
|
@@ -759,15 +649,15 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
759
649
|
});
|
|
760
650
|
}, 10);
|
|
761
651
|
},
|
|
762
|
-
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
652
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
763
653
|
level: "h4",
|
|
764
654
|
children: formatMessage({
|
|
765
655
|
id: 'Reset All Filters'
|
|
766
656
|
})
|
|
767
657
|
})
|
|
768
|
-
}), (0, _jsxRuntime.jsxs)(
|
|
658
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
769
659
|
size: 16,
|
|
770
|
-
children: [(0, _jsxRuntime.jsx)("span", {
|
|
660
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
771
661
|
onClick: function onClick() {
|
|
772
662
|
setDropVisible(false);
|
|
773
663
|
dispatchOptionsChange({
|
|
@@ -776,32 +666,30 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
776
666
|
});
|
|
777
667
|
setTimeRangeType(confirmedTimeRange);
|
|
778
668
|
},
|
|
779
|
-
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
669
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
780
670
|
level: "h4",
|
|
781
671
|
children: formatMessage({
|
|
782
672
|
id: 'Cancel'
|
|
783
673
|
})
|
|
784
674
|
})
|
|
785
|
-
}), (0, _jsxRuntime.jsx)(
|
|
675
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
786
676
|
onClick: function onClick() {
|
|
787
677
|
setDropVisible(false);
|
|
788
678
|
setShowSearchInputDefault(false);
|
|
789
679
|
setConfimed(optionsChanged);
|
|
790
680
|
setConfirmTimeRange(timeRangeType);
|
|
791
681
|
setSearchInputValue('');
|
|
792
|
-
|
|
793
682
|
if (typeof onFilter === 'function') {
|
|
794
683
|
onFilter(_objectSpread({}, optionsChanged));
|
|
795
684
|
typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, optionsChanged));
|
|
796
685
|
}
|
|
797
|
-
|
|
798
686
|
if (judgeChange(defaultOptions, optionsChanged, timePickerKey)) {
|
|
799
687
|
setHighLightFilter(true);
|
|
800
688
|
} else {
|
|
801
689
|
setHighLightFilter(false);
|
|
802
690
|
}
|
|
803
691
|
},
|
|
804
|
-
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
692
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
805
693
|
level: "h4",
|
|
806
694
|
style: {
|
|
807
695
|
padding: '0px 35px'
|
|
@@ -815,9 +703,9 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
815
703
|
})]
|
|
816
704
|
}, 1)
|
|
817
705
|
});
|
|
818
|
-
return (0, _jsxRuntime.jsxs)("div", {
|
|
706
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
819
707
|
className: "".concat(showIdSelect ? 'igloo-form-filter-with-select' : 'igloo-form-filter'),
|
|
820
|
-
children: [(0, _jsxRuntime.jsx)(
|
|
708
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
|
|
821
709
|
ref: invisibleRef,
|
|
822
710
|
style: {
|
|
823
711
|
width: '0',
|
|
@@ -825,29 +713,29 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
825
713
|
padding: '0px',
|
|
826
714
|
border: '0px'
|
|
827
715
|
}
|
|
828
|
-
}), showIdSelect && idKeyTypes.length !== 0 && (0, _jsxRuntime.jsx)(_select.default, {
|
|
716
|
+
}), showIdSelect && idKeyTypes.length !== 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_select.default, {
|
|
829
717
|
className: "igloo-form-filter-id-select",
|
|
830
718
|
onChange: function onChange(e) {
|
|
831
719
|
return setIdName(String(e));
|
|
832
720
|
},
|
|
833
721
|
defaultValue: idKeyTypeDefault,
|
|
834
|
-
suffixIcon: (0, _jsxRuntime.jsx)(_iglooicon.ArrowDownOutlined, {
|
|
722
|
+
suffixIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.ArrowDownOutlined, {
|
|
835
723
|
style: {
|
|
836
724
|
fontSize: 24
|
|
837
725
|
}
|
|
838
726
|
}),
|
|
839
727
|
children: idKeyTypes.map(function (item) {
|
|
840
|
-
return (0, _jsxRuntime.jsx)(Option, {
|
|
728
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
|
|
841
729
|
value: item.value,
|
|
842
|
-
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
730
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
843
731
|
level: "body1",
|
|
844
732
|
children: item.label
|
|
845
733
|
})
|
|
846
734
|
}, item.value);
|
|
847
735
|
})
|
|
848
|
-
}), (hightLightFilterButton || showDefaultOptions || stillHaveTagsToDelete) && !noFilters && !showSearchInputDefault && !showSearchInputWhenHasTag ? (0, _jsxRuntime.jsxs)("div", {
|
|
736
|
+
}), (hightLightFilterButton || showDefaultOptions || stillHaveTagsToDelete) && !noFilters && !showSearchInputDefault && !showSearchInputWhenHasTag ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
849
737
|
className: "igloo-filter-tag-position-reference",
|
|
850
|
-
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
738
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
851
739
|
ref: heightRef,
|
|
852
740
|
className: (0, _classnames.default)({
|
|
853
741
|
'tag-defalut-container-hide-status': inputExtend,
|
|
@@ -857,75 +745,73 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
857
745
|
onClick: function onClick(e) {
|
|
858
746
|
e.stopPropagation();
|
|
859
747
|
!oneLineCanShow && extendInputContent(true);
|
|
860
|
-
|
|
861
748
|
if (onlyHaveCanNotDeleteTags) {
|
|
862
749
|
setShowSearchInputWhenHasTag(true);
|
|
863
750
|
}
|
|
864
751
|
},
|
|
865
|
-
children: [(0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
752
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
866
753
|
className: 'search-icon'
|
|
867
|
-
}), (0, _jsxRuntime.jsxs)(
|
|
754
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
868
755
|
size: [12, 8],
|
|
869
756
|
className: "tag-container",
|
|
870
757
|
style: {
|
|
871
758
|
flex: '1'
|
|
872
759
|
},
|
|
873
760
|
children: [_toConsumableArray(inputExtend ? choosedTags : maxTagsWhenClosed).map(function (item, index) {
|
|
874
|
-
return (0, _jsxRuntime.jsxs)("div", {
|
|
761
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
875
762
|
className: "tag-card",
|
|
876
|
-
children: [(0, _jsxRuntime.jsx)(_typography.default, {
|
|
763
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
877
764
|
level: "body3",
|
|
878
765
|
children: item.label
|
|
879
|
-
}), !item.canNotDelete && (0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
766
|
+
}), !item.canNotDelete && /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
880
767
|
className: "delete-icon",
|
|
881
768
|
onClick: function onClick(e) {
|
|
882
769
|
e.stopPropagation();
|
|
883
770
|
var type = item.type;
|
|
884
|
-
|
|
885
771
|
if (type === 'date') {
|
|
886
772
|
setTimeRangeType(-1);
|
|
887
773
|
}
|
|
888
|
-
|
|
889
774
|
var statusCallBack = function statusCallBack(options) {
|
|
890
775
|
dispatchOptionsChange({
|
|
891
776
|
type: 'deleteOne',
|
|
892
777
|
value: options
|
|
893
778
|
});
|
|
894
779
|
setConfimed(options);
|
|
895
|
-
var tags = getChoosedTags(filterItems, options);
|
|
780
|
+
var tags = getChoosedTags(filterItems, options);
|
|
896
781
|
|
|
782
|
+
// 删除过程中需要一直展示tags 不切换到 search input
|
|
897
783
|
if (tags.length) {
|
|
898
784
|
setStillHaveTagsToDelete(true);
|
|
899
785
|
} else {
|
|
900
786
|
setStillHaveTagsToDelete(false);
|
|
901
787
|
}
|
|
902
788
|
};
|
|
903
|
-
|
|
904
789
|
var handleFilter = function handleFilter(confirmed) {
|
|
905
790
|
typeof onFilter === 'function' && onFilter(_objectSpread({}, confirmed));
|
|
906
791
|
typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, confirmed));
|
|
907
792
|
};
|
|
908
|
-
|
|
909
793
|
deleteSomeOne(confirmed, item, [statusCallBack, handleFilter]);
|
|
910
794
|
}
|
|
911
795
|
})]
|
|
912
796
|
}, index);
|
|
913
|
-
}), !oneLineCanShow && !inputExtend && (0, _jsxRuntime.jsx)("span", {
|
|
797
|
+
}), !oneLineCanShow && !inputExtend && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
914
798
|
children: "..."
|
|
915
799
|
})]
|
|
916
|
-
}), !onlyHaveCanNotDeleteTags && (0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
800
|
+
}), !onlyHaveCanNotDeleteTags && /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
917
801
|
className: "delete-all-icon",
|
|
918
802
|
onClick: function onClick(e) {
|
|
919
803
|
e.stopPropagation();
|
|
920
804
|
setTimeRangeType(-1);
|
|
921
|
-
extendInputContent(false);
|
|
805
|
+
extendInputContent(false);
|
|
922
806
|
|
|
923
|
-
|
|
807
|
+
// 不管什么情况下的 删除全部 都不应该继续展示tags
|
|
808
|
+
setStillHaveTagsToDelete(false);
|
|
924
809
|
|
|
810
|
+
// 对于全部删除而言 只能使用 choosedTags
|
|
925
811
|
var deleteAll = choosedTags.reduce(function (res, item) {
|
|
926
812
|
var key = item.key,
|
|
927
|
-
|
|
928
|
-
|
|
813
|
+
optionValue = item.optionValue,
|
|
814
|
+
canNotDelete = item.canNotDelete;
|
|
929
815
|
return canNotDelete ? _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, optionValue)) : res;
|
|
930
816
|
}, {});
|
|
931
817
|
var afterDeleteValue = deleteAllTagsType === 'restFilters' ? _objectSpread({}, defaultOptions) : deleteAll;
|
|
@@ -934,14 +820,13 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
934
820
|
value: afterDeleteValue
|
|
935
821
|
});
|
|
936
822
|
setConfimed(afterDeleteValue);
|
|
937
|
-
|
|
938
823
|
if (typeof onFilter === 'function') {
|
|
939
824
|
onFilter(_objectSpread({}, afterDeleteValue));
|
|
940
825
|
typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, afterDeleteValue));
|
|
941
826
|
}
|
|
942
827
|
}
|
|
943
828
|
})]
|
|
944
|
-
}), (0, _jsxRuntime.jsxs)("div", {
|
|
829
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
945
830
|
ref: openStatusTagRef,
|
|
946
831
|
className: (0, _classnames.default)('tag-extend-container-hide-status', {
|
|
947
832
|
'igloo-form-filter-has-select-tag-container': showIdSelect,
|
|
@@ -953,72 +838,70 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
953
838
|
},
|
|
954
839
|
onClick: function onClick(e) {
|
|
955
840
|
e.stopPropagation();
|
|
956
|
-
|
|
957
841
|
if (onlyHaveCanNotDeleteTags) {
|
|
958
842
|
setShowSearchInputWhenHasTag(true);
|
|
959
843
|
}
|
|
960
844
|
},
|
|
961
|
-
children: [(0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
845
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
962
846
|
className: 'search-icon'
|
|
963
|
-
}), (0, _jsxRuntime.jsx)(
|
|
847
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
964
848
|
size: [12, 8],
|
|
965
849
|
className: "tag-container",
|
|
966
850
|
style: {
|
|
967
851
|
flex: '1'
|
|
968
852
|
},
|
|
969
853
|
children: _toConsumableArray(inputExtend ? choosedTags : maxTagsWhenClosed).map(function (item, index) {
|
|
970
|
-
return (0, _jsxRuntime.jsxs)("div", {
|
|
854
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
971
855
|
className: "tag-card",
|
|
972
|
-
children: [(0, _jsxRuntime.jsx)(_typography.default, {
|
|
856
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
973
857
|
level: "body3",
|
|
974
858
|
children: item.label
|
|
975
|
-
}), !item.canNotDelete && (0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
859
|
+
}), !item.canNotDelete && /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
976
860
|
className: "delete-icon",
|
|
977
861
|
onClick: function onClick(e) {
|
|
978
862
|
e.stopPropagation();
|
|
979
863
|
var type = item.type;
|
|
980
|
-
|
|
981
864
|
if (type === 'date') {
|
|
982
865
|
setTimeRangeType(-1);
|
|
983
866
|
}
|
|
984
|
-
|
|
985
867
|
var statusCallBack = function statusCallBack(options) {
|
|
986
868
|
dispatchOptionsChange({
|
|
987
869
|
type: 'deleteOne',
|
|
988
870
|
value: options
|
|
989
871
|
});
|
|
990
872
|
setConfimed(options);
|
|
991
|
-
var tags = getChoosedTags(filterItems, options);
|
|
873
|
+
var tags = getChoosedTags(filterItems, options);
|
|
992
874
|
|
|
875
|
+
// 删除过程中需要一直展示tags 不切换到 search input
|
|
993
876
|
if (tags.length) {
|
|
994
877
|
setStillHaveTagsToDelete(true);
|
|
995
878
|
} else {
|
|
996
879
|
setStillHaveTagsToDelete(false);
|
|
997
880
|
}
|
|
998
881
|
};
|
|
999
|
-
|
|
1000
882
|
var handleFilter = function handleFilter(confirmed) {
|
|
1001
883
|
typeof onFilter === 'function' && onFilter(_objectSpread({}, confirmed));
|
|
1002
884
|
typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, confirmed));
|
|
1003
885
|
};
|
|
1004
|
-
|
|
1005
886
|
deleteSomeOne(confirmed, item, [statusCallBack, handleFilter]);
|
|
1006
887
|
}
|
|
1007
888
|
})]
|
|
1008
889
|
}, index);
|
|
1009
890
|
})
|
|
1010
|
-
}), !onlyHaveCanNotDeleteTags && (0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
891
|
+
}), !onlyHaveCanNotDeleteTags && /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.CrossOutlined, {
|
|
1011
892
|
className: "delete-all-icon",
|
|
1012
893
|
onClick: function onClick() {
|
|
1013
894
|
setTimeRangeType(-1);
|
|
1014
|
-
extendInputContent(false);
|
|
895
|
+
extendInputContent(false);
|
|
1015
896
|
|
|
1016
|
-
|
|
897
|
+
// 不管什么情况下的 删除全部 都不应该继续展示tags
|
|
898
|
+
setStillHaveTagsToDelete(false);
|
|
1017
899
|
|
|
900
|
+
// 对于全部删除而言 只能使用 choosedTags
|
|
1018
901
|
var deleteAll = choosedTags.reduce(function (res, item) {
|
|
1019
902
|
var key = item.key,
|
|
1020
|
-
|
|
1021
|
-
|
|
903
|
+
optionValue = item.optionValue,
|
|
904
|
+
canNotDelete = item.canNotDelete;
|
|
1022
905
|
return canNotDelete ? _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, optionValue)) : res;
|
|
1023
906
|
}, {});
|
|
1024
907
|
var afterDeleteValue = deleteAllTagsType === 'restFilters' ? _objectSpread({}, defaultOptions) : deleteAll;
|
|
@@ -1027,7 +910,6 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1027
910
|
value: afterDeleteValue
|
|
1028
911
|
});
|
|
1029
912
|
setConfimed(afterDeleteValue);
|
|
1030
|
-
|
|
1031
913
|
if (typeof onFilter === 'function') {
|
|
1032
914
|
onFilter(_objectSpread({}, afterDeleteValue));
|
|
1033
915
|
typeof parentFilterCallBack === 'function' && parentFilterCallBack(_objectSpread({}, afterDeleteValue));
|
|
@@ -1035,7 +917,7 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1035
917
|
}
|
|
1036
918
|
})]
|
|
1037
919
|
})]
|
|
1038
|
-
}) : (0, _jsxRuntime.jsx)(
|
|
920
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
|
|
1039
921
|
ref: searchInput,
|
|
1040
922
|
value: searchInputValue,
|
|
1041
923
|
onChange: function onChange(e) {
|
|
@@ -1048,7 +930,7 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1048
930
|
setShowSearchInputWhenHasTag(false);
|
|
1049
931
|
}
|
|
1050
932
|
},
|
|
1051
|
-
prefix: (0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
933
|
+
prefix: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
1052
934
|
style: {
|
|
1053
935
|
fontSize: '24px',
|
|
1054
936
|
color: '#999999',
|
|
@@ -1058,10 +940,8 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1058
940
|
className: "".concat(showIdSelect ? 'igloo-form-filter-has-select-input' : 'igloo-form-filter-default-input'),
|
|
1059
941
|
onPressEnter: function onPressEnter(e) {
|
|
1060
942
|
var value = undefined;
|
|
1061
|
-
|
|
1062
943
|
if (e.target.value) {
|
|
1063
944
|
var _ref;
|
|
1064
|
-
|
|
1065
945
|
value = searchWithFilter ? _objectSpread(_objectSpread(_defineProperty({}, idName || 'id', e.target.value), confirmed), {}, {
|
|
1066
946
|
searchValue: e.target.value,
|
|
1067
947
|
searchKey: idName
|
|
@@ -1072,15 +952,14 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1072
952
|
searchKey: idName
|
|
1073
953
|
});
|
|
1074
954
|
}
|
|
1075
|
-
|
|
1076
955
|
onFilter(value);
|
|
1077
956
|
typeof parentFilterCallBack === 'function' && parentFilterCallBack(value);
|
|
1078
957
|
}
|
|
1079
|
-
}), !inputOnly && (0, _jsxRuntime.jsx)(
|
|
958
|
+
}), !inputOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Dropdown, {
|
|
1080
959
|
getPopupContainer: function getPopupContainer() {
|
|
1081
960
|
return dropDownContainerRef.current;
|
|
1082
961
|
},
|
|
1083
|
-
overlay: dropVisible ? menu : (0, _jsxRuntime.jsx)(
|
|
962
|
+
overlay: dropVisible ? menu : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Menu, {
|
|
1084
963
|
style: {
|
|
1085
964
|
display: 'none'
|
|
1086
965
|
}
|
|
@@ -1088,13 +967,11 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1088
967
|
placement: 'bottomLeft',
|
|
1089
968
|
overlayClassName: "igloo-form-filter-drop-down-container",
|
|
1090
969
|
visible: dropVisible,
|
|
1091
|
-
|
|
970
|
+
onOpenChange: function onOpenChange(visible) {
|
|
1092
971
|
setDropVisible(visible);
|
|
1093
|
-
|
|
1094
972
|
if (visible) {
|
|
1095
973
|
typeof beforeOpenFilter === 'function' && beforeOpenFilter(_objectSpread({}, confirmed));
|
|
1096
974
|
}
|
|
1097
|
-
|
|
1098
975
|
setTimeout(function () {
|
|
1099
976
|
if (dropVisible) {
|
|
1100
977
|
setTimeRangeType(confirmedTimeRange);
|
|
@@ -1106,14 +983,14 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1106
983
|
}, 0);
|
|
1107
984
|
},
|
|
1108
985
|
trigger: ['click'],
|
|
1109
|
-
children: (0, _jsxRuntime.jsx)("div", {
|
|
986
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1110
987
|
className: "igloo-form-filter-button-container",
|
|
1111
|
-
children: (0, _jsxRuntime.jsx)(
|
|
988
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
1112
989
|
className: (0, _classnames.default)('igloo-form-filter-filter-button', {
|
|
1113
990
|
'igloo-form-filter-filter-button-active': dropVisible,
|
|
1114
991
|
'igloo-form-filter-filter-button-high-light': hightLightFilterButton
|
|
1115
992
|
}),
|
|
1116
|
-
icon: (0, _jsxRuntime.jsx)(_iglooicon.FilterOutlined, {
|
|
993
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.FilterOutlined, {
|
|
1117
994
|
style: {
|
|
1118
995
|
fontSize: '24px'
|
|
1119
996
|
}
|
|
@@ -1121,9 +998,9 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1121
998
|
onClick: function onClick() {
|
|
1122
999
|
setDropVisible(true);
|
|
1123
1000
|
},
|
|
1124
|
-
children: (0, _jsxRuntime.jsx)("span", {
|
|
1001
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1125
1002
|
className: "filter-text",
|
|
1126
|
-
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
1003
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
1127
1004
|
level: "body1",
|
|
1128
1005
|
children: formatMessage({
|
|
1129
1006
|
id: 'Filter'
|
|
@@ -1132,12 +1009,11 @@ var FilterComponent = function FilterComponent(props) {
|
|
|
1132
1009
|
})
|
|
1133
1010
|
})
|
|
1134
1011
|
})
|
|
1135
|
-
}), (0, _jsxRuntime.jsx)("div", {
|
|
1012
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1136
1013
|
className: "igloo-form-filter-drop-down",
|
|
1137
1014
|
ref: dropDownContainerRef
|
|
1138
1015
|
})]
|
|
1139
1016
|
});
|
|
1140
1017
|
};
|
|
1141
|
-
|
|
1142
1018
|
var _default = FilterComponent;
|
|
1143
1019
|
exports.default = _default;
|