@commercetools-frontend/experimental-components 0.0.2
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/CHANGELOG.md +7 -0
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +15285 -0
- package/dist/commercetools-frontend-experimental-components.cjs.js +7 -0
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +15276 -0
- package/dist/commercetools-frontend-experimental-components.esm.js +14983 -0
- package/package.json +88 -0
- package/src/actions/reference-search/cart-discount/cart-discount.ctp.graphql +29 -0
- package/src/actions/reference-search/cart-discount/cart-discount.js +69 -0
- package/src/actions/reference-search/cart-discount/cart-discount.spec.js +115 -0
- package/src/actions/reference-search/cart-discount/index.js +1 -0
- package/src/actions/reference-search/category/category.ctp.graphql +44 -0
- package/src/actions/reference-search/category/category.js +50 -0
- package/src/actions/reference-search/category/category.spec.js +82 -0
- package/src/actions/reference-search/category/index.js +1 -0
- package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/cart-discount-reference-search.jsx +132 -0
- package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/cart-discount-reference-search.spec.js +225 -0
- package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/index.js +1 -0
- package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/messages.js +33 -0
- package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/option.jsx +45 -0
- package/src/components/attribute-definitions/reference-search/category-reference-search/category-reference-search.jsx +96 -0
- package/src/components/attribute-definitions/reference-search/category-reference-search/category-reference-search.spec.js +281 -0
- package/src/components/attribute-definitions/reference-search/category-reference-search/index.js +2 -0
- package/src/components/attribute-definitions/reference-search/category-reference-search/messages.js +37 -0
- package/src/components/attribute-definitions/reference-search/category-reference-search/option.jsx +71 -0
- package/src/components/attribute-definitions/reference-search/category-reference-search/use-cached-category-options.js +21 -0
- package/src/components/attribute-definitions/reference-search/index.js +10 -0
- package/src/components/attribute-definitions/reference-search/reference-search.jsx +179 -0
- package/src/components/attribute-definitions/reference-search/reference-search.module.css +13 -0
- package/src/components/business-unit-select-field/business-unit-select-field.jsx +141 -0
- package/src/components/business-unit-select-field/index.js +1 -0
- package/src/components/business-unit-select-input/business-unit-select-input.jsx +160 -0
- package/src/components/business-unit-select-input/business-unit-select-input.spec.js +118 -0
- package/src/components/business-unit-select-input/components/business-unit-async-select-input/business-unit-async-select-input.jsx +181 -0
- package/src/components/business-unit-select-input/components/business-unit-async-select-input/index.js +1 -0
- package/src/components/business-unit-select-input/components/business-unit-basic-select-input/business-unit-basic-select-input.jsx +150 -0
- package/src/components/business-unit-select-input/components/business-unit-basic-select-input/index.js +1 -0
- package/src/components/business-unit-select-input/components/business-unit-search-select-input/business-unit-search-select-input.jsx +187 -0
- package/src/components/business-unit-select-input/components/business-unit-search-select-input/fetch-business-units-by-where-predicate.ctp.graphql +9 -0
- package/src/components/business-unit-select-input/components/business-unit-search-select-input/index.js +1 -0
- package/src/components/business-unit-select-input/components/business-unit-search-select-input/mocks/handlers.js +16 -0
- package/src/components/business-unit-select-input/components/business-unit-search-select-input/mocks/index.js +3 -0
- package/src/components/business-unit-select-input/constants.js +2 -0
- package/src/components/business-unit-select-input/hooks/index.js +5 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/fetch-business-units-by-field.ctp.graphql +9 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/index.js +2 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/mocks/handlers.js +17 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/mocks/index.js +3 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/use-business-units-by-field-fetcher.js +35 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/fetch-business-units-list.ctp.graphql +21 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/index.js +2 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/mocks/handlers.js +17 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/mocks/index.js +3 -0
- package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/use-business-units-list-fetcher.js +50 -0
- package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/index.js +2 -0
- package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/mocks/handlers.js +17 -0
- package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/mocks/index.js +3 -0
- package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/total-number-of-business-units.ctp.graphql +5 -0
- package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/use-total-number-of-business-units-fetcher.js +20 -0
- package/src/components/business-unit-select-input/index.js +5 -0
- package/src/components/business-unit-select-input/messages.js +30 -0
- package/src/components/business-unit-select-input/utils.js +27 -0
- package/src/components/buttons/button/button.jsx +42 -0
- package/src/components/buttons/button/button.module.css +214 -0
- package/src/components/buttons/button/button.spec.js +84 -0
- package/src/components/buttons/button/index.js +1 -0
- package/src/components/buttons/button-close/__snapshots__/button-close.spec.js.snap +19 -0
- package/src/components/buttons/button-close/button-close.jsx +37 -0
- package/src/components/buttons/button-close/button-close.module.css +3 -0
- package/src/components/buttons/button-close/button-close.spec.js +68 -0
- package/src/components/buttons/button-close/index.js +1 -0
- package/src/components/buttons/button-group/button-group.jsx +62 -0
- package/src/components/buttons/button-group/button-group.module.css +53 -0
- package/src/components/buttons/button-group/button-group.spec.js +142 -0
- package/src/components/buttons/button-group/index.js +1 -0
- package/src/components/buttons/button-typed/button-typed.jsx +120 -0
- package/src/components/buttons/button-typed/button-typed.spec.js +95 -0
- package/src/components/buttons/button-typed/index.js +1 -0
- package/src/components/buttons/file-input/README.md +45 -0
- package/src/components/buttons/file-input/file-input.jsx +35 -0
- package/src/components/buttons/file-input/file-input.module.css +31 -0
- package/src/components/buttons/file-input/file-input.spec.js +115 -0
- package/src/components/buttons/file-input/index.js +1 -0
- package/src/components/buttons/file-input/messages.js +9 -0
- package/src/components/buttons/index.jsx +42 -0
- package/src/components/centered-loading-spinner/centered-loading-spinner.jsx +18 -0
- package/src/components/centered-loading-spinner/centered-loading-spinner.module.css +7 -0
- package/src/components/centered-loading-spinner/centered-loading-spinner.spec.js +13 -0
- package/src/components/centered-loading-spinner/index.js +2 -0
- package/src/components/channel-picker-input/channel-picker-input.ctp.graphql +24 -0
- package/src/components/channel-picker-input/channel-picker-input.jsx +210 -0
- package/src/components/channel-picker-input/channel-picker-input.spec.js +405 -0
- package/src/components/channel-picker-input/index.js +1 -0
- package/src/components/channel-picker-input/messages.js +14 -0
- package/src/components/channel-picker-input/tracking-events.js +24 -0
- package/src/components/country-picker/components/countries-async-select-dropdown/countries-async-select-dropdown.jsx +89 -0
- package/src/components/country-picker/components/countries-async-select-dropdown/index.js +1 -0
- package/src/components/country-picker/components/countries-basic-select-dropdown/countries-basic-select-dropdown.jsx +50 -0
- package/src/components/country-picker/components/countries-basic-select-dropdown/index.js +1 -0
- package/src/components/country-picker/constants.js +1 -0
- package/src/components/country-picker/country-picker.jsx +49 -0
- package/src/components/country-picker/index.js +1 -0
- package/src/components/country-picker/messages.js +20 -0
- package/src/components/divider/divider.jsx +21 -0
- package/src/components/divider/divider.module.css +25 -0
- package/src/components/divider/index.js +1 -0
- package/src/components/formatted-date-time/README.md +44 -0
- package/src/components/formatted-date-time/__snapshots__/formatted-date-time.spec.js.snap +19 -0
- package/src/components/formatted-date-time/formatted-date-time.jsx +35 -0
- package/src/components/formatted-date-time/formatted-date-time.spec.js +68 -0
- package/src/components/formatted-date-time/index.js +1 -0
- package/src/components/keep-display-name/index.js +1 -0
- package/src/components/keep-display-name/keep-display-name.js +6 -0
- package/src/components/messages.js +17 -0
- package/src/components/modal-container/__snapshots__/modal-container.spec.js.snap +21 -0
- package/src/components/modal-container/index.js +1 -0
- package/src/components/modal-container/modal-container.jsx +36 -0
- package/src/components/modal-container/modal-container.spec.js +10 -0
- package/src/components/modal-content-layout/index.js +1 -0
- package/src/components/modal-content-layout/modal-content-layout.jsx +38 -0
- package/src/components/modal-content-layout/modal-content-layout.module.css +69 -0
- package/src/components/modal-content-layout/modal-content-layout.spec.js +109 -0
- package/src/components/product-attributes/README.md +72 -0
- package/src/components/product-attributes/conversions.js +75 -0
- package/src/components/product-attributes/conversions.spec.js +97 -0
- package/src/components/product-attributes/index.js +3 -0
- package/src/components/product-attributes/product-attribute-input.jsx +68 -0
- package/src/components/product-attributes/product-attributes.jsx +79 -0
- package/src/components/product-picker-input/index.js +1 -0
- package/src/components/product-picker-input/messages.js +14 -0
- package/src/components/product-picker-input/product-picker-input.ctp.graphql +31 -0
- package/src/components/product-picker-input/product-picker-input.jsx +203 -0
- package/src/components/product-picker-input/product-picker-input.spec.js +357 -0
- package/src/components/product-picker-input/tracking-events.js +19 -0
- package/src/components/product-selection-picker/components/product-selection-async-select-dropdown/index.js +1 -0
- package/src/components/product-selection-picker/components/product-selection-async-select-dropdown/product-selection-async-select-dropdown.jsx +113 -0
- package/src/components/product-selection-picker/components/product-selection-basic-select-dropdown/index.js +1 -0
- package/src/components/product-selection-picker/components/product-selection-basic-select-dropdown/product-selection-basic-select-dropdown.jsx +98 -0
- package/src/components/product-selection-picker/components/product-selections-search-select-dropdown/index.js +1 -0
- package/src/components/product-selection-picker/components/product-selections-search-select-dropdown/product-selections-fetcher.ctp.graphql +13 -0
- package/src/components/product-selection-picker/components/product-selections-search-select-dropdown/product-selections-search-select-dropdown.jsx +121 -0
- package/src/components/product-selection-picker/constants.js +2 -0
- package/src/components/product-selection-picker/index.js +1 -0
- package/src/components/product-selection-picker/messages.js +20 -0
- package/src/components/product-selection-picker/product-selection-picker.jsx +84 -0
- package/src/components/product-type-picker-input/index.js +1 -0
- package/src/components/product-type-picker-input/messages.js +14 -0
- package/src/components/product-type-picker-input/product-type-picker-input.ctp.graphql +15 -0
- package/src/components/product-type-picker-input/product-type-picker-input.jsx +172 -0
- package/src/components/product-type-picker-input/product-type-picker-input.spec.js +266 -0
- package/src/components/product-type-picker-input/tracking-events.js +14 -0
- package/src/components/required-indicator/__snapshots__/required-indicator.spec.js.snap +17 -0
- package/src/components/required-indicator/index.js +1 -0
- package/src/components/required-indicator/required-indicator.jsx +16 -0
- package/src/components/required-indicator/required-indicator.module.css +3 -0
- package/src/components/required-indicator/required-indicator.spec.js +14 -0
- package/src/components/scroll-to-field-error/index.js +1 -0
- package/src/components/scroll-to-field-error/scroll-to-field-error.js +32 -0
- package/src/components/selectable-field-search-input/index.js +1 -0
- package/src/components/selectable-field-search-input/messages.js +14 -0
- package/src/components/selectable-field-search-input/selectable-field-search-input.jsx +147 -0
- package/src/components/selectable-field-search-input/selectable-field-search-input.module.css +14 -0
- package/src/components/selectable-field-search-input/selectable-field-search-input.spec.js +82 -0
- package/src/components/state-picker-input/index.js +1 -0
- package/src/components/state-picker-input/messages.js +14 -0
- package/src/components/state-picker-input/state-picker-input.ctp.graphql +24 -0
- package/src/components/state-picker-input/state-picker-input.jsx +204 -0
- package/src/components/state-picker-input/state-picker-input.spec.js +447 -0
- package/src/components/state-picker-input/tracking-events.js +24 -0
- package/src/components/store-select-field/index.js +1 -0
- package/src/components/store-select-field/store-select-field.jsx +145 -0
- package/src/components/store-select-input/components/stores-async-select-input/index.js +1 -0
- package/src/components/store-select-input/components/stores-async-select-input/stores-async-select-input.jsx +214 -0
- package/src/components/store-select-input/components/stores-basic-select-input/index.js +1 -0
- package/src/components/store-select-input/components/stores-basic-select-input/stores-basic-select-input.jsx +172 -0
- package/src/components/store-select-input/components/stores-search-select-input/fetch-stores-by-where-predicate.ctp.graphql +26 -0
- package/src/components/store-select-input/components/stores-search-select-input/index.js +2 -0
- package/src/components/store-select-input/components/stores-search-select-input/mocks/handlers.js +16 -0
- package/src/components/store-select-input/components/stores-search-select-input/mocks/index.js +3 -0
- package/src/components/store-select-input/components/stores-search-select-input/stores-search-select-input.jsx +261 -0
- package/src/components/store-select-input/constants.js +2 -0
- package/src/components/store-select-input/hooks/index.js +4 -0
- package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/fetch-stores-by-field.ctp.graphql +22 -0
- package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/index.js +2 -0
- package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/mocks/handlers.js +16 -0
- package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/mocks/index.js +3 -0
- package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/use-stores-by-field-fetcher.js +47 -0
- package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/index.js +2 -0
- package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/mocks/handlers.js +16 -0
- package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/mocks/index.js +3 -0
- package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/total-number-of-stores.ctp.graphql +5 -0
- package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/use-total-number-of-stores-fetcher.js +20 -0
- package/src/components/store-select-input/index.js +4 -0
- package/src/components/store-select-input/messages.js +36 -0
- package/src/components/store-select-input/store-select-input.jsx +163 -0
- package/src/components/store-select-input/store-select-input.spec.js +124 -0
- package/src/components/store-select-input/utils.js +40 -0
- package/src/components/tooltip/index.js +1 -0
- package/src/components/tooltip/tooltip.jsx +192 -0
- package/src/components/tooltip/tooltip.module.css +281 -0
- package/src/components/tooltip/tooltip.spec.js +138 -0
- package/src/components/validated-input/__snapshots__/validated-input.spec.js.snap +13 -0
- package/src/components/validated-input/index.js +2 -0
- package/src/components/validated-input/validated-input.jsx +318 -0
- package/src/components/validated-input/validated-input.module.css +9 -0
- package/src/components/validated-input/validated-input.spec.js +91 -0
- package/src/components/validation-error/README.md +87 -0
- package/src/components/validation-error/__snapshots__/validation-error-match.spec.js.snap +9 -0
- package/src/components/validation-error/__snapshots__/validation-error-switch.spec.js.snap +12 -0
- package/src/components/validation-error/index.js +4 -0
- package/src/components/validation-error/validation-error-match.js +31 -0
- package/src/components/validation-error/validation-error-match.spec.js +102 -0
- package/src/components/validation-error/validation-error-switch.js +45 -0
- package/src/components/validation-error/validation-error-switch.spec.js +78 -0
- package/src/components/with-mouse-over-state/README.md +33 -0
- package/src/components/with-mouse-over-state/index.js +1 -0
- package/src/components/with-mouse-over-state/with-mouse-over-state.jsx +32 -0
- package/src/components/with-mouse-over-state/with-mouse-over-state.spec.js +35 -0
- package/src/constants/index.js +114 -0
- package/src/custom-fields/custom-field-definitions-connector/README.md +90 -0
- package/src/custom-fields/custom-field-definitions-connector/__snapshots__/custom-field-definitions-connector.spec.js.snap +7 -0
- package/src/custom-fields/custom-field-definitions-connector/custom-field-definitions-connector.ctp.graphql +54 -0
- package/src/custom-fields/custom-field-definitions-connector/custom-field-definitions-connector.js +150 -0
- package/src/custom-fields/custom-field-definitions-connector/custom-field-definitions-connector.spec.js +288 -0
- package/src/custom-fields/custom-field-definitions-connector/index.js +3 -0
- package/src/custom-fields/custom-field-definitions-connector/mocks/handlers.js +16 -0
- package/src/custom-fields/custom-field-definitions-connector/mocks/index.js +4 -0
- package/src/custom-fields/custom-field-type-definitions-connector/README.md +193 -0
- package/src/custom-fields/custom-field-type-definitions-connector/__snapshots__/custom-field-type-definitions-connector.spec.js.snap +7 -0
- package/src/custom-fields/custom-field-type-definitions-connector/custom-field-type-definitions-connector.ctp.graphql +72 -0
- package/src/custom-fields/custom-field-type-definitions-connector/custom-field-type-definitions-connector.js +131 -0
- package/src/custom-fields/custom-field-type-definitions-connector/custom-field-type-definitions-connector.spec.js +82 -0
- package/src/custom-fields/custom-field-type-definitions-connector/index.js +1 -0
- package/src/custom-fields/custom-field-type-definitions-connector/utils.js +89 -0
- package/src/custom-fields/custom-field-type-definitions-connector/utils.spec.js +235 -0
- package/src/custom-fields/custom-fields/README.md +75 -0
- package/src/custom-fields/custom-fields/constants.js +38 -0
- package/src/custom-fields/custom-fields/custom-field-errors.jsx +60 -0
- package/src/custom-fields/custom-fields/custom-field-input.jsx +100 -0
- package/src/custom-fields/custom-fields/custom-field-tooltip.jsx +34 -0
- package/src/custom-fields/custom-fields/custom-fields-internal.jsx +148 -0
- package/src/custom-fields/custom-fields/custom-fields-label/cart-discounts-count.ctp.graphql +5 -0
- package/src/custom-fields/custom-fields/custom-fields-label/custom-fields-label.jsx +156 -0
- package/src/custom-fields/custom-fields/custom-fields-label/custom-fields-label.spec.js +92 -0
- package/src/custom-fields/custom-fields/custom-fields-label/index.js +1 -0
- package/src/custom-fields/custom-fields/custom-fields-label/messages.js +37 -0
- package/src/custom-fields/custom-fields/custom-fields.jsx +61 -0
- package/src/custom-fields/custom-fields/custom-nested-field-input/custom-nested-field-input.jsx +66 -0
- package/src/custom-fields/custom-fields/custom-nested-field-input/fetch-product-type.ctp.graphql +82 -0
- package/src/custom-fields/custom-fields/custom-nested-field-input/index.js +1 -0
- package/src/custom-fields/custom-fields/custom-nested-field-input/messages.js +9 -0
- package/src/custom-fields/custom-fields/custom-nested-field-input/product-type-reference.jsx +20 -0
- package/src/custom-fields/custom-fields/custom-nested-field-input/use-nested-product-type.js +72 -0
- package/src/custom-fields/custom-fields/index.js +5 -0
- package/src/custom-fields/custom-fields/nesting-level-context.js +5 -0
- package/src/custom-fields/custom-fields/set/custom-boolean-input-set.jsx +69 -0
- package/src/custom-fields/custom-fields/set/custom-boolean-input-set.spec.js +89 -0
- package/src/custom-fields/custom-fields/set/custom-input-set.jsx +233 -0
- package/src/custom-fields/custom-fields/set/custom-input-set.spec.js +193 -0
- package/src/custom-fields/custom-fields/set/expand-button.jsx +37 -0
- package/src/custom-fields/custom-fields/set/expand-button.spec.js +43 -0
- package/src/custom-fields/custom-fields/set/set-buttons.jsx +47 -0
- package/src/custom-fields/custom-fields/set/set-buttons.module.css +7 -0
- package/src/custom-fields/custom-fields/set/set-buttons.spec.js +39 -0
- package/src/custom-fields/custom-fields/test-utils.jsx +167 -0
- package/src/custom-fields/custom-fields/types/custom-boolean-input.jsx +49 -0
- package/src/custom-fields/custom-fields/types/custom-boolean-input.spec.js +51 -0
- package/src/custom-fields/custom-fields/types/custom-date-time-input.jsx +53 -0
- package/src/custom-fields/custom-fields/types/custom-date-time-input.spec.js +116 -0
- package/src/custom-fields/custom-fields/types/custom-enum-input.jsx +61 -0
- package/src/custom-fields/custom-fields/types/custom-enum-input.spec.js +113 -0
- package/src/custom-fields/custom-fields/types/custom-localized-enum-input.jsx +70 -0
- package/src/custom-fields/custom-fields/types/custom-localized-enum-input.spec.js +133 -0
- package/src/custom-fields/custom-fields/types/custom-localized-text-input.jsx +86 -0
- package/src/custom-fields/custom-fields/types/custom-localized-text-input.spec.js +99 -0
- package/src/custom-fields/custom-fields/types/custom-money-input.jsx +117 -0
- package/src/custom-fields/custom-fields/types/custom-money-input.module.css +3 -0
- package/src/custom-fields/custom-fields/types/custom-money-input.spec.js +124 -0
- package/src/custom-fields/custom-fields/types/custom-nested-input/custom-nested-input.jsx +331 -0
- package/src/custom-fields/custom-fields/types/custom-nested-input/custom-nested-input.spec.js +470 -0
- package/src/custom-fields/custom-fields/types/custom-nested-input/index.js +1 -0
- package/src/custom-fields/custom-fields/types/custom-nested-input/messages.js +82 -0
- package/src/custom-fields/custom-fields/types/custom-number-input.jsx +34 -0
- package/src/custom-fields/custom-fields/types/custom-number-input.spec.js +42 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-cart-discount-reference-input.jsx +44 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-cart-discount-reference-input.spec.js +132 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-category-reference-input.jsx +46 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-category-reference-input.spec.js +134 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-channel-reference-input.jsx +36 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-channel-reference-input.spec.js +130 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-product-reference-input.jsx +37 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-product-reference-input.spec.js +123 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-product-type-reference-input.jsx +36 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-product-type-reference-input.spec.js +146 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-raw-id-reference-input.jsx +32 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-raw-id-reference-input.spec.js +83 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-reference-input.jsx +78 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-state-reference-input.jsx +36 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/custom-state-reference-input.spec.js +130 -0
- package/src/custom-fields/custom-fields/types/custom-reference-input/index.js +1 -0
- package/src/custom-fields/custom-fields/types/custom-text-input.jsx +46 -0
- package/src/custom-fields/custom-fields/types/custom-text-input.spec.js +66 -0
- package/src/custom-fields/custom-fields/types/custom-time-input.jsx +74 -0
- package/src/custom-fields/custom-fields/types/custom-time-input.spec.js +91 -0
- package/src/custom-fields/custom-fields/utils/index.js +1 -0
- package/src/custom-fields/custom-fields/utils/utils.js +22 -0
- package/src/custom-fields/custom-fields/validations/index.js +1 -0
- package/src/custom-fields/custom-fields/validations/validations.js +117 -0
- package/src/custom-fields/custom-fields/validations/validations.spec.js +134 -0
- package/src/custom-fields/custom-fields-error-text-notification/custom-fields-error-text-notification.jsx +29 -0
- package/src/custom-fields/custom-fields-error-text-notification/custom-fields-error-text-notification.spec.js +31 -0
- package/src/custom-fields/custom-fields-error-text-notification/index.js +1 -0
- package/src/custom-fields/custom-fields-error-text-notification/messages.js +10 -0
- package/src/custom-fields/messages/custom-fields.js +17 -0
- package/src/features/picker/index.js +11 -0
- package/src/features/picker/shared/components/index.js +1 -0
- package/src/features/picker/shared/components/messages.js +9 -0
- package/src/features/picker/shared/components/option.jsx +51 -0
- package/src/features/picker/shared/hooks/use-current-option.js +24 -0
- package/src/features/picker/shared/hooks/use-current-option.spec.js +125 -0
- package/src/features/picker/shared/hooks/use-handlers.js +42 -0
- package/src/features/picker/shared/hooks/use-load-options.js +63 -0
- package/src/features/picker/shared/hooks/use-load-options.spec.js +63 -0
- package/src/features/picker/shared/hooks/use-product-type-options.js +190 -0
- package/src/features/picker/shared/hooks/use-product-type-options.spec.js +151 -0
- package/src/features/pim-indexer/components/index.js +5 -0
- package/src/features/pim-indexer/components/pim-indexer-context/index.js +1 -0
- package/src/features/pim-indexer/components/pim-indexer-context/pim-indexer-context.js +28 -0
- package/src/features/pim-indexer/components/pim-indexer-provider/fetch-indices-exist.pim-indexer.graphql +12 -0
- package/src/features/pim-indexer/components/pim-indexer-provider/fetch-pim-index-status.js +42 -0
- package/src/features/pim-indexer/components/pim-indexer-provider/fetch-pim-index-status.spec.js +128 -0
- package/src/features/pim-indexer/components/pim-indexer-provider/index.js +1 -0
- package/src/features/pim-indexer/components/pim-indexer-provider/messages.js +17 -0
- package/src/features/pim-indexer/components/pim-indexer-provider/pim-indexer-provider.jsx +287 -0
- package/src/features/pim-indexer/components/pim-indexer-provider/pim-indexer-provider.spec.js +80 -0
- package/src/features/pim-indexer/components/pim-indexer-provider/pim-indexer.pim-indexer.graphql +55 -0
- package/src/features/pim-indexer/components/with-pim-indexer/index.js +1 -0
- package/src/features/pim-indexer/components/with-pim-indexer/with-pim-indexer.jsx +19 -0
- package/src/features/pim-indexer/hocs/index.js +2 -0
- package/src/features/pim-indexer/hocs/inject-pim-indexer/index.js +1 -0
- package/src/features/pim-indexer/hocs/inject-pim-indexer/inject-pim-indexer.jsx +23 -0
- package/src/features/pim-indexer/hocs/inject-pim-indexer/inject-pim-indexer.spec.js +37 -0
- package/src/features/pim-indexer/hooks/index.js +2 -0
- package/src/features/pim-indexer/hooks/use-pim-indexer/index.js +1 -0
- package/src/features/pim-indexer/hooks/use-pim-indexer/use-pim-indexer.js +6 -0
- package/src/features/pim-indexer/index.js +6 -0
- package/src/features/platform-limits/assets/graphic-limits-reached.react.svg +50 -0
- package/src/features/platform-limits/customer-groups/components/index.js +5 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-combined/index.js +1 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-combined/platform-limits-customer-groups-combined.jsx +32 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-combined/platform-limits-customer-groups-combined.module.css +3 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-error-modal/index.js +1 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-error-modal/messages.js +15 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-error-modal/platform-limits-customer-groups-error-modal.jsx +43 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-notification/index.js +1 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-notification/platform-limits-customer-groups-notification.jsx +42 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-notification/platform-limits-customer-groups-notification.spec.js +51 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-status/index.js +1 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-status/messages.js +9 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-status/platform-limits-customer-groups-status.jsx +37 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-status/platform-limits-customer-groups-status.module.css +3 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-tooltip/index.js +1 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-tooltip/messages.js +9 -0
- package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-tooltip/platform-limits-customer-groups-tooltip.jsx +18 -0
- package/src/features/platform-limits/customer-groups/hocs/index.js +2 -0
- package/src/features/platform-limits/customer-groups/hocs/inject-customer-groups-platform-limits/index.js +1 -0
- package/src/features/platform-limits/customer-groups/hocs/inject-customer-groups-platform-limits/inject-customer-groups-platform-limits.jsx +23 -0
- package/src/features/platform-limits/customer-groups/hooks/index.js +4 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits/index.js +1 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits/use-customer-groups-platform-limits.js +40 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-fetcher/index.js +1 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-fetcher/use-customer-groups-platform-limits-fetcher.js +18 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-fetcher/use-customer-groups-platform-limits-fetcher.spec.js +45 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-modal-state/index.js +1 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-modal-state/use-customer-groups-platform-limits-modal-state.js +21 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-modal-state/use-customer-groups-platform-limits-modal-state.spec.js +39 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-status/index.js +1 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-status/use-customer-groups-platform-limits-status.js +35 -0
- package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-status/use-customer-groups-platform-limits-status.spec.js +66 -0
- package/src/features/platform-limits/customer-groups/index.js +3 -0
- package/src/features/platform-limits/customers/components/index.js +5 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-combined/index.js +1 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-combined/platform-limits-customers-combined.jsx +28 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-combined/platform-limits-customers-combined.module.css +3 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-error-modal/index.js +1 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-error-modal/messages.js +14 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-error-modal/platform-limits-customers-error-modal.jsx +43 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-notification/index.js +1 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-notification/platform-limits-customers-notification.jsx +40 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-notification/platform-limits-customers-notification.spec.js +51 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-status/index.js +1 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-status/messages.js +9 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-status/platform-limits-customers-status.jsx +36 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-status/platform-limits-customers-status.module.css +3 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-tooltip/index.js +1 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-tooltip/messages.js +9 -0
- package/src/features/platform-limits/customers/components/platform-limits-customers-tooltip/platform-limits-customers-tooltip.jsx +17 -0
- package/src/features/platform-limits/customers/hocs/index.js +2 -0
- package/src/features/platform-limits/customers/hocs/inject-customers-platform-limits/index.js +1 -0
- package/src/features/platform-limits/customers/hocs/inject-customers-platform-limits/inject-customers-platform-limits.jsx +23 -0
- package/src/features/platform-limits/customers/hooks/index.js +4 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits/index.js +1 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits/use-customers-platform-limits.js +38 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-fetcher/index.js +1 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-fetcher/use-customers-platform-limits-fetcher.js +18 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-fetcher/use-customers-platform-limits-fetcher.spec.js +43 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-modal-state/index.js +1 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-modal-state/use-customers-platform-limits-modal-state.js +20 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-modal-state/use-customers-platform-limits-modal-state.spec.js +39 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-status/index.js +1 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-status/use-customers-platform-limits-status.js +35 -0
- package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-status/use-customers-platform-limits-status.spec.js +61 -0
- package/src/features/platform-limits/customers/index.js +3 -0
- package/src/features/platform-limits/index.js +21 -0
- package/src/features/platform-limits/shared/components/index.js +2 -0
- package/src/features/platform-limits/shared/components/notifications/error/error.jsx +33 -0
- package/src/features/platform-limits/shared/components/notifications/error/index.js +1 -0
- package/src/features/platform-limits/shared/components/notifications/error/messages.js +34 -0
- package/src/features/platform-limits/shared/components/notifications/index.js +1 -0
- package/src/features/platform-limits/shared/components/notifications/notifications.js +9 -0
- package/src/features/platform-limits/shared/components/notifications/warning/index.js +1 -0
- package/src/features/platform-limits/shared/components/notifications/warning/messages.js +34 -0
- package/src/features/platform-limits/shared/components/notifications/warning/warning.jsx +41 -0
- package/src/features/platform-limits/shared/components/status-text/index.js +1 -0
- package/src/features/platform-limits/shared/components/status-text/status-text.jsx +19 -0
- package/src/features/platform-limits/shared/constants.js +16 -0
- package/src/features/platform-limits/shared/hooks/index.js +5 -0
- package/src/features/platform-limits/shared/hooks/use-intercept-navigation/index.js +1 -0
- package/src/features/platform-limits/shared/hooks/use-intercept-navigation/use-intercept-navigation.js +31 -0
- package/src/features/platform-limits/shared/hooks/use-intercept-navigation/use-intercept-navigation.spec.js +76 -0
- package/src/features/platform-limits/shared/hooks/use-limits-modal-state/index.js +1 -0
- package/src/features/platform-limits/shared/hooks/use-limits-modal-state/use-limits-modal-state.js +17 -0
- package/src/features/platform-limits/shared/hooks/use-limits-modal-state/use-limits-modal-state.spec.js +33 -0
- package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/__mocks__/index.js +405 -0
- package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/index.js +1 -0
- package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/mocks/handlers.js +16 -0
- package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/mocks/index.js +4 -0
- package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/platform-limits-query-variables.js +18 -0
- package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/use-platform-limits-fetcher.ctp.graphql +87 -0
- package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/use-platform-limits-fetcher.js +30 -0
- package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/use-platform-limits-fetcher.spec.js +202 -0
- package/src/features/platform-limits/shared/index.js +15 -0
- package/src/features/platform-limits/shared/utils/index.js +5 -0
- package/src/features/platform-limits/shared/utils/utils.js +17 -0
- package/src/features/platform-limits/shared/utils/utils.spec.js +126 -0
- package/src/features/platform-limits/shipping-methods/components/index.js +3 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-notification/index.js +1 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-notification/platform-limits-shipping-methods-notification.jsx +42 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-notification/platform-limits-shipping-methods-notification.spec.js +51 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-status/index.js +1 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-status/messages.js +9 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-status/platform-limits-shipping-methods-status.jsx +29 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-status/platform-limits-shipping-methods-status.spec.js +37 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-tooltip/index.js +1 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-tooltip/messages.js +10 -0
- package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-tooltip/platform-limits-shipping-methods-tooltip.jsx +18 -0
- package/src/features/platform-limits/shipping-methods/hocs/index.js +2 -0
- package/src/features/platform-limits/shipping-methods/hocs/inject-shipping-methods-platform-limits/index.js +1 -0
- package/src/features/platform-limits/shipping-methods/hocs/inject-shipping-methods-platform-limits/inject-shipping-methods-platform-limits.jsx +23 -0
- package/src/features/platform-limits/shipping-methods/hooks/index.js +3 -0
- package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits/index.js +1 -0
- package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits/use-shipping-methods-platform-limits.js +30 -0
- package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-fetcher/index.js +1 -0
- package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-fetcher/use-shipping-methods-platform-limits-fetcher.js +18 -0
- package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-fetcher/use-shipping-methods-platform-limits-fetcher.spec.js +46 -0
- package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-status/index.js +1 -0
- package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-status/use-shipping-methods-platform-limits-status.js +35 -0
- package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-status/use-shipping-methods-platform-limits-status.spec.js +67 -0
- package/src/features/platform-limits/shipping-methods/index.js +3 -0
- package/src/features/platform-limits/stores/hooks/index.js +3 -0
- package/src/features/platform-limits/stores/hooks/use-store-platform-limits/index.js +1 -0
- package/src/features/platform-limits/stores/hooks/use-store-platform-limits/use-store-platform-limits.js +19 -0
- package/src/features/platform-limits/stores/hooks/use-store-platform-limits-fetcher/index.js +1 -0
- package/src/features/platform-limits/stores/hooks/use-store-platform-limits-fetcher/use-store-platform-limits-fetcher.js +28 -0
- package/src/features/platform-limits/stores/hooks/use-store-platform-limits-fetcher/use-store-platform-limits-fetcher.spec.js +51 -0
- package/src/features/platform-limits/stores/hooks/use-store-platform-limits-status/index.js +1 -0
- package/src/features/platform-limits/stores/hooks/use-store-platform-limits-status/use-store-platform-limits-status.js +35 -0
- package/src/features/platform-limits/stores/hooks/use-store-platform-limits-status/use-store-platform-limits-status.spec.js +61 -0
- package/src/features/platform-limits/stores/index.js +1 -0
- package/src/features/platform-limits/tax-categories/components/index.js +3 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-notification/index.js +1 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-notification/platform-limits-tax-categories-notification.jsx +42 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-notification/platform-limits-tax-categories-notification.spec.js +51 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-status/index.js +1 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-status/messages.js +9 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-status/platform-limits-tax-categories-status.jsx +29 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-status/platform-limits-tax-categories-status.spec.js +37 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-tooltip/index.js +1 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-tooltip/messages.js +9 -0
- package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-tooltip/platform-limits-tax-categories-tooltip.jsx +18 -0
- package/src/features/platform-limits/tax-categories/hocs/index.js +2 -0
- package/src/features/platform-limits/tax-categories/hocs/inject-tax-categories-platform-limits/index.js +1 -0
- package/src/features/platform-limits/tax-categories/hocs/inject-tax-categories-platform-limits/inject-tax-categories-platform-limits.jsx +23 -0
- package/src/features/platform-limits/tax-categories/hooks/index.js +3 -0
- package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits/index.js +1 -0
- package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits/use-tax-categories-platform-limits.js +30 -0
- package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-fetcher/index.js +1 -0
- package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-fetcher/use-tax-categories-platform-limits-fetcher.js +18 -0
- package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-fetcher/use-tax-categories-platform-limits-fetcher.spec.js +48 -0
- package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-status/index.js +1 -0
- package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-status/use-tax-categories-platform-limits-status.js +35 -0
- package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-status/use-tax-categories-platform-limits-status.spec.js +66 -0
- package/src/features/platform-limits/tax-categories/index.js +3 -0
- package/src/features/platform-limits/test-utils/index.js +1 -0
- package/src/features/platform-limits/zones/components/index.js +3 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-notification/index.js +1 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-notification/platform-limits-zones-notification.jsx +40 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-notification/platform-limits-zones-notification.spec.js +51 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-status/index.js +1 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-status/messages.js +9 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-status/platform-limits-zones-status.jsx +32 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-status/platform-limits-zones-status.spec.js +37 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-tooltip/index.js +1 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-tooltip/messages.js +9 -0
- package/src/features/platform-limits/zones/components/platform-limits-zones-tooltip/platform-limits-zones-tooltip.jsx +17 -0
- package/src/features/platform-limits/zones/hocs/index.js +2 -0
- package/src/features/platform-limits/zones/hocs/inject-zones-platform-limits/index.js +1 -0
- package/src/features/platform-limits/zones/hocs/inject-zones-platform-limits/inject-zones-platform-limits.jsx +23 -0
- package/src/features/platform-limits/zones/hooks/index.js +3 -0
- package/src/features/platform-limits/zones/hooks/use-zones-platform-limits/index.js +1 -0
- package/src/features/platform-limits/zones/hooks/use-zones-platform-limits/use-zones-platform-limits.js +24 -0
- package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-fetcher/index.js +1 -0
- package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-fetcher/use-zones-platform-limits-fetcher.js +18 -0
- package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-fetcher/use-zones-platform-limits-fetcher.spec.js +42 -0
- package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-status/index.js +1 -0
- package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-status/use-zones-platform-limits-status.js +35 -0
- package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-status/use-zones-platform-limits-status.spec.js +61 -0
- package/src/features/platform-limits/zones/index.js +2 -0
- package/src/fields/attribute-reference-label/attribute-reference-label.jsx +38 -0
- package/src/fields/attribute-reference-label/attribute-reference-label.module.css +7 -0
- package/src/fields/attribute-reference-label/index.js +1 -0
- package/src/fields/autocomplete/README.md +66 -0
- package/src/fields/autocomplete/autocomplete.jsx +129 -0
- package/src/fields/autocomplete/autocomplete.module.css +3 -0
- package/src/fields/autocomplete/autocomplete.spec.js +144 -0
- package/src/fields/autocomplete/dropdown-indicator.jsx +14 -0
- package/src/fields/autocomplete/dropdown-indicator.module.css +5 -0
- package/src/fields/autocomplete/index.js +1 -0
- package/src/fields/boolean-field/boolean-field.jsx +82 -0
- package/src/fields/boolean-field/boolean-field.spec.js +80 -0
- package/src/fields/boolean-field/index.js +3 -0
- package/src/fields/boolean-field/messages.js +14 -0
- package/src/fields/checkbox-field/checkbox-field.jsx +50 -0
- package/src/fields/checkbox-field/checkbox-field.module.css +40 -0
- package/src/fields/checkbox-field/checkbox-field.spec.js +67 -0
- package/src/fields/checkbox-field/index.js +1 -0
- package/src/fields/checkbox-field/radio-check-icons.png +0 -0
- package/src/fields/expandable-field/expandable-field.jsx +93 -0
- package/src/fields/expandable-field/expandable-field.module.css +3 -0
- package/src/fields/expandable-field/expandable-field.spec.js +68 -0
- package/src/fields/expandable-field/index.js +1 -0
- package/src/fields/expandable-field/messages.js +14 -0
- package/src/fields/label-range/index.js +1 -0
- package/src/fields/label-range/label-range.jsx +28 -0
- package/src/fields/label-range/label-range.module.css +4 -0
- package/src/fields/label-range/label-range.spec.js +28 -0
- package/src/fields/label-required/index.js +2 -0
- package/src/fields/label-required/label-required.jsx +25 -0
- package/src/fields/localized-field/index.js +1 -0
- package/src/fields/localized-field/localized-field.jsx +320 -0
- package/src/fields/localized-field/localized-field.module.css +291 -0
- package/src/fields/localized-field/localized-field.spec.js +53 -0
- package/src/fields/localized-input/index.js +1 -0
- package/src/fields/localized-input/localized-input.jsx +20 -0
- package/src/fields/localized-textarea/index.js +1 -0
- package/src/fields/localized-textarea/localized-textarea.jsx +50 -0
- package/src/fields/missing-value-field/__snapshots__/missing-value-field.spec.js.snap +22 -0
- package/src/fields/missing-value-field/index.js +2 -0
- package/src/fields/missing-value-field/messages.js +9 -0
- package/src/fields/missing-value-field/missing-value-field.jsx +28 -0
- package/src/fields/missing-value-field/missing-value-field.spec.js +35 -0
- package/src/fields/multi-value-search-input/index.js +1 -0
- package/src/fields/multi-value-search-input/messages.js +14 -0
- package/src/fields/multi-value-search-input/multi-value-search-input.jsx +175 -0
- package/src/fields/multi-value-search-input/multi-value-search-input.module.css +45 -0
- package/src/fields/numeric-format-input/index.js +1 -0
- package/src/fields/numeric-format-input/numeric-format-input.jsx +184 -0
- package/src/fields/numeric-format-input/numeric-format-input.module.css +10 -0
- package/src/fields/numeric-format-input/numeric-format-input.spec.js +323 -0
- package/src/fields/search-input/index.js +1 -0
- package/src/fields/search-input/messages.js +14 -0
- package/src/fields/search-input/search-input.jsx +202 -0
- package/src/fields/search-input/search-input.module.css +75 -0
- package/src/fields/search-input/search-input.spec.js +116 -0
- package/src/fields/throttled-field/index.js +1 -0
- package/src/fields/throttled-field/throttled-field.jsx +189 -0
- package/src/fields/throttled-field/throttled-field.module.css +75 -0
- package/src/fields/throttled-field/throttled-field.spec.js +172 -0
- package/src/hocs/index.js +9 -0
- package/src/hocs/inject-data-table-pagination-state/index.js +1 -0
- package/src/hocs/inject-data-table-pagination-state/inject-data-table-pagination-state.jsx +41 -0
- package/src/hocs/inject-modal-state/index.js +1 -0
- package/src/hocs/inject-modal-state/inject-modal-state.jsx +31 -0
- package/src/hocs/inject-modal-state/inject-modal-state.spec.js +60 -0
- package/src/hocs/inject-notifications/README.md +43 -0
- package/src/hocs/inject-notifications/index.js +1 -0
- package/src/hocs/inject-notifications/inject-notifications.jsx +35 -0
- package/src/hocs/inject-notifications/inject-notifications.spec.js +55 -0
- package/src/hocs/inject-storage/index.js +1 -0
- package/src/hocs/inject-storage/inject-storage.jsx +45 -0
- package/src/hocs/inject-storage/inject-storage.spec.js +32 -0
- package/src/hocs/inject-toggle-state/index.js +1 -0
- package/src/hocs/inject-toggle-state/inject-toggle-state.jsx +31 -0
- package/src/hocs/inject-toggle-state/inject-toggle-state.spec.js +58 -0
- package/src/hocs/utils/get-display-name/get-display-name.js +13 -0
- package/src/hocs/utils/get-display-name/get-display-name.spec.js +52 -0
- package/src/hocs/utils/get-display-name/index.js +1 -0
- package/src/hocs/utils/index.js +2 -0
- package/src/hocs/utils/set-display-name/index.js +1 -0
- package/src/hocs/utils/set-display-name/set-display-name.js +8 -0
- package/src/hocs/utils/set-display-name/set-display-name.spec.js +9 -0
- package/src/hocs/with-props/index.js +1 -0
- package/src/hocs/with-props/with-props.jsx +21 -0
- package/src/hocs/with-props/with-props.spec.js +57 -0
- package/src/hocs/with-redirect-to/index.js +1 -0
- package/src/hocs/with-redirect-to/with-redirect-to.jsx +42 -0
- package/src/hocs/with-redirect-to/with-redirect-to.spec.js +77 -0
- package/src/hocs/wrap-display-name/index.js +1 -0
- package/src/hocs/wrap-display-name/wrap-display-name.js +6 -0
- package/src/hocs/wrap-display-name/wrap-display-name.spec.js +26 -0
- package/src/hooks/index.js +37 -0
- package/src/hooks/use-debounced-promise-callback.js +8 -0
- package/src/hooks/use-did-form-validation-fail/index.js +1 -0
- package/src/hooks/use-did-form-validation-fail/use-did-form-validation-fail.js +30 -0
- package/src/hooks/use-did-form-validation-fail/use-did-form-validation-fail.spec.js +48 -0
- package/src/hooks/use-event-callback/index.js +1 -0
- package/src/hooks/use-event-callback/use-event-callback.js +18 -0
- package/src/hooks/use-format-localized-field-to-string/index.js +1 -0
- package/src/hooks/use-format-localized-field-to-string/use-format-localized-field-to-string.js +43 -0
- package/src/hooks/use-format-localized-field-to-string/use-format-localized-field-to-string.spec.js +36 -0
- package/src/hooks/use-is-sso-user/index.js +1 -0
- package/src/hooks/use-is-sso-user/use-is-sso-user.js +13 -0
- package/src/hooks/use-is-sso-user/use-is-sso-user.spec.js +46 -0
- package/src/hooks/use-localized-key-fallback/index.js +1 -0
- package/src/hooks/use-localized-key-fallback/messages.js +9 -0
- package/src/hooks/use-localized-key-fallback/use-localized-key-fallback.js +31 -0
- package/src/hooks/use-localized-key-fallback/use-localized-key-fallback.spec.js +44 -0
- package/src/hooks/use-pending-requests/index.js +1 -0
- package/src/hooks/use-pending-requests/use-pending-requests.js +39 -0
- package/src/hooks/use-pending-requests/use-pending-requests.spec.js +10 -0
- package/src/hooks/use-persisted-reminder/index.js +1 -0
- package/src/hooks/use-persisted-reminder/use-persisted-reminder.js +88 -0
- package/src/hooks/use-persisted-reminder/use-persisted-reminder.spec.js +114 -0
- package/src/hooks/use-persisted-table-configuration/index.js +1 -0
- package/src/hooks/use-persisted-table-configuration/use-persisted-table-configuration.js +136 -0
- package/src/hooks/use-persisted-table-configuration/use-persisted-table-configuration.spec.js +170 -0
- package/src/hooks/use-previous/index.js +1 -0
- package/src/hooks/use-previous/use-previous.js +12 -0
- package/src/hooks/use-previous/use-previous.spec.js +25 -0
- package/src/hooks/use-product-selections-fetcher/conversions.js +15 -0
- package/src/hooks/use-product-selections-fetcher/fetch-product-selections.ctp.graphql +18 -0
- package/src/hooks/use-product-selections-fetcher/index.js +2 -0
- package/src/hooks/use-product-selections-fetcher/mocks/handlers.js +16 -0
- package/src/hooks/use-product-selections-fetcher/mocks/index.js +3 -0
- package/src/hooks/use-product-selections-fetcher/use-product-selections-fetcher.js +39 -0
- package/src/hooks/use-product-selections-fetcher/use-product-selections-fetcher.spec.js +71 -0
- package/src/hooks/use-product-selections-total-fetcher/fetch-product-selections-total.ctp.graphql +5 -0
- package/src/hooks/use-product-selections-total-fetcher/index.js +2 -0
- package/src/hooks/use-product-selections-total-fetcher/mocks/handlers.js +19 -0
- package/src/hooks/use-product-selections-total-fetcher/mocks/index.js +3 -0
- package/src/hooks/use-product-selections-total-fetcher/use-product-selections-total-fetcher.js +19 -0
- package/src/hooks/use-role-based-channels-fetcher/index.js +2 -0
- package/src/hooks/use-role-based-channels-fetcher/role-based-channels-fetcher.ctp.graphql +12 -0
- package/src/hooks/use-role-based-channels-fetcher/test-utils.js +37 -0
- package/src/hooks/use-role-based-channels-fetcher/use-role-based-channels-fetcher.js +44 -0
- package/src/hooks/use-role-notification/index.js +1 -0
- package/src/hooks/use-role-notification/notification-text/index.js +1 -0
- package/src/hooks/use-role-notification/notification-text/messages.js +21 -0
- package/src/hooks/use-role-notification/notification-text/notification-text.jsx +46 -0
- package/src/hooks/use-role-notification/use-role-notification.jsx +36 -0
- package/src/hooks/use-role-notification/use-role-notification.spec.js +46 -0
- package/src/hooks/use-role-notification-effect/index.js +1 -0
- package/src/hooks/use-role-notification-effect/use-role-notification-effect.js +56 -0
- package/src/hooks/use-role-notification-effect/use-role-notification-effect.spec.js +72 -0
- package/src/hooks/use-storage/__mocks__/index.js +26 -0
- package/src/hooks/use-storage/index.js +1 -0
- package/src/hooks/use-storage/use-storage.js +85 -0
- package/src/hooks/use-storage/use-storage.spec.js +237 -0
- package/src/hooks/use-store-keys-in-data-fence/index.js +1 -0
- package/src/hooks/use-store-keys-in-data-fence/use-store-keys-in-data-fence.js +38 -0
- package/src/hooks/use-store-keys-in-data-fence/use-store-keys-in-data-fence.spec.js +141 -0
- package/src/hooks/use-stores-list-fetcher/index.js +2 -0
- package/src/hooks/use-stores-list-fetcher/mocks/handlers.js +76 -0
- package/src/hooks/use-stores-list-fetcher/mocks/index.js +3 -0
- package/src/hooks/use-stores-list-fetcher/stores-list-query.ctp.graphql +52 -0
- package/src/hooks/use-stores-list-fetcher/use-stores-list-fetcher.js +71 -0
- package/src/hooks/use-stores-list-fetcher/use-stores-list-fetcher.spec.js +234 -0
- package/src/hooks/use-tracking/index.js +1 -0
- package/src/hooks/use-tracking/use-tracking.js +4 -0
- package/src/hooks/use-tracking/use-tracking.spec.js +29 -0
- package/src/hooks/use-tracking-shared/__mocks__/index.js +16 -0
- package/src/hooks/use-tracking-shared/index.js +1 -0
- package/src/hooks/use-tracking-shared/use-tracking-shared.js +58 -0
- package/src/index.js +489 -0
- package/src/internal-index.js +143 -0
- package/src/utils/active-modals/active-modals.js +7 -0
- package/src/utils/active-modals/active-modals.spec.js +27 -0
- package/src/utils/active-modals/index.js +1 -0
- package/src/utils/ariaset/ariaset.js +11 -0
- package/src/utils/ariaset/ariaset.spec.js +20 -0
- package/src/utils/ariaset/index.js +1 -0
- package/src/utils/array-helpers/array-helpers.js +2 -0
- package/src/utils/array-helpers/index.js +1 -0
- package/src/utils/attributes/attributes.js +38 -0
- package/src/utils/attributes/attributes.spec.js +180 -0
- package/src/utils/attributes/index.js +1 -0
- package/src/utils/build-search-query/build-search-query.js +27 -0
- package/src/utils/build-search-query/build-search-query.spec.js +129 -0
- package/src/utils/build-search-query/index.js +1 -0
- package/src/utils/bulk-notifications/get-bulk-notification.js +34 -0
- package/src/utils/bulk-notifications/get-bulk-notification.spec.js +142 -0
- package/src/utils/bulk-notifications/index.js +4 -0
- package/src/utils/business-roles/business-roles.js +24 -0
- package/src/utils/business-roles/index.js +4 -0
- package/src/utils/business-roles/messages.js +95 -0
- package/src/utils/capitalize-first/capitalize-first.js +3 -0
- package/src/utils/capitalize-first/capitalize-first.spec.js +7 -0
- package/src/utils/capitalize-first/index.js +1 -0
- package/src/utils/categories/categories.js +56 -0
- package/src/utils/categories/categories.spec.js +122 -0
- package/src/utils/categories/index.js +1 -0
- package/src/utils/clone/clone.js +3 -0
- package/src/utils/clone/clone.spec.js +23 -0
- package/src/utils/clone/index.js +1 -0
- package/src/utils/coerce-to-integer/coerce-to-integer.js +3 -0
- package/src/utils/coerce-to-integer/coerce-to-integer.spec.js +49 -0
- package/src/utils/coerce-to-integer/index.js +1 -0
- package/src/utils/connector/connector.js +30 -0
- package/src/utils/connector/connector.spec.js +174 -0
- package/src/utils/connector/index.js +1 -0
- package/src/utils/constants.js +43 -0
- package/src/utils/conversions/sort-array.js +6 -0
- package/src/utils/create-next-sort-definition/create-next-sort-definition.js +46 -0
- package/src/utils/create-next-sort-definition/create-next-sort-definition.spec.js +121 -0
- package/src/utils/create-next-sort-definition/index.js +1 -0
- package/src/utils/create-reducer/create-reducer.js +21 -0
- package/src/utils/create-reducer/create-reducer.spec.js +45 -0
- package/src/utils/create-reducer/index.js +1 -0
- package/src/utils/create-resource-reducer/create-resource-reducer.js +53 -0
- package/src/utils/create-resource-reducer/create-resource-reducer.spec.js +151 -0
- package/src/utils/create-resource-reducer/index.js +1 -0
- package/src/utils/customer/format-customer-address/format-customer-address.js +12 -0
- package/src/utils/customer/format-customer-address/format-customer-address.spec.js +43 -0
- package/src/utils/customer/format-customer-address/index.js +1 -0
- package/src/utils/customer/format-customer-name/format-customer-name.js +9 -0
- package/src/utils/customer/format-customer-name/format-customer-name.spec.js +44 -0
- package/src/utils/customer/format-customer-name/index.js +1 -0
- package/src/utils/customer/format-customer-title/format-customer-title.js +5 -0
- package/src/utils/customer/format-customer-title/format-customer-title.spec.js +23 -0
- package/src/utils/customer/format-customer-title/index.js +1 -0
- package/src/utils/dataset/dataset.js +34 -0
- package/src/utils/dataset/dataset.spec.js +70 -0
- package/src/utils/dataset/index.js +1 -0
- package/src/utils/encodings/encodings.js +24 -0
- package/src/utils/encodings/encodings.spec.js +21 -0
- package/src/utils/encodings/index.js +1 -0
- package/src/utils/filters/README.md +56 -0
- package/src/utils/filters/custom-fields/custom-fields.js +56 -0
- package/src/utils/filters/custom-fields/custom-fields.spec.js +328 -0
- package/src/utils/filters/custom-fields/index.js +1 -0
- package/src/utils/filters/date/date.js +114 -0
- package/src/utils/filters/date/date.spec.js +138 -0
- package/src/utils/filters/date/index.js +1 -0
- package/src/utils/filters/graphql/category-level/category-level.js +17 -0
- package/src/utils/filters/graphql/category-level/index.js +1 -0
- package/src/utils/filters/graphql/date/date.js +58 -0
- package/src/utils/filters/graphql/date/date.spec.js +122 -0
- package/src/utils/filters/graphql/date/index.js +1 -0
- package/src/utils/filters/graphql/graphql.js +42 -0
- package/src/utils/filters/graphql/graphql.spec.js +130 -0
- package/src/utils/filters/graphql/index.js +1 -0
- package/src/utils/filters/graphql/missing/index.js +1 -0
- package/src/utils/filters/graphql/missing/missing.js +7 -0
- package/src/utils/filters/graphql/missing/missing.spec.js +17 -0
- package/src/utils/filters/graphql/missing-locale/index.js +1 -0
- package/src/utils/filters/graphql/missing-locale/missing-locale.js +8 -0
- package/src/utils/filters/graphql/missing-locale/missing-locale.spec.js +17 -0
- package/src/utils/filters/graphql/number/index.js +1 -0
- package/src/utils/filters/graphql/number/number.js +37 -0
- package/src/utils/filters/graphql/number/number.spec.js +65 -0
- package/src/utils/filters/graphql/reference/index.js +1 -0
- package/src/utils/filters/graphql/reference/reference.js +26 -0
- package/src/utils/filters/graphql/reference/reference.spec.js +20 -0
- package/src/utils/filters/graphql/text/index.js +1 -0
- package/src/utils/filters/graphql/text/text.js +8 -0
- package/src/utils/filters/graphql/text/text.spec.js +35 -0
- package/src/utils/filters/is-date/index.js +1 -0
- package/src/utils/filters/is-date/is-date.js +17 -0
- package/src/utils/filters/is-date/is-date.spec.js +73 -0
- package/src/utils/filters/is-empty/index.js +1 -0
- package/src/utils/filters/is-empty/is-empty.js +9 -0
- package/src/utils/filters/is-empty/is-empty.spec.js +20 -0
- package/src/utils/filters/is-empty/range/index.js +1 -0
- package/src/utils/filters/is-empty/range/range.js +8 -0
- package/src/utils/filters/is-empty/range/range.spec.js +22 -0
- package/src/utils/filters/is-empty/single/index.js +1 -0
- package/src/utils/filters/is-empty/single/single.js +5 -0
- package/src/utils/filters/is-empty/single/single.spec.js +17 -0
- package/src/utils/filters/localized-string/index.js +1 -0
- package/src/utils/filters/localized-string/localized-string.js +4 -0
- package/src/utils/filters/localized-string/localized-string.spec.js +26 -0
- package/src/utils/filters/money/index.js +1 -0
- package/src/utils/filters/money/money.js +36 -0
- package/src/utils/filters/money/money.spec.js +55 -0
- package/src/utils/filters/time/index.js +1 -0
- package/src/utils/filters/time/time.js +65 -0
- package/src/utils/filters/time/time.spec.js +96 -0
- package/src/utils/filters/validation/custom-field/custom-field.js +70 -0
- package/src/utils/filters/validation/custom-field/custom-field.spec.js +237 -0
- package/src/utils/filters/validation/custom-field/index.js +1 -0
- package/src/utils/filters/validation/date/date.js +42 -0
- package/src/utils/filters/validation/date/date.spec.js +60 -0
- package/src/utils/filters/validation/date/index.js +1 -0
- package/src/utils/filters/validation/enum/enum.js +16 -0
- package/src/utils/filters/validation/enum/enum.spec.js +44 -0
- package/src/utils/filters/validation/enum/index.js +1 -0
- package/src/utils/filters/validation/number/index.js +1 -0
- package/src/utils/filters/validation/number/number.js +52 -0
- package/src/utils/filters/validation/number/number.spec.js +39 -0
- package/src/utils/filters/validation/text/index.js +1 -0
- package/src/utils/filters/validation/text/text.js +9 -0
- package/src/utils/filters/validation/text/text.spec.js +20 -0
- package/src/utils/formats/custom-field/custom-field.js +66 -0
- package/src/utils/formats/custom-field/custom-field.spec.js +91 -0
- package/src/utils/formats/custom-field/index.js +1 -0
- package/src/utils/formats/date/__mocks__/index.js +2 -0
- package/src/utils/formats/date/date.js +58 -0
- package/src/utils/formats/date/date.spec.js +241 -0
- package/src/utils/formats/date/index.js +1 -0
- package/src/utils/formats/discount/discount.js +12 -0
- package/src/utils/formats/discount/discount.spec.js +75 -0
- package/src/utils/formats/discount/index.js +1 -0
- package/src/utils/formats/index.js +4 -0
- package/src/utils/formats/money/index.js +6 -0
- package/src/utils/formats/money/money.js +50 -0
- package/src/utils/formats/money/money.spec.js +117 -0
- package/src/utils/formats/percentage/index.js +1 -0
- package/src/utils/formats/percentage/percentage.js +7 -0
- package/src/utils/formats/percentage/percentage.spec.js +18 -0
- package/src/utils/formats/product-attribute/index.js +1 -0
- package/src/utils/formats/product-attribute/messages.js +14 -0
- package/src/utils/formats/product-attribute/product-attribute.js +127 -0
- package/src/utils/formats/product-attribute/product-attribute.spec.js +128 -0
- package/src/utils/get-currency-code-data/currency-code-data.js +1247 -0
- package/src/utils/get-currency-code-data/get-currency-code-data.js +53 -0
- package/src/utils/get-currency-code-data/index.js +12 -0
- package/src/utils/get-prefix-search-bounds/get-prefix-search-bounds.js +26 -0
- package/src/utils/get-prefix-search-bounds/get-prefix-search-bounds.spec.js +14 -0
- package/src/utils/get-prefix-search-bounds/index.js +1 -0
- package/src/utils/graphql/__snapshots__/graphql.spec.js.snap +45 -0
- package/src/utils/graphql/fragments/address.ctp.graphql +39 -0
- package/src/utils/graphql/fragments/custom-fields.ctp.graphql +67 -0
- package/src/utils/graphql/fragments/store-basic-info.ctp.graphql +11 -0
- package/src/utils/graphql/graphql.js +579 -0
- package/src/utils/graphql/graphql.spec.js +1129 -0
- package/src/utils/graphql/index.js +1 -0
- package/src/utils/has-error-code/has-error-code.js +15 -0
- package/src/utils/has-error-code/has-error-code.spec.js +56 -0
- package/src/utils/has-error-code/has-invalid-input-error.js +7 -0
- package/src/utils/has-error-code/has-semantic-error.js +7 -0
- package/src/utils/has-error-code/has-semantic-error.spec.js +56 -0
- package/src/utils/has-error-code/index.js +3 -0
- package/src/utils/is-uuid/index.js +1 -0
- package/src/utils/is-uuid/is-uuid.js +6 -0
- package/src/utils/is-uuid/is-uuid.spec.js +25 -0
- package/src/utils/minusify/index.js +1 -0
- package/src/utils/minusify/minusify.js +4 -0
- package/src/utils/minusify/minusify.spec.js +9 -0
- package/src/utils/numbers/index.js +1 -0
- package/src/utils/numbers/numbers.js +32 -0
- package/src/utils/numbers/numbers.spec.js +57 -0
- package/src/utils/omit-deep/index.js +1 -0
- package/src/utils/omit-deep/omit-deep.js +20 -0
- package/src/utils/pim-query-clauses.js +43 -0
- package/src/utils/prices/index.js +1 -0
- package/src/utils/prices/prices.js +79 -0
- package/src/utils/prices/prices.spec.js +265 -0
- package/src/utils/product-selections/convert-product-selection-from-graphql.js +80 -0
- package/src/utils/product-selections/index.js +1 -0
- package/src/utils/product-types/index.js +1 -0
- package/src/utils/product-types/product-types.js +122 -0
- package/src/utils/product-types/product-types.spec.js +328 -0
- package/src/utils/products/index.js +1 -0
- package/src/utils/products/messages.js +16 -0
- package/src/utils/products/products.jsx +258 -0
- package/src/utils/products/products.spec.js +331 -0
- package/src/utils/query-string/index.js +1 -0
- package/src/utils/query-string/query-string.js +37 -0
- package/src/utils/query-string/query-string.spec.js +56 -0
- package/src/utils/request-cache/index.js +2 -0
- package/src/utils/request-cache/request-cache.js +52 -0
- package/src/utils/request-cache/request-cache.spec.js +118 -0
- package/src/utils/shallow-equal/index.js +1 -0
- package/src/utils/shallow-equal/shallow-equal.js +19 -0
- package/src/utils/shallow-equal/shallow-equal.spec.js +45 -0
- package/src/utils/should-update-attribute-input/index.js +1 -0
- package/src/utils/should-update-attribute-input/should-update-attribute-input.js +43 -0
- package/src/utils/should-update-attribute-input/should-update-attribute-input.spec.js +96 -0
- package/src/utils/slugify/index.js +1 -0
- package/src/utils/slugify/slugify.js +10 -0
- package/src/utils/slugify/slugify.spec.js +11 -0
- package/src/utils/swap-array-items/index.js +2 -0
- package/src/utils/swap-array-items/swap-array-items.js +13 -0
- package/src/utils/swap-array-items/swap-array-items.spec.js +52 -0
- package/src/utils/text-fallback/text-fallback.js +6 -0
- package/src/utils/time-zones/index.js +5 -0
- package/src/utils/time-zones/time-zone-utils.js +34 -0
- package/src/utils/time-zones/time-zone-utils.spec.js +47 -0
- package/src/utils/track-menu-click/index.js +1 -0
- package/src/utils/track-menu-click/track-menu-click.js +28 -0
- package/src/utils/track-menu-click/track-menu-click.spec.js +66 -0
- package/src/utils/transform-to-proper-noun-case/index.js +1 -0
- package/src/utils/transform-to-proper-noun-case/transform-to-proper-noun-case.js +10 -0
- package/src/utils/transform-to-proper-noun-case/transform-to-proper-noun-case.spec.js +23 -0
- package/src/utils/truncate/index.js +1 -0
- package/src/utils/truncate/truncate.js +9 -0
- package/src/utils/truncate/truncate.spec.js +23 -0
- package/src/utils/type-definitions/index.js +1 -0
- package/src/utils/type-definitions/type-definitions.js +118 -0
- package/src/utils/type-definitions/type-definitions.spec.js +547 -0
- package/src/utils/update-status-in-list/index.js +1 -0
- package/src/utils/update-status-in-list/update-status-in-list.js +16 -0
- package/src/utils/validation/get-indexes-of-invalid-values.js +16 -0
- package/src/utils/validation/get-indexes-of-invalid-values.spec.js +31 -0
- package/src/utils/validation/index.js +3 -0
- package/src/utils/validation/validation.js +169 -0
- package/src/utils/validation/validation.spec.js +99 -0
- package/src/utils/validation/without-empty-errors-by-field.js +5 -0
- package/src/utils/validation/without-empty-errors-by-field.spec.js +74 -0
- package/src/utils/with-pending-requests/index.js +1 -0
- package/src/utils/with-pending-requests/with-pending-requests.jsx +21 -0
- package/src/utils/with-pending-requests/with-pending-requests.spec.js +62 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
export default defineMessages({
|
|
4
|
+
ExecutiveManagement: {
|
|
5
|
+
id: 'Shared.businessRoles.executiveManagement',
|
|
6
|
+
description: 'The label for one of the selectable business roles',
|
|
7
|
+
defaultMessage: 'Executive Management',
|
|
8
|
+
},
|
|
9
|
+
BusinessIntelligence: {
|
|
10
|
+
id: 'Shared.businessRoles.businessIntelligence',
|
|
11
|
+
description: 'The label for one of the selectable business roles',
|
|
12
|
+
defaultMessage: 'Business Intelligence',
|
|
13
|
+
},
|
|
14
|
+
BuyingPlanningAndInventoryManagement: {
|
|
15
|
+
id: 'Shared.businessRoles.buyingPlanningInventoryManagement',
|
|
16
|
+
description: 'The label for one of the selectable business roles',
|
|
17
|
+
defaultMessage:
|
|
18
|
+
'Buying, Planning & Instock Management Buying, Planning & Inventory Management',
|
|
19
|
+
},
|
|
20
|
+
DataQualityAndContentManagement: {
|
|
21
|
+
id: 'Shared.businessRoles.dataQualityContentManagement',
|
|
22
|
+
description: 'The label for one of the selectable business roles',
|
|
23
|
+
defaultMessage: 'Data Quality & Content Management',
|
|
24
|
+
},
|
|
25
|
+
CustomerService: {
|
|
26
|
+
id: 'Shared.businessRoles.customerService',
|
|
27
|
+
description: 'The label for one of the selectable business roles',
|
|
28
|
+
defaultMessage: 'Customer Service',
|
|
29
|
+
},
|
|
30
|
+
FinanceAndAccounting: {
|
|
31
|
+
id: 'Shared.businessRoles.financeAccounting',
|
|
32
|
+
description: 'The label for one of the selectable business roles',
|
|
33
|
+
defaultMessage: 'Finance & Accounting',
|
|
34
|
+
},
|
|
35
|
+
LegalAndPeople: {
|
|
36
|
+
id: 'Shared.businessRoles.legalPeople',
|
|
37
|
+
description: 'The label for one of the selectable business roles',
|
|
38
|
+
defaultMessage: 'Legal & People',
|
|
39
|
+
},
|
|
40
|
+
LogisticsAndSupplyChain: {
|
|
41
|
+
id: 'Shared.businessRoles.logisticsSupplyChain',
|
|
42
|
+
description: 'The label for one of the selectable business roles',
|
|
43
|
+
defaultMessage: 'Logistics & Supply Chain',
|
|
44
|
+
},
|
|
45
|
+
FulfillmentAndOperationsManagement: {
|
|
46
|
+
id: 'Shared.businessRoles.fulfillmentOperationsManagement',
|
|
47
|
+
description: 'The label for one of the selectable business roles',
|
|
48
|
+
defaultMessage: 'Fulfillment & Operations Management',
|
|
49
|
+
},
|
|
50
|
+
OfflineRetailStore: {
|
|
51
|
+
id: 'Shared.businessRoles.offlineRetailStore',
|
|
52
|
+
description: 'The label for one of the selectable business roles',
|
|
53
|
+
defaultMessage: 'Offline Retail Store',
|
|
54
|
+
},
|
|
55
|
+
Marketing: {
|
|
56
|
+
id: 'Shared.businessRoles.marketing',
|
|
57
|
+
description: 'The label for one of the selectable business roles',
|
|
58
|
+
defaultMessage: 'Marketing',
|
|
59
|
+
},
|
|
60
|
+
BusinessDevSalesAndAccountManagement: {
|
|
61
|
+
id: 'Shared.businessRoles.businessDevSalesAccountManagement',
|
|
62
|
+
description: 'The label for one of the selectable business roles',
|
|
63
|
+
defaultMessage: 'Business Dev, Sales & Account Management',
|
|
64
|
+
},
|
|
65
|
+
UXUIDesign: {
|
|
66
|
+
id: 'Shared.businessRoles.uxUiDesign',
|
|
67
|
+
description: 'The label for one of the selectable business roles',
|
|
68
|
+
defaultMessage: 'UX/UI Design',
|
|
69
|
+
},
|
|
70
|
+
TechProductManagement: {
|
|
71
|
+
id: 'Shared.businessRoles.productManagementTech',
|
|
72
|
+
description: 'The label for one of the selectable business roles',
|
|
73
|
+
defaultMessage: 'Product Management (Tech)',
|
|
74
|
+
},
|
|
75
|
+
TechProjectAndProgramManagement: {
|
|
76
|
+
id: 'Shared.businessRoles.projectProgramManagementTech',
|
|
77
|
+
description: 'The label for one of the selectable business roles',
|
|
78
|
+
defaultMessage: 'Project & Program Management (Tech)',
|
|
79
|
+
},
|
|
80
|
+
SoftwareDevelopmentAndSolutionsArchitect: {
|
|
81
|
+
id: 'Shared.businessRoles.softwareDevelopmentSolutionsArchitect',
|
|
82
|
+
description: 'The label for one of the selectable business roles',
|
|
83
|
+
defaultMessage: 'Software Development & Solutions Architect',
|
|
84
|
+
},
|
|
85
|
+
OperationsITAndSupportEngineering: {
|
|
86
|
+
id: 'Shared.businessRoles.operationsItSupportEngineering',
|
|
87
|
+
description: 'The label for one of the selectable business roles',
|
|
88
|
+
defaultMessage: 'Operations, IT & Support Engineering',
|
|
89
|
+
},
|
|
90
|
+
Other: {
|
|
91
|
+
id: 'Shared.businessRoles.other',
|
|
92
|
+
description: 'The label for one of the selectable business roles',
|
|
93
|
+
defaultMessage: 'Other',
|
|
94
|
+
},
|
|
95
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './capitalize-first';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable import/prefer-default-export */
|
|
2
|
+
import { formatLocalizedString } from '@commercetools-frontend/l10n';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Get the ancestors of the category,
|
|
6
|
+
* Apply an `limit` if you need to limit how far up the ancestors' tree
|
|
7
|
+
* of the category you need to go. ATM we do this when we get the parent.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} category
|
|
10
|
+
* @param {Number} limit
|
|
11
|
+
* @return {Array}
|
|
12
|
+
*/
|
|
13
|
+
export function getAncestors(cat, limit = 0) {
|
|
14
|
+
const category = normalizeCategory(cat);
|
|
15
|
+
const ancestors = category.ancestors || [];
|
|
16
|
+
const maxLimit = limit > ancestors.length ? ancestors.length : limit;
|
|
17
|
+
if (!limit) return ancestors;
|
|
18
|
+
return ancestors.slice(ancestors.length - maxLimit);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function getCategoryLevel(cat) {
|
|
22
|
+
return getAncestors(cat).length + 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @param {Object} category
|
|
27
|
+
* @param {String} lang
|
|
28
|
+
* @param {Array} languages
|
|
29
|
+
* @param {Number} limit
|
|
30
|
+
*
|
|
31
|
+
* @return {String} - A string representation of the path
|
|
32
|
+
*/
|
|
33
|
+
export function getPathName(cat, lang, languages, limit = 0) {
|
|
34
|
+
const ancestors = getAncestors(cat, limit);
|
|
35
|
+
return convertToPathName([...ancestors, cat], lang, languages);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function convertToPathName(categoriesInPath, language, languages) {
|
|
39
|
+
return categoriesInPath
|
|
40
|
+
.map((categoryInPath) =>
|
|
41
|
+
formatLocalizedString(normalizeCategory(categoryInPath), {
|
|
42
|
+
key: 'name',
|
|
43
|
+
locale: language,
|
|
44
|
+
fallbackOrder: languages,
|
|
45
|
+
})
|
|
46
|
+
)
|
|
47
|
+
.join(' > ');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function normalizeCategory(category) {
|
|
51
|
+
return category.obj
|
|
52
|
+
? // we assume that this is expanded reference or mapped from graphql
|
|
53
|
+
category.obj
|
|
54
|
+
: // we assume that this is a direct fetch of the object
|
|
55
|
+
category;
|
|
56
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { getAncestors, getCategoryLevel, getPathName } from './categories';
|
|
2
|
+
|
|
3
|
+
const createTestCategory = (props) => ({
|
|
4
|
+
id: 'fc735952-21eb-4db6-b76c-b83b72b84345',
|
|
5
|
+
version: 1,
|
|
6
|
+
name: { en: 'Nüsse & Kerne', de: 'Nüsse & Kerne' },
|
|
7
|
+
slug: { en: 'nuesse-kerne', de: 'nuesse-kerne' },
|
|
8
|
+
ancestors: [
|
|
9
|
+
{
|
|
10
|
+
typeId: 'category',
|
|
11
|
+
id: 'da5b66e6-7423-4d89-b57a-3de48f6bf4d3',
|
|
12
|
+
obj: {
|
|
13
|
+
id: 'da5b66e6-7423-4d89-b57a-3de48f6bf4d3',
|
|
14
|
+
version: 1,
|
|
15
|
+
name: { en: 'Obst & Gemüse', de: 'Obst & Gemüse' },
|
|
16
|
+
slug: { en: 'obst-gemuese', de: 'obst-gemuese' },
|
|
17
|
+
ancestors: [],
|
|
18
|
+
orderHint: '0.1',
|
|
19
|
+
createdAt: '2016-05-11T15:38:02.023Z',
|
|
20
|
+
lastModifiedAt: '2016-05-11T15:38:02.023Z',
|
|
21
|
+
externalId: '100',
|
|
22
|
+
lastMessageSequenceNumber: 1,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
typeId: 'category',
|
|
27
|
+
id: '6a769249-bb21-4361-8c71-5ab6d8acd799',
|
|
28
|
+
obj: {
|
|
29
|
+
id: '6a769249-bb21-4361-8c71-5ab6d8acd799',
|
|
30
|
+
version: 1,
|
|
31
|
+
name: {
|
|
32
|
+
en: 'Trockenfrüchte, Nüsse & Kerne',
|
|
33
|
+
de: 'Trockenfrüchte, Nüsse & Kerne',
|
|
34
|
+
},
|
|
35
|
+
slug: {
|
|
36
|
+
en: 'trockenfruechte-nuesse-kerne',
|
|
37
|
+
de: 'trockenfruechte-nuesse-kerne',
|
|
38
|
+
},
|
|
39
|
+
ancestors: [
|
|
40
|
+
{
|
|
41
|
+
typeId: 'category',
|
|
42
|
+
id: 'da5b66e6-7423-4d89-b57a-3de48f6bf4d3',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
parent: {
|
|
46
|
+
typeId: 'category',
|
|
47
|
+
id: 'da5b66e6-7423-4d89-b57a-3de48f6bf4d3',
|
|
48
|
+
},
|
|
49
|
+
orderHint: '0.1',
|
|
50
|
+
createdAt: '2016-05-11T15:38:03.477Z',
|
|
51
|
+
lastModifiedAt: '2016-05-11T15:38:03.477Z',
|
|
52
|
+
externalId: '101',
|
|
53
|
+
lastMessageSequenceNumber: 1,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
parent: {
|
|
58
|
+
typeId: 'category',
|
|
59
|
+
id: '6a769249-bb21-4361-8c71-5ab6d8acd799',
|
|
60
|
+
},
|
|
61
|
+
...props,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe('getPathName', () => {
|
|
65
|
+
const category = {
|
|
66
|
+
id: 'example-cat-1',
|
|
67
|
+
obj: {
|
|
68
|
+
id: 'example-cat-1',
|
|
69
|
+
name: { en: 'example-cat-name-1' },
|
|
70
|
+
ancestors: [
|
|
71
|
+
{
|
|
72
|
+
id: 'example-ancestor-2',
|
|
73
|
+
obj: {
|
|
74
|
+
name: { de: 'example-ancestor-name-de' },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'example-ancestor-1',
|
|
79
|
+
obj: {
|
|
80
|
+
name: { en: 'example-ancestor-name-1' },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
it('should show complete path name', () => {
|
|
88
|
+
const expected =
|
|
89
|
+
'example-ancestor-name-de (DE) > example-ancestor-name-1 > example-cat-name-1';
|
|
90
|
+
const actual = getPathName(category, 'en', ['de', 'fr']);
|
|
91
|
+
expect(actual).toBe(expected);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('getAncestors', () => {
|
|
96
|
+
const category = createTestCategory();
|
|
97
|
+
|
|
98
|
+
it('should render actual ancestor', () => {
|
|
99
|
+
const actualAncestors = getAncestors(category);
|
|
100
|
+
expect(actualAncestors).toEqual(category.ancestors);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('should render last ancestor', () => {
|
|
104
|
+
const actualParent = getAncestors(category, 1);
|
|
105
|
+
expect(actualParent).toEqual([
|
|
106
|
+
category.ancestors[category.ancestors.length - 1],
|
|
107
|
+
]);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('should render ancestors of cate', () => {
|
|
111
|
+
const actualAncestorsExceededLimit = getAncestors(category, 5000);
|
|
112
|
+
expect(actualAncestorsExceededLimit).toEqual(category.ancestors);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe('getCategoryLevel', () => {
|
|
117
|
+
const category = createTestCategory();
|
|
118
|
+
|
|
119
|
+
it('should return correct level', () => {
|
|
120
|
+
expect(getCategoryLevel(category)).toBe(3);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './categories';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import clone from './clone';
|
|
2
|
+
|
|
3
|
+
describe('utility functions', () => {
|
|
4
|
+
const baseObject = {
|
|
5
|
+
one: 1,
|
|
6
|
+
two: 2,
|
|
7
|
+
other: {
|
|
8
|
+
one: 1,
|
|
9
|
+
two: 2,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
it('should return a cloned object that matches the base object', () => {
|
|
14
|
+
const clonedObject = clone(baseObject);
|
|
15
|
+
expect(baseObject).toEqual(clonedObject);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should return a modified cloned object that not match base object', () => {
|
|
19
|
+
const clonedObject = clone(baseObject);
|
|
20
|
+
clonedObject.other = null;
|
|
21
|
+
expect(baseObject).not.toEqual(clonedObject);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './clone';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { coerceToInteger } from '.';
|
|
2
|
+
|
|
3
|
+
describe('with number', () => {
|
|
4
|
+
it('should return an integer unchanged', () => {
|
|
5
|
+
expect(coerceToInteger(5)).toEqual(5);
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it('should coerce a float to integer', () => {
|
|
9
|
+
expect(coerceToInteger(10.999857)).toEqual(10);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should coerce a string containing an integer to integer', () => {
|
|
13
|
+
expect(coerceToInteger('20')).toEqual(20);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should coerce a string containing a float to integer', () => {
|
|
17
|
+
expect(coerceToInteger('20.83')).toEqual(20);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('with non-numeric values', () => {
|
|
22
|
+
it('should return undefined for undefined', () => {
|
|
23
|
+
expect(coerceToInteger(undefined)).toEqual(undefined);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('should return undefined for null', () => {
|
|
27
|
+
expect(coerceToInteger(null)).toEqual(undefined);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should return undefined for empty string', () => {
|
|
31
|
+
expect(coerceToInteger('')).toEqual(undefined);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should return undefined for non-numeric string', () => {
|
|
35
|
+
expect(coerceToInteger('foo')).toEqual(undefined);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should return undefined for string containing array', () => {
|
|
39
|
+
expect(coerceToInteger('[20]')).toEqual(undefined);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should return undefined for object', () => {
|
|
43
|
+
expect(coerceToInteger({ foo: 0 })).toEqual(undefined);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should return undefined for a string containing an object', () => {
|
|
47
|
+
expect(coerceToInteger('{ foo: "bar" }')).toEqual(undefined);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './coerce-to-integer';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Network status adapted from
|
|
2
|
+
// https://www.okgrow.com/posts/loading-patterns-in-apollo-client
|
|
3
|
+
// https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-networkStatus
|
|
4
|
+
// networkStatus 1: loading
|
|
5
|
+
// networkStatus 2: setVariables
|
|
6
|
+
// networkStatus 3: fetchMore
|
|
7
|
+
// networkStatus 4: refetch
|
|
8
|
+
// networkStatus 5: unused
|
|
9
|
+
// networkStatus 6: poll
|
|
10
|
+
// networkStatus 7: ready
|
|
11
|
+
// networkStatus 8: error
|
|
12
|
+
export const convertApolloNetworkStatusToLoadingState = (networkStatus) => ({
|
|
13
|
+
initialLoading: networkStatus === 1,
|
|
14
|
+
activelyRefetching: networkStatus === 4,
|
|
15
|
+
passivelyRefetching: networkStatus === 2 || networkStatus === 6,
|
|
16
|
+
fetchingMore: networkStatus === 3,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const convertApolloQueryDataToConnectorData = (
|
|
20
|
+
queryData,
|
|
21
|
+
dataKey,
|
|
22
|
+
{ mapData } = {}
|
|
23
|
+
) => ({
|
|
24
|
+
isLoading: queryData.loading,
|
|
25
|
+
loadingState: convertApolloNetworkStatusToLoadingState(
|
|
26
|
+
queryData.networkStatus
|
|
27
|
+
),
|
|
28
|
+
error: queryData.error,
|
|
29
|
+
[dataKey]: mapData ? mapData(queryData[dataKey]) : queryData[dataKey],
|
|
30
|
+
});
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {
|
|
2
|
+
convertApolloNetworkStatusToLoadingState,
|
|
3
|
+
convertApolloQueryDataToConnectorData,
|
|
4
|
+
} from './connector';
|
|
5
|
+
|
|
6
|
+
describe('convertApolloNetworkStatusToLoadingState', () => {
|
|
7
|
+
describe('when networkStatus is 1 (loading)', () => {
|
|
8
|
+
it('should match', () => {
|
|
9
|
+
expect(convertApolloNetworkStatusToLoadingState(1)).toEqual({
|
|
10
|
+
activelyRefetching: false,
|
|
11
|
+
fetchingMore: false,
|
|
12
|
+
initialLoading: true,
|
|
13
|
+
passivelyRefetching: false,
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe('when networkStatus is 2 (setVariables)', () => {
|
|
18
|
+
it('should match', () => {
|
|
19
|
+
expect(convertApolloNetworkStatusToLoadingState(2)).toEqual({
|
|
20
|
+
activelyRefetching: false,
|
|
21
|
+
fetchingMore: false,
|
|
22
|
+
initialLoading: false,
|
|
23
|
+
passivelyRefetching: true,
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('when networkStatus is 3 (fetchMore)', () => {
|
|
28
|
+
it('should match', () => {
|
|
29
|
+
expect(convertApolloNetworkStatusToLoadingState(3)).toEqual({
|
|
30
|
+
activelyRefetching: false,
|
|
31
|
+
fetchingMore: true,
|
|
32
|
+
initialLoading: false,
|
|
33
|
+
passivelyRefetching: false,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe('when networkStatus is 4 (refetch)', () => {
|
|
38
|
+
it('should match', () => {
|
|
39
|
+
expect(convertApolloNetworkStatusToLoadingState(4)).toEqual({
|
|
40
|
+
activelyRefetching: true,
|
|
41
|
+
fetchingMore: false,
|
|
42
|
+
initialLoading: false,
|
|
43
|
+
passivelyRefetching: false,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('when networkStatus is 5 (unused)', () => {
|
|
48
|
+
it('should match', () => {
|
|
49
|
+
expect(convertApolloNetworkStatusToLoadingState(5)).toEqual({
|
|
50
|
+
activelyRefetching: false,
|
|
51
|
+
fetchingMore: false,
|
|
52
|
+
initialLoading: false,
|
|
53
|
+
passivelyRefetching: false,
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
describe('when networkStatus is 6 (poll)', () => {
|
|
58
|
+
it('should match', () => {
|
|
59
|
+
expect(convertApolloNetworkStatusToLoadingState(6)).toEqual({
|
|
60
|
+
activelyRefetching: false,
|
|
61
|
+
fetchingMore: false,
|
|
62
|
+
initialLoading: false,
|
|
63
|
+
passivelyRefetching: true,
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
describe('when networkStatus is 7 (ready)', () => {
|
|
68
|
+
it('should match', () => {
|
|
69
|
+
expect(convertApolloNetworkStatusToLoadingState(7)).toEqual({
|
|
70
|
+
activelyRefetching: false,
|
|
71
|
+
fetchingMore: false,
|
|
72
|
+
initialLoading: false,
|
|
73
|
+
passivelyRefetching: false,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe('when networkStatus is 8 (error)', () => {
|
|
78
|
+
it('should match', () => {
|
|
79
|
+
expect(convertApolloNetworkStatusToLoadingState(8)).toEqual({
|
|
80
|
+
activelyRefetching: false,
|
|
81
|
+
fetchingMore: false,
|
|
82
|
+
initialLoading: false,
|
|
83
|
+
passivelyRefetching: false,
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('convertApolloQueryDataToConnectorData', () => {
|
|
90
|
+
describe('when mapData is passed', () => {
|
|
91
|
+
const fooData = { bar: true };
|
|
92
|
+
let mapData;
|
|
93
|
+
let result;
|
|
94
|
+
beforeEach(() => {
|
|
95
|
+
mapData = jest.fn((data) => ({ mapped: data }));
|
|
96
|
+
result = convertApolloQueryDataToConnectorData(
|
|
97
|
+
{
|
|
98
|
+
loading: true,
|
|
99
|
+
networkStatus: 1,
|
|
100
|
+
error: null,
|
|
101
|
+
foo: fooData,
|
|
102
|
+
},
|
|
103
|
+
'foo',
|
|
104
|
+
{ mapData }
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
it('should apply mapData', () => {
|
|
108
|
+
expect(result).toEqual({
|
|
109
|
+
error: null,
|
|
110
|
+
foo: { mapped: fooData },
|
|
111
|
+
isLoading: true,
|
|
112
|
+
loadingState: {
|
|
113
|
+
activelyRefetching: false,
|
|
114
|
+
fetchingMore: false,
|
|
115
|
+
initialLoading: true,
|
|
116
|
+
passivelyRefetching: false,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
it('should call mapData', () => {
|
|
121
|
+
expect(mapData).toHaveBeenCalledTimes(1);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
describe('when loading', () => {
|
|
125
|
+
it('should match', () => {
|
|
126
|
+
expect(
|
|
127
|
+
convertApolloQueryDataToConnectorData(
|
|
128
|
+
{
|
|
129
|
+
loading: true,
|
|
130
|
+
networkStatus: 1,
|
|
131
|
+
error: null,
|
|
132
|
+
foo: {},
|
|
133
|
+
},
|
|
134
|
+
'foo'
|
|
135
|
+
)
|
|
136
|
+
).toEqual({
|
|
137
|
+
error: null,
|
|
138
|
+
foo: {},
|
|
139
|
+
isLoading: true,
|
|
140
|
+
loadingState: {
|
|
141
|
+
activelyRefetching: false,
|
|
142
|
+
fetchingMore: false,
|
|
143
|
+
initialLoading: true,
|
|
144
|
+
passivelyRefetching: false,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
describe('when error is present', () => {
|
|
150
|
+
it('should have an error', () => {
|
|
151
|
+
expect(
|
|
152
|
+
convertApolloQueryDataToConnectorData(
|
|
153
|
+
{
|
|
154
|
+
loading: true,
|
|
155
|
+
networkStatus: 4,
|
|
156
|
+
error: {},
|
|
157
|
+
foo: null,
|
|
158
|
+
},
|
|
159
|
+
'foo'
|
|
160
|
+
)
|
|
161
|
+
).toEqual({
|
|
162
|
+
error: {},
|
|
163
|
+
foo: null,
|
|
164
|
+
isLoading: true,
|
|
165
|
+
loadingState: {
|
|
166
|
+
activelyRefetching: true,
|
|
167
|
+
fetchingMore: false,
|
|
168
|
+
initialLoading: false,
|
|
169
|
+
passivelyRefetching: false,
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './connector';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const PRODUCT_STATUSES = {
|
|
2
|
+
PUBLISHED: 'published',
|
|
3
|
+
UNPUBLISHED: 'unpublished',
|
|
4
|
+
MODIFIED: 'modified',
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const FILTER_TYPES = {
|
|
8
|
+
lessThan: 'lessThan',
|
|
9
|
+
moreThan: 'moreThan',
|
|
10
|
+
equalTo: 'equalTo',
|
|
11
|
+
range: 'range',
|
|
12
|
+
missing: 'missing',
|
|
13
|
+
missingIn: 'missingIn',
|
|
14
|
+
in: 'in',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const FIELD_TYPES = {
|
|
18
|
+
Money: 'Money',
|
|
19
|
+
LocalizedString: 'LocalizedString',
|
|
20
|
+
Time: 'Time',
|
|
21
|
+
DateTime: 'DateTime',
|
|
22
|
+
Boolean: 'Boolean',
|
|
23
|
+
String: 'String',
|
|
24
|
+
Enum: 'Enum',
|
|
25
|
+
LocalizedEnum: 'LocalizedEnum',
|
|
26
|
+
Number: 'Number',
|
|
27
|
+
Date: 'Date',
|
|
28
|
+
Reference: 'Reference',
|
|
29
|
+
Set: 'Set',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const PRECISION_TYPES = {
|
|
33
|
+
highPrecision: 'highPrecision',
|
|
34
|
+
centPrecision: 'centPrecision',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const ERROR_CODES = {
|
|
38
|
+
semanticError: 'SemanticError',
|
|
39
|
+
invalidInput: 'InvalidInput',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const DefaultPageSizes = [20, 50, 100];
|
|
43
|
+
export const DefaultPageSize = DefaultPageSizes[0];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// We create the next sort definition to be attached to the request based on the following values:
|
|
2
|
+
// - requestedSortBy/requestedSortDirection: reflects values of the sort definition that the UI requests for
|
|
3
|
+
// - sortBy/sortDirection: reflects the current state of the sorting on the data
|
|
4
|
+
//
|
|
5
|
+
// 1. if the `requestedSortBy` and `sortBy` are not equal, then we know the user attempts to sort by
|
|
6
|
+
// another column of the table, which in this case we override the current state of sorting and
|
|
7
|
+
// use requestedSortBy/requestedSortDirection to sort with
|
|
8
|
+
//
|
|
9
|
+
// 2. with `sortDirection`, we are enforcing a flow control in the following order: NONE -> asc -> desc -> (back to) NONE
|
|
10
|
+
// By NONE, we refer to clearing the sort state entirely and let the API gives us the values sorted by their natural order.
|
|
11
|
+
const createNextSortDefinition = ({
|
|
12
|
+
requestedSortBy,
|
|
13
|
+
requestedSortDirection,
|
|
14
|
+
sortBy,
|
|
15
|
+
sortDirection,
|
|
16
|
+
}) => {
|
|
17
|
+
if (sortBy !== requestedSortBy) {
|
|
18
|
+
return {
|
|
19
|
+
sortBy: requestedSortBy,
|
|
20
|
+
sortDirection: requestedSortDirection,
|
|
21
|
+
page: 1,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
switch (sortDirection) {
|
|
25
|
+
case 'desc':
|
|
26
|
+
return {
|
|
27
|
+
sortBy: undefined,
|
|
28
|
+
sortDirection: undefined,
|
|
29
|
+
page: 1,
|
|
30
|
+
};
|
|
31
|
+
case 'asc':
|
|
32
|
+
return {
|
|
33
|
+
sortBy,
|
|
34
|
+
sortDirection: 'desc',
|
|
35
|
+
page: 1,
|
|
36
|
+
};
|
|
37
|
+
default:
|
|
38
|
+
return {
|
|
39
|
+
sortBy,
|
|
40
|
+
sortDirection: 'asc',
|
|
41
|
+
page: 1,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default createNextSortDefinition;
|