@myparcel-dev/pdk-admin 2.1.0 → 2.2.1
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 +15 -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 +5 -6
- 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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a translation key for a shipment option field label.
|
|
3
|
+
*
|
|
4
|
+
* Accepts `string` because option names come from the carrier context at
|
|
5
|
+
* runtime. Converts to snake_case for the translation lookup.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getFieldLabel: (name: string) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './addBulkEditNotification';
|
|
2
|
+
export * from './addCapabilitiesClearNotification';
|
|
3
|
+
export * from './createDefaultOption';
|
|
4
|
+
export * from './createLabel';
|
|
5
|
+
export * from './defineFormField';
|
|
6
|
+
export * from './getDeliveryTypes';
|
|
7
|
+
export * from './getFieldLabel';
|
|
8
|
+
export * from './getFormCarrierName';
|
|
9
|
+
export * from './getPackageTypes';
|
|
10
|
+
export * from './resolveFormComponent';
|
|
11
|
+
export * from './setFieldProp';
|
|
12
|
+
export * from './triStateFieldIsEnabled';
|
|
13
|
+
export * from './updateFieldsDefaults';
|
|
14
|
+
export * from './useFormCapabilities';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type ElementInstance } from '../../types';
|
|
3
|
+
type SetFieldProp = {
|
|
4
|
+
(form: FormInstance, name: string, key: string, value: unknown): void;
|
|
5
|
+
(field: ElementInstance, key: string, value: unknown, arg3?: never, arg4?: never): void;
|
|
6
|
+
};
|
|
7
|
+
export declare const setFieldProp: SetFieldProp;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Shipment } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type InteractiveElementInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
/**
|
|
4
|
+
* Update the default values of the fields based on the carrier, so the tri-state defaults are correct.
|
|
5
|
+
*/
|
|
6
|
+
export declare const updateFieldsDefaults: (carrier: string, { form, name }: InteractiveElementInstance, inheritedDeliveryOptions: Record<string, Shipment.ModelDeliveryOptions>) => void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type CarrierModel } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type SelectOption } from '../../types';
|
|
4
|
+
import { type Formatter } from '../../composables';
|
|
5
|
+
/**
|
|
6
|
+
* Bag of capability resolvers, each pre-bound to a Pinia store + orderId snapshot captured at
|
|
7
|
+
* the composable's invocation time. Returned by {@link useFormCapabilities}.
|
|
8
|
+
*
|
|
9
|
+
* The functions are plain — they don't call `useQueryStore()` / `getOrderId()` on each
|
|
10
|
+
* invocation, so they're safe to call from outside Vue setup context (e.g. inside
|
|
11
|
+
* vue-form-builder's `visibleWhen` / `disabledWhen` / `readOnlyWhen` / `afterUpdate`
|
|
12
|
+
* watchEffect-driven re-evaluators, where `inject()` is not available).
|
|
13
|
+
*/
|
|
14
|
+
export type FormCapabilities = {
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the chosen carrier's order-level capability data — destination + weight scope only.
|
|
17
|
+
* Used to populate carrier / packageType / deliveryType dropdowns. `requires` / `excludes`
|
|
18
|
+
* are NEVER populated through this path; they only appear on `getCarrierCapabilitiesForShipment`.
|
|
19
|
+
*/
|
|
20
|
+
getCarrierCapabilitiesForOrder: (form: FormInstance) => CarrierModel | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the chosen carrier's shipment-level capability data — narrowed to the full
|
|
23
|
+
* selection (carrier + packageType + deliveryType + cc + weight). Three return states:
|
|
24
|
+
*
|
|
25
|
+
* 1. **Shipment-narrow carrier** — query is `success` AND its results contain the chosen
|
|
26
|
+
* carrier. Returns that carrier with the narrow option set.
|
|
27
|
+
* 2. **Order-level fallback** — query isn't registered, loading, or errored. Falls back to
|
|
28
|
+
* `getCarrierCapabilitiesForOrder` so transient loading windows don't empty the form.
|
|
29
|
+
* 3. **`undefined`** — query is `success` but its results don't contain the chosen carrier.
|
|
30
|
+
* Server has confirmed the combo is invalid; consumers must handle gracefully.
|
|
31
|
+
*/
|
|
32
|
+
getCarrierCapabilitiesForShipment: (form: FormInstance) => CarrierModel | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the chosen shipment configuration supports a given option. Reads from the
|
|
35
|
+
* shipment-scoped carrier; falls through to order-level data when shipment data isn't
|
|
36
|
+
* available yet.
|
|
37
|
+
*/
|
|
38
|
+
hasShipmentOption: (form: FormInstance, option: string) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Insurance amount bracket options derived from the currently selected carrier's
|
|
41
|
+
* `insuredAmount` data. Amounts in the context are in cents; emitted values are strings
|
|
42
|
+
* representing cent amounts so they round-trip through form select inputs unchanged.
|
|
43
|
+
*/
|
|
44
|
+
getInsuranceOptions: (form: FormInstance, formatter: Formatter) => SelectOption[];
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Closure-factory composable that captures Pinia + orderId references ONCE at its
|
|
48
|
+
* setup-context invocation, and returns plain resolver functions pre-bound to those captures.
|
|
49
|
+
*
|
|
50
|
+
* Why this exists: form-builder's `visibleWhen` / `disabledWhen` / `readOnlyWhen` / `afterUpdate`
|
|
51
|
+
* re-evaluators run inside an internal `watchEffect`, NOT inside Vue setup. Calling
|
|
52
|
+
* `useQueryStore()` / `useContext()` / `getOrderId()` from those callbacks fires Vue's
|
|
53
|
+
* `inject() can only be used inside setup()` warning AND can return a disconnected store
|
|
54
|
+
* instance, breaking reactive dep tracking on `queries.value[modifier]`.
|
|
55
|
+
*
|
|
56
|
+
* Capturing once here, then closing over those references in the returned resolvers, gives
|
|
57
|
+
* factories a single seam to call from setup — `const capabilities = useFormCapabilities()` — without
|
|
58
|
+
* threading a context object through every helper signature.
|
|
59
|
+
*
|
|
60
|
+
* Pinia is a singleton, so all `useFormCapabilities()` callers within the same Pinia instance
|
|
61
|
+
* reference the same underlying store. The dynamic-context entry in the store is itself a
|
|
62
|
+
* TanStack query whose `data` is reactive — `useFetchContextQuery` refetches `Dynamic` on
|
|
63
|
+
* window focus, so we read `query.data` live on every resolver call rather than snapshotting
|
|
64
|
+
* the carriers array at setup time.
|
|
65
|
+
*/
|
|
66
|
+
export declare const useFormCapabilities: () => FormCapabilities;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import { type PluginSettingsTabsContext } from './types';
|
|
4
|
+
export declare const createPluginSettingsForm: (id: string, view: Plugin.SettingsView, context: PluginSettingsTabsContext) => FormInstance;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type TabDefinition } from '../../types';
|
|
3
|
+
import { type PluginSettingsTabsContext } from './types';
|
|
4
|
+
export declare const createPluginSettingsTabs: (view: Plugin.ModelContextPluginSettingsViewContext, context: PluginSettingsTabsContext) => TabDefinition[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type PluginSettingsTabsContext } from './types';
|
|
4
|
+
export declare const createPluginSettingsTabsComponent: (id: string, view: Plugin.SettingsView, context: PluginSettingsTabsContext) => Component;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { OrderMode } from '../../data';
|
|
3
|
+
/**
|
|
4
|
+
* Filter the plugin-settings view for the active order mode.
|
|
5
|
+
*
|
|
6
|
+
* Today the V2 hybrid surfaces all the same tabs and fields as Shipments mode so
|
|
7
|
+
* manual export keeps working. Only Order v1 hides the shipment-export-specific
|
|
8
|
+
* fields, because v1 uses fulfilment orders instead.
|
|
9
|
+
*
|
|
10
|
+
* @TODO INT-1590: once sales-channel detection lands, re-introduce tab hiding for
|
|
11
|
+
* V2 with an active sales channel — the label/customs tabs and shipment-export
|
|
12
|
+
* fields become irrelevant when the sales channel handles fulfilment
|
|
13
|
+
* end-to-end.
|
|
14
|
+
*/
|
|
15
|
+
export declare const filterPluginSettingsView: (view: Plugin.ModelContextPluginSettingsViewContext, orderMode: OrderMode) => Plugin.ModelContextPluginSettingsViewContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AnyElementConfiguration } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
3
|
+
type GenerateFormFields = (config: {
|
|
4
|
+
fields: null | Plugin.Field[];
|
|
5
|
+
values: Record<string, unknown>;
|
|
6
|
+
}, prefix?: string) => AnyElementConfiguration[];
|
|
7
|
+
export declare const generateFormFields: GenerateFormFields;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './createFormTab';
|
|
2
|
+
export * from './createPluginSettingsForm';
|
|
3
|
+
export * from './createPluginSettingsTabs';
|
|
4
|
+
export * from './createPluginSettingsTabsComponent';
|
|
5
|
+
export * from './filterPluginSettingsView';
|
|
6
|
+
export * from './generateFormFields';
|
|
7
|
+
export * from './types';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve settings values for a given form ID, falling back to the wildcard
|
|
3
|
+
* key when no carrier-specific settings have been saved yet.
|
|
4
|
+
*
|
|
5
|
+
* Example: "carrier.POSTNL" → try pluginSettings.carrier.POSTNL first,
|
|
6
|
+
* fall back to pluginSettings.carrier.* if it doesn't exist.
|
|
7
|
+
*/
|
|
8
|
+
export declare const resolveSettingsValues: (pluginSettings: Record<string, unknown>, id: string) => Record<string, unknown>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
2
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import { type AdminConfiguration, type TabDefinition } from '../../types';
|
|
4
|
+
import { type AdminAction } from '../../data';
|
|
5
|
+
import { type ActionContext } from '../../actions';
|
|
6
|
+
export interface FormTab extends Omit<TabDefinition, 'component'> {
|
|
7
|
+
form: FormInstance;
|
|
8
|
+
}
|
|
9
|
+
export type PluginSettingsTabsContext = {
|
|
10
|
+
pluginSettings: Plugin.ModelContextDynamicContext['pluginSettings'];
|
|
11
|
+
actionContext: ActionContext<AdminAction.PluginSettingsUpdate>;
|
|
12
|
+
config: AdminConfiguration;
|
|
13
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type OneOrMore } from '@myparcel-dev/ts-utils';
|
|
3
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
4
|
+
export declare const createShipmentOptionsForm: (orders?: OneOrMore<Plugin.ModelPdkOrder>) => FormInstance;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type FieldName = string;
|
|
2
|
+
export declare const SHIPMENT_OPTIONS = "shipmentOptions";
|
|
3
|
+
export declare const CARRIER = "carrier";
|
|
4
|
+
export declare const LABEL_AMOUNT = "labelAmount";
|
|
5
|
+
export declare const PACKAGE_TYPE = "packageType";
|
|
6
|
+
export declare const DELIVERY_TYPE = "deliveryType";
|
|
7
|
+
export declare const MANUAL_WEIGHT = "manualWeight";
|
|
8
|
+
export declare const LENGTH = "length";
|
|
9
|
+
export declare const WIDTH = "width";
|
|
10
|
+
export declare const HEIGHT = "height";
|
|
11
|
+
export declare const PROP_OPTIONS = "options";
|
|
12
|
+
export declare const KEY_DESCRIPTION = "description";
|
|
13
|
+
export declare const KEY_SUBTEXT = "subtext";
|
|
14
|
+
export declare const FIELD_CARRIER: FieldName;
|
|
15
|
+
export declare const FIELD_LABEL_AMOUNT: FieldName;
|
|
16
|
+
export declare const FIELD_PACKAGE_TYPE: FieldName;
|
|
17
|
+
export declare const FIELD_DELIVERY_TYPE: FieldName;
|
|
18
|
+
export declare const FIELD_MANUAL_WEIGHT: FieldName;
|
|
19
|
+
export declare const FIELD_LENGTH: FieldName;
|
|
20
|
+
export declare const FIELD_WIDTH: FieldName;
|
|
21
|
+
export declare const FIELD_HEIGHT: FieldName;
|
|
22
|
+
export declare const FIELD_SHIPMENT_OPTIONS_PREFIX: FieldName;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type InteractiveElementConfiguration } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type ShipmentOptionsRefs } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Factory function signature for custom shipment option field creators.
|
|
5
|
+
*
|
|
6
|
+
* Uses `string` for fieldName because option names are determined at runtime
|
|
7
|
+
* from the carrier context and are not a fixed compile-time set.
|
|
8
|
+
*/
|
|
9
|
+
export type FieldFactory = (refs: ShipmentOptionsRefs, fieldName: string) => InteractiveElementConfiguration;
|
|
10
|
+
/**
|
|
11
|
+
* Registry of shipment option names that require custom field rendering.
|
|
12
|
+
*
|
|
13
|
+
* Options NOT listed here are rendered as generic TriState toggles by
|
|
14
|
+
* `createShipmentOptionField`. Each entry maps an option name (as it appears in
|
|
15
|
+
* `carrier.options`) to its custom factory function.
|
|
16
|
+
*
|
|
17
|
+
* Current exceptions:
|
|
18
|
+
* - `insurance`: renders as a select/dropdown with amount brackets derived from
|
|
19
|
+
* `insuredAmount` in the option data.
|
|
20
|
+
*/
|
|
21
|
+
export declare const fieldFactoryRegistry: Record<string, FieldFactory>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type InteractiveElementConfiguration } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type ShipmentOptionsRefs } from '../types';
|
|
4
|
+
export declare const createCarrierField: (refs: ShipmentOptionsRefs, inheritedDeliveryOptions: Plugin.ModelContextOrderDataContext["inheritedDeliveryOptions"]) => InteractiveElementConfiguration;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type InteractiveElementConfiguration } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type ShipmentOptionsRefs } from '../types';
|
|
4
|
+
export declare const createDigitalStampRangeField: (refs: ShipmentOptionsRefs, order?: Plugin.ModelContextOrderDataContext) => InteractiveElementConfiguration;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type InteractiveElementConfiguration } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type ShipmentOptionsRefs } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Custom field factory for the insurance shipment option.
|
|
5
|
+
*
|
|
6
|
+
* Renders as a select/dropdown instead of a TriState toggle. Insurance amount brackets are
|
|
7
|
+
* derived from the currently selected carrier's shipment-scoped `insuredAmount` data (min/max)
|
|
8
|
+
* and refresh automatically whenever that data changes — i.e. on carrier change AND on
|
|
9
|
+
* packageType / deliveryType / weight / cc change, since those all narrow the shipment-scoped
|
|
10
|
+
* capabilities response.
|
|
11
|
+
*
|
|
12
|
+
* Visibility / disabled state is inherited from {@link createShipmentOptionField} — driven
|
|
13
|
+
* purely by `hasShipmentOption` (i.e. by the capabilities response). No manual package-type
|
|
14
|
+
* gating: if insurance isn't valid for the current combination, the API won't include it in
|
|
15
|
+
* `carrier.options` and the field will hide.
|
|
16
|
+
*/
|
|
17
|
+
export declare const createInsuranceField: (refs: ShipmentOptionsRefs, fieldName: string) => InteractiveElementConfiguration;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type InteractiveElementConfiguration } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
import { type ShipmentOptionsRefs } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a generic shipment option field as a TriState toggle.
|
|
5
|
+
*
|
|
6
|
+
* Default factory for any option from `carrier.options` that doesn't have a custom factory in
|
|
7
|
+
* `fieldFactoryRegistry`. `requires` / `excludes` are sourced from the shipment-scoped
|
|
8
|
+
* response (`getCarrierCapabilitiesForShipment`); they're absent while the shipment query is loading or
|
|
9
|
+
* falling back to order-level data — locking doesn't run during those windows.
|
|
10
|
+
*
|
|
11
|
+
* `useFormCapabilities()` is called at factory invocation (setup-time) so visibility, disabled,
|
|
12
|
+
* readOnly and afterUpdate handlers close over a captured Pinia store + orderId — no
|
|
13
|
+
* `inject()` calls during form-builder's watchEffect-driven re-evaluators.
|
|
14
|
+
*/
|
|
15
|
+
export declare const createShipmentOptionField: (refs: ShipmentOptionsRefs, fieldName: string, config?: Partial<InteractiveElementConfiguration>) => InteractiveElementConfiguration;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './createDigitalStampRangeField';
|
|
2
|
+
export * from './createDimensionFields';
|
|
3
|
+
export * from './createInsuranceField';
|
|
4
|
+
export * from './createLabelAmountField';
|
|
5
|
+
export * from './createPackageTypeField';
|
|
6
|
+
export * from './createRef';
|
|
7
|
+
export * from './createShipmentOptionField';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
4
|
+
import { type CapabilitiesSelection } from './wireProxyCapabilities';
|
|
5
|
+
type InheritedDeliveryOptions = Plugin.ModelContextOrderDataContext['inheritedDeliveryOptions'];
|
|
6
|
+
/**
|
|
7
|
+
* Watch the form's selection refs and the capability queries, and roll back any field that
|
|
8
|
+
* has become invalid because of another axis changing. Each clear is announced through a
|
|
9
|
+
* single rolling form-level notification (see {@link addCapabilitiesClearNotification}).
|
|
10
|
+
*
|
|
11
|
+
* The core rule (per design): when a user action invalidates the form, the field the user
|
|
12
|
+
* just touched is cleared — they're already at that field in the UI, so they immediately
|
|
13
|
+
* see the rollback and can pick again. We never silently mutate fields the user previously
|
|
14
|
+
* set without notifying them.
|
|
15
|
+
*
|
|
16
|
+
* Three independent invalidation sources are handled, each in its own watcher:
|
|
17
|
+
*
|
|
18
|
+
* 1. **Cross-axis (synchronous) — order data**: when the chosen carrier's `packageTypes` /
|
|
19
|
+
* `deliveryTypes` (from the order query) no longer contain the form's current value,
|
|
20
|
+
* we clear that field. Carrier-change is special-cased through the same silent +
|
|
21
|
+
* inherited-defaults flow as the shipment-query path; without that, the order watcher
|
|
22
|
+
* (which fires synchronously) would emit a noisy notification before the debounced
|
|
23
|
+
* shipment watcher gets a chance to apply the silent reset.
|
|
24
|
+
* 2. **Shipment-empty — server invalidation**: when the shipment query returns no entry for
|
|
25
|
+
* the chosen carrier (empty `results` or carrier not present), the server has confirmed
|
|
26
|
+
* the combination isn't valid. Clears the just-touched axis (or deliveryType by default).
|
|
27
|
+
* 3. **Option key dropped — cross-axis effect on options**: when the shipment query has the
|
|
28
|
+
* chosen carrier but its `options` no longer carries an option key the form has active,
|
|
29
|
+
* that option is cleared (`TriState.Inherit`). Axis intent wins over an active option.
|
|
30
|
+
*
|
|
31
|
+
* Form values are read via `form.getValue(name)` rather than `form.values[name]` so reactive
|
|
32
|
+
* dep tracking inside `computed` / `watch` callbacks fires correctly (the PDK's existing
|
|
33
|
+
* `createValueGetter` follows the same pattern).
|
|
34
|
+
*/
|
|
35
|
+
export declare const useCapabilitiesAutoClear: (form: FormInstance, allOptionKeys: string[], orderId: string, inheritedDeliveryOptions: InheritedDeliveryOptions, selection: Readonly<Ref<CapabilitiesSelection>>) => void;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter, type Ref } from 'vue';
|
|
2
|
+
import { type CapabilitiesSelection } from '../../actions/composables/queries/account/useShipmentCapabilitiesQuery';
|
|
3
|
+
export type OrderInput = {
|
|
4
|
+
cc?: string;
|
|
5
|
+
weight?: number;
|
|
6
|
+
isBusiness?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type FormInput = {
|
|
9
|
+
carrier?: string;
|
|
10
|
+
packageType?: string;
|
|
11
|
+
deliveryType?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Merge an order source and a shipment-options form source into a single debounced selection
|
|
15
|
+
* ref suitable for the order and shipment capabilities queries. Rapid form-state changes
|
|
16
|
+
* (clicking through carriers, toggling options) collapse into one query refetch after the
|
|
17
|
+
* user pauses.
|
|
18
|
+
*
|
|
19
|
+
* Inputs accept any of `Ref<T>`, `ComputedRef<T>`, or `() => T` so callers can pass whatever
|
|
20
|
+
* shape they already have.
|
|
21
|
+
*/
|
|
22
|
+
export declare const useCapabilitiesWatcher: (order: MaybeRefOrGetter<OrderInput>, form: MaybeRefOrGetter<FormInput>) => Readonly<Ref<CapabilitiesSelection>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import { type FormInstance } from '@myparcel-dev/vue-form-builder';
|
|
3
|
+
import { type Plugin } from '@myparcel-dev/pdk-common';
|
|
4
|
+
import { type CapabilitiesSelection } from '../../actions/composables/queries/account/useShipmentCapabilitiesQuery';
|
|
5
|
+
/**
|
|
6
|
+
* Wire BOTH capabilities queries — order-scoped (cc + weight + isBusiness) and shipment-scoped
|
|
7
|
+
* (full selection) — into the shipment-options form for a single order, register them in the
|
|
8
|
+
* query store under composite-string modifiers (`${orderId}.order` and `${orderId}.shipment`),
|
|
9
|
+
* and tear them down when the form's scope disposes (modal close).
|
|
10
|
+
*
|
|
11
|
+
* The two queries serve different concerns:
|
|
12
|
+
*
|
|
13
|
+
* - **Order query** drives the carrier / packageType / deliveryType dropdowns from each
|
|
14
|
+
* carrier's flat union arrays. Refetches only when destination, weight or the recipient
|
|
15
|
+
* business flag change.
|
|
16
|
+
* - **Shipment query** drives per-option metadata (`isRequired`, `requires`, `excludes`,
|
|
17
|
+
* `insuredAmount`) for the chosen combination. Refetches when any axis of the selection
|
|
18
|
+
* changes; the empty-result case is the invalid-combo signal consumed by
|
|
19
|
+
* `useCapabilitiesAutoClear`.
|
|
20
|
+
*
|
|
21
|
+
* Manual-weight reactivity: weight is sourced from `FIELD_MANUAL_WEIGHT` when the user has set
|
|
22
|
+
* one, otherwise from `order.physicalProperties.initialWeight`. Both queries refetch when
|
|
23
|
+
* weight changes through the slider.
|
|
24
|
+
*
|
|
25
|
+
* Skipped for bulk forms (no single orderId) and for orders without an externalIdentifier (no
|
|
26
|
+
* key to register under).
|
|
27
|
+
*/
|
|
28
|
+
export declare const wireProxyCapabilities: (form: FormInstance, order: Plugin.ModelContextOrderDataContext) => {
|
|
29
|
+
selection: Readonly<Ref<CapabilitiesSelection>>;
|
|
30
|
+
} | undefined;
|
|
31
|
+
export type { CapabilitiesSelection };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type { AnyElementConfiguration, AnyElementInstance, ComponentOrHtmlElement, FormConfiguration, FormInstance, InteractiveElementConfiguration, InteractiveElementInstance, PlainElementConfiguration, PlainElementInstance, ResolvedElementConfiguration, } from '@myparcel-dev/vue-form-builder';
|
|
2
|
+
export * from './actions';
|
|
3
|
+
export * from './deprecated';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './views/integrated';
|
|
6
|
+
export * from '@myparcel-dev/pdk-common';
|
|
7
|
+
export { ActionButton, BulkSelectCheckbox, NotificationContainer, PackageType, PlainElement, ResetButton, ReturnsForm, ShipmentBarcode, ShipmentOptionsForm, ShipmentStatus, StatusIndicator, SubmitButton, TabNavigation, } from './components';
|
|
8
|
+
export { AdminAction, AdminComponent, AdminIcon, AdminInstanceContextKey, AdminModalKey, AdminView, NotificationCategory, OrderMode, allAdminComponentNames, optionalAdminActionContainerComponentNames, optionalAdminComponentNames, optionalAdminPlainWrapperComponentNames, requiredAdminComponentNames, } from './data';
|
|
9
|
+
export { FORM_KEYS, FORM_KEY_ACCOUNT_SETTINGS, FORM_KEY_CHILD_PRODUCT_SETTINGS, FORM_KEY_MODAL, FORM_KEY_MODAL_PRINT_OPTIONS, FORM_KEY_MODAL_RETURN_OPTIONS, FORM_KEY_MODAL_SHIPMENT_OPTIONS, FORM_KEY_PLUGIN_SETTINGS, FORM_KEY_PRODUCT_SETTINGS, resolveFormComponent, } from './forms';
|
|
10
|
+
export { FormHook, useElement, useForm, useFormBuilder } from '@myparcel-dev/vue-form-builder';
|
|
11
|
+
export { INJECT_ADMIN_INSTANCE, INJECT_GLOBAL_PDK_ADMIN } from './symbols';
|
|
12
|
+
export { LogLevel, getActionIdentifier } from './services';
|
|
13
|
+
export { PdkAdmin, createPdkAdmin } from './pdk';
|
|
14
|
+
export { createAdminConfig, createPdkAdminPlugin } from './pdk';
|
|
15
|
+
export { createFormElement } from './utils';
|
|
16
|
+
export { createLogger } from './services';
|
|
17
|
+
export { generateFieldId, prefixComponent } from './utils';
|
|
18
|
+
export { useActionStore, useModalStore, useNotificationStore, useQueryStore } from './stores';
|
|
19
|
+
export { useAdminConfig, useAppInfo, useCheckboxGroupContext, useDropOffInputContext, useDropdownButtonContext, useElementContext, useElementOptions, useFormatter, useGlobalContext, useGlobalPdkAdmin, useInputWithOptionsContext, useLanguage, useLoadMore, useLogger, useModalContext, useModalElementContext, useMultiSelectInputContext, useOrderData, useOrderMode, useOrdersData, useProductData, useRadioGroupContext, useSelectInputContext, useShippingMethodsInputContext, useStoreQuery, useTableContext, useToggleInputContext, useTriStateInputContext, useWeekdays, } from './composables';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type App } from 'vue';
|
|
2
|
+
import { type AdminAppConfig, type AdminConfiguration, type AdminContextObject } from '../types';
|
|
3
|
+
import { AdminView } from '../data';
|
|
4
|
+
export declare class PdkAdmin {
|
|
5
|
+
readonly config: AdminConfiguration;
|
|
6
|
+
readonly context: AdminContextObject;
|
|
7
|
+
readonly renderedComponents: string[];
|
|
8
|
+
constructor(config: AdminConfiguration, context: AdminContextObject);
|
|
9
|
+
/**
|
|
10
|
+
* Render a views in given selector.
|
|
11
|
+
*/
|
|
12
|
+
render(view: AdminView, selector: string): Promise<void>;
|
|
13
|
+
protected createApp(view: AdminView, appConfig: AdminAppConfig): Promise<App>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a unique app name for components that are rendered multiple times.
|
|
16
|
+
*/
|
|
17
|
+
protected createAppName(componentName: AdminView, context: AdminContextObject): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type InputAdminConfiguration } from '../types';
|
|
2
|
+
import { PdkAdmin } from './PdkAdmin';
|
|
3
|
+
export type CreatePdkAdmin = (configuration?: InputAdminConfiguration) => undefined | PdkAdmin;
|
|
4
|
+
/**
|
|
5
|
+
* Initialize the pdk frontend, parse configuration, and send a boot event that triggers the
|
|
6
|
+
* components to render themselves using the PdkAdmin class.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createPdkAdmin: CreatePdkAdmin;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type QueryClient } from '@tanstack/vue-query';
|
|
2
|
+
import { type Plugin, type Shipment } from '@myparcel-dev/pdk-common';
|
|
3
|
+
import { type OneOrMore } from '@myparcel-dev/ts-utils';
|
|
4
|
+
export declare const fillShipmentsQueryData: (queryClient: QueryClient, shipments: OneOrMore<Shipment.ModelShipment>, order?: Plugin.ModelPdkOrder) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './PdkAdmin';
|
|
2
|
+
export * from './boot';
|
|
3
|
+
export * from './createAdminConfig';
|
|
4
|
+
export * from './createPdkAdmin';
|
|
5
|
+
export * from './createPdkAdminPlugin';
|
|
6
|
+
export * from './fillShipmentsQueryData';
|
|
7
|
+
export * from './instance';
|
|
8
|
+
export * from './renderMap';
|
|
9
|
+
export * from './sendBootEvent';
|
|
10
|
+
export * from './setupAdminApp';
|
|
11
|
+
export * from './testIdDirective';
|