@webx-ui/module-tariffs 0.1.15 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TariffsPage-Trs7f5Rf.js +330 -0
- package/dist/TariffsPage-Trs7f5Rf.js.map +1 -0
- package/dist/index-Cg_PgXDL.js +384 -0
- package/dist/index-Cg_PgXDL.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +10 -691
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { defineComponent as J, ref as h, computed as p, onMounted as z, onBeforeUnmount as j, openBlock as k, createElementBlock as C, createBlock as D, unref as l, Fragment as q, createVNode as y, createSlots as Q, withCtx as w, createTextVNode as R, toDisplayString as I, createCommentVNode as X, defineAsyncComponent as Y } from "vue";
|
|
2
|
+
import { categoryRoutes as Z, reorderItems as ee, useAdmin as U, useTranslate as te, useErrorText as ae, useBodyKeys as re, WxScreenHead as ie, WxScreen as se, WxSaveState as oe } from "@webx-ui/module-admin";
|
|
3
|
+
import { onBeforeRouteUpdate as ne, onBeforeRouteLeave as le } from "vue-router";
|
|
4
|
+
import { useLocales as fe, localizedValue as ce, WxSkeleton as ue, WxBadge as de, WxActionBar as he, WxButton as pe, toast as g, confirm as O } from "@webx-ui/core";
|
|
5
|
+
function ge(e = "/tariffs") {
|
|
6
|
+
return {
|
|
7
|
+
api: "tariffs/categories",
|
|
8
|
+
path: `${e}/groups`,
|
|
9
|
+
name: "webx.tariffs.groups",
|
|
10
|
+
module: "tariff-groups",
|
|
11
|
+
screen: "tariffs.category-form",
|
|
12
|
+
manage: "tariffs.groups.manage",
|
|
13
|
+
count: "tariffs_count",
|
|
14
|
+
// The list narrowed to one group is also where its own order is dragged.
|
|
15
|
+
items: (i) => ({ path: e, query: { category: String(i) } }),
|
|
16
|
+
words: {
|
|
17
|
+
new: "webx-tariffs::category.new",
|
|
18
|
+
empty: "webx-tariffs::category.empty",
|
|
19
|
+
"empty-help": "webx-tariffs::category.empty-help",
|
|
20
|
+
order: "webx-tariffs::category.order",
|
|
21
|
+
hidden: "webx-tariffs::category.hidden",
|
|
22
|
+
count: "webx-tariffs::category.tariffs",
|
|
23
|
+
"show-items": "webx-tariffs::category.show-tariffs",
|
|
24
|
+
"delete-blocked": "webx-tariffs::category.delete-blocked",
|
|
25
|
+
"delete-text": "webx-tariffs::category.delete-text",
|
|
26
|
+
deleted: "webx-tariffs::category.deleted",
|
|
27
|
+
saved: "webx-tariffs::category.saved",
|
|
28
|
+
"field-title": "webx-tariffs::category.field-title"
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function _e(e = {}) {
|
|
33
|
+
const i = e.path ?? "/tariffs";
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
id: "tariffs",
|
|
37
|
+
path: i,
|
|
38
|
+
// One route: the open tariff is in the address (`?tariff=`), beside the list it was opened
|
|
39
|
+
// from, so a link to it is a link to both.
|
|
40
|
+
routes: [
|
|
41
|
+
{
|
|
42
|
+
path: i,
|
|
43
|
+
name: "webx.tariffs",
|
|
44
|
+
component: () => import("./TariffsPage-Trs7f5Rf.js"),
|
|
45
|
+
props: { base: i }
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "tariff-groups",
|
|
51
|
+
path: `${i}/groups`,
|
|
52
|
+
routes: Z(ge(i))
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
const V = "tariffs";
|
|
57
|
+
function ve(e) {
|
|
58
|
+
const i = `${e.apiPath}/${V}`, r = (a) => a.data;
|
|
59
|
+
return {
|
|
60
|
+
list: (a = {}) => {
|
|
61
|
+
const o = new URLSearchParams();
|
|
62
|
+
return a.search && o.set("search", a.search), a.category != null && o.set("category", String(a.category)), a.trashed && o.set("trashed", "1"), e.http.get(o.size > 0 ? `${i}?${o}` : i);
|
|
63
|
+
},
|
|
64
|
+
get: (a) => e.http.get(`${i}/${a}`).then(r),
|
|
65
|
+
create: (a) => e.http.post(i, { values: a }).then(r),
|
|
66
|
+
save: (a, o) => e.http.put(`${i}/${a}`, { values: o }).then(r),
|
|
67
|
+
remove: (a) => e.http.delete(`${i}/${a}`).then(() => {
|
|
68
|
+
}),
|
|
69
|
+
// The resource of the list line, and not the form's pair: a restored tariff stays closed.
|
|
70
|
+
restore: (a) => e.http.post(`${i}/${a}/restore`, {}).then(r),
|
|
71
|
+
reorder: (a, o = null) => ee(e, V, a, o)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const me = {
|
|
75
|
+
module: {
|
|
76
|
+
group: "Tariffs",
|
|
77
|
+
tariffs: "Tariffs",
|
|
78
|
+
groups: "Groups"
|
|
79
|
+
},
|
|
80
|
+
tariff: {
|
|
81
|
+
new: "New tariff",
|
|
82
|
+
untitled: "Untitled",
|
|
83
|
+
search: "Search the tariffs",
|
|
84
|
+
empty: "No tariffs yet.",
|
|
85
|
+
"empty-help": "A tariff reaches the site in a tariffs block, on any page.",
|
|
86
|
+
"empty-search": "Nothing matches that.",
|
|
87
|
+
"empty-bin": "The bin is empty.",
|
|
88
|
+
all: "All",
|
|
89
|
+
trashed: "Bin",
|
|
90
|
+
"filter-category": "Group",
|
|
91
|
+
"any-category": "Any group",
|
|
92
|
+
"not-published": "Not published",
|
|
93
|
+
featured: "Recommended",
|
|
94
|
+
"no-price": "No price",
|
|
95
|
+
order: "Drag to change the order of the cards on the site.",
|
|
96
|
+
choose: "Choose a tariff",
|
|
97
|
+
"choose-help": "Or add a new one: the first line of the list.",
|
|
98
|
+
save: "Save",
|
|
99
|
+
saved: "The tariff is saved.",
|
|
100
|
+
"save-failed": "The tariff was not saved.",
|
|
101
|
+
cancel: "Cancel",
|
|
102
|
+
delete: "Delete",
|
|
103
|
+
"delete-title": "Delete the tariff “:name”?",
|
|
104
|
+
"delete-text": "It goes to the bin and leaves every block on the site. Restored, it comes back to its places.",
|
|
105
|
+
deleted: "The tariff is in the bin.",
|
|
106
|
+
restore: "Restore",
|
|
107
|
+
restored: "The tariff is back.",
|
|
108
|
+
"reorder-failed": "The new order was not saved.",
|
|
109
|
+
"order-group": "Drag to change the order inside this group. The rest of the list keeps its own.",
|
|
110
|
+
"leave-title": "Leave without saving?",
|
|
111
|
+
"leave-text": "What you changed in this tariff is not on the server.",
|
|
112
|
+
leave: "Leave",
|
|
113
|
+
back: "Back to the list"
|
|
114
|
+
},
|
|
115
|
+
screen: {
|
|
116
|
+
tariff: "Tariff",
|
|
117
|
+
name: "Name",
|
|
118
|
+
"name-help": "Required in the default language. Not written in another one, it is shown as written in the default one.",
|
|
119
|
+
badge: "Badge",
|
|
120
|
+
"badge-help": "A short line over the name: “30 HOURS / 25$”.",
|
|
121
|
+
featured: "Recommended",
|
|
122
|
+
"featured-help": "The card stands out among the others.",
|
|
123
|
+
pricing: "Price",
|
|
124
|
+
price: "Price",
|
|
125
|
+
"price-help": "A number, up to two digits after the point. Empty — the words below are shown instead.",
|
|
126
|
+
currency: "Currency",
|
|
127
|
+
"currency-help": "The list comes from the site’s settings.",
|
|
128
|
+
"currency-placeholder": "Choose a currency",
|
|
129
|
+
period: "Period",
|
|
130
|
+
"period-help": "Printed after the price: “/mo”, “a year”.",
|
|
131
|
+
"price-text": "Price in words",
|
|
132
|
+
"price-text-help": "Printed when there is no price: “On request”, “Custom”.",
|
|
133
|
+
features: "What is included",
|
|
134
|
+
"features-help": "A line not written in a language is left out of the list in that language.",
|
|
135
|
+
"features-add": "Add a line",
|
|
136
|
+
"features-empty": "No lines yet.",
|
|
137
|
+
feature: "Line",
|
|
138
|
+
about: "Description",
|
|
139
|
+
description: "Description",
|
|
140
|
+
"description-help": "Shown only in the languages it is written in.",
|
|
141
|
+
button: "Button",
|
|
142
|
+
"button-label": "Label",
|
|
143
|
+
"button-label-help": "Without a label in a language, the card has no button in it.",
|
|
144
|
+
"button-link": "Link",
|
|
145
|
+
"button-link-help": "A page of the site or an address. A draft or a page in the bin hides the button.",
|
|
146
|
+
"button-variant": "Look",
|
|
147
|
+
"button-variant-placeholder": "Choose a look",
|
|
148
|
+
settings: "Settings",
|
|
149
|
+
categories: "Groups",
|
|
150
|
+
"categories-help": "What a block picks the tariff by, and the tabs of a page of prices.",
|
|
151
|
+
"categories-add": "Add to a group",
|
|
152
|
+
"categories-empty": "In no group yet.",
|
|
153
|
+
services: "Services",
|
|
154
|
+
"services-help": "The services this tariff is for: a tariffs block on a service’s page can show only its own.",
|
|
155
|
+
published: "Published",
|
|
156
|
+
"published-help": "On the site in every block that shows its groups, from the moment it is saved."
|
|
157
|
+
},
|
|
158
|
+
category: {
|
|
159
|
+
"field-title": "Title",
|
|
160
|
+
visible: "Shown on the site",
|
|
161
|
+
"visible-help": "Hidden, it drops out of every page of prices; its tariffs stay in the blocks that show them.",
|
|
162
|
+
new: "New group",
|
|
163
|
+
empty: "No groups yet.",
|
|
164
|
+
"empty-help": "A group gathers tariffs — for individuals, for business: a block shows the ones you pick, and a page of prices can show each group as a tab.",
|
|
165
|
+
order: "Drag to change the order of the groups on the site.",
|
|
166
|
+
hidden: "Hidden from the site",
|
|
167
|
+
tariffs: "Tariffs: :count",
|
|
168
|
+
"show-tariffs": "Show its tariffs",
|
|
169
|
+
"delete-blocked": "This group still holds tariffs. Move them first.",
|
|
170
|
+
"delete-text": "It goes to the bin and leaves every page of prices. Its tariffs stay.",
|
|
171
|
+
deleted: "The group is in the bin.",
|
|
172
|
+
saved: "The group is saved."
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
function Ne(e, i) {
|
|
176
|
+
if (e.price === null || e.price === void 0) return (e.price_text ?? "").trim();
|
|
177
|
+
const r = Number.isInteger(e.price), a = new Intl.NumberFormat(i, {
|
|
178
|
+
minimumFractionDigits: r ? 0 : 2,
|
|
179
|
+
maximumFractionDigits: r ? 0 : 2
|
|
180
|
+
}).format(e.price), o = e.symbol ?? e.currency ?? "", c = (e.period ?? "").trim();
|
|
181
|
+
return [`${o}${a}`, c].filter((T) => T !== "").join(" ");
|
|
182
|
+
}
|
|
183
|
+
const F = /* @__PURE__ */ new WeakSet();
|
|
184
|
+
function be() {
|
|
185
|
+
try {
|
|
186
|
+
const { i18n: e } = U();
|
|
187
|
+
F.has(e) || (e.defaults("webx-tariffs", me), F.add(e));
|
|
188
|
+
} catch {
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const ye = /* @__PURE__ */ J({
|
|
192
|
+
name: "WxTariffPane",
|
|
193
|
+
__name: "TariffPane",
|
|
194
|
+
props: {
|
|
195
|
+
id: {},
|
|
196
|
+
category: { default: null },
|
|
197
|
+
inline: { type: Boolean, default: !0 }
|
|
198
|
+
},
|
|
199
|
+
emits: ["back", "saved", "created", "removed"],
|
|
200
|
+
setup(e, { emit: i }) {
|
|
201
|
+
const r = e, a = i, o = U(), c = ve(o), T = fe();
|
|
202
|
+
be();
|
|
203
|
+
const s = te("webx-tariffs"), S = ae(), u = h(null), f = h({}), v = h(""), _ = h(r.id !== null), d = h(!1), N = h({}), m = p(() => o.can("tariffs.manage")), $ = p(() => JSON.stringify(f.value)), b = p(() => v.value !== "" && $.value !== v.value), E = p(() => d.value ? "saving" : b.value || r.id === null ? "unsaved" : "saved"), G = p(() => {
|
|
204
|
+
const t = f.value.name, n = r.id === null ? s("tariff.new") : u.value?.name ?? "";
|
|
205
|
+
return ce(t, T.active.value, n) || s("tariff.untitled");
|
|
206
|
+
});
|
|
207
|
+
function A(t) {
|
|
208
|
+
u.value = t.tariff, f.value = t.values, v.value = JSON.stringify(t.values);
|
|
209
|
+
}
|
|
210
|
+
if (r.id === null) {
|
|
211
|
+
const t = {
|
|
212
|
+
name: {},
|
|
213
|
+
badge: {},
|
|
214
|
+
price: null,
|
|
215
|
+
period: {},
|
|
216
|
+
price_text: {},
|
|
217
|
+
features: [],
|
|
218
|
+
description: {},
|
|
219
|
+
button_label: {},
|
|
220
|
+
button_link: null,
|
|
221
|
+
featured: !1,
|
|
222
|
+
published: !1,
|
|
223
|
+
categories: r.category === null ? [] : [r.category]
|
|
224
|
+
};
|
|
225
|
+
f.value = t, v.value = JSON.stringify(t);
|
|
226
|
+
}
|
|
227
|
+
async function M() {
|
|
228
|
+
if (r.id !== null) {
|
|
229
|
+
_.value = !0;
|
|
230
|
+
try {
|
|
231
|
+
A(await c.get(r.id));
|
|
232
|
+
} catch (t) {
|
|
233
|
+
g.danger(S(t)), a("back");
|
|
234
|
+
} finally {
|
|
235
|
+
_.value = !1;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
async function B() {
|
|
240
|
+
if (!(d.value || !m.value)) {
|
|
241
|
+
d.value = !0, N.value = {};
|
|
242
|
+
try {
|
|
243
|
+
const t = r.id === null, n = t ? await c.create(f.value) : await c.save(r.id, f.value);
|
|
244
|
+
A(n), g.success(s("tariff.saved")), a(t ? "created" : "saved", n.tariff);
|
|
245
|
+
} catch (t) {
|
|
246
|
+
const n = t.body;
|
|
247
|
+
n?.errors ? (N.value = n.errors, g.danger(s("tariff.save-failed"))) : g.danger(S(t));
|
|
248
|
+
} finally {
|
|
249
|
+
d.value = !1;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
async function H() {
|
|
254
|
+
const t = u.value;
|
|
255
|
+
if (!(!t || !await O({
|
|
256
|
+
title: s("tariff.delete-title", { name: t.name }),
|
|
257
|
+
message: s("tariff.delete-text"),
|
|
258
|
+
confirmText: s("tariff.delete"),
|
|
259
|
+
cancelText: s("tariff.cancel"),
|
|
260
|
+
tone: "danger"
|
|
261
|
+
})))
|
|
262
|
+
try {
|
|
263
|
+
await c.remove(t.id), g.success(s("tariff.deleted")), v.value = $.value, a("removed", t.id);
|
|
264
|
+
} catch (x) {
|
|
265
|
+
g.danger(S(x));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function W(t) {
|
|
269
|
+
b.value && t.preventDefault();
|
|
270
|
+
}
|
|
271
|
+
function L(t) {
|
|
272
|
+
(t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "s" && (t.preventDefault(), (b.value || r.id === null) && B());
|
|
273
|
+
}
|
|
274
|
+
re(L), z(() => {
|
|
275
|
+
M(), window.addEventListener("beforeunload", W);
|
|
276
|
+
}), j(() => {
|
|
277
|
+
window.removeEventListener("beforeunload", W);
|
|
278
|
+
});
|
|
279
|
+
async function P() {
|
|
280
|
+
return !b.value || !m.value ? !0 : await O({
|
|
281
|
+
title: s("tariff.leave-title"),
|
|
282
|
+
message: s("tariff.leave-text"),
|
|
283
|
+
confirmText: s("tariff.leave"),
|
|
284
|
+
cancelText: s("tariff.cancel"),
|
|
285
|
+
tone: "danger"
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
ne(
|
|
289
|
+
async (t, n) => t.query.tariff === n.query.tariff ? !0 : await P()
|
|
290
|
+
), le(P);
|
|
291
|
+
const K = p(
|
|
292
|
+
() => m.value && u.value !== null ? [
|
|
293
|
+
{
|
|
294
|
+
key: "delete",
|
|
295
|
+
label: s("tariff.delete"),
|
|
296
|
+
icon: "trash",
|
|
297
|
+
danger: !0,
|
|
298
|
+
menu: !0,
|
|
299
|
+
run: () => {
|
|
300
|
+
H();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
] : []
|
|
304
|
+
);
|
|
305
|
+
return (t, n) => (k(), C("div", {
|
|
306
|
+
class: "wx-tariff",
|
|
307
|
+
onKeydown: L
|
|
308
|
+
}, [
|
|
309
|
+
_.value ? (k(), D(l(ue), {
|
|
310
|
+
key: 0,
|
|
311
|
+
class: "wx-tariff__ghost",
|
|
312
|
+
title: "",
|
|
313
|
+
rows: 6
|
|
314
|
+
})) : (k(), C(q, { key: 1 }, [
|
|
315
|
+
y(l(ie), {
|
|
316
|
+
level: 3,
|
|
317
|
+
back: !r.inline,
|
|
318
|
+
"back-label": l(s)("tariff.back"),
|
|
319
|
+
title: G.value,
|
|
320
|
+
actions: K.value,
|
|
321
|
+
"collapse-below": 480,
|
|
322
|
+
onBack: n[0] || (n[0] = (x) => a("back"))
|
|
323
|
+
}, Q({ _: 2 }, [
|
|
324
|
+
u.value && !u.value.published ? {
|
|
325
|
+
name: "title-after",
|
|
326
|
+
fn: w(() => [
|
|
327
|
+
y(l(de), { dot: "" }, {
|
|
328
|
+
default: w(() => [
|
|
329
|
+
R(I(l(s)("tariff.not-published")), 1)
|
|
330
|
+
]),
|
|
331
|
+
_: 1
|
|
332
|
+
})
|
|
333
|
+
]),
|
|
334
|
+
key: "0"
|
|
335
|
+
} : void 0
|
|
336
|
+
]), 1032, ["back", "back-label", "title", "actions"]),
|
|
337
|
+
y(l(se), {
|
|
338
|
+
modelValue: f.value,
|
|
339
|
+
"onUpdate:modelValue": n[1] || (n[1] = (x) => f.value = x),
|
|
340
|
+
name: "tariffs.form",
|
|
341
|
+
errors: N.value,
|
|
342
|
+
disabled: !m.value || d.value
|
|
343
|
+
}, null, 8, ["modelValue", "errors", "disabled"]),
|
|
344
|
+
m.value ? (k(), D(l(he), { key: 0 }, {
|
|
345
|
+
state: w(() => [
|
|
346
|
+
y(l(oe), { state: E.value }, null, 8, ["state"])
|
|
347
|
+
]),
|
|
348
|
+
default: w(() => [
|
|
349
|
+
y(l(pe), {
|
|
350
|
+
type: "primary",
|
|
351
|
+
loading: d.value,
|
|
352
|
+
disabled: !b.value && r.id !== null,
|
|
353
|
+
onClick: B
|
|
354
|
+
}, {
|
|
355
|
+
default: w(() => [
|
|
356
|
+
R(I(l(s)("tariff.save")), 1)
|
|
357
|
+
]),
|
|
358
|
+
_: 1
|
|
359
|
+
}, 8, ["loading", "disabled"])
|
|
360
|
+
]),
|
|
361
|
+
_: 1
|
|
362
|
+
})) : X("", !0)
|
|
363
|
+
], 64))
|
|
364
|
+
], 32));
|
|
365
|
+
}
|
|
366
|
+
}), we = (e, i) => {
|
|
367
|
+
const r = e.__vccOpts || e;
|
|
368
|
+
for (const [a, o] of i)
|
|
369
|
+
r[a] = o;
|
|
370
|
+
return r;
|
|
371
|
+
}, $e = /* @__PURE__ */ we(ye, [["__scopeId", "data-v-196f1a0d"]]), Ae = Y(() => import("./TariffsPage-Trs7f5Rf.js"));
|
|
372
|
+
export {
|
|
373
|
+
V as T,
|
|
374
|
+
Ae as W,
|
|
375
|
+
we as _,
|
|
376
|
+
$e as a,
|
|
377
|
+
_e as b,
|
|
378
|
+
ve as c,
|
|
379
|
+
me as d,
|
|
380
|
+
Ne as p,
|
|
381
|
+
ge as t,
|
|
382
|
+
be as u
|
|
383
|
+
};
|
|
384
|
+
//# sourceMappingURL=index-Cg_PgXDL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Cg_PgXDL.js","sources":["../src/module.ts","../src/api.ts","../src/messages.ts","../src/price.ts","../src/i18n.ts","../src/TariffPane.vue","../src/index.ts"],"sourcesContent":["import { categoryRoutes, type AdminModule, type CategoriesOptions } from '@webx-ui/module-admin'\n\nexport interface TariffsOptions {\n /** Where the tariffs live inside the panel. The groups sit under it. */\n path?: string\n}\n\n/**\n * The groups of the tariffs as the panel's shared category screens see them. Exported so that a\n * panel mounting the screens somewhere of its own does not have to repeat the words.\n *\n * Categories in the code and groups in the words (decision 14): the API and the tables speak the\n * shared code's language, the editor reads \"group\" — “For individuals”, “For business”. No words\n * about addresses: a group has none (decision 2), and the shared list leaves the address line out\n * when the server says so.\n */\nexport function tariffGroupsOptions(path = '/tariffs'): CategoriesOptions {\n return {\n api: 'tariffs/categories',\n path: `${path}/groups`,\n name: 'webx.tariffs.groups',\n module: 'tariff-groups',\n screen: 'tariffs.category-form',\n manage: 'tariffs.groups.manage',\n count: 'tariffs_count',\n // The list narrowed to one group is also where its own order is dragged.\n items: (id) => ({ path, query: { category: String(id) } }),\n words: {\n new: 'webx-tariffs::category.new',\n empty: 'webx-tariffs::category.empty',\n 'empty-help': 'webx-tariffs::category.empty-help',\n order: 'webx-tariffs::category.order',\n hidden: 'webx-tariffs::category.hidden',\n count: 'webx-tariffs::category.tariffs',\n 'show-items': 'webx-tariffs::category.show-tariffs',\n 'delete-blocked': 'webx-tariffs::category.delete-blocked',\n 'delete-text': 'webx-tariffs::category.delete-text',\n deleted: 'webx-tariffs::category.deleted',\n saved: 'webx-tariffs::category.saved',\n 'field-title': 'webx-tariffs::category.field-title',\n },\n }\n}\n\n/**\n * The tariffs as sections of the panel: tariffs, and their groups (§5.2).\n *\n * Two modules rather than one, because the navigation is one entry per module; the server puts\n * both in the `tariffs` group, which is what draws them under one heading. The panel includes\n * them as `...tariffs()` — the line `extra.webx.panel.register` of the composer package names. A\n * section whose server half is not installed never appears — the entry is built from the manifest.\n */\nexport function tariffs(options: TariffsOptions = {}): AdminModule[] {\n const path = options.path ?? '/tariffs'\n\n return [\n {\n id: 'tariffs',\n path,\n // One route: the open tariff is in the address (`?tariff=`), beside the list it was opened\n // from, so a link to it is a link to both.\n routes: [\n {\n path,\n name: 'webx.tariffs',\n component: () => import('./TariffsPage.vue'),\n props: { base: path },\n },\n ],\n },\n {\n id: 'tariff-groups',\n path: `${path}/groups`,\n routes: categoryRoutes(tariffGroupsOptions(path)),\n },\n ]\n}\n","import { reorderItems, type AdminContext } from '@webx-ui/module-admin'\nimport type { ScreenModel } from '@webx-ui/schema'\nimport type { TariffDetail, TariffQuery, TariffRow, TariffsList } from './types'\n\nexport interface TariffsApi {\n /** Every tariff, with the groups the list can be narrowed to. */\n list(query?: TariffQuery): Promise<TariffsList>\n get(id: number): Promise<TariffDetail>\n /**\n * A new tariff out of the values of its form, in one request: the form is filled in first and\n * the record made on the first save, so nobody leaves an empty card behind.\n */\n create(values: ScreenModel): Promise<TariffDetail>\n /** Refused with a 422 under the name of the field — a line of the list under `features.<n>.text`. */\n save(id: number, values: ScreenModel): Promise<TariffDetail>\n remove(id: number): Promise<void>\n restore(id: number): Promise<TariffRow>\n /** The order on screen: of the whole list, or — with `category` — of that group alone. */\n reorder(ids: number[], category?: number | null): Promise<void>\n}\n\n/** The path of the list under the panel's API, and of its order (`CategoryRoutes::items()`). */\nexport const TARIFFS_API = 'tariffs'\n\n/**\n * Everything under `/tariffs`, below the panel's API path — except the groups, which are the\n * panel's shared categories and are asked for with `createCategoriesApi(admin, 'tariffs/categories')`.\n */\nexport function createTariffsApi(admin: AdminContext): TariffsApi {\n const base = `${admin.apiPath}/${TARIFFS_API}`\n const data = <T>(body: { data: T }): T => body.data\n\n return {\n list: (query = {}) => {\n const search = new URLSearchParams()\n\n // Only what was asked for: `category=` would ask for the tariffs of no group.\n if (query.search) search.set('search', query.search)\n if (query.category != null) search.set('category', String(query.category))\n if (query.trashed) search.set('trashed', '1')\n\n return admin.http.get<TariffsList>(search.size > 0 ? `${base}?${search}` : base)\n },\n get: (id) => admin.http.get<{ data: TariffDetail }>(`${base}/${id}`).then(data),\n create: (values) => admin.http.post<{ data: TariffDetail }>(base, { values }).then(data),\n save: (id, values) =>\n admin.http.put<{ data: TariffDetail }>(`${base}/${id}`, { values }).then(data),\n remove: (id) => admin.http.delete<void>(`${base}/${id}`).then(() => undefined),\n // The resource of the list line, and not the form's pair: a restored tariff stays closed.\n restore: (id) => admin.http.post<{ data: TariffRow }>(`${base}/${id}/restore`, {}).then(data),\n reorder: (ids, category = null) => reorderItems(admin, TARIFFS_API, ids, category),\n }\n}\n","import type { Messages } from '@webx-ui/module-admin'\n\n/**\n * The English this package speaks on its own, before the server's dictionary arrives, or without\n * one. The server ships the same lines in ten languages under `webx-tariffs::` and overrides\n * these; `messages.test.ts` keeps the two sets of keys equal.\n *\n * Categories in the code, groups in the words (decision 14): the `category` group holds what the\n * shared category screens say, and every one of its lines says \"group\".\n */\nexport const tariffsMessages: Record<string, Messages> = {\n module: {\n group: 'Tariffs',\n tariffs: 'Tariffs',\n groups: 'Groups',\n },\n tariff: {\n new: 'New tariff',\n untitled: 'Untitled',\n search: 'Search the tariffs',\n empty: 'No tariffs yet.',\n 'empty-help': 'A tariff reaches the site in a tariffs block, on any page.',\n 'empty-search': 'Nothing matches that.',\n 'empty-bin': 'The bin is empty.',\n all: 'All',\n trashed: 'Bin',\n 'filter-category': 'Group',\n 'any-category': 'Any group',\n 'not-published': 'Not published',\n featured: 'Recommended',\n 'no-price': 'No price',\n order: 'Drag to change the order of the cards on the site.',\n choose: 'Choose a tariff',\n 'choose-help': 'Or add a new one: the first line of the list.',\n save: 'Save',\n saved: 'The tariff is saved.',\n 'save-failed': 'The tariff was not saved.',\n cancel: 'Cancel',\n delete: 'Delete',\n 'delete-title': 'Delete the tariff “:name”?',\n 'delete-text':\n 'It goes to the bin and leaves every block on the site. Restored, it comes back to its places.',\n deleted: 'The tariff is in the bin.',\n restore: 'Restore',\n restored: 'The tariff is back.',\n 'reorder-failed': 'The new order was not saved.',\n 'order-group':\n 'Drag to change the order inside this group. The rest of the list keeps its own.',\n 'leave-title': 'Leave without saving?',\n 'leave-text': 'What you changed in this tariff is not on the server.',\n leave: 'Leave',\n back: 'Back to the list',\n },\n screen: {\n tariff: 'Tariff',\n name: 'Name',\n 'name-help':\n 'Required in the default language. Not written in another one, it is shown as written in the default one.',\n badge: 'Badge',\n 'badge-help': 'A short line over the name: “30 HOURS / 25$”.',\n featured: 'Recommended',\n 'featured-help': 'The card stands out among the others.',\n pricing: 'Price',\n price: 'Price',\n 'price-help':\n 'A number, up to two digits after the point. Empty — the words below are shown instead.',\n currency: 'Currency',\n 'currency-help': 'The list comes from the site’s settings.',\n 'currency-placeholder': 'Choose a currency',\n period: 'Period',\n 'period-help': 'Printed after the price: “/mo”, “a year”.',\n 'price-text': 'Price in words',\n 'price-text-help': 'Printed when there is no price: “On request”, “Custom”.',\n features: 'What is included',\n 'features-help': 'A line not written in a language is left out of the list in that language.',\n 'features-add': 'Add a line',\n 'features-empty': 'No lines yet.',\n feature: 'Line',\n about: 'Description',\n description: 'Description',\n 'description-help': 'Shown only in the languages it is written in.',\n button: 'Button',\n 'button-label': 'Label',\n 'button-label-help': 'Without a label in a language, the card has no button in it.',\n 'button-link': 'Link',\n 'button-link-help':\n 'A page of the site or an address. A draft or a page in the bin hides the button.',\n 'button-variant': 'Look',\n 'button-variant-placeholder': 'Choose a look',\n settings: 'Settings',\n categories: 'Groups',\n 'categories-help': 'What a block picks the tariff by, and the tabs of a page of prices.',\n 'categories-add': 'Add to a group',\n 'categories-empty': 'In no group yet.',\n services: 'Services',\n 'services-help':\n 'The services this tariff is for: a tariffs block on a service’s page can show only its own.',\n published: 'Published',\n 'published-help':\n 'On the site in every block that shows its groups, from the moment it is saved.',\n },\n category: {\n 'field-title': 'Title',\n visible: 'Shown on the site',\n 'visible-help':\n 'Hidden, it drops out of every page of prices; its tariffs stay in the blocks that show them.',\n new: 'New group',\n empty: 'No groups yet.',\n 'empty-help':\n 'A group gathers tariffs — for individuals, for business: a block shows the ones you pick, and a page of prices can show each group as a tab.',\n order: 'Drag to change the order of the groups on the site.',\n hidden: 'Hidden from the site',\n tariffs: 'Tariffs: :count',\n 'show-tariffs': 'Show its tariffs',\n 'delete-blocked': 'This group still holds tariffs. Move them first.',\n 'delete-text': 'It goes to the bin and leaves every page of prices. Its tariffs stay.',\n deleted: 'The group is in the bin.',\n saved: 'The group is saved.',\n },\n}\n","import type { TariffRow } from './types'\n\n/**\n * The price of a row on one line, the way the offered block prints it: the symbol before the\n * number, the period after it (“$750 /mo”), or the words where there is no number (“On request”).\n * `''` when there is neither — the row says nothing rather than “0”.\n *\n * The number follows the same rule as the card's `amount` (§4.1): no fraction when it is whole,\n * two places when it is not, the separators of the panel's language. Zero is a number (decision\n * 16): “$0”, and “Free” is the words.\n */\nexport function priceLine(\n row: Pick<TariffRow, 'price' | 'symbol' | 'currency' | 'period' | 'price_text'>,\n locale: string,\n): string {\n if (row.price === null || row.price === undefined) return (row.price_text ?? '').trim()\n\n const whole = Number.isInteger(row.price)\n const amount = new Intl.NumberFormat(locale, {\n minimumFractionDigits: whole ? 0 : 2,\n maximumFractionDigits: whole ? 0 : 2,\n }).format(row.price)\n const symbol = row.symbol ?? row.currency ?? ''\n const period = (row.period ?? '').trim()\n\n return [`${symbol}${amount}`, period].filter((part) => part !== '').join(' ')\n}\n","import { useAdmin } from '@webx-ui/module-admin'\nimport { tariffsMessages } from './messages'\n\nconst seeded = new WeakSet<object>()\n\n/** Puts this package's English under the panel's dictionary, once per panel. */\nexport function useTariffsMessages(): void {\n try {\n const { i18n } = useAdmin()\n\n if (!seeded.has(i18n)) {\n i18n.defaults('webx-tariffs', tariffsMessages)\n seeded.add(i18n)\n }\n } catch {\n // Outside a panel there is no dictionary to seed, and `useTranslate` falls back on its own.\n }\n}\n","<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref } from 'vue'\nimport { onBeforeRouteLeave, onBeforeRouteUpdate, type RouteLocationNormalized } from 'vue-router'\nimport {\n confirm,\n localizedValue,\n toast,\n useLocales,\n WxActionBar,\n WxBadge,\n WxButton,\n WxSkeleton,\n type LocalizedValue,\n} from '@webx-ui/core'\nimport {\n useAdmin,\n useErrorText,\n useTranslate,\n WxSaveState,\n WxScreen,\n WxScreenHead,\n type ScreenAction,\n useBodyKeys,\n} from '@webx-ui/module-admin'\nimport type { ScreenModel } from '@webx-ui/schema'\nimport { createTariffsApi } from './api'\nimport { useTariffsMessages } from './i18n'\nimport type { TariffDetail, TariffSummary } from './types'\n\n/**\n * One tariff: the pane beside the list, and the whole screen on a phone.\n *\n * The described screen `tariffs.form` with a head over it and one button under it. One explicit\n * save, and no autosave: a tariff has no draft (decision 10), so what is saved is on the site at\n * once — the button is the moment somebody decides it is ready.\n *\n * A new tariff is a form first and a record on the first save: an empty row made by pressing\n * \"New tariff\" and walking away would be a tariff with nothing in it on the list for ever.\n *\n * The way back is drawn here and not by the pane around it: the drawer a narrow screen opens\n * this in has no close of its own on purpose (CLAUDE.md §4).\n */\ndefineOptions({ name: 'WxTariffPane' })\n\nconst props = withDefaults(\n defineProps<{\n /** `null` — a tariff not written yet. */\n id: number | null\n /** The group the list is narrowed to: a new tariff starts in it. */\n category?: number | null\n /** False in the drawer a narrow screen opens this in. */\n inline?: boolean\n }>(),\n { category: null, inline: true },\n)\n\nconst emit = defineEmits<{\n back: []\n /** The tariff was written; the list redraws its row. */\n saved: [tariff: TariffSummary]\n /** The first save of a new tariff: it is a record now, with an id to be opened by. */\n created: [tariff: TariffSummary]\n removed: [id: number]\n}>()\n\nconst context = useAdmin()\nconst api = createTariffsApi(context)\nconst locales = useLocales()\nuseTariffsMessages()\n\nconst t = useTranslate('webx-tariffs')\n/* Not the server's `message`: the panel says how a request failed in its own words. */\nconst message = useErrorText()\n\nconst tariff = ref<TariffSummary | null>(null)\nconst values = ref<ScreenModel>({})\nconst snapshot = ref('')\n\nconst loading = ref(props.id !== null)\nconst saving = ref(false)\nconst errors = ref<Record<string, string[]>>({})\n\nconst canManage = computed(() => context.can('tariffs.manage'))\n\nconst current = computed(() => JSON.stringify(values.value))\nconst dirty = computed(() => snapshot.value !== '' && current.value !== snapshot.value)\n\nconst state = computed<'saving' | 'unsaved' | 'saved'>(() => {\n if (saving.value) return 'saving'\n\n return dirty.value || props.id === null ? 'unsaved' : 'saved'\n})\n\n/** The name follows the field rather than the answer: an edit shows at the top as it is typed. */\nconst title = computed(() => {\n const written = values.value.name as LocalizedValue | string | null | undefined\n const fallback = props.id === null ? t('tariff.new') : (tariff.value?.name ?? '')\n\n return localizedValue(written, locales.active.value, fallback) || t('tariff.untitled')\n})\n\nfunction take(detail: TariffDetail): void {\n tariff.value = detail.tariff\n values.value = detail.values\n snapshot.value = JSON.stringify(detail.values)\n}\n\nif (props.id === null) {\n // What the server would answer for a tariff with nothing in it yet. No currency: the panel does\n // not know the site's list, and the server gives a new tariff its first one (decision 15).\n const blank: ScreenModel = {\n name: {},\n badge: {},\n price: null,\n period: {},\n price_text: {},\n features: [],\n description: {},\n button_label: {},\n button_link: null,\n featured: false,\n published: false,\n categories: props.category === null ? [] : [props.category],\n }\n\n values.value = blank\n snapshot.value = JSON.stringify(blank)\n}\n\nasync function load(): Promise<void> {\n if (props.id === null) return\n\n loading.value = true\n\n try {\n take(await api.get(props.id))\n } catch (error) {\n toast.danger(message(error))\n emit('back')\n } finally {\n loading.value = false\n }\n}\n\nasync function save(): Promise<void> {\n if (saving.value || !canManage.value) return\n\n saving.value = true\n errors.value = {}\n\n try {\n const made = props.id === null\n const detail = made\n ? await api.create(values.value)\n : await api.save(props.id as number, values.value)\n\n take(detail)\n toast.success(t('tariff.saved'))\n if (made) emit('created', detail.tariff)\n else emit('saved', detail.tariff)\n } catch (error) {\n const body = (error as { body?: { errors?: Record<string, string[]> } }).body\n\n if (body?.errors) {\n errors.value = body.errors\n toast.danger(t('tariff.save-failed'))\n } else {\n toast.danger(message(error))\n }\n } finally {\n saving.value = false\n }\n}\n\nasync function remove(): Promise<void> {\n const record = tariff.value\n\n if (!record) return\n\n const agreed = await confirm({\n title: t('tariff.delete-title', { name: record.name }),\n message: t('tariff.delete-text'),\n confirmText: t('tariff.delete'),\n cancelText: t('tariff.cancel'),\n tone: 'danger',\n })\n\n if (!agreed) return\n\n try {\n await api.remove(record.id)\n toast.success(t('tariff.deleted'))\n // Nothing left to protect: the record is in the bin.\n snapshot.value = current.value\n emit('removed', record.id)\n } catch (error) {\n toast.danger(message(error))\n }\n}\n\n/* The browser's own guard: it cannot wait for a request, so all it can do is ask. */\nfunction leaveGuard(event: BeforeUnloadEvent): void {\n if (dirty.value) event.preventDefault()\n}\n\n/* Ctrl+S saves, as it does everywhere else that has a save button. */\nfunction onKeydown(event: KeyboardEvent): void {\n if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's') {\n event.preventDefault()\n if (dirty.value || props.id === null) void save()\n }\n}\n\n// And from the page around the form, where a click on empty space leaves the focus.\nuseBodyKeys(onKeydown)\n\nonMounted(() => {\n void load()\n window.addEventListener('beforeunload', leaveGuard)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('beforeunload', leaveGuard)\n})\n\nasync function mayLeave(): Promise<boolean> {\n if (!dirty.value || !canManage.value) return true\n\n return await confirm({\n title: t('tariff.leave-title'),\n message: t('tariff.leave-text'),\n confirmText: t('tariff.leave'),\n cancelText: t('tariff.cancel'),\n tone: 'danger',\n })\n}\n\n/*\n * The list and this form are one route, so another tariff is an update of it rather than a way\n * out — and so is every keystroke in the search above the list, which goes into the address too.\n * Only a change of the tariff asks.\n */\nonBeforeRouteUpdate(async (to: RouteLocationNormalized, from: RouteLocationNormalized) =>\n to.query.tariff === from.query.tariff ? true : await mayLeave(),\n)\n\nonBeforeRouteLeave(mayLeave)\n\n/* What leads away from the tariff. On a narrow pane the head folds them into the ···. */\nconst actions = computed<ScreenAction[]>(() =>\n canManage.value && tariff.value !== null\n ? [\n {\n key: 'delete',\n label: t('tariff.delete'),\n icon: 'trash',\n danger: true,\n menu: true,\n run: () => void remove(),\n },\n ]\n : [],\n)\n</script>\n\n<template>\n <div class=\"wx-tariff\" @keydown=\"onKeydown\">\n <wx-skeleton v-if=\"loading\" class=\"wx-tariff__ghost\" title :rows=\"6\" />\n\n <template v-else>\n <wx-screen-head\n :level=\"3\"\n :back=\"!props.inline\"\n :back-label=\"t('tariff.back')\"\n :title=\"title\"\n :actions=\"actions\"\n :collapse-below=\"480\"\n @back=\"emit('back')\"\n >\n <template v-if=\"tariff && !tariff.published\" #title-after>\n <wx-badge dot>{{ t('tariff.not-published') }}</wx-badge>\n </template>\n </wx-screen-head>\n\n <wx-screen\n v-model=\"values\"\n name=\"tariffs.form\"\n :errors=\"errors\"\n :disabled=\"!canManage || saving\"\n />\n\n <wx-action-bar v-if=\"canManage\">\n <template #state>\n <wx-save-state :state=\"state\" />\n </template>\n\n <wx-button\n type=\"primary\"\n :loading=\"saving\"\n :disabled=\"!dirty && props.id !== null\"\n @click=\"save\"\n >\n {{ t('tariff.save') }}\n </wx-button>\n </wx-action-bar>\n </template>\n </div>\n</template>\n\n<style scoped>\n.wx-tariff {\n display: flex;\n flex-direction: column;\n gap: var(--wx-gap, var(--wx-space-16));\n min-width: 0;\n padding: var(--wx-gap, var(--wx-space-16));\n container-type: inline-size;\n}\n\n.wx-tariff__ghost {\n max-width: 480px;\n}\n</style>\n","import { defineAsyncComponent } from 'vue'\nexport { tariffs, tariffGroupsOptions, type TariffsOptions } from './module'\nexport { createTariffsApi, TARIFFS_API, type TariffsApi } from './api'\nexport { tariffsMessages } from './messages'\nexport { priceLine } from './price'\nexport const WxTariffsPage = defineAsyncComponent(() => import('./TariffsPage.vue'))\nexport { default as WxTariffPane } from './TariffPane.vue'\nexport type {\n TariffDetail,\n TariffGroupRef,\n TariffQuery,\n TariffRow,\n TariffsList,\n TariffSummary,\n} from './types'\n"],"names":["tariffGroupsOptions","path","id","tariffs","options","categoryRoutes","TARIFFS_API","createTariffsApi","admin","base","data","body","query","search","values","ids","category","reorderItems","tariffsMessages","priceLine","row","locale","whole","amount","symbol","period","part","seeded","useTariffsMessages","i18n","useAdmin","props","__props","emit","__emit","context","api","locales","useLocales","t","useTranslate","message","useErrorText","tariff","ref","snapshot","loading","saving","errors","canManage","computed","current","dirty","state","title","written","fallback","localizedValue","take","detail","blank","load","error","toast","save","made","remove","record","confirm","leaveGuard","event","onKeydown","useBodyKeys","onMounted","onBeforeUnmount","mayLeave","onBeforeRouteUpdate","to","from","onBeforeRouteLeave","actions","_createElementBlock","_createBlock","_unref","WxSkeleton","_Fragment","_createVNode","WxScreenHead","WxBadge","WxScreen","$event","WxActionBar","WxSaveState","WxButton","WxTariffsPage","defineAsyncComponent"],"mappings":";;;;AAgBO,SAASA,GAAoBC,IAAO,YAA+B;AACxE,SAAO;AAAA,IACL,KAAK;AAAA,IACL,MAAM,GAAGA,CAAI;AAAA,IACb,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA;AAAA,IAEP,OAAO,CAACC,OAAQ,EAAE,MAAAD,GAAM,OAAO,EAAE,UAAU,OAAOC,CAAE,EAAA;IACpD,OAAO;AAAA,MACL,KAAK;AAAA,MACL,OAAO;AAAA,MACP,cAAc;AAAA,MACd,OAAO;AAAA,MACP,QAAQ;AAA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C,EAAqB,MAAM,OAAO,2BAAmB,CAAC;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ export { tariffs, tariffGroupsOptions, type TariffsOptions } from './module';
|
|
|
2
2
|
export { createTariffsApi, TARIFFS_API, type TariffsApi } from './api';
|
|
3
3
|
export { tariffsMessages } from './messages';
|
|
4
4
|
export { priceLine } from './price';
|
|
5
|
-
export
|
|
5
|
+
export declare const WxTariffsPage: import('vue').DefineComponent<{
|
|
6
|
+
base?: string;
|
|
7
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
8
|
+
base?: string;
|
|
9
|
+
}> & Readonly<{}>, {
|
|
10
|
+
base: string;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
12
|
export { default as WxTariffPane } from './TariffPane';
|
|
7
13
|
export type { TariffDetail, TariffGroupRef, TariffQuery, TariffRow, TariffsList, TariffSummary, } from './types';
|