@webx-ui/module-delivery 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +58 -2
- package/dist/BindingsPage-pjTbDDWA.js +280 -0
- package/dist/BindingsPage-pjTbDDWA.js.map +1 -0
- package/dist/BindingsPage.d.ts +2 -0
- package/dist/CarrierDialog.d.ts +26 -0
- package/dist/CarriersPage-Dpre8dbl.js +650 -0
- package/dist/CarriersPage-Dpre8dbl.js.map +1 -0
- package/dist/CarriersPage.d.ts +2 -0
- package/dist/GeographyPage-IBg0JnNH.js +750 -0
- package/dist/GeographyPage-IBg0JnNH.js.map +1 -0
- package/dist/GeographyPage.d.ts +2 -0
- package/dist/LocalityDialog.d.ts +39 -0
- package/dist/LocalitySearch.d.ts +33 -0
- package/dist/MethodPane.d.ts +29 -0
- package/dist/MethodsPage-Bpzsa_6v.js +414 -0
- package/dist/MethodsPage-Bpzsa_6v.js.map +1 -0
- package/dist/MethodsPage.d.ts +2 -0
- package/dist/OrderChangeDialog.d.ts +7 -0
- package/dist/OrderDeliveryNode.d.ts +2 -0
- package/dist/PointDialog.d.ts +22 -0
- package/dist/PointsPage-CzYIM86R.js +336 -0
- package/dist/PointsPage-CzYIM86R.js.map +1 -0
- package/dist/PointsPage.d.ts +2 -0
- package/dist/PopularPage-CSrvVg4o.js +141 -0
- package/dist/PopularPage-CSrvVg4o.js.map +1 -0
- package/dist/PopularPage.d.ts +2 -0
- package/dist/RegionDialog.d.ts +11 -0
- package/dist/WaybillDialog.d.ts +8 -0
- package/dist/api.d.ts +151 -0
- package/dist/fields/CountryField.d.ts +14 -0
- package/dist/fields/LocalitiesField.d.ts +14 -0
- package/dist/fields/LocalityField.d.ts +16 -0
- package/dist/fields/PointKindField.d.ts +20 -0
- package/dist/fields/RegionField.d.ts +19 -0
- package/dist/fields/ScheduleField.d.ts +24 -0
- package/dist/i18n.d.ts +5 -0
- package/dist/index-5nt0M0In.js +2539 -0
- package/dist/index-5nt0M0In.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +7 -0
- package/dist/module.d.ts +19 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +467 -0
- package/package.json +64 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopularPage-CSrvVg4o.js","sources":["../src/PopularPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport {\n toast,\n WxAction,\n WxAlert,\n WxBadge,\n WxCard,\n WxEmpty,\n WxSkeleton,\n WxSortableList,\n} from '@webx-ui/core'\nimport { useAdmin, useErrorText, WxListScreen } from '@webx-ui/module-admin'\nimport { createDeliveryApi } from './api'\nimport { useDeliveryWords } from './i18n'\nimport LocalitySearch from './LocalitySearch.vue'\nimport type { LocalityBrief } from './types'\n\n/**\n * The popular towns of the checkout's dialog (decision 40): one list for the site, the buttons\n * under the search in the order dragged here. «Add» searches the shared geography; a locality\n * switched off stays in the list, marked — the dialog skips it until it is on again.\n */\nconst context = useAdmin()\nconst api = createDeliveryApi(context)\nconst t = useDeliveryWords()\nconst message = useErrorText()\n\nconst rows = ref<LocalityBrief[]>([])\nconst loading = ref(true)\nconst canManage = computed(() => context.can('delivery.manage'))\n\nconst title = computed(\n () =>\n context.state.manifest?.modules.find((module) => module.id === 'delivery-popular')?.title ??\n t('sections.popular'),\n)\n\nasync function load(): Promise<void> {\n loading.value = true\n\n try {\n rows.value = await api.popular()\n } catch (error) {\n toast.danger(message(error))\n } finally {\n loading.value = false\n }\n}\n\nvoid load()\n\nasync function add(locality: LocalityBrief): Promise<void> {\n if (rows.value.some((row) => row.id === locality.id)) {\n toast.info(t('popular.already'))\n\n return\n }\n\n try {\n rows.value = await api.addPopular(locality.id)\n toast.success(t('popular.added'))\n } catch (error) {\n toast.danger(message(error))\n }\n}\n\nasync function remove(row: LocalityBrief): Promise<void> {\n try {\n rows.value = await api.removePopular(row.id)\n toast.success(t('popular.removed'))\n } catch (error) {\n toast.danger(message(error))\n }\n}\n\nasync function reorder(): Promise<void> {\n try {\n rows.value = await api.setPopular(rows.value.map((row) => row.id))\n } catch (error) {\n toast.danger(message(error, t('common.order-failed')))\n await load()\n }\n}\n</script>\n\n<template>\n <wx-list-screen :title=\"title\" :card=\"false\">\n <wx-card class=\"wx-delivery-popular\">\n <div v-if=\"canManage\" class=\"wx-delivery-popular__add\">\n <locality-search\n creatable\n :exclude=\"rows.map((row) => row.id)\"\n :placeholder=\"t('popular.add')\"\n @pick=\"add\"\n />\n <span class=\"wx-delivery-popular__help\">{{ t('popular.add-help') }}</span>\n </div>\n\n <wx-skeleton v-if=\"loading && rows.length === 0\" :rows=\"4\" />\n\n <wx-empty\n v-else-if=\"rows.length === 0\"\n :title=\"t('popular.empty')\"\n :description=\"t('popular.empty-help')\"\n />\n\n <template v-else>\n <wx-sortable-list\n v-model=\"rows\"\n class=\"wx-delivery-popular__list\"\n hoverable\n plain\n item-key=\"id\"\n :handle=\"canManage ? 'grip' : 'row'\"\n :item-label=\"(item: LocalityBrief) => item.name\"\n :disabled=\"!canManage\"\n data-test=\"popular-list\"\n @move=\"reorder\"\n >\n <template #default=\"{ item }\">\n <span class=\"wx-delivery-popular__row\">\n <span class=\"wx-delivery-popular__name\">{{ item.name }}</span>\n <span class=\"wx-delivery-popular__label\">{{ item.label }}</span>\n <wx-badge v-if=\"!item.active\" size=\"sm\" type=\"warning\" dot>\n {{ t('popular.hidden') }}\n </wx-badge>\n </span>\n </template>\n\n <!-- Asked first, with the red bin the panel removes a row of a list by (blog → rubrics). -->\n <template v-if=\"canManage\" #actions=\"{ item }\">\n <wx-action\n type=\"remove\"\n size=\"sm\"\n :title=\"t('popular.remove')\"\n :confirm=\"t('popular.remove-title', { name: item.name })\"\n :confirm-text=\"t('popular.remove')\"\n :cancel-text=\"t('common.cancel')\"\n data-test=\"popular-remove\"\n @click=\"remove(item)\"\n />\n </template>\n </wx-sortable-list>\n\n <wx-alert\n v-if=\"canManage && rows.length > 1\"\n class=\"wx-delivery-popular__note\"\n type=\"info\"\n :description=\"t('common.drag')\"\n />\n </template>\n </wx-card>\n </wx-list-screen>\n</template>\n\n<style scoped>\n.wx-delivery-popular__add {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-4);\n max-width: 480px;\n margin-bottom: var(--wx-space-16);\n}\n\n.wx-delivery-popular__help {\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n}\n\n/* Off the card's edge on both sides: the bin at the end gets room, as the grip at the start has. */\n.wx-delivery-popular__list :deep(.wx-sortable-list__row) {\n gap: var(--wx-space-8);\n padding-inline: var(--wx-space-4) var(--wx-space-8);\n}\n\n.wx-delivery-popular__row {\n display: flex;\n flex: 1 1 auto;\n flex-wrap: wrap;\n align-items: baseline;\n gap: var(--wx-space-4) var(--wx-space-8);\n min-width: 0;\n padding-block: var(--wx-space-8);\n}\n\n.wx-delivery-popular__name {\n font-weight: var(--wx-font-weight-medium);\n}\n\n.wx-delivery-popular__label {\n min-width: 0;\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-delivery-popular__note {\n margin-top: var(--wx-space-12);\n}\n</style>\n"],"names":["context","useAdmin","api","createDeliveryApi","t","useDeliveryWords","message","useErrorText","rows","ref","loading","canManage","computed","title","module","load","error","toast","add","locality","row","remove","reorder","_createBlock","_unref","WxListScreen","_createVNode","WxCard","_openBlock","_createElementBlock","_hoisted_1","LocalitySearch","_createElementVNode","_hoisted_2","_toDisplayString","WxSkeleton","WxEmpty","_Fragment","WxSortableList","$event","item","_withCtx","_hoisted_3","_hoisted_4","_hoisted_5","WxBadge","WxAction","WxAlert"],"mappings":";;;;;;;;;;AAuBA,UAAMA,IAAUC,EAAA,GACVC,IAAMC,EAAkBH,CAAO,GAC/BI,IAAIC,EAAA,GACJC,IAAUC,EAAA,GAEVC,IAAOC,EAAqB,EAAE,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ponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RegionRow } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
country: string;
|
|
4
|
+
region?: RegionRow | null;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
region: RegionRow | null;
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
9
|
+
field: HTMLDivElement;
|
|
10
|
+
}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WaybillDraft } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
orderId: number;
|
|
4
|
+
draft: WaybillDraft;
|
|
5
|
+
exponent: number;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { AdminContext } from '@webx-ui/module-admin';
|
|
2
|
+
import { ScreenModel } from '@webx-ui/schema';
|
|
3
|
+
import { ChangeInput, ChangeMethod, ChangeOption, ChangeOutcome, ChangeTown, BatchResult, BindingsPage, CarrierDetail, CarrierRow, SettingOption, Countries, LocalityBrief, LocalityDetail, LocalityPage, MethodBlank, MethodDetail, MethodRow, MethodType, OrderDelivery, Option, PointDetail, PointsPage, RegionRow, WaybillChanges, WaybillDraft } from './types';
|
|
4
|
+
/** Everything under `/delivery`, below the panel's API path (spec §14). */
|
|
5
|
+
export declare function createDeliveryApi(admin: AdminContext): {
|
|
6
|
+
methods: () => Promise<{
|
|
7
|
+
methods: MethodRow[];
|
|
8
|
+
types: MethodType[];
|
|
9
|
+
}>;
|
|
10
|
+
method: (id: number) => Promise<MethodDetail>;
|
|
11
|
+
blank: (type: string) => Promise<MethodBlank>;
|
|
12
|
+
createMethod: (type: string, values: ScreenModel) => Promise<MethodDetail>;
|
|
13
|
+
saveMethod: (id: number, values: ScreenModel) => Promise<MethodDetail>;
|
|
14
|
+
removeMethod: (id: number) => Promise<undefined>;
|
|
15
|
+
orderMethods: (ids: number[]) => Promise<undefined>;
|
|
16
|
+
defineKind: (kind: string, names: Record<string, string>) => Promise<Option[]>;
|
|
17
|
+
points: (params: {
|
|
18
|
+
page?: number;
|
|
19
|
+
per_page?: number;
|
|
20
|
+
q?: string;
|
|
21
|
+
kind?: string;
|
|
22
|
+
state?: string;
|
|
23
|
+
/** `title`, `kind`, `locality` or `active`; a minus — the other way round. */
|
|
24
|
+
sort?: string;
|
|
25
|
+
}) => Promise<PointsPage>;
|
|
26
|
+
point: (id: number) => Promise<PointDetail>;
|
|
27
|
+
createPoint: (values: ScreenModel) => Promise<PointDetail>;
|
|
28
|
+
savePoint: (id: number, values: ScreenModel) => Promise<PointDetail>;
|
|
29
|
+
removePoint: (id: number) => Promise<undefined>;
|
|
30
|
+
carriers: () => Promise<CarrierRow[]>;
|
|
31
|
+
carrier: (key: string) => Promise<CarrierDetail>;
|
|
32
|
+
saveCarrier: (key: string, body: {
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
settings?: Record<string, unknown>;
|
|
35
|
+
credentials?: Record<string, string>;
|
|
36
|
+
clear?: string[];
|
|
37
|
+
}) => Promise<CarrierDetail>;
|
|
38
|
+
/**
|
|
39
|
+
* The options of a settings field from the carrier's account (§5.2 of a satellite's spec): the
|
|
40
|
+
* values of what it depends on, what was typed, and `fresh` past the cache. No key travels.
|
|
41
|
+
*/
|
|
42
|
+
carrierOptions: (key: string, field: string, params?: {
|
|
43
|
+
values?: Record<string, unknown>;
|
|
44
|
+
q?: string;
|
|
45
|
+
fresh?: boolean;
|
|
46
|
+
}) => Promise<SettingOption[]>;
|
|
47
|
+
testCarrier: (key: string, credentials: Record<string, string>) => Promise<{
|
|
48
|
+
ok: boolean;
|
|
49
|
+
message: string | null;
|
|
50
|
+
}>;
|
|
51
|
+
runSync: (key: string, directory: string) => Promise<{
|
|
52
|
+
queued: string[];
|
|
53
|
+
}>;
|
|
54
|
+
confirmRemoval: (key: string, directory: string) => Promise<unknown>;
|
|
55
|
+
countries: () => Promise<Countries>;
|
|
56
|
+
enableCountry: (code: string) => Promise<undefined>;
|
|
57
|
+
disableCountry: (code: string) => Promise<undefined>;
|
|
58
|
+
/** Gone when nothing is in it, switched off otherwise — the answer says which. */
|
|
59
|
+
removeCountry: (code: string) => Promise<"deleted" | "deactivated">;
|
|
60
|
+
orderCountries: (codes: string[]) => Promise<undefined>;
|
|
61
|
+
lead: (code: string, carrier: string | null) => Promise<undefined>;
|
|
62
|
+
regions: (country: string) => Promise<RegionRow[]>;
|
|
63
|
+
createRegion: (country: string, names: Record<string, string>, code?: string | null) => Promise<{
|
|
64
|
+
id: number;
|
|
65
|
+
}>;
|
|
66
|
+
saveRegion: (id: number, changes: {
|
|
67
|
+
names?: Record<string, string>;
|
|
68
|
+
code?: string | null;
|
|
69
|
+
}) => Promise<undefined>;
|
|
70
|
+
/** The country's regions in the order dragged to: the selects and the list read them so. */
|
|
71
|
+
orderRegions: (country: string, ids: number[]) => Promise<undefined>;
|
|
72
|
+
removeRegion: (id: number) => Promise<undefined>;
|
|
73
|
+
localities: (params: {
|
|
74
|
+
page?: number;
|
|
75
|
+
per_page?: number;
|
|
76
|
+
q?: string;
|
|
77
|
+
country?: string;
|
|
78
|
+
region?: number | null;
|
|
79
|
+
source?: string;
|
|
80
|
+
state?: string;
|
|
81
|
+
}) => Promise<LocalityPage>;
|
|
82
|
+
suggest: (q: string, country?: string | null) => Promise<LocalityBrief[]>;
|
|
83
|
+
brief: (ids: number[]) => Promise<LocalityBrief[]>;
|
|
84
|
+
locality: (id: number) => Promise<LocalityDetail>;
|
|
85
|
+
createLocality: (values: ScreenModel, force?: boolean) => Promise<LocalityDetail>;
|
|
86
|
+
saveLocality: (id: number, values: ScreenModel, force?: boolean) => Promise<LocalityDetail>;
|
|
87
|
+
removeLocality: (id: number) => Promise<{
|
|
88
|
+
removal: "deleted" | "deactivated";
|
|
89
|
+
}>;
|
|
90
|
+
activateLocality: (id: number) => Promise<undefined>;
|
|
91
|
+
deactivateLocality: (id: number) => Promise<undefined>;
|
|
92
|
+
popular: () => Promise<LocalityBrief[]>;
|
|
93
|
+
setPopular: (ids: number[]) => Promise<LocalityBrief[]>;
|
|
94
|
+
addPopular: (id: number) => Promise<LocalityBrief[]>;
|
|
95
|
+
removePopular: (id: number) => Promise<LocalityBrief[]>;
|
|
96
|
+
bindings: (params: {
|
|
97
|
+
page?: number;
|
|
98
|
+
per_page?: number;
|
|
99
|
+
carrier?: string;
|
|
100
|
+
reason?: string;
|
|
101
|
+
}) => Promise<BindingsPage>;
|
|
102
|
+
batch: (body: {
|
|
103
|
+
action: "bind" | "create" | "ignore";
|
|
104
|
+
ids?: number[];
|
|
105
|
+
all?: boolean;
|
|
106
|
+
carrier?: string;
|
|
107
|
+
reason?: string;
|
|
108
|
+
locality_id?: number;
|
|
109
|
+
}) => Promise<BatchResult>;
|
|
110
|
+
/** The tab «Delivery» of an order's card (§14.2). */
|
|
111
|
+
orderDelivery: (order: number) => Promise<OrderDelivery>;
|
|
112
|
+
createWaybill: (order: number, changes: WaybillChanges) => Promise<OrderDelivery>;
|
|
113
|
+
previewWaybill: (order: number, changes: WaybillChanges) => Promise<WaybillDraft>;
|
|
114
|
+
/** «Change delivery» (decision of 02.11.2026): the checkout's search, for the order's lines. */
|
|
115
|
+
changeTowns: (order: number, q: string) => Promise<{
|
|
116
|
+
localities: ChangeTown[];
|
|
117
|
+
popular: ChangeTown[];
|
|
118
|
+
}>;
|
|
119
|
+
changeMethods: (order: number, locality: number) => Promise<{
|
|
120
|
+
locality: {
|
|
121
|
+
id: number;
|
|
122
|
+
label: string;
|
|
123
|
+
};
|
|
124
|
+
methods: ChangeMethod[];
|
|
125
|
+
}>;
|
|
126
|
+
changePoints: (order: number, locality: number, method: number, q: string, page?: number) => Promise<{
|
|
127
|
+
options: ChangeOption[];
|
|
128
|
+
total: number;
|
|
129
|
+
page: number;
|
|
130
|
+
more: boolean;
|
|
131
|
+
}>;
|
|
132
|
+
changeStreets: (order: number, locality: number, method: number, q: string) => Promise<{
|
|
133
|
+
options: ChangeOption[];
|
|
134
|
+
}>;
|
|
135
|
+
changeDelivery: (order: number, input: ChangeInput) => Promise<{
|
|
136
|
+
change: ChangeOutcome;
|
|
137
|
+
delivery?: OrderDelivery;
|
|
138
|
+
}>;
|
|
139
|
+
trackOrder: (order: number) => Promise<OrderDelivery>;
|
|
140
|
+
cancelShipment: (shipment: number) => Promise<OrderDelivery>;
|
|
141
|
+
shipmentLabel: (shipment: number) => Promise<{
|
|
142
|
+
url: string;
|
|
143
|
+
} | {
|
|
144
|
+
pdf: string;
|
|
145
|
+
filename: string;
|
|
146
|
+
}>;
|
|
147
|
+
};
|
|
148
|
+
export type DeliveryApi = ReturnType<typeof createDeliveryApi>;
|
|
149
|
+
/** The body of a refusal, when the panel's HTTP client kept one. */
|
|
150
|
+
export declare function bodyOf<T>(error: unknown): T | null;
|
|
151
|
+
export declare function statusOf(error: unknown): number | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
};
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: string | null;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string | null) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
};
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: number[] | null;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: number[] | null) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: number[] | null) => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
};
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: number | null;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: number | null) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
14
|
+
root: HTMLDivElement;
|
|
15
|
+
}, HTMLDivElement>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Option } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
options?: Option[];
|
|
4
|
+
/** The shop's pick-up: a kind of its own can be named here. */
|
|
5
|
+
creatable?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_PublicProps = {
|
|
9
|
+
modelValue?: string | null;
|
|
10
|
+
} & __VLS_Props;
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: string | null) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
options: Option[];
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
creatable: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RenderContext } from '@webx-ui/schema';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
countryField?: string;
|
|
5
|
+
context?: RenderContext;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = {
|
|
8
|
+
modelValue?: number | null;
|
|
9
|
+
} & __VLS_Props;
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: number | null) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
countryField: string;
|
|
17
|
+
context: RenderContext;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type Interval = [string, string];
|
|
2
|
+
interface ScheduleValue {
|
|
3
|
+
timezone?: string;
|
|
4
|
+
week?: Record<string, Interval[] | null>;
|
|
5
|
+
exceptions?: {
|
|
6
|
+
date: string;
|
|
7
|
+
hours: Interval[];
|
|
8
|
+
}[];
|
|
9
|
+
text?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_PublicProps = {
|
|
15
|
+
modelValue?: ScheduleValue | null;
|
|
16
|
+
} & __VLS_Props;
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
"update:modelValue": (value: ScheduleValue | null) => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: ScheduleValue | null) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
24
|
+
export default _default;
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Translate } from '@webx-ui/module-admin';
|
|
2
|
+
/** Puts this package's English under the panel's dictionary, once per panel. */
|
|
3
|
+
export declare function useDeliveryMessages(): void;
|
|
4
|
+
/** The section's words: `t('method.new')` reads `webx-delivery::panel.method.new`. */
|
|
5
|
+
export declare function useDeliveryWords(): Translate;
|