@myparcel-dev/pdk-admin 1.13.1 → 1.14.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 CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  <!-- MONOWEAVE:BELOW -->
4
4
 
5
+ ## [1.14.1](https://github.com/myparcelnl/js-pdk/compare/@myparcel-dev/pdk-admin@1.14.0...@myparcel-dev/pdk-admin@1.14.1) "@myparcel-dev/pdk-admin" (2026-02-16)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **admin:** handle bulk order ids in digital stamp range field ([#301](https://github.com/myparcelnl/js-pdk/issues/301)) ([3794ab7](https://github.com/myparcelnl/js-pdk/commit/3794ab7d65ee6ab70ac26376fc9ddc094d0002ce))
11
+
12
+
13
+
14
+
15
+ ## [1.14.0](https://github.com/myparcelnl/js-pdk/compare/@myparcel-dev/pdk-admin@1.13.1...@myparcel-dev/pdk-admin@1.14.0) "@myparcel-dev/pdk-admin" (2026-02-06)
16
+
17
+
18
+ ### Features
19
+
20
+ * add priority mailbox delivery fields ([#290](https://github.com/myparcelnl/js-pdk/issues/290)) ([1bea145](https://github.com/myparcelnl/js-pdk/commit/1bea1454676e33f1364c401724b203f71404b672))
21
+
22
+
23
+
24
+
5
25
  ## [1.13.1](https://github.com/myparcelnl/js-pdk/compare/@myparcel-dev/pdk-admin@1.13.0...@myparcel-dev/pdk-admin@1.13.1) "@myparcel-dev/pdk-admin" (2026-02-05)
6
26
 
7
27
 
@@ -1,9 +1,12 @@
1
1
  import { type ComputedRef } from 'vue';
2
2
  import { type MaybeRef } from '@vueuse/core';
3
+ import { type Plugin } from '@myparcel-dev/pdk-common';
3
4
  import { type SelectOptionWithPlainLabel } from '../types';
4
5
  interface UseDigitalStampRanges {
5
6
  ranges: ComputedRef<SelectOptionWithPlainLabel<number, string>[]>;
6
7
  currentRange: ComputedRef<SelectOptionWithPlainLabel<number, string>>;
7
8
  }
8
- export declare const useDigitalStampRanges: (weight: MaybeRef<number>) => UseDigitalStampRanges;
9
+ export declare const useDigitalStampRanges: (weight: MaybeRef<number>, order?: MaybeRef<null | {
10
+ digitalStampRanges?: Plugin.DigitalStampRange[];
11
+ }>) => UseDigitalStampRanges;
9
12
  export {};
@@ -10,6 +10,7 @@ export * from './getInsuranceOptions';
10
10
  export * from './getPackageTypes';
11
11
  export * from './hasPostNlAgeCheck';
12
12
  export * from './hasShipmentOption';
13
+ export * from './isPackageTypeMailbox';
13
14
  export * from './isPackageTypePackage';
14
15
  export * from './isPackageTypePackageOrSmall';
15
16
  export * from './isPackageTypeSmallPackage';
@@ -0,0 +1,2 @@
1
+ import { type FormInstance } from '@myparcel-dev/vue-form-builder';
2
+ export declare const isPackageTypeMailbox: (form: FormInstance) => boolean;
@@ -1,4 +1,4 @@
1
- import { type Plugin } from '@myparcel-dev/pdk-common';
2
1
  import { type FormInstance } from '@myparcel-dev/vue-form-builder';
3
2
  import { type OneOrMore } from '@myparcel-dev/ts-utils';
3
+ import { type Plugin } from '@myparcel-dev/pdk-common';
4
4
  export declare const createShipmentOptionsForm: (orders?: OneOrMore<Plugin.ModelPdkOrder>) => FormInstance;
@@ -13,6 +13,7 @@ export declare const ONLY_RECIPIENT = "onlyRecipient";
13
13
  export declare const SAME_DAY_DELIVERY = "sameDayDelivery";
14
14
  export declare const SIGNATURE = "signature";
15
15
  export declare const INSURANCE = "insurance";
16
+ export declare const PRIORITY_DELIVERY = "priorityDelivery";
16
17
  export declare const MANUAL_WEIGHT = "manualWeight";
17
18
  export declare const PROP_OPTIONS = "options";
18
19
  export declare const KEY_DESCRIPTION = "description";
@@ -29,6 +30,7 @@ export declare const FIELD_ONLY_RECIPIENT: FieldName;
29
30
  export declare const FIELD_SAME_DAY_DELIVERY: FieldName;
30
31
  export declare const FIELD_SIGNATURE: FieldName;
31
32
  export declare const FIELD_INSURANCE: FieldName;
33
+ export declare const FIELD_PRIORITY_DELIVERY: FieldName;
32
34
  export declare const FIELD_MANUAL_WEIGHT: FieldName;
33
35
  export declare const FIELD_RECEIPT_CODE: FieldName;
34
- export declare const ALL_FIELDS: readonly [string, string, string, string, string, string, string, string, string, string, string, string, string, string];
36
+ export declare const ALL_FIELDS: readonly [string, string, string, string, string, string, string, string, string, string, string, string, string, string, string];
@@ -1,3 +1,4 @@
1
1
  import { type InteractiveElementConfiguration } from '@myparcel-dev/vue-form-builder';
2
+ import { type Plugin } from '@myparcel-dev/pdk-common';
2
3
  import { type ShipmentOptionsRefs } from '../types';
3
- export declare const createDigitalStampRangeField: (refs: ShipmentOptionsRefs) => InteractiveElementConfiguration;
4
+ export declare const createDigitalStampRangeField: (refs: ShipmentOptionsRefs, order?: Plugin.ModelContextOrderDataContext) => InteractiveElementConfiguration;
@@ -0,0 +1,3 @@
1
+ import { type InteractiveElementConfiguration } from '@myparcel-dev/vue-form-builder';
2
+ import { type ShipmentOptionsRefs } from '../types';
3
+ export declare const createPriorityDeliveryField: (refs: ShipmentOptionsRefs) => InteractiveElementConfiguration;
@@ -7,6 +7,7 @@ export * from './createLabelAmountField';
7
7
  export * from './createLargeFormatField';
8
8
  export * from './createOnlyRecipientField';
9
9
  export * from './createPackageTypeField';
10
+ export * from './createPriorityDeliveryField';
10
11
  export * from './createRef';
11
12
  export * from './createSameDayDeliveryField';
12
13
  export * from './createShipmentOptionField';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myparcel-dev/pdk-admin",
3
- "version": "1.13.1",
3
+ "version": "1.14.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/myparcelnl/js-pdk.git",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@myparcel-dev/constants": "^2.7.0",
40
- "@myparcel-dev/pdk-common": "^1.11.1",
40
+ "@myparcel-dev/pdk-common": "^1.12.0",
41
41
  "@myparcel-dev/sdk": "^5.0.0",
42
42
  "@myparcel-dev/vue-form-builder": "1.0.0-beta.42.6",
43
43
  "@tanstack/vue-query": "~4.43.0",
@@ -10,11 +10,15 @@ interface UseDigitalStampRanges {
10
10
  currentRange: ComputedRef<SelectOptionWithPlainLabel<number, string>>;
11
11
  }
12
12
 
13
- export const useDigitalStampRanges = (weight: MaybeRef<number>): UseDigitalStampRanges => {
14
- // todo: move this to global context
15
- const {order} = useOrderData();
16
-
17
- const allRanges = computed<Plugin.DigitalStampRange[]>(() => toValue(order).digitalStampRanges ?? []);
13
+ export const useDigitalStampRanges = (
14
+ weight: MaybeRef<number>,
15
+ order?: MaybeRef<null | {digitalStampRanges?: Plugin.DigitalStampRange[]}>,
16
+ ): UseDigitalStampRanges => {
17
+ const fallbackOrder = order ? null : useOrderData().order;
18
+
19
+ const allRanges = computed<Plugin.DigitalStampRange[]>(() => {
20
+ return toValue(order ?? fallbackOrder)?.digitalStampRanges ?? [];
21
+ });
18
22
 
19
23
  const ranges = computed<SelectOptionWithPlainLabel<number, string>[]>(() => {
20
24
  return allRanges.value.map((range) => ({
@@ -10,6 +10,7 @@ export * from './getInsuranceOptions';
10
10
  export * from './getPackageTypes';
11
11
  export * from './hasPostNlAgeCheck';
12
12
  export * from './hasShipmentOption';
13
+ export * from './isPackageTypeMailbox';
13
14
  export * from './isPackageTypePackage';
14
15
  export * from './isPackageTypePackageOrSmall';
15
16
  export * from './isPackageTypeSmallPackage';
@@ -0,0 +1,7 @@
1
+ import {type FormInstance} from '@myparcel-dev/vue-form-builder';
2
+ import {PackageTypeName} from '@myparcel-dev/constants';
3
+ import {FIELD_PACKAGE_TYPE} from '../shipmentOptions';
4
+
5
+ export const isPackageTypeMailbox = (form: FormInstance): boolean => {
6
+ return PackageTypeName.Mailbox === form.getValue(FIELD_PACKAGE_TYPE);
7
+ };
@@ -3,9 +3,9 @@
3
3
 
4
4
  import {toRaw} from 'vue';
5
5
  import {get} from 'lodash-unified';
6
- import {type Plugin} from '@myparcel-dev/pdk-common';
7
6
  import {defineForm, type FormInstance} from '@myparcel-dev/vue-form-builder';
8
7
  import {type OneOrMore, toArray} from '@myparcel-dev/ts-utils';
8
+ import {type Plugin} from '@myparcel-dev/pdk-common';
9
9
  import {addBulkEditNotification} from '../helpers';
10
10
  import {createShipmentFormName} from '../../utils';
11
11
  import {useModalStore} from '../../stores';
@@ -20,6 +20,7 @@ import {
20
20
  createDigitalStampRangeField,
21
21
  createDirectReturnField,
22
22
  createInsuranceField,
23
+ createPriorityDeliveryField,
23
24
  createLabelAmountField,
24
25
  createLargeFormatField,
25
26
  createOnlyRecipientField,
@@ -66,7 +67,7 @@ export const createShipmentOptionsForm = (orders?: OneOrMore<Plugin.ModelPdkOrde
66
67
 
67
68
  createLabelAmountField(refs),
68
69
 
69
- createDigitalStampRangeField(refs),
70
+ createDigitalStampRangeField(refs, order),
70
71
 
71
72
  // Actual shipment options
72
73
  createAgeCheckField(refs),
@@ -78,6 +79,7 @@ export const createShipmentOptionsForm = (orders?: OneOrMore<Plugin.ModelPdkOrde
78
79
  createSameDayDeliveryField(refs),
79
80
  createReceiptCodeField(refs),
80
81
  createInsuranceField(refs),
82
+ createPriorityDeliveryField(refs),
81
83
  ],
82
84
  });
83
85
  };
@@ -36,6 +36,8 @@ export const SIGNATURE = 'signature' satisfies keyof Shipment.ModelShipmentOptio
36
36
 
37
37
  export const INSURANCE = 'insurance' satisfies keyof Shipment.ModelShipmentOptions;
38
38
 
39
+ export const PRIORITY_DELIVERY = 'priorityDelivery' satisfies keyof Shipment.ModelShipmentOptions;
40
+
39
41
  export const MANUAL_WEIGHT = 'manualWeight';
40
42
 
41
43
  export const PROP_OPTIONS = 'options';
@@ -68,6 +70,8 @@ export const FIELD_SIGNATURE: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${SIGNATUR
68
70
 
69
71
  export const FIELD_INSURANCE: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${INSURANCE}`;
70
72
 
73
+ export const FIELD_PRIORITY_DELIVERY: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${PRIORITY_DELIVERY}`;
74
+
71
75
  export const FIELD_MANUAL_WEIGHT: FieldName = `${PHYSICAL_PROPERTIES_PREFIX}.${MANUAL_WEIGHT}`;
72
76
 
73
77
  export const FIELD_RECEIPT_CODE: FieldName = `${SHIPMENT_OPTIONS_PREFIX}.${RECEIPT_CODE}`;
@@ -78,6 +82,7 @@ export const ALL_FIELDS = [
78
82
  FIELD_DIRECT_RETURN,
79
83
  FIELD_HIDE_SENDER,
80
84
  FIELD_INSURANCE,
85
+ FIELD_PRIORITY_DELIVERY,
81
86
  FIELD_LABEL_AMOUNT,
82
87
  FIELD_LARGE_FORMAT,
83
88
  FIELD_ONLY_RECIPIENT,
@@ -1,7 +1,7 @@
1
1
  import {ref, toValue} from 'vue';
2
2
  import {get} from 'lodash-unified';
3
- import {TriState} from '@myparcel-dev/pdk-common';
4
3
  import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
4
+ import {type Plugin, TriState} from '@myparcel-dev/pdk-common';
5
5
  import {PackageTypeName} from '@myparcel-dev/constants';
6
6
  import {type ShipmentOptionsRefs} from '../types';
7
7
  import {FIELD_MANUAL_WEIGHT, FIELD_PACKAGE_TYPE} from '../field';
@@ -10,17 +10,19 @@ import {type GlobalFieldProps, type OptionsProp} from '../../../types';
10
10
  import {AdminComponent} from '../../../data';
11
11
  import {useDigitalStampRanges, useOrderData, usePluginSettings} from '../../../composables';
12
12
 
13
- export const createDigitalStampRangeField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
13
+ export const createDigitalStampRangeField = (
14
+ refs: ShipmentOptionsRefs,
15
+ order?: Plugin.ModelContextOrderDataContext,
16
+ ): InteractiveElementConfiguration => {
14
17
  const pluginSettings = usePluginSettings();
15
- const {order} = useOrderData();
16
-
17
- const orderData = toValue(order);
18
+ const fallbackOrderData = order ? undefined : toValue(useOrderData().order);
19
+ const orderData = order ?? fallbackOrderData;
18
20
 
19
21
  const {initialWeight, manualWeight} = orderData?.physicalProperties ?? {};
20
22
 
21
23
  const totalWeight = Number(initialWeight) + Number(pluginSettings.order.emptyDigitalStampWeight ?? 0);
22
24
 
23
- const {ranges, currentRange} = useDigitalStampRanges(orderData);
25
+ const {ranges, currentRange} = useDigitalStampRanges(totalWeight, orderData);
24
26
 
25
27
  const selectedValue =
26
28
  TriState.Inherit === manualWeight
@@ -0,0 +1,12 @@
1
+ import {type InteractiveElementConfiguration} from '@myparcel-dev/vue-form-builder';
2
+ import {type ShipmentOptionsRefs} from '../types';
3
+ import {FIELD_PRIORITY_DELIVERY, PRIORITY_DELIVERY} from '../field';
4
+ import {createHasShipmentOptionWatcher, isPackageTypeMailbox} from '../../helpers';
5
+ import {createShipmentOptionField} from './createShipmentOptionField';
6
+
7
+ export const createPriorityDeliveryField = (refs: ShipmentOptionsRefs): InteractiveElementConfiguration => {
8
+ return createShipmentOptionField(refs, FIELD_PRIORITY_DELIVERY, {
9
+ visibleWhen: createHasShipmentOptionWatcher(PRIORITY_DELIVERY, false, isPackageTypeMailbox),
10
+ disabledWhen: createHasShipmentOptionWatcher(PRIORITY_DELIVERY, true, isPackageTypeMailbox),
11
+ });
12
+ };
@@ -7,6 +7,7 @@ export * from './createLabelAmountField';
7
7
  export * from './createLargeFormatField';
8
8
  export * from './createOnlyRecipientField';
9
9
  export * from './createPackageTypeField';
10
+ export * from './createPriorityDeliveryField';
10
11
  export * from './createRef';
11
12
  export * from './createSameDayDeliveryField';
12
13
  export * from './createShipmentOptionField';