@myparcel-dev/pdk-admin 2.0.1 → 2.2.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 +20 -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/mockDefaultPluginSettings.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultPrintOptionsView.d.ts +2 -0
- package/dist/__tests__/mocks/mockDefaultProposition.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/account/useOrderCapabilitiesQuery.d.ts +29 -0
- package/dist/actions/composables/queries/account/useShipmentCapabilitiesQuery.d.ts +45 -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 +39 -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 +3 -0
- package/dist/actions/executors/createQueryHandler.d.ts +3 -0
- package/dist/actions/executors/createShipmentsMutationHandler.d.ts +3 -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 +7 -0
- package/dist/actions/orderModeActions.d.ts +37 -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 +7 -0
- package/dist/components/OrderBox/OrderShipmentsTableRow.vue.d.ts +19 -0
- package/dist/components/OrderBox/ShipmentOptionsBox.vue.d.ts +3 -0
- package/dist/components/OrderBox/ShipmentTableBox.vue.d.ts +3 -0
- package/dist/components/OrderListItem/OrderModeOrderListItem.vue.d.ts +3 -0
- package/dist/components/OrderListItem/ShipmentLabel.vue.d.ts +14 -0
- package/dist/components/OrderListItem/ShipmentModeOrderListItem.vue.d.ts +3 -0
- package/dist/components/PluginSettings/AccountSettings.vue.d.ts +3 -0
- package/dist/components/PluginSettings/DebugOptions.vue.d.ts +3 -0
- package/dist/components/PluginSettings/EditApiKeyForm.vue.d.ts +8 -0
- package/dist/components/PluginSettings/PluginSettingsForms.vue.d.ts +3 -0
- package/dist/components/PluginSettings/WebhooksStatus.vue.d.ts +3 -0
- package/dist/components/PluginSettings/createUpdateAccountSettingsValidator.d.ts +4 -0
- package/dist/components/common/ActionButton.vue.d.ts +48 -0
- package/dist/components/common/BulkSelectCheckbox.vue.d.ts +20 -0
- package/dist/components/common/CarrierLogo.vue.d.ts +15 -0
- package/dist/components/common/DateRelative.vue.d.ts +15 -0
- package/dist/components/common/DeliveryOptionsDeliveryType.vue.d.ts +15 -0
- package/dist/components/common/DeliveryOptionsExcerpt.vue.d.ts +3 -0
- package/dist/components/common/DeliveryOptionsExcerptCarrierName.vue.d.ts +15 -0
- package/dist/components/common/DeliveryOptionsPackageType.vue.d.ts +15 -0
- package/dist/components/common/DigitalStampWeightRange.vue.d.ts +14 -0
- package/dist/components/common/NotificationContainer.vue.d.ts +17 -0
- package/dist/components/common/PackageType.vue.d.ts +15 -0
- package/dist/components/common/PlainElement.d.ts +2 -0
- package/dist/components/common/ResetButton.vue.d.ts +14 -0
- package/dist/components/common/ReturnsForm.vue.d.ts +15 -0
- package/dist/components/common/ShipmentBarcode.vue.d.ts +14 -0
- package/dist/components/common/ShipmentOptionsForm.vue.d.ts +15 -0
- package/dist/components/common/ShipmentStatus.vue.d.ts +14 -0
- package/dist/components/common/StatusIndicator.vue.d.ts +27 -0
- package/dist/components/common/SubmitButton.vue.d.ts +14 -0
- package/dist/components/common/TabNavigation.vue.d.ts +70 -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 +3 -0
- package/dist/components/modals/PrintOptionsModalForm.vue.d.ts +3 -0
- package/dist/components/modals/ShipmentOptionsModal.vue.d.ts +3 -0
- package/dist/components/modals/ShipmentOptionsModalForm.vue.d.ts +15 -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 +8 -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/useOrderMode.d.ts +12 -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 +12 -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 +5 -0
- package/dist/data/orderMode.d.ts +25 -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 +11 -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/addCapabilitiesClearNotification.d.ts +15 -0
- package/dist/forms/helpers/createDefaultOption.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/getDeliveryTypes.d.ts +3 -0
- package/dist/forms/helpers/getFieldLabel.d.ts +7 -0
- package/dist/forms/helpers/getFormCarrierName.d.ts +2 -0
- package/dist/forms/helpers/getPackageTypes.d.ts +3 -0
- package/dist/forms/helpers/index.d.ts +14 -0
- package/dist/forms/helpers/resolveFormComponent.d.ts +3 -0
- package/dist/forms/helpers/setFieldProp.d.ts +8 -0
- package/dist/forms/helpers/triStateFieldIsEnabled.d.ts +2 -0
- package/dist/forms/helpers/updateFieldsDefaults.d.ts +6 -0
- package/dist/forms/helpers/useFormCapabilities.d.ts +66 -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/filterPluginSettingsView.d.ts +15 -0
- package/dist/forms/pluginSettings/generateFormFields.d.ts +8 -0
- package/dist/forms/pluginSettings/index.d.ts +7 -0
- package/dist/forms/pluginSettings/resolveSettingsValues.d.ts +8 -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 +22 -0
- package/dist/forms/shipmentOptions/fieldFactoryRegistry.d.ts +21 -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 +4 -0
- package/dist/forms/shipmentOptions/fields/createDimensionFields.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createInsuranceField.d.ts +17 -0
- package/dist/forms/shipmentOptions/fields/createLabelAmountField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createPackageTypeField.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createRef.d.ts +3 -0
- package/dist/forms/shipmentOptions/fields/createShipmentOptionField.d.ts +15 -0
- package/dist/forms/shipmentOptions/fields/index.d.ts +7 -0
- package/dist/forms/shipmentOptions/index.d.ts +4 -0
- package/dist/forms/shipmentOptions/types.d.ts +2 -0
- package/dist/forms/shipmentOptions/useCapabilitiesAutoClear.d.ts +36 -0
- package/dist/forms/shipmentOptions/useCapabilitiesWatcher.d.ts +22 -0
- package/dist/forms/shipmentOptions/wireProxyCapabilities.d.ts +31 -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 +1 -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 +80 -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 +212 -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/getEnabledValues.d.ts +11 -0
- package/dist/utils/forms/index.d.ts +5 -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 +3 -0
- package/dist/views/Modals.vue.d.ts +3 -0
- package/dist/views/Notifications.vue.d.ts +3 -0
- package/dist/views/OrderBox.vue.d.ts +3 -0
- package/dist/views/OrderListItem.vue.d.ts +3 -0
- package/dist/views/PluginSettings.vue.d.ts +3 -0
- package/dist/views/ProductSettings.vue.d.ts +35 -0
- package/dist/views/integrated/OrderBoxView.vue.d.ts +13 -0
- package/dist/views/integrated/OrderListItemView.vue.d.ts +13 -0
- package/dist/views/integrated/index.d.ts +7 -0
- package/package.json +3 -3
- package/src/actions/composables/queries/account/useOrderCapabilitiesQuery.spec.ts +56 -0
- package/src/actions/composables/queries/account/useOrderCapabilitiesQuery.ts +11 -8
- package/src/actions/composables/queries/account/useShipmentCapabilitiesQuery.spec.ts +64 -0
- package/src/actions/composables/queries/account/useShipmentCapabilitiesQuery.ts +8 -7
- package/src/forms/shipmentOptions/createShipmentOptionsForm.spec.ts +1 -0
- package/src/forms/shipmentOptions/createShipmentOptionsForm.ts +21 -2
- package/src/forms/shipmentOptions/field.ts +12 -0
- package/src/forms/shipmentOptions/fields/createDimensionFields.spec.ts +49 -0
- package/src/forms/shipmentOptions/fields/createDimensionFields.ts +32 -0
- package/src/forms/shipmentOptions/fields/index.ts +1 -0
- package/src/forms/shipmentOptions/useCapabilitiesWatcher.spec.ts +1 -1
- package/src/forms/shipmentOptions/useCapabilitiesWatcher.ts +2 -1
- package/src/forms/shipmentOptions/wireProxyCapabilities.spec.ts +59 -7
- package/src/forms/shipmentOptions/wireProxyCapabilities.ts +31 -20
- package/src/types/sdk.types.ts +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
import { type Variant } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type OneOrMore } from '@myparcel-dev/ts-utils';
|
|
4
|
+
import { type NotificationCategory } from '../data';
|
|
5
|
+
import { type Translation } from './language.types';
|
|
6
|
+
export type NotificationId = number | string;
|
|
7
|
+
export interface PdkNotification {
|
|
8
|
+
category?: NotificationCategory;
|
|
9
|
+
content?: OneOrMore<string>;
|
|
10
|
+
dismissible?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* ID of a notification. If not provided, a unique id will be generated. It may be a string, but make sure this string
|
|
13
|
+
* does not exist in NotificationCategory.
|
|
14
|
+
*
|
|
15
|
+
* @see NotificationCategory
|
|
16
|
+
*/
|
|
17
|
+
id?: NotificationId;
|
|
18
|
+
/**
|
|
19
|
+
* Arbitrary tags that can be set to distinguish notifications from each other.
|
|
20
|
+
*/
|
|
21
|
+
tags?: Record<string, string>;
|
|
22
|
+
timeout?: boolean | number;
|
|
23
|
+
title?: string;
|
|
24
|
+
variant: Variant;
|
|
25
|
+
}
|
|
26
|
+
export type ResolvedNotification = PdkNotification & {
|
|
27
|
+
id: NotificationId;
|
|
28
|
+
timeout: boolean | number;
|
|
29
|
+
dismissible: boolean;
|
|
30
|
+
};
|
|
31
|
+
export type NotificationFilter = (notification: ResolvedNotification) => boolean;
|
|
32
|
+
export type OrderIds = OneOrMore<string>;
|
|
33
|
+
export type ShipmentIds = OneOrMore<string | number>;
|
|
34
|
+
export type ArrayItem<T> = T extends (infer U)[] ? U : T;
|
|
35
|
+
export interface TabDefinition {
|
|
36
|
+
component: string | Component;
|
|
37
|
+
description?: Translation;
|
|
38
|
+
icon?: string;
|
|
39
|
+
label: Translation;
|
|
40
|
+
labelSuffix?: string;
|
|
41
|
+
name: string;
|
|
42
|
+
subtext?: Translation;
|
|
43
|
+
}
|
|
44
|
+
export type WebhookDefinition = {
|
|
45
|
+
connected: boolean;
|
|
46
|
+
hook: string;
|
|
47
|
+
url: null | string;
|
|
48
|
+
};
|
|
49
|
+
export type DefaultSlot = {
|
|
50
|
+
default(): never;
|
|
51
|
+
};
|
|
52
|
+
export type PlainComponentProps = {};
|
|
53
|
+
export type PlainComponentSlots = DefaultSlot;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { type Keyable, type Settings, type ShippingMethodTypeMap, type TriState } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type OptionsProp, type PdkElementEmits, type PdkElementProps, type SelectOptionValue } from './form.types';
|
|
3
|
+
import { type ArrayItem } from './common.types';
|
|
4
|
+
/**
|
|
5
|
+
* @see AdminComponent.CheckboxGroup
|
|
6
|
+
*/
|
|
7
|
+
export type CheckboxGroupModelValue = string | boolean;
|
|
8
|
+
export type CheckboxGroupProps<T extends CheckboxGroupModelValue = CheckboxGroupModelValue> = PdkElementProps<T>;
|
|
9
|
+
export type CheckboxGroupEmits<T extends CheckboxGroupModelValue = CheckboxGroupModelValue> = PdkElementEmits<T>;
|
|
10
|
+
/**
|
|
11
|
+
* @see AdminComponent.CurrencyInput
|
|
12
|
+
*/
|
|
13
|
+
export type CurrencyInputModelValue = string | number;
|
|
14
|
+
export type CurrencyInputProps = PdkElementProps<CurrencyInputModelValue>;
|
|
15
|
+
export type CurrencyInputEmits = PdkElementEmits<number>;
|
|
16
|
+
/**
|
|
17
|
+
* @see AdminComponent.CheckboxInput
|
|
18
|
+
*/
|
|
19
|
+
export type CheckboxInputModelValue = Keyable | boolean;
|
|
20
|
+
export type CheckboxInputProps<T extends CheckboxInputModelValue = CheckboxInputModelValue> = PdkElementProps<T>;
|
|
21
|
+
export type CheckboxInputEmits<T extends CheckboxInputModelValue = CheckboxInputModelValue> = PdkElementEmits<T>;
|
|
22
|
+
/**
|
|
23
|
+
* @see AdminComponent.CodeEditor
|
|
24
|
+
*/
|
|
25
|
+
export type CodeEditorModelValue = TextInputModelValue;
|
|
26
|
+
export type CodeEditorProps = PdkElementProps<CodeEditorModelValue>;
|
|
27
|
+
export type CodeEditorEmits = PdkElementEmits<CodeEditorModelValue>;
|
|
28
|
+
/**
|
|
29
|
+
* @see AdminComponent.DropOffInput
|
|
30
|
+
*/
|
|
31
|
+
export type DropOffInputModelValue = Settings.ModelDropOffPossibilities;
|
|
32
|
+
export type DropOffInputProps = PdkElementProps<DropOffInputModelValue>;
|
|
33
|
+
export type DropOffInputEmits = PdkElementEmits<DropOffInputModelValue>;
|
|
34
|
+
/**
|
|
35
|
+
* @see AdminComponent.SelectInput
|
|
36
|
+
*/
|
|
37
|
+
export type SelectInputModelValue = SelectOptionValue;
|
|
38
|
+
export type SelectInputProps<T extends SelectInputModelValue = SelectInputModelValue> = PdkElementProps<T, OptionsProp<T>>;
|
|
39
|
+
export type SelectInputEmits<T extends SelectInputModelValue = SelectInputModelValue> = PdkElementEmits<T>;
|
|
40
|
+
/**
|
|
41
|
+
* @see AdminComponent.MultiSelectInput
|
|
42
|
+
*/
|
|
43
|
+
export type MultiSelectInputModelValue = SelectOptionValue[];
|
|
44
|
+
export type MultiSelectInputProps<T extends MultiSelectInputModelValue = MultiSelectInputModelValue> = SelectInputProps<ArrayItem<T>>;
|
|
45
|
+
export type MultiSelectInputEmits<T extends MultiSelectInputModelValue = MultiSelectInputModelValue> = SelectInputEmits<ArrayItem<T>>;
|
|
46
|
+
/**
|
|
47
|
+
* @see AdminComponent.NumberInput
|
|
48
|
+
*/
|
|
49
|
+
export type NumberInputModelValue = string | number;
|
|
50
|
+
export type NumberInputProps = PdkElementProps<NumberInputModelValue>;
|
|
51
|
+
export type NumberInputEmits = PdkElementEmits<number>;
|
|
52
|
+
/**
|
|
53
|
+
* @see AdminComponent.RadioGroup
|
|
54
|
+
*/
|
|
55
|
+
export type RadioGroupModelValue = Keyable;
|
|
56
|
+
export type RadioGroupProps<T extends RadioGroupModelValue = RadioGroupModelValue> = PdkElementProps<T, OptionsProp<T>>;
|
|
57
|
+
export type RadioGroupEmits<T extends RadioGroupModelValue = RadioGroupModelValue> = PdkElementEmits<T>;
|
|
58
|
+
/**
|
|
59
|
+
* @see AdminComponent.RadioInput
|
|
60
|
+
*/
|
|
61
|
+
export type RadioInputModelValue = string | number;
|
|
62
|
+
export type RadioInputProps = PdkElementProps<RadioInputModelValue>;
|
|
63
|
+
export type RadioInputEmits = PdkElementEmits<string>;
|
|
64
|
+
/**
|
|
65
|
+
* @see AdminComponent.TextInput
|
|
66
|
+
*/
|
|
67
|
+
export type TextInputModelValue = string;
|
|
68
|
+
export type TextInputProps = PdkElementProps<TextInputModelValue>;
|
|
69
|
+
export type TextInputEmits = PdkElementEmits<TextInputModelValue>;
|
|
70
|
+
/**
|
|
71
|
+
* @see AdminComponent.TextArea
|
|
72
|
+
*/
|
|
73
|
+
export type TextAreaModelValue = string;
|
|
74
|
+
export type TextAreaProps = PdkElementProps<TextAreaModelValue>;
|
|
75
|
+
export type TextAreaEmits = PdkElementEmits<TextAreaModelValue>;
|
|
76
|
+
/**
|
|
77
|
+
* @see AdminComponent.TimeInput
|
|
78
|
+
*/
|
|
79
|
+
export type TimeInputModelValue = string;
|
|
80
|
+
export type TimeInputProps = PdkElementProps<TimeInputModelValue>;
|
|
81
|
+
export type TimeInputEmits = PdkElementEmits<TimeInputModelValue>;
|
|
82
|
+
/**
|
|
83
|
+
* @see AdminComponent.ToggleInput
|
|
84
|
+
*/
|
|
85
|
+
export type ToggleInputModelValue = TriState.On | TriState.Off;
|
|
86
|
+
export type ToggleInputProps = PdkElementProps<ToggleInputModelValue>;
|
|
87
|
+
export type ToggleInputEmits = PdkElementEmits<ToggleInputModelValue>;
|
|
88
|
+
/**
|
|
89
|
+
* @see AdminComponent.TriStateInput
|
|
90
|
+
*/
|
|
91
|
+
export type TriStateInputModelValue = TriState;
|
|
92
|
+
export type TriStateInputProps = PdkElementProps<TriStateInputModelValue, {
|
|
93
|
+
defaultValue?: TriStateInputModelValue;
|
|
94
|
+
}>;
|
|
95
|
+
export type TriStateInputEmits = PdkElementEmits<TriStateInputModelValue>;
|
|
96
|
+
/**
|
|
97
|
+
* @see AdminComponent.ShippingMethodsInput
|
|
98
|
+
*/
|
|
99
|
+
export type ShippingMethodsInputModelValue = ShippingMethodTypeMap;
|
|
100
|
+
export type ShippingMethodsInputProps<T extends ShippingMethodsInputModelValue = ShippingMethodsInputModelValue> = PdkElementProps<T, OptionsProp<string>>;
|
|
101
|
+
export type ShippingMethodsInputEmits<T extends ShippingMethodsInputModelValue = ShippingMethodsInputModelValue> = PdkElementEmits<T>;
|
|
102
|
+
/**
|
|
103
|
+
* @see AdminComponent.MultiDateInput
|
|
104
|
+
*/
|
|
105
|
+
export type MultiDateInputModelValue = Date[];
|
|
106
|
+
export type MultiDateInputProps = PdkElementProps<MultiDateInputModelValue>;
|
|
107
|
+
export type MultiDateInputEmits = PdkElementEmits<Date[]>;
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { type SlotsType } from 'vue';
|
|
2
|
+
import { type Size } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type AdminIcon, type AdminModalKey } from '../data';
|
|
4
|
+
import { type Translation } from './language.types';
|
|
5
|
+
import { type PdkElementProps } from './form.types';
|
|
6
|
+
import { type AdminModalContext } from './context.types';
|
|
7
|
+
import { type DefaultSlot, type PdkNotification, type PlainComponentProps, type PlainComponentSlots } from './common.types';
|
|
8
|
+
import { type ActionDefinition } from './actions.types';
|
|
9
|
+
/**
|
|
10
|
+
* @see AdminComponent.Badge
|
|
11
|
+
*/
|
|
12
|
+
export type BadgeProps = PlainComponentProps;
|
|
13
|
+
export type BadgeSlots = PlainComponentSlots;
|
|
14
|
+
/**
|
|
15
|
+
* @see AdminComponent.Box
|
|
16
|
+
*/
|
|
17
|
+
export type BoxProps = {
|
|
18
|
+
/**
|
|
19
|
+
* Used to control loading state.
|
|
20
|
+
*/
|
|
21
|
+
loading: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Size of the box.
|
|
24
|
+
*/
|
|
25
|
+
size: Size;
|
|
26
|
+
/**
|
|
27
|
+
* Title of the box.
|
|
28
|
+
*/
|
|
29
|
+
title?: string;
|
|
30
|
+
};
|
|
31
|
+
export type BoxEmits = (e: 'clickHeader') => void;
|
|
32
|
+
export type BoxSlots = DefaultSlot & {
|
|
33
|
+
header(): never;
|
|
34
|
+
footer(): never;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* @see AdminComponent.Button
|
|
38
|
+
*/
|
|
39
|
+
export type ButtonProps = {
|
|
40
|
+
/**
|
|
41
|
+
* Controls disabled state.
|
|
42
|
+
*/
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Icon.
|
|
46
|
+
*/
|
|
47
|
+
icon: AdminIcon | null;
|
|
48
|
+
/**
|
|
49
|
+
* Button label. Can be used instead of the slot.
|
|
50
|
+
*/
|
|
51
|
+
label: string;
|
|
52
|
+
/**
|
|
53
|
+
* Size of the button.
|
|
54
|
+
*/
|
|
55
|
+
size: Size;
|
|
56
|
+
};
|
|
57
|
+
export type ButtonEmits = (e: 'click') => void;
|
|
58
|
+
export type ButtonSlots = DefaultSlot;
|
|
59
|
+
/**
|
|
60
|
+
* @see AdminComponent.ButtonGroup
|
|
61
|
+
*/
|
|
62
|
+
export type ButtonGroupProps = PlainComponentProps;
|
|
63
|
+
export type ButtonGroupSlots = PlainComponentSlots;
|
|
64
|
+
/**
|
|
65
|
+
* @see AdminComponent.Col
|
|
66
|
+
*/
|
|
67
|
+
export type ColProps = {};
|
|
68
|
+
export type ColSlots = DefaultSlot;
|
|
69
|
+
/**
|
|
70
|
+
* @see AdminComponent.ConceptBoxWrapper
|
|
71
|
+
*/
|
|
72
|
+
export type ConceptBoxWrapperProps = PlainComponentProps;
|
|
73
|
+
export type ConceptBoxWrapperSlots = PlainComponentSlots;
|
|
74
|
+
/**
|
|
75
|
+
* @see AdminComponent.DropdownButton
|
|
76
|
+
*/
|
|
77
|
+
export type DropdownButtonProps = {
|
|
78
|
+
/**
|
|
79
|
+
* List of actions.
|
|
80
|
+
*/
|
|
81
|
+
actions: ActionDefinition[];
|
|
82
|
+
/**
|
|
83
|
+
* Controls disabled state.
|
|
84
|
+
*/
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* To hide the text of the standalone actions.
|
|
88
|
+
*/
|
|
89
|
+
hideText?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Size of the button.
|
|
92
|
+
*/
|
|
93
|
+
size?: Size;
|
|
94
|
+
};
|
|
95
|
+
export type DropdownButtonSlots = DefaultSlot;
|
|
96
|
+
/**
|
|
97
|
+
* @see AdminComponent.FormGroup
|
|
98
|
+
*/
|
|
99
|
+
export type FormGroupProps = PdkElementProps<never, {
|
|
100
|
+
label?: Translation;
|
|
101
|
+
description?: Translation;
|
|
102
|
+
subtext?: Translation;
|
|
103
|
+
}>;
|
|
104
|
+
export type FormGroupSlots = DefaultSlot & {
|
|
105
|
+
label(): never;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* @see AdminComponent.Heading
|
|
109
|
+
*/
|
|
110
|
+
export type HeadingProps = {
|
|
111
|
+
level: number | string;
|
|
112
|
+
};
|
|
113
|
+
export type HeadingSlots = DefaultSlot;
|
|
114
|
+
/**
|
|
115
|
+
* @see AdminComponent.Icon
|
|
116
|
+
*/
|
|
117
|
+
export type IconProps = {
|
|
118
|
+
/**
|
|
119
|
+
* The icon to display.
|
|
120
|
+
*/
|
|
121
|
+
icon: AdminIcon;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* @see AdminComponent.Image
|
|
125
|
+
*/
|
|
126
|
+
export type ImageProps = {
|
|
127
|
+
/**
|
|
128
|
+
* The source of the image.
|
|
129
|
+
*/
|
|
130
|
+
src: string;
|
|
131
|
+
/**
|
|
132
|
+
* The alternative text of the image.
|
|
133
|
+
*/
|
|
134
|
+
alt: string;
|
|
135
|
+
/**
|
|
136
|
+
* The title of the image.
|
|
137
|
+
*/
|
|
138
|
+
title?: string | null;
|
|
139
|
+
/**
|
|
140
|
+
* The width of the image.
|
|
141
|
+
*/
|
|
142
|
+
width?: number | string | null;
|
|
143
|
+
/**
|
|
144
|
+
* The height of the image.
|
|
145
|
+
*/
|
|
146
|
+
height?: number | string | null;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* @see AdminComponent.Link
|
|
150
|
+
*/
|
|
151
|
+
export type LinkProps = {
|
|
152
|
+
action?: ActionDefinition;
|
|
153
|
+
hideText?: boolean;
|
|
154
|
+
href?: string;
|
|
155
|
+
};
|
|
156
|
+
export type LinkEmits = (e: 'click', event: MouseEvent) => void;
|
|
157
|
+
export type LinkSlots = DefaultSlot;
|
|
158
|
+
/**
|
|
159
|
+
* @see AdminComponent.Loader
|
|
160
|
+
*/
|
|
161
|
+
export type LoaderProps = {
|
|
162
|
+
/**
|
|
163
|
+
* The size of the loader.
|
|
164
|
+
*/
|
|
165
|
+
size: Size;
|
|
166
|
+
/**
|
|
167
|
+
* The html tag. Defaults to 'div'.
|
|
168
|
+
*/
|
|
169
|
+
tag: string;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* @see AdminComponent.Modal
|
|
173
|
+
*/
|
|
174
|
+
export type ModalProps = {
|
|
175
|
+
/**
|
|
176
|
+
* Available actions in the modal.
|
|
177
|
+
*/
|
|
178
|
+
actions?: ActionDefinition[];
|
|
179
|
+
/**
|
|
180
|
+
* Modal key.
|
|
181
|
+
*/
|
|
182
|
+
modalKey: AdminModalKey;
|
|
183
|
+
/**
|
|
184
|
+
* Modal title.
|
|
185
|
+
*/
|
|
186
|
+
title?: string;
|
|
187
|
+
};
|
|
188
|
+
export type ModalSlots = {
|
|
189
|
+
default(context: AdminModalContext): never;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* @see AdminComponent.Notification
|
|
193
|
+
*/
|
|
194
|
+
export type NotificationProps = {
|
|
195
|
+
/**
|
|
196
|
+
* The notification to display.
|
|
197
|
+
*/
|
|
198
|
+
notification: PdkNotification;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* @see AdminComponent.PluginSettingsWrapper
|
|
202
|
+
*/
|
|
203
|
+
export type PluginSettingsWrapperProps = PlainComponentProps;
|
|
204
|
+
export type PluginSettingsWrapperSlots = PlainComponentSlots;
|
|
205
|
+
/**
|
|
206
|
+
* @see AdminComponent.Row
|
|
207
|
+
*/
|
|
208
|
+
export type RowProps = {};
|
|
209
|
+
export type RowSlots = DefaultSlot;
|
|
210
|
+
/**
|
|
211
|
+
* @see AdminComponent.SettingsDivider
|
|
212
|
+
*/
|
|
213
|
+
export type SettingsDividerProps = PdkElementProps<never, {
|
|
214
|
+
content?: Translation;
|
|
215
|
+
heading?: Translation;
|
|
216
|
+
level?: number | string;
|
|
217
|
+
}>;
|
|
218
|
+
/**
|
|
219
|
+
* @see AdminComponent.ShipmentLabelWrapper
|
|
220
|
+
*/
|
|
221
|
+
export type ShipmentLabelWrapperProps = PlainComponentProps;
|
|
222
|
+
export type ShipmentLabelWrapperSlots = PlainComponentSlots;
|
|
223
|
+
/**
|
|
224
|
+
* @see AdminComponent.Table
|
|
225
|
+
*/
|
|
226
|
+
export type TableProps = {
|
|
227
|
+
transition?: false | string;
|
|
228
|
+
};
|
|
229
|
+
export type TableSlots = DefaultSlot & {
|
|
230
|
+
header(): never;
|
|
231
|
+
footer(): never;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* The component that is used to render a table column in a Table.
|
|
235
|
+
*
|
|
236
|
+
* @see AdminComponent.TableCol
|
|
237
|
+
*/
|
|
238
|
+
export type TableColProps = {
|
|
239
|
+
/**
|
|
240
|
+
* Component to use as the table column. Defaults to 'td'.
|
|
241
|
+
*/
|
|
242
|
+
component?: string;
|
|
243
|
+
};
|
|
244
|
+
export type TableColSlots = DefaultSlot;
|
|
245
|
+
/**
|
|
246
|
+
* The component that is used to render a table row in a Table.
|
|
247
|
+
*
|
|
248
|
+
* @see AdminComponent.TableRow
|
|
249
|
+
*/
|
|
250
|
+
export type TableRowProps = {
|
|
251
|
+
/**
|
|
252
|
+
* Component to use as the table row. Defaults to 'tr'.
|
|
253
|
+
*/
|
|
254
|
+
component?: string;
|
|
255
|
+
};
|
|
256
|
+
export type TableRowSlots = SlotsType<DefaultSlot>;
|
|
257
|
+
/**
|
|
258
|
+
* @see AdminComponent.TabNavButton
|
|
259
|
+
*/
|
|
260
|
+
export type TabNavButtonProps = {
|
|
261
|
+
active: boolean;
|
|
262
|
+
};
|
|
263
|
+
export type TabNavButtonEmits = (e: 'click') => void;
|
|
264
|
+
/**
|
|
265
|
+
* @see AdminComponent.TabNavButtonWrapper
|
|
266
|
+
*/
|
|
267
|
+
export type TabNavButtonWrapperProps = PlainComponentProps;
|
|
268
|
+
export type TabNavButtonWrapperSlots = PlainComponentSlots;
|
|
269
|
+
/**
|
|
270
|
+
* @see AdminComponent.TabNavContentWrapper
|
|
271
|
+
*/
|
|
272
|
+
export type TabNavContentWrapperProps = PlainComponentProps;
|
|
273
|
+
export type TabNavContentWrapperSlots = PlainComponentSlots;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type PiniaPluginContext } from 'pinia';
|
|
2
|
+
import { type FormConfiguration, type InteractiveElementInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import { type MakeOptional } from '@myparcel-dev/ts-utils';
|
|
4
|
+
import { type LogLevel } from '../services';
|
|
5
|
+
import { type FORM_KEYS } from '../forms';
|
|
6
|
+
import { type FormatterObject } from '../composables';
|
|
7
|
+
import { type AdminContextObject } from './context.types';
|
|
8
|
+
import { type AdminComponentMap, type PrefixedAdminComponentMap } from './admin.types';
|
|
9
|
+
export type DefaultAdminConfiguration = Omit<AdminConfiguration, 'context' | 'components' | 'generateFieldId'> & {
|
|
10
|
+
components?: Record<string, undefined>;
|
|
11
|
+
formatters: Record<string, undefined>;
|
|
12
|
+
generateFieldId(element: InteractiveElementInstance): string;
|
|
13
|
+
};
|
|
14
|
+
export type AdminConfiguration = {
|
|
15
|
+
/**
|
|
16
|
+
* Components to use.
|
|
17
|
+
*/
|
|
18
|
+
components: AdminComponentMap | PrefixedAdminComponentMap;
|
|
19
|
+
/**
|
|
20
|
+
* Override default formatters.
|
|
21
|
+
*/
|
|
22
|
+
formatters?: FormatterObject;
|
|
23
|
+
/**
|
|
24
|
+
* Log level to use. Defaults to 'info' on production and 'debug' on development.
|
|
25
|
+
*/
|
|
26
|
+
logLevel: LogLevel;
|
|
27
|
+
/**
|
|
28
|
+
* Configuration to pass to @myparcel-dev/vue-form-builder.
|
|
29
|
+
*/
|
|
30
|
+
formConfig?: Omit<FormConfiguration, 'fields'>;
|
|
31
|
+
/**
|
|
32
|
+
* Overrides per form.
|
|
33
|
+
*/
|
|
34
|
+
formConfigOverrides?: Partial<Record<(typeof FORM_KEYS)[number], Omit<FormConfiguration, 'fields'> & {
|
|
35
|
+
/**
|
|
36
|
+
* Callback to generate a field id.
|
|
37
|
+
*/
|
|
38
|
+
generateFieldId?(element: InteractiveElementInstance): string;
|
|
39
|
+
}>>;
|
|
40
|
+
/**
|
|
41
|
+
* Transition names.
|
|
42
|
+
*/
|
|
43
|
+
transitions?: {
|
|
44
|
+
shipmentBox?: string;
|
|
45
|
+
modal?: string;
|
|
46
|
+
modalBackdrop?: string;
|
|
47
|
+
notification?: string;
|
|
48
|
+
shipmentRow?: string;
|
|
49
|
+
tabNavigation?: string;
|
|
50
|
+
tableRow?: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Css classes for common utility usage.
|
|
54
|
+
*/
|
|
55
|
+
cssUtilities?: {
|
|
56
|
+
animationLoading?: string;
|
|
57
|
+
animationSpin?: string;
|
|
58
|
+
cursorDefault?: string;
|
|
59
|
+
cursorPointer?: string;
|
|
60
|
+
displayFlex?: string;
|
|
61
|
+
flexGrow?: string;
|
|
62
|
+
marginLAuto?: string;
|
|
63
|
+
marginYAuto?: string;
|
|
64
|
+
textCenter?: string;
|
|
65
|
+
textColorError?: string;
|
|
66
|
+
textColorSuccess?: string;
|
|
67
|
+
whitespaceNoWrap?: string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Hook that executes when a store is created.
|
|
71
|
+
*/
|
|
72
|
+
onCreateStore?(piniaContext: PiniaPluginContext): void;
|
|
73
|
+
/**
|
|
74
|
+
* Hook that executes before an app is created.
|
|
75
|
+
*/
|
|
76
|
+
beforeRender?(configuration: AdminConfiguration): void;
|
|
77
|
+
/**
|
|
78
|
+
* Hook that executes after an app is created.
|
|
79
|
+
*/
|
|
80
|
+
onRendered?(configuration: AdminConfiguration): void;
|
|
81
|
+
/**
|
|
82
|
+
* Hook that executes before the pdk admin is created.
|
|
83
|
+
*/
|
|
84
|
+
beforeInitialize?(configuration: AdminConfiguration, context: AdminContextObject): void;
|
|
85
|
+
/**
|
|
86
|
+
* Hook that executes after the pdk admin is created.
|
|
87
|
+
*/
|
|
88
|
+
onInitialized?(configuration: AdminConfiguration, context: AdminContextObject): void;
|
|
89
|
+
/**
|
|
90
|
+
* Callback to generate a field id.
|
|
91
|
+
*/
|
|
92
|
+
generateFieldId(element: InteractiveElementInstance): string;
|
|
93
|
+
};
|
|
94
|
+
export type AdminConfigurationPreset = Omit<Partial<AdminConfiguration>, 'components'>;
|
|
95
|
+
export type InputAdminConfiguration = MakeOptional<AdminConfiguration, 'generateFieldId'>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type AdminContextKey, type Plugin } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import { type OneOrMore, type Replace } from '@myparcel-dev/ts-utils';
|
|
4
|
+
import { type AdminInstanceContextKey, type AdminModalKey } from '../data';
|
|
5
|
+
import { type BackendPdkEndpointObject } from './endpoints.types';
|
|
6
|
+
export type AdminContextObject = Replace<Plugin.ModelContextContextBag, 'global', GlobalAdminContext> & Partial<AdminInstanceContext>;
|
|
7
|
+
export type GlobalAdminContext = Replace<Plugin.ModelContextGlobalContext, 'endpoints', BackendPdkEndpointObject>;
|
|
8
|
+
export type AnyAdminContext = AdminContext<AdminContextKey>;
|
|
9
|
+
export type AdminContext<T> = T extends keyof AdminContextObject ? AdminContextObject[T] : never;
|
|
10
|
+
export type AdminInstanceContext = {
|
|
11
|
+
[AdminInstanceContextKey.OrderIdentifier]: Plugin.ModelContextOrderDataContext['externalIdentifier'];
|
|
12
|
+
[AdminInstanceContextKey.ProductIdentifier]: Plugin.ModelContextProductDataContext['externalIdentifier'];
|
|
13
|
+
};
|
|
14
|
+
type BaseModalContext = {
|
|
15
|
+
form?: FormInstance;
|
|
16
|
+
};
|
|
17
|
+
export type AdminModalContext<T extends AdminModalKey = AdminModalKey> = (BaseModalContext & (T extends AdminModalKey.ShipmentOptions ? {
|
|
18
|
+
orderIds?: OneOrMore<string>;
|
|
19
|
+
} : unknown)) | null;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BackendEndpoint, type EndpointObject } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type BACKEND_ENDPOINTS_DEBUG, type BACKEND_ENDPOINTS_ORDERS, type BACKEND_ENDPOINTS_SHIPMENTS, type BACKEND_ENDPOINTS_WEBHOOKS } from '../data';
|
|
3
|
+
export type BackendPdkEndpointObject = EndpointObject<BackendEndpoint>;
|
|
4
|
+
export type BackendShipmentEndpoint = (typeof BACKEND_ENDPOINTS_SHIPMENTS)[number];
|
|
5
|
+
export type BackendOrderEndpoint = (typeof BACKEND_ENDPOINTS_ORDERS)[number];
|
|
6
|
+
export type BackendWebhookEndpoint = (typeof BACKEND_ENDPOINTS_WEBHOOKS)[number];
|
|
7
|
+
export type BackendDebugEndpoint = (typeof BACKEND_ENDPOINTS_DEBUG)[number];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Keyable, type SortType } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type InteractiveElementInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import { type AdminIcon } from '../data';
|
|
4
|
+
import { type Translatable, type Translation } from './language.types';
|
|
5
|
+
export type GlobalFieldProps = {
|
|
6
|
+
description?: Translation;
|
|
7
|
+
subtext?: Translation;
|
|
8
|
+
value?: unknown;
|
|
9
|
+
};
|
|
10
|
+
export type ElementInstance<Type = unknown, Props = any> = InteractiveElementInstance<Type, Props & GlobalFieldProps & Record<string, unknown>>;
|
|
11
|
+
export type OptionsProp<T extends SelectOptionValue = SelectOptionValue> = {
|
|
12
|
+
options?: SelectOption<T>[];
|
|
13
|
+
sort?: SortType;
|
|
14
|
+
};
|
|
15
|
+
export type PdkElementProps<ModelValue extends unknown = Keyable, Props = any> = {
|
|
16
|
+
element: ElementInstance<ModelValue, Props>;
|
|
17
|
+
modelValue: ModelValue;
|
|
18
|
+
};
|
|
19
|
+
export type PdkElementEmits<ModelValue extends unknown = Keyable> = (event: 'update:modelValue', value: ModelValue) => void;
|
|
20
|
+
export type RadioGroupOption<Value extends Keyable = Keyable> = SelectOption<Value> & {
|
|
21
|
+
image?: string;
|
|
22
|
+
icon?: AdminIcon;
|
|
23
|
+
};
|
|
24
|
+
interface BaseSelectOption<Value extends SelectOptionValue = SelectOptionValue> {
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
icon?: string | AdminIcon;
|
|
27
|
+
image?: string;
|
|
28
|
+
description?: Translatable;
|
|
29
|
+
value: Value;
|
|
30
|
+
}
|
|
31
|
+
export interface SelectOptionWithLabel<Value extends SelectOptionValue = SelectOptionValue, T extends Translation = Translation> extends BaseSelectOption<Value> {
|
|
32
|
+
label: T;
|
|
33
|
+
}
|
|
34
|
+
export interface SelectOptionWithPlainLabel<Value extends SelectOptionValue = SelectOptionValue, T extends Translation = Translation> extends BaseSelectOption<Value> {
|
|
35
|
+
plainLabel: T;
|
|
36
|
+
}
|
|
37
|
+
export type SelectOptionValue = Keyable | boolean;
|
|
38
|
+
export type SelectOption<Value extends SelectOptionValue = SelectOptionValue> = SelectOptionWithLabel<Value> | SelectOptionWithPlainLabel<Value>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * from './actions.types';
|
|
3
|
+
export * from './admin.types';
|
|
4
|
+
export * from './common.types';
|
|
5
|
+
export * from './components-form.types';
|
|
6
|
+
export * from './components.types';
|
|
7
|
+
export * from './configuration.types';
|
|
8
|
+
export * from './context.types';
|
|
9
|
+
export * from './endpoints.types';
|
|
10
|
+
export * from './form.types';
|
|
11
|
+
export * from './language.types';
|
|
12
|
+
export * from './sdk.types';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Keyable } from '@myparcel-dev/pdk-common';
|
|
2
|
+
export interface NonTranslatable {
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Translatable {
|
|
6
|
+
key: string;
|
|
7
|
+
args?: Record<Keyable, Keyable>;
|
|
8
|
+
}
|
|
9
|
+
export type Translation = string | Translatable | NonTranslatable;
|