@myparcel-dev/pdk-admin 1.13.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/CHANGELOG.md +459 -0
- package/dist/__tests__/doComponentTestSetup.d.ts +2 -0
- package/dist/__tests__/doComponentTestTeardown.d.ts +1 -0
- package/dist/__tests__/index.d.ts +3 -0
- package/dist/__tests__/mocks/index.d.ts +14 -0
- package/dist/__tests__/mocks/mockDefaultAccount.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultAppConfig.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultAppInfo.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultCarriers.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultConfig.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultDynamicContext.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultEndpoints.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultGlobalContext.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultLogger.d.ts +1 -0
- package/dist/__tests__/mocks/mockDefaultPlatform.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultPluginSettings.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultPrintOptionsView.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultShop.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultTranslations.d.ts +2 -0
- package/dist/actions/composables/index.d.ts +2 -0
- package/dist/actions/composables/mutations/account/index.d.ts +2 -0
- package/dist/actions/composables/mutations/account/useDeleteAccountMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/account/useUpdateAccountMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/debug/index.d.ts +3 -0
- package/dist/actions/composables/mutations/debug/useDownloadLogsMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/debug/useSwitchToAcceptanceApiMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/debug/useSwitchToProductionApiMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/index.d.ts +7 -0
- package/dist/actions/composables/mutations/orders/index.d.ts +3 -0
- package/dist/actions/composables/mutations/orders/useExportOrdersMutation.d.ts +5 -0
- package/dist/actions/composables/mutations/orders/usePrintOrdersMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/orders/useUpdateOrdersMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/settings/index.d.ts +2 -0
- package/dist/actions/composables/mutations/settings/useUpdatePluginSettingsMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/settings/useUpdateProductSettingsMutation.d.ts +3 -0
- package/dist/actions/composables/mutations/shipments/index.d.ts +4 -0
- package/dist/actions/composables/mutations/shipments/useDeleteShipmentsMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/shipments/useExportReturnMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/shipments/usePrintShipmentsMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/shipments/useUpdateShipmentsMutation.d.ts +4 -0
- package/dist/actions/composables/mutations/usePdkMutation.d.ts +15 -0
- package/dist/actions/composables/mutations/webhooks/index.d.ts +2 -0
- package/dist/actions/composables/mutations/webhooks/useCreateWebhooksMutation.d.ts +1 -0
- package/dist/actions/composables/mutations/webhooks/useDeleteWebhooksMutation.d.ts +3 -0
- package/dist/actions/composables/queries/account/index.d.ts +1 -0
- package/dist/actions/composables/queries/account/useFetchContextQuery.d.ts +3 -0
- package/dist/actions/composables/queries/index.d.ts +6 -0
- package/dist/actions/composables/queries/orders/index.d.ts +1 -0
- package/dist/actions/composables/queries/orders/useFetchOrdersQuery.d.ts +3 -0
- package/dist/actions/composables/queries/products/index.d.ts +1 -0
- package/dist/actions/composables/queries/products/useFetchProductsQuery.d.ts +3 -0
- package/dist/actions/composables/queries/queryKeys.d.ts +2 -0
- package/dist/actions/composables/queries/shipments/index.d.ts +1 -0
- package/dist/actions/composables/queries/shipments/useFetchShipmentsQuery.d.ts +4 -0
- package/dist/actions/composables/queries/webhooks/index.d.ts +1 -0
- package/dist/actions/composables/queries/webhooks/useFetchWebhooksQuery.d.ts +3 -0
- package/dist/actions/defineAction.d.ts +8 -0
- package/dist/actions/definitions/account.d.ts +13 -0
- package/dist/actions/definitions/context.d.ts +6 -0
- package/dist/actions/definitions/debug.d.ts +13 -0
- package/dist/actions/definitions/index.d.ts +8 -0
- package/dist/actions/definitions/modal.d.ts +17 -0
- package/dist/actions/definitions/orders.d.ts +38 -0
- package/dist/actions/definitions/settings.d.ts +2 -0
- package/dist/actions/definitions/shipments.d.ts +15 -0
- package/dist/actions/definitions/webhooks.d.ts +4 -0
- package/dist/actions/executors/createHandlerWithParameters.d.ts +5 -0
- package/dist/actions/executors/createMutationHandler.d.ts +3 -0
- package/dist/actions/executors/createOrdersMutationHandler.d.ts +2 -0
- package/dist/actions/executors/createQueryHandler.d.ts +3 -0
- package/dist/actions/executors/createShipmentsMutationHandler.d.ts +2 -0
- package/dist/actions/executors/doMutate.d.ts +4 -0
- package/dist/actions/executors/executeAction.d.ts +6 -0
- package/dist/actions/executors/executeAfterHandle.d.ts +3 -0
- package/dist/actions/executors/executeBeforeHandle.d.ts +4 -0
- package/dist/actions/executors/executeHandler.d.ts +3 -0
- package/dist/actions/executors/executeNextAction.d.ts +6 -0
- package/dist/actions/executors/index.d.ts +14 -0
- package/dist/actions/executors/resolveOrderParameters.d.ts +3 -0
- package/dist/actions/executors/resolveQuerySuffix.d.ts +3 -0
- package/dist/actions/executors/types.d.ts +19 -0
- package/dist/actions/index.d.ts +6 -0
- package/dist/actions/print/index.d.ts +3 -0
- package/dist/actions/print/openOrPrintPdf.d.ts +3 -0
- package/dist/actions/print/resolvePrintParameters.d.ts +3 -0
- package/dist/actions/print/waitForLabelPrompt.d.ts +3 -0
- package/dist/actions/stopActionHandler.d.ts +2 -0
- package/dist/components/OrderBox/OrderShipmentsTable.vue.d.ts +6 -0
- package/dist/components/OrderBox/OrderShipmentsTableRow.vue.d.ts +21 -0
- package/dist/components/OrderBox/ShipmentOptionsBox.vue.d.ts +2 -0
- package/dist/components/OrderBox/ShipmentTableBox.vue.d.ts +2 -0
- package/dist/components/OrderListItem/OrderModeOrderListItem.vue.d.ts +2 -0
- package/dist/components/OrderListItem/ShipmentLabel.vue.d.ts +15 -0
- package/dist/components/OrderListItem/ShipmentModeOrderListItem.vue.d.ts +2 -0
- package/dist/components/PluginSettings/AccountSettings.vue.d.ts +2 -0
- package/dist/components/PluginSettings/DebugOptions.vue.d.ts +2 -0
- package/dist/components/PluginSettings/EditApiKeyForm.vue.d.ts +7 -0
- package/dist/components/PluginSettings/PluginSettingsForms.vue.d.ts +2 -0
- package/dist/components/PluginSettings/WebhooksStatus.vue.d.ts +2 -0
- package/dist/components/PluginSettings/createUpdateAccountSettingsValidator.d.ts +4 -0
- package/dist/components/common/ActionButton.vue.d.ts +52 -0
- package/dist/components/common/BulkSelectCheckbox.vue.d.ts +22 -0
- package/dist/components/common/CarrierLogo.vue.d.ts +16 -0
- package/dist/components/common/DateRelative.vue.d.ts +16 -0
- package/dist/components/common/DeliveryOptionsDeliveryType.vue.d.ts +16 -0
- package/dist/components/common/DeliveryOptionsExcerpt.vue.d.ts +2 -0
- package/dist/components/common/DeliveryOptionsExcerptCarrierName.vue.d.ts +16 -0
- package/dist/components/common/DeliveryOptionsPackageType.vue.d.ts +16 -0
- package/dist/components/common/DigitalStampWeightRange.vue.d.ts +15 -0
- package/dist/components/common/NotificationContainer.vue.d.ts +19 -0
- package/dist/components/common/PackageType.vue.d.ts +16 -0
- package/dist/components/common/PlainElement.d.ts +2 -0
- package/dist/components/common/ResetButton.vue.d.ts +15 -0
- package/dist/components/common/ReturnsForm.vue.d.ts +14 -0
- package/dist/components/common/ShipmentBarcode.vue.d.ts +15 -0
- package/dist/components/common/ShipmentOptionsForm.vue.d.ts +16 -0
- package/dist/components/common/ShipmentStatus.vue.d.ts +15 -0
- package/dist/components/common/StatusIndicator.vue.d.ts +23 -0
- package/dist/components/common/SubmitButton.vue.d.ts +15 -0
- package/dist/components/common/TabNavigation.vue.d.ts +66 -0
- package/dist/components/common/index.d.ts +20 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/modals/PrintOptionsModal.vue.d.ts +2 -0
- package/dist/components/modals/PrintOptionsModalForm.vue.d.ts +2 -0
- package/dist/components/modals/ShipmentOptionsModal.vue.d.ts +2 -0
- package/dist/components/modals/ShipmentOptionsModalForm.vue.d.ts +16 -0
- package/dist/composables/components/index.d.ts +15 -0
- package/dist/composables/components/useBulkSelectCheckbox.d.ts +9 -0
- package/dist/composables/components/useCheckboxGroupContext.d.ts +4 -0
- package/dist/composables/components/useDropOffInputContext.d.ts +13 -0
- package/dist/composables/components/useDropdownButtonContext.d.ts +15 -0
- package/dist/composables/components/useElementContext.d.ts +7 -0
- package/dist/composables/components/useElementOptions.d.ts +6 -0
- package/dist/composables/components/useInputWithOptionsContext.d.ts +10 -0
- package/dist/composables/components/useModalElementContext.d.ts +11 -0
- package/dist/composables/components/useMultiSelectInputContext.d.ts +4 -0
- package/dist/composables/components/useRadioGroupContext.d.ts +10 -0
- package/dist/composables/components/useSelectInputContext.d.ts +4 -0
- package/dist/composables/components/useShippingMethodsInputContext.d.ts +13 -0
- package/dist/composables/components/useTableContext.d.ts +7 -0
- package/dist/composables/components/useToggleInputContext.d.ts +11 -0
- package/dist/composables/components/useTriStateInputContext.d.ts +17 -0
- package/dist/composables/context/index.d.ts +7 -0
- package/dist/composables/context/useAppInfo.d.ts +2 -0
- package/dist/composables/context/useContext.d.ts +3 -0
- package/dist/composables/context/useGlobalContext.d.ts +2 -0
- package/dist/composables/context/useInstanceContext.d.ts +8 -0
- package/dist/composables/context/useModalContext.d.ts +11 -0
- package/dist/composables/context/useModalOrder.d.ts +1 -0
- package/dist/composables/context/usePluginSettings.d.ts +2 -0
- package/dist/composables/formatter/default/createCurrencyFormat.d.ts +1 -0
- package/dist/composables/formatter/default/createLongDateFormat.d.ts +1 -0
- package/dist/composables/formatter/default/createRelativeTimeFormat.d.ts +1 -0
- package/dist/composables/formatter/default/defaultCurrencyFormatters.d.ts +2 -0
- package/dist/composables/formatter/default/defaultDateFormatters.d.ts +4 -0
- package/dist/composables/formatter/default/index.d.ts +6 -0
- package/dist/composables/formatter/default/parseDate.d.ts +1 -0
- package/dist/composables/formatter/formatter.types.d.ts +23 -0
- package/dist/composables/formatter/index.d.ts +4 -0
- package/dist/composables/formatter/useFormatter.d.ts +2 -0
- package/dist/composables/formatter/useLocalizedFormatter.d.ts +2 -0
- package/dist/composables/index.d.ts +17 -0
- package/dist/composables/language/index.d.ts +4 -0
- package/dist/composables/language/resolveTranslatedString.d.ts +3 -0
- package/dist/composables/language/resolveTranslationKey.d.ts +2 -0
- package/dist/composables/language/types.d.ts +1 -0
- package/dist/composables/language/useLanguage.d.ts +23 -0
- package/dist/composables/orders/index.d.ts +3 -0
- package/dist/composables/orders/useOrder.d.ts +3 -0
- package/dist/composables/orders/useOrderData.d.ts +9 -0
- package/dist/composables/orders/useOrdersData.d.ts +3 -0
- package/dist/composables/products/index.d.ts +1 -0
- package/dist/composables/products/useProductData.d.ts +8 -0
- package/dist/composables/shipments/index.d.ts +3 -0
- package/dist/composables/shipments/useShipment.d.ts +3 -0
- package/dist/composables/shipments/useShipmentData.d.ts +12 -0
- package/dist/composables/shipments/useShipmentsData.d.ts +2 -0
- package/dist/composables/useAdminConfig.d.ts +2 -0
- package/dist/composables/useAdminInstance.d.ts +2 -0
- package/dist/composables/useDigitalStampRanges.d.ts +9 -0
- package/dist/composables/useGlobalPdkAdmin.d.ts +2 -0
- package/dist/composables/useLoadMore.d.ts +14 -0
- package/dist/composables/useLoading.d.ts +10 -0
- package/dist/composables/useLogger.d.ts +2 -0
- package/dist/composables/useStoreContextQuery.d.ts +3 -0
- package/dist/composables/useStoreQuery.d.ts +4 -0
- package/dist/composables/useWeekdays.d.ts +9 -0
- package/dist/data/components.d.ts +195 -0
- package/dist/data/constants.d.ts +63 -0
- package/dist/data/endpoints.d.ts +5 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/view.d.ts +9 -0
- package/dist/deprecated.d.ts +6 -0
- package/dist/forms/createReturnsForm.d.ts +1 -0
- package/dist/forms/form-builder/builders/buildAfterUpdate.d.ts +3 -0
- package/dist/forms/form-builder/builders/buildFormStateWatcher.d.ts +3 -0
- package/dist/forms/form-builder/builders/index.d.ts +2 -0
- package/dist/forms/form-builder/conditions/index.d.ts +3 -0
- package/dist/forms/form-builder/conditions/validateIfCondition.d.ts +2 -0
- package/dist/forms/form-builder/conditions/validateIfConditions.d.ts +2 -0
- package/dist/forms/form-builder/conditions/validateIsTruthy.d.ts +2 -0
- package/dist/forms/form-builder/index.d.ts +5 -0
- package/dist/forms/form-builder/operations/executeCustomOperationHandlers.d.ts +2 -0
- package/dist/forms/form-builder/operations/executeOperation.d.ts +2 -0
- package/dist/forms/form-builder/operations/executeOperations.d.ts +2 -0
- package/dist/forms/form-builder/operations/executeSetPropOperation.d.ts +2 -0
- package/dist/forms/form-builder/operations/executeSetValueOperation.d.ts +2 -0
- package/dist/forms/form-builder/operations/index.d.ts +5 -0
- package/dist/forms/form-builder/operations/parseBuilders.d.ts +3 -0
- package/dist/forms/form-builder/types/FormCondition.types.d.ts +36 -0
- package/dist/forms/form-builder/types/FormOperations.types.d.ts +16 -0
- package/dist/forms/form-builder/types/SubOperationBuilder.types.d.ts +13 -0
- package/dist/forms/form-builder/types/common.types.d.ts +21 -0
- package/dist/forms/form-builder/types/index.d.ts +4 -0
- package/dist/forms/form-builder/utils/createPropSetter.d.ts +4 -0
- package/dist/forms/form-builder/utils/createValueGetter.d.ts +4 -0
- package/dist/forms/form-builder/utils/createValueSetter.d.ts +4 -0
- package/dist/forms/form-builder/utils/index.d.ts +4 -0
- package/dist/forms/formKeys.d.ts +10 -0
- package/dist/forms/helpers/addBulkEditNotification.d.ts +1 -0
- package/dist/forms/helpers/createDefaultOption.d.ts +3 -0
- package/dist/forms/helpers/createHasShipmentOptionWatcher.d.ts +3 -0
- package/dist/forms/helpers/createLabel.d.ts +1 -0
- package/dist/forms/helpers/defineFormField.d.ts +2 -0
- package/dist/forms/helpers/getCarrier.d.ts +3 -0
- package/dist/forms/helpers/getDeliveryTypes.d.ts +3 -0
- package/dist/forms/helpers/getFieldLabel.d.ts +2 -0
- package/dist/forms/helpers/getFormCarrierName.d.ts +2 -0
- package/dist/forms/helpers/getInsuranceOptions.d.ts +3 -0
- package/dist/forms/helpers/getPackageTypes.d.ts +3 -0
- package/dist/forms/helpers/hasPostNlAgeCheck.d.ts +2 -0
- package/dist/forms/helpers/hasShipmentOption.d.ts +3 -0
- package/dist/forms/helpers/index.d.ts +20 -0
- package/dist/forms/helpers/isPackageTypePackage.d.ts +2 -0
- package/dist/forms/helpers/isPackageTypePackageOrSmall.d.ts +2 -0
- package/dist/forms/helpers/isPackageTypeSmallPackage.d.ts +2 -0
- package/dist/forms/helpers/resolveFormComponent.d.ts +3 -0
- package/dist/forms/helpers/setFieldProp.d.ts +8 -0
- package/dist/forms/helpers/setPostNlAgeCheckSubtext.d.ts +2 -0
- package/dist/forms/helpers/triStateFieldIsEnabled.d.ts +2 -0
- package/dist/forms/helpers/updateFieldsDefaults.d.ts +6 -0
- package/dist/forms/index.d.ts +6 -0
- package/dist/forms/pluginSettings/createFormTab.d.ts +3 -0
- package/dist/forms/pluginSettings/createPluginSettingsForm.d.ts +4 -0
- package/dist/forms/pluginSettings/createPluginSettingsTabs.d.ts +4 -0
- package/dist/forms/pluginSettings/createPluginSettingsTabsComponent.d.ts +4 -0
- package/dist/forms/pluginSettings/generateFormFields.d.ts +8 -0
- package/dist/forms/pluginSettings/index.d.ts +6 -0
- package/dist/forms/pluginSettings/types.d.ts +13 -0
- package/dist/forms/shipmentOptions/createShipmentOptionsForm.d.ts +4 -0
- package/dist/forms/shipmentOptions/field.d.ts +34 -0
- package/dist/forms/shipmentOptions/fields/createAgeCheckField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createCarrierField.d.ts +4 -0
- package/dist/forms/shipmentOptions/fields/createDeliveryTypeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createDigitalStampRangeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createDirectReturnField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createHideSenderField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createInsuranceField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createLabelAmountField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createLargeFormatField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createOnlyRecipientField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createPackageTypeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createReceiptCodeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createRef.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createSameDayDeliveryField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createShipmentOptionField.d.ts +4 -0
- package/dist/forms/shipmentOptions/fields/createSignatureField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/index.d.ts +14 -0
- package/dist/forms/shipmentOptions/index.d.ts +4 -0
- package/dist/forms/shipmentOptions/types.d.ts +2 -0
- package/dist/index.d.ts +19 -0
- package/dist/pdk/PdkAdmin.d.ts +18 -0
- package/dist/pdk/boot.d.ts +3 -0
- package/dist/pdk/createAdminConfig.d.ts +2 -0
- package/dist/pdk/createPdkAdmin.d.ts +8 -0
- package/dist/pdk/createPdkAdminPlugin.d.ts +3 -0
- package/dist/pdk/fillShipmentsQueryData.d.ts +4 -0
- package/dist/pdk/index.d.ts +11 -0
- package/dist/pdk/instance/createInstanceContext.d.ts +5 -0
- package/dist/pdk/instance/createQueryClient.d.ts +2 -0
- package/dist/pdk/instance/index.d.ts +3 -0
- package/dist/pdk/instance/plugins/createContextPlugin.d.ts +2 -0
- package/dist/pdk/instance/plugins/createLoggerPlugin.d.ts +2 -0
- package/dist/pdk/instance/plugins/createRegisterComponentsPlugin.d.ts +5 -0
- package/dist/pdk/instance/plugins/createStorePlugin.d.ts +2 -0
- package/dist/pdk/instance/plugins/createVueQueryPlugin.d.ts +5 -0
- package/dist/pdk/instance/plugins/index.d.ts +6 -0
- package/dist/pdk/instance/plugins/plugins.types.d.ts +3 -0
- package/dist/pdk/renderMap.d.ts +3 -0
- package/dist/pdk/sendBootEvent.d.ts +3 -0
- package/dist/pdk/setupAdminApp.d.ts +3 -0
- package/dist/pdk/testIdDirective.d.ts +5 -0
- package/dist/sdk/PdkFetchClient.d.ts +11 -0
- package/dist/sdk/composables/api/index.d.ts +1 -0
- package/dist/sdk/composables/api/useFetchCarrier.d.ts +2 -0
- package/dist/sdk/composables/index.d.ts +3 -0
- package/dist/sdk/composables/useMyParcelApi.d.ts +5 -0
- package/dist/sdk/composables/usePdkAdminApi.d.ts +6 -0
- package/dist/sdk/endpoints/abstractPdkEndpoint.d.ts +7 -0
- package/dist/sdk/endpoints/index.d.ts +1 -0
- package/dist/sdk/index.d.ts +3 -0
- package/dist/services/actions/createAction.d.ts +4 -0
- package/dist/services/actions/createActionContext.d.ts +3 -0
- package/dist/services/actions/downloadFile.d.ts +4 -0
- package/dist/services/actions/getActionIdentifier.d.ts +2 -0
- package/dist/services/actions/index.d.ts +4 -0
- package/dist/services/addErrorToNotifications.d.ts +2 -0
- package/dist/services/context/getElementContext.d.ts +2 -0
- package/dist/services/context/index.d.ts +1 -0
- package/dist/services/createNotification.d.ts +5 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/instantiateAction.d.ts +2 -0
- package/dist/services/instantiateActions.d.ts +8 -0
- package/dist/services/logger.d.ts +19 -0
- package/dist/services/mutations/getCallbackForMutationMode.d.ts +4 -0
- package/dist/services/mutations/getModalMutationOptions.d.ts +2 -0
- package/dist/services/mutations/index.d.ts +3 -0
- package/dist/services/mutations/mutationMode.d.ts +4 -0
- package/dist/services/print/index.d.ts +1 -0
- package/dist/services/print/openPdfInNewWindow.d.ts +4 -0
- package/dist/stores/createQueryCacheKey.d.ts +3 -0
- package/dist/stores/index.d.ts +6 -0
- package/dist/stores/types.d.ts +13 -0
- package/dist/stores/useActionStore.d.ts +25 -0
- package/dist/stores/useModalStore.d.ts +16 -0
- package/dist/stores/useNotificationStore.d.ts +60 -0
- package/dist/stores/useQueryStore.d.ts +77 -0
- package/dist/symbols.d.ts +5 -0
- package/dist/testing.d.ts +1 -0
- package/dist/types/actions/actions.types.d.ts +31 -0
- package/dist/types/actions/endpoints.types.d.ts +9 -0
- package/dist/types/actions/index.d.ts +4 -0
- package/dist/types/actions/parameters.types.d.ts +55 -0
- package/dist/types/actions/response.types.d.ts +7 -0
- package/dist/types/actions.types.d.ts +45 -0
- package/dist/types/admin.types.d.ts +26 -0
- package/dist/types/common.types.d.ts +53 -0
- package/dist/types/components-form.types.d.ts +107 -0
- package/dist/types/components.types.d.ts +273 -0
- package/dist/types/configuration.types.d.ts +95 -0
- package/dist/types/context.types.d.ts +20 -0
- package/dist/types/endpoints.types.d.ts +7 -0
- package/dist/types/form.types.d.ts +39 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/language.types.d.ts +9 -0
- package/dist/types/sdk.types.d.ts +155 -0
- package/dist/utils/booleanToTriState.d.ts +2 -0
- package/dist/utils/convertDotNotationToObject.d.ts +1 -0
- package/dist/utils/createAssetUrl.d.ts +1 -0
- package/dist/utils/createClasses.d.ts +8 -0
- package/dist/utils/createObjectWithKeys.d.ts +3 -0
- package/dist/utils/decodeHtmlEntities.d.ts +7 -0
- package/dist/utils/downloadBlob.d.ts +1 -0
- package/dist/utils/downloadFileFromUrl.d.ts +1 -0
- package/dist/utils/encodeArrayParameter.d.ts +2 -0
- package/dist/utils/extendAdminInstance.d.ts +2 -0
- package/dist/utils/fakeLinkClick.d.ts +4 -0
- package/dist/utils/forms/createFormElement.d.ts +3 -0
- package/dist/utils/forms/createShipmentFormName.d.ts +1 -0
- package/dist/utils/forms/formToBody.d.ts +2 -0
- package/dist/utils/forms/generateFieldId.d.ts +3 -0
- package/dist/utils/forms/index.d.ts +4 -0
- package/dist/utils/generateLabelFilename.d.ts +3 -0
- package/dist/utils/getOrderId.d.ts +3 -0
- package/dist/utils/getOrderShipmentIds.d.ts +2 -0
- package/dist/utils/index.d.ts +22 -0
- package/dist/utils/openUrlInNewTab.d.ts +1 -0
- package/dist/utils/prefixComponent.d.ts +3 -0
- package/dist/utils/query/index.d.ts +3 -0
- package/dist/utils/query/setQueryData.d.ts +2 -0
- package/dist/utils/query/setQueryOrder.d.ts +10 -0
- package/dist/utils/query/setQueryShipment.d.ts +3 -0
- package/dist/utils/resolveCarrier.d.ts +1 -0
- package/dist/utils/translations/getDeliveryTypeTranslation.d.ts +2 -0
- package/dist/utils/translations/getDynamicTranslation.d.ts +1 -0
- package/dist/utils/translations/getPackageTypeTranslation.d.ts +2 -0
- package/dist/utils/translations/index.d.ts +4 -0
- package/dist/utils/translations/translateSelectOption.d.ts +3 -0
- package/dist/utils/triStateToBoolean.d.ts +2 -0
- package/dist/utils/unprefixComponent.d.ts +3 -0
- package/dist/utils/validateId.d.ts +2 -0
- package/dist/views/ChildProductSettings.vue.d.ts +2 -0
- package/dist/views/Modals.vue.d.ts +2 -0
- package/dist/views/Notifications.vue.d.ts +2 -0
- package/dist/views/OrderBox.vue.d.ts +2 -0
- package/dist/views/OrderListItem.vue.d.ts +2 -0
- package/dist/views/PluginSettings.vue.d.ts +2 -0
- package/dist/views/ProductSettings.vue.d.ts +35 -0
- package/dist/views/integrated/OrderBoxView.vue.d.ts +12 -0
- package/dist/views/integrated/OrderListItemView.vue.d.ts +12 -0
- package/dist/views/integrated/index.d.ts +7 -0
- package/package.json +70 -0
- package/src/__tests__/__snapshots__/exports.spec.ts.snap +195 -0
- package/src/__tests__/doComponentTestSetup.ts +54 -0
- package/src/__tests__/doComponentTestTeardown.ts +6 -0
- package/src/__tests__/exports.spec.ts +13 -0
- package/src/__tests__/getElementContext.spec.ts +18 -0
- package/src/__tests__/index.ts +3 -0
- package/src/__tests__/mocks/index.ts +14 -0
- package/src/__tests__/mocks/mockDefaultAccount.ts +18 -0
- package/src/__tests__/mocks/mockDefaultAppConfig.ts +21 -0
- package/src/__tests__/mocks/mockDefaultAppInfo.ts +12 -0
- package/src/__tests__/mocks/mockDefaultCarriers.ts +4 -0
- package/src/__tests__/mocks/mockDefaultConfig.ts +11 -0
- package/src/__tests__/mocks/mockDefaultDynamicContext.ts +17 -0
- package/src/__tests__/mocks/mockDefaultEndpoints.ts +19 -0
- package/src/__tests__/mocks/mockDefaultGlobalContext.ts +21 -0
- package/src/__tests__/mocks/mockDefaultLogger.ts +4 -0
- package/src/__tests__/mocks/mockDefaultPlatform.ts +14 -0
- package/src/__tests__/mocks/mockDefaultPluginSettings.ts +15 -0
- package/src/__tests__/mocks/mockDefaultPrintOptionsView.ts +13 -0
- package/src/__tests__/mocks/mockDefaultShop.ts +20 -0
- package/src/__tests__/mocks/mockDefaultTranslations.ts +4 -0
- package/src/__tests__/render.spec.ts +53 -0
- package/src/__tests__/utils/mockLinkElement.ts +20 -0
- package/src/actions/composables/index.ts +2 -0
- package/src/actions/composables/mutations/account/index.ts +2 -0
- package/src/actions/composables/mutations/account/useDeleteAccountMutation.ts +30 -0
- package/src/actions/composables/mutations/account/useUpdateAccountMutation.ts +60 -0
- package/src/actions/composables/mutations/debug/index.ts +3 -0
- package/src/actions/composables/mutations/debug/useDownloadLogsMutation.ts +8 -0
- package/src/actions/composables/mutations/debug/useSwitchToAcceptanceApiMutation.ts +10 -0
- package/src/actions/composables/mutations/debug/useSwitchToProductionApiMutation.ts +10 -0
- package/src/actions/composables/mutations/index.ts +7 -0
- package/src/actions/composables/mutations/orders/index.ts +3 -0
- package/src/actions/composables/mutations/orders/useExportOrdersMutation.ts +51 -0
- package/src/actions/composables/mutations/orders/usePrintOrdersMutation.ts +23 -0
- package/src/actions/composables/mutations/orders/useUpdateOrdersMutation.ts +36 -0
- package/src/actions/composables/mutations/settings/index.ts +2 -0
- package/src/actions/composables/mutations/settings/useUpdatePluginSettingsMutation.ts +16 -0
- package/src/actions/composables/mutations/settings/useUpdateProductSettingsMutation.ts +22 -0
- package/src/actions/composables/mutations/shipments/index.ts +4 -0
- package/src/actions/composables/mutations/shipments/useDeleteShipmentsMutation.ts +65 -0
- package/src/actions/composables/mutations/shipments/useExportReturnMutation.ts +36 -0
- package/src/actions/composables/mutations/shipments/usePrintShipmentsMutation.ts +39 -0
- package/src/actions/composables/mutations/shipments/useUpdateShipmentsMutation.ts +36 -0
- package/src/actions/composables/mutations/usePdkMutation.ts +41 -0
- package/src/actions/composables/mutations/webhooks/index.ts +2 -0
- package/src/actions/composables/mutations/webhooks/useCreateWebhooksMutation.ts +20 -0
- package/src/actions/composables/mutations/webhooks/useDeleteWebhooksMutation.ts +20 -0
- package/src/actions/composables/queries/account/index.ts +1 -0
- package/src/actions/composables/queries/account/useFetchContextQuery.ts +43 -0
- package/src/actions/composables/queries/index.ts +6 -0
- package/src/actions/composables/queries/orders/index.ts +1 -0
- package/src/actions/composables/queries/orders/useFetchOrdersQuery.ts +35 -0
- package/src/actions/composables/queries/products/index.ts +1 -0
- package/src/actions/composables/queries/products/useFetchProductsQuery.ts +20 -0
- package/src/actions/composables/queries/queryKeys.ts +3 -0
- package/src/actions/composables/queries/shipments/index.ts +1 -0
- package/src/actions/composables/queries/shipments/useFetchShipmentsQuery.ts +44 -0
- package/src/actions/composables/queries/webhooks/index.ts +1 -0
- package/src/actions/composables/queries/webhooks/useFetchWebhooksQuery.ts +24 -0
- package/src/actions/defineAction.ts +10 -0
- package/src/actions/definitions/account.ts +39 -0
- package/src/actions/definitions/context.ts +17 -0
- package/src/actions/definitions/debug.ts +39 -0
- package/src/actions/definitions/index.ts +8 -0
- package/src/actions/definitions/modal.ts +32 -0
- package/src/actions/definitions/orders.ts +128 -0
- package/src/actions/definitions/settings.ts +11 -0
- package/src/actions/definitions/shipments.ts +61 -0
- package/src/actions/definitions/webhooks.ts +25 -0
- package/src/actions/executors/createHandlerWithParameters.ts +29 -0
- package/src/actions/executors/createMutationHandler.ts +10 -0
- package/src/actions/executors/createOrdersMutationHandler.ts +12 -0
- package/src/actions/executors/createQueryHandler.ts +19 -0
- package/src/actions/executors/createShipmentsMutationHandler.ts +12 -0
- package/src/actions/executors/doMutate.ts +16 -0
- package/src/actions/executors/executeAction.ts +35 -0
- package/src/actions/executors/executeAfterHandle.ts +23 -0
- package/src/actions/executors/executeBeforeHandle.ts +29 -0
- package/src/actions/executors/executeHandler.ts +34 -0
- package/src/actions/executors/executeNextAction.ts +34 -0
- package/src/actions/executors/index.ts +14 -0
- package/src/actions/executors/resolveOrderParameters.ts +19 -0
- package/src/actions/executors/resolveQuerySuffix.ts +10 -0
- package/src/actions/executors/types.ts +45 -0
- package/src/actions/index.ts +6 -0
- package/src/actions/print/index.ts +3 -0
- package/src/actions/print/openOrPrintPdf.ts +16 -0
- package/src/actions/print/resolvePrintParameters.ts +24 -0
- package/src/actions/print/waitForLabelPrompt.ts +39 -0
- package/src/actions/stopActionHandler.ts +1 -0
- package/src/components/OrderBox/OrderShipmentsTable.vue +53 -0
- package/src/components/OrderBox/OrderShipmentsTableRow.vue +81 -0
- package/src/components/OrderBox/ShipmentOptionsBox.vue +74 -0
- package/src/components/OrderBox/ShipmentTableBox.vue +51 -0
- package/src/components/OrderListItem/OrderModeOrderListItem.vue +45 -0
- package/src/components/OrderListItem/ShipmentLabel.vue +44 -0
- package/src/components/OrderListItem/ShipmentModeOrderListItem.vue +67 -0
- package/src/components/PluginSettings/AccountSettings.vue +81 -0
- package/src/components/PluginSettings/DebugOptions.vue +89 -0
- package/src/components/PluginSettings/EditApiKeyForm.vue +89 -0
- package/src/components/PluginSettings/PluginSettingsForms.vue +56 -0
- package/src/components/PluginSettings/WebhooksStatus.vue +73 -0
- package/src/components/PluginSettings/createUpdateAccountSettingsValidator.ts +21 -0
- package/src/components/common/ActionButton.vue +53 -0
- package/src/components/common/BulkSelectCheckbox.vue +46 -0
- package/src/components/common/CarrierLogo.vue +14 -0
- package/src/components/common/DateRelative.vue +20 -0
- package/src/components/common/DeliveryOptionsDeliveryType.vue +23 -0
- package/src/components/common/DeliveryOptionsExcerpt.vue +39 -0
- package/src/components/common/DeliveryOptionsExcerptCarrierName.vue +21 -0
- package/src/components/common/DeliveryOptionsPackageType.vue +30 -0
- package/src/components/common/DigitalStampWeightRange.vue +14 -0
- package/src/components/common/NotificationContainer.vue +35 -0
- package/src/components/common/PackageType.vue +16 -0
- package/src/components/common/PlainElement.ts +8 -0
- package/src/components/common/ResetButton.vue +26 -0
- package/src/components/common/ReturnsForm.vue +31 -0
- package/src/components/common/ShipmentBarcode.vue +41 -0
- package/src/components/common/ShipmentOptionsForm.vue +22 -0
- package/src/components/common/ShipmentStatus.vue +23 -0
- package/src/components/common/StatusIndicator.vue +46 -0
- package/src/components/common/SubmitButton.vue +30 -0
- package/src/components/common/TabNavigation.vue +134 -0
- package/src/components/common/index.ts +39 -0
- package/src/components/index.ts +1 -0
- package/src/components/modals/PrintOptionsModal.vue +32 -0
- package/src/components/modals/PrintOptionsModalForm.vue +33 -0
- package/src/components/modals/ShipmentOptionsModal.vue +56 -0
- package/src/components/modals/ShipmentOptionsModalForm.vue +21 -0
- package/src/composables/components/index.ts +15 -0
- package/src/composables/components/useBulkSelectCheckbox.ts +39 -0
- package/src/composables/components/useCheckboxGroupContext.ts +10 -0
- package/src/composables/components/useDropOffInputContext.ts +74 -0
- package/src/composables/components/useDropdownButtonContext.ts +42 -0
- package/src/composables/components/useElementContext.ts +27 -0
- package/src/composables/components/useElementOptions.ts +48 -0
- package/src/composables/components/useInputWithOptionsContext.ts +46 -0
- package/src/composables/components/useModalElementContext.ts +27 -0
- package/src/composables/components/useMultiSelectInputContext.ts +11 -0
- package/src/composables/components/useRadioGroupContext.ts +56 -0
- package/src/composables/components/useSelectInputContext.ts +11 -0
- package/src/composables/components/useShippingMethodsInputContext.spec.ts +93 -0
- package/src/composables/components/useShippingMethodsInputContext.ts +130 -0
- package/src/composables/components/useTableContext.ts +17 -0
- package/src/composables/components/useToggleInputContext.ts +35 -0
- package/src/composables/components/useTriStateInputContext.ts +117 -0
- package/src/composables/context/index.ts +7 -0
- package/src/composables/context/useAppInfo.ts +6 -0
- package/src/composables/context/useContext.ts +18 -0
- package/src/composables/context/useGlobalContext.ts +7 -0
- package/src/composables/context/useInstanceContext.ts +15 -0
- package/src/composables/context/useModalContext.ts +52 -0
- package/src/composables/context/useModalOrder.ts +13 -0
- package/src/composables/context/usePluginSettings.ts +12 -0
- package/src/composables/formatter/default/createCurrencyFormat.ts +6 -0
- package/src/composables/formatter/default/createLongDateFormat.ts +7 -0
- package/src/composables/formatter/default/createRelativeTimeFormat.ts +5 -0
- package/src/composables/formatter/default/defaultCurrencyFormatters.ts +16 -0
- package/src/composables/formatter/default/defaultDateFormatters.ts +83 -0
- package/src/composables/formatter/default/index.ts +6 -0
- package/src/composables/formatter/default/parseDate.ts +12 -0
- package/src/composables/formatter/formatter.types.ts +32 -0
- package/src/composables/formatter/index.ts +4 -0
- package/src/composables/formatter/useFormatter.spec.ts +147 -0
- package/src/composables/formatter/useFormatter.ts +51 -0
- package/src/composables/formatter/useLocalizedFormatter.ts +11 -0
- package/src/composables/index.ts +17 -0
- package/src/composables/language/index.ts +4 -0
- package/src/composables/language/resolveTranslatedString.ts +30 -0
- package/src/composables/language/resolveTranslationKey.ts +5 -0
- package/src/composables/language/types.ts +1 -0
- package/src/composables/language/useLanguage.spec.ts +124 -0
- package/src/composables/language/useLanguage.ts +117 -0
- package/src/composables/orders/index.ts +3 -0
- package/src/composables/orders/useOrder.ts +8 -0
- package/src/composables/orders/useOrderData.ts +29 -0
- package/src/composables/orders/useOrdersData.ts +14 -0
- package/src/composables/products/index.ts +1 -0
- package/src/composables/products/useProductData.ts +23 -0
- package/src/composables/shipments/index.ts +3 -0
- package/src/composables/shipments/useShipment.ts +7 -0
- package/src/composables/shipments/useShipmentData.ts +52 -0
- package/src/composables/shipments/useShipmentsData.ts +5 -0
- package/src/composables/useAdminConfig.ts +8 -0
- package/src/composables/useAdminInstance.ts +13 -0
- package/src/composables/useDigitalStampRanges.ts +38 -0
- package/src/composables/useGlobalPdkAdmin.ts +13 -0
- package/src/composables/useLoadMore.spec.ts +69 -0
- package/src/composables/useLoadMore.ts +46 -0
- package/src/composables/useLoading.spec.ts +20 -0
- package/src/composables/useLoading.ts +18 -0
- package/src/composables/useLogger.ts +8 -0
- package/src/composables/useStoreContextQuery.ts +9 -0
- package/src/composables/useStoreQuery.ts +9 -0
- package/src/composables/useWeekdays.ts +24 -0
- package/src/data/components.ts +289 -0
- package/src/data/constants.ts +76 -0
- package/src/data/endpoints.ts +28 -0
- package/src/data/index.ts +4 -0
- package/src/data/view.ts +9 -0
- package/src/deprecated.ts +9 -0
- package/src/forms/createReturnsForm.ts +8 -0
- package/src/forms/form-builder/builders/buildAfterUpdate.spec.ts +48 -0
- package/src/forms/form-builder/builders/buildAfterUpdate.ts +26 -0
- package/src/forms/form-builder/builders/buildFormStateWatcher.spec.ts +206 -0
- package/src/forms/form-builder/builders/buildFormStateWatcher.ts +15 -0
- package/src/forms/form-builder/builders/index.ts +2 -0
- package/src/forms/form-builder/conditions/index.ts +3 -0
- package/src/forms/form-builder/conditions/validateIfCondition.spec.ts +69 -0
- package/src/forms/form-builder/conditions/validateIfCondition.ts +43 -0
- package/src/forms/form-builder/conditions/validateIfConditions.spec.ts +238 -0
- package/src/forms/form-builder/conditions/validateIfConditions.ts +31 -0
- package/src/forms/form-builder/conditions/validateIsTruthy.ts +15 -0
- package/src/forms/form-builder/index.ts +5 -0
- package/src/forms/form-builder/operations/executeCustomOperationHandlers.ts +18 -0
- package/src/forms/form-builder/operations/executeOperation.ts +27 -0
- package/src/forms/form-builder/operations/executeOperations.spec.ts +63 -0
- package/src/forms/form-builder/operations/executeOperations.ts +10 -0
- package/src/forms/form-builder/operations/executeSetPropOperation.spec.ts +164 -0
- package/src/forms/form-builder/operations/executeSetPropOperation.ts +15 -0
- package/src/forms/form-builder/operations/executeSetValueOperation.spec.ts +203 -0
- package/src/forms/form-builder/operations/executeSetValueOperation.ts +15 -0
- package/src/forms/form-builder/operations/index.ts +5 -0
- package/src/forms/form-builder/operations/parseBuilders.spec.ts +70 -0
- package/src/forms/form-builder/operations/parseBuilders.ts +39 -0
- package/src/forms/form-builder/types/FormCondition.types.ts +57 -0
- package/src/forms/form-builder/types/FormOperations.types.ts +21 -0
- package/src/forms/form-builder/types/SubOperationBuilder.types.ts +18 -0
- package/src/forms/form-builder/types/common.types.ts +35 -0
- package/src/forms/form-builder/types/index.ts +4 -0
- package/src/forms/form-builder/utils/createPropSetter.ts +19 -0
- package/src/forms/form-builder/utils/createValueGetter.ts +16 -0
- package/src/forms/form-builder/utils/createValueSetter.ts +21 -0
- package/src/forms/form-builder/utils/index.ts +6 -0
- package/src/forms/formKeys.ts +28 -0
- package/src/forms/helpers/addBulkEditNotification.ts +21 -0
- package/src/forms/helpers/createDefaultOption.ts +12 -0
- package/src/forms/helpers/createHasShipmentOptionWatcher.ts +12 -0
- package/src/forms/helpers/createLabel.ts +3 -0
- package/src/forms/helpers/defineFormField.ts +19 -0
- package/src/forms/helpers/getCarrier.ts +11 -0
- package/src/forms/helpers/getDeliveryTypes.ts +19 -0
- package/src/forms/helpers/getFieldLabel.ts +6 -0
- package/src/forms/helpers/getFormCarrierName.ts +7 -0
- package/src/forms/helpers/getInsuranceOptions.ts +23 -0
- package/src/forms/helpers/getPackageTypes.ts +19 -0
- package/src/forms/helpers/hasPostNlAgeCheck.ts +11 -0
- package/src/forms/helpers/hasShipmentOption.ts +8 -0
- package/src/forms/helpers/index.ts +20 -0
- package/src/forms/helpers/isPackageTypePackage.ts +7 -0
- package/src/forms/helpers/isPackageTypePackageOrSmall.ts +7 -0
- package/src/forms/helpers/isPackageTypeSmallPackage.ts +7 -0
- package/src/forms/helpers/resolveFormComponent.ts +12 -0
- package/src/forms/helpers/setFieldProp.ts +32 -0
- package/src/forms/helpers/setPostNlAgeCheckSubtext.ts +17 -0
- package/src/forms/helpers/triStateFieldIsEnabled.ts +20 -0
- package/src/forms/helpers/updateFieldsDefaults.ts +26 -0
- package/src/forms/index.ts +6 -0
- package/src/forms/pluginSettings/__snapshots__/generateFormFields.spec.ts.snap +37 -0
- package/src/forms/pluginSettings/createFormTab.ts +19 -0
- package/src/forms/pluginSettings/createPluginSettingsForm.ts +39 -0
- package/src/forms/pluginSettings/createPluginSettingsTabs.ts +35 -0
- package/src/forms/pluginSettings/createPluginSettingsTabsComponent.ts +42 -0
- package/src/forms/pluginSettings/generateFormFields.spec.ts +54 -0
- package/src/forms/pluginSettings/generateFormFields.ts +50 -0
- package/src/forms/pluginSettings/index.ts +6 -0
- package/src/forms/pluginSettings/types.ts +15 -0
- package/src/forms/shipmentOptions/createShipmentOptionsForm.ts +83 -0
- package/src/forms/shipmentOptions/field.ts +90 -0
- package/src/forms/shipmentOptions/fields/createAgeCheckField.ts +33 -0
- package/src/forms/shipmentOptions/fields/createCarrierField.ts +83 -0
- package/src/forms/shipmentOptions/fields/createDeliveryTypeField.ts +18 -0
- package/src/forms/shipmentOptions/fields/createDigitalStampRangeField.ts +48 -0
- package/src/forms/shipmentOptions/fields/createDirectReturnField.ts +8 -0
- package/src/forms/shipmentOptions/fields/createHideSenderField.ts +8 -0
- package/src/forms/shipmentOptions/fields/createInsuranceField.ts +31 -0
- package/src/forms/shipmentOptions/fields/createLabelAmountField.ts +20 -0
- package/src/forms/shipmentOptions/fields/createLargeFormatField.ts +8 -0
- package/src/forms/shipmentOptions/fields/createOnlyRecipientField.ts +21 -0
- package/src/forms/shipmentOptions/fields/createPackageTypeField.ts +18 -0
- package/src/forms/shipmentOptions/fields/createReceiptCodeField.ts +21 -0
- package/src/forms/shipmentOptions/fields/createRef.ts +6 -0
- package/src/forms/shipmentOptions/fields/createSameDayDeliveryField.ts +8 -0
- package/src/forms/shipmentOptions/fields/createShipmentOptionField.ts +25 -0
- package/src/forms/shipmentOptions/fields/createSignatureField.ts +11 -0
- package/src/forms/shipmentOptions/fields/index.ts +14 -0
- package/src/forms/shipmentOptions/index.ts +4 -0
- package/src/forms/shipmentOptions/types.ts +3 -0
- package/src/index.ts +114 -0
- package/src/pdk/PdkAdmin.ts +82 -0
- package/src/pdk/boot.ts +14 -0
- package/src/pdk/createAdminConfig.ts +29 -0
- package/src/pdk/createPdkAdmin.ts +39 -0
- package/src/pdk/createPdkAdminPlugin.ts +18 -0
- package/src/pdk/fillShipmentsQueryData.ts +44 -0
- package/src/pdk/index.ts +11 -0
- package/src/pdk/instance/createInstanceContext.ts +23 -0
- package/src/pdk/instance/createQueryClient.ts +31 -0
- package/src/pdk/instance/index.ts +3 -0
- package/src/pdk/instance/plugins/createContextPlugin.ts +17 -0
- package/src/pdk/instance/plugins/createLoggerPlugin.ts +13 -0
- package/src/pdk/instance/plugins/createRegisterComponentsPlugin.spec.ts +58 -0
- package/src/pdk/instance/plugins/createRegisterComponentsPlugin.ts +87 -0
- package/src/pdk/instance/plugins/createStorePlugin.ts +23 -0
- package/src/pdk/instance/plugins/createVueQueryPlugin.ts +48 -0
- package/src/pdk/instance/plugins/index.ts +6 -0
- package/src/pdk/instance/plugins/plugins.types.ts +4 -0
- package/src/pdk/renderMap.ts +27 -0
- package/src/pdk/sendBootEvent.ts +12 -0
- package/src/pdk/setupAdminApp.ts +20 -0
- package/src/pdk/testIdDirective.spec.ts +42 -0
- package/src/pdk/testIdDirective.ts +28 -0
- package/src/sdk/PdkFetchClient.ts +70 -0
- package/src/sdk/composables/api/index.ts +1 -0
- package/src/sdk/composables/api/useFetchCarrier.ts +23 -0
- package/src/sdk/composables/index.ts +3 -0
- package/src/sdk/composables/useMyParcelApi.ts +18 -0
- package/src/sdk/composables/usePdkAdminApi.ts +34 -0
- package/src/sdk/endpoints/abstractPdkEndpoint.ts +10 -0
- package/src/sdk/endpoints/index.ts +1 -0
- package/src/sdk/index.ts +3 -0
- package/src/services/actions/createAction.ts +24 -0
- package/src/services/actions/createActionContext.ts +49 -0
- package/src/services/actions/downloadFile.ts +16 -0
- package/src/services/actions/getActionIdentifier.ts +7 -0
- package/src/services/actions/index.ts +4 -0
- package/src/services/addErrorToNotifications.ts +35 -0
- package/src/services/context/getElementContext.ts +17 -0
- package/src/services/context/index.ts +1 -0
- package/src/services/createNotification.ts +35 -0
- package/src/services/index.ts +9 -0
- package/src/services/instantiateAction.ts +11 -0
- package/src/services/instantiateActions.ts +14 -0
- package/src/services/logger.spec.ts +70 -0
- package/src/services/logger.ts +118 -0
- package/src/services/mutations/getCallbackForMutationMode.ts +18 -0
- package/src/services/mutations/getModalMutationOptions.ts +24 -0
- package/src/services/mutations/index.ts +3 -0
- package/src/services/mutations/mutationMode.ts +4 -0
- package/src/services/print/index.ts +1 -0
- package/src/services/print/openPdfInNewWindow.ts +11 -0
- package/src/stores/createQueryCacheKey.ts +6 -0
- package/src/stores/index.ts +6 -0
- package/src/stores/types.ts +35 -0
- package/src/stores/useActionStore.ts +94 -0
- package/src/stores/useModalStore.ts +65 -0
- package/src/stores/useNotificationStore.ts +65 -0
- package/src/stores/useQueryStore.ts +184 -0
- package/src/symbols.ts +7 -0
- package/src/testing.ts +1 -0
- package/src/types/actions/actions.types.ts +42 -0
- package/src/types/actions/endpoints.types.ts +32 -0
- package/src/types/actions/index.ts +4 -0
- package/src/types/actions/parameters.types.ts +80 -0
- package/src/types/actions/response.types.ts +12 -0
- package/src/types/actions.types.ts +57 -0
- package/src/types/admin.types.ts +47 -0
- package/src/types/common.types.ts +66 -0
- package/src/types/components-form.types.ts +183 -0
- package/src/types/components.types.ts +349 -0
- package/src/types/configuration.types.ts +116 -0
- package/src/types/context.types.ts +25 -0
- package/src/types/endpoints.types.ts +17 -0
- package/src/types/form.types.ts +65 -0
- package/src/types/index.ts +12 -0
- package/src/types/language.types.ts +12 -0
- package/src/types/sdk.types.ts +213 -0
- package/src/utils/booleanToTriState.spec.ts +13 -0
- package/src/utils/booleanToTriState.ts +5 -0
- package/src/utils/convertDotNotationToObject.ts +15 -0
- package/src/utils/createAssetUrl.ts +9 -0
- package/src/utils/createClasses.ts +18 -0
- package/src/utils/createObjectWithKeys.ts +10 -0
- package/src/utils/decodeHtmlEntities.ts +11 -0
- package/src/utils/downloadBlob.ts +9 -0
- package/src/utils/downloadFileFromUrl.spec.ts +29 -0
- package/src/utils/downloadFileFromUrl.ts +5 -0
- package/src/utils/encodeArrayParameter.ts +6 -0
- package/src/utils/extendAdminInstance.ts +10 -0
- package/src/utils/fakeLinkClick.ts +17 -0
- package/src/utils/forms/createFormElement.ts +20 -0
- package/src/utils/forms/createShipmentFormName.ts +9 -0
- package/src/utils/forms/formToBody.ts +16 -0
- package/src/utils/forms/generateFieldId.ts +17 -0
- package/src/utils/forms/index.ts +4 -0
- package/src/utils/generateLabelFilename.spec.ts +24 -0
- package/src/utils/generateLabelFilename.ts +26 -0
- package/src/utils/getOrderId.ts +12 -0
- package/src/utils/getOrderShipmentIds.ts +12 -0
- package/src/utils/index.ts +23 -0
- package/src/utils/openUrlInNewTab.spec.ts +29 -0
- package/src/utils/openUrlInNewTab.ts +5 -0
- package/src/utils/prefixComponent.spec.ts +15 -0
- package/src/utils/prefixComponent.ts +10 -0
- package/src/utils/query/index.ts +3 -0
- package/src/utils/query/setQueryData.ts +8 -0
- package/src/utils/query/setQueryOrder.ts +26 -0
- package/src/utils/query/setQueryShipment.ts +8 -0
- package/src/utils/resolveCarrier.spec.ts +11 -0
- package/src/utils/resolveCarrier.ts +3 -0
- package/src/utils/translations/getDeliveryTypeTranslation.ts +5 -0
- package/src/utils/translations/getDynamicTranslation.ts +7 -0
- package/src/utils/translations/getPackageTypeTranslation.ts +5 -0
- package/src/utils/translations/index.ts +4 -0
- package/src/utils/translations/translateSelectOption.ts +15 -0
- package/src/utils/triStateToBoolean.spec.ts +13 -0
- package/src/utils/triStateToBoolean.ts +5 -0
- package/src/utils/unprefixComponent.spec.ts +13 -0
- package/src/utils/unprefixComponent.ts +6 -0
- package/src/utils/validateId.spec.ts +20 -0
- package/src/utils/validateId.ts +16 -0
- package/src/views/ChildProductSettings.vue +14 -0
- package/src/views/Modals.vue +22 -0
- package/src/views/Notifications.vue +9 -0
- package/src/views/OrderBox.vue +32 -0
- package/src/views/OrderListItem.vue +52 -0
- package/src/views/PluginSettings.vue +43 -0
- package/src/views/ProductSettings.vue +76 -0
- package/src/views/integrated/OrderBoxView.vue +20 -0
- package/src/views/integrated/OrderListItemView.vue +20 -0
- package/src/views/integrated/index.ts +13 -0
- package/src/vue-form-builder.d.ts +14 -0
- package/src/vue.shims.d.ts +11 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {type Component, defineComponent, h} from 'vue';
|
|
2
|
+
import {type Plugin} from '@myparcel-dev/pdk-common';
|
|
3
|
+
import {AdminView, HASH_SEPARATOR} from '../../data';
|
|
4
|
+
import {TabNavigation} from '../../components';
|
|
5
|
+
import {type PluginSettingsTabsContext} from './types';
|
|
6
|
+
import {createPluginSettingsForm} from './createPluginSettingsForm';
|
|
7
|
+
import {createFormTab} from './createFormTab';
|
|
8
|
+
|
|
9
|
+
export const createPluginSettingsTabsComponent = (
|
|
10
|
+
id: string,
|
|
11
|
+
view: Plugin.SettingsView,
|
|
12
|
+
context: PluginSettingsTabsContext,
|
|
13
|
+
): Component =>
|
|
14
|
+
defineComponent({
|
|
15
|
+
name: `${AdminView.PluginSettings}-${id}`,
|
|
16
|
+
|
|
17
|
+
setup: () => {
|
|
18
|
+
return {
|
|
19
|
+
tabs: (view.children ?? []).map((subview) => {
|
|
20
|
+
const {subtext, description, id: subviewId, title, titleSuffix} = subview;
|
|
21
|
+
|
|
22
|
+
return createFormTab({
|
|
23
|
+
name: `${id}.${subviewId}`,
|
|
24
|
+
label: title,
|
|
25
|
+
labelSuffix: titleSuffix,
|
|
26
|
+
form: createPluginSettingsForm(`${id}.${subviewId}`, subview, context),
|
|
27
|
+
description,
|
|
28
|
+
subtext,
|
|
29
|
+
});
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
render() {
|
|
35
|
+
return h('div', [
|
|
36
|
+
h(TabNavigation, {
|
|
37
|
+
hashPrefix: `${view.id}${HASH_SEPARATOR}`,
|
|
38
|
+
tabs: this.tabs,
|
|
39
|
+
}),
|
|
40
|
+
]);
|
|
41
|
+
},
|
|
42
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
import {type Plugin} from '@myparcel-dev/pdk-common';
|
|
3
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
4
|
+
import {AdminComponent} from '../../data';
|
|
5
|
+
import {generateFormFields} from './generateFormFields';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
const removeRef: any = (field: InteractiveElementConfiguration) => {
|
|
9
|
+
const {ref, ...rest} = field;
|
|
10
|
+
return rest;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('generateFormFields', () => {
|
|
14
|
+
it('should generate fields from a view', () => {
|
|
15
|
+
const view: Plugin.SettingsView = {
|
|
16
|
+
id: 'general_settings',
|
|
17
|
+
title: 'general_settings',
|
|
18
|
+
description: 'general_settings_description',
|
|
19
|
+
children: [],
|
|
20
|
+
elements: [
|
|
21
|
+
{
|
|
22
|
+
name: 'generalSettings.name',
|
|
23
|
+
label: 'general_settings_name',
|
|
24
|
+
$attributes: {
|
|
25
|
+
min: 0,
|
|
26
|
+
max: 100,
|
|
27
|
+
step: 1,
|
|
28
|
+
},
|
|
29
|
+
$component: AdminComponent.NumberInput,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'generalSettings.description',
|
|
33
|
+
label: 'general_settings_description',
|
|
34
|
+
$component: AdminComponent.TextInput,
|
|
35
|
+
$builders: [
|
|
36
|
+
{
|
|
37
|
+
$visibleWhen: {
|
|
38
|
+
$if: [
|
|
39
|
+
{
|
|
40
|
+
$target: 'generalSettings.name',
|
|
41
|
+
$eq: 'foo',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const fields = generateFormFields({fields: view.elements, values: {}});
|
|
52
|
+
expect(fields.map(removeRef)).toMatchSnapshot();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {ref, toRaw} from 'vue';
|
|
2
|
+
import {type Plugin} from '@myparcel-dev/pdk-common';
|
|
3
|
+
import {
|
|
4
|
+
type FieldConfiguration,
|
|
5
|
+
defineField,
|
|
6
|
+
type InteractiveElementConfiguration,
|
|
7
|
+
} from '@myparcel-dev/vue-form-builder';
|
|
8
|
+
import {defineFormField, resolveFormComponent} from '../helpers';
|
|
9
|
+
import {type FormBuilder, parseBuilders} from '../form-builder';
|
|
10
|
+
import {type AdminComponent} from '../../data';
|
|
11
|
+
|
|
12
|
+
type GenerateFormFields = (
|
|
13
|
+
config: {
|
|
14
|
+
fields: null | Plugin.Field[];
|
|
15
|
+
values: Record<string, unknown>;
|
|
16
|
+
},
|
|
17
|
+
prefix?: string,
|
|
18
|
+
) => FieldConfiguration[];
|
|
19
|
+
|
|
20
|
+
export const generateFormFields: GenerateFormFields = ({fields, values}, prefix = '') => {
|
|
21
|
+
if (!fields) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return fields.map((data) => {
|
|
26
|
+
const {$attributes, $component, $slot, $wrapper, label, name, $builders, ...props} = toRaw(data);
|
|
27
|
+
|
|
28
|
+
const common = {
|
|
29
|
+
component: resolveFormComponent($component as AdminComponent),
|
|
30
|
+
props: {...props},
|
|
31
|
+
attributes: {...$attributes},
|
|
32
|
+
optional: true,
|
|
33
|
+
slots: $slot ? {default: () => $slot} : undefined,
|
|
34
|
+
wrapper: $wrapper && typeof $wrapper === 'string' ? resolveFormComponent($wrapper as AdminComponent) : undefined,
|
|
35
|
+
...parseBuilders(($builders ?? []) as FormBuilder[], prefix),
|
|
36
|
+
} as FieldConfiguration;
|
|
37
|
+
|
|
38
|
+
// Plain element
|
|
39
|
+
if (!label || !name) {
|
|
40
|
+
return defineField(common);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return defineFormField({
|
|
44
|
+
...common,
|
|
45
|
+
name: prefix + name,
|
|
46
|
+
ref: ref(toRaw(values?.[name])),
|
|
47
|
+
label,
|
|
48
|
+
} as InteractiveElementConfiguration);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {type Plugin} from '@myparcel-dev/pdk-common';
|
|
2
|
+
import {type FormInstance} from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import {type AdminConfiguration, type TabDefinition} from '../../types';
|
|
4
|
+
import {type AdminAction} from '../../data';
|
|
5
|
+
import {type ActionContext} from '../../actions';
|
|
6
|
+
|
|
7
|
+
export interface FormTab extends Omit<TabDefinition, 'component'> {
|
|
8
|
+
form: FormInstance;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type PluginSettingsTabsContext = {
|
|
12
|
+
pluginSettings: Plugin.ModelContextDynamicContext['pluginSettings'];
|
|
13
|
+
actionContext: ActionContext<AdminAction.PluginSettingsUpdate>;
|
|
14
|
+
config: AdminConfiguration;
|
|
15
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
// noinspection JSUnusedGlobalSymbols
|
|
3
|
+
|
|
4
|
+
import {toRaw} from 'vue';
|
|
5
|
+
import {get} from 'lodash-unified';
|
|
6
|
+
import {type Plugin} from '@myparcel-dev/pdk-common';
|
|
7
|
+
import {defineForm, type FormInstance} from '@myparcel-dev/vue-form-builder';
|
|
8
|
+
import {type OneOrMore, toArray} from '@myparcel-dev/ts-utils';
|
|
9
|
+
import {addBulkEditNotification} from '../helpers';
|
|
10
|
+
import {createShipmentFormName} from '../../utils';
|
|
11
|
+
import {useModalStore} from '../../stores';
|
|
12
|
+
import {AdminModalKey} from '../../data';
|
|
13
|
+
import {useAdminConfig} from '../../composables';
|
|
14
|
+
import {type ShipmentOptionsRefs} from './types';
|
|
15
|
+
import {createHideSenderField} from './fields/createHideSenderField';
|
|
16
|
+
import {createDeliveryTypeField} from './fields/createDeliveryTypeField';
|
|
17
|
+
import {
|
|
18
|
+
createAgeCheckField,
|
|
19
|
+
createCarrierField,
|
|
20
|
+
createDigitalStampRangeField,
|
|
21
|
+
createDirectReturnField,
|
|
22
|
+
createInsuranceField,
|
|
23
|
+
createLabelAmountField,
|
|
24
|
+
createLargeFormatField,
|
|
25
|
+
createOnlyRecipientField,
|
|
26
|
+
createPackageTypeField,
|
|
27
|
+
createSameDayDeliveryField,
|
|
28
|
+
createSignatureField,
|
|
29
|
+
createReceiptCodeField,
|
|
30
|
+
} from './fields';
|
|
31
|
+
import {ALL_FIELDS, FIELD_CARRIER} from './field';
|
|
32
|
+
|
|
33
|
+
export const createShipmentOptionsForm = (orders?: OneOrMore<Plugin.ModelPdkOrder>): FormInstance => {
|
|
34
|
+
const ordersArray = toArray(orders ?? []).map(toRaw);
|
|
35
|
+
|
|
36
|
+
const config = useAdminConfig();
|
|
37
|
+
const modalStore = useModalStore();
|
|
38
|
+
|
|
39
|
+
const isBulk = ordersArray.length > 1;
|
|
40
|
+
const isModal = AdminModalKey.ShipmentOptions === modalStore.opened;
|
|
41
|
+
|
|
42
|
+
if (isBulk) {
|
|
43
|
+
addBulkEditNotification(isModal);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const order = ((isBulk ? undefined : ordersArray[0]) ?? {}) as Plugin.ModelContextOrderDataContext;
|
|
47
|
+
|
|
48
|
+
const refs = ALL_FIELDS.reduce((acc, fieldName) => {
|
|
49
|
+
acc[fieldName] = get(order, fieldName);
|
|
50
|
+
|
|
51
|
+
return acc;
|
|
52
|
+
}, {} as ShipmentOptionsRefs);
|
|
53
|
+
|
|
54
|
+
refs[FIELD_CARRIER] = get(order, `${FIELD_CARRIER}.externalIdentifier`);
|
|
55
|
+
|
|
56
|
+
return defineForm(createShipmentFormName(order.externalIdentifier), {
|
|
57
|
+
...(isModal ? config.formConfigOverrides?.modal : null),
|
|
58
|
+
...config.formConfigOverrides?.shipmentOptions,
|
|
59
|
+
fields: [
|
|
60
|
+
// General delivery options
|
|
61
|
+
createCarrierField(refs, order.inheritedDeliveryOptions),
|
|
62
|
+
|
|
63
|
+
createPackageTypeField(refs),
|
|
64
|
+
|
|
65
|
+
createDeliveryTypeField(refs),
|
|
66
|
+
|
|
67
|
+
createLabelAmountField(refs),
|
|
68
|
+
|
|
69
|
+
createDigitalStampRangeField(refs),
|
|
70
|
+
|
|
71
|
+
// Actual shipment options
|
|
72
|
+
createAgeCheckField(refs),
|
|
73
|
+
createSignatureField(refs),
|
|
74
|
+
createOnlyRecipientField(refs),
|
|
75
|
+
createDirectReturnField(refs),
|
|
76
|
+
createLargeFormatField(refs),
|
|
77
|
+
createHideSenderField(refs),
|
|
78
|
+
createSameDayDeliveryField(refs),
|
|
79
|
+
createReceiptCodeField(refs),
|
|
80
|
+
createInsuranceField(refs),
|
|
81
|
+
],
|
|
82
|
+
});
|
|
83
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {type Shipment} from '@myparcel-dev/pdk-common';
|
|
2
|
+
|
|
3
|
+
export type FieldName = string;
|
|
4
|
+
|
|
5
|
+
const DELIVERY_OPTIONS_PREFIX = 'deliveryOptions';
|
|
6
|
+
|
|
7
|
+
const PHYSICAL_PROPERTIES_PREFIX = 'physicalProperties';
|
|
8
|
+
|
|
9
|
+
export const SHIPMENT_OPTIONS = `shipmentOptions`;
|
|
10
|
+
|
|
11
|
+
const SHIPMENT_OPTIONS_PREFIX = `${DELIVERY_OPTIONS_PREFIX}.${SHIPMENT_OPTIONS}`;
|
|
12
|
+
|
|
13
|
+
export const CARRIER = 'carrier' satisfies keyof Shipment.ModelDeliveryOptions;
|
|
14
|
+
|
|
15
|
+
export const LABEL_AMOUNT = 'labelAmount' satisfies keyof Shipment.ModelDeliveryOptions;
|
|
16
|
+
|
|
17
|
+
export const PACKAGE_TYPE = 'packageType' satisfies keyof Shipment.ModelDeliveryOptions;
|
|
18
|
+
|
|
19
|
+
export const DELIVERY_TYPE = 'deliveryType' satisfies keyof Shipment.ModelDeliveryOptions;
|
|
20
|
+
|
|
21
|
+
export const AGE_CHECK = 'ageCheck' satisfies keyof Shipment.ModelShipmentOptions;
|
|
22
|
+
|
|
23
|
+
export const RECEIPT_CODE = 'receiptCode' satisfies keyof Shipment.ModelShipmentOptions;
|
|
24
|
+
|
|
25
|
+
export const DIRECT_RETURN = 'return' satisfies keyof Shipment.ModelShipmentOptions;
|
|
26
|
+
|
|
27
|
+
export const HIDE_SENDER = 'hideSender' satisfies keyof Shipment.ModelShipmentOptions;
|
|
28
|
+
|
|
29
|
+
export const LARGE_FORMAT = 'largeFormat' satisfies keyof Shipment.ModelShipmentOptions;
|
|
30
|
+
|
|
31
|
+
export const ONLY_RECIPIENT = 'onlyRecipient' satisfies keyof Shipment.ModelShipmentOptions;
|
|
32
|
+
|
|
33
|
+
export const SAME_DAY_DELIVERY = 'sameDayDelivery' satisfies keyof Shipment.ModelShipmentOptions;
|
|
34
|
+
|
|
35
|
+
export const SIGNATURE = 'signature' satisfies keyof Shipment.ModelShipmentOptions;
|
|
36
|
+
|
|
37
|
+
export const INSURANCE = 'insurance' satisfies keyof Shipment.ModelShipmentOptions;
|
|
38
|
+
|
|
39
|
+
export const MANUAL_WEIGHT = 'manualWeight';
|
|
40
|
+
|
|
41
|
+
export const PROP_OPTIONS = 'options';
|
|
42
|
+
|
|
43
|
+
export const KEY_DESCRIPTION = 'description';
|
|
44
|
+
|
|
45
|
+
export const KEY_SUBTEXT = 'subtext';
|
|
46
|
+
|
|
47
|
+
export const FIELD_CARRIER: FieldName = `${DELIVERY_OPTIONS_PREFIX}.${CARRIER}`;
|
|
48
|
+
|
|
49
|
+
export const FIELD_LABEL_AMOUNT: FieldName = `${DELIVERY_OPTIONS_PREFIX}.${LABEL_AMOUNT}`;
|
|
50
|
+
|
|
51
|
+
export const FIELD_PACKAGE_TYPE: FieldName = `${DELIVERY_OPTIONS_PREFIX}.${PACKAGE_TYPE}`;
|
|
52
|
+
|
|
53
|
+
export const FIELD_DELIVERY_TYPE: FieldName = `${DELIVERY_OPTIONS_PREFIX}.${DELIVERY_TYPE}`;
|
|
54
|
+
|
|
55
|
+
export const FIELD_AGE_CHECK: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${AGE_CHECK}`;
|
|
56
|
+
|
|
57
|
+
export const FIELD_DIRECT_RETURN: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${DIRECT_RETURN}`;
|
|
58
|
+
|
|
59
|
+
export const FIELD_HIDE_SENDER: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${HIDE_SENDER}`;
|
|
60
|
+
|
|
61
|
+
export const FIELD_LARGE_FORMAT: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${LARGE_FORMAT}`;
|
|
62
|
+
|
|
63
|
+
export const FIELD_ONLY_RECIPIENT: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${ONLY_RECIPIENT}`;
|
|
64
|
+
|
|
65
|
+
export const FIELD_SAME_DAY_DELIVERY: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${SAME_DAY_DELIVERY}`;
|
|
66
|
+
|
|
67
|
+
export const FIELD_SIGNATURE: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${SIGNATURE}`;
|
|
68
|
+
|
|
69
|
+
export const FIELD_INSURANCE: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${INSURANCE}`;
|
|
70
|
+
|
|
71
|
+
export const FIELD_MANUAL_WEIGHT: FieldName = `${PHYSICAL_PROPERTIES_PREFIX}.${MANUAL_WEIGHT}`;
|
|
72
|
+
|
|
73
|
+
export const FIELD_RECEIPT_CODE: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${RECEIPT_CODE}`;
|
|
74
|
+
|
|
75
|
+
export const ALL_FIELDS = [
|
|
76
|
+
FIELD_AGE_CHECK,
|
|
77
|
+
FIELD_CARRIER,
|
|
78
|
+
FIELD_DIRECT_RETURN,
|
|
79
|
+
FIELD_HIDE_SENDER,
|
|
80
|
+
FIELD_INSURANCE,
|
|
81
|
+
FIELD_LABEL_AMOUNT,
|
|
82
|
+
FIELD_LARGE_FORMAT,
|
|
83
|
+
FIELD_ONLY_RECIPIENT,
|
|
84
|
+
FIELD_MANUAL_WEIGHT,
|
|
85
|
+
FIELD_PACKAGE_TYPE,
|
|
86
|
+
FIELD_DELIVERY_TYPE,
|
|
87
|
+
FIELD_SAME_DAY_DELIVERY,
|
|
88
|
+
FIELD_SIGNATURE,
|
|
89
|
+
FIELD_RECEIPT_CODE,
|
|
90
|
+
] as const;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {TriState} from '@myparcel-dev/pdk-common';
|
|
2
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import {type PromiseOr} from '@myparcel-dev/ts-utils';
|
|
4
|
+
import {CarrierName} from '@myparcel-dev/constants';
|
|
5
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
6
|
+
import {FIELD_AGE_CHECK, FIELD_ONLY_RECIPIENT, FIELD_SIGNATURE} from '../field';
|
|
7
|
+
import {getFormCarrierName, setPostNlAgeCheckSubtext, triStateFieldIsEnabled} from '../../helpers';
|
|
8
|
+
import {createShipmentOptionField} from './createShipmentOptionField';
|
|
9
|
+
|
|
10
|
+
export const createAgeCheckField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
11
|
+
return createShipmentOptionField(refs, FIELD_AGE_CHECK, {
|
|
12
|
+
afterUpdate(field): PromiseOr<void> {
|
|
13
|
+
const {form} = field;
|
|
14
|
+
|
|
15
|
+
setPostNlAgeCheckSubtext(field);
|
|
16
|
+
|
|
17
|
+
if (!triStateFieldIsEnabled(field.form, FIELD_AGE_CHECK)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
switch (getFormCarrierName(form)) {
|
|
22
|
+
case CarrierName.PostNl:
|
|
23
|
+
form.setValue(FIELD_SIGNATURE, TriState.On);
|
|
24
|
+
form.setValue(FIELD_ONLY_RECIPIENT, TriState.On);
|
|
25
|
+
break;
|
|
26
|
+
|
|
27
|
+
case CarrierName.DhlForYou:
|
|
28
|
+
form.setValue(FIELD_SIGNATURE, TriState.Off);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {toValue} from 'vue';
|
|
2
|
+
import {AdminContextKey, type Plugin} from '@myparcel-dev/pdk-common';
|
|
3
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
4
|
+
import {PackageTypeName} from '@myparcel-dev/constants';
|
|
5
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
6
|
+
import {FIELD_CARRIER, FIELD_DELIVERY_TYPE, FIELD_INSURANCE, FIELD_PACKAGE_TYPE, PROP_OPTIONS} from '../field';
|
|
7
|
+
import {getDeliveryTypes} from '../../helpers/getDeliveryTypes';
|
|
8
|
+
import {
|
|
9
|
+
defineFormField,
|
|
10
|
+
getInsuranceOptions,
|
|
11
|
+
getPackageTypes,
|
|
12
|
+
resolveFormComponent,
|
|
13
|
+
setFieldProp,
|
|
14
|
+
setPostNlAgeCheckSubtext,
|
|
15
|
+
updateFieldsDefaults,
|
|
16
|
+
} from '../../helpers';
|
|
17
|
+
import {createAssetUrl} from '../../../utils';
|
|
18
|
+
import {type RadioGroupOption} from '../../../types';
|
|
19
|
+
import {useFetchCarrier} from '../../../sdk';
|
|
20
|
+
import {AdminComponent} from '../../../data';
|
|
21
|
+
import {useContext, useLanguage, useLocalizedFormatter} from '../../../composables';
|
|
22
|
+
import {createRef} from './createRef';
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line max-lines-per-function
|
|
25
|
+
export const createCarrierField = (
|
|
26
|
+
refs: ShipmentOptionsRefs,
|
|
27
|
+
inheritedDeliveryOptions: Plugin.ModelContextOrderDataContext['inheritedDeliveryOptions'],
|
|
28
|
+
): InteractiveElementConfiguration => {
|
|
29
|
+
const dynamicContext = useContext(AdminContextKey.Dynamic);
|
|
30
|
+
|
|
31
|
+
const formatter = useLocalizedFormatter();
|
|
32
|
+
|
|
33
|
+
const {translate} = useLanguage();
|
|
34
|
+
|
|
35
|
+
return defineFormField({
|
|
36
|
+
name: FIELD_CARRIER,
|
|
37
|
+
label: 'carrier',
|
|
38
|
+
ref: createRef<string>(refs, FIELD_CARRIER, PackageTypeName.Package),
|
|
39
|
+
component: resolveFormComponent(AdminComponent.RadioGroup),
|
|
40
|
+
props: {
|
|
41
|
+
options: [],
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
onBeforeMount: async (field) => {
|
|
45
|
+
const carrierSelectOptions = await Promise.all(
|
|
46
|
+
dynamicContext.carriers.map(async (carrier): Promise<RadioGroupOption> => {
|
|
47
|
+
const query = useFetchCarrier(carrier.name);
|
|
48
|
+
await query.suspense();
|
|
49
|
+
|
|
50
|
+
const apiCarrier = toValue(query.data);
|
|
51
|
+
|
|
52
|
+
let plainLabel = apiCarrier?.human ?? carrier.human ?? '';
|
|
53
|
+
|
|
54
|
+
if (!carrier.isDefault) {
|
|
55
|
+
plainLabel += ` ${carrier.label ?? translate(`carrier_type_${carrier.type}`)}`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
plainLabel,
|
|
60
|
+
value: carrier.externalIdentifier ?? apiCarrier?.name ?? '',
|
|
61
|
+
image: apiCarrier?.meta.logo_svg ? createAssetUrl(apiCarrier.meta.logo_svg) : undefined,
|
|
62
|
+
};
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
setFieldProp(field, PROP_OPTIONS, carrierSelectOptions);
|
|
67
|
+
|
|
68
|
+
await field?.afterUpdate?.(field, toValue(field.ref), undefined);
|
|
69
|
+
|
|
70
|
+
updateFieldsDefaults(toValue(field.ref) as string, field, inheritedDeliveryOptions);
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
afterUpdate: (field, newCarrier: string) => {
|
|
74
|
+
updateFieldsDefaults(newCarrier, field, inheritedDeliveryOptions);
|
|
75
|
+
|
|
76
|
+
setFieldProp(field.form, FIELD_INSURANCE, PROP_OPTIONS, getInsuranceOptions(field, formatter));
|
|
77
|
+
setFieldProp(field.form, FIELD_PACKAGE_TYPE, PROP_OPTIONS, getPackageTypes(field.form));
|
|
78
|
+
setFieldProp(field.form, FIELD_DELIVERY_TYPE, PROP_OPTIONS, getDeliveryTypes(field.form));
|
|
79
|
+
|
|
80
|
+
setPostNlAgeCheckSubtext(field);
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {snakeCase} from 'lodash-unified';
|
|
2
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import {DeliveryTypeName} from '@myparcel-dev/constants';
|
|
4
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
5
|
+
import {FIELD_DELIVERY_TYPE, SHIPMENT_OPTIONS} from '../field';
|
|
6
|
+
import {defineFormField, resolveFormComponent} from '../../helpers';
|
|
7
|
+
import {AdminComponent} from '../../../data';
|
|
8
|
+
import {createRef} from './createRef';
|
|
9
|
+
|
|
10
|
+
export const createDeliveryTypeField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
11
|
+
return defineFormField({
|
|
12
|
+
name: FIELD_DELIVERY_TYPE,
|
|
13
|
+
label: snakeCase(`${SHIPMENT_OPTIONS}_delivery_type`),
|
|
14
|
+
ref: createRef<DeliveryTypeName>(refs, FIELD_DELIVERY_TYPE, DeliveryTypeName.Standard),
|
|
15
|
+
component: resolveFormComponent(AdminComponent.RadioGroup),
|
|
16
|
+
// options defined in afterUpdate of `createCarrierField`
|
|
17
|
+
});
|
|
18
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {ref, toValue} from 'vue';
|
|
2
|
+
import {get} from 'lodash-unified';
|
|
3
|
+
import {TriState} from '@myparcel-dev/pdk-common';
|
|
4
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
5
|
+
import {PackageTypeName} from '@myparcel-dev/constants';
|
|
6
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
7
|
+
import {FIELD_MANUAL_WEIGHT, FIELD_PACKAGE_TYPE} from '../field';
|
|
8
|
+
import {createDefaultOption, defineFormField, resolveFormComponent} from '../../helpers';
|
|
9
|
+
import {type GlobalFieldProps, type OptionsProp} from '../../../types';
|
|
10
|
+
import {AdminComponent} from '../../../data';
|
|
11
|
+
import {useDigitalStampRanges, useOrderData, usePluginSettings} from '../../../composables';
|
|
12
|
+
|
|
13
|
+
export const createDigitalStampRangeField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
14
|
+
const pluginSettings = usePluginSettings();
|
|
15
|
+
const {order} = useOrderData();
|
|
16
|
+
|
|
17
|
+
const orderData = toValue(order);
|
|
18
|
+
|
|
19
|
+
const {initialWeight, manualWeight} = orderData?.physicalProperties ?? {};
|
|
20
|
+
|
|
21
|
+
const totalWeight = Number(initialWeight) + Number(pluginSettings.order.emptyDigitalStampWeight ?? 0);
|
|
22
|
+
|
|
23
|
+
const {ranges, currentRange} = useDigitalStampRanges(orderData);
|
|
24
|
+
|
|
25
|
+
const selectedValue =
|
|
26
|
+
TriState.Inherit === manualWeight
|
|
27
|
+
? TriState.Inherit
|
|
28
|
+
: (get(refs, FIELD_MANUAL_WEIGHT, manualWeight) as number) ?? currentRange.value?.value;
|
|
29
|
+
|
|
30
|
+
return defineFormField({
|
|
31
|
+
name: FIELD_MANUAL_WEIGHT,
|
|
32
|
+
label: 'weight_range',
|
|
33
|
+
ref: ref(selectedValue ?? TriState.Inherit),
|
|
34
|
+
component: resolveFormComponent(AdminComponent.SelectInput),
|
|
35
|
+
visibleWhen: (field) => PackageTypeName.DigitalStamp === field.form.getValue(FIELD_PACKAGE_TYPE),
|
|
36
|
+
disabledWhen: (field) => PackageTypeName.DigitalStamp !== field.form.getValue(FIELD_PACKAGE_TYPE),
|
|
37
|
+
props: {
|
|
38
|
+
subtext: {
|
|
39
|
+
key: 'order_weight',
|
|
40
|
+
args: {
|
|
41
|
+
// eslint-disable-next-line id-length
|
|
42
|
+
n: totalWeight,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
options: [createDefaultOption(currentRange.value?.plainLabel), ...ranges.value],
|
|
46
|
+
} satisfies OptionsProp & GlobalFieldProps,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
3
|
+
import {FIELD_DIRECT_RETURN} from '../field';
|
|
4
|
+
import {createShipmentOptionField} from './createShipmentOptionField';
|
|
5
|
+
|
|
6
|
+
export const createDirectReturnField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
7
|
+
return createShipmentOptionField(refs, FIELD_DIRECT_RETURN);
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
3
|
+
import {FIELD_HIDE_SENDER} from '../field';
|
|
4
|
+
import {createShipmentOptionField} from './createShipmentOptionField';
|
|
5
|
+
|
|
6
|
+
export const createHideSenderField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
7
|
+
return createShipmentOptionField(refs, FIELD_HIDE_SENDER);
|
|
8
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type InteractiveElementConfiguration } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type ShipmentOptionsRefs } from '../types';
|
|
3
|
+
import { FIELD_INSURANCE, PROP_OPTIONS, INSURANCE } from '../field';
|
|
4
|
+
import {
|
|
5
|
+
createHasShipmentOptionWatcher,
|
|
6
|
+
getInsuranceOptions,
|
|
7
|
+
isPackageTypePackageOrSmall,
|
|
8
|
+
resolveFormComponent,
|
|
9
|
+
setFieldProp,
|
|
10
|
+
} from '../../helpers';
|
|
11
|
+
import { type ElementInstance } from '../../../types';
|
|
12
|
+
import { AdminComponent } from '../../../data';
|
|
13
|
+
import { useLocalizedFormatter } from '../../../composables';
|
|
14
|
+
import { createShipmentOptionField } from './createShipmentOptionField';
|
|
15
|
+
import { createRef } from './createRef';
|
|
16
|
+
|
|
17
|
+
export const createInsuranceField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
18
|
+
const formatter = useLocalizedFormatter();
|
|
19
|
+
|
|
20
|
+
return createShipmentOptionField(refs, FIELD_INSURANCE, {
|
|
21
|
+
ref: createRef(refs, FIELD_INSURANCE, 0),
|
|
22
|
+
component: resolveFormComponent(AdminComponent.SelectInput),
|
|
23
|
+
visibleWhen: createHasShipmentOptionWatcher(INSURANCE, false, isPackageTypePackageOrSmall),
|
|
24
|
+
disabledWhen: createHasShipmentOptionWatcher(INSURANCE, true, isPackageTypePackageOrSmall),
|
|
25
|
+
onBeforeMount(field: ElementInstance) {
|
|
26
|
+
const insurancePossibilities = getInsuranceOptions(field, formatter);
|
|
27
|
+
|
|
28
|
+
setFieldProp(field, PROP_OPTIONS, insurancePossibilities);
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {snakeCase} from 'lodash-unified';
|
|
2
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
4
|
+
import {FIELD_LABEL_AMOUNT, LABEL_AMOUNT} from '../field';
|
|
5
|
+
import {defineFormField, resolveFormComponent} from '../../helpers';
|
|
6
|
+
import {AdminComponent} from '../../../data';
|
|
7
|
+
import {createRef} from './createRef';
|
|
8
|
+
|
|
9
|
+
export const createLabelAmountField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
10
|
+
return defineFormField({
|
|
11
|
+
name: FIELD_LABEL_AMOUNT,
|
|
12
|
+
label: snakeCase(LABEL_AMOUNT),
|
|
13
|
+
ref: createRef<number>(refs, FIELD_LABEL_AMOUNT, 1),
|
|
14
|
+
component: resolveFormComponent(AdminComponent.NumberInput),
|
|
15
|
+
props: {
|
|
16
|
+
min: 1,
|
|
17
|
+
max: 10,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
3
|
+
import {FIELD_LARGE_FORMAT} from '../field';
|
|
4
|
+
import {createShipmentOptionField} from './createShipmentOptionField';
|
|
5
|
+
|
|
6
|
+
export const createLargeFormatField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
7
|
+
return createShipmentOptionField(refs, FIELD_LARGE_FORMAT);
|
|
8
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {TriState} from '@myparcel-dev/pdk-common';
|
|
2
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import {CarrierName} from '@myparcel-dev/constants';
|
|
4
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
5
|
+
import {FIELD_AGE_CHECK, FIELD_ONLY_RECIPIENT} from '../field';
|
|
6
|
+
import {getFormCarrierName, hasPostNlAgeCheck} from '../../helpers';
|
|
7
|
+
import {createShipmentOptionField} from './createShipmentOptionField';
|
|
8
|
+
|
|
9
|
+
export const createOnlyRecipientField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
10
|
+
return createShipmentOptionField(refs, FIELD_ONLY_RECIPIENT, {
|
|
11
|
+
readOnlyWhen: ({form}) => hasPostNlAgeCheck(form),
|
|
12
|
+
|
|
13
|
+
afterUpdate({form}, value) {
|
|
14
|
+
if (!(CarrierName.DhlForYou === getFormCarrierName(form) && TriState.On === value)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
form.setValue(FIELD_AGE_CHECK, TriState.Off);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {snakeCase} from 'lodash-unified';
|
|
2
|
+
import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import {PackageTypeName} from '@myparcel-dev/constants';
|
|
4
|
+
import {type ShipmentOptionsRefs} from '../types';
|
|
5
|
+
import {FIELD_PACKAGE_TYPE, SHIPMENT_OPTIONS} from '../field';
|
|
6
|
+
import {defineFormField, resolveFormComponent} from '../../helpers';
|
|
7
|
+
import {AdminComponent} from '../../../data';
|
|
8
|
+
import {createRef} from './createRef';
|
|
9
|
+
|
|
10
|
+
export const createPackageTypeField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
|
|
11
|
+
return defineFormField({
|
|
12
|
+
name: FIELD_PACKAGE_TYPE,
|
|
13
|
+
label: snakeCase(`${SHIPMENT_OPTIONS}_package_type`),
|
|
14
|
+
ref: createRef<PackageTypeName>(refs, FIELD_PACKAGE_TYPE, PackageTypeName.Package),
|
|
15
|
+
component: resolveFormComponent(AdminComponent.RadioGroup),
|
|
16
|
+
// options defined in afterUpdate of `createCarrierField`
|
|
17
|
+
});
|
|
18
|
+
};
|