@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,20 @@
|
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
|
+
import {useLoading} from './useLoading';
|
|
3
|
+
|
|
4
|
+
describe('useLoading', () => {
|
|
5
|
+
it('can be toggled', () => {
|
|
6
|
+
const {loading, setLoading} = useLoading();
|
|
7
|
+
|
|
8
|
+
expect(loading.value).toBe(false);
|
|
9
|
+
setLoading(true);
|
|
10
|
+
expect(loading.value).toBe(true);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('uses the initial value', () => {
|
|
14
|
+
const {loading, setLoading} = useLoading(true);
|
|
15
|
+
|
|
16
|
+
expect(loading.value).toBe(true);
|
|
17
|
+
setLoading(false);
|
|
18
|
+
expect(loading.value).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {type Ref, ref} from 'vue';
|
|
2
|
+
|
|
3
|
+
type UseLoading = (initialValue?: boolean) => {
|
|
4
|
+
loading: Ref<boolean>;
|
|
5
|
+
setLoading: (state: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Manages loading state.
|
|
10
|
+
*/
|
|
11
|
+
export const useLoading: UseLoading = (initialValue = false) => {
|
|
12
|
+
const loading = ref<boolean>(initialValue);
|
|
13
|
+
const setLoading = (state: boolean): void => {
|
|
14
|
+
loading.value = state;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return {loading, setLoading};
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {AdminContextKey, BackendEndpoint} from '@myparcel-dev/pdk-common';
|
|
2
|
+
import {type ContextQuery} from '../stores';
|
|
3
|
+
import {useStoreQuery} from './useStoreQuery';
|
|
4
|
+
|
|
5
|
+
export const useStoreContextQuery = <C extends AdminContextKey = AdminContextKey.Dynamic>(
|
|
6
|
+
contextKey?: C,
|
|
7
|
+
): ContextQuery<C> => {
|
|
8
|
+
return useStoreQuery(BackendEndpoint.FetchContext, contextKey ?? AdminContextKey.Dynamic) as ContextQuery<C>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {type BackendEndpoint} from '@myparcel-dev/pdk-common';
|
|
2
|
+
import {type ResolvedQuery, useQueryStore} from '../stores';
|
|
3
|
+
import {type PlainModifier} from '../actions';
|
|
4
|
+
|
|
5
|
+
export const useStoreQuery = <E extends BackendEndpoint>(endpoint: E, suffix?: PlainModifier): ResolvedQuery<E> => {
|
|
6
|
+
const queryStore = useQueryStore();
|
|
7
|
+
|
|
8
|
+
return queryStore.get(endpoint, suffix) as ResolvedQuery<E>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {createObjectWithKeys} from '../utils';
|
|
2
|
+
import {Format, useLocalizedFormatter} from './formatter';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line no-magic-numbers,@typescript-eslint/no-magic-numbers
|
|
5
|
+
const WEEKDAYS = [0, 1, 2, 3, 4, 5, 6] as const;
|
|
6
|
+
|
|
7
|
+
export type Weekdays = typeof WEEKDAYS;
|
|
8
|
+
|
|
9
|
+
export type Weekday = Weekdays[number];
|
|
10
|
+
|
|
11
|
+
type UseWeekdays = {
|
|
12
|
+
weekdays: Weekdays;
|
|
13
|
+
weekdaysObject: Record<Weekday, string>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const useWeekdays = (): UseWeekdays => {
|
|
17
|
+
const formatter = useLocalizedFormatter();
|
|
18
|
+
const weekdaysObject = createObjectWithKeys(WEEKDAYS, (day) => formatter.format(Format.Weekday, day));
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
weekdays: WEEKDAYS,
|
|
22
|
+
weekdaysObject,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
export enum AdminComponent {
|
|
2
|
+
/**
|
|
3
|
+
* @see BadgeProps
|
|
4
|
+
*/
|
|
5
|
+
Badge = 'Badge',
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to wrap content in a block.
|
|
9
|
+
*
|
|
10
|
+
* @see BoxProps
|
|
11
|
+
*/
|
|
12
|
+
Box = 'Box',
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This component is used to render a button. The button can be used to trigger an action. The button can have
|
|
16
|
+
* multiple icons, a label and various sizes. The button can be disabled.
|
|
17
|
+
*
|
|
18
|
+
* @see ButtonProps
|
|
19
|
+
*/
|
|
20
|
+
Button = 'Button',
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @see ButtonGroupProps
|
|
24
|
+
*/
|
|
25
|
+
ButtonGroup = 'ButtonGroup',
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @see CheckboxGroupProps
|
|
29
|
+
*/
|
|
30
|
+
CheckboxGroup = 'CheckboxGroup',
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @see CheckboxInputProps
|
|
34
|
+
*/
|
|
35
|
+
CheckboxInput = 'CheckboxInput',
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @see CodeEditorProps
|
|
39
|
+
*/
|
|
40
|
+
CodeEditor = 'CodeEditor',
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @see ColProps
|
|
44
|
+
*/
|
|
45
|
+
Col = 'Col',
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @see ConceptBoxWrapperProps
|
|
49
|
+
*/
|
|
50
|
+
ConceptBoxWrapper = 'ConceptBoxWrapper',
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @see CurrencyInputProps
|
|
54
|
+
*/
|
|
55
|
+
CurrencyInput = 'CurrencyInput',
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @see DropOffInputProps
|
|
59
|
+
*/
|
|
60
|
+
DropOffInput = 'DropOffInput',
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The dropdown button is a button that can be clicked to open a dropdown menu. The dropdown menu can contain multiple
|
|
64
|
+
* items.
|
|
65
|
+
*
|
|
66
|
+
* @see DropdownButtonProps
|
|
67
|
+
*/
|
|
68
|
+
DropdownButton = 'DropdownButton',
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The form group is used to render a label and a form element.
|
|
72
|
+
*
|
|
73
|
+
* @see FormGroupProps
|
|
74
|
+
*/
|
|
75
|
+
FormGroup = 'FormGroup',
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @see HeadingProps
|
|
79
|
+
*/
|
|
80
|
+
Heading = 'Heading',
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @see IconProps
|
|
84
|
+
*/
|
|
85
|
+
Icon = 'Icon',
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @see ImageProps
|
|
89
|
+
*/
|
|
90
|
+
Image = 'Image',
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* This component is used to render a link. The link can be used to trigger an action.
|
|
94
|
+
*
|
|
95
|
+
* @see LinkProps
|
|
96
|
+
*/
|
|
97
|
+
Link = 'Link',
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @see LoaderProps
|
|
101
|
+
*/
|
|
102
|
+
Loader = 'Loader',
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @see ModalProps
|
|
106
|
+
*/
|
|
107
|
+
Modal = 'Modal',
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A multi-select box. Renders a list of options which each have their own value. Allows multiple options to be selected.
|
|
111
|
+
*
|
|
112
|
+
* @see MultiSelectInputProps
|
|
113
|
+
*/
|
|
114
|
+
MultiSelectInput = 'MultiSelectInput',
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @see NotificationProps
|
|
118
|
+
*/
|
|
119
|
+
Notification = 'Notification',
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @see NumberInputProps
|
|
123
|
+
*/
|
|
124
|
+
NumberInput = 'NumberInput',
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @see PluginSettingsWrapperProps
|
|
128
|
+
*/
|
|
129
|
+
PluginSettingsWrapper = 'PluginSettingsWrapper',
|
|
130
|
+
/**
|
|
131
|
+
* @see RadioGroupProps
|
|
132
|
+
*/
|
|
133
|
+
RadioGroup = 'RadioGroup',
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @see RadioInputProps
|
|
137
|
+
*/
|
|
138
|
+
RadioInput = 'RadioInput',
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Table row.
|
|
142
|
+
*
|
|
143
|
+
* @see RowProps
|
|
144
|
+
*/
|
|
145
|
+
Row = 'Row',
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* A select element. Renders a list of options which each have their own value.
|
|
149
|
+
*
|
|
150
|
+
* @see SelectInputProps
|
|
151
|
+
*/
|
|
152
|
+
SelectInput = 'SelectInput',
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @see SettingsDividerProps
|
|
156
|
+
*/
|
|
157
|
+
SettingsDivider = 'SettingsDivider',
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @see ShipmentLabelWrapperProps
|
|
161
|
+
*/
|
|
162
|
+
ShipmentLabelWrapper = 'ShipmentLabelWrapper',
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @see ShippingMethodsInputProps
|
|
166
|
+
*/
|
|
167
|
+
ShippingMethodsInput = 'ShippingMethodsInput',
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @see TabNavButtonProps
|
|
171
|
+
*/
|
|
172
|
+
TabNavButton = 'TabNavButton',
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @see TabNavButtonWrapperProps
|
|
176
|
+
*/
|
|
177
|
+
TabNavButtonWrapper = 'TabNavButtonWrapper',
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @see TabNavContentWrapperProps
|
|
181
|
+
*/
|
|
182
|
+
TabNavContentWrapper = 'TabNavContentWrapper',
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* A table component that can be used to render data via slots.
|
|
186
|
+
*
|
|
187
|
+
* @see TableProps
|
|
188
|
+
*/
|
|
189
|
+
Table = 'Table',
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @see TableColProps
|
|
193
|
+
*/
|
|
194
|
+
TableCol = 'TableCol',
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @see TableRowProps
|
|
198
|
+
*/
|
|
199
|
+
TableRow = 'TableRow',
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @see TextAreaProps
|
|
203
|
+
*/
|
|
204
|
+
TextArea = 'TextArea',
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @see TextInputProps
|
|
208
|
+
*/
|
|
209
|
+
TextInput = 'TextInput',
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @see TimeInputProps
|
|
213
|
+
*/
|
|
214
|
+
TimeInput = 'TimeInput',
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @see ToggleInputProps
|
|
218
|
+
*/
|
|
219
|
+
ToggleInput = 'ToggleInput',
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @see TriStateInputProps
|
|
223
|
+
*/
|
|
224
|
+
TriStateInput = 'TriStateInput',
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @see MultiDateInputProps
|
|
228
|
+
*/
|
|
229
|
+
MultiDateInput = 'MultiDateInput',
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export const requiredAdminComponentNames = [
|
|
233
|
+
AdminComponent.Box,
|
|
234
|
+
AdminComponent.Button,
|
|
235
|
+
AdminComponent.CheckboxGroup,
|
|
236
|
+
AdminComponent.CheckboxInput,
|
|
237
|
+
AdminComponent.CodeEditor,
|
|
238
|
+
AdminComponent.Col,
|
|
239
|
+
AdminComponent.CurrencyInput,
|
|
240
|
+
AdminComponent.DropOffInput,
|
|
241
|
+
AdminComponent.DropdownButton,
|
|
242
|
+
AdminComponent.FormGroup,
|
|
243
|
+
AdminComponent.Heading,
|
|
244
|
+
AdminComponent.Icon,
|
|
245
|
+
AdminComponent.Image,
|
|
246
|
+
AdminComponent.Link,
|
|
247
|
+
AdminComponent.Loader,
|
|
248
|
+
AdminComponent.Modal,
|
|
249
|
+
AdminComponent.MultiSelectInput,
|
|
250
|
+
AdminComponent.Notification,
|
|
251
|
+
AdminComponent.NumberInput,
|
|
252
|
+
AdminComponent.RadioGroup,
|
|
253
|
+
AdminComponent.RadioInput,
|
|
254
|
+
AdminComponent.Row,
|
|
255
|
+
AdminComponent.SelectInput,
|
|
256
|
+
AdminComponent.TabNavButton,
|
|
257
|
+
AdminComponent.Table,
|
|
258
|
+
AdminComponent.TextArea,
|
|
259
|
+
AdminComponent.TextInput,
|
|
260
|
+
AdminComponent.TimeInput,
|
|
261
|
+
AdminComponent.ToggleInput,
|
|
262
|
+
AdminComponent.TriStateInput,
|
|
263
|
+
AdminComponent.MultiDateInput,
|
|
264
|
+
] as const;
|
|
265
|
+
|
|
266
|
+
export const optionalAdminComponentNames = [AdminComponent.ShippingMethodsInput] as const;
|
|
267
|
+
|
|
268
|
+
export const optionalAdminPlainWrapperComponentNames = [
|
|
269
|
+
AdminComponent.Badge,
|
|
270
|
+
AdminComponent.ButtonGroup,
|
|
271
|
+
AdminComponent.PluginSettingsWrapper,
|
|
272
|
+
AdminComponent.SettingsDivider,
|
|
273
|
+
AdminComponent.TabNavButtonWrapper,
|
|
274
|
+
AdminComponent.TabNavContentWrapper,
|
|
275
|
+
AdminComponent.TableCol,
|
|
276
|
+
AdminComponent.TableRow,
|
|
277
|
+
] as const;
|
|
278
|
+
|
|
279
|
+
export const optionalAdminActionContainerComponentNames = [
|
|
280
|
+
AdminComponent.ConceptBoxWrapper,
|
|
281
|
+
AdminComponent.ShipmentLabelWrapper,
|
|
282
|
+
] as const;
|
|
283
|
+
|
|
284
|
+
export const allAdminComponentNames = [
|
|
285
|
+
...requiredAdminComponentNames,
|
|
286
|
+
...optionalAdminComponentNames,
|
|
287
|
+
...optionalAdminPlainWrapperComponentNames,
|
|
288
|
+
...optionalAdminActionContainerComponentNames,
|
|
289
|
+
] as const;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export const HASH_SEPARATOR = '--';
|
|
2
|
+
|
|
3
|
+
export const ADMIN_COMPONENT_PREFIX = 'Pdk';
|
|
4
|
+
|
|
5
|
+
export enum AdminInstanceContextKey {
|
|
6
|
+
OrderIdentifier = 'orderIdentifier',
|
|
7
|
+
ProductIdentifier = 'productIdentifier',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum AdminModalKey {
|
|
11
|
+
PrintOptions = 'printOptions',
|
|
12
|
+
ReturnOptions = 'returnOptions',
|
|
13
|
+
ShipmentOptions = 'shipmentOptions',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum NotificationCategory {
|
|
17
|
+
Action = 'action',
|
|
18
|
+
Api = 'api',
|
|
19
|
+
General = 'general',
|
|
20
|
+
Modal = 'modal',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export enum NotificationSource {
|
|
24
|
+
Api = 'api',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export enum AdminIcon {
|
|
28
|
+
Add = 'add',
|
|
29
|
+
ArrowDown = 'arrow_down',
|
|
30
|
+
ArrowUp = 'arrow_up',
|
|
31
|
+
Close = 'close',
|
|
32
|
+
Delete = 'delete',
|
|
33
|
+
Download = 'download',
|
|
34
|
+
Edit = 'edit',
|
|
35
|
+
Export = 'export',
|
|
36
|
+
External = 'external',
|
|
37
|
+
No = 'no',
|
|
38
|
+
Print = 'print',
|
|
39
|
+
Refresh = 'refresh',
|
|
40
|
+
Return = 'return',
|
|
41
|
+
Save = 'save',
|
|
42
|
+
Shipment = 'shipment',
|
|
43
|
+
Spinner = 'spinner',
|
|
44
|
+
Yes = 'yes',
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export enum AdminAction {
|
|
48
|
+
ContextFetch = 'contextFetch',
|
|
49
|
+
|
|
50
|
+
AccountDelete = 'accountDelete',
|
|
51
|
+
AccountUpdate = 'accountUpdate',
|
|
52
|
+
|
|
53
|
+
OrdersExport = 'ordersExport',
|
|
54
|
+
OrdersExportPrint = 'ordersExportPrint',
|
|
55
|
+
OrdersPrint = 'ordersPrint',
|
|
56
|
+
OrdersFetch = 'ordersFetch',
|
|
57
|
+
OrdersUpdate = 'ordersUpdate',
|
|
58
|
+
OrdersEdit = 'ordersEdit',
|
|
59
|
+
|
|
60
|
+
ShipmentsDelete = 'shipmentsDelete',
|
|
61
|
+
ShipmentsPrint = 'shipmentsPrint',
|
|
62
|
+
ShipmentsUpdate = 'shipmentsUpdate',
|
|
63
|
+
ShipmentsFetch = 'shipmentsFetch',
|
|
64
|
+
ShipmentsExportReturn = 'shipmentsExportReturn',
|
|
65
|
+
|
|
66
|
+
PluginSettingsUpdate = 'pluginSettingsUpdate',
|
|
67
|
+
ProductSettingsUpdate = 'productSettingsUpdate',
|
|
68
|
+
|
|
69
|
+
WebhooksCreate = 'webhooksCreate',
|
|
70
|
+
WebhooksDelete = 'webhooksDelete',
|
|
71
|
+
WebhooksFetch = 'webhooksFetch',
|
|
72
|
+
|
|
73
|
+
DownloadLogs = 'downloadLogs',
|
|
74
|
+
SwitchToAcceptanceApi = 'switchToAcceptanceApi',
|
|
75
|
+
SwitchToProductionApi = 'switchToProductionApi',
|
|
76
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {BackendEndpoint} from '@myparcel-dev/pdk-common';
|
|
2
|
+
|
|
3
|
+
export const BACKEND_ENDPOINTS_ORDERS = [
|
|
4
|
+
BackendEndpoint.ExportOrders,
|
|
5
|
+
BackendEndpoint.FetchOrders,
|
|
6
|
+
BackendEndpoint.PrintOrders,
|
|
7
|
+
BackendEndpoint.UpdateOrders,
|
|
8
|
+
] as const;
|
|
9
|
+
|
|
10
|
+
export const BACKEND_ENDPOINTS_SHIPMENTS = [
|
|
11
|
+
BackendEndpoint.DeleteShipments,
|
|
12
|
+
BackendEndpoint.ExportReturn,
|
|
13
|
+
BackendEndpoint.FetchShipments,
|
|
14
|
+
BackendEndpoint.PrintShipments,
|
|
15
|
+
BackendEndpoint.UpdateShipments,
|
|
16
|
+
] as const;
|
|
17
|
+
|
|
18
|
+
export const BACKEND_ENDPOINTS_WEBHOOKS = [
|
|
19
|
+
BackendEndpoint.CreateWebhooks,
|
|
20
|
+
BackendEndpoint.DeleteWebhooks,
|
|
21
|
+
BackendEndpoint.FetchWebhooks,
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
export const BACKEND_ENDPOINTS_DEBUG = [
|
|
25
|
+
BackendEndpoint.DownloadLogs,
|
|
26
|
+
BackendEndpoint.SwitchToAcceptanceApi,
|
|
27
|
+
BackendEndpoint.SwitchToProductionApi,
|
|
28
|
+
] as const;
|
package/src/data/view.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export enum AdminView {
|
|
2
|
+
ChildProductSettings = 'ChildProductSettings',
|
|
3
|
+
Modals = 'Modals',
|
|
4
|
+
Notifications = 'Notifications',
|
|
5
|
+
OrderBox = 'OrderBox',
|
|
6
|
+
OrderListItem = 'OrderListItem',
|
|
7
|
+
PluginSettings = 'PluginSettings',
|
|
8
|
+
ProductSettings = 'ProductSettings',
|
|
9
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {ref} from 'vue';
|
|
2
|
+
import {afterEach, describe, expect, it, vi} from 'vitest';
|
|
3
|
+
import {mount} from '@vue/test-utils';
|
|
4
|
+
import MagicForm, {defineForm, useFormBuilder} from '@myparcel-dev/vue-form-builder';
|
|
5
|
+
import {buildAfterUpdate} from './buildAfterUpdate';
|
|
6
|
+
|
|
7
|
+
describe('buildAfterUpdate', () => {
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
useFormBuilder().forms.value = {};
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('builds', () => {
|
|
13
|
+
const result = buildAfterUpdate([{$setValue: {$value: 'hello'}}], '');
|
|
14
|
+
|
|
15
|
+
expect(result).toBeDefined();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should execute afterUpdate hook', async () => {
|
|
19
|
+
expect.assertions(3);
|
|
20
|
+
|
|
21
|
+
const afterUpdate = vi.fn(buildAfterUpdate([{$setValue: {$value: 'hello'}}], ''));
|
|
22
|
+
|
|
23
|
+
const form = defineForm('test', {});
|
|
24
|
+
|
|
25
|
+
await form.addElement({
|
|
26
|
+
name: 'test',
|
|
27
|
+
component: 'input',
|
|
28
|
+
ref: ref(''),
|
|
29
|
+
afterUpdate,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const wrapper = mount(MagicForm, {props: {form}});
|
|
33
|
+
|
|
34
|
+
expect(afterUpdate).not.toHaveBeenCalled();
|
|
35
|
+
|
|
36
|
+
form.setValue('test', 'test');
|
|
37
|
+
|
|
38
|
+
const testField = form.getField('test');
|
|
39
|
+
// afterUpdate must be triggered manually via hooks.execute in new vue-form-builder API
|
|
40
|
+
await testField?.hooks.execute('afterUpdate', testField, 'test', '');
|
|
41
|
+
|
|
42
|
+
await wrapper.vm.$nextTick();
|
|
43
|
+
|
|
44
|
+
// The spy is called once when we execute the hook
|
|
45
|
+
expect(afterUpdate).toHaveBeenCalled();
|
|
46
|
+
expect(form.getValue('test')).toBe('hello');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {type InteractiveElementInstance} from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import {createPropSetter, createValueGetter, createValueSetter} from '../utils';
|
|
3
|
+
import {type FormOperation, type HandlerDefinition} from '../types';
|
|
4
|
+
import {executeOperations} from '../operations';
|
|
5
|
+
|
|
6
|
+
export const buildAfterUpdate = (
|
|
7
|
+
operations: FormOperation[],
|
|
8
|
+
prefix: string,
|
|
9
|
+
customHandlers: HandlerDefinition[] = [],
|
|
10
|
+
): ((instance: InteractiveElementInstance) => void) => {
|
|
11
|
+
return (instance: InteractiveElementInstance): void => {
|
|
12
|
+
const getValue = createValueGetter(instance, prefix);
|
|
13
|
+
const setValue = createValueSetter(instance, prefix);
|
|
14
|
+
const setProp = createPropSetter(instance, prefix);
|
|
15
|
+
|
|
16
|
+
executeOperations(
|
|
17
|
+
operations,
|
|
18
|
+
{
|
|
19
|
+
getValue,
|
|
20
|
+
setValue,
|
|
21
|
+
setProp,
|
|
22
|
+
},
|
|
23
|
+
customHandlers,
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
};
|