@myparcel-dev/pdk-admin-js 2.2.4 → 2.2.6
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 +10 -0
- package/dist/OrderModeOrderListItem-1aoX4NQq.js +43 -0
- package/dist/PrintOptionsModalForm-0jr34WqX.js +30 -0
- package/dist/ShipmentModeOrderListItem-yiwrWuD9.js +58 -0
- package/dist/ShipmentOptionsModalForm-Bz5XIh6B.js +21 -0
- package/dist/ShipmentTableBox-pZpaz3Lo.js +214 -0
- package/dist/{style.css → index.css} +1 -0
- package/dist/index.js +4001 -177
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/shared-DHuYOc8-.js +15405 -0
- package/package.json +4 -4
- package/vite.config.ts +10 -9
- package/dist/ChildProductSettings-CWdldjU8.js +0 -4
- package/dist/Modals-CqhfaUfv.js +0 -4
- package/dist/Notifications-BsEoAoXb.js +0 -4
- package/dist/OrderBox-Bn8AcI8b.js +0 -4
- package/dist/OrderListItem-DT_77Xo3.js +0 -4
- package/dist/OrderModeOrderListItem-BrBhUyyu.js +0 -60
- package/dist/PluginSettings-6qK6JuXL.js +0 -4
- package/dist/PrintOptionsModalForm-BhshAOse.js +0 -32
- package/dist/ProductSettings-D5kTD7jw.js +0 -4
- package/dist/ShipmentLabel.vue_vue_type_script_setup_true_lang-Cpk2IaBC.js +0 -212
- package/dist/ShipmentModeOrderListItem-wtNZ_vd8.js +0 -69
- package/dist/ShipmentOptionsModalForm-cj7Pa1yh.js +0 -25
- package/dist/ShipmentTableBox-PwR7YMws.js +0 -258
- package/dist/index-BCHGsSUm.js +0 -24316
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- MONOWEAVE:BELOW -->
|
|
4
4
|
|
|
5
|
+
## [2.2.6](https://github.com/myparcelnl/js-pdk/compare/@myparcel-dev/pdk-admin-js@2.2.5...@myparcel-dev/pdk-admin-js@2.2.6) "@myparcel-dev/pdk-admin-js" (2026-09-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Reverts
|
|
9
|
+
|
|
10
|
+
* build(deps): update vitest to 4 and vite to 8 ([7696c6f](https://github.com/myparcelnl/js-pdk/commit/7696c6f8d344619c2e554f0fae5ed5db2d5c71f8)), closes [#463](https://github.com/myparcelnl/js-pdk/issues/463)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
5
15
|
## [2.0.1](https://github.com/myparcelnl/js-pdk/compare/@myparcel-dev/pdk-admin-js@2.0.0...@myparcel-dev/pdk-admin-js@2.0.1) "@myparcel-dev/pdk-admin-js" (2026-07-20)
|
|
6
16
|
|
|
7
17
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Cr as createBlock, Ct as useOrderMode, Dr as createVNode, Fr as openBlock, Hr as withCtx, Lr as renderList, Rn as OrderMode, Tr as createElementBlock, Xr as toValue, Zr as unref, a as LIST_ITEM_MODE_ACTIONS, en as DeliveryOptionsExcerpt_default, ht as useOrderData, in as ActionButton_default, kr as defineComponent, lt as instantiateActions, m as orderViewInBackofficeAction, sr as Size, t as ShipmentLabel_default, ut as instantiateAction, wr as createCommentVNode, xr as computed, yr as Fragment, zr as resolveComponent } from "./shared-DHuYOc8-.js";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region ../admin/src/components/OrderListItem/OrderModeOrderListItem.vue
|
|
4
|
+
var OrderModeOrderListItem_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "OrderModeOrderListItem",
|
|
6
|
+
setup(__props) {
|
|
7
|
+
const { query, order } = useOrderData();
|
|
8
|
+
const orderMode = useOrderMode();
|
|
9
|
+
const data = computed(() => toValue(query.data));
|
|
10
|
+
const shipments = computed(() => toValue(data)?.shipments ?? []);
|
|
11
|
+
const showExportedOrderAction = instantiateAction(orderViewInBackofficeAction);
|
|
12
|
+
const orderActions = computed(() => instantiateActions(LIST_ITEM_MODE_ACTIONS[orderMode.value], { orderIds: order.value?.externalIdentifier }));
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
const _component_PdkLink = resolveComponent("PdkLink");
|
|
15
|
+
const _component_PdkButtonGroup = resolveComponent("PdkButtonGroup");
|
|
16
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
17
|
+
shipments.value.length === 0 ? (openBlock(), createBlock(unref(DeliveryOptionsExcerpt_default), { key: 0 })) : createCommentVNode("", true),
|
|
18
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(data.value?.shipments ?? [], (shipment) => {
|
|
19
|
+
return openBlock(), createBlock(ShipmentLabel_default, {
|
|
20
|
+
key: `${data.value?.externalIdentifier}_${shipment.id}`,
|
|
21
|
+
"shipment-id": shipment.id
|
|
22
|
+
}, null, 8, ["shipment-id"]);
|
|
23
|
+
}), 128)),
|
|
24
|
+
createVNode(_component_PdkButtonGroup, null, {
|
|
25
|
+
default: withCtx(() => [unref(orderMode) === unref(OrderMode).OrderV1 && unref(order)?.exported ? (openBlock(), createBlock(_component_PdkLink, {
|
|
26
|
+
key: 0,
|
|
27
|
+
action: unref(showExportedOrderAction)
|
|
28
|
+
}, null, 8, ["action"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(orderActions.value, (action) => {
|
|
29
|
+
return openBlock(), createBlock(unref(ActionButton_default), {
|
|
30
|
+
key: action.id,
|
|
31
|
+
action,
|
|
32
|
+
size: unref(Size).Small,
|
|
33
|
+
"hide-text": ""
|
|
34
|
+
}, null, 8, ["action", "size"]);
|
|
35
|
+
}), 128))]),
|
|
36
|
+
_: 1
|
|
37
|
+
})
|
|
38
|
+
], 64);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
export { OrderModeOrderListItem_default as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Cr as createBlock, Dt as useContext, Fr as openBlock, Gr as markRaw, Hn as AdminModalKey, In as xe, Nr as onMounted, St as usePluginSettings, Vt as generateFormFields, Zr as unref, jn as Ne, kr as defineComponent, qr as ref, vt as useAdminConfig, wr as createCommentVNode } from "./shared-DHuYOc8-.js";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region ../admin/src/components/modals/PrintOptionsModalForm.vue
|
|
4
|
+
var PrintOptionsModalForm_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "PrintOptionsModalForm",
|
|
6
|
+
setup(__props) {
|
|
7
|
+
const context = useContext();
|
|
8
|
+
const pluginSettings = usePluginSettings();
|
|
9
|
+
const config = useAdminConfig();
|
|
10
|
+
const form = ref();
|
|
11
|
+
onMounted(() => {
|
|
12
|
+
form.value = markRaw(Ne(AdminModalKey.PrintOptions, {
|
|
13
|
+
...config.formConfigOverrides?.modal,
|
|
14
|
+
...config.formConfigOverrides?.[AdminModalKey.PrintOptions],
|
|
15
|
+
fields: generateFormFields({
|
|
16
|
+
fields: context.printOptionsView.elements,
|
|
17
|
+
values: pluginSettings.label
|
|
18
|
+
})
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return form.value ? (openBlock(), createBlock(unref(xe), {
|
|
23
|
+
key: 0,
|
|
24
|
+
form: form.value
|
|
25
|
+
}, null, 8, ["form"])) : createCommentVNode("", true);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { PrintOptionsModalForm_default as default };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Cr as createBlock, Dr as createVNode, Fr as openBlock, Hr as withCtx, Lr as renderList, Tr as createElementBlock, Xr as toValue, Zr as unref, _ as ordersFetchAction, en as DeliveryOptionsExcerpt_default, f as orderExportAction, g as ordersExportPrintShipmentsAction, gr as TransitionGroup, h as ordersEditAction, ht as useOrderData, kr as defineComponent, lt as instantiateActions, sr as Size, t as ShipmentLabel_default, v as ordersPrintAction, vt as useAdminConfig, wr as createCommentVNode, xr as computed, yr as Fragment, zr as resolveComponent } from "./shared-DHuYOc8-.js";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region ../admin/src/components/OrderListItem/ShipmentModeOrderListItem.vue
|
|
4
|
+
var ShipmentModeOrderListItem_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "ShipmentModeOrderListItem",
|
|
6
|
+
setup(__props) {
|
|
7
|
+
const config = useAdminConfig();
|
|
8
|
+
const { query, order } = useOrderData();
|
|
9
|
+
const data = computed(() => toValue(query.data));
|
|
10
|
+
const shipments = computed(() => toValue(data)?.shipments ?? []);
|
|
11
|
+
const actions = computed(() => {
|
|
12
|
+
const actions = [];
|
|
13
|
+
if (toValue(order)?.shipments?.some((item) => !item.deleted)) {
|
|
14
|
+
actions.push(orderExportAction);
|
|
15
|
+
actions.push({
|
|
16
|
+
...ordersPrintAction,
|
|
17
|
+
standalone: true
|
|
18
|
+
});
|
|
19
|
+
actions.push(ordersFetchAction);
|
|
20
|
+
} else {
|
|
21
|
+
actions.push({
|
|
22
|
+
...orderExportAction,
|
|
23
|
+
standalone: true
|
|
24
|
+
});
|
|
25
|
+
actions.push(ordersExportPrintShipmentsAction);
|
|
26
|
+
}
|
|
27
|
+
actions.push(ordersEditAction);
|
|
28
|
+
return instantiateActions(actions, {
|
|
29
|
+
orderIds: toValue(order)?.externalIdentifier,
|
|
30
|
+
form: false
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
const _component_PdkDropdownButton = resolveComponent("PdkDropdownButton");
|
|
35
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
36
|
+
shipments.value.length === 0 ? (openBlock(), createBlock(unref(DeliveryOptionsExcerpt_default), { key: 0 })) : createCommentVNode("", true),
|
|
37
|
+
createVNode(TransitionGroup, {
|
|
38
|
+
name: unref(config)?.transitions?.shipmentBox,
|
|
39
|
+
appear: ""
|
|
40
|
+
}, {
|
|
41
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(data.value?.shipments ?? [], (shipment) => {
|
|
42
|
+
return openBlock(), createBlock(ShipmentLabel_default, {
|
|
43
|
+
key: `${data.value?.externalIdentifier}_${shipment.id}`,
|
|
44
|
+
"shipment-id": shipment.id
|
|
45
|
+
}, null, 8, ["shipment-id"]);
|
|
46
|
+
}), 128))]),
|
|
47
|
+
_: 1
|
|
48
|
+
}, 8, ["name"]),
|
|
49
|
+
createVNode(_component_PdkDropdownButton, {
|
|
50
|
+
actions: actions.value,
|
|
51
|
+
size: unref(Size).Small
|
|
52
|
+
}, null, 8, ["actions", "size"])
|
|
53
|
+
], 64);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
//#endregion
|
|
58
|
+
export { ShipmentModeOrderListItem_default as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Cr as createBlock, Fr as openBlock, Xr as toValue, Zr as unref, kr as defineComponent, mt as useOrdersData, wr as createCommentVNode, xr as computed, zt as ShipmentOptionsForm_default } from "./shared-DHuYOc8-.js";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region ../admin/src/components/modals/ShipmentOptionsModalForm.vue
|
|
4
|
+
var ShipmentOptionsModalForm_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "ShipmentOptionsModalForm",
|
|
6
|
+
props: { order: {} },
|
|
7
|
+
setup(__props) {
|
|
8
|
+
const props = __props;
|
|
9
|
+
const orderIds = computed(() => {
|
|
10
|
+
return useOrdersData(props.order).filter((data) => toValue(data.order)).map((data) => toValue(data.order)?.externalIdentifier);
|
|
11
|
+
});
|
|
12
|
+
return (_ctx, _cache) => {
|
|
13
|
+
return orderIds.value.length ? (openBlock(), createBlock(unref(ShipmentOptionsForm_default), {
|
|
14
|
+
key: 0,
|
|
15
|
+
order: orderIds.value
|
|
16
|
+
}, null, 8, ["order"])) : createCommentVNode("", true);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ShipmentOptionsModalForm_default as default };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { $r as toDisplayString, At as useQueryStore, Bn as AdminIcon, Bt as ShipmentBarcode_default, Cr as createBlock, Dr as createVNode, Er as createTextVNode, Fr as openBlock, Hr as withCtx, Jr as toRaw, Lr as renderList, Qr as normalizeClass, Rt as ShipmentStatus_default, Sr as createBaseVNode, Tr as createElementBlock, Vr as watch, Wr as isRef, Xn as useVModel, Xr as toValue, Yr as toRefs, Zn as isDef, Zr as unref, b as shipmentActions, bt as Format, ft as useShipmentData, gt as useLocalizedFormatter, ht as useOrderData, kr as defineComponent, lt as instantiateActions, qr as ref, rn as BulkSelectCheckbox_default, vt as useAdminConfig, wr as createCommentVNode, xr as computed, xt as useLanguage, yr as Fragment, zr as resolveComponent } from "./shared-DHuYOc8-.js";
|
|
2
|
+
//#region ../admin/src/composables/components/useBulkSelectCheckbox.ts
|
|
3
|
+
var useBulkSelectCheckbox = (options, emit) => {
|
|
4
|
+
const selected = ref({});
|
|
5
|
+
const bulkModel = computed({
|
|
6
|
+
get() {
|
|
7
|
+
return selected.value;
|
|
8
|
+
},
|
|
9
|
+
set(values) {
|
|
10
|
+
selected.value = values;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
watch(bulkModel, (value) => {
|
|
14
|
+
emit("select", value);
|
|
15
|
+
}, { deep: true });
|
|
16
|
+
return {
|
|
17
|
+
bulkModel,
|
|
18
|
+
bulkOptions: options
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region ../admin/src/utils/createClasses.ts
|
|
23
|
+
var createClasses = (param) => {
|
|
24
|
+
return param.reduce((acc, { key, value }) => {
|
|
25
|
+
if (key && value) acc[key] = value;
|
|
26
|
+
return acc;
|
|
27
|
+
}, {});
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region ../admin/src/components/OrderBox/OrderShipmentsTableRow.vue?vue&type=script&setup=true&lang.ts
|
|
31
|
+
var _hoisted_1 = ["title", "textContent"];
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region ../admin/src/components/OrderBox/OrderShipmentsTableRow.vue
|
|
34
|
+
var OrderShipmentsTableRow_default = /* @__PURE__ */ defineComponent({
|
|
35
|
+
__name: "OrderShipmentsTableRow",
|
|
36
|
+
props: {
|
|
37
|
+
shipmentId: {},
|
|
38
|
+
modelValue: { type: Boolean }
|
|
39
|
+
},
|
|
40
|
+
emits: ["update:modelValue"],
|
|
41
|
+
setup(__props, { emit: __emit }) {
|
|
42
|
+
const props = __props;
|
|
43
|
+
const { shipmentId } = toRefs(props);
|
|
44
|
+
const emit = __emit;
|
|
45
|
+
const config = useAdminConfig();
|
|
46
|
+
const formatter = useLocalizedFormatter();
|
|
47
|
+
useQueryStore().registerShipmentQueries(shipmentId);
|
|
48
|
+
const { loading, actions, shipment } = useShipmentData(shipmentId);
|
|
49
|
+
const selected = useVModel(props, void 0, emit);
|
|
50
|
+
const checkboxElement = {
|
|
51
|
+
id: `shipment_${shipmentId.value}`,
|
|
52
|
+
ref: selected,
|
|
53
|
+
form: { name: `shipment-${shipmentId.value}` }
|
|
54
|
+
};
|
|
55
|
+
const shipmentUpdatedAt = computed(() => {
|
|
56
|
+
return shipment.value.updated ? formatter.format(Format.DateRelative, shipment.value.updated) : "–";
|
|
57
|
+
});
|
|
58
|
+
const classes = computed(() => {
|
|
59
|
+
return createClasses([{
|
|
60
|
+
key: config?.cssUtilities?.animationLoading,
|
|
61
|
+
value: loading.value
|
|
62
|
+
}]);
|
|
63
|
+
});
|
|
64
|
+
return (_ctx, _cache) => {
|
|
65
|
+
const _component_PdkCheckboxInput = resolveComponent("PdkCheckboxInput");
|
|
66
|
+
const _component_PdkTableCol = resolveComponent("PdkTableCol");
|
|
67
|
+
const _component_PdkDropdownButton = resolveComponent("PdkDropdownButton");
|
|
68
|
+
const _component_PdkTableRow = resolveComponent("PdkTableRow");
|
|
69
|
+
return openBlock(), createBlock(_component_PdkTableRow, { class: normalizeClass(classes.value) }, {
|
|
70
|
+
default: withCtx(() => [
|
|
71
|
+
createVNode(_component_PdkTableCol, null, {
|
|
72
|
+
default: withCtx(() => [createVNode(_component_PdkCheckboxInput, {
|
|
73
|
+
modelValue: unref(selected),
|
|
74
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(selected) ? selected.value = $event : null),
|
|
75
|
+
element: checkboxElement,
|
|
76
|
+
value: unref(shipmentId)
|
|
77
|
+
}, null, 8, ["modelValue", "value"])]),
|
|
78
|
+
_: 1
|
|
79
|
+
}),
|
|
80
|
+
createVNode(_component_PdkTableCol, null, {
|
|
81
|
+
default: withCtx(() => [createVNode(unref(ShipmentBarcode_default), { "shipment-id": unref(shipmentId) }, null, 8, ["shipment-id"])]),
|
|
82
|
+
_: 1
|
|
83
|
+
}),
|
|
84
|
+
createVNode(_component_PdkTableCol, null, {
|
|
85
|
+
default: withCtx(() => [createVNode(unref(ShipmentStatus_default), { "shipment-id": unref(shipmentId) }, null, 8, ["shipment-id"])]),
|
|
86
|
+
_: 1
|
|
87
|
+
}),
|
|
88
|
+
createVNode(_component_PdkTableCol, null, {
|
|
89
|
+
default: withCtx(() => [createBaseVNode("span", {
|
|
90
|
+
title: unref(shipment).updated?.date,
|
|
91
|
+
textContent: toDisplayString(shipmentUpdatedAt.value)
|
|
92
|
+
}, null, 8, _hoisted_1)]),
|
|
93
|
+
_: 1
|
|
94
|
+
}),
|
|
95
|
+
createVNode(_component_PdkTableCol, { align: "right" }, {
|
|
96
|
+
default: withCtx(() => [createVNode(_component_PdkDropdownButton, { actions: unref(actions) }, null, 8, ["actions"])]),
|
|
97
|
+
_: 1
|
|
98
|
+
})
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["class"]);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region ../admin/src/components/OrderBox/OrderShipmentsTable.vue?vue&type=script&setup=true&lang.ts
|
|
107
|
+
var translationPrefix = "order_labels_column_";
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region ../admin/src/components/OrderBox/OrderShipmentsTable.vue
|
|
110
|
+
var OrderShipmentsTable_default = /* @__PURE__ */ defineComponent({
|
|
111
|
+
__name: "OrderShipmentsTable",
|
|
112
|
+
emits: ["select"],
|
|
113
|
+
setup(__props, { emit: __emit }) {
|
|
114
|
+
const emit = __emit;
|
|
115
|
+
const { query } = useOrderData();
|
|
116
|
+
const data = computed(() => toValue(query.data));
|
|
117
|
+
const { bulkModel, bulkOptions } = useBulkSelectCheckbox(query.data.value?.shipments?.map(({ id }) => id) ?? [], emit);
|
|
118
|
+
const { translate } = useLanguage();
|
|
119
|
+
return (_ctx, _cache) => {
|
|
120
|
+
const _component_PdkTableCol = resolveComponent("PdkTableCol");
|
|
121
|
+
const _component_PdkTableRow = resolveComponent("PdkTableRow");
|
|
122
|
+
const _component_PdkTable = resolveComponent("PdkTable");
|
|
123
|
+
return openBlock(), createBlock(_component_PdkTable, { class: "mb-0" }, {
|
|
124
|
+
header: withCtx(() => [createVNode(_component_PdkTableRow, null, {
|
|
125
|
+
default: withCtx(() => [
|
|
126
|
+
createVNode(_component_PdkTableCol, { component: "th" }, {
|
|
127
|
+
default: withCtx(() => [createVNode(unref(BulkSelectCheckbox_default), {
|
|
128
|
+
modelValue: unref(bulkModel),
|
|
129
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(bulkModel) ? bulkModel.value = $event : null),
|
|
130
|
+
options: unref(bulkOptions)
|
|
131
|
+
}, null, 8, ["modelValue", "options"])]),
|
|
132
|
+
_: 1
|
|
133
|
+
}),
|
|
134
|
+
createVNode(_component_PdkTableCol, { component: "th" }, {
|
|
135
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)(`${translationPrefix}track_trace`)), 1)]),
|
|
136
|
+
_: 1
|
|
137
|
+
}),
|
|
138
|
+
createVNode(_component_PdkTableCol, { component: "th" }, {
|
|
139
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)(`${translationPrefix}status`)), 1)]),
|
|
140
|
+
_: 1
|
|
141
|
+
}),
|
|
142
|
+
createVNode(_component_PdkTableCol, { component: "th" }, {
|
|
143
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)(`${translationPrefix}last_update`)), 1)]),
|
|
144
|
+
_: 1
|
|
145
|
+
}),
|
|
146
|
+
createVNode(_component_PdkTableCol, {
|
|
147
|
+
align: "right",
|
|
148
|
+
component: "th"
|
|
149
|
+
}, {
|
|
150
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)(`${translationPrefix}actions`)), 1)]),
|
|
151
|
+
_: 1
|
|
152
|
+
})
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
})]),
|
|
156
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(data.value?.shipments, (shipment) => {
|
|
157
|
+
return openBlock(), createBlock(OrderShipmentsTableRow_default, {
|
|
158
|
+
key: `row_${shipment.id}_${shipment.updated}`,
|
|
159
|
+
modelValue: unref(bulkModel)[shipment.id],
|
|
160
|
+
"onUpdate:modelValue": ($event) => unref(bulkModel)[shipment.id] = $event,
|
|
161
|
+
"shipment-id": shipment.id
|
|
162
|
+
}, null, 8, [
|
|
163
|
+
"modelValue",
|
|
164
|
+
"onUpdate:modelValue",
|
|
165
|
+
"shipment-id"
|
|
166
|
+
]);
|
|
167
|
+
}), 128))]),
|
|
168
|
+
_: 1
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region ../admin/src/components/OrderBox/ShipmentTableBox.vue
|
|
175
|
+
var ShipmentTableBox_default = /* @__PURE__ */ defineComponent({
|
|
176
|
+
__name: "ShipmentTableBox",
|
|
177
|
+
setup(__props) {
|
|
178
|
+
const { order } = useOrderData();
|
|
179
|
+
const selectedLabels = ref([]);
|
|
180
|
+
const bulkActions = computed(() => {
|
|
181
|
+
return instantiateActions(shipmentActions, {
|
|
182
|
+
orderIds: toValue(order)?.externalIdentifier,
|
|
183
|
+
shipmentIds: toRaw(selectedLabels.value)
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
const setSelectedLabels = (labels) => {
|
|
187
|
+
selectedLabels.value = Object.keys(labels).filter((id) => isDef(labels[id]));
|
|
188
|
+
};
|
|
189
|
+
const { translate } = useLanguage();
|
|
190
|
+
return (_ctx, _cache) => {
|
|
191
|
+
const _component_PdkIcon = resolveComponent("PdkIcon");
|
|
192
|
+
const _component_PdkBadge = resolveComponent("PdkBadge");
|
|
193
|
+
const _component_PdkDropdownButton = resolveComponent("PdkDropdownButton");
|
|
194
|
+
const _component_PdkBox = resolveComponent("PdkBox");
|
|
195
|
+
return openBlock(), createBlock(_component_PdkBox, null, {
|
|
196
|
+
header: withCtx(() => [createVNode(_component_PdkIcon, { icon: unref(AdminIcon).Shipment }, null, 8, ["icon"]), createTextVNode(" " + toDisplayString(unref(translate)("order_labels_header")), 1)]),
|
|
197
|
+
default: withCtx(() => [createVNode(OrderShipmentsTable_default, { onSelect: setSelectedLabels })]),
|
|
198
|
+
footer: withCtx(() => [createVNode(_component_PdkDropdownButton, {
|
|
199
|
+
actions: bulkActions.value,
|
|
200
|
+
disabled: !selectedLabels.value.length
|
|
201
|
+
}, {
|
|
202
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("bulk_actions")) + " ", 1), selectedLabels.value.length ? (openBlock(), createBlock(_component_PdkBadge, { key: 0 }, {
|
|
203
|
+
default: withCtx(() => [createTextVNode(toDisplayString(selectedLabels.value.length), 1)]),
|
|
204
|
+
_: 1
|
|
205
|
+
})) : createCommentVNode("", true)]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["actions", "disabled"])]),
|
|
208
|
+
_: 1
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
//#endregion
|
|
214
|
+
export { ShipmentTableBox_default as default };
|