iglooform 3.2.7 → 3.3.1
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/tmp/core/defineApp.ts +1 -1
- package/.dumi/tmp/core/helmet.ts +1 -1
- package/.dumi/tmp/core/history.ts +1 -1
- package/.dumi/tmp/core/historyIntelli.ts +1 -1
- package/.dumi/tmp/core/plugin.ts +2 -2
- package/.dumi/tmp/core/polyfill.ts +197 -197
- package/.dumi/tmp/core/route.tsx +33 -33
- package/.dumi/tmp/dumi/exports.ts +1 -1
- package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
- package/.dumi/tmp/dumi/meta/index.ts +33 -33
- package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
- package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
- package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
- package/.dumi/tmp/exports.ts +5 -5
- package/.dumi/tmp/testBrowser.tsx +3 -3
- package/.dumi/tmp/umi.ts +4 -4
- package/.dumirc.ts +1 -1
- package/es/form/index.js +3 -1
- package/es/form/step-items-selection/components/checkbox-group-items/index.js +110 -0
- package/es/form/step-items-selection/components/checkbox-group-items/style/index.js +1 -0
- package/es/form/step-items-selection/components/checkbox-group-items/style/index.less +9 -0
- package/es/form/step-items-selection/components/index.js +2 -0
- package/es/form/step-items-selection/components/item-info/index.js +62 -0
- package/es/form/step-items-selection/components/item-info/style/index.js +1 -0
- package/es/form/step-items-selection/components/item-info/style/index.less +31 -0
- package/es/form/step-items-selection/components/section-of-item-condition/hooks/index.js +1 -0
- package/es/form/step-items-selection/components/section-of-item-condition/hooks/useElements.d.ts +5 -0
- package/es/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js +73 -0
- package/es/form/step-items-selection/components/section-of-item-condition/index.js +89 -0
- package/es/form/step-items-selection/components/section-of-item-condition/style/index.js +1 -0
- package/es/form/step-items-selection/components/section-of-item-condition/style/index.less +17 -0
- package/es/form/step-items-selection/config.js +5 -0
- package/es/form/step-items-selection/index.js +227 -0
- package/es/form/step-items-selection/types.js +1 -0
- package/es/form/steps/index.js +86 -24
- package/es/input/input-number/basic.js +34 -0
- package/es/input/{input-number.js → input-number/index.js} +67 -31
- package/es/input/input-number/stepper/index.js +69 -0
- package/es/input/input-number/stepper/index.less +99 -0
- package/es/input/style/common.less +1 -0
- package/es/locale/en-US/messages.json +9 -3
- package/es/locale/id-ID/messages.json +9 -3
- package/es/locale/th-TH/messages.json +9 -3
- package/es/locale/vi-VN/messages.json +9 -3
- package/es/locale/zh-CN/messages.json +9 -3
- package/es/locale/zh-TW/messages.json +9 -3
- package/lib/form/index.js +3 -1
- package/lib/form/step-items-selection/components/checkbox-group-items/index.js +117 -0
- package/lib/form/step-items-selection/components/checkbox-group-items/style/index.js +3 -0
- package/lib/form/step-items-selection/components/checkbox-group-items/style/index.less +9 -0
- package/lib/form/step-items-selection/components/index.js +19 -0
- package/lib/form/step-items-selection/components/item-info/index.js +69 -0
- package/lib/form/step-items-selection/components/item-info/style/index.js +3 -0
- package/lib/form/step-items-selection/components/item-info/style/index.less +31 -0
- package/lib/form/step-items-selection/components/section-of-item-condition/hooks/index.js +16 -0
- package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useElements.d.ts +5 -0
- package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js +80 -0
- package/lib/form/step-items-selection/components/section-of-item-condition/index.js +96 -0
- package/lib/form/step-items-selection/components/section-of-item-condition/style/index.js +3 -0
- package/lib/form/step-items-selection/components/section-of-item-condition/style/index.less +17 -0
- package/lib/form/step-items-selection/config.js +16 -0
- package/lib/form/step-items-selection/index.js +234 -0
- package/lib/form/step-items-selection/types.js +5 -0
- package/lib/form/steps/index.js +84 -23
- package/lib/input/input-number/basic.js +42 -0
- package/lib/input/{input-number.js → input-number/index.js} +68 -32
- package/lib/input/input-number/stepper/index.js +75 -0
- package/lib/input/input-number/stepper/index.less +99 -0
- package/lib/input/style/common.less +1 -0
- package/lib/locale/en-US/messages.json +9 -3
- package/lib/locale/id-ID/messages.json +9 -3
- package/lib/locale/th-TH/messages.json +9 -3
- package/lib/locale/vi-VN/messages.json +9 -3
- package/lib/locale/zh-CN/messages.json +9 -3
- package/lib/locale/zh-TW/messages.json +9 -3
- package/package.json +1 -2
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/iglooform.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/es/admin-amount/style/index.d.ts +0 -0
- package/es/admin-upload/index.d.ts +0 -37
- package/es/admin-upload/style/index.d.ts +0 -1
- package/es/alert-message/style/index.d.ts +0 -1
- package/es/app/context.d.ts +0 -9
- package/es/app/index.d.ts +0 -8
- package/es/babel-plugin-import-option.d.ts +0 -7
- package/es/back-top/index.d.ts +0 -5
- package/es/back-top/style/index.d.ts +0 -1
- package/es/button/style/index.d.ts +0 -1
- package/es/card-detail/card-page.d.ts +0 -12
- package/es/card-detail/card.d.ts +0 -10
- package/es/card-detail/style/index.d.ts +0 -1
- package/es/checkbox/style/index.d.ts +0 -1
- package/es/claim-list/style/index.d.ts +0 -1
- package/es/config-provider.d.ts +0 -9
- package/es/confirmation/index.d.ts +0 -16
- package/es/confirmation/style/index.d.ts +0 -1
- package/es/currency-context/index.d.ts +0 -8
- package/es/currency-context/style/index.d.ts +0 -0
- package/es/date-picker/buddhist.d.ts +0 -6
- package/es/date-picker/index.d.ts +0 -13
- package/es/date-picker/style/index.d.ts +0 -1
- package/es/declaration/style/index.d.ts +0 -1
- package/es/detail-panel/style/index.d.ts +0 -1
- package/es/documents/index.d.ts +0 -15
- package/es/documents/style/index.d.ts +0 -1
- package/es/filter/index.d.ts +0 -52
- package/es/filter/style/index.d.ts +0 -1
- package/es/form/addable-section/index.d.ts +0 -20
- package/es/form/addable-section/style/index.d.ts +0 -1
- package/es/form/divider/style/index.d.ts +0 -1
- package/es/form/element/index.d.ts +0 -12
- package/es/form/element/style/index.d.ts +0 -1
- package/es/form/elements.d.ts +0 -8
- package/es/form/hstep/style/index.d.ts +0 -1
- package/es/form/hsteps/index.d.ts +0 -21
- package/es/form/hsteps/style/index.d.ts +0 -1
- package/es/form/index.d.ts +0 -4
- package/es/form/login/style/index.d.ts +0 -1
- package/es/form/messages.d.ts +0 -48
- package/es/form/page/style/index.d.ts +0 -1
- package/es/form/pages/style/index.d.ts +0 -1
- package/es/form/render/style/index.d.ts +0 -1
- package/es/form/section/index.d.ts +0 -16
- package/es/form/section/style/index.d.ts +0 -1
- package/es/form/step/style/index.d.ts +0 -1
- package/es/form/steps/index.d.ts +0 -10
- package/es/form/steps/style/index.d.ts +0 -1
- package/es/form/style/index.d.ts +0 -1
- package/es/form-context.d.ts +0 -28
- package/es/free-form/addable-section/index.d.ts +0 -19
- package/es/free-form/addable-section/style/index.d.ts +0 -1
- package/es/free-form/element/index.d.ts +0 -11
- package/es/free-form/element/style/index.d.ts +0 -1
- package/es/free-form/index.d.ts +0 -11
- package/es/free-form/messages.d.ts +0 -48
- package/es/free-form/page/style/index.d.ts +0 -1
- package/es/free-form/pages/style/index.d.ts +0 -1
- package/es/free-form/section/index.d.ts +0 -13
- package/es/free-form/section/style/index.d.ts +0 -1
- package/es/free-form/step/index.d.ts +0 -21
- package/es/free-form/step/style/index.d.ts +0 -1
- package/es/free-form/steps/index.d.ts +0 -12
- package/es/free-form/steps/style/index.d.ts +0 -1
- package/es/free-form/style/index.d.ts +0 -1
- package/es/home-menu/style/index.d.ts +0 -1
- package/es/hooks/ocr/index.d.ts +0 -3
- package/es/hooks/ocr/micro-blink.d.ts +0 -10
- package/es/index.d.ts +0 -49
- package/es/input/amount.d.ts +0 -14
- package/es/input/expiry-date.d.ts +0 -16
- package/es/input/input-date.d.ts +0 -8
- package/es/input/input-number.d.ts +0 -6
- package/es/input/phone-number.d.ts +0 -14
- package/es/input/style/amount/index.d.ts +0 -2
- package/es/input/style/index.d.ts +0 -2
- package/es/input/style/input-date/index.d.ts +0 -2
- package/es/input/style/otp/index.d.ts +0 -2
- package/es/input/style/phone-number/index.d.ts +0 -2
- package/es/input/style/text-area/index.d.ts +0 -2
- package/es/layout/defaultFooter.d.ts +0 -4
- package/es/layout/defaultHeader.d.ts +0 -4
- package/es/layout/style/index.d.ts +0 -1
- package/es/locale/en-US.d.ts +0 -2
- package/es/locale/format-message.d.ts +0 -10
- package/es/locale/formatted-message.d.ts +0 -6
- package/es/locale/id-ID.d.ts +0 -2
- package/es/locale/index.d.ts +0 -4
- package/es/locale/locale-context.d.ts +0 -12
- package/es/locale/locale-provider.d.ts +0 -13
- package/es/locale/ms-MY.d.ts +0 -2
- package/es/locale/th-TH.d.ts +0 -2
- package/es/locale/vi-VN.d.ts +0 -2
- package/es/locale/zh-CN.d.ts +0 -2
- package/es/locale/zh-TW.d.ts +0 -2
- package/es/login-page/index.d.ts +0 -7
- package/es/login-page/style/index.d.ts +0 -1
- package/es/media/file-icon.d.ts +0 -9
- package/es/media/index.d.ts +0 -29
- package/es/media/media.d.ts +0 -11
- package/es/media/preview.d.ts +0 -12
- package/es/media/style/index.d.ts +0 -1
- package/es/message/index.d.ts +0 -14
- package/es/message/style/index.d.ts +0 -1
- package/es/message/useMessage.d.ts +0 -6
- package/es/mobile-insurer-detail/style/index.d.ts +0 -1
- package/es/mobile-insurer-list/style/index.d.ts +0 -1
- package/es/modal/index.d.ts +0 -33
- package/es/modal/style/index.d.ts +0 -1
- package/es/modal/useModal.d.ts +0 -12
- package/es/ocr/index.d.ts +0 -15
- package/es/ocr/micro-blink/index.d.ts +0 -8
- package/es/ocr/micro-blink/style/index.d.ts +0 -1
- package/es/platform/index.d.ts +0 -2
- package/es/platform/platform-card/index.d.ts +0 -12
- package/es/platform/platform-card/style/index.d.ts +0 -1
- package/es/platform/switch-platform/index.d.ts +0 -12
- package/es/platform/switch-platform/style/index.d.ts +0 -1
- package/es/policy-list/style/index.d.ts +0 -1
- package/es/radio/index.d.ts +0 -24
- package/es/radio/radio-group-with-other.d.ts +0 -7
- package/es/radio/style/index.d.ts +0 -1
- package/es/search-box/style/index.d.ts +0 -1
- package/es/select/style/index.d.ts +0 -1
- package/es/status-box/style/index.d.ts +0 -1
- package/es/table/style/index.d.ts +0 -1
- package/es/tabs/index.d.ts +0 -15
- package/es/tabs/style/index.d.ts +0 -1
- package/es/types.d.ts +0 -187
- package/es/typography/style/index.d.ts +0 -1
- package/es/upload/index.d.ts +0 -16
- package/es/upload/style/index.d.ts +0 -1
- package/es/upload-photo/index.d.ts +0 -28
- package/es/upload-photo/media.d.ts +0 -7
- package/es/upload-photo/style/index.d.ts +0 -1
- package/es/upload-preview/index.d.ts +0 -9
- package/es/upload-preview/media.d.ts +0 -7
- package/es/upload-preview/style/index.d.ts +0 -1
- package/es/utils/agent-detect.d.ts +0 -1
- package/es/utils/form-utils.d.ts +0 -79
- package/es/utils/option-utils.d.ts +0 -29
- package/es/utils/tools.d.ts +0 -5
- package/es/utils/useAsyncEffect.d.ts +0 -3
- package/lib/admin-amount/style/index.d.ts +0 -0
- package/lib/admin-upload/index.d.ts +0 -37
- package/lib/admin-upload/style/index.d.ts +0 -1
- package/lib/alert-message/style/index.d.ts +0 -1
- package/lib/app/context.d.ts +0 -9
- package/lib/app/index.d.ts +0 -8
- package/lib/babel-plugin-import-option.d.ts +0 -7
- package/lib/back-top/index.d.ts +0 -5
- package/lib/back-top/style/index.d.ts +0 -1
- package/lib/button/style/index.d.ts +0 -1
- package/lib/card-detail/card-page.d.ts +0 -12
- package/lib/card-detail/card.d.ts +0 -10
- package/lib/card-detail/style/index.d.ts +0 -1
- package/lib/checkbox/style/index.d.ts +0 -1
- package/lib/claim-list/style/index.d.ts +0 -1
- package/lib/config-provider.d.ts +0 -9
- package/lib/confirmation/index.d.ts +0 -16
- package/lib/confirmation/style/index.d.ts +0 -1
- package/lib/currency-context/index.d.ts +0 -8
- package/lib/currency-context/style/index.d.ts +0 -0
- package/lib/date-picker/buddhist.d.ts +0 -6
- package/lib/date-picker/index.d.ts +0 -13
- package/lib/date-picker/style/index.d.ts +0 -1
- package/lib/declaration/style/index.d.ts +0 -1
- package/lib/detail-panel/style/index.d.ts +0 -1
- package/lib/documents/index.d.ts +0 -15
- package/lib/documents/style/index.d.ts +0 -1
- package/lib/filter/index.d.ts +0 -52
- package/lib/filter/style/index.d.ts +0 -1
- package/lib/form/addable-section/index.d.ts +0 -20
- package/lib/form/addable-section/style/index.d.ts +0 -1
- package/lib/form/divider/style/index.d.ts +0 -1
- package/lib/form/element/index.d.ts +0 -12
- package/lib/form/element/style/index.d.ts +0 -1
- package/lib/form/elements.d.ts +0 -8
- package/lib/form/hstep/style/index.d.ts +0 -1
- package/lib/form/hsteps/index.d.ts +0 -21
- package/lib/form/hsteps/style/index.d.ts +0 -1
- package/lib/form/index.d.ts +0 -4
- package/lib/form/login/style/index.d.ts +0 -1
- package/lib/form/messages.d.ts +0 -48
- package/lib/form/page/style/index.d.ts +0 -1
- package/lib/form/pages/style/index.d.ts +0 -1
- package/lib/form/render/style/index.d.ts +0 -1
- package/lib/form/section/index.d.ts +0 -16
- package/lib/form/section/style/index.d.ts +0 -1
- package/lib/form/step/style/index.d.ts +0 -1
- package/lib/form/steps/index.d.ts +0 -10
- package/lib/form/steps/style/index.d.ts +0 -1
- package/lib/form/style/index.d.ts +0 -1
- package/lib/form-context.d.ts +0 -28
- package/lib/free-form/addable-section/index.d.ts +0 -19
- package/lib/free-form/addable-section/style/index.d.ts +0 -1
- package/lib/free-form/element/index.d.ts +0 -11
- package/lib/free-form/element/style/index.d.ts +0 -1
- package/lib/free-form/index.d.ts +0 -11
- package/lib/free-form/messages.d.ts +0 -48
- package/lib/free-form/page/style/index.d.ts +0 -1
- package/lib/free-form/pages/style/index.d.ts +0 -1
- package/lib/free-form/section/index.d.ts +0 -13
- package/lib/free-form/section/style/index.d.ts +0 -1
- package/lib/free-form/step/index.d.ts +0 -21
- package/lib/free-form/step/style/index.d.ts +0 -1
- package/lib/free-form/steps/index.d.ts +0 -12
- package/lib/free-form/steps/style/index.d.ts +0 -1
- package/lib/free-form/style/index.d.ts +0 -1
- package/lib/home-menu/style/index.d.ts +0 -1
- package/lib/hooks/ocr/index.d.ts +0 -3
- package/lib/hooks/ocr/micro-blink.d.ts +0 -10
- package/lib/index.d.ts +0 -49
- package/lib/input/amount.d.ts +0 -14
- package/lib/input/expiry-date.d.ts +0 -16
- package/lib/input/input-date.d.ts +0 -8
- package/lib/input/input-number.d.ts +0 -6
- package/lib/input/phone-number.d.ts +0 -14
- package/lib/input/style/amount/index.d.ts +0 -2
- package/lib/input/style/index.d.ts +0 -2
- package/lib/input/style/input-date/index.d.ts +0 -2
- package/lib/input/style/otp/index.d.ts +0 -2
- package/lib/input/style/phone-number/index.d.ts +0 -2
- package/lib/input/style/text-area/index.d.ts +0 -2
- package/lib/layout/defaultFooter.d.ts +0 -4
- package/lib/layout/defaultHeader.d.ts +0 -4
- package/lib/layout/style/index.d.ts +0 -1
- package/lib/locale/en-US.d.ts +0 -2
- package/lib/locale/format-message.d.ts +0 -10
- package/lib/locale/formatted-message.d.ts +0 -6
- package/lib/locale/id-ID.d.ts +0 -2
- package/lib/locale/index.d.ts +0 -4
- package/lib/locale/locale-context.d.ts +0 -12
- package/lib/locale/locale-provider.d.ts +0 -13
- package/lib/locale/ms-MY.d.ts +0 -2
- package/lib/locale/th-TH.d.ts +0 -2
- package/lib/locale/vi-VN.d.ts +0 -2
- package/lib/locale/zh-CN.d.ts +0 -2
- package/lib/locale/zh-TW.d.ts +0 -2
- package/lib/login-page/index.d.ts +0 -7
- package/lib/login-page/style/index.d.ts +0 -1
- package/lib/media/file-icon.d.ts +0 -9
- package/lib/media/index.d.ts +0 -29
- package/lib/media/media.d.ts +0 -11
- package/lib/media/preview.d.ts +0 -12
- package/lib/media/style/index.d.ts +0 -1
- package/lib/message/index.d.ts +0 -14
- package/lib/message/style/index.d.ts +0 -1
- package/lib/message/useMessage.d.ts +0 -6
- package/lib/mobile-insurer-detail/style/index.d.ts +0 -1
- package/lib/mobile-insurer-list/style/index.d.ts +0 -1
- package/lib/modal/index.d.ts +0 -33
- package/lib/modal/style/index.d.ts +0 -1
- package/lib/modal/useModal.d.ts +0 -12
- package/lib/ocr/index.d.ts +0 -15
- package/lib/ocr/micro-blink/index.d.ts +0 -8
- package/lib/ocr/micro-blink/style/index.d.ts +0 -1
- package/lib/platform/index.d.ts +0 -2
- package/lib/platform/platform-card/index.d.ts +0 -12
- package/lib/platform/platform-card/style/index.d.ts +0 -1
- package/lib/platform/switch-platform/index.d.ts +0 -12
- package/lib/platform/switch-platform/style/index.d.ts +0 -1
- package/lib/policy-list/style/index.d.ts +0 -1
- package/lib/radio/index.d.ts +0 -24
- package/lib/radio/radio-group-with-other.d.ts +0 -7
- package/lib/radio/style/index.d.ts +0 -1
- package/lib/search-box/style/index.d.ts +0 -1
- package/lib/select/style/index.d.ts +0 -1
- package/lib/status-box/style/index.d.ts +0 -1
- package/lib/table/style/index.d.ts +0 -1
- package/lib/tabs/index.d.ts +0 -15
- package/lib/tabs/style/index.d.ts +0 -1
- package/lib/types.d.ts +0 -187
- package/lib/typography/style/index.d.ts +0 -1
- package/lib/upload/index.d.ts +0 -16
- package/lib/upload/style/index.d.ts +0 -1
- package/lib/upload-photo/index.d.ts +0 -28
- package/lib/upload-photo/media.d.ts +0 -7
- package/lib/upload-photo/style/index.d.ts +0 -1
- package/lib/upload-preview/index.d.ts +0 -9
- package/lib/upload-preview/media.d.ts +0 -7
- package/lib/upload-preview/style/index.d.ts +0 -1
- package/lib/utils/agent-detect.d.ts +0 -1
- package/lib/utils/form-utils.d.ts +0 -79
- package/lib/utils/option-utils.d.ts +0 -29
- package/lib/utils/tools.d.ts +0 -5
- package/lib/utils/useAsyncEffect.d.ts +0 -3
- package/yarn-error.log +0 -16168
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["checked", "onChange", "className", "readonly"];
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
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."); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
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); }
|
|
18
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
+
import { Fragment, useMemo } from 'react';
|
|
21
|
+
import Checkbox from "../../../../checkbox";
|
|
22
|
+
import Divider from "../../../divider";
|
|
23
|
+
import ItemInfo from "../item-info";
|
|
24
|
+
import "./style";
|
|
25
|
+
import { KEY_ITEM_ID } from "../../config";
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
var clsPrefix = 'igloo-items-selection-checkbox-group';
|
|
29
|
+
var CheckboxGroupItem = function CheckboxGroupItem(props) {
|
|
30
|
+
var checked = props.checked,
|
|
31
|
+
onChangeProp = props.onChange,
|
|
32
|
+
className = props.className,
|
|
33
|
+
readonly = props.readonly,
|
|
34
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
35
|
+
var onChange = function onChange(e) {
|
|
36
|
+
onChangeProp(e.target.checked);
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
39
|
+
className: className,
|
|
40
|
+
children: [!readonly && /*#__PURE__*/_jsx(Checkbox, {
|
|
41
|
+
className: "".concat(clsPrefix, "-").concat(className, "-checkbox"),
|
|
42
|
+
checked: checked,
|
|
43
|
+
onChange: onChange
|
|
44
|
+
}), /*#__PURE__*/_jsx(ItemInfo, _objectSpread({}, rest))]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
export var CheckboxGroupItems = function CheckboxGroupItems(props) {
|
|
48
|
+
var _props$itemsData = props.itemsData,
|
|
49
|
+
itemsData = _props$itemsData === void 0 ? [] : _props$itemsData,
|
|
50
|
+
itemsDataConfig = props.itemsDataConfig,
|
|
51
|
+
_props$value = props.value,
|
|
52
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
53
|
+
onChangeProp = props.onChange,
|
|
54
|
+
preview = props.preview;
|
|
55
|
+
var renderItemsData = useMemo(function () {
|
|
56
|
+
return itemsData.filter(function (item) {
|
|
57
|
+
return !preview || value.includes(item[KEY_ITEM_ID]);
|
|
58
|
+
});
|
|
59
|
+
}, [itemsData, preview]);
|
|
60
|
+
var visibleConfig = useMemo(function () {
|
|
61
|
+
var newVisibleConfig = {};
|
|
62
|
+
Object.entries(itemsDataConfig).forEach(function (_ref) {
|
|
63
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
64
|
+
k = _ref2[0],
|
|
65
|
+
v = _ref2[1];
|
|
66
|
+
newVisibleConfig[k] = v === null || v === void 0 ? void 0 : v.visible;
|
|
67
|
+
});
|
|
68
|
+
return newVisibleConfig;
|
|
69
|
+
}, [itemsDataConfig]);
|
|
70
|
+
var _onChange = function onChange(id, checked) {
|
|
71
|
+
if (checked) {
|
|
72
|
+
var newValue = [].concat(_toConsumableArray(value), [id]).sort(function (a, b) {
|
|
73
|
+
var indexA = itemsData.findIndex(function (item) {
|
|
74
|
+
return item[KEY_ITEM_ID] === a;
|
|
75
|
+
});
|
|
76
|
+
var indexB = itemsData.findIndex(function (item) {
|
|
77
|
+
return item[KEY_ITEM_ID] === b;
|
|
78
|
+
});
|
|
79
|
+
return indexA - indexB;
|
|
80
|
+
});
|
|
81
|
+
onChangeProp === null || onChangeProp === void 0 ? void 0 : onChangeProp(newValue);
|
|
82
|
+
} else {
|
|
83
|
+
onChangeProp === null || onChangeProp === void 0 ? void 0 : onChangeProp(value.filter(function (item) {
|
|
84
|
+
return item !== id;
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
89
|
+
className: clsPrefix,
|
|
90
|
+
children: [itemsData.length === 0 && /*#__PURE__*/_jsx("em", {
|
|
91
|
+
children: "Data exception: No Items Data."
|
|
92
|
+
}), renderItemsData.map(function (item, index) {
|
|
93
|
+
var id = item[KEY_ITEM_ID];
|
|
94
|
+
var checked = value.includes(id);
|
|
95
|
+
return /*#__PURE__*/_jsxs(Fragment, {
|
|
96
|
+
children: [/*#__PURE__*/_jsx(CheckboxGroupItem, _objectSpread({
|
|
97
|
+
className: "".concat(clsPrefix, "-item"),
|
|
98
|
+
checked: checked,
|
|
99
|
+
onChange: function onChange(checked) {
|
|
100
|
+
return _onChange(id, checked);
|
|
101
|
+
},
|
|
102
|
+
readonly: preview,
|
|
103
|
+
visibleConfig: visibleConfig
|
|
104
|
+
}, item)), index !== renderItemsData.length - 1 && /*#__PURE__*/_jsx(Divider, {
|
|
105
|
+
className: "".concat(clsPrefix, "-divider")
|
|
106
|
+
})]
|
|
107
|
+
}, id);
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.less";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { GoodsOutlined } from 'iglooicon';
|
|
3
|
+
import Typography from "../../../../typography";
|
|
4
|
+
import { LocaleContext } from "../../../../locale";
|
|
5
|
+
import "./style";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
var clsPrefix = 'igloo-items-selection-info';
|
|
9
|
+
var ItemInfo = function ItemInfo(props) {
|
|
10
|
+
var item_id = props.item_id,
|
|
11
|
+
item_name = props.item_name,
|
|
12
|
+
item_quantity = props.item_quantity,
|
|
13
|
+
item_image = props.item_image,
|
|
14
|
+
visibleConfig = props.visibleConfig;
|
|
15
|
+
var _useContext = useContext(LocaleContext),
|
|
16
|
+
formatMessage = _useContext.formatMessage;
|
|
17
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
18
|
+
className: clsPrefix,
|
|
19
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
20
|
+
className: "".concat(clsPrefix, "-image"),
|
|
21
|
+
children: visibleConfig !== null && visibleConfig !== void 0 && visibleConfig.item_image && item_image ? /*#__PURE__*/_jsx("img", {
|
|
22
|
+
className: "".concat(clsPrefix, "-image-image"),
|
|
23
|
+
src: item_image,
|
|
24
|
+
alt: "item logo"
|
|
25
|
+
}) : /*#__PURE__*/_jsx(GoodsOutlined, {
|
|
26
|
+
className: "".concat(clsPrefix, "-image-icon")
|
|
27
|
+
})
|
|
28
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
29
|
+
className: "".concat(clsPrefix, "-main"),
|
|
30
|
+
children: [(visibleConfig === null || visibleConfig === void 0 ? void 0 : visibleConfig.item_id) && /*#__PURE__*/_jsx(Typography, {
|
|
31
|
+
level: "body2",
|
|
32
|
+
className: "".concat(clsPrefix, "-main-caption"),
|
|
33
|
+
children: item_id ? formatMessage({
|
|
34
|
+
id: 'Item ID: {id}',
|
|
35
|
+
values: {
|
|
36
|
+
id: item_id
|
|
37
|
+
}
|
|
38
|
+
}) : formatMessage({
|
|
39
|
+
id: 'Item ID'
|
|
40
|
+
})
|
|
41
|
+
}), (visibleConfig === null || visibleConfig === void 0 ? void 0 : visibleConfig.item_name) && /*#__PURE__*/_jsx(Typography, {
|
|
42
|
+
level: "body1",
|
|
43
|
+
className: "".concat(clsPrefix, "-main-name"),
|
|
44
|
+
children: item_name !== null && item_name !== void 0 ? item_name : formatMessage({
|
|
45
|
+
id: 'Item Name'
|
|
46
|
+
})
|
|
47
|
+
}), (visibleConfig === null || visibleConfig === void 0 ? void 0 : visibleConfig.item_quantity) && /*#__PURE__*/_jsx(Typography, {
|
|
48
|
+
level: "body2",
|
|
49
|
+
className: "".concat(clsPrefix, "-main-caption"),
|
|
50
|
+
children: item_quantity ? formatMessage({
|
|
51
|
+
id: '{quantity} (Quantity)',
|
|
52
|
+
values: {
|
|
53
|
+
quantity: item_quantity
|
|
54
|
+
}
|
|
55
|
+
}) : formatMessage({
|
|
56
|
+
id: 'Quantity'
|
|
57
|
+
})
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
export default ItemInfo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.less";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.igloo-items-selection-info {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 8px;
|
|
4
|
+
&-image {
|
|
5
|
+
width: 48px;
|
|
6
|
+
height: 48px;
|
|
7
|
+
background: #f6f6ff;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
&-image {
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
max-height: 100%;
|
|
14
|
+
}
|
|
15
|
+
&-icon {
|
|
16
|
+
color: #5858ff;
|
|
17
|
+
font-size: 34px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
&-main {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: 2px;
|
|
24
|
+
&-name {
|
|
25
|
+
color: #212121;
|
|
26
|
+
}
|
|
27
|
+
&-caption {
|
|
28
|
+
color: #999;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./useElements";
|
package/es/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
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; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { useContext, useMemo } from 'react';
|
|
17
|
+
import { KEY_FORM_QUANTITY, KEY_ITEM_QUANTITY } from "../../../config";
|
|
18
|
+
import { LocaleContext } from "../../../../../locale";
|
|
19
|
+
export var useElements = function useElements(elements, itemData) {
|
|
20
|
+
var _useContext = useContext(LocaleContext),
|
|
21
|
+
formatMessage = _useContext.formatMessage;
|
|
22
|
+
// 将item信息加入表单隐藏项中
|
|
23
|
+
var hiddenElements = useMemo(function () {
|
|
24
|
+
return Object.entries(itemData).map(function (_ref) {
|
|
25
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
26
|
+
k = _ref2[0],
|
|
27
|
+
v = _ref2[1];
|
|
28
|
+
return {
|
|
29
|
+
type: 'Input',
|
|
30
|
+
name: k,
|
|
31
|
+
initialValue: v,
|
|
32
|
+
ignore: true
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}, [itemData]);
|
|
36
|
+
return useMemo(function () {
|
|
37
|
+
return elements.map(function (element) {
|
|
38
|
+
// claim_quantity max rule的处理
|
|
39
|
+
if (element.name === KEY_FORM_QUANTITY) {
|
|
40
|
+
var itemQuantity = itemData[KEY_ITEM_QUANTITY];
|
|
41
|
+
var claimQuantityRules = typeof itemQuantity !== 'number' ? [{
|
|
42
|
+
validator: function () {
|
|
43
|
+
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
44
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
45
|
+
while (1) switch (_context.prev = _context.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
throw new Error(formatMessage({
|
|
48
|
+
id: 'Invalid item_quantity'
|
|
49
|
+
}));
|
|
50
|
+
case 1:
|
|
51
|
+
case "end":
|
|
52
|
+
return _context.stop();
|
|
53
|
+
}
|
|
54
|
+
}, _callee);
|
|
55
|
+
}));
|
|
56
|
+
function validator() {
|
|
57
|
+
return _validator.apply(this, arguments);
|
|
58
|
+
}
|
|
59
|
+
return validator;
|
|
60
|
+
}()
|
|
61
|
+
}] : void 0;
|
|
62
|
+
var max = typeof itemQuantity === 'number' ? itemQuantity : void 0;
|
|
63
|
+
return _objectSpread(_objectSpread({}, element), {}, {
|
|
64
|
+
rules: claimQuantityRules,
|
|
65
|
+
min: 1,
|
|
66
|
+
max: max,
|
|
67
|
+
initialValue: max
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return element;
|
|
71
|
+
}).concat(hiddenElements);
|
|
72
|
+
}, [elements, itemData, hiddenElements]);
|
|
73
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { forwardRef, useImperativeHandle, useMemo, useState } from 'react';
|
|
14
|
+
import { Row } from 'antd';
|
|
15
|
+
import { ArrowDownOutlined, ArrowUpOutlined } from 'iglooicon';
|
|
16
|
+
import ItemInfo from "../item-info";
|
|
17
|
+
import Element from "../../../element";
|
|
18
|
+
import { useElements } from "./hooks";
|
|
19
|
+
import "./style";
|
|
20
|
+
import classNames from 'classnames';
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
var clsPrefix = 'igloo-items-selection-item-form';
|
|
24
|
+
export var SectionOfItemCondition = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
25
|
+
var itemData = props.itemData,
|
|
26
|
+
itemsDataConfig = props.itemsDataConfig,
|
|
27
|
+
elementsProp = props.elements,
|
|
28
|
+
parentName = props.parentName,
|
|
29
|
+
preview = props.preview,
|
|
30
|
+
index = props.index;
|
|
31
|
+
var _useState = useState(true),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
isOpenState = _useState2[0],
|
|
34
|
+
setIsOpenState = _useState2[1];
|
|
35
|
+
var elements = useElements(elementsProp, itemData);
|
|
36
|
+
var isOpen = isOpenState || preview;
|
|
37
|
+
useImperativeHandle(ref, function () {
|
|
38
|
+
return {
|
|
39
|
+
unfold: function unfold() {
|
|
40
|
+
setIsOpenState(true);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
var visibleConfig = useMemo(function () {
|
|
45
|
+
var newVisibleConfig = {};
|
|
46
|
+
Object.entries(itemsDataConfig).forEach(function (_ref) {
|
|
47
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
48
|
+
k = _ref2[0],
|
|
49
|
+
v = _ref2[1];
|
|
50
|
+
newVisibleConfig[k] = v === null || v === void 0 ? void 0 : v.visible;
|
|
51
|
+
});
|
|
52
|
+
return newVisibleConfig;
|
|
53
|
+
}, [itemsDataConfig]);
|
|
54
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
55
|
+
className: clsPrefix,
|
|
56
|
+
style: {
|
|
57
|
+
marginTop: index > 0 ? 8 : 0
|
|
58
|
+
},
|
|
59
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
60
|
+
className: "".concat(clsPrefix, "-item-info"),
|
|
61
|
+
children: [/*#__PURE__*/_jsx(ItemInfo, _objectSpread(_objectSpread({}, itemData), {}, {
|
|
62
|
+
visibleConfig: visibleConfig
|
|
63
|
+
})), !preview && /*#__PURE__*/_jsx("div", {
|
|
64
|
+
onClick: function onClick() {
|
|
65
|
+
return setIsOpenState(function (n) {
|
|
66
|
+
return !n;
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
children: isOpen ? /*#__PURE__*/_jsx(ArrowUpOutlined, {
|
|
70
|
+
className: "".concat(clsPrefix, "-item-info-arrow")
|
|
71
|
+
}) : /*#__PURE__*/_jsx(ArrowDownOutlined, {
|
|
72
|
+
className: "".concat(clsPrefix, "-item-info-arrow")
|
|
73
|
+
})
|
|
74
|
+
})]
|
|
75
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
76
|
+
className: classNames("".concat(clsPrefix, "-item-form"), _defineProperty({}, "".concat(clsPrefix, "-item-form-hidden"), !isOpen)),
|
|
77
|
+
children: /*#__PURE__*/_jsx(Row, {
|
|
78
|
+
gutter: [32, preview ? 16 : 24],
|
|
79
|
+
children: elements.map(function (child, index) {
|
|
80
|
+
return /*#__PURE__*/_jsx(Element, {
|
|
81
|
+
parentName: parentName,
|
|
82
|
+
config: child,
|
|
83
|
+
preview: preview
|
|
84
|
+
}, index);
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
89
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.less";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.igloo-items-selection-item-form {
|
|
2
|
+
&-item-info {
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
&-arrow {
|
|
6
|
+
font-size: 24px;
|
|
7
|
+
color: #666666;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
&-item-form {
|
|
12
|
+
margin-top: 24px;
|
|
13
|
+
&-hidden {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|