@vendure/admin-ui 1.4.7 → 2.0.0-next.0
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/catalog/catalog.module.d.ts +30 -0
- package/catalog/components/apply-facet-dialog/apply-facet-dialog.component.d.ts +5 -2
- package/catalog/components/asset-detail/asset-detail.component.d.ts +6 -4
- package/catalog/components/asset-list/asset-list.component.d.ts +5 -2
- package/catalog/components/{product-assets/product-assets.component.d.ts → assets/assets.component.d.ts} +7 -10
- package/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.d.ts +9 -7
- package/catalog/components/collection-contents/collection-contents.component.d.ts +5 -3
- package/catalog/components/collection-detail/collection-detail.component.d.ts +6 -3
- package/catalog/components/collection-list/collection-list.component.d.ts +6 -3
- package/catalog/components/collection-tree/collection-tree-node.component.d.ts +7 -3
- package/catalog/components/collection-tree/collection-tree.component.d.ts +10 -25
- package/catalog/components/collection-tree/collection-tree.service.d.ts +33 -0
- package/catalog/components/collection-tree/collection-tree.types.d.ts +7 -0
- package/catalog/components/confirm-variant-deletion-dialog/confirm-variant-deletion-dialog.component.d.ts +5 -2
- package/catalog/components/facet-detail/facet-detail.component.d.ts +7 -4
- package/catalog/components/facet-list/facet-list.component.d.ts +6 -3
- package/catalog/components/generate-product-variants/generate-product-variants.component.d.ts +3 -0
- package/catalog/components/option-value-input/option-value-input.component.d.ts +3 -0
- package/catalog/components/product-detail/product-detail.component.d.ts +17 -37
- package/catalog/components/product-detail/product-detail.types.d.ts +26 -0
- package/catalog/components/product-list/product-list.component.d.ts +6 -3
- package/catalog/components/product-options-editor/product-options-editor.component.d.ts +9 -4
- package/catalog/components/product-search-input/product-search-input.component.d.ts +9 -4
- package/catalog/components/product-variants-editor/product-variants-editor.component.d.ts +5 -2
- package/catalog/components/product-variants-list/product-variants-list.component.d.ts +24 -17
- package/catalog/components/product-variants-table/product-variants-table.component.d.ts +24 -11
- package/catalog/components/update-product-option-dialog/update-product-option-dialog.component.d.ts +5 -2
- package/catalog/components/variant-price-detail/variant-price-detail.component.d.ts +3 -0
- package/catalog/package.json +5 -6
- package/catalog/providers/product-detail/product-detail.service.d.ts +214 -93
- package/catalog/providers/routing/asset-resolver.d.ts +5 -3
- package/catalog/providers/routing/collection-resolver.d.ts +5 -2
- package/catalog/providers/routing/facet-resolver.d.ts +5 -4
- package/catalog/providers/routing/product-resolver.d.ts +5 -2
- package/catalog/providers/routing/product-variants-resolver.d.ts +5 -2
- package/catalog/public_api.d.ts +4 -1
- package/catalog/vendure-admin-ui-catalog.d.ts +1 -0
- package/core/app.component.d.ts +3 -0
- package/core/app.component.module.d.ts +7 -0
- package/core/common/base-detail.component.d.ts +2 -2
- package/core/common/base-entity-resolver.d.ts +1 -1
- package/core/common/base-list.component.d.ts +10 -0
- package/core/common/generated-types.d.ts +12045 -4197
- package/core/common/utilities/flatten-facet-values.d.ts +2 -2
- package/core/common/version.d.ts +1 -1
- package/core/components/app-shell/app-shell.component.d.ts +3 -0
- package/core/components/breadcrumb/breadcrumb.component.d.ts +3 -0
- package/core/components/channel-switcher/channel-switcher.component.d.ts +3 -0
- package/core/components/main-nav/main-nav.component.d.ts +3 -0
- package/core/components/notification/notification.component.d.ts +3 -0
- package/core/components/overlay-host/overlay-host.component.d.ts +3 -0
- package/core/components/theme-switcher/theme-switcher.component.d.ts +3 -0
- package/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.d.ts +4 -1
- package/core/components/user-menu/user-menu.component.d.ts +3 -0
- package/core/core.module.d.ts +18 -0
- package/core/data/client-state/client-defaults.d.ts +19 -7
- package/core/data/data.module.d.ts +6 -0
- package/core/data/definitions/administrator-definitions.d.ts +15 -15
- package/core/data/definitions/auth-definitions.d.ts +4 -4
- package/core/data/definitions/client-definitions.d.ts +16 -16
- package/core/data/definitions/collection-definitions.d.ts +9 -9
- package/core/data/definitions/customer-definitions.d.ts +22 -21
- package/core/data/definitions/facet-definitions.d.ts +10 -10
- package/core/data/definitions/order-definitions.d.ts +25 -25
- package/core/data/definitions/product-definitions.d.ts +44 -44
- package/core/data/definitions/promotion-definitions.d.ts +7 -7
- package/core/data/definitions/settings-definitions.d.ts +65 -65
- package/core/data/definitions/shared-definitions.d.ts +3 -3
- package/core/data/definitions/shipping-definitions.d.ts +9 -9
- package/core/data/providers/administrator-data.service.d.ts +15 -15
- package/core/data/providers/auth-data.service.d.ts +4 -3
- package/core/data/providers/base-data.service.d.ts +3 -0
- package/core/data/providers/client-data.service.d.ts +15 -14
- package/core/data/providers/collection-data.service.d.ts +11 -11
- package/core/data/providers/customer-data.service.d.ts +25 -24
- package/core/data/providers/data.service.d.ts +5 -2
- package/core/data/providers/facet-data.service.d.ts +12 -12
- package/core/data/providers/fetch-adapter.d.ts +3 -0
- package/core/data/providers/interceptor.d.ts +3 -0
- package/core/data/providers/order-data.service.d.ts +21 -21
- package/core/data/providers/product-data.service.d.ts +51 -51
- package/core/data/providers/promotion-data.service.d.ts +8 -8
- package/core/data/providers/settings-data.service.d.ts +52 -51
- package/core/data/providers/shipping-method-data.service.d.ts +12 -12
- package/core/data/query-result.d.ts +1 -1
- package/core/data/server-config.d.ts +5 -2
- package/core/package.json +5 -6
- package/core/providers/auth/auth.service.d.ts +5 -2
- package/core/providers/component-registry/component-registry.service.d.ts +3 -0
- package/core/providers/custom-detail-component/custom-detail-component.service.d.ts +3 -0
- package/core/providers/custom-field-component/custom-field-component.service.d.ts +3 -0
- package/core/providers/dashboard-widget/dashboard-widget.service.d.ts +3 -0
- package/core/providers/guard/auth.guard.d.ts +3 -0
- package/core/providers/health-check/health-check.service.d.ts +3 -0
- package/core/providers/i18n/custom-message-format-compiler.d.ts +3 -0
- package/core/providers/i18n/i18n.service.d.ts +3 -0
- package/core/providers/job-queue/job-queue.service.d.ts +3 -0
- package/core/providers/local-storage/local-storage.service.d.ts +3 -0
- package/core/providers/modal/modal.service.d.ts +4 -67
- package/core/providers/modal/modal.types.d.ts +67 -0
- package/core/providers/nav-builder/nav-builder.service.d.ts +3 -0
- package/core/providers/notification/notification.service.d.ts +3 -0
- package/core/providers/overlay-host/overlay-host.service.d.ts +3 -0
- package/core/public_api.d.ts +3 -0
- package/core/shared/components/action-bar/action-bar.component.d.ts +7 -0
- package/core/shared/components/action-bar-items/action-bar-items.component.d.ts +3 -0
- package/core/shared/components/address-form/address-form.component.d.ts +5 -2
- package/core/shared/components/affixed-input/affixed-input.component.d.ts +3 -0
- package/core/shared/components/affixed-input/percentage-suffix-input.component.d.ts +3 -0
- package/core/shared/components/asset-file-input/asset-file-input.component.d.ts +3 -0
- package/core/shared/components/asset-gallery/asset-gallery.component.d.ts +46 -26
- package/core/shared/components/asset-gallery/asset-gallery.types.d.ts +3 -0
- package/core/shared/components/asset-picker-dialog/asset-picker-dialog.component.d.ts +7 -3
- package/core/shared/components/asset-preview/asset-preview.component.d.ts +5 -3
- package/core/shared/components/asset-preview-dialog/asset-preview-dialog.component.d.ts +7 -5
- package/core/shared/components/asset-preview-links/asset-preview-links.component.d.ts +8 -0
- package/core/shared/components/asset-search-input/asset-search-input.component.d.ts +5 -2
- package/core/shared/components/channel-assignment-control/channel-assignment-control.component.d.ts +3 -0
- package/core/shared/components/channel-badge/channel-badge.component.d.ts +3 -0
- package/core/shared/components/chip/chip.component.d.ts +3 -0
- package/core/shared/components/configurable-input/configurable-input.component.d.ts +3 -0
- package/core/shared/components/currency-input/currency-input.component.d.ts +3 -0
- package/core/shared/components/custom-detail-component-host/custom-detail-component-host.component.d.ts +3 -0
- package/core/shared/components/custom-field-control/custom-field-control.component.d.ts +3 -0
- package/core/shared/components/customer-label/customer-label.component.d.ts +5 -2
- package/core/shared/components/data-table/data-table-column.component.d.ts +3 -0
- package/core/shared/components/data-table/data-table.component.d.ts +3 -0
- package/core/shared/components/datetime-picker/datetime-picker.component.d.ts +3 -0
- package/core/shared/components/datetime-picker/datetime-picker.service.d.ts +3 -0
- package/core/shared/components/dropdown/dropdown-item.directive.d.ts +3 -0
- package/core/shared/components/dropdown/dropdown-menu.component.d.ts +3 -0
- package/core/shared/components/dropdown/dropdown-trigger.directive.d.ts +3 -0
- package/core/shared/components/dropdown/dropdown.component.d.ts +3 -0
- package/core/shared/components/edit-note-dialog/edit-note-dialog.component.d.ts +4 -1
- package/core/shared/components/empty-placeholder/empty-placeholder.component.d.ts +3 -0
- package/core/shared/components/entity-info/entity-info.component.d.ts +3 -0
- package/core/shared/components/extension-host/extension-host.component.d.ts +3 -0
- package/core/shared/components/extension-host/extension-host.service.d.ts +3 -0
- package/core/shared/components/facet-value-chip/facet-value-chip.component.d.ts +5 -2
- package/core/shared/components/facet-value-selector/facet-value-selector.component.d.ts +8 -5
- package/core/shared/components/focal-point-control/focal-point-control.component.d.ts +3 -0
- package/core/shared/components/form-field/form-field-control.directive.d.ts +3 -0
- package/core/shared/components/form-field/form-field.component.d.ts +3 -0
- package/core/shared/components/form-item/form-item.component.d.ts +3 -0
- package/core/shared/components/formatted-address/formatted-address.component.d.ts +3 -0
- package/core/shared/components/help-tooltip/help-tooltip.component.d.ts +3 -0
- package/core/shared/components/history-entry-detail/history-entry-detail.component.d.ts +3 -0
- package/core/shared/components/items-per-page-controls/items-per-page-controls.component.d.ts +3 -0
- package/core/shared/components/labeled-data/labeled-data.component.d.ts +3 -0
- package/core/shared/components/language-selector/language-selector.component.d.ts +3 -0
- package/core/shared/components/manage-tags-dialog/manage-tags-dialog.component.d.ts +6 -3
- package/core/shared/components/modal-dialog/dialog-buttons.directive.d.ts +3 -0
- package/core/shared/components/modal-dialog/dialog-component-outlet.component.d.ts +3 -0
- package/core/shared/components/modal-dialog/dialog-title.directive.d.ts +3 -0
- package/core/shared/components/modal-dialog/modal-dialog.component.d.ts +4 -1
- package/core/shared/components/object-tree/object-tree.component.d.ts +3 -0
- package/core/shared/components/order-state-label/order-state-label.component.d.ts +4 -1
- package/core/shared/components/pagination-controls/pagination-controls.component.d.ts +3 -0
- package/core/shared/components/product-selector/product-selector.component.d.ts +23 -13
- package/core/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.d.ts +4 -1
- package/core/shared/components/rich-text-editor/link-dialog/link-dialog.component.d.ts +4 -1
- package/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.d.ts +3 -0
- package/core/shared/components/rich-text-editor/rich-text-editor.component.d.ts +3 -0
- package/core/shared/components/select-toggle/select-toggle.component.d.ts +3 -0
- package/core/shared/components/simple-dialog/simple-dialog.component.d.ts +4 -1
- package/core/shared/components/status-badge/status-badge.component.d.ts +3 -0
- package/core/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.d.ts +3 -0
- package/core/shared/components/table-row-action/table-row-action.component.d.ts +3 -0
- package/core/shared/components/tag-selector/tag-selector.component.d.ts +3 -0
- package/core/shared/components/timeline-entry/timeline-entry.component.d.ts +3 -0
- package/core/shared/components/title-input/title-input.component.d.ts +3 -0
- package/core/shared/components/ui-extension-point/ui-extension-point.component.d.ts +3 -0
- package/core/shared/directives/disabled.directive.d.ts +3 -0
- package/core/shared/directives/if-default-channel-active.directive.d.ts +3 -0
- package/core/shared/directives/if-directive-base.d.ts +3 -0
- package/core/shared/directives/if-multichannel.directive.d.ts +3 -0
- package/core/shared/directives/if-permissions.directive.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/boolean-form-input/boolean-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/currency-form-input/currency-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/customer-group-form-input/customer-group-form-input.component.d.ts +7 -3
- package/core/shared/dynamic-form-inputs/date-form-input/date-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.d.ts +5 -2
- package/core/shared/dynamic-form-inputs/number-form-input/number-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/password-form-input/password-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/product-selector-form-input/product-selector-form-input.component.d.ts +6 -3
- package/core/shared/dynamic-form-inputs/register-dynamic-input-components.d.ts +1 -1
- package/core/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.d.ts +6 -3
- package/core/shared/dynamic-form-inputs/relation-form-input/customer/relation-customer-input.component.d.ts +6 -2
- package/core/shared/dynamic-form-inputs/relation-form-input/product/relation-product-input.component.d.ts +7 -3
- package/core/shared/dynamic-form-inputs/relation-form-input/product-variant/relation-product-variant-input.component.d.ts +7 -3
- package/core/shared/dynamic-form-inputs/relation-form-input/relation-card/relation-card.component.d.ts +7 -0
- package/core/shared/dynamic-form-inputs/relation-form-input/relation-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/relation-form-input/relation-selector-dialog/relation-selector-dialog.component.d.ts +4 -1
- package/core/shared/dynamic-form-inputs/rich-text-form-input/rich-text-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/text-form-input/text-form-input.component.d.ts +3 -0
- package/core/shared/dynamic-form-inputs/textarea-form-input/textarea-form-input.component.d.ts +3 -0
- package/core/shared/pipes/asset-preview.pipe.d.ts +3 -0
- package/core/shared/pipes/channel-label.pipe.d.ts +3 -0
- package/core/shared/pipes/custom-field-label.pipe.d.ts +3 -0
- package/core/shared/pipes/duration.pipe.d.ts +3 -0
- package/core/shared/pipes/file-size.pipe.d.ts +3 -0
- package/core/shared/pipes/has-permission.pipe.d.ts +3 -0
- package/core/shared/pipes/locale-base.pipe.d.ts +3 -0
- package/core/shared/pipes/locale-currency-name.pipe.d.ts +3 -0
- package/core/shared/pipes/locale-currency.pipe.d.ts +3 -0
- package/core/shared/pipes/locale-date.pipe.d.ts +3 -0
- package/core/shared/pipes/locale-language-name.pipe.d.ts +3 -0
- package/core/shared/pipes/locale-region-name.pipe.d.ts +3 -0
- package/core/shared/pipes/sentence-case.pipe.d.ts +3 -0
- package/core/shared/pipes/sort.pipe.d.ts +3 -0
- package/core/shared/pipes/state-i18n-token.pipe.d.ts +3 -0
- package/core/shared/pipes/string-to-color.pipe.d.ts +3 -0
- package/core/shared/pipes/time-ago.pipe.d.ts +3 -0
- package/core/shared/providers/routing/can-deactivate-detail-guard.d.ts +3 -0
- package/core/shared/shared.module.d.ts +118 -0
- package/core/vendure-admin-ui-core.d.ts +1 -0
- package/customer/components/add-customer-to-group-dialog/add-customer-to-group-dialog.component.d.ts +6 -3
- package/customer/components/address-card/address-card.component.d.ts +7 -2
- package/customer/components/address-detail-dialog/address-detail-dialog.component.d.ts +5 -2
- package/customer/components/customer-detail/customer-detail.component.d.ts +10 -5
- package/customer/components/customer-group-detail-dialog/customer-group-detail-dialog.component.d.ts +3 -0
- package/customer/components/customer-group-list/customer-group-list.component.d.ts +10 -7
- package/customer/components/customer-group-member-list/customer-group-member-list.component.d.ts +3 -0
- package/customer/components/customer-history/customer-history.component.d.ts +12 -7
- package/customer/components/customer-list/customer-list.component.d.ts +7 -5
- package/customer/components/customer-status-label/customer-status-label.component.d.ts +5 -2
- package/customer/components/select-customer-group-dialog/select-customer-group-dialog.component.d.ts +5 -2
- package/customer/customer.module.d.ts +17 -0
- package/customer/package.json +5 -6
- package/customer/providers/routing/customer-resolver.d.ts +5 -4
- package/customer/vendure-admin-ui-customer.d.ts +1 -0
- package/dashboard/components/dashboard/dashboard.component.d.ts +3 -0
- package/dashboard/components/dashboard-widget/dashboard-widget.component.d.ts +3 -0
- package/dashboard/dashboard.module.d.ts +8 -0
- package/dashboard/package.json +5 -6
- package/dashboard/vendure-admin-ui-dashboard.d.ts +1 -0
- package/dashboard/widgets/latest-orders-widget/latest-orders-widget.component.d.ts +9 -2
- package/dashboard/widgets/order-summary-widget/order-summary-widget.component.d.ts +7 -0
- package/dashboard/widgets/test-widget/test-widget.component.d.ts +6 -0
- package/dashboard/widgets/welcome-widget/welcome-widget.component.d.ts +9 -2
- package/esm2020/catalog/catalog.module.mjs +116 -0
- package/esm2020/catalog/catalog.routes.mjs +174 -0
- package/esm2020/catalog/components/apply-facet-dialog/apply-facet-dialog.component.mjs +30 -0
- package/esm2020/catalog/components/asset-detail/asset-detail.component.mjs +66 -0
- package/esm2020/catalog/components/asset-list/asset-list.component.mjs +120 -0
- package/esm2020/catalog/components/assets/assets.component.mjs +100 -0
- package/esm2020/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.mjs +104 -0
- package/esm2020/catalog/components/collection-contents/collection-contents.component.mjs +76 -0
- package/esm2020/catalog/components/collection-detail/collection-detail.component.mjs +210 -0
- package/esm2020/catalog/components/collection-list/collection-list.component.mjs +120 -0
- package/esm2020/catalog/components/collection-tree/array-to-tree.mjs +56 -0
- package/esm2020/catalog/components/collection-tree/collection-tree-node.component.mjs +99 -0
- package/esm2020/catalog/components/collection-tree/collection-tree.component.mjs +44 -0
- package/esm2020/catalog/components/collection-tree/collection-tree.service.mjs +68 -0
- package/esm2020/catalog/components/collection-tree/collection-tree.types.mjs +2 -0
- package/esm2020/catalog/components/confirm-variant-deletion-dialog/confirm-variant-deletion-dialog.component.mjs +23 -0
- package/esm2020/catalog/components/facet-detail/facet-detail.component.mjs +321 -0
- package/esm2020/catalog/components/facet-list/facet-list.component.mjs +104 -0
- package/esm2020/catalog/components/generate-product-variants/generate-product-variants.component.mjs +79 -0
- package/esm2020/catalog/components/option-value-input/option-value-input.component.mjs +97 -0
- package/esm2020/catalog/components/product-detail/product-detail.component.mjs +520 -0
- package/esm2020/catalog/components/product-detail/product-detail.types.mjs +2 -0
- package/esm2020/catalog/components/product-list/product-list.component.mjs +150 -0
- package/esm2020/catalog/components/product-options-editor/product-options-editor.component.mjs +151 -0
- package/esm2020/catalog/components/product-search-input/product-search-input.component.mjs +107 -0
- package/esm2020/catalog/components/product-variants-editor/product-variants-editor.component.mjs +313 -0
- package/esm2020/catalog/components/product-variants-list/product-variants-list.component.mjs +226 -0
- package/esm2020/catalog/components/product-variants-table/product-variants-table.component.mjs +72 -0
- package/esm2020/catalog/components/update-product-option-dialog/update-product-option-dialog.component.mjs +64 -0
- package/esm2020/catalog/components/variant-price-detail/variant-price-detail.component.mjs +61 -0
- package/esm2020/catalog/providers/product-detail/product-detail.service.mjs +224 -0
- package/{esm2015/catalog/providers/product-detail/replace-last.js → esm2020/catalog/providers/product-detail/replace-last.mjs} +0 -0
- package/esm2020/catalog/providers/routing/asset-resolver.mjs +33 -0
- package/esm2020/catalog/providers/routing/collection-resolver.mjs +35 -0
- package/esm2020/catalog/providers/routing/facet-resolver.mjs +30 -0
- package/esm2020/catalog/providers/routing/product-resolver.mjs +39 -0
- package/esm2020/catalog/providers/routing/product-variants-resolver.mjs +27 -0
- package/esm2020/catalog/public_api.mjs +39 -0
- package/{esm2015/catalog/vendure-admin-ui-catalog.js → esm2020/catalog/vendure-admin-ui-catalog.mjs} +0 -0
- package/esm2020/core/app.component.mjs +79 -0
- package/esm2020/core/app.component.module.mjs +19 -0
- package/{esm2015/core/app.config.js → esm2020/core/app.config.mjs} +0 -0
- package/esm2020/core/common/base-detail.component.mjs +108 -0
- package/{esm2015/core/common/base-entity-resolver.js → esm2020/core/common/base-entity-resolver.mjs} +2 -2
- package/esm2020/core/common/base-list.component.mjs +159 -0
- package/{esm2015/core/common/component-registry-types.js → esm2020/core/common/component-registry-types.mjs} +0 -0
- package/{esm2015/core/common/deactivate-aware.js → esm2020/core/common/deactivate-aware.mjs} +0 -0
- package/{esm2015/core/common/detail-breadcrumb.js → esm2020/core/common/detail-breadcrumb.mjs} +0 -0
- package/esm2020/core/common/generated-types.mjs +954 -0
- package/{esm2015/core/common/introspection-result-wrapper.js → esm2020/core/common/introspection-result-wrapper.mjs} +0 -0
- package/esm2020/core/common/introspection-result.mjs +187 -0
- package/{esm2015/core/common/single-search-selection-model.js → esm2020/core/common/single-search-selection-model.mjs} +0 -0
- package/esm2020/core/common/utilities/configurable-operation-utils.mjs +83 -0
- package/esm2020/core/common/utilities/create-updated-translatable.mjs +75 -0
- package/esm2020/core/common/utilities/find-translation.mjs +9 -0
- package/esm2020/core/common/utilities/flatten-facet-values.mjs +4 -0
- package/esm2020/core/common/utilities/get-default-ui-language.mjs +12 -0
- package/{esm2015/core/common/utilities/interpolate-description.js → esm2020/core/common/utilities/interpolate-description.mjs} +0 -0
- package/{esm2015/core/common/utilities/string-to-color.js → esm2020/core/common/utilities/string-to-color.mjs} +0 -0
- package/{esm2015/core/common/version.js → esm2020/core/common/version.mjs} +2 -2
- package/esm2020/core/components/app-shell/app-shell.component.mjs +76 -0
- package/esm2020/core/components/breadcrumb/breadcrumb.component.mjs +124 -0
- package/esm2020/core/components/channel-switcher/channel-switcher.component.mjs +58 -0
- package/esm2020/core/components/main-nav/main-nav.component.mjs +270 -0
- package/esm2020/core/components/notification/notification.component.mjs +76 -0
- package/esm2020/core/components/overlay-host/overlay-host.component.mjs +22 -0
- package/esm2020/core/components/theme-switcher/theme-switcher.component.mjs +29 -0
- package/esm2020/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.mjs +305 -0
- package/esm2020/core/components/user-menu/user-menu.component.mjs +37 -0
- package/esm2020/core/core.module.mjs +145 -0
- package/{esm2015/core/data/check-jobs-link.js → esm2020/core/data/check-jobs-link.mjs} +0 -0
- package/{esm2015/core/data/client-state/client-defaults.js → esm2020/core/data/client-state/client-defaults.mjs} +1 -1
- package/esm2020/core/data/client-state/client-resolvers.mjs +131 -0
- package/esm2020/core/data/data.module.mjs +126 -0
- package/{esm2015/core/data/definitions/administrator-definitions.js → esm2020/core/data/definitions/administrator-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/auth-definitions.js → esm2020/core/data/definitions/auth-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/client-definitions.js → esm2020/core/data/definitions/client-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/collection-definitions.js → esm2020/core/data/definitions/collection-definitions.mjs} +0 -0
- package/esm2020/core/data/definitions/customer-definitions.mjs +265 -0
- package/{esm2015/core/data/definitions/facet-definitions.js → esm2020/core/data/definitions/facet-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/order-definitions.js → esm2020/core/data/definitions/order-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/product-definitions.js → esm2020/core/data/definitions/product-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/promotion-definitions.js → esm2020/core/data/definitions/promotion-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/settings-definitions.js → esm2020/core/data/definitions/settings-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/shared-definitions.js → esm2020/core/data/definitions/shared-definitions.mjs} +0 -0
- package/{esm2015/core/data/definitions/shipping-definitions.js → esm2020/core/data/definitions/shipping-definitions.mjs} +0 -0
- package/{esm2015/core/data/omit-typename-link.js → esm2020/core/data/omit-typename-link.mjs} +0 -0
- package/esm2020/core/data/providers/administrator-data.service.mjs +63 -0
- package/esm2020/core/data/providers/auth-data.service.mjs +20 -0
- package/esm2020/core/data/providers/base-data.service.mjs +69 -0
- package/esm2020/core/data/providers/client-data.service.mjs +75 -0
- package/esm2020/core/data/providers/collection-data.service.mjs +72 -0
- package/esm2020/core/data/providers/customer-data.service.mjs +120 -0
- package/esm2020/core/data/providers/data.service.mjs +90 -0
- package/esm2020/core/data/providers/facet-data.service.mjs +60 -0
- package/esm2020/core/data/providers/fetch-adapter.mjs +36 -0
- package/esm2020/core/data/providers/interceptor.mjs +136 -0
- package/esm2020/core/data/providers/order-data.service.mjs +100 -0
- package/esm2020/core/data/providers/product-data.service.mjs +240 -0
- package/esm2020/core/data/providers/promotion-data.service.mjs +36 -0
- package/esm2020/core/data/providers/settings-data.service.mjs +235 -0
- package/esm2020/core/data/providers/shipping-method-data.service.mjs +66 -0
- package/{esm2015/core/data/query-result.js → esm2020/core/data/query-result.mjs} +1 -1
- package/esm2020/core/data/server-config.mjs +74 -0
- package/esm2020/core/data/utils/add-custom-fields.mjs +84 -0
- package/{esm2015/core/data/utils/get-server-location.js → esm2020/core/data/utils/get-server-location.mjs} +0 -0
- package/{esm2015/core/data/utils/remove-readonly-custom-fields.js → esm2020/core/data/utils/remove-readonly-custom-fields.mjs} +1 -1
- package/esm2020/core/data/utils/transform-relation-custom-field-inputs.mjs +46 -0
- package/esm2020/core/providers/auth/auth.service.mjs +104 -0
- package/esm2020/core/providers/component-registry/component-registry.service.mjs +25 -0
- package/{esm2015/core/providers/custom-detail-component/custom-detail-component-types.js → esm2020/core/providers/custom-detail-component/custom-detail-component-types.mjs} +0 -0
- package/esm2020/core/providers/custom-detail-component/custom-detail-component.service.mjs +44 -0
- package/esm2020/core/providers/custom-field-component/custom-field-component.service.mjs +45 -0
- package/{esm2015/core/providers/dashboard-widget/dashboard-widget-types.js → esm2020/core/providers/dashboard-widget/dashboard-widget-types.mjs} +0 -0
- package/esm2020/core/providers/dashboard-widget/dashboard-widget.service.mjs +98 -0
- package/{esm2015/core/providers/dashboard-widget/register-dashboard-widget.js → esm2020/core/providers/dashboard-widget/register-dashboard-widget.mjs} +0 -0
- package/esm2020/core/providers/guard/auth.guard.mjs +38 -0
- package/esm2020/core/providers/health-check/health-check.service.mjs +36 -0
- package/{esm2015/core/providers/i18n/custom-http-loader.js → esm2020/core/providers/i18n/custom-http-loader.mjs} +0 -0
- package/esm2020/core/providers/i18n/custom-message-format-compiler.mjs +31 -0
- package/esm2020/core/providers/i18n/i18n.service.mjs +54 -0
- package/esm2020/core/providers/job-queue/job-queue.service.mjs +91 -0
- package/esm2020/core/providers/local-storage/local-storage.service.mjs +77 -0
- package/esm2020/core/providers/modal/modal.service.mjs +97 -0
- package/esm2020/core/providers/modal/modal.types.mjs +2 -0
- package/{esm2015/core/providers/nav-builder/nav-builder-types.js → esm2020/core/providers/nav-builder/nav-builder-types.mjs} +0 -0
- package/esm2020/core/providers/nav-builder/nav-builder.service.mjs +268 -0
- package/esm2020/core/providers/notification/notification.service.mjs +157 -0
- package/esm2020/core/providers/overlay-host/overlay-host.service.mjs +48 -0
- package/esm2020/core/public_api.mjs +220 -0
- package/esm2020/core/shared/components/action-bar/action-bar.component.mjs +57 -0
- package/esm2020/core/shared/components/action-bar-items/action-bar-items.component.mjs +78 -0
- package/esm2020/core/shared/components/address-form/address-form.component.mjs +23 -0
- package/esm2020/core/shared/components/affixed-input/affixed-input.component.mjs +19 -0
- package/esm2020/core/shared/components/affixed-input/percentage-suffix-input.component.mjs +97 -0
- package/esm2020/core/shared/components/asset-file-input/asset-file-input.component.mjs +97 -0
- package/esm2020/core/shared/components/asset-gallery/asset-gallery.component.mjs +110 -0
- package/esm2020/core/shared/components/asset-gallery/asset-gallery.types.mjs +2 -0
- package/esm2020/core/shared/components/asset-picker-dialog/asset-picker-dialog.component.mjs +144 -0
- package/esm2020/core/shared/components/asset-preview/asset-preview.component.mjs +189 -0
- package/esm2020/core/shared/components/asset-preview-dialog/asset-preview-dialog.component.mjs +34 -0
- package/esm2020/core/shared/components/asset-preview-links/asset-preview-links.component.mjs +26 -0
- package/esm2020/core/shared/components/asset-search-input/asset-search-input.component.mjs +106 -0
- package/esm2020/core/shared/components/channel-assignment-control/channel-assignment-control.component.mjs +116 -0
- package/esm2020/core/shared/components/channel-badge/channel-badge.component.mjs +19 -0
- package/esm2020/core/shared/components/chip/chip.component.mjs +47 -0
- package/esm2020/core/shared/components/configurable-input/configurable-input.component.mjs +144 -0
- package/esm2020/core/shared/components/currency-input/currency-input.component.mjs +152 -0
- package/esm2020/core/shared/components/custom-detail-component-host/custom-detail-component-host.component.mjs +40 -0
- package/esm2020/core/shared/components/custom-field-control/custom-field-control.component.mjs +83 -0
- package/esm2020/core/shared/components/customer-label/customer-label.component.mjs +17 -0
- package/esm2020/core/shared/components/data-table/data-table-column.component.mjs +29 -0
- package/esm2020/core/shared/components/data-table/data-table.component.mjs +124 -0
- package/{esm2015/core/shared/components/datetime-picker/constants.js → esm2020/core/shared/components/datetime-picker/constants.mjs} +0 -0
- package/esm2020/core/shared/components/datetime-picker/datetime-picker.component.mjs +226 -0
- package/esm2020/core/shared/components/datetime-picker/datetime-picker.service.mjs +201 -0
- package/{esm2015/core/shared/components/datetime-picker/types.js → esm2020/core/shared/components/datetime-picker/types.mjs} +0 -0
- package/esm2020/core/shared/components/dropdown/dropdown-item.directive.mjs +25 -0
- package/esm2020/core/shared/components/dropdown/dropdown-menu.component.mjs +127 -0
- package/esm2020/core/shared/components/dropdown/dropdown-trigger.directive.mjs +25 -0
- package/esm2020/core/shared/components/dropdown/dropdown.component.mjs +58 -0
- package/esm2020/core/shared/components/edit-note-dialog/edit-note-dialog.component.mjs +32 -0
- package/esm2020/core/shared/components/empty-placeholder/empty-placeholder.component.mjs +16 -0
- package/esm2020/core/shared/components/entity-info/entity-info.component.mjs +26 -0
- package/{esm2015/core/shared/components/extension-host/extension-host-config.js → esm2020/core/shared/components/extension-host/extension-host-config.mjs} +0 -0
- package/esm2020/core/shared/components/extension-host/extension-host.component.mjs +80 -0
- package/esm2020/core/shared/components/extension-host/extension-host.service.mjs +99 -0
- package/{esm2015/core/shared/components/extension-host/host-external-frame.js → esm2020/core/shared/components/extension-host/host-external-frame.mjs} +0 -0
- package/esm2020/core/shared/components/facet-value-chip/facet-value-chip.component.mjs +26 -0
- package/esm2020/core/shared/components/facet-value-selector/facet-value-selector.component.mjs +121 -0
- package/esm2020/core/shared/components/focal-point-control/focal-point-control.component.mjs +71 -0
- package/esm2020/core/shared/components/form-field/form-field-control.directive.mjs +37 -0
- package/esm2020/core/shared/components/form-field/form-field.component.mjs +70 -0
- package/esm2020/core/shared/components/form-item/form-item.component.mjs +18 -0
- package/esm2020/core/shared/components/formatted-address/formatted-address.component.mjs +38 -0
- package/esm2020/core/shared/components/help-tooltip/help-tooltip.component.mjs +16 -0
- package/esm2020/core/shared/components/history-entry-detail/history-entry-detail.component.mjs +16 -0
- package/esm2020/core/shared/components/items-per-page-controls/items-per-page-controls.component.mjs +25 -0
- package/esm2020/core/shared/components/labeled-data/labeled-data.component.mjs +13 -0
- package/esm2020/core/shared/components/language-selector/language-selector.component.mjs +31 -0
- package/esm2020/core/shared/components/manage-tags-dialog/manage-tags-dialog.component.mjs +61 -0
- package/esm2020/core/shared/components/modal-dialog/dialog-buttons.directive.mjs +23 -0
- package/esm2020/core/shared/components/modal-dialog/dialog-component-outlet.component.mjs +31 -0
- package/esm2020/core/shared/components/modal-dialog/dialog-title.directive.mjs +23 -0
- package/esm2020/core/shared/components/modal-dialog/modal-dialog.component.mjs +60 -0
- package/esm2020/core/shared/components/object-tree/object-tree.component.mjs +56 -0
- package/esm2020/core/shared/components/order-state-label/order-state-label.component.mjs +46 -0
- package/esm2020/core/shared/components/pagination-controls/pagination-controls.component.mjs +26 -0
- package/esm2020/core/shared/components/product-selector/product-selector.component.mjs +62 -0
- package/esm2020/core/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.mjs +37 -0
- package/esm2020/core/shared/components/rich-text-editor/link-dialog/link-dialog.component.mjs +34 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/inputrules.js → esm2020/core/shared/components/rich-text-editor/prosemirror/inputrules.mjs} +0 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/keymap.js → esm2020/core/shared/components/rich-text-editor/prosemirror/keymap.mjs} +0 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/menu/images.js → esm2020/core/shared/components/rich-text-editor/prosemirror/menu/images.mjs} +0 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/menu/links.js → esm2020/core/shared/components/rich-text-editor/prosemirror/menu/links.mjs} +0 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.js → esm2020/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.mjs} +0 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu.js → esm2020/core/shared/components/rich-text-editor/prosemirror/menu/menu.mjs} +0 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/plugins/link-select-plugin.js → esm2020/core/shared/components/rich-text-editor/prosemirror/plugins/link-select-plugin.mjs} +0 -0
- package/esm2020/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.mjs +112 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/types.js → esm2020/core/shared/components/rich-text-editor/prosemirror/types.mjs} +0 -0
- package/{esm2015/core/shared/components/rich-text-editor/prosemirror/utils.js → esm2020/core/shared/components/rich-text-editor/prosemirror/utils.mjs} +0 -0
- package/esm2020/core/shared/components/rich-text-editor/rich-text-editor.component.mjs +93 -0
- package/esm2020/core/shared/components/select-toggle/select-toggle.component.mjs +32 -0
- package/esm2020/core/shared/components/simple-dialog/simple-dialog.component.mjs +24 -0
- package/esm2020/core/shared/components/status-badge/status-badge.component.mjs +16 -0
- package/esm2020/core/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.mjs +54 -0
- package/esm2020/core/shared/components/table-row-action/table-row-action.component.mjs +28 -0
- package/esm2020/core/shared/components/tag-selector/tag-selector.component.mjs +60 -0
- package/esm2020/core/shared/components/timeline-entry/timeline-entry.component.mjs +52 -0
- package/esm2020/core/shared/components/title-input/title-input.component.mjs +21 -0
- package/esm2020/core/shared/components/ui-extension-point/ui-extension-point.component.mjs +34 -0
- package/esm2020/core/shared/directives/disabled.directive.mjs +41 -0
- package/esm2020/core/shared/directives/if-default-channel-active.directive.mjs +39 -0
- package/esm2020/core/shared/directives/if-directive-base.mjs +73 -0
- package/esm2020/core/shared/directives/if-multichannel.directive.mjs +45 -0
- package/esm2020/core/shared/directives/if-permissions.directive.mjs +76 -0
- package/esm2020/core/shared/dynamic-form-inputs/boolean-form-input/boolean-form-input.component.mjs +23 -0
- package/esm2020/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.mjs +120 -0
- package/esm2020/core/shared/dynamic-form-inputs/currency-form-input/currency-form-input.component.mjs +31 -0
- package/esm2020/core/shared/dynamic-form-inputs/customer-group-form-input/customer-group-form-input.component.mjs +42 -0
- package/esm2020/core/shared/dynamic-form-inputs/date-form-input/date-form-input.component.mjs +32 -0
- package/esm2020/core/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.mjs +265 -0
- package/esm2020/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.mjs +35 -0
- package/esm2020/core/shared/dynamic-form-inputs/number-form-input/number-form-input.component.mjs +39 -0
- package/esm2020/core/shared/dynamic-form-inputs/password-form-input/password-form-input.component.mjs +21 -0
- package/esm2020/core/shared/dynamic-form-inputs/product-selector-form-input/product-selector-form-input.component.mjs +61 -0
- package/{esm2015/core/shared/dynamic-form-inputs/register-dynamic-input-components.js → esm2020/core/shared/dynamic-form-inputs/register-dynamic-input-components.mjs} +0 -0
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.mjs +69 -0
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/customer/relation-customer-input.component.mjs +70 -0
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/product/relation-product-input.component.mjs +89 -0
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/product-variant/relation-product-variant-input.component.mjs +89 -0
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/relation-card/relation-card.component.mjs +60 -0
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/relation-form-input.component.mjs +28 -0
- package/esm2020/core/shared/dynamic-form-inputs/relation-form-input/relation-selector-dialog/relation-selector-dialog.component.mjs +14 -0
- package/esm2020/core/shared/dynamic-form-inputs/rich-text-form-input/rich-text-form-input.component.mjs +21 -0
- package/esm2020/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.mjs +31 -0
- package/esm2020/core/shared/dynamic-form-inputs/text-form-input/text-form-input.component.mjs +28 -0
- package/esm2020/core/shared/dynamic-form-inputs/textarea-form-input/textarea-form-input.component.mjs +24 -0
- package/esm2020/core/shared/pipes/asset-preview.pipe.mjs +42 -0
- package/esm2020/core/shared/pipes/channel-label.pipe.mjs +23 -0
- package/esm2020/core/shared/pipes/custom-field-label.pipe.mjs +47 -0
- package/esm2020/core/shared/pipes/duration.pipe.mjs +49 -0
- package/esm2020/core/shared/pipes/file-size.pipe.mjs +47 -0
- package/esm2020/core/shared/pipes/has-permission.pipe.mjs +65 -0
- package/esm2020/core/shared/pipes/locale-base.pipe.mjs +55 -0
- package/esm2020/core/shared/pipes/locale-currency-name.pipe.mjs +61 -0
- package/esm2020/core/shared/pipes/locale-currency.pipe.mjs +44 -0
- package/esm2020/core/shared/pipes/locale-date.pipe.mjs +84 -0
- package/esm2020/core/shared/pipes/locale-language-name.pipe.mjs +51 -0
- package/esm2020/core/shared/pipes/locale-region-name.pipe.mjs +51 -0
- package/esm2020/core/shared/pipes/sentence-case.pipe.mjs +30 -0
- package/esm2020/core/shared/pipes/sort.pipe.mjs +34 -0
- package/esm2020/core/shared/pipes/state-i18n-token.pipe.mjs +50 -0
- package/esm2020/core/shared/pipes/string-to-color.pipe.mjs +18 -0
- package/esm2020/core/shared/pipes/time-ago.pipe.mjs +52 -0
- package/esm2020/core/shared/providers/routing/can-deactivate-detail-guard.mjs +35 -0
- package/esm2020/core/shared/shared.module.mjs +520 -0
- package/{esm2015/core/validators/unicode-pattern.validator.js → esm2020/core/validators/unicode-pattern.validator.mjs} +0 -0
- package/{esm2015/core/vendure-admin-ui-core.js → esm2020/core/vendure-admin-ui-core.mjs} +0 -0
- package/esm2020/customer/components/add-customer-to-group-dialog/add-customer-to-group-dialog.component.mjs +41 -0
- package/esm2020/customer/components/address-card/address-card.component.mjs +97 -0
- package/esm2020/customer/components/address-detail-dialog/address-detail-dialog.component.mjs +28 -0
- package/esm2020/customer/components/customer-detail/customer-detail.component.mjs +414 -0
- package/esm2020/customer/components/customer-group-detail-dialog/customer-group-detail-dialog.component.mjs +45 -0
- package/esm2020/customer/components/customer-group-list/customer-group-list.component.mjs +181 -0
- package/esm2020/customer/components/customer-group-member-list/customer-group-member-list.component.mjs +103 -0
- package/esm2020/customer/components/customer-history/customer-history.component.mjs +83 -0
- package/esm2020/customer/components/customer-list/customer-list.component.mjs +80 -0
- package/esm2020/customer/components/customer-status-label/customer-status-label.component.mjs +17 -0
- package/esm2020/customer/components/select-customer-group-dialog/select-customer-group-dialog.component.mjs +31 -0
- package/esm2020/customer/customer.module.mjs +53 -0
- package/esm2020/customer/customer.routes.mjs +42 -0
- package/esm2020/customer/providers/routing/customer-resolver.mjs +31 -0
- package/{esm2015/customer/public_api.js → esm2020/customer/public_api.mjs} +0 -0
- package/{esm2015/customer/vendure-admin-ui-customer.js → esm2020/customer/vendure-admin-ui-customer.mjs} +0 -0
- package/esm2020/dashboard/components/dashboard/dashboard.component.mjs +121 -0
- package/esm2020/dashboard/components/dashboard-widget/dashboard-widget.component.mjs +35 -0
- package/esm2020/dashboard/dashboard.module.mjs +29 -0
- package/{esm2015/dashboard/dashboard.routes.js → esm2020/dashboard/dashboard.routes.mjs} +0 -0
- package/esm2020/dashboard/default-widgets.mjs +32 -0
- package/{esm2015/dashboard/public_api.js → esm2020/dashboard/public_api.mjs} +0 -0
- package/{esm2015/dashboard/vendure-admin-ui-dashboard.js → esm2020/dashboard/vendure-admin-ui-dashboard.mjs} +0 -0
- package/esm2020/dashboard/widgets/latest-orders-widget/latest-orders-widget.component.mjs +45 -0
- package/esm2020/dashboard/widgets/order-summary-widget/order-summary-widget.component.mjs +59 -0
- package/esm2020/dashboard/widgets/test-widget/test-widget.component.mjs +22 -0
- package/esm2020/dashboard/widgets/welcome-widget/welcome-widget.component.mjs +39 -0
- package/esm2020/login/components/login/login.component.mjs +62 -0
- package/esm2020/login/login.module.mjs +21 -0
- package/{esm2015/login/login.routes.js → esm2020/login/login.routes.mjs} +0 -0
- package/esm2020/login/providers/login.guard.mjs +31 -0
- package/{esm2015/login/public_api.js → esm2020/login/public_api.mjs} +0 -0
- package/{esm2015/login/vendure-admin-ui-login.js → esm2020/login/vendure-admin-ui-login.mjs} +0 -0
- package/esm2020/marketing/components/promotion-detail/promotion-detail.component.mjs +242 -0
- package/esm2020/marketing/components/promotion-list/promotion-list.component.mjs +81 -0
- package/esm2020/marketing/marketing.module.mjs +21 -0
- package/esm2020/marketing/marketing.routes.mjs +33 -0
- package/esm2020/marketing/providers/routing/promotion-resolver.mjs +31 -0
- package/{esm2015/marketing/public_api.js → esm2020/marketing/public_api.mjs} +0 -0
- package/{esm2015/marketing/vendure-admin-ui-marketing.js → esm2020/marketing/vendure-admin-ui-marketing.mjs} +0 -0
- package/esm2020/order/components/add-manual-payment-dialog/add-manual-payment-dialog.component.mjs +39 -0
- package/esm2020/order/components/cancel-order-dialog/cancel-order-dialog.component.mjs +78 -0
- package/esm2020/order/components/fulfill-order-dialog/fulfill-order-dialog.component.mjs +73 -0
- package/esm2020/order/components/fulfillment-card/fulfillment-card.component.mjs +48 -0
- package/esm2020/order/components/fulfillment-detail/fulfillment-detail.component.mjs +62 -0
- package/esm2020/order/components/fulfillment-state-label/fulfillment-state-label.component.mjs +28 -0
- package/esm2020/order/components/line-fulfillment/line-fulfillment.component.mjs +68 -0
- package/esm2020/order/components/line-refunds/line-refunds.component.mjs +37 -0
- package/esm2020/order/components/modification-detail/modification-detail.component.mjs +68 -0
- package/esm2020/order/components/order-custom-fields-card/order-custom-fields-card.component.mjs +40 -0
- package/esm2020/order/components/order-detail/order-detail.component.mjs +504 -0
- package/esm2020/order/components/order-editor/order-editor.component.mjs +365 -0
- package/esm2020/order/components/order-edits-preview-dialog/order-edits-preview-dialog.component.mjs +55 -0
- package/esm2020/order/components/order-history/order-history.component.mjs +166 -0
- package/esm2020/order/components/order-list/order-list.component.mjs +192 -0
- package/esm2020/order/components/order-payment-card/order-payment-card.component.mjs +43 -0
- package/{esm2015/order/components/order-process-graph/constants.js → esm2020/order/components/order-process-graph/constants.mjs} +0 -0
- package/esm2020/order/components/order-process-graph/order-process-edge.component.mjs +45 -0
- package/esm2020/order/components/order-process-graph/order-process-graph.component.mjs +96 -0
- package/esm2020/order/components/order-process-graph/order-process-node.component.mjs +53 -0
- package/{esm2015/order/components/order-process-graph/types.js → esm2020/order/components/order-process-graph/types.mjs} +0 -0
- package/esm2020/order/components/order-process-graph-dialog/order-process-graph-dialog.component.mjs +21 -0
- package/esm2020/order/components/order-state-select-dialog/order-state-select-dialog.component.mjs +29 -0
- package/esm2020/order/components/order-table/order-table.component.mjs +73 -0
- package/esm2020/order/components/payment-detail/payment-detail.component.mjs +18 -0
- package/esm2020/order/components/payment-state-label/payment-state-label.component.mjs +28 -0
- package/esm2020/order/components/refund-order-dialog/refund-order-dialog.component.mjs +138 -0
- package/esm2020/order/components/refund-state-label/refund-state-label.component.mjs +27 -0
- package/esm2020/order/components/settle-refund-dialog/settle-refund-dialog.component.mjs +24 -0
- package/esm2020/order/components/simple-item-list/simple-item-list.component.mjs +15 -0
- package/esm2020/order/order.module.mjs +103 -0
- package/esm2020/order/order.routes.mjs +52 -0
- package/esm2020/order/providers/order-transition.service.mjs +112 -0
- package/esm2020/order/providers/routing/order-resolver.mjs +29 -0
- package/{esm2015/order/public_api.js → esm2020/order/public_api.mjs} +0 -0
- package/{esm2015/order/vendure-admin-ui-order.js → esm2020/order/vendure-admin-ui-order.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/esm2020/settings/components/add-country-to-zone-dialog/add-country-to-zone-dialog.component.mjs +34 -0
- package/esm2020/settings/components/admin-detail/admin-detail.component.mjs +192 -0
- package/esm2020/settings/components/administrator-list/administrator-list.component.mjs +49 -0
- package/esm2020/settings/components/channel-detail/channel-detail.component.mjs +154 -0
- package/esm2020/settings/components/channel-list/channel-list.component.mjs +53 -0
- package/esm2020/settings/components/country-detail/country-detail.component.mjs +115 -0
- package/esm2020/settings/components/country-list/country-list.component.mjs +84 -0
- package/esm2020/settings/components/global-settings/global-settings.component.mjs +85 -0
- package/esm2020/settings/components/payment-method-detail/payment-method-detail.component.mjs +199 -0
- package/esm2020/settings/components/payment-method-list/payment-method-list.component.mjs +62 -0
- package/esm2020/settings/components/permission-grid/permission-grid.component.mjs +83 -0
- package/esm2020/settings/components/profile/profile.component.mjs +77 -0
- package/esm2020/settings/components/role-detail/role-detail.component.mjs +105 -0
- package/esm2020/settings/components/role-list/role-list.component.mjs +66 -0
- package/esm2020/settings/components/shipping-eligibility-test-result/shipping-eligibility-test-result.component.mjs +30 -0
- package/esm2020/settings/components/shipping-method-detail/shipping-method-detail.component.mjs +240 -0
- package/esm2020/settings/components/shipping-method-list/shipping-method-list.component.mjs +92 -0
- package/esm2020/settings/components/shipping-method-test-result/shipping-method-test-result.component.mjs +30 -0
- package/esm2020/settings/components/tax-category-detail/tax-category-detail.component.mjs +107 -0
- package/esm2020/settings/components/tax-category-list/tax-category-list.component.mjs +56 -0
- package/esm2020/settings/components/tax-rate-detail/tax-rate-detail.component.mjs +126 -0
- package/esm2020/settings/components/tax-rate-list/tax-rate-list.component.mjs +56 -0
- package/esm2020/settings/components/test-address-form/test-address-form.component.mjs +49 -0
- package/esm2020/settings/components/test-order-builder/test-order-builder.component.mjs +71 -0
- package/esm2020/settings/components/zone-detail-dialog/zone-detail-dialog.component.mjs +44 -0
- package/esm2020/settings/components/zone-list/zone-list.component.mjs +158 -0
- package/esm2020/settings/components/zone-member-list/zone-member-controls.directive.mjs +16 -0
- package/esm2020/settings/components/zone-member-list/zone-member-list-header.directive.mjs +16 -0
- package/esm2020/settings/components/zone-member-list/zone-member-list.component.mjs +72 -0
- package/esm2020/settings/providers/routing/administrator-resolver.mjs +28 -0
- package/esm2020/settings/providers/routing/channel-resolver.mjs +34 -0
- package/esm2020/settings/providers/routing/country-resolver.mjs +31 -0
- package/esm2020/settings/providers/routing/global-settings-resolver.mjs +24 -0
- package/esm2020/settings/providers/routing/payment-method-resolver.mjs +33 -0
- package/esm2020/settings/providers/routing/profile-resolver.mjs +30 -0
- package/esm2020/settings/providers/routing/role-resolver.mjs +28 -0
- package/esm2020/settings/providers/routing/shipping-method-resolver.mjs +34 -0
- package/esm2020/settings/providers/routing/tax-category-resolver.mjs +29 -0
- package/esm2020/settings/providers/routing/tax-rate-resolver.mjs +33 -0
- package/{esm2015/settings/public_api.js → esm2020/settings/public_api.mjs} +0 -0
- package/esm2020/settings/settings.module.mjs +106 -0
- package/esm2020/settings/settings.routes.mjs +253 -0
- package/{esm2015/settings/vendure-admin-ui-settings.js → esm2020/settings/vendure-admin-ui-settings.mjs} +0 -0
- package/esm2020/system/components/health-check/health-check.component.mjs +18 -0
- package/esm2020/system/components/job-list/job-list.component.mjs +76 -0
- package/esm2020/system/components/job-state-label/job-state-label.component.mjs +46 -0
- package/{esm2015/system/public_api.js → esm2020/system/public_api.mjs} +0 -0
- package/esm2020/system/system.module.mjs +22 -0
- package/esm2020/system/system.routes.mjs +20 -0
- package/{esm2015/system/vendure-admin-ui-system.js → esm2020/system/vendure-admin-ui-system.mjs} +0 -0
- package/{esm2015/vendure-admin-ui.js → esm2020/vendure-admin-ui.mjs} +0 -0
- package/fesm2015/vendure-admin-ui-catalog.mjs +3732 -0
- package/fesm2015/vendure-admin-ui-catalog.mjs.map +1 -0
- package/fesm2015/vendure-admin-ui-core.mjs +15998 -0
- package/fesm2015/vendure-admin-ui-core.mjs.map +1 -0
- package/fesm2015/vendure-admin-ui-customer.mjs +1134 -0
- package/fesm2015/vendure-admin-ui-customer.mjs.map +1 -0
- package/fesm2015/vendure-admin-ui-dashboard.mjs +365 -0
- package/fesm2015/vendure-admin-ui-dashboard.mjs.map +1 -0
- package/fesm2015/vendure-admin-ui-login.mjs +122 -0
- package/fesm2015/vendure-admin-ui-login.mjs.map +1 -0
- package/fesm2015/vendure-admin-ui-marketing.mjs +388 -0
- package/fesm2015/vendure-admin-ui-marketing.mjs.map +1 -0
- package/fesm2015/vendure-admin-ui-order.mjs +2448 -0
- package/fesm2015/vendure-admin-ui-order.mjs.map +1 -0
- package/fesm2015/vendure-admin-ui-settings.mjs +2784 -0
- package/fesm2015/vendure-admin-ui-settings.mjs.map +1 -0
- package/fesm2015/vendure-admin-ui-system.mjs +165 -0
- package/fesm2015/vendure-admin-ui-system.mjs.map +1 -0
- package/fesm2015/{vendure-admin-ui.js → vendure-admin-ui.mjs} +1 -1
- package/fesm2015/vendure-admin-ui.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-catalog.mjs +3747 -0
- package/fesm2020/vendure-admin-ui-catalog.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-core.mjs +15994 -0
- package/fesm2020/vendure-admin-ui-core.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-customer.mjs +1135 -0
- package/fesm2020/vendure-admin-ui-customer.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-dashboard.mjs +361 -0
- package/fesm2020/vendure-admin-ui-dashboard.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-login.mjs +122 -0
- package/fesm2020/vendure-admin-ui-login.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-marketing.mjs +388 -0
- package/fesm2020/vendure-admin-ui-marketing.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-order.mjs +2462 -0
- package/fesm2020/vendure-admin-ui-order.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-settings.mjs +2791 -0
- package/fesm2020/vendure-admin-ui-settings.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui-system.mjs +168 -0
- package/fesm2020/vendure-admin-ui-system.mjs.map +1 -0
- package/fesm2020/vendure-admin-ui.mjs +11 -0
- package/fesm2020/vendure-admin-ui.mjs.map +1 -0
- package/login/components/login/login.component.d.ts +3 -0
- package/login/login.module.d.ts +7 -0
- package/login/package.json +5 -6
- package/login/providers/login.guard.d.ts +3 -0
- package/login/vendure-admin-ui-login.d.ts +1 -0
- package/marketing/components/promotion-detail/promotion-detail.component.d.ts +7 -4
- package/marketing/components/promotion-list/promotion-list.component.d.ts +5 -6
- package/marketing/marketing.module.d.ts +8 -0
- package/marketing/package.json +5 -6
- package/marketing/providers/routing/promotion-resolver.d.ts +5 -2
- package/marketing/vendure-admin-ui-marketing.d.ts +1 -0
- package/order/components/add-manual-payment-dialog/add-manual-payment-dialog.component.d.ts +5 -2
- package/order/components/cancel-order-dialog/cancel-order-dialog.component.d.ts +6 -0
- package/order/components/fulfill-order-dialog/fulfill-order-dialog.component.d.ts +6 -3
- package/order/components/fulfillment-card/fulfillment-card.component.d.ts +6 -3
- package/order/components/fulfillment-detail/fulfillment-detail.component.d.ts +6 -3
- package/order/components/fulfillment-state-label/fulfillment-state-label.component.d.ts +3 -0
- package/order/components/line-fulfillment/line-fulfillment.component.d.ts +8 -3
- package/order/components/line-refunds/line-refunds.component.d.ts +6 -3
- package/order/components/modification-detail/modification-detail.component.d.ts +13 -4
- package/order/components/order-custom-fields-card/order-custom-fields-card.component.d.ts +3 -0
- package/order/components/order-detail/order-detail.component.d.ts +15 -10
- package/order/components/order-editor/order-editor.component.d.ts +16 -12
- package/order/components/order-edits-preview-dialog/order-edits-preview-dialog.component.d.ts +6 -3
- package/order/components/order-history/order-history.component.d.ts +36 -20
- package/order/components/order-list/order-list.component.d.ts +5 -2
- package/order/components/order-payment-card/order-payment-card.component.d.ts +48 -14
- package/order/components/order-process-graph/order-process-edge.component.d.ts +3 -0
- package/order/components/order-process-graph/order-process-graph.component.d.ts +3 -0
- package/order/components/order-process-graph/order-process-node.component.d.ts +3 -0
- package/order/components/order-process-graph-dialog/order-process-graph-dialog.component.d.ts +3 -0
- package/order/components/order-state-select-dialog/order-state-select-dialog.component.d.ts +3 -0
- package/order/components/order-table/order-table.component.d.ts +14 -8
- package/order/components/payment-detail/payment-detail.component.d.ts +5 -2
- package/order/components/payment-state-label/payment-state-label.component.d.ts +3 -0
- package/order/components/refund-order-dialog/refund-order-dialog.component.d.ts +8 -4
- package/order/components/refund-state-label/refund-state-label.component.d.ts +3 -0
- package/order/components/settle-refund-dialog/settle-refund-dialog.component.d.ts +5 -3
- package/order/components/simple-item-list/simple-item-list.component.d.ts +3 -0
- package/order/order.module.d.ts +34 -0
- package/order/package.json +5 -6
- package/order/providers/order-transition.service.d.ts +3 -0
- package/order/providers/routing/order-resolver.d.ts +5 -4
- package/order/vendure-admin-ui-order.d.ts +1 -0
- package/package.json +120 -36
- package/settings/components/add-country-to-zone-dialog/add-country-to-zone-dialog.component.d.ts +6 -3
- package/settings/components/admin-detail/admin-detail.component.d.ts +9 -10
- package/settings/components/administrator-list/administrator-list.component.d.ts +6 -3
- package/settings/components/channel-detail/channel-detail.component.d.ts +7 -8
- package/settings/components/channel-list/channel-list.component.d.ts +5 -5
- package/settings/components/country-detail/country-detail.component.d.ts +7 -4
- package/settings/components/country-list/country-list.component.d.ts +7 -4
- package/settings/components/global-settings/global-settings.component.d.ts +3 -0
- package/settings/components/payment-method-detail/payment-method-detail.component.d.ts +6 -3
- package/settings/components/payment-method-list/payment-method-list.component.d.ts +5 -2
- package/settings/components/permission-grid/permission-grid.component.d.ts +3 -0
- package/settings/components/profile/profile.component.d.ts +5 -2
- package/settings/components/role-detail/role-detail.component.d.ts +3 -0
- package/settings/components/role-list/role-list.component.d.ts +8 -5
- package/settings/components/shipping-eligibility-test-result/shipping-eligibility-test-result.component.d.ts +3 -0
- package/settings/components/shipping-method-detail/shipping-method-detail.component.d.ts +7 -4
- package/settings/components/shipping-method-list/shipping-method-list.component.d.ts +6 -3
- package/settings/components/shipping-method-test-result/shipping-method-test-result.component.d.ts +3 -0
- package/settings/components/tax-category-detail/tax-category-detail.component.d.ts +7 -8
- package/settings/components/tax-category-list/tax-category-list.component.d.ts +6 -6
- package/settings/components/tax-rate-detail/tax-rate-detail.component.d.ts +8 -5
- package/settings/components/tax-rate-list/tax-rate-list.component.d.ts +6 -7
- package/settings/components/test-address-form/test-address-form.component.d.ts +5 -2
- package/settings/components/test-order-builder/test-order-builder.component.d.ts +7 -2
- package/settings/components/zone-detail-dialog/zone-detail-dialog.component.d.ts +3 -0
- package/settings/components/zone-list/zone-list.component.d.ts +10 -7
- package/settings/components/zone-member-list/zone-member-controls.directive.d.ts +3 -0
- package/settings/components/zone-member-list/zone-member-list-header.directive.d.ts +3 -0
- package/settings/components/zone-member-list/zone-member-list.component.d.ts +3 -0
- package/settings/package.json +5 -6
- package/settings/providers/routing/administrator-resolver.d.ts +5 -4
- package/settings/providers/routing/channel-resolver.d.ts +5 -4
- package/settings/providers/routing/country-resolver.d.ts +5 -4
- package/settings/providers/routing/global-settings-resolver.d.ts +5 -4
- package/settings/providers/routing/payment-method-resolver.d.ts +5 -4
- package/settings/providers/routing/profile-resolver.d.ts +5 -4
- package/settings/providers/routing/role-resolver.d.ts +5 -4
- package/settings/providers/routing/shipping-method-resolver.d.ts +5 -4
- package/settings/providers/routing/tax-category-resolver.d.ts +5 -2
- package/settings/providers/routing/tax-rate-resolver.d.ts +5 -2
- package/settings/settings.module.d.ts +35 -0
- package/settings/vendure-admin-ui-settings.d.ts +1 -0
- package/static/i18n-messages/cs.json +5 -1
- package/static/i18n-messages/de.json +5 -1
- package/static/i18n-messages/en.json +6 -2
- package/static/i18n-messages/es.json +5 -1
- package/static/i18n-messages/fr.json +5 -1
- package/static/i18n-messages/it.json +5 -1
- package/static/i18n-messages/pl.json +5 -1
- package/static/i18n-messages/pt_BR.json +5 -1
- package/static/i18n-messages/pt_PT.json +5 -1
- package/static/i18n-messages/ru.json +5 -1
- package/static/i18n-messages/uk.json +5 -1
- package/static/i18n-messages/zh_Hans.json +5 -1
- package/static/i18n-messages/zh_Hant.json +5 -1
- package/static/polyfills.ts +0 -10
- package/static/styles/styles.scss +1 -1
- package/static/theme.min.css +1 -1
- package/system/components/health-check/health-check.component.d.ts +3 -0
- package/system/components/job-list/job-list.component.d.ts +7 -4
- package/system/components/job-state-label/job-state-label.component.d.ts +3 -0
- package/system/package.json +5 -6
- package/system/system.module.d.ts +9 -0
- package/system/vendure-admin-ui-system.d.ts +1 -0
- package/vendure-admin-ui.d.ts +1 -0
- package/bundles/vendure-admin-ui-catalog.umd.js +0 -4638
- package/bundles/vendure-admin-ui-catalog.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-core.umd.js +0 -14759
- package/bundles/vendure-admin-ui-core.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-customer.umd.js +0 -1626
- package/bundles/vendure-admin-ui-customer.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-dashboard.umd.js +0 -757
- package/bundles/vendure-admin-ui-dashboard.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-login.umd.js +0 -157
- package/bundles/vendure-admin-ui-login.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-marketing.umd.js +0 -783
- package/bundles/vendure-admin-ui-marketing.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-order.umd.js +0 -3287
- package/bundles/vendure-admin-ui-order.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-settings.umd.js +0 -3697
- package/bundles/vendure-admin-ui-settings.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-system.umd.js +0 -524
- package/bundles/vendure-admin-ui-system.umd.js.map +0 -1
- package/bundles/vendure-admin-ui.umd.js +0 -21
- package/bundles/vendure-admin-ui.umd.js.map +0 -1
- package/catalog/vendure-admin-ui-catalog.metadata.json +0 -1
- package/core/vendure-admin-ui-core.metadata.json +0 -1
- package/customer/vendure-admin-ui-customer.metadata.json +0 -1
- package/dashboard/vendure-admin-ui-dashboard.metadata.json +0 -1
- package/esm2015/catalog/catalog.module.js +0 -64
- package/esm2015/catalog/catalog.routes.js +0 -176
- package/esm2015/catalog/components/apply-facet-dialog/apply-facet-dialog.component.js +0 -32
- package/esm2015/catalog/components/asset-detail/asset-detail.component.js +0 -74
- package/esm2015/catalog/components/asset-list/asset-list.component.js +0 -119
- package/esm2015/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.js +0 -109
- package/esm2015/catalog/components/collection-contents/collection-contents.component.js +0 -78
- package/esm2015/catalog/components/collection-detail/collection-detail.component.js +0 -206
- package/esm2015/catalog/components/collection-list/collection-list.component.js +0 -119
- package/esm2015/catalog/components/collection-tree/array-to-tree.js +0 -57
- package/esm2015/catalog/components/collection-tree/collection-tree-node.component.js +0 -94
- package/esm2015/catalog/components/collection-tree/collection-tree.component.js +0 -74
- package/esm2015/catalog/components/confirm-variant-deletion-dialog/confirm-variant-deletion-dialog.component.js +0 -21
- package/esm2015/catalog/components/facet-detail/facet-detail.component.js +0 -326
- package/esm2015/catalog/components/facet-list/facet-list.component.js +0 -107
- package/esm2015/catalog/components/generate-product-variants/generate-product-variants.component.js +0 -78
- package/esm2015/catalog/components/option-value-input/option-value-input.component.js +0 -98
- package/esm2015/catalog/components/product-assets/product-assets.component.js +0 -108
- package/esm2015/catalog/components/product-detail/product-detail.component.js +0 -514
- package/esm2015/catalog/components/product-list/product-list.component.js +0 -153
- package/esm2015/catalog/components/product-options-editor/product-options-editor.component.js +0 -157
- package/esm2015/catalog/components/product-search-input/product-search-input.component.js +0 -104
- package/esm2015/catalog/components/product-variants-editor/product-variants-editor.component.js +0 -316
- package/esm2015/catalog/components/product-variants-list/product-variants-list.component.js +0 -207
- package/esm2015/catalog/components/product-variants-table/product-variants-table.component.js +0 -66
- package/esm2015/catalog/components/update-product-option-dialog/update-product-option-dialog.component.js +0 -61
- package/esm2015/catalog/components/variant-price-detail/variant-price-detail.component.js +0 -60
- package/esm2015/catalog/providers/product-detail/product-detail.service.js +0 -224
- package/esm2015/catalog/providers/routing/asset-resolver.js +0 -37
- package/esm2015/catalog/providers/routing/collection-resolver.js +0 -38
- package/esm2015/catalog/providers/routing/facet-resolver.js +0 -35
- package/esm2015/catalog/providers/routing/product-resolver.js +0 -42
- package/esm2015/catalog/providers/routing/product-variants-resolver.js +0 -31
- package/esm2015/catalog/public_api.js +0 -36
- package/esm2015/core/app.component.js +0 -80
- package/esm2015/core/app.component.module.js +0 -14
- package/esm2015/core/common/base-detail.component.js +0 -106
- package/esm2015/core/common/base-list.component.js +0 -156
- package/esm2015/core/common/generated-types.js +0 -953
- package/esm2015/core/common/introspection-result.js +0 -253
- package/esm2015/core/common/utilities/configurable-operation-utils.js +0 -78
- package/esm2015/core/common/utilities/create-updated-translatable.js +0 -72
- package/esm2015/core/common/utilities/find-translation.js +0 -9
- package/esm2015/core/common/utilities/flatten-facet-values.js +0 -4
- package/esm2015/core/common/utilities/get-default-ui-language.js +0 -13
- package/esm2015/core/components/app-shell/app-shell.component.js +0 -78
- package/esm2015/core/components/breadcrumb/breadcrumb.component.js +0 -126
- package/esm2015/core/components/channel-switcher/channel-switcher.component.js +0 -52
- package/esm2015/core/components/main-nav/main-nav.component.js +0 -272
- package/esm2015/core/components/notification/notification.component.js +0 -71
- package/esm2015/core/components/overlay-host/overlay-host.component.js +0 -22
- package/esm2015/core/components/theme-switcher/theme-switcher.component.js +0 -31
- package/esm2015/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.js +0 -294
- package/esm2015/core/components/user-menu/user-menu.component.js +0 -24
- package/esm2015/core/core.module.js +0 -115
- package/esm2015/core/data/client-state/client-resolvers.js +0 -123
- package/esm2015/core/data/data.module.js +0 -106
- package/esm2015/core/data/definitions/customer-definitions.js +0 -258
- package/esm2015/core/data/providers/administrator-data.service.js +0 -55
- package/esm2015/core/data/providers/auth-data.service.js +0 -20
- package/esm2015/core/data/providers/base-data.service.js +0 -72
- package/esm2015/core/data/providers/client-data.service.js +0 -75
- package/esm2015/core/data/providers/collection-data.service.js +0 -72
- package/esm2015/core/data/providers/customer-data.service.js +0 -114
- package/esm2015/core/data/providers/data.service.js +0 -90
- package/esm2015/core/data/providers/facet-data.service.js +0 -60
- package/esm2015/core/data/providers/fetch-adapter.js +0 -38
- package/esm2015/core/data/providers/interceptor.js +0 -142
- package/esm2015/core/data/providers/order-data.service.js +0 -98
- package/esm2015/core/data/providers/product-data.service.js +0 -232
- package/esm2015/core/data/providers/promotion-data.service.js +0 -36
- package/esm2015/core/data/providers/settings-data.service.js +0 -231
- package/esm2015/core/data/providers/shipping-method-data.service.js +0 -66
- package/esm2015/core/data/server-config.js +0 -76
- package/esm2015/core/data/utils/add-custom-fields.js +0 -78
- package/esm2015/core/data/utils/transform-relation-custom-field-inputs.js +0 -46
- package/esm2015/core/providers/auth/auth.service.js +0 -110
- package/esm2015/core/providers/component-registry/component-registry.service.js +0 -23
- package/esm2015/core/providers/custom-detail-component/custom-detail-component.service.js +0 -44
- package/esm2015/core/providers/custom-field-component/custom-field-component.service.js +0 -47
- package/esm2015/core/providers/dashboard-widget/dashboard-widget.service.js +0 -97
- package/esm2015/core/providers/guard/auth.guard.js +0 -42
- package/esm2015/core/providers/health-check/health-check.service.js +0 -38
- package/esm2015/core/providers/i18n/custom-message-format-compiler.js +0 -30
- package/esm2015/core/providers/i18n/i18n.service.js +0 -56
- package/esm2015/core/providers/job-queue/job-queue.service.js +0 -93
- package/esm2015/core/providers/local-storage/local-storage.service.js +0 -79
- package/esm2015/core/providers/modal/modal.service.js +0 -100
- package/esm2015/core/providers/nav-builder/nav-builder.service.js +0 -264
- package/esm2015/core/providers/notification/notification.service.js +0 -165
- package/esm2015/core/providers/overlay-host/overlay-host.service.js +0 -46
- package/esm2015/core/public_api.js +0 -217
- package/esm2015/core/shared/components/action-bar/action-bar.component.js +0 -47
- package/esm2015/core/shared/components/action-bar-items/action-bar-items.component.js +0 -78
- package/esm2015/core/shared/components/address-form/address-form.component.js +0 -17
- package/esm2015/core/shared/components/affixed-input/affixed-input.component.js +0 -19
- package/esm2015/core/shared/components/affixed-input/percentage-suffix-input.component.js +0 -70
- package/esm2015/core/shared/components/asset-file-input/asset-file-input.component.js +0 -92
- package/esm2015/core/shared/components/asset-gallery/asset-gallery.component.js +0 -102
- package/esm2015/core/shared/components/asset-picker-dialog/asset-picker-dialog.component.js +0 -138
- package/esm2015/core/shared/components/asset-preview/asset-preview.component.js +0 -176
- package/esm2015/core/shared/components/asset-preview-dialog/asset-preview-dialog.component.js +0 -35
- package/esm2015/core/shared/components/asset-search-input/asset-search-input.component.js +0 -102
- package/esm2015/core/shared/components/channel-assignment-control/channel-assignment-control.component.js +0 -109
- package/esm2015/core/shared/components/channel-badge/channel-badge.component.js +0 -19
- package/esm2015/core/shared/components/chip/chip.component.js +0 -42
- package/esm2015/core/shared/components/configurable-input/configurable-input.component.js +0 -128
- package/esm2015/core/shared/components/currency-input/currency-input.component.js +0 -145
- package/esm2015/core/shared/components/custom-detail-component-host/custom-detail-component-host.component.js +0 -44
- package/esm2015/core/shared/components/custom-field-control/custom-field-control.component.js +0 -55
- package/esm2015/core/shared/components/customer-label/customer-label.component.js +0 -15
- package/esm2015/core/shared/components/data-table/data-table-column.component.js +0 -22
- package/esm2015/core/shared/components/data-table/data-table.component.js +0 -106
- package/esm2015/core/shared/components/datetime-picker/datetime-picker.component.js +0 -205
- package/esm2015/core/shared/components/datetime-picker/datetime-picker.service.js +0 -199
- package/esm2015/core/shared/components/dropdown/dropdown-item.directive.js +0 -24
- package/esm2015/core/shared/components/dropdown/dropdown-menu.component.js +0 -121
- package/esm2015/core/shared/components/dropdown/dropdown-trigger.directive.js +0 -25
- package/esm2015/core/shared/components/dropdown/dropdown.component.js +0 -60
- package/esm2015/core/shared/components/edit-note-dialog/edit-note-dialog.component.js +0 -26
- package/esm2015/core/shared/components/empty-placeholder/empty-placeholder.component.js +0 -15
- package/esm2015/core/shared/components/entity-info/entity-info.component.js +0 -19
- package/esm2015/core/shared/components/extension-host/extension-host.component.js +0 -83
- package/esm2015/core/shared/components/extension-host/extension-host.service.js +0 -100
- package/esm2015/core/shared/components/facet-value-chip/facet-value-chip.component.js +0 -23
- package/esm2015/core/shared/components/facet-value-selector/facet-value-selector.component.js +0 -114
- package/esm2015/core/shared/components/focal-point-control/focal-point-control.component.js +0 -56
- package/esm2015/core/shared/components/form-field/form-field-control.directive.js +0 -35
- package/esm2015/core/shared/components/form-field/form-field.component.js +0 -61
- package/esm2015/core/shared/components/form-item/form-item.component.js +0 -19
- package/esm2015/core/shared/components/formatted-address/formatted-address.component.js +0 -37
- package/esm2015/core/shared/components/help-tooltip/help-tooltip.component.js +0 -16
- package/esm2015/core/shared/components/history-entry-detail/history-entry-detail.component.js +0 -12
- package/esm2015/core/shared/components/items-per-page-controls/items-per-page-controls.component.js +0 -23
- package/esm2015/core/shared/components/labeled-data/labeled-data.component.js +0 -15
- package/esm2015/core/shared/components/language-selector/language-selector.component.js +0 -21
- package/esm2015/core/shared/components/manage-tags-dialog/manage-tags-dialog.component.js +0 -58
- package/esm2015/core/shared/components/modal-dialog/dialog-buttons.directive.js +0 -23
- package/esm2015/core/shared/components/modal-dialog/dialog-component-outlet.component.js +0 -31
- package/esm2015/core/shared/components/modal-dialog/dialog-title.directive.js +0 -23
- package/esm2015/core/shared/components/modal-dialog/modal-dialog.component.js +0 -57
- package/esm2015/core/shared/components/object-tree/object-tree.component.js +0 -53
- package/esm2015/core/shared/components/order-state-label/order-state-label.component.js +0 -43
- package/esm2015/core/shared/components/pagination-controls/pagination-controls.component.js +0 -22
- package/esm2015/core/shared/components/product-selector/product-selector.component.js +0 -61
- package/esm2015/core/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.js +0 -32
- package/esm2015/core/shared/components/rich-text-editor/link-dialog/link-dialog.component.js +0 -28
- package/esm2015/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.js +0 -112
- package/esm2015/core/shared/components/rich-text-editor/rich-text-editor.component.js +0 -86
- package/esm2015/core/shared/components/select-toggle/select-toggle.component.js +0 -28
- package/esm2015/core/shared/components/simple-dialog/simple-dialog.component.js +0 -21
- package/esm2015/core/shared/components/status-badge/status-badge.component.js +0 -18
- package/esm2015/core/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.js +0 -49
- package/esm2015/core/shared/components/table-row-action/table-row-action.component.js +0 -23
- package/esm2015/core/shared/components/tag-selector/tag-selector.component.js +0 -55
- package/esm2015/core/shared/components/timeline-entry/timeline-entry.component.js +0 -40
- package/esm2015/core/shared/components/title-input/title-input.component.js +0 -18
- package/esm2015/core/shared/components/ui-extension-point/ui-extension-point.component.js +0 -31
- package/esm2015/core/shared/directives/disabled.directive.js +0 -38
- package/esm2015/core/shared/directives/if-default-channel-active.directive.js +0 -42
- package/esm2015/core/shared/directives/if-directive-base.js +0 -75
- package/esm2015/core/shared/directives/if-multichannel.directive.js +0 -47
- package/esm2015/core/shared/directives/if-permissions.directive.js +0 -78
- package/esm2015/core/shared/dynamic-form-inputs/boolean-form-input/boolean-form-input.component.js +0 -20
- package/esm2015/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.js +0 -125
- package/esm2015/core/shared/dynamic-form-inputs/currency-form-input/currency-form-input.component.js +0 -33
- package/esm2015/core/shared/dynamic-form-inputs/customer-group-form-input/customer-group-form-input.component.js +0 -43
- package/esm2015/core/shared/dynamic-form-inputs/date-form-input/date-form-input.component.js +0 -35
- package/esm2015/core/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.js +0 -266
- package/esm2015/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.js +0 -36
- package/esm2015/core/shared/dynamic-form-inputs/number-form-input/number-form-input.component.js +0 -43
- package/esm2015/core/shared/dynamic-form-inputs/password-form-input/password-form-input.component.js +0 -20
- package/esm2015/core/shared/dynamic-form-inputs/product-selector-form-input/product-selector-form-input.component.js +0 -60
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.js +0 -69
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/customer/relation-customer-input.component.js +0 -66
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/product/relation-product-input.component.js +0 -81
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/product-variant/relation-product-variant-input.component.js +0 -81
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/relation-card/relation-card.component.js +0 -43
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/relation-form-input.component.js +0 -25
- package/esm2015/core/shared/dynamic-form-inputs/relation-form-input/relation-selector-dialog/relation-selector-dialog.component.js +0 -12
- package/esm2015/core/shared/dynamic-form-inputs/rich-text-form-input/rich-text-form-input.component.js +0 -20
- package/esm2015/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.js +0 -28
- package/esm2015/core/shared/dynamic-form-inputs/text-form-input/text-form-input.component.js +0 -28
- package/esm2015/core/shared/dynamic-form-inputs/textarea-form-input/textarea-form-input.component.js +0 -23
- package/esm2015/core/shared/pipes/asset-preview.pipe.js +0 -38
- package/esm2015/core/shared/pipes/channel-label.pipe.js +0 -19
- package/esm2015/core/shared/pipes/custom-field-label.pipe.js +0 -46
- package/esm2015/core/shared/pipes/duration.pipe.js +0 -48
- package/esm2015/core/shared/pipes/file-size.pipe.js +0 -43
- package/esm2015/core/shared/pipes/has-permission.pipe.js +0 -65
- package/esm2015/core/shared/pipes/locale-base.pipe.js +0 -57
- package/esm2015/core/shared/pipes/locale-currency-name.pipe.js +0 -58
- package/esm2015/core/shared/pipes/locale-currency.pipe.js +0 -40
- package/esm2015/core/shared/pipes/locale-date.pipe.js +0 -80
- package/esm2015/core/shared/pipes/locale-language-name.pipe.js +0 -47
- package/esm2015/core/shared/pipes/locale-region-name.pipe.js +0 -47
- package/esm2015/core/shared/pipes/sentence-case.pipe.js +0 -26
- package/esm2015/core/shared/pipes/sort.pipe.js +0 -30
- package/esm2015/core/shared/pipes/state-i18n-token.pipe.js +0 -46
- package/esm2015/core/shared/pipes/string-to-color.pipe.js +0 -14
- package/esm2015/core/shared/pipes/time-ago.pipe.js +0 -51
- package/esm2015/core/shared/providers/routing/can-deactivate-detail-guard.js +0 -36
- package/esm2015/core/shared/shared.module.js +0 -263
- package/esm2015/customer/components/add-customer-to-group-dialog/add-customer-to-group-dialog.component.js +0 -42
- package/esm2015/customer/components/address-card/address-card.component.js +0 -86
- package/esm2015/customer/components/address-detail-dialog/address-detail-dialog.component.js +0 -28
- package/esm2015/customer/components/customer-detail/customer-detail.component.js +0 -393
- package/esm2015/customer/components/customer-group-detail-dialog/customer-group-detail-dialog.component.js +0 -47
- package/esm2015/customer/components/customer-group-list/customer-group-list.component.js +0 -184
- package/esm2015/customer/components/customer-group-member-list/customer-group-member-list.component.js +0 -101
- package/esm2015/customer/components/customer-history/customer-history.component.js +0 -76
- package/esm2015/customer/components/customer-list/customer-list.component.js +0 -78
- package/esm2015/customer/components/customer-status-label/customer-status-label.component.js +0 -15
- package/esm2015/customer/components/select-customer-group-dialog/select-customer-group-dialog.component.js +0 -31
- package/esm2015/customer/customer.module.js +0 -37
- package/esm2015/customer/customer.routes.js +0 -44
- package/esm2015/customer/providers/routing/customer-resolver.js +0 -35
- package/esm2015/dashboard/components/dashboard/dashboard.component.js +0 -124
- package/esm2015/dashboard/components/dashboard-widget/dashboard-widget.component.js +0 -39
- package/esm2015/dashboard/dashboard.module.js +0 -25
- package/esm2015/dashboard/default-widgets.js +0 -34
- package/esm2015/dashboard/widgets/latest-orders-widget/latest-orders-widget.component.js +0 -42
- package/esm2015/dashboard/widgets/order-summary-widget/order-summary-widget.component.js +0 -56
- package/esm2015/dashboard/widgets/test-widget/test-widget.component.js +0 -19
- package/esm2015/dashboard/widgets/welcome-widget/welcome-widget.component.js +0 -36
- package/esm2015/login/components/login/login.component.js +0 -61
- package/esm2015/login/login.module.js +0 -15
- package/esm2015/login/providers/login.guard.js +0 -35
- package/esm2015/marketing/components/promotion-detail/promotion-detail.component.js +0 -247
- package/esm2015/marketing/components/promotion-list/promotion-list.component.js +0 -87
- package/esm2015/marketing/marketing.module.js +0 -15
- package/esm2015/marketing/marketing.routes.js +0 -35
- package/esm2015/marketing/providers/routing/promotion-resolver.js +0 -34
- package/esm2015/order/components/add-manual-payment-dialog/add-manual-payment-dialog.component.js +0 -39
- package/esm2015/order/components/cancel-order-dialog/cancel-order-dialog.component.js +0 -52
- package/esm2015/order/components/fulfill-order-dialog/fulfill-order-dialog.component.js +0 -71
- package/esm2015/order/components/fulfillment-card/fulfillment-card.component.js +0 -43
- package/esm2015/order/components/fulfillment-detail/fulfillment-detail.component.js +0 -64
- package/esm2015/order/components/fulfillment-state-label/fulfillment-state-label.component.js +0 -26
- package/esm2015/order/components/line-fulfillment/line-fulfillment.component.js +0 -65
- package/esm2015/order/components/line-refunds/line-refunds.component.js +0 -35
- package/esm2015/order/components/modification-detail/modification-detail.component.js +0 -66
- package/esm2015/order/components/order-custom-fields-card/order-custom-fields-card.component.js +0 -39
- package/esm2015/order/components/order-detail/order-detail.component.js +0 -509
- package/esm2015/order/components/order-editor/order-editor.component.js +0 -362
- package/esm2015/order/components/order-edits-preview-dialog/order-edits-preview-dialog.component.js +0 -50
- package/esm2015/order/components/order-history/order-history.component.js +0 -154
- package/esm2015/order/components/order-list/order-list.component.js +0 -188
- package/esm2015/order/components/order-payment-card/order-payment-card.component.js +0 -33
- package/esm2015/order/components/order-process-graph/order-process-edge.component.js +0 -37
- package/esm2015/order/components/order-process-graph/order-process-graph.component.js +0 -94
- package/esm2015/order/components/order-process-graph/order-process-node.component.js +0 -53
- package/esm2015/order/components/order-process-graph-dialog/order-process-graph-dialog.component.js +0 -23
- package/esm2015/order/components/order-state-select-dialog/order-state-select-dialog.component.js +0 -25
- package/esm2015/order/components/order-table/order-table.component.js +0 -68
- package/esm2015/order/components/payment-detail/payment-detail.component.js +0 -16
- package/esm2015/order/components/payment-state-label/payment-state-label.component.js +0 -26
- package/esm2015/order/components/refund-order-dialog/refund-order-dialog.component.js +0 -133
- package/esm2015/order/components/refund-state-label/refund-state-label.component.js +0 -25
- package/esm2015/order/components/settle-refund-dialog/settle-refund-dialog.component.js +0 -21
- package/esm2015/order/components/simple-item-list/simple-item-list.component.js +0 -15
- package/esm2015/order/order.module.js +0 -70
- package/esm2015/order/order.routes.js +0 -54
- package/esm2015/order/providers/order-transition.service.js +0 -116
- package/esm2015/order/providers/routing/order-resolver.js +0 -33
- package/esm2015/settings/components/add-country-to-zone-dialog/add-country-to-zone-dialog.component.js +0 -35
- package/esm2015/settings/components/admin-detail/admin-detail.component.js +0 -199
- package/esm2015/settings/components/administrator-list/administrator-list.component.js +0 -52
- package/esm2015/settings/components/channel-detail/channel-detail.component.js +0 -163
- package/esm2015/settings/components/channel-list/channel-list.component.js +0 -57
- package/esm2015/settings/components/country-detail/country-detail.component.js +0 -120
- package/esm2015/settings/components/country-list/country-list.component.js +0 -82
- package/esm2015/settings/components/global-settings/global-settings.component.js +0 -89
- package/esm2015/settings/components/payment-method-detail/payment-method-detail.component.js +0 -204
- package/esm2015/settings/components/payment-method-list/payment-method-list.component.js +0 -66
- package/esm2015/settings/components/permission-grid/permission-grid.component.js +0 -80
- package/esm2015/settings/components/profile/profile.component.js +0 -82
- package/esm2015/settings/components/role-detail/role-detail.component.js +0 -109
- package/esm2015/settings/components/role-list/role-list.component.js +0 -73
- package/esm2015/settings/components/shipping-eligibility-test-result/shipping-eligibility-test-result.component.js +0 -24
- package/esm2015/settings/components/shipping-method-detail/shipping-method-detail.component.js +0 -235
- package/esm2015/settings/components/shipping-method-list/shipping-method-list.component.js +0 -94
- package/esm2015/settings/components/shipping-method-test-result/shipping-method-test-result.component.js +0 -24
- package/esm2015/settings/components/tax-category-detail/tax-category-detail.component.js +0 -115
- package/esm2015/settings/components/tax-category-list/tax-category-list.component.js +0 -60
- package/esm2015/settings/components/tax-rate-detail/tax-rate-detail.component.js +0 -131
- package/esm2015/settings/components/tax-rate-list/tax-rate-list.component.js +0 -64
- package/esm2015/settings/components/test-address-form/test-address-form.component.js +0 -53
- package/esm2015/settings/components/test-order-builder/test-order-builder.component.js +0 -73
- package/esm2015/settings/components/zone-detail-dialog/zone-detail-dialog.component.js +0 -47
- package/esm2015/settings/components/zone-list/zone-list.component.js +0 -160
- package/esm2015/settings/components/zone-member-list/zone-member-controls.directive.js +0 -15
- package/esm2015/settings/components/zone-member-list/zone-member-list-header.directive.js +0 -15
- package/esm2015/settings/components/zone-member-list/zone-member-list.component.js +0 -63
- package/esm2015/settings/providers/routing/administrator-resolver.js +0 -32
- package/esm2015/settings/providers/routing/channel-resolver.js +0 -40
- package/esm2015/settings/providers/routing/country-resolver.js +0 -35
- package/esm2015/settings/providers/routing/global-settings-resolver.js +0 -28
- package/esm2015/settings/providers/routing/payment-method-resolver.js +0 -37
- package/esm2015/settings/providers/routing/profile-resolver.js +0 -34
- package/esm2015/settings/providers/routing/role-resolver.js +0 -32
- package/esm2015/settings/providers/routing/shipping-method-resolver.js +0 -38
- package/esm2015/settings/providers/routing/tax-category-resolver.js +0 -32
- package/esm2015/settings/providers/routing/tax-rate-resolver.js +0 -36
- package/esm2015/settings/settings.module.js +0 -72
- package/esm2015/settings/settings.routes.js +0 -255
- package/esm2015/system/components/health-check/health-check.component.js +0 -19
- package/esm2015/system/components/job-list/job-list.component.js +0 -74
- package/esm2015/system/components/job-state-label/job-state-label.component.js +0 -45
- package/esm2015/system/system.module.js +0 -16
- package/esm2015/system/system.routes.js +0 -22
- package/fesm2015/vendure-admin-ui-catalog.js +0 -3800
- package/fesm2015/vendure-admin-ui-catalog.js.map +0 -1
- package/fesm2015/vendure-admin-ui-core.js +0 -15757
- package/fesm2015/vendure-admin-ui-core.js.map +0 -1
- package/fesm2015/vendure-admin-ui-customer.js +0 -1140
- package/fesm2015/vendure-admin-ui-customer.js.map +0 -1
- package/fesm2015/vendure-admin-ui-dashboard.js +0 -371
- package/fesm2015/vendure-admin-ui-dashboard.js.map +0 -1
- package/fesm2015/vendure-admin-ui-login.js +0 -121
- package/fesm2015/vendure-admin-ui-login.js.map +0 -1
- package/fesm2015/vendure-admin-ui-marketing.js +0 -403
- package/fesm2015/vendure-admin-ui-marketing.js.map +0 -1
- package/fesm2015/vendure-admin-ui-order.js +0 -2492
- package/fesm2015/vendure-admin-ui-order.js.map +0 -1
- package/fesm2015/vendure-admin-ui-settings.js +0 -2975
- package/fesm2015/vendure-admin-ui-settings.js.map +0 -1
- package/fesm2015/vendure-admin-ui-system.js +0 -171
- package/fesm2015/vendure-admin-ui-system.js.map +0 -1
- package/fesm2015/vendure-admin-ui.js.map +0 -1
- package/login/vendure-admin-ui-login.metadata.json +0 -1
- package/marketing/vendure-admin-ui-marketing.metadata.json +0 -1
- package/order/vendure-admin-ui-order.metadata.json +0 -1
- package/settings/vendure-admin-ui-settings.metadata.json +0 -1
- package/system/vendure-admin-ui-system.metadata.json +0 -1
- package/vendure-admin-ui.metadata.json +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Formats a number into a human-readable file size string.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```TypeScript
|
|
9
|
+
* {{ fileSizeInBytes | filesize }}
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @docsCategory pipes
|
|
13
|
+
*/
|
|
14
|
+
export class FileSizePipe {
|
|
15
|
+
transform(value, useSiUnits = true) {
|
|
16
|
+
if (typeof value !== 'number' && typeof value !== 'string') {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
return humanFileSize(value, useSiUnits === true);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
FileSizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
23
|
+
FileSizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileSizePipe, name: "filesize" });
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileSizePipe, decorators: [{
|
|
25
|
+
type: Pipe,
|
|
26
|
+
args: [{ name: 'filesize' }]
|
|
27
|
+
}] });
|
|
28
|
+
/**
|
|
29
|
+
* Convert a number into a human-readable file size string.
|
|
30
|
+
* Adapted from http://stackoverflow.com/a/14919494/772859
|
|
31
|
+
*/
|
|
32
|
+
function humanFileSize(bytes, si) {
|
|
33
|
+
const thresh = si ? 1000 : 1024;
|
|
34
|
+
if (Math.abs(bytes) < thresh) {
|
|
35
|
+
return bytes + ' B';
|
|
36
|
+
}
|
|
37
|
+
const units = si
|
|
38
|
+
? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
39
|
+
: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
|
|
40
|
+
let u = -1;
|
|
41
|
+
do {
|
|
42
|
+
bytes /= thresh;
|
|
43
|
+
++u;
|
|
44
|
+
} while (Math.abs(bytes) >= thresh && u < units.length - 1);
|
|
45
|
+
return bytes.toFixed(1) + ' ' + units[u];
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZS1zaXplLnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbGliL2NvcmUvc3JjL3NoYXJlZC9waXBlcy9maWxlLXNpemUucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQzs7QUFFcEQ7Ozs7Ozs7Ozs7R0FVRztBQUVILE1BQU0sT0FBTyxZQUFZO0lBQ3JCLFNBQVMsQ0FBQyxLQUFhLEVBQUUsYUFBc0IsSUFBSTtRQUMvQyxJQUFJLE9BQU8sS0FBSyxLQUFLLFFBQVEsSUFBSSxPQUFPLEtBQUssS0FBSyxRQUFRLEVBQUU7WUFDeEQsT0FBTyxLQUFLLENBQUM7U0FDaEI7UUFDRCxPQUFPLGFBQWEsQ0FBQyxLQUFLLEVBQUUsVUFBVSxLQUFLLElBQUksQ0FBQyxDQUFDO0lBQ3JELENBQUM7O3lHQU5RLFlBQVk7dUdBQVosWUFBWTsyRkFBWixZQUFZO2tCQUR4QixJQUFJO21CQUFDLEVBQUUsSUFBSSxFQUFFLFVBQVUsRUFBRTs7QUFVMUI7OztHQUdHO0FBQ0gsU0FBUyxhQUFhLENBQUMsS0FBYSxFQUFFLEVBQVc7SUFDN0MsTUFBTSxNQUFNLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FB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gICAgID8gWydrQicsICdNQicsICdHQicsICdUQicsICdQQicsICdFQicsICdaQicsICdZQiddXHJcbiAgICAgICAgOiBbJ0tpQicsICdNaUInLCAnR2lCJywgJ1RpQicsICdQaUInLCAnRWlCJywgJ1ppQicsICdZaUInXTtcclxuICAgIGxldCB1ID0gLTE7XHJcbiAgICBkbyB7XHJcbiAgICAgICAgYnl0ZXMgLz0gdGhyZXNoO1xyXG4gICAgICAgICsrdTtcclxuICAgIH0gd2hpbGUgKE1hdGguYWJzKGJ5dGVzKSA+PSB0aHJlc2ggJiYgdSA8IHVuaXRzLmxlbmd0aCAtIDEpO1xyXG5cclxuICAgIHJldHVybiBieXRlcy50b0ZpeGVkKDEpICsgJyAnICsgdW5pdHNbdV07XHJcbn1cclxuIl19
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "../../data/providers/data.service";
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* A pipe which checks the provided permission against all the permissions of the current user.
|
|
7
|
+
* Returns `true` if the current user has that permission.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```HTML
|
|
11
|
+
* <button [disabled]="!('UpdateCatalog' | hasPermission)">Save Changes</button>
|
|
12
|
+
* ```
|
|
13
|
+
* @docsCategory pipes
|
|
14
|
+
*/
|
|
15
|
+
export class HasPermissionPipe {
|
|
16
|
+
constructor(dataService, changeDetectorRef) {
|
|
17
|
+
this.dataService = dataService;
|
|
18
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
19
|
+
this.hasPermission = false;
|
|
20
|
+
this.lastPermissions = null;
|
|
21
|
+
this.currentPermissions$ = this.dataService.client
|
|
22
|
+
.userStatus()
|
|
23
|
+
.mapStream(data => data.userStatus.permissions);
|
|
24
|
+
}
|
|
25
|
+
transform(input) {
|
|
26
|
+
const requiredPermissions = Array.isArray(input) ? input : [input];
|
|
27
|
+
const requiredPermissionsString = requiredPermissions.join(',');
|
|
28
|
+
if (this.lastPermissions !== requiredPermissionsString) {
|
|
29
|
+
this.lastPermissions = requiredPermissionsString;
|
|
30
|
+
this.hasPermission = false;
|
|
31
|
+
this.dispose();
|
|
32
|
+
this.subscription = this.currentPermissions$.subscribe(permissions => {
|
|
33
|
+
this.hasPermission = this.checkPermissions(permissions, requiredPermissions);
|
|
34
|
+
this.changeDetectorRef.markForCheck();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return this.hasPermission;
|
|
38
|
+
}
|
|
39
|
+
ngOnDestroy() {
|
|
40
|
+
this.dispose();
|
|
41
|
+
}
|
|
42
|
+
checkPermissions(userPermissions, requiredPermissions) {
|
|
43
|
+
for (const perm of requiredPermissions) {
|
|
44
|
+
if (userPermissions.includes(perm)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
dispose() {
|
|
51
|
+
if (this.subscription) {
|
|
52
|
+
this.subscription.unsubscribe();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
HasPermissionPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HasPermissionPipe, deps: [{ token: i1.DataService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
57
|
+
HasPermissionPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HasPermissionPipe, name: "hasPermission", pure: false });
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HasPermissionPipe, decorators: [{
|
|
59
|
+
type: Pipe,
|
|
60
|
+
args: [{
|
|
61
|
+
name: 'hasPermission',
|
|
62
|
+
pure: false,
|
|
63
|
+
}]
|
|
64
|
+
}], ctorParameters: function () { return [{ type: i1.Data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k7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "../../data/providers/data.service";
|
|
4
|
+
/**
|
|
5
|
+
* Used by locale-aware pipes to handle the task of getting the active languageCode
|
|
6
|
+
* of the UI and cleaning up.
|
|
7
|
+
*/
|
|
8
|
+
export class LocaleBasePipe {
|
|
9
|
+
constructor(dataService, changeDetectorRef) {
|
|
10
|
+
if (dataService && changeDetectorRef) {
|
|
11
|
+
this.subscription = dataService.client
|
|
12
|
+
.uiState()
|
|
13
|
+
.mapStream(data => data.uiState)
|
|
14
|
+
.subscribe(({ language, locale }) => {
|
|
15
|
+
this.locale = language.replace(/_/g, '-');
|
|
16
|
+
if (locale) {
|
|
17
|
+
this.locale += `-${locale}`;
|
|
18
|
+
}
|
|
19
|
+
changeDetectorRef.markForCheck();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
ngOnDestroy() {
|
|
24
|
+
if (this.subscription) {
|
|
25
|
+
this.subscription.unsubscribe();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the active locale after attempting to ensure that the locale string
|
|
30
|
+
* is valid for the Intl API.
|
|
31
|
+
*/
|
|
32
|
+
getActiveLocale(localeOverride) {
|
|
33
|
+
const locale = typeof localeOverride === 'string' ? localeOverride : this.locale ?? 'en';
|
|
34
|
+
const hyphenated = locale?.replace(/_/g, '-');
|
|
35
|
+
// Check for a double-region string, containing 2 region codes like
|
|
36
|
+
// pt-BR-BR, which is invalid. In this case, the second region is used
|
|
37
|
+
// and the first region discarded. This would only ever be an issue for
|
|
38
|
+
// those languages where the translation file itself encodes the region,
|
|
39
|
+
// as in pt_BR & pt_PT.
|
|
40
|
+
const matches = hyphenated?.match(/^([a-zA-Z_-]+)(-[A-Z][A-Z])(-[A-Z][A-z])$/);
|
|
41
|
+
if (matches?.length) {
|
|
42
|
+
const overriddenLocale = matches[1] + matches[3];
|
|
43
|
+
return overriddenLocale;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return hyphenated;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
LocaleBasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleBasePipe, deps: [{ token: i1.DataService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
51
|
+
LocaleBasePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleBasePipe });
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleBasePipe, decorators: [{
|
|
53
|
+
type: Injectable
|
|
54
|
+
}], ctorParameters: function () { return [{ type: i1.DataService }, { type: i0.ChangeDetectorRef }]; } });
|
|
55
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlLWJhc2UucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvY29yZS9zcmMvc2hhcmVkL3BpcGVzL2xvY2FsZS1iYXNlLnBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFxQixVQUFVLEVBQTRCLE1BQU0sZUFBZSxDQUFDOzs7QUFLeEY7OztHQUdHO0FBRUgsTUFBTSxPQUFnQixjQUFjO0lBSWhDLFlBQXNCLFdBQXlCLEVBQUUsaUJBQXFDO1FBQ2xGLElBQUksV0FBVyxJQUFJLGlCQUFpQixFQUFFO1lBQ2xDLElBQUksQ0FBQyxZQUFZLEdBQUcsV0FBVyxDQUFDLE1BQU07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1Y3RvcihkYXRhU2VydmljZT86IERhdGFTZXJ2aWNlLCBjaGFuZ2VEZXRlY3RvclJlZj86IENoYW5nZURldGVjdG9yUmVmKSB7XHJcbiAgICAgICAgaWYgKGRhdGFTZXJ2aWNlICYmIGNoYW5nZURldGVjdG9yUmVmKSB7XHJcbiAgICAgICAgICAgIHRoaXMuc3Vic2NyaXB0aW9uID0gZGF0YVNlcnZpY2UuY2xpZW50XHJcbiAgICAgICAgICAgICAgICAudWlTdGF0ZSgpXHJcbiAgICAgICAgICAgICAgICAubWFwU3RyZWFtKGRhdGEgPT4gZGF0YS51aVN0YXRlKVxyXG4gICAgICAgICAgICAgICAgLnN1YnNjcmliZSgoeyBsYW5ndWFnZSwgbG9jYWxlIH0pID0+IHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmxvY2FsZSA9IGxhbmd1YWdlLnJlcGxhY2UoL18vZywgJy0nKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobG9jYWxlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubG9jYWxlICs9IGAtJHtsb2NhbGV9YDtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0b3JSZWYubWFya0ZvckNoZWNrKCk7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgbmdPbkRlc3Ryb3koKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuc3Vic2NyaXB0aW9uKSB7XHJcbiAgICAgICAgICAgIHRoaXMuc3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogUmV0dXJucyB0aGUgYWN0aXZlIGxvY2FsZSBhZnRlciBhdHRlbXB0aW5nIHRvIGVuc3VyZSB0aGF0IHRoZSBsb2NhbGUgc3RyaW5nXHJcbiAgICAg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F0Y2hlc1szXTtcclxuICAgICAgICAgICAgcmV0dXJuIG92ZXJyaWRkZW5Mb2NhbGU7XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgcmV0dXJuIGh5cGhlbmF0ZWQ7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGFic3RyYWN0IHRyYW5zZm9ybSh2YWx1ZTogYW55LCAuLi5hcmdzKTogYW55O1xyXG59XHJcbiJdfQ==
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Optional, Pipe } from '@angular/core';
|
|
2
|
+
import { LocaleBasePipe } from './locale-base.pipe';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../../data/providers/data.service";
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* Displays a human-readable name for a given ISO 4217 currency code.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```HTML
|
|
11
|
+
* {{ order.currencyCode | localeCurrencyName }}
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @docsCategory pipes
|
|
15
|
+
*/
|
|
16
|
+
export class LocaleCurrencyNamePipe extends LocaleBasePipe {
|
|
17
|
+
constructor(dataService, changeDetectorRef) {
|
|
18
|
+
super(dataService, changeDetectorRef);
|
|
19
|
+
}
|
|
20
|
+
transform(value, display = 'full', locale) {
|
|
21
|
+
if (value == null || value === '') {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
if (typeof value !== 'string') {
|
|
25
|
+
return `Invalid currencyCode "${value}"`;
|
|
26
|
+
}
|
|
27
|
+
let name = '';
|
|
28
|
+
let symbol = '';
|
|
29
|
+
const activeLocale = this.getActiveLocale(locale);
|
|
30
|
+
// Awaiting TS types for this API: https://github.com/microsoft/TypeScript/pull/44022/files
|
|
31
|
+
const DisplayNames = Intl.DisplayNames;
|
|
32
|
+
if (display === 'full' || display === 'name') {
|
|
33
|
+
name = new DisplayNames([activeLocale], {
|
|
34
|
+
type: 'currency',
|
|
35
|
+
}).of(value);
|
|
36
|
+
}
|
|
37
|
+
if (display === 'full' || display === 'symbol') {
|
|
38
|
+
const parts = new Intl.NumberFormat(activeLocale, {
|
|
39
|
+
style: 'currency',
|
|
40
|
+
currency: value,
|
|
41
|
+
currencyDisplay: 'symbol',
|
|
42
|
+
}).formatToParts();
|
|
43
|
+
symbol = parts.find(p => p.type === 'currency')?.value || value;
|
|
44
|
+
}
|
|
45
|
+
return display === 'full' ? `${name} (${symbol})` : display === 'name' ? name : symbol;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
LocaleCurrencyNamePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleCurrencyNamePipe, deps: [{ token: i1.DataService, optional: true }, { token: i0.ChangeDetectorRef, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
49
|
+
LocaleCurrencyNamePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleCurrencyNamePipe, name: "localeCurrencyName", pure: false });
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleCurrencyNamePipe, decorators: [{
|
|
51
|
+
type: Pipe,
|
|
52
|
+
args: [{
|
|
53
|
+
name: 'localeCurrencyName',
|
|
54
|
+
pure: false,
|
|
55
|
+
}]
|
|
56
|
+
}], ctorParameters: function () { return [{ type: i1.DataService, decorators: [{
|
|
57
|
+
type: Optional
|
|
58
|
+
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
59
|
+
type: Optional
|
|
60
|
+
}] }]; } });
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlLWN1cnJlbmN5LW5hbWUucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy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b2NhbGUsIHtcclxuICAgICAgICAgICAgICAgICAgICBzdHlsZTogJ2N1cnJlbmN5JyxcclxuICAgICAgICAgICAgICAgICAgICBjdXJyZW5jeTogdmFsdWUsXHJcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3lEaXNwbGF5OiAnc3ltYm9sJyxcclxuICAgICAgICAgICAgICAgIH0pIGFzIGFueVxyXG4gICAgICAgICAgICApLmZvcm1hdFRvUGFydHMoKTtcclxuXHJcbiAgICAgICAgICAgIHN5bWJvbCA9IHBhcnRzLmZpbmQocCA9PiBwLnR5cGUgPT09ICdjdXJyZW5jeScpPy52YWx1ZSB8fCB2YWx1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGRpc3BsYXkgPT09ICdmdWxsJyA/IGAke25hbWV9ICgke3N5bWJvbH0pYCA6IGRpc3BsYXkgPT09ICduYW1lJyA/IG5hbWUgOiBzeW1ib2w7XHJcbiAgICB9XHJcbn1cclxuIl19
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Optional, Pipe } from '@angular/core';
|
|
2
|
+
import { LocaleBasePipe } from './locale-base.pipe';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../../data/providers/data.service";
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* Formats a Vendure monetary value (in cents) into the correct format for the configured currency and display
|
|
8
|
+
* locale.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```HTML
|
|
12
|
+
* {{ variant.priceWithTax | localeCurrency }}
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @docsCategory pipes
|
|
16
|
+
*/
|
|
17
|
+
export class LocaleCurrencyPipe extends LocaleBasePipe {
|
|
18
|
+
constructor(dataService, changeDetectorRef) {
|
|
19
|
+
super(dataService, changeDetectorRef);
|
|
20
|
+
}
|
|
21
|
+
transform(value, ...args) {
|
|
22
|
+
const [currencyCode, locale] = args;
|
|
23
|
+
if (typeof value === 'number' && typeof currencyCode === 'string') {
|
|
24
|
+
const activeLocale = this.getActiveLocale(locale);
|
|
25
|
+
const majorUnits = value / 100;
|
|
26
|
+
return new Intl.NumberFormat(activeLocale, { style: 'currency', currency: currencyCode }).format(majorUnits);
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
LocaleCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleCurrencyPipe, deps: [{ token: i1.DataService, optional: true }, { token: i0.ChangeDetectorRef, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
32
|
+
LocaleCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleCurrencyPipe, name: "localeCurrency", pure: false });
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleCurrencyPipe, decorators: [{
|
|
34
|
+
type: Pipe,
|
|
35
|
+
args: [{
|
|
36
|
+
name: 'localeCurrency',
|
|
37
|
+
pure: false,
|
|
38
|
+
}]
|
|
39
|
+
}], ctorParameters: function () { return [{ type: i1.DataService, decorators: [{
|
|
40
|
+
type: Optional
|
|
41
|
+
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
42
|
+
type: Optional
|
|
43
|
+
}] }]; } });
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlLWN1cnJlbmN5LnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbGliL2NvcmUvc3JjL3NoYXJlZC9waXBlcy9sb2NhbGUtY3VycmVuY3kucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQXFCLFFBQVEsRUFB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EZXRlY3RvclJlZik7XHJcbiAgICB9XHJcblxyXG4gICAgdHJhbnNmb3JtKHZhbHVlOiB1bmtub3duLCAuLi5hcmdzOiB1bmtub3duW10pOiBzdHJpbmcgfCB1bmtub3duIHtcclxuICAgICAgICBjb25zdCBbY3VycmVuY3lDb2RlLCBsb2NhbGVdID0gYXJncztcclxuICAgICAgICBpZiAodHlwZW9mIHZhbHVlID09PSAnbnVtYmVyJyAmJiB0eXBlb2YgY3VycmVuY3lDb2RlID09PSAnc3RyaW5nJykge1xyXG4gICAgICAgICAgICBjb25zdCBhY3RpdmVMb2NhbGUgPSB0aGlzLmdldEFjdGl2ZUxvY2FsZShsb2NhbGUpO1xyXG4gICAgICAgICAgICBjb25zdCBtYWpvclVuaXRzID0gdmFsdWUgLyAxMDA7XHJcbiAgICAgICAgICAgIHJldHVybiBuZXcgSW50bC5OdW1iZXJGb3JtYXQoYWN0aXZlTG9jYWxlLCB7IHN0eWxlOiAnY3VycmVuY3knLCBjdXJyZW5jeTogY3VycmVuY3lDb2RlIH0pLmZvcm1hdChcclxuICAgICAgICAgICAgICAgIG1ham9yVW5pdHMsXHJcbiAgICAgICAgICAgICk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB2YWx1ZTtcclxuICAgIH1cclxufVxyXG4iXX0=
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Optional, Pipe } from '@angular/core';
|
|
2
|
+
import { LocaleBasePipe } from './locale-base.pipe';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../../data/providers/data.service";
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* A replacement of the Angular DatePipe which makes use of the Intl API
|
|
8
|
+
* to format dates according to the selected UI language.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```HTML
|
|
12
|
+
* {{ order.orderPlacedAt | localeDate }}
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @docsCategory pipes
|
|
16
|
+
*/
|
|
17
|
+
export class LocaleDatePipe extends LocaleBasePipe {
|
|
18
|
+
constructor(dataService, changeDetectorRef) {
|
|
19
|
+
super(dataService, changeDetectorRef);
|
|
20
|
+
}
|
|
21
|
+
transform(value, ...args) {
|
|
22
|
+
const [format, locale] = args;
|
|
23
|
+
if (this.locale || typeof locale === 'string') {
|
|
24
|
+
const activeLocale = this.getActiveLocale(locale);
|
|
25
|
+
const date = value instanceof Date ? value : typeof value === 'string' ? new Date(value) : undefined;
|
|
26
|
+
if (date) {
|
|
27
|
+
const options = this.getOptionsForFormat(typeof format === 'string' ? format : 'medium');
|
|
28
|
+
return new Intl.DateTimeFormat(activeLocale, options).format(date);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
getOptionsForFormat(dateFormat) {
|
|
33
|
+
switch (dateFormat) {
|
|
34
|
+
case 'medium':
|
|
35
|
+
return {
|
|
36
|
+
month: 'short',
|
|
37
|
+
year: 'numeric',
|
|
38
|
+
day: 'numeric',
|
|
39
|
+
hour: 'numeric',
|
|
40
|
+
minute: 'numeric',
|
|
41
|
+
second: 'numeric',
|
|
42
|
+
hour12: true,
|
|
43
|
+
};
|
|
44
|
+
case 'mediumTime':
|
|
45
|
+
return {
|
|
46
|
+
hour: 'numeric',
|
|
47
|
+
minute: 'numeric',
|
|
48
|
+
second: 'numeric',
|
|
49
|
+
hour12: true,
|
|
50
|
+
};
|
|
51
|
+
case 'longDate':
|
|
52
|
+
return {
|
|
53
|
+
year: 'numeric',
|
|
54
|
+
month: 'long',
|
|
55
|
+
day: 'numeric',
|
|
56
|
+
};
|
|
57
|
+
case 'short':
|
|
58
|
+
return {
|
|
59
|
+
day: 'numeric',
|
|
60
|
+
month: 'numeric',
|
|
61
|
+
year: '2-digit',
|
|
62
|
+
hour: 'numeric',
|
|
63
|
+
minute: 'numeric',
|
|
64
|
+
hour12: true,
|
|
65
|
+
};
|
|
66
|
+
default:
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
LocaleDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleDatePipe, deps: [{ token: i1.DataService, optional: true }, { token: i0.ChangeDetectorRef, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
72
|
+
LocaleDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleDatePipe, name: "localeDate", pure: false });
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleDatePipe, decorators: [{
|
|
74
|
+
type: Pipe,
|
|
75
|
+
args: [{
|
|
76
|
+
name: 'localeDate',
|
|
77
|
+
pure: false,
|
|
78
|
+
}]
|
|
79
|
+
}], ctorParameters: function () { return [{ type: i1.DataService, decorators: [{
|
|
80
|
+
type: Optional
|
|
81
|
+
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
82
|
+
type: Optional
|
|
83
|
+
}] }]; } });
|
|
84
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlLWRhdGUucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvY29yZS9zcmMvc2hhcmVkL3BpcGVzL2xvY2FsZS1kYXRlLnBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFxQixRQUFRLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQztBQUlqRixPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7OztBQUVwRDs7Ozs7Ozs7Ozs7R0FXRztBQUtILE1BQU0sT0FBTyxjQUFlLFNBQVEsY0FBYztJQUM5QyxZQUF3QixXQUF5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ICAgICAgICAgICAgICAgICAgICBkYXk6ICdudW1lcmljJyxcclxuICAgICAgICAgICAgICAgICAgICBob3VyOiAnbnVtZXJpYycsXHJcbiAgICAgICAgICAgICAgICAgICAgbWludXRlOiAnbnVtZXJpYycsXHJcbiAgICAgICAgICAgICAgICAgICAgc2Vjb25kOiAnbnVtZXJpYycsXHJcbiAgICAgICAgICAgICAgICAgICAgaG91cjEyOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgY2FzZSAnbWVkaXVtVGltZSc6XHJcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGhvdXI6ICdudW1lcmljJyxcclxuICAgICAgICAgICAgICAgICAgICBtaW51dGU6ICdudW1lcmljJyxcclxuICAgICAgICAgICAgICAgICAgICBzZWNvbmQ6ICdudW1lcmljJyxcclxuICAgICAgICAgICAgICAgICAgICBob3VyMTI6IHRydWUsXHJcbiAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBjYXNlICdsb25nRGF0ZSc6XHJcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHllYXI6ICdudW1lcmljJyxcclxuICAgICAgICAgICAgICAgICAgICBtb250aDogJ2xvbmcnLFxyXG4gICAgICAgICAgICAgICAgICAgIGRheTogJ251bWVyaWMnLFxyXG4gICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgY2FzZSAnc2hvcnQnOlxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgICAgICBkYXk6ICdudW1lcmljJyxcclxuICAgICAgICAgICAgICAgICAgICBtb250aDogJ251bWVyaWMnLFxyXG4gICAgICAgICAgICAgICAgICAgIHllYXI6ICcyLWRpZ2l0JyxcclxuICAgICAgICAgICAgICAgICAgICBob3VyOiAnbnVtZXJpYycsXHJcbiAgICAgICAgICAgICAgICAgICAgbWludXRlOiAnbnVtZXJpYycsXHJcbiAgICAgICAgICAgICAgICAgICAgaG91cjEyOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIl19
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Optional, Pipe } from '@angular/core';
|
|
2
|
+
import { LocaleBasePipe } from './locale-base.pipe';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../../data/providers/data.service";
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* Displays a human-readable name for a given ISO 639-1 language code.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```HTML
|
|
11
|
+
* {{ 'zh_Hant' | localeLanguageName }}
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @docsCategory pipes
|
|
15
|
+
*/
|
|
16
|
+
export class LocaleLanguageNamePipe extends LocaleBasePipe {
|
|
17
|
+
constructor(dataService, changeDetectorRef) {
|
|
18
|
+
super(dataService, changeDetectorRef);
|
|
19
|
+
}
|
|
20
|
+
transform(value, locale) {
|
|
21
|
+
if (value == null || value === '') {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
if (typeof value !== 'string') {
|
|
25
|
+
return `Invalid language code "${value}"`;
|
|
26
|
+
}
|
|
27
|
+
const activeLocale = this.getActiveLocale(locale);
|
|
28
|
+
// Awaiting TS types for this API: https://github.com/microsoft/TypeScript/pull/44022/files
|
|
29
|
+
const DisplayNames = Intl.DisplayNames;
|
|
30
|
+
try {
|
|
31
|
+
return new DisplayNames([activeLocale.replace('_', '-')], { type: 'language' }).of(value.replace('_', '-'));
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
LocaleLanguageNamePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleLanguageNamePipe, deps: [{ token: i1.DataService, optional: true }, { token: i0.ChangeDetectorRef, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
39
|
+
LocaleLanguageNamePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleLanguageNamePipe, name: "localeLanguageName", pure: false });
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleLanguageNamePipe, decorators: [{
|
|
41
|
+
type: Pipe,
|
|
42
|
+
args: [{
|
|
43
|
+
name: 'localeLanguageName',
|
|
44
|
+
pure: false,
|
|
45
|
+
}]
|
|
46
|
+
}], ctorParameters: function () { return [{ type: i1.DataService, decorators: [{
|
|
47
|
+
type: Optional
|
|
48
|
+
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
49
|
+
type: Optional
|
|
50
|
+
}] }]; } });
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlLWxhbmd1YWdlLW5hbWUucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvY29yZS9zcmMvc2hhcmVkL3BpcGVzL2xvY2FsZS1sYW5ndWFnZS1uYW1lLnBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFxQixRQUFRLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQztBQUlqRixPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7OztBQUVwRDs7Ozs7Ozs7OztHQVVHO0FBS0gsTUFBTSxPQUFPLHNCQUF1QixTQUFRLGNBQWM7SUFDdEQsWUFBd0IsV0FBeUIsRUFBY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XHJcbiAgICAgICAgaWYgKHZhbHVlID09IG51bGwgfHwgdmFsdWUgPT09ICcnKSB7XHJcbiAgICAgICAgICAgIHJldHVybiAnJztcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZSAhPT0gJ3N0cmluZycpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGBJbnZhbGlkIGxhbmd1YWdlIGNvZGUgXCIke3ZhbHVlIGFzIGFueX1cImA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IGFjdGl2ZUxvY2FsZSA9IHRoaXMuZ2V0QWN0aXZlTG9jYWxlKGxvY2FsZSk7XHJcblxyXG4gICAgICAgIC8vIEF3YWl0aW5nIFRTIHR5cGVzIGZvciB0aGlzIEFQSTogaHR0cHM6Ly9naXRodWIuY29tL21pY3Jvc29mdC9UeXBlU2NyaXB0L3B1bGwvNDQwMjIvZmlsZXNcclxuICAgICAgICBjb25zdCBEaXNwbGF5TmFtZXMgPSAoSW50bCBhcyBhbnkpLkRpc3BsYXlOYW1lcztcclxuXHJcbiAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgcmV0dXJuIG5ldyBEaXNwbGF5TmFtZXMoW2FjdGl2ZUxvY2FsZS5yZXBsYWNlKCdfJywgJy0nKV0sIHsgdHlwZTogJ2xhbmd1YWdlJyB9KS5vZihcclxuICAgICAgICAgICAgICAgIHZhbHVlLnJlcGxhY2UoJ18nLCAnLScpLFxyXG4gICAgICAgICAgICApO1xyXG4gICAgICAgIH0gY2F0Y2ggKGU6IGFueSkge1xyXG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Optional, Pipe } from '@angular/core';
|
|
2
|
+
import { LocaleBasePipe } from './locale-base.pipe';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../../data/providers/data.service";
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* Displays a human-readable name for a given region.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```HTML
|
|
11
|
+
* {{ 'GB' | localeRegionName }}
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @docsCategory pipes
|
|
15
|
+
*/
|
|
16
|
+
export class LocaleRegionNamePipe extends LocaleBasePipe {
|
|
17
|
+
constructor(dataService, changeDetectorRef) {
|
|
18
|
+
super(dataService, changeDetectorRef);
|
|
19
|
+
}
|
|
20
|
+
transform(value, locale) {
|
|
21
|
+
if (value == null || value === '') {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
if (typeof value !== 'string') {
|
|
25
|
+
return `Invalid region code "${value}"`;
|
|
26
|
+
}
|
|
27
|
+
const activeLocale = this.getActiveLocale(locale);
|
|
28
|
+
// Awaiting TS types for this API: https://github.com/microsoft/TypeScript/pull/44022/files
|
|
29
|
+
const DisplayNames = Intl.DisplayNames;
|
|
30
|
+
try {
|
|
31
|
+
return new DisplayNames([activeLocale.replace('_', '-')], { type: 'region' }).of(value.replace('_', '-'));
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
LocaleRegionNamePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleRegionNamePipe, deps: [{ token: i1.DataService, optional: true }, { token: i0.ChangeDetectorRef, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
39
|
+
LocaleRegionNamePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleRegionNamePipe, name: "localeRegionName", pure: false });
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LocaleRegionNamePipe, decorators: [{
|
|
41
|
+
type: Pipe,
|
|
42
|
+
args: [{
|
|
43
|
+
name: 'localeRegionName',
|
|
44
|
+
pure: false,
|
|
45
|
+
}]
|
|
46
|
+
}], ctorParameters: function () { return [{ type: i1.DataService, decorators: [{
|
|
47
|
+
type: Optional
|
|
48
|
+
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
49
|
+
type: Optional
|
|
50
|
+
}] }]; } });
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlLXJlZ2lvbi1uYW1lLnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbGliL2NvcmUvc3JjL3NoYXJlZC9waXBlcy9sb2NhbGUtcmVnaW9uLW5hbWUucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQXFCLFFBQVEsRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDO0FBSWpGLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQzs7O0FBRXBEOzs7Ozs7Ozs7O0dBVUc7QUFLSCxNQUFNLE9BQU8sb0JBQXFCLFNBQVEsY0FBYztJQUNwRCxZQUF3QixXQUF5QixFQUFjLGlCQUFxQztRQUNoRyxLQUFLLENBQUMsV0FBVyxFQUFFLGlCQUFpQixDQUFDLENBQUM7SUFDMUMsQ0FBQztJQUNELFNBQVMsQ0FBQyxLQUFVLEVBQUUsTUFBZ0I7UUFDbEMsSUFBSSxLQUFLLElBQUksSUFBSSxJQUFJLEtBQUssS0FBSyxFQUFFLEVBQUU7WUFDL0IsT0FBTyxFQUFFLENBQUM7U0FDYjtRQUNELElBQUksT0FBTyxLQUFLLEtBQUssUUFBUSxFQUFFO1lBQzNCLE9BQU8sd0JBQXdCLEtBQVksR0FBRyxDQUFDO1NBQ2xEO1FBQ0QsTUFBTS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8gQXdhaXRpbmcgVFMgdHlwZXMgZm9yIHRoaXMgQVBJOiBodHRwczovL2dpdGh1Yi5jb20vbWljcm9zb2Z0L1R5cGVTY3JpcHQvcHVsbC80NDAyMi9maWxlc1xyXG4gICAgICAgIGNvbnN0IERpc3BsYXlOYW1lcyA9IChJbnRsIGFzIGFueSkuRGlzcGxheU5hbWVzO1xyXG5cclxuICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICByZXR1cm4gbmV3IERpc3BsYXlOYW1lcyhbYWN0aXZlTG9jYWxlLnJlcGxhY2UoJ18nLCAnLScpXSwgeyB0eXBlOiAncmVnaW9uJyB9KS5vZihcclxuICAgICAgICAgICAgICAgIHZhbHVlLnJlcGxhY2UoJ18nLCAnLScpLFxyXG4gICAgICAgICAgICApO1xyXG4gICAgICAgIH0gY2F0Y2ggKGU6IGFueSkge1xyXG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Formats a string into sentence case (first letter of first word uppercase).
|
|
5
|
+
*/
|
|
6
|
+
export class SentenceCasePipe {
|
|
7
|
+
transform(value) {
|
|
8
|
+
if (typeof value === 'string') {
|
|
9
|
+
let lower;
|
|
10
|
+
if (isCamelCase(value)) {
|
|
11
|
+
lower = value.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
lower = value.toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
return lower.charAt(0).toUpperCase() + lower.slice(1);
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
SentenceCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SentenceCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
22
|
+
SentenceCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SentenceCasePipe, name: "sentenceCase" });
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SentenceCasePipe, decorators: [{
|
|
24
|
+
type: Pipe,
|
|
25
|
+
args: [{ name: 'sentenceCase' }]
|
|
26
|
+
}] });
|
|
27
|
+
function isCamelCase(value) {
|
|
28
|
+
return /^[a-zA-Z]+[A-Z][a-zA-Z]+$/.test(value);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VudGVuY2UtY2FzZS5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9jb3JlL3NyYy9zaGFyZWQvcGlwZXMvc2VudGVuY2UtY2FzZS5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDOztBQUVwRDs7R0FFRztBQUVILE1BQU0sT0FBTyxnQkFBZ0I7SUFDekIsU0FBUyxDQUFDLEtBQVU7UUFDaEIsSUFBSSxPQUFPLEtBQUssS0FBSyxRQUFRLEVBQUU7WUFDM0IsSUFBSSxLQUFhLENBQUM7WUFDbEIsSUFBSSxXQUFXLENBQUMsS0FBSyxDQUFDLEVBQUU7Z0JBQ3BCLEtBQUssR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLGlCQUFpQixFQUFFLE9BQU8sQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDO2FBQ25FO2lCQUFNO2dCQUNILEtBQUssR0FBRyxLQUFLLENBQUMsV0FBVyxFQUFFLENBQUM7YUFDL0I7W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JDYXNlKCk7XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBsb3dlciA9IHZhbHVlLnRvTG93ZXJDYXNlKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGxvd2VyLmNoYXJBdCgwKS50b1VwcGVyQ2FzZSgpICsgbG93ZXIuc2xpY2UoMSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB2YWx1ZTtcclxuICAgIH1cclxufVxyXG5cclxuZnVuY3Rpb24gaXNDYW1lbENhc2UodmFsdWU6IHN0cmluZyk6IGJvb2xlYW4ge1xyXG4gICAgcmV0dXJuIC9eW2EtekEtWl0rW0EtWl1bYS16QS1aXSskLy50ZXN0KHZhbHVlKTtcclxufVxyXG4iXX0=
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* A pipe for sorting elements of an array. Should be used with caution due to the
|
|
5
|
+
* potential for perf degredation. Ideally should only be used on small arrays (< 10s of items)
|
|
6
|
+
* and in components using OnPush change detection.
|
|
7
|
+
*/
|
|
8
|
+
export class SortPipe {
|
|
9
|
+
transform(value, orderByProp) {
|
|
10
|
+
return value.slice().sort((a, b) => {
|
|
11
|
+
const aProp = orderByProp ? a[orderByProp] : a;
|
|
12
|
+
const bProp = orderByProp ? b[orderByProp] : b;
|
|
13
|
+
if (aProp === bProp) {
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
16
|
+
if (aProp == null) {
|
|
17
|
+
return 1;
|
|
18
|
+
}
|
|
19
|
+
if (bProp == null) {
|
|
20
|
+
return -1;
|
|
21
|
+
}
|
|
22
|
+
return aProp > bProp ? 1 : -1;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
SortPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SortPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
27
|
+
SortPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SortPipe, name: "sort" });
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SortPipe, decorators: [{
|
|
29
|
+
type: Pipe,
|
|
30
|
+
args: [{
|
|
31
|
+
name: 'sort',
|
|
32
|
+
}]
|
|
33
|
+
}] });
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29ydC5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9jb3JlL3NyYy9zaGFyZWQvcGlwZXMvc29ydC5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDOztBQUVwRDs7OztHQUlHO0FBSUgsTUFBTSxPQUFPLFFBQVE7SUFDakIsU0FBUyxDQUFJLEtBQXlCLEVBQUUsV0FBcUI7UUFDekQsT0FBTyxLQUFLLENBQUMsS0FBSyxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQy9CLE1BQU0sS0FBSyxHQUFHLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDL0MsTUFBTSxLQUFLLEdBQUcsV0FBVyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztZQUMvQyxJQUFJLEtBQUssS0FBSyxLQUFLLEVBQUU7Z0JBQ2pCLE9BQU8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OiBrZXlvZiBUKSB7XHJcbiAgICAgICAgcmV0dXJuIHZhbHVlLnNsaWNlKCkuc29ydCgoYSwgYikgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCBhUHJvcCA9IG9yZGVyQnlQcm9wID8gYVtvcmRlckJ5UHJvcF0gOiBhO1xyXG4gICAgICAgICAgICBjb25zdCBiUHJvcCA9IG9yZGVyQnlQcm9wID8gYltvcmRlckJ5UHJvcF0gOiBiO1xyXG4gICAgICAgICAgICBpZiAoYVByb3AgPT09IGJQcm9wKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoYVByb3AgPT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIDE7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGJQcm9wID09IG51bGwpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gYVByb3AgPiBiUHJvcCA/IDEgOiAtMTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxufVxyXG4iXX0=
|