@webx-ui/module-tariffs 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 +73 -0
- package/dist/TariffPane.d.ts +24 -0
- package/dist/TariffsPage.d.ts +21 -0
- package/dist/api.d.ts +26 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +694 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +10 -0
- package/dist/module.d.ts +24 -0
- package/dist/price.d.ts +11 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +65 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 webx-ui
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @webx-ui/module-tariffs
|
|
2
|
+
|
|
3
|
+
The front end of the tariffs section of the [WebX UI](https://github.com/webx-ui/webx-ui) admin
|
|
4
|
+
panel: price cards — a name, a badge, a price in a currency of the site's list with a period, or
|
|
5
|
+
words instead of a price, the lines of what the plan includes, a description, one button and the
|
|
6
|
+
«recommended» mark — gathered into groups and, when the site has services, linked to them.
|
|
7
|
+
|
|
8
|
+
The other half is the Composer package `webx-ui/module-tariffs`, which owns the tariffs, their
|
|
9
|
+
groups and orders, the Tariffs block, `tariffs()` for templates and the API. A section appears in
|
|
10
|
+
the panel when both halves are installed.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @webx-ui/module-tariffs
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { createAdmin } from '@webx-ui/module-admin'
|
|
20
|
+
import { tariffs } from '@webx-ui/module-tariffs'
|
|
21
|
+
import '@webx-ui/module-tariffs/style.css'
|
|
22
|
+
|
|
23
|
+
createAdmin({
|
|
24
|
+
basePath: '/cms',
|
|
25
|
+
modules: [...tariffs()],
|
|
26
|
+
}).mount()
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`tariffs()` is **two** sections — **Tariffs** and **Groups** — in a menu group of their own, so it
|
|
30
|
+
is spread into the list. `tariffs({ path: '/pricing' })` puts both somewhere else inside the panel;
|
|
31
|
+
the groups always sit under the tariffs (`/pricing/groups`).
|
|
32
|
+
|
|
33
|
+
On the server, the block type the module offers is installed once:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
php artisan webx:blocks:offered --install --module=tariffs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## The tariffs
|
|
40
|
+
|
|
41
|
+
A list and the form of one tariff side by side, without pages: the list is where tariffs are put in
|
|
42
|
+
order, and a drag cannot cross a page boundary. The open tariff is in the address (`?tariff=7`), so
|
|
43
|
+
a link to it is a link to the list around it too. **New tariff** is a row that opens an empty form;
|
|
44
|
+
the tariff is created by its first save. On a phone the form slides over the list and draws its own
|
|
45
|
+
«Back».
|
|
46
|
+
|
|
47
|
+
A row shows the name, the price in one line («$750 /mo», or the words instead of a number), a star
|
|
48
|
+
at the recommended one and a mark when it is not published. The list narrows to a group — and then
|
|
49
|
+
a drag is that group's own order, the whole list keeps its own — to words, or to the bin. While a
|
|
50
|
+
search narrows the list, the grips disappear. The bin lists what was deleted, newest first, and
|
|
51
|
+
brings it back to its places.
|
|
52
|
+
|
|
53
|
+
The form is the `tariffs.form` screen, described in JSON on the server: the name and the badge,
|
|
54
|
+
**Recommended**, the price with its currency, period and words instead of a number, the lines of
|
|
55
|
+
what is included, the description, the button (a label, a link and a look from the site's list),
|
|
56
|
+
the groups, the services — only on a site that has them — **Published** and a card for the
|
|
57
|
+
project's own fields. Save with the button or `Ctrl+S`; leaving with unsaved changes asks first. A
|
|
58
|
+
tariff has no draft: a save is on the site.
|
|
59
|
+
|
|
60
|
+
**Groups** are the panel's shared category screens with this module's words: a title, **Shown on
|
|
61
|
+
the site**, the order by drag.
|
|
62
|
+
|
|
63
|
+
`priceLine()` is the one line of the list, exported for a project that draws tariffs elsewhere in
|
|
64
|
+
the panel.
|
|
65
|
+
|
|
66
|
+
## Words
|
|
67
|
+
|
|
68
|
+
The panel's words come from the server (`webx-tariffs::*`, ten languages). `tariffsMessages` is the
|
|
69
|
+
English floor the section falls back on while they load, or when a key is missing.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TariffSummary } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** `null` — a tariff not written yet. */
|
|
4
|
+
id: number | null;
|
|
5
|
+
/** The group the list is narrowed to: a new tariff starts in it. */
|
|
6
|
+
category?: number | null;
|
|
7
|
+
/** False in the drawer a narrow screen opens this in. */
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
saved: (tariff: TariffSummary) => any;
|
|
12
|
+
back: () => any;
|
|
13
|
+
created: (tariff: TariffSummary) => any;
|
|
14
|
+
removed: (id: number) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onSaved?: ((tariff: TariffSummary) => any) | undefined;
|
|
17
|
+
onBack?: (() => any) | undefined;
|
|
18
|
+
onCreated?: ((tariff: TariffSummary) => any) | undefined;
|
|
19
|
+
onRemoved?: ((id: number) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
category: number | null;
|
|
22
|
+
inline: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tariffs: all of them on the left, the one being written on the right (§5.2).
|
|
3
|
+
*
|
|
4
|
+
* The shape of the reviews, for the same reason: a price card is short, and the one next to edit
|
|
5
|
+
* is usually the one beside it — "Growth" is priced against "Starter". On a phone the form is the
|
|
6
|
+
* whole screen, in the drawer `WxListDetail` raises, and draws its own way back.
|
|
7
|
+
*
|
|
8
|
+
* Two orders, as with the reviews: without a filter a drag moves the common order; narrowed to
|
|
9
|
+
* one group, the group's own; a search or the bin shows a selection, so the grips go away and the
|
|
10
|
+
* line under the list says why. The query keeps the shared code's name, `category` (decision 14).
|
|
11
|
+
*
|
|
12
|
+
* Everything the screen is looking at lives in the address — the view, the group, the search and
|
|
13
|
+
* the open tariff — so a link to a tariff is a link to it in its list.
|
|
14
|
+
*/
|
|
15
|
+
type __VLS_Props = {
|
|
16
|
+
base?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
base: string;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
21
|
+
export default _default;
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AdminContext } from '@webx-ui/module-admin';
|
|
2
|
+
import { ScreenModel } from '@webx-ui/schema';
|
|
3
|
+
import { TariffDetail, TariffQuery, TariffRow, TariffsList } from './types';
|
|
4
|
+
export interface TariffsApi {
|
|
5
|
+
/** Every tariff, with the groups the list can be narrowed to. */
|
|
6
|
+
list(query?: TariffQuery): Promise<TariffsList>;
|
|
7
|
+
get(id: number): Promise<TariffDetail>;
|
|
8
|
+
/**
|
|
9
|
+
* A new tariff out of the values of its form, in one request: the form is filled in first and
|
|
10
|
+
* the record made on the first save, so nobody leaves an empty card behind.
|
|
11
|
+
*/
|
|
12
|
+
create(values: ScreenModel): Promise<TariffDetail>;
|
|
13
|
+
/** Refused with a 422 under the name of the field — a line of the list under `features.<n>.text`. */
|
|
14
|
+
save(id: number, values: ScreenModel): Promise<TariffDetail>;
|
|
15
|
+
remove(id: number): Promise<void>;
|
|
16
|
+
restore(id: number): Promise<TariffRow>;
|
|
17
|
+
/** The order on screen: of the whole list, or — with `category` — of that group alone. */
|
|
18
|
+
reorder(ids: number[], category?: number | null): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/** The path of the list under the panel's API, and of its order (`CategoryRoutes::items()`). */
|
|
21
|
+
export declare const TARIFFS_API = "tariffs";
|
|
22
|
+
/**
|
|
23
|
+
* Everything under `/tariffs`, below the panel's API path — except the groups, which are the
|
|
24
|
+
* panel's shared categories and are asked for with `createCategoriesApi(admin, 'tariffs/categories')`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createTariffsApi(admin: AdminContext): TariffsApi;
|
package/dist/i18n.d.ts
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { tariffs, tariffGroupsOptions, type TariffsOptions } from './module';
|
|
2
|
+
export { createTariffsApi, TARIFFS_API, type TariffsApi } from './api';
|
|
3
|
+
export { tariffsMessages } from './messages';
|
|
4
|
+
export { priceLine } from './price';
|
|
5
|
+
export { default as WxTariffsPage } from './TariffsPage';
|
|
6
|
+
export { default as WxTariffPane } from './TariffPane';
|
|
7
|
+
export type { TariffDetail, TariffGroupRef, TariffQuery, TariffRow, TariffsList, TariffSummary, } from './types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import { reorderItems as me, useAdmin as ee, useTranslate as oe, useErrorText as ne, WxScreenHead as ye, WxScreen as be, WxSaveState as we, useItemOrder as xe, WxListScreen as _e, WxRowMenu as ke, categoryRoutes as Te } from "@webx-ui/module-admin";
|
|
2
|
+
import { defineComponent as le, ref as S, computed as v, onMounted as Se, onBeforeUnmount as fe, openBlock as p, createElementBlock as A, createBlock as k, unref as a, Fragment as Q, createVNode as b, createSlots as We, withCtx as g, createTextVNode as O, toDisplayString as C, createCommentVNode as B, watch as re, createElementVNode as D, normalizeClass as H, resolveDynamicComponent as qe, renderList as Ne } from "vue";
|
|
3
|
+
import { onBeforeRouteUpdate as $e, onBeforeRouteLeave as Be, useRoute as Ce, useRouter as Le } from "vue-router";
|
|
4
|
+
import { useLocales as Ae, localizedValue as Pe, WxSkeleton as ue, WxBadge as X, WxActionBar as Re, WxButton as Ve, toast as x, confirm as Y, WxCard as De, WxListDetail as Ie, WxEmpty as ie, WxInput as Ue, WxIcon as j, WxSelect as ze, WxSortableList as Oe, WxAlert as Me } from "@webx-ui/core";
|
|
5
|
+
const Z = "tariffs";
|
|
6
|
+
function ce(s) {
|
|
7
|
+
const l = `${s.apiPath}/${Z}`, n = (t) => t.data;
|
|
8
|
+
return {
|
|
9
|
+
list: (t = {}) => {
|
|
10
|
+
const u = new URLSearchParams();
|
|
11
|
+
return t.search && u.set("search", t.search), t.category != null && u.set("category", String(t.category)), t.trashed && u.set("trashed", "1"), s.http.get(u.size > 0 ? `${l}?${u}` : l);
|
|
12
|
+
},
|
|
13
|
+
get: (t) => s.http.get(`${l}/${t}`).then(n),
|
|
14
|
+
create: (t) => s.http.post(l, { values: t }).then(n),
|
|
15
|
+
save: (t, u) => s.http.put(`${l}/${t}`, { values: u }).then(n),
|
|
16
|
+
remove: (t) => s.http.delete(`${l}/${t}`).then(() => {
|
|
17
|
+
}),
|
|
18
|
+
// The resource of the list line, and not the form's pair: a restored tariff stays closed.
|
|
19
|
+
restore: (t) => s.http.post(`${l}/${t}/restore`, {}).then(n),
|
|
20
|
+
reorder: (t, u = null) => me(s, Z, t, u)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const Ee = {
|
|
24
|
+
module: {
|
|
25
|
+
group: "Tariffs",
|
|
26
|
+
tariffs: "Tariffs",
|
|
27
|
+
groups: "Groups"
|
|
28
|
+
},
|
|
29
|
+
tariff: {
|
|
30
|
+
new: "New tariff",
|
|
31
|
+
untitled: "Untitled",
|
|
32
|
+
search: "Search the tariffs",
|
|
33
|
+
empty: "No tariffs yet.",
|
|
34
|
+
"empty-help": "A tariff reaches the site in a tariffs block, on any page.",
|
|
35
|
+
"empty-search": "Nothing matches that.",
|
|
36
|
+
"empty-bin": "The bin is empty.",
|
|
37
|
+
all: "All",
|
|
38
|
+
trashed: "Bin",
|
|
39
|
+
"filter-category": "Group",
|
|
40
|
+
"any-category": "Any group",
|
|
41
|
+
"not-published": "Not published",
|
|
42
|
+
featured: "Recommended",
|
|
43
|
+
"no-price": "No price",
|
|
44
|
+
order: "Drag to change the order of the cards on the site.",
|
|
45
|
+
choose: "Choose a tariff",
|
|
46
|
+
"choose-help": "Or add a new one: the first line of the list.",
|
|
47
|
+
save: "Save",
|
|
48
|
+
saved: "The tariff is saved.",
|
|
49
|
+
"save-failed": "The tariff was not saved.",
|
|
50
|
+
cancel: "Cancel",
|
|
51
|
+
delete: "Delete",
|
|
52
|
+
"delete-title": "Delete the tariff “:name”?",
|
|
53
|
+
"delete-text": "It goes to the bin and leaves every block on the site. Restored, it comes back to its places.",
|
|
54
|
+
deleted: "The tariff is in the bin.",
|
|
55
|
+
restore: "Restore",
|
|
56
|
+
restored: "The tariff is back.",
|
|
57
|
+
"reorder-failed": "The new order was not saved.",
|
|
58
|
+
"order-group": "Drag to change the order inside this group. The rest of the list keeps its own.",
|
|
59
|
+
"leave-title": "Leave without saving?",
|
|
60
|
+
"leave-text": "What you changed in this tariff is not on the server.",
|
|
61
|
+
leave: "Leave",
|
|
62
|
+
back: "Back to the list"
|
|
63
|
+
},
|
|
64
|
+
screen: {
|
|
65
|
+
tariff: "Tariff",
|
|
66
|
+
name: "Name",
|
|
67
|
+
"name-help": "Required in the default language. Not written in another one, it is shown as written in the default one.",
|
|
68
|
+
badge: "Badge",
|
|
69
|
+
"badge-help": "A short line over the name: “30 HOURS / 25$”.",
|
|
70
|
+
featured: "Recommended",
|
|
71
|
+
"featured-help": "The card stands out among the others.",
|
|
72
|
+
pricing: "Price",
|
|
73
|
+
price: "Price",
|
|
74
|
+
"price-help": "A number, up to two digits after the point. Empty — the words below are shown instead.",
|
|
75
|
+
currency: "Currency",
|
|
76
|
+
"currency-help": "The list comes from the site’s settings.",
|
|
77
|
+
"currency-placeholder": "Choose a currency",
|
|
78
|
+
period: "Period",
|
|
79
|
+
"period-help": "Printed after the price: “/mo”, “a year”.",
|
|
80
|
+
"price-text": "Price in words",
|
|
81
|
+
"price-text-help": "Printed when there is no price: “On request”, “Custom”.",
|
|
82
|
+
features: "What is included",
|
|
83
|
+
"features-help": "A line not written in a language is left out of the list in that language.",
|
|
84
|
+
"features-add": "Add a line",
|
|
85
|
+
"features-empty": "No lines yet.",
|
|
86
|
+
feature: "Line",
|
|
87
|
+
about: "Description",
|
|
88
|
+
description: "Description",
|
|
89
|
+
"description-help": "Shown only in the languages it is written in.",
|
|
90
|
+
button: "Button",
|
|
91
|
+
"button-label": "Label",
|
|
92
|
+
"button-label-help": "Without a label in a language, the card has no button in it.",
|
|
93
|
+
"button-link": "Link",
|
|
94
|
+
"button-link-help": "A page of the site or an address. A draft or a page in the bin hides the button.",
|
|
95
|
+
"button-variant": "Look",
|
|
96
|
+
"button-variant-placeholder": "Choose a look",
|
|
97
|
+
settings: "Settings",
|
|
98
|
+
categories: "Groups",
|
|
99
|
+
"categories-help": "What a block picks the tariff by, and the tabs of a page of prices.",
|
|
100
|
+
"categories-add": "Add to a group",
|
|
101
|
+
"categories-empty": "In no group yet.",
|
|
102
|
+
services: "Services",
|
|
103
|
+
"services-help": "The services this tariff is for: a tariffs block on a service’s page can show only its own.",
|
|
104
|
+
published: "Published",
|
|
105
|
+
"published-help": "On the site in every block that shows its groups, from the moment it is saved."
|
|
106
|
+
},
|
|
107
|
+
category: {
|
|
108
|
+
"field-title": "Title",
|
|
109
|
+
visible: "Shown on the site",
|
|
110
|
+
"visible-help": "Hidden, it drops out of every page of prices; its tariffs stay in the blocks that show them.",
|
|
111
|
+
new: "New group",
|
|
112
|
+
empty: "No groups yet.",
|
|
113
|
+
"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.",
|
|
114
|
+
order: "Drag to change the order of the groups on the site.",
|
|
115
|
+
hidden: "Hidden from the site",
|
|
116
|
+
tariffs: "Tariffs: :count",
|
|
117
|
+
"show-tariffs": "Show its tariffs",
|
|
118
|
+
"delete-blocked": "This group still holds tariffs. Move them first.",
|
|
119
|
+
"delete-text": "It goes to the bin and leaves every page of prices. Its tariffs stay.",
|
|
120
|
+
deleted: "The group is in the bin.",
|
|
121
|
+
saved: "The group is saved."
|
|
122
|
+
}
|
|
123
|
+
}, se = /* @__PURE__ */ new WeakSet();
|
|
124
|
+
function de() {
|
|
125
|
+
try {
|
|
126
|
+
const { i18n: s } = ee();
|
|
127
|
+
se.has(s) || (s.defaults("webx-tariffs", Ee), se.add(s));
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function Fe(s, l) {
|
|
132
|
+
if (s.price === null || s.price === void 0) return (s.price_text ?? "").trim();
|
|
133
|
+
const n = Number.isInteger(s.price), t = new Intl.NumberFormat(l, {
|
|
134
|
+
minimumFractionDigits: n ? 0 : 2,
|
|
135
|
+
maximumFractionDigits: n ? 0 : 2
|
|
136
|
+
}).format(s.price), u = s.symbol ?? s.currency ?? "", r = (s.period ?? "").trim();
|
|
137
|
+
return [`${u}${t}`, r].filter((q) => q !== "").join(" ");
|
|
138
|
+
}
|
|
139
|
+
const Ge = /* @__PURE__ */ le({
|
|
140
|
+
name: "WxTariffPane",
|
|
141
|
+
__name: "TariffPane",
|
|
142
|
+
props: {
|
|
143
|
+
id: {},
|
|
144
|
+
category: { default: null },
|
|
145
|
+
inline: { type: Boolean, default: !0 }
|
|
146
|
+
},
|
|
147
|
+
emits: ["back", "saved", "created", "removed"],
|
|
148
|
+
setup(s, { emit: l }) {
|
|
149
|
+
const n = s, t = l, u = ee(), r = ce(u), q = Ae();
|
|
150
|
+
de();
|
|
151
|
+
const f = oe("webx-tariffs"), P = ne(), _ = S(null), m = S({}), L = S(""), N = S(n.id !== null), c = S(!1), W = S({}), w = v(() => u.can("tariffs.manage")), R = v(() => JSON.stringify(m.value)), y = v(() => L.value !== "" && R.value !== L.value), M = v(() => c.value ? "saving" : y.value || n.id === null ? "unsaved" : "saved"), J = v(() => {
|
|
152
|
+
const i = m.value.name, d = n.id === null ? f("tariff.new") : _.value?.name ?? "";
|
|
153
|
+
return Pe(i, q.active.value, d) || f("tariff.untitled");
|
|
154
|
+
});
|
|
155
|
+
function $(i) {
|
|
156
|
+
_.value = i.tariff, m.value = i.values, L.value = JSON.stringify(i.values);
|
|
157
|
+
}
|
|
158
|
+
if (n.id === null) {
|
|
159
|
+
const i = {
|
|
160
|
+
name: {},
|
|
161
|
+
badge: {},
|
|
162
|
+
price: null,
|
|
163
|
+
period: {},
|
|
164
|
+
price_text: {},
|
|
165
|
+
features: [],
|
|
166
|
+
description: {},
|
|
167
|
+
button_label: {},
|
|
168
|
+
button_link: null,
|
|
169
|
+
featured: !1,
|
|
170
|
+
published: !1,
|
|
171
|
+
categories: n.category === null ? [] : [n.category]
|
|
172
|
+
};
|
|
173
|
+
m.value = i, L.value = JSON.stringify(i);
|
|
174
|
+
}
|
|
175
|
+
async function E() {
|
|
176
|
+
if (n.id !== null) {
|
|
177
|
+
N.value = !0;
|
|
178
|
+
try {
|
|
179
|
+
$(await r.get(n.id));
|
|
180
|
+
} catch (i) {
|
|
181
|
+
x.danger(P(i)), t("back");
|
|
182
|
+
} finally {
|
|
183
|
+
N.value = !1;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async function F() {
|
|
188
|
+
if (!(c.value || !w.value)) {
|
|
189
|
+
c.value = !0, W.value = {};
|
|
190
|
+
try {
|
|
191
|
+
const i = n.id === null, d = i ? await r.create(m.value) : await r.save(n.id, m.value);
|
|
192
|
+
$(d), x.success(f("tariff.saved")), t(i ? "created" : "saved", d.tariff);
|
|
193
|
+
} catch (i) {
|
|
194
|
+
const d = i.body;
|
|
195
|
+
d?.errors ? (W.value = d.errors, x.danger(f("tariff.save-failed"))) : x.danger(P(i));
|
|
196
|
+
} finally {
|
|
197
|
+
c.value = !1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
async function K() {
|
|
202
|
+
const i = _.value;
|
|
203
|
+
if (!(!i || !await Y({
|
|
204
|
+
title: f("tariff.delete-title", { name: i.name }),
|
|
205
|
+
message: f("tariff.delete-text"),
|
|
206
|
+
confirmText: f("tariff.delete"),
|
|
207
|
+
cancelText: f("tariff.cancel"),
|
|
208
|
+
tone: "danger"
|
|
209
|
+
})))
|
|
210
|
+
try {
|
|
211
|
+
await r.remove(i.id), x.success(f("tariff.deleted")), L.value = R.value, t("removed", i.id);
|
|
212
|
+
} catch (V) {
|
|
213
|
+
x.danger(P(V));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function T(i) {
|
|
217
|
+
y.value && i.preventDefault();
|
|
218
|
+
}
|
|
219
|
+
function I(i) {
|
|
220
|
+
(i.ctrlKey || i.metaKey) && i.key.toLowerCase() === "s" && (i.preventDefault(), (y.value || n.id === null) && F());
|
|
221
|
+
}
|
|
222
|
+
Se(() => {
|
|
223
|
+
E(), window.addEventListener("beforeunload", T);
|
|
224
|
+
}), fe(() => {
|
|
225
|
+
window.removeEventListener("beforeunload", T);
|
|
226
|
+
});
|
|
227
|
+
async function G() {
|
|
228
|
+
return !y.value || !w.value ? !0 : await Y({
|
|
229
|
+
title: f("tariff.leave-title"),
|
|
230
|
+
message: f("tariff.leave-text"),
|
|
231
|
+
confirmText: f("tariff.leave"),
|
|
232
|
+
cancelText: f("tariff.cancel"),
|
|
233
|
+
tone: "danger"
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
$e(
|
|
237
|
+
async (i, d) => i.query.tariff === d.query.tariff ? !0 : await G()
|
|
238
|
+
), Be(G);
|
|
239
|
+
const U = v(
|
|
240
|
+
() => w.value && _.value !== null ? [
|
|
241
|
+
{
|
|
242
|
+
key: "delete",
|
|
243
|
+
label: f("tariff.delete"),
|
|
244
|
+
icon: "trash",
|
|
245
|
+
danger: !0,
|
|
246
|
+
menu: !0,
|
|
247
|
+
run: () => {
|
|
248
|
+
K();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
] : []
|
|
252
|
+
);
|
|
253
|
+
return (i, d) => (p(), A("div", {
|
|
254
|
+
class: "wx-tariff",
|
|
255
|
+
onKeydown: I
|
|
256
|
+
}, [
|
|
257
|
+
N.value ? (p(), k(a(ue), {
|
|
258
|
+
key: 0,
|
|
259
|
+
class: "wx-tariff__ghost",
|
|
260
|
+
title: "",
|
|
261
|
+
rows: 6
|
|
262
|
+
})) : (p(), A(Q, { key: 1 }, [
|
|
263
|
+
b(a(ye), {
|
|
264
|
+
level: 3,
|
|
265
|
+
back: !n.inline,
|
|
266
|
+
"back-label": a(f)("tariff.back"),
|
|
267
|
+
title: J.value,
|
|
268
|
+
actions: U.value,
|
|
269
|
+
"collapse-below": 480,
|
|
270
|
+
onBack: d[0] || (d[0] = (V) => t("back"))
|
|
271
|
+
}, We({ _: 2 }, [
|
|
272
|
+
_.value && !_.value.published ? {
|
|
273
|
+
name: "title-after",
|
|
274
|
+
fn: g(() => [
|
|
275
|
+
b(a(X), { dot: "" }, {
|
|
276
|
+
default: g(() => [
|
|
277
|
+
O(C(a(f)("tariff.not-published")), 1)
|
|
278
|
+
]),
|
|
279
|
+
_: 1
|
|
280
|
+
})
|
|
281
|
+
]),
|
|
282
|
+
key: "0"
|
|
283
|
+
} : void 0
|
|
284
|
+
]), 1032, ["back", "back-label", "title", "actions"]),
|
|
285
|
+
b(a(be), {
|
|
286
|
+
modelValue: m.value,
|
|
287
|
+
"onUpdate:modelValue": d[1] || (d[1] = (V) => m.value = V),
|
|
288
|
+
name: "tariffs.form",
|
|
289
|
+
errors: W.value,
|
|
290
|
+
disabled: !w.value || c.value
|
|
291
|
+
}, null, 8, ["modelValue", "errors", "disabled"]),
|
|
292
|
+
w.value ? (p(), k(a(Re), { key: 0 }, {
|
|
293
|
+
state: g(() => [
|
|
294
|
+
b(a(we), { state: M.value }, null, 8, ["state"])
|
|
295
|
+
]),
|
|
296
|
+
default: g(() => [
|
|
297
|
+
b(a(Ve), {
|
|
298
|
+
type: "primary",
|
|
299
|
+
loading: c.value,
|
|
300
|
+
disabled: !y.value && n.id !== null,
|
|
301
|
+
onClick: F
|
|
302
|
+
}, {
|
|
303
|
+
default: g(() => [
|
|
304
|
+
O(C(a(f)("tariff.save")), 1)
|
|
305
|
+
]),
|
|
306
|
+
_: 1
|
|
307
|
+
}, 8, ["loading", "disabled"])
|
|
308
|
+
]),
|
|
309
|
+
_: 1
|
|
310
|
+
})) : B("", !0)
|
|
311
|
+
], 64))
|
|
312
|
+
], 32));
|
|
313
|
+
}
|
|
314
|
+
}), pe = (s, l) => {
|
|
315
|
+
const n = s.__vccOpts || s;
|
|
316
|
+
for (const [t, u] of l)
|
|
317
|
+
n[t] = u;
|
|
318
|
+
return n;
|
|
319
|
+
}, He = /* @__PURE__ */ pe(Ge, [["__scopeId", "data-v-2c8988e3"]]), Je = { class: "wx-tariffs__bar" }, Ke = { class: "wx-tariff-row__body" }, je = { class: "wx-tariff-row__who" }, Qe = { class: "wx-tariff-row__name" }, Xe = ["aria-label"], Ye = { class: "wx-tariff-row__facts" }, Ze = {
|
|
320
|
+
key: 1,
|
|
321
|
+
class: "wx-tariff-row__badge"
|
|
322
|
+
}, et = /* @__PURE__ */ le({
|
|
323
|
+
__name: "TariffsPage",
|
|
324
|
+
props: {
|
|
325
|
+
base: { default: "/tariffs" }
|
|
326
|
+
},
|
|
327
|
+
setup(s) {
|
|
328
|
+
const l = ee(), n = ce(l), t = Ce(), u = Le();
|
|
329
|
+
de();
|
|
330
|
+
const r = oe("webx-tariffs"), q = ne(), f = S([]), P = S([]), _ = S(!0), m = v(() => l.can("tariffs.manage")), L = v(
|
|
331
|
+
() => l.state.manifest?.modules.find((e) => e.id === "tariffs")?.title ?? r("module.tariffs")
|
|
332
|
+
), N = v({
|
|
333
|
+
get: () => t.query.view === "trashed" ? "trashed" : "",
|
|
334
|
+
set: (e) => {
|
|
335
|
+
const h = {
|
|
336
|
+
...t.query,
|
|
337
|
+
view: e === "" ? void 0 : String(e)
|
|
338
|
+
};
|
|
339
|
+
delete h.tariff, u.replace({ query: h });
|
|
340
|
+
}
|
|
341
|
+
}), c = v(() => N.value === "trashed"), W = v(() => {
|
|
342
|
+
const e = t.query.category;
|
|
343
|
+
return typeof e == "string" && e !== "" && Number(e) || null;
|
|
344
|
+
}), w = v(() => typeof t.query.q == "string" ? t.query.q : ""), R = S(w.value), y = v(() => {
|
|
345
|
+
const e = t.query.tariff;
|
|
346
|
+
return e === "new" ? m.value ? "new" : null : typeof e == "string" && e !== "" && Number(e) || null;
|
|
347
|
+
}), M = v({
|
|
348
|
+
get: () => y.value !== null,
|
|
349
|
+
set: (e) => {
|
|
350
|
+
e || i();
|
|
351
|
+
}
|
|
352
|
+
}), J = v(() => [
|
|
353
|
+
{ value: "", label: r("tariff.all") },
|
|
354
|
+
{ value: "trashed", label: r("tariff.trashed"), icon: "trash" }
|
|
355
|
+
]), $ = xe(Z, () => ({
|
|
356
|
+
q: w.value,
|
|
357
|
+
category: W.value,
|
|
358
|
+
filtered: c.value
|
|
359
|
+
})), E = v(() => m.value && $.sortable.value), F = v(() => $.mode.value === "category" ? r("tariff.order-group") : $.mode.value === "all" ? r("tariff.order") : $.hint.value), K = v(() => w.value !== "" ? r("tariff.empty-search") : c.value ? r("tariff.empty-bin") : r("tariff.empty"));
|
|
360
|
+
async function T() {
|
|
361
|
+
_.value = !0;
|
|
362
|
+
try {
|
|
363
|
+
const e = await n.list({
|
|
364
|
+
search: w.value,
|
|
365
|
+
category: c.value ? null : W.value,
|
|
366
|
+
trashed: c.value
|
|
367
|
+
});
|
|
368
|
+
f.value = e.data, P.value = e.filters.categories;
|
|
369
|
+
} catch (e) {
|
|
370
|
+
x.danger(q(e));
|
|
371
|
+
} finally {
|
|
372
|
+
_.value = !1;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
re(
|
|
376
|
+
() => [N.value, W.value, w.value],
|
|
377
|
+
() => {
|
|
378
|
+
T();
|
|
379
|
+
}
|
|
380
|
+
), T();
|
|
381
|
+
let I;
|
|
382
|
+
re(R, (e) => {
|
|
383
|
+
clearTimeout(I), I = setTimeout(() => {
|
|
384
|
+
u.replace({ query: { ...t.query, q: e.trim() === "" ? void 0 : e } });
|
|
385
|
+
}, 300);
|
|
386
|
+
}), fe(() => clearTimeout(I));
|
|
387
|
+
function G(e) {
|
|
388
|
+
u.replace({
|
|
389
|
+
query: { ...t.query, category: typeof e == "number" ? String(e) : void 0 }
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
function U(e) {
|
|
393
|
+
u.replace({ query: { ...t.query, tariff: String(e) } });
|
|
394
|
+
}
|
|
395
|
+
function i() {
|
|
396
|
+
const e = { ...t.query };
|
|
397
|
+
delete e.tariff, u.replace({ query: e });
|
|
398
|
+
}
|
|
399
|
+
function d(e) {
|
|
400
|
+
U(e.id), T();
|
|
401
|
+
}
|
|
402
|
+
async function V() {
|
|
403
|
+
try {
|
|
404
|
+
await $.move(f.value.map((e) => e.id));
|
|
405
|
+
} catch (e) {
|
|
406
|
+
x.danger(q(e, r("tariff.reorder-failed"))), await T();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function ve(e) {
|
|
410
|
+
return m.value ? c.value ? [
|
|
411
|
+
{
|
|
412
|
+
key: "restore",
|
|
413
|
+
icon: "refresh",
|
|
414
|
+
label: r("tariff.restore"),
|
|
415
|
+
run: () => {
|
|
416
|
+
ge(e);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
] : [
|
|
420
|
+
{
|
|
421
|
+
key: "delete",
|
|
422
|
+
icon: "trash",
|
|
423
|
+
label: r("tariff.delete"),
|
|
424
|
+
danger: !0,
|
|
425
|
+
run: () => {
|
|
426
|
+
he(e);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
] : [];
|
|
430
|
+
}
|
|
431
|
+
async function he(e) {
|
|
432
|
+
if (await Y({
|
|
433
|
+
title: r("tariff.delete-title", { name: e.name }),
|
|
434
|
+
message: r("tariff.delete-text"),
|
|
435
|
+
confirmText: r("tariff.delete"),
|
|
436
|
+
cancelText: r("tariff.cancel"),
|
|
437
|
+
tone: "danger"
|
|
438
|
+
}))
|
|
439
|
+
try {
|
|
440
|
+
await n.remove(e.id), x.success(r("tariff.deleted")), te(e.id);
|
|
441
|
+
} catch (o) {
|
|
442
|
+
x.danger(q(o));
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function te(e) {
|
|
446
|
+
y.value === e && i(), T();
|
|
447
|
+
}
|
|
448
|
+
async function ge(e) {
|
|
449
|
+
try {
|
|
450
|
+
await n.restore(e.id), x.success(r("tariff.restored"));
|
|
451
|
+
} catch (h) {
|
|
452
|
+
x.danger(q(h));
|
|
453
|
+
} finally {
|
|
454
|
+
await T();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function ae(e) {
|
|
458
|
+
return Fe(e, l.i18n.state.locale);
|
|
459
|
+
}
|
|
460
|
+
return (e, h) => (p(), k(a(_e), {
|
|
461
|
+
view: N.value,
|
|
462
|
+
"onUpdate:view": h[4] || (h[4] = (o) => N.value = o),
|
|
463
|
+
title: L.value,
|
|
464
|
+
views: J.value,
|
|
465
|
+
card: !1
|
|
466
|
+
}, {
|
|
467
|
+
default: g(() => [
|
|
468
|
+
b(a(De), {
|
|
469
|
+
class: "wx-tariffs",
|
|
470
|
+
padding: "none"
|
|
471
|
+
}, {
|
|
472
|
+
default: g(() => [
|
|
473
|
+
b(a(Ie), {
|
|
474
|
+
open: M.value,
|
|
475
|
+
"onUpdate:open": h[3] || (h[3] = (o) => M.value = o),
|
|
476
|
+
class: "wx-tariffs__panes",
|
|
477
|
+
"list-width": 360,
|
|
478
|
+
"detail-min": 460,
|
|
479
|
+
"detail-label": a(r)("module.tariffs")
|
|
480
|
+
}, {
|
|
481
|
+
list: g(() => [
|
|
482
|
+
D("div", Je, [
|
|
483
|
+
b(a(Ue), {
|
|
484
|
+
modelValue: R.value,
|
|
485
|
+
"onUpdate:modelValue": h[0] || (h[0] = (o) => R.value = o),
|
|
486
|
+
class: "wx-tariffs__search",
|
|
487
|
+
size: "sm",
|
|
488
|
+
clearable: "",
|
|
489
|
+
placeholder: a(r)("tariff.search"),
|
|
490
|
+
"aria-label": a(r)("tariff.search")
|
|
491
|
+
}, {
|
|
492
|
+
prefix: g(() => [
|
|
493
|
+
b(a(j), {
|
|
494
|
+
name: "search",
|
|
495
|
+
size: "sm"
|
|
496
|
+
})
|
|
497
|
+
]),
|
|
498
|
+
_: 1
|
|
499
|
+
}, 8, ["modelValue", "placeholder", "aria-label"]),
|
|
500
|
+
c.value ? B("", !0) : (p(), k(a(ze), {
|
|
501
|
+
key: 0,
|
|
502
|
+
"model-value": W.value,
|
|
503
|
+
options: P.value.map((o) => ({ value: o.id, label: o.title })),
|
|
504
|
+
placeholder: a(r)("tariff.any-category"),
|
|
505
|
+
"aria-label": a(r)("tariff.filter-category"),
|
|
506
|
+
clearable: "",
|
|
507
|
+
size: "sm",
|
|
508
|
+
"onUpdate:modelValue": G
|
|
509
|
+
}, null, 8, ["model-value", "options", "placeholder", "aria-label"]))
|
|
510
|
+
]),
|
|
511
|
+
m.value && !c.value ? (p(), A("button", {
|
|
512
|
+
key: 0,
|
|
513
|
+
type: "button",
|
|
514
|
+
class: H(["wx-tariffs__new", { "is-current": y.value === "new" }]),
|
|
515
|
+
onClick: h[1] || (h[1] = (o) => U("new"))
|
|
516
|
+
}, [
|
|
517
|
+
b(a(j), {
|
|
518
|
+
name: "plus",
|
|
519
|
+
size: "sm"
|
|
520
|
+
}),
|
|
521
|
+
O(" " + C(a(r)("tariff.new")), 1)
|
|
522
|
+
], 2)) : B("", !0),
|
|
523
|
+
_.value && f.value.length === 0 ? (p(), k(a(ue), {
|
|
524
|
+
key: 1,
|
|
525
|
+
class: "wx-tariffs__loading",
|
|
526
|
+
rows: 5
|
|
527
|
+
})) : f.value.length === 0 ? (p(), k(a(ie), {
|
|
528
|
+
key: 2,
|
|
529
|
+
title: K.value,
|
|
530
|
+
description: !c.value && w.value === "" ? a(r)("tariff.empty-help") : void 0
|
|
531
|
+
}, null, 8, ["title", "description"])) : (p(), A(Q, { key: 3 }, [
|
|
532
|
+
b(a(Oe), {
|
|
533
|
+
modelValue: f.value,
|
|
534
|
+
"onUpdate:modelValue": h[2] || (h[2] = (o) => f.value = o),
|
|
535
|
+
class: H(["wx-tariffs__list", { "is-loading": _.value }]),
|
|
536
|
+
plain: "",
|
|
537
|
+
"item-key": "id",
|
|
538
|
+
handle: E.value ? "grip" : "row",
|
|
539
|
+
"item-label": (o) => o.name,
|
|
540
|
+
disabled: !E.value,
|
|
541
|
+
onMove: V
|
|
542
|
+
}, {
|
|
543
|
+
default: g(({ item: o }) => [
|
|
544
|
+
(p(), k(qe(c.value ? "div" : "button"), {
|
|
545
|
+
type: c.value ? void 0 : "button",
|
|
546
|
+
class: H(["wx-tariff-row", { "is-current": y.value === o.id }]),
|
|
547
|
+
onClick: (z) => c.value ? void 0 : U(o.id)
|
|
548
|
+
}, {
|
|
549
|
+
default: g(() => [
|
|
550
|
+
D("span", Ke, [
|
|
551
|
+
D("span", je, [
|
|
552
|
+
D("span", Qe, C(o.name), 1),
|
|
553
|
+
o.featured ? (p(), A("span", {
|
|
554
|
+
key: 0,
|
|
555
|
+
class: "wx-tariff-row__star",
|
|
556
|
+
role: "img",
|
|
557
|
+
"aria-label": a(r)("tariff.featured")
|
|
558
|
+
}, [
|
|
559
|
+
b(a(j), {
|
|
560
|
+
name: "star",
|
|
561
|
+
size: "sm"
|
|
562
|
+
})
|
|
563
|
+
], 8, Xe)) : B("", !0)
|
|
564
|
+
]),
|
|
565
|
+
D("span", {
|
|
566
|
+
class: H(["wx-tariff-row__price", { "is-missing": ae(o) === "" }])
|
|
567
|
+
}, C(ae(o) || a(r)("tariff.no-price")), 3),
|
|
568
|
+
D("span", Ye, [
|
|
569
|
+
o.published ? B("", !0) : (p(), k(a(X), {
|
|
570
|
+
key: 0,
|
|
571
|
+
dot: "",
|
|
572
|
+
size: "sm"
|
|
573
|
+
}, {
|
|
574
|
+
default: g(() => [
|
|
575
|
+
O(C(a(r)("tariff.not-published")), 1)
|
|
576
|
+
]),
|
|
577
|
+
_: 1
|
|
578
|
+
})),
|
|
579
|
+
o.badge ? (p(), A("span", Ze, C(o.badge), 1)) : B("", !0),
|
|
580
|
+
(p(!0), A(Q, null, Ne(o.categories, (z) => (p(), k(a(X), {
|
|
581
|
+
key: z.id,
|
|
582
|
+
size: "sm",
|
|
583
|
+
round: ""
|
|
584
|
+
}, {
|
|
585
|
+
default: g(() => [
|
|
586
|
+
O(C(z.title), 1)
|
|
587
|
+
]),
|
|
588
|
+
_: 2
|
|
589
|
+
}, 1024))), 128))
|
|
590
|
+
])
|
|
591
|
+
])
|
|
592
|
+
]),
|
|
593
|
+
_: 2
|
|
594
|
+
}, 1032, ["type", "class", "onClick"]))
|
|
595
|
+
]),
|
|
596
|
+
actions: g(({ item: o }) => [
|
|
597
|
+
b(a(ke), {
|
|
598
|
+
actions: ve(o),
|
|
599
|
+
label: o.name
|
|
600
|
+
}, null, 8, ["actions", "label"])
|
|
601
|
+
]),
|
|
602
|
+
_: 1
|
|
603
|
+
}, 8, ["modelValue", "class", "handle", "item-label", "disabled"]),
|
|
604
|
+
m.value && !c.value ? (p(), k(a(Me), {
|
|
605
|
+
key: 0,
|
|
606
|
+
class: "wx-tariffs__note",
|
|
607
|
+
type: "info",
|
|
608
|
+
description: F.value
|
|
609
|
+
}, null, 8, ["description"])) : B("", !0)
|
|
610
|
+
], 64))
|
|
611
|
+
]),
|
|
612
|
+
detail: g(({ inline: o, back: z }) => [
|
|
613
|
+
y.value !== null ? (p(), k(He, {
|
|
614
|
+
id: y.value === "new" ? null : y.value,
|
|
615
|
+
key: String(y.value),
|
|
616
|
+
category: W.value,
|
|
617
|
+
inline: o,
|
|
618
|
+
onBack: z,
|
|
619
|
+
onSaved: T,
|
|
620
|
+
onCreated: d,
|
|
621
|
+
onRemoved: te
|
|
622
|
+
}, null, 8, ["id", "category", "inline", "onBack"])) : B("", !0)
|
|
623
|
+
]),
|
|
624
|
+
empty: g(() => [
|
|
625
|
+
b(a(ie), {
|
|
626
|
+
title: a(r)("tariff.choose"),
|
|
627
|
+
description: m.value ? a(r)("tariff.choose-help") : void 0
|
|
628
|
+
}, null, 8, ["title", "description"])
|
|
629
|
+
]),
|
|
630
|
+
_: 1
|
|
631
|
+
}, 8, ["open", "detail-label"])
|
|
632
|
+
]),
|
|
633
|
+
_: 1
|
|
634
|
+
})
|
|
635
|
+
]),
|
|
636
|
+
_: 1
|
|
637
|
+
}, 8, ["view", "title", "views"]));
|
|
638
|
+
}
|
|
639
|
+
}), tt = /* @__PURE__ */ pe(et, [["__scopeId", "data-v-d86b91c1"]]);
|
|
640
|
+
function at(s = "/tariffs") {
|
|
641
|
+
return {
|
|
642
|
+
api: "tariffs/categories",
|
|
643
|
+
path: `${s}/groups`,
|
|
644
|
+
name: "webx.tariffs.groups",
|
|
645
|
+
module: "tariff-groups",
|
|
646
|
+
screen: "tariffs.category-form",
|
|
647
|
+
manage: "tariffs.groups.manage",
|
|
648
|
+
count: "tariffs_count",
|
|
649
|
+
// The list narrowed to one group is also where its own order is dragged.
|
|
650
|
+
items: (l) => ({ path: s, query: { category: String(l) } }),
|
|
651
|
+
words: {
|
|
652
|
+
new: "webx-tariffs::category.new",
|
|
653
|
+
empty: "webx-tariffs::category.empty",
|
|
654
|
+
"empty-help": "webx-tariffs::category.empty-help",
|
|
655
|
+
order: "webx-tariffs::category.order",
|
|
656
|
+
hidden: "webx-tariffs::category.hidden",
|
|
657
|
+
count: "webx-tariffs::category.tariffs",
|
|
658
|
+
"show-items": "webx-tariffs::category.show-tariffs",
|
|
659
|
+
"delete-blocked": "webx-tariffs::category.delete-blocked",
|
|
660
|
+
"delete-text": "webx-tariffs::category.delete-text",
|
|
661
|
+
deleted: "webx-tariffs::category.deleted",
|
|
662
|
+
saved: "webx-tariffs::category.saved",
|
|
663
|
+
"field-title": "webx-tariffs::category.field-title"
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
function nt(s = {}) {
|
|
668
|
+
const l = s.path ?? "/tariffs";
|
|
669
|
+
return [
|
|
670
|
+
{
|
|
671
|
+
id: "tariffs",
|
|
672
|
+
path: l,
|
|
673
|
+
// One route: the open tariff is in the address (`?tariff=`), beside the list it was opened
|
|
674
|
+
// from, so a link to it is a link to both.
|
|
675
|
+
routes: [{ path: l, name: "webx.tariffs", component: tt, props: { base: l } }]
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
id: "tariff-groups",
|
|
679
|
+
path: `${l}/groups`,
|
|
680
|
+
routes: Te(at(l))
|
|
681
|
+
}
|
|
682
|
+
];
|
|
683
|
+
}
|
|
684
|
+
export {
|
|
685
|
+
Z as TARIFFS_API,
|
|
686
|
+
He as WxTariffPane,
|
|
687
|
+
tt as WxTariffsPage,
|
|
688
|
+
ce as createTariffsApi,
|
|
689
|
+
Fe as priceLine,
|
|
690
|
+
at as tariffGroupsOptions,
|
|
691
|
+
nt as tariffs,
|
|
692
|
+
Ee as tariffsMessages
|
|
693
|
+
};
|
|
694
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/api.ts","../src/messages.ts","../src/i18n.ts","../src/price.ts","../src/TariffPane.vue","../src/TariffsPage.vue","../src/module.ts"],"sourcesContent":["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 { 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","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","<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} 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\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","<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, ref, watch } from 'vue'\nimport { useRoute, useRouter, type LocationQueryRaw } from 'vue-router'\nimport {\n confirm,\n toast,\n WxAlert,\n WxBadge,\n WxCard,\n WxEmpty,\n WxIcon,\n WxInput,\n WxListDetail,\n WxSelect,\n WxSkeleton,\n WxSortableList,\n type TabItem,\n type TabValue,\n} from '@webx-ui/core'\nimport {\n useAdmin,\n useErrorText,\n useItemOrder,\n useTranslate,\n WxListScreen,\n WxRowMenu,\n type RowAction,\n} from '@webx-ui/module-admin'\nimport { createTariffsApi, TARIFFS_API } from './api'\nimport { useTariffsMessages } from './i18n'\nimport { priceLine } from './price'\nimport TariffPane from './TariffPane.vue'\nimport type { TariffGroupRef, TariffRow, TariffSummary } from './types'\n\n/**\n * The tariffs: all of them on the left, the one being written on the right (§5.2).\n *\n * The shape of the reviews, for the same reason: a price card is short, and the one next to edit\n * is usually the one beside it — \"Growth\" is priced against \"Starter\". On a phone the form is the\n * whole screen, in the drawer `WxListDetail` raises, and draws its own way back.\n *\n * Two orders, as with the reviews: without a filter a drag moves the common order; narrowed to\n * one group, the group's own; a search or the bin shows a selection, so the grips go away and the\n * line under the list says why. The query keeps the shared code's name, `category` (decision 14).\n *\n * Everything the screen is looking at lives in the address — the view, the group, the search and\n * the open tariff — so a link to a tariff is a link to it in its list.\n */\nwithDefaults(defineProps<{ base?: string }>(), { base: '/tariffs' })\n\nconst context = useAdmin()\nconst api = createTariffsApi(context)\nconst route = useRoute()\nconst router = useRouter()\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 rows = ref<TariffRow[]>([])\nconst categories = ref<TariffGroupRef[]>([])\nconst loading = ref(true)\n\nconst canManage = computed(() => context.can('tariffs.manage'))\n\nconst title = computed(\n () =>\n context.state.manifest?.modules.find((module) => module.id === 'tariffs')?.title ??\n t('module.tariffs'),\n)\n\nconst view = computed<TabValue>({\n get: () => (route.query.view === 'trashed' ? 'trashed' : ''),\n set: (value) => {\n const query: LocationQueryRaw = {\n ...route.query,\n view: value === '' ? undefined : String(value),\n }\n\n // A tariff from the list is not a tariff from the bin: the form closes with the view.\n delete query.tariff\n void router.replace({ query })\n },\n})\n\nconst inBin = computed(() => view.value === 'trashed')\n\nconst category = computed<number | null>(() => {\n const raw = route.query.category\n\n return typeof raw === 'string' && raw !== '' ? Number(raw) || null : null\n})\n\nconst q = computed(() => (typeof route.query.q === 'string' ? route.query.q : ''))\n\n/* What is typed, ahead of the address: the address follows it after a pause. */\nconst typed = ref(q.value)\n\n/** The open tariff: a number, `'new'` for one not yet saved, or nothing. */\nconst selected = computed<number | 'new' | null>(() => {\n const raw = route.query.tariff\n\n if (raw === 'new') return canManage.value ? 'new' : null\n\n return typeof raw === 'string' && raw !== '' ? Number(raw) || null : null\n})\n\n/*\n * Open is \"a tariff is chosen\", and closing is un-choosing it — so the address, the list's\n * highlight and the drawer on a phone can never disagree about it.\n */\nconst open = computed({\n get: () => selected.value !== null,\n set: (value) => {\n if (!value) close()\n },\n})\n\nconst views = computed<TabItem[]>(() => [\n { value: '', label: t('tariff.all') },\n { value: 'trashed', label: t('tariff.trashed'), icon: 'trash' },\n])\n\nconst order = useItemOrder(TARIFFS_API, () => ({\n q: q.value,\n category: category.value,\n filtered: inBin.value,\n}))\n\n/* Dragged only by somebody who may write, and only in a list that is a whole order. */\nconst sortable = computed(() => canManage.value && order.sortable.value)\n\n/*\n * The panel's shared lines say \"category\" and \"items\"; here the editor reads \"group\" and \"cards\"\n * (decision 14). A locked list keeps the shared line: it explains why nothing moves.\n */\nconst hint = computed(() => {\n if (order.mode.value === 'category') return t('tariff.order-group')\n if (order.mode.value === 'all') return t('tariff.order')\n\n return order.hint.value\n})\n\nconst emptyText = computed(() => {\n if (q.value !== '') return t('tariff.empty-search')\n\n return inBin.value ? t('tariff.empty-bin') : t('tariff.empty')\n})\n\nasync function load(): Promise<void> {\n loading.value = true\n\n try {\n const answer = await api.list({\n search: q.value,\n category: inBin.value ? null : category.value,\n trashed: inBin.value,\n })\n\n rows.value = answer.data\n categories.value = answer.filters.categories\n } catch (error) {\n toast.danger(message(error))\n } finally {\n loading.value = false\n }\n}\n\nwatch(\n () => [view.value, category.value, q.value] as const,\n () => void load(),\n)\nvoid load()\n\nlet pause: ReturnType<typeof setTimeout> | undefined\n\nwatch(typed, (value) => {\n clearTimeout(pause)\n pause = setTimeout(() => {\n void router.replace({ query: { ...route.query, q: value.trim() === '' ? undefined : value } })\n }, 300)\n})\n\nonBeforeUnmount(() => clearTimeout(pause))\n\nfunction narrow(value: unknown): void {\n void router.replace({\n query: { ...route.query, category: typeof value === 'number' ? String(value) : undefined },\n })\n}\n\n/* `replace` and not `push`: going through twenty tariffs is not twenty steps of history. */\nfunction choose(id: number | 'new'): void {\n void router.replace({ query: { ...route.query, tariff: String(id) } })\n}\n\nfunction close(): void {\n const query = { ...route.query }\n\n delete query.tariff\n void router.replace({ query })\n}\n\n/** A new tariff was saved: it is a record now, and the list has it. */\nfunction created(tariff: TariffSummary): void {\n choose(tariff.id)\n void load()\n}\n\n/**\n * The order on screen, written as a whole — the list or the category's, whichever this is. The\n * list is already in its new order (`WxSortableList` reorders the model before it says so), so a\n * failure has to put it back rather than leave the screen disagreeing with the database.\n */\nasync function reorder(): Promise<void> {\n try {\n await order.move(rows.value.map((row) => row.id))\n } catch (error) {\n toast.danger(message(error, t('tariff.reorder-failed')))\n await load()\n }\n}\n\nfunction actionsFor(row: TariffRow): RowAction[] {\n if (!canManage.value) return []\n\n if (inBin.value) {\n return [\n {\n key: 'restore',\n icon: 'refresh',\n label: t('tariff.restore'),\n run: () => void restore(row),\n },\n ]\n }\n\n return [\n {\n key: 'delete',\n icon: 'trash',\n label: t('tariff.delete'),\n danger: true,\n run: () => void remove(row),\n },\n ]\n}\n\nasync function remove(row: TariffRow): Promise<void> {\n const agreed = await confirm({\n title: t('tariff.delete-title', { name: row.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(row.id)\n toast.success(t('tariff.deleted'))\n removed(row.id)\n } catch (error) {\n toast.danger(message(error))\n }\n}\n\n/** Gone from the list; and if it was the open one, the form goes with it. */\nfunction removed(id: number): void {\n if (selected.value === id) close()\n\n void load()\n}\n\nasync function restore(row: TariffRow): Promise<void> {\n try {\n await api.restore(row.id)\n toast.success(t('tariff.restored'))\n } catch (error) {\n toast.danger(message(error))\n } finally {\n await load()\n }\n}\n\n/* The price as the site would print it — the language of the panel only decides the separators. */\nfunction price(row: TariffRow): string {\n return priceLine(row, context.i18n.state.locale)\n}\n</script>\n\n<template>\n <wx-list-screen v-model:view=\"view\" :title=\"title\" :views=\"views\" :card=\"false\">\n <wx-card class=\"wx-tariffs\" padding=\"none\">\n <wx-list-detail\n v-model:open=\"open\"\n class=\"wx-tariffs__panes\"\n :list-width=\"360\"\n :detail-min=\"460\"\n :detail-label=\"t('module.tariffs')\"\n >\n <template #list>\n <div class=\"wx-tariffs__bar\">\n <wx-input\n v-model=\"typed\"\n class=\"wx-tariffs__search\"\n size=\"sm\"\n clearable\n :placeholder=\"t('tariff.search')\"\n :aria-label=\"t('tariff.search')\"\n >\n <template #prefix><wx-icon name=\"search\" size=\"sm\" /></template>\n </wx-input>\n\n <!-- Always in sight rather than behind a funnel: it is the one filter that decides\n which order a drag writes, and the list says so right under it. -->\n <wx-select\n v-if=\"!inBin\"\n :model-value=\"category\"\n :options=\"categories.map((item) => ({ value: item.id, label: item.title }))\"\n :placeholder=\"t('tariff.any-category')\"\n :aria-label=\"t('tariff.filter-category')\"\n clearable\n size=\"sm\"\n @update:model-value=\"narrow\"\n />\n </div>\n\n <!--\n A line of the list rather than a button in the head: the new tariff is written where\n it will stand, beside the ones it joins — and the form opens the same way any other\n tariff's does.\n -->\n <button\n v-if=\"canManage && !inBin\"\n type=\"button\"\n class=\"wx-tariffs__new\"\n :class=\"{ 'is-current': selected === 'new' }\"\n @click=\"choose('new')\"\n >\n <wx-icon name=\"plus\" size=\"sm\" />\n {{ t('tariff.new') }}\n </button>\n\n <wx-skeleton v-if=\"loading && rows.length === 0\" class=\"wx-tariffs__loading\" :rows=\"5\" />\n\n <wx-empty\n v-else-if=\"rows.length === 0\"\n :title=\"emptyText\"\n :description=\"!inBin && q === '' ? t('tariff.empty-help') : undefined\"\n />\n\n <template v-else>\n <!-- A grip and not the whole row: the row opens a tariff, and a row that both opens\n and drags is one where one of the two happens by accident. -->\n <wx-sortable-list\n v-model=\"rows\"\n class=\"wx-tariffs__list\"\n :class=\"{ 'is-loading': loading }\"\n plain\n item-key=\"id\"\n :handle=\"sortable ? 'grip' : 'row'\"\n :item-label=\"(item: TariffRow) => item.name\"\n :disabled=\"!sortable\"\n @move=\"reorder\"\n >\n <template #default=\"{ item }\">\n <component\n :is=\"inBin ? 'div' : 'button'\"\n :type=\"inBin ? undefined : 'button'\"\n class=\"wx-tariff-row\"\n :class=\"{ 'is-current': selected === item.id }\"\n @click=\"inBin ? undefined : choose(item.id)\"\n >\n <span class=\"wx-tariff-row__body\">\n <span class=\"wx-tariff-row__who\">\n <span class=\"wx-tariff-row__name\">{{ item.name }}</span>\n <!-- A mark and not a control: the switch is in the form. -->\n <span\n v-if=\"item.featured\"\n class=\"wx-tariff-row__star\"\n role=\"img\"\n :aria-label=\"t('tariff.featured')\"\n >\n <wx-icon name=\"star\" size=\"sm\" />\n </span>\n </span>\n\n <span\n class=\"wx-tariff-row__price\"\n :class=\"{ 'is-missing': price(item) === '' }\"\n >\n {{ price(item) || t('tariff.no-price') }}\n </span>\n\n <span class=\"wx-tariff-row__facts\">\n <wx-badge v-if=\"!item.published\" dot size=\"sm\">\n {{ t('tariff.not-published') }}\n </wx-badge>\n\n <span v-if=\"item.badge\" class=\"wx-tariff-row__badge\">{{ item.badge }}</span>\n\n <wx-badge v-for=\"chip in item.categories\" :key=\"chip.id\" size=\"sm\" round>\n {{ chip.title }}\n </wx-badge>\n </span>\n </span>\n </component>\n </template>\n\n <template #actions=\"{ item }\">\n <wx-row-menu :actions=\"actionsFor(item)\" :label=\"item.name\" />\n </template>\n </wx-sortable-list>\n\n <!-- What a drag does here, or why there is nothing to drag. -->\n <wx-alert\n v-if=\"canManage && !inBin\"\n class=\"wx-tariffs__note\"\n type=\"info\"\n :description=\"hint\"\n />\n </template>\n </template>\n\n <template #detail=\"{ inline, back }\">\n <tariff-pane\n v-if=\"selected !== null\"\n :id=\"selected === 'new' ? null : selected\"\n :key=\"String(selected)\"\n :category=\"category\"\n :inline=\"inline\"\n @back=\"back\"\n @saved=\"load\"\n @created=\"created\"\n @removed=\"removed\"\n />\n </template>\n\n <template #empty>\n <wx-empty\n :title=\"t('tariff.choose')\"\n :description=\"canManage ? t('tariff.choose-help') : undefined\"\n />\n </template>\n </wx-list-detail>\n </wx-card>\n </wx-list-screen>\n</template>\n\n<style>\n/*\n * What scrolls here is the page, the way it does on every other list of the panel. The card's\n * corners are the screen's, and the panes paint their own background to the edge: `clip`, not\n * `hidden`, which would make this a scroll container and pin everything sticky inside to a box\n * that never moves (CLAUDE.md §4).\n */\n.wx-tariffs > .wx-card__body {\n display: flex;\n flex-direction: column;\n overflow: clip;\n border-radius: inherit;\n}\n</style>\n\n<style scoped>\n.wx-tariffs__bar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--wx-space-8);\n padding: var(--wx-space-12) var(--wx-space-12) var(--wx-space-8);\n}\n\n.wx-tariffs__search {\n flex: 1 1 180px;\n min-width: 0;\n}\n\n/* The select is a fragment (it carries its dropdown beside it), so our scope attribute never\n reaches it: styled from our own wrapper (CLAUDE.md §4). */\n.wx-tariffs__bar > :deep(.wx-select) {\n flex: 1 1 140px;\n min-width: 0;\n}\n\n.wx-tariffs__new {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n width: calc(100% - 2 * var(--wx-space-8));\n margin: 0 var(--wx-space-8) var(--wx-space-4);\n padding: var(--wx-space-8);\n border: 1px dashed var(--wx-border-default);\n border-radius: var(--wx-radius-sm);\n background: none;\n font: inherit;\n color: var(--wx-color-primary);\n text-align: start;\n cursor: pointer;\n}\n\n.wx-tariffs__new:hover,\n.wx-tariffs__new.is-current {\n background: var(--wx-bg-subtle);\n}\n\n.wx-tariffs__loading {\n padding: var(--wx-space-12);\n}\n\n.wx-tariffs__list {\n padding-inline: var(--wx-space-8);\n}\n\n.wx-tariffs__list.is-loading {\n opacity: 0.6;\n}\n\n.wx-tariffs__list :deep(.wx-sortable-list__row) {\n gap: var(--wx-space-4);\n padding-inline: var(--wx-space-4);\n border-radius: var(--wx-radius-sm);\n}\n\n.wx-tariffs__list :deep(.wx-sortable-list__row:hover),\n.wx-tariffs__list :deep(.wx-sortable-list__row:has(.is-current)) {\n background: var(--wx-bg-subtle);\n}\n\n.wx-tariffs__note {\n margin: var(--wx-space-8);\n}\n\n.wx-tariff-row {\n display: flex;\n align-items: flex-start;\n gap: var(--wx-space-10);\n /* The row is the target: a short name should not leave half the line dead — and a button,\n unlike a link, is only as wide as what is in it until it is told otherwise. */\n flex: 1 1 auto;\n width: 100%;\n min-width: 0;\n padding-block: var(--wx-space-8);\n padding-inline: 0;\n border: 0;\n background: none;\n font: inherit;\n color: inherit;\n text-align: start;\n}\n\nbutton.wx-tariff-row {\n cursor: pointer;\n}\n\n.wx-tariff-row__body {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: var(--wx-space-2);\n min-width: 0;\n}\n\n.wx-tariff-row__who {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n column-gap: var(--wx-space-8);\n min-width: 0;\n}\n\n.wx-tariff-row__name {\n min-width: 0;\n overflow: hidden;\n font-weight: var(--wx-font-weight-medium);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-tariff-row.is-current .wx-tariff-row__name {\n color: var(--wx-color-primary);\n}\n\n.wx-tariff-row__star {\n display: inline-flex;\n flex: none;\n align-self: center;\n color: var(--wx-color-warning);\n}\n\n/* The price is what tells two cards apart in the list, so it is the second line, not a chip. */\n.wx-tariff-row__price {\n overflow: hidden;\n font-size: var(--wx-font-size-sm);\n font-variant-numeric: tabular-nums;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-tariff-row__price.is-missing {\n color: var(--wx-text-muted);\n font-style: italic;\n}\n\n.wx-tariff-row__facts {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-4);\n min-width: 0;\n margin-top: var(--wx-space-2);\n}\n\n.wx-tariff-row__facts:empty {\n display: none;\n}\n\n.wx-tariff-row__badge {\n min-width: 0;\n overflow: hidden;\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n text-overflow: ellipsis;\n text-transform: uppercase;\n white-space: nowrap;\n}\n</style>\n","import { categoryRoutes, type AdminModule, type CategoriesOptions } from '@webx-ui/module-admin'\nimport TariffsPage from './TariffsPage.vue'\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: [{ path, name: 'webx.tariffs', component: TariffsPage, props: { base: path } }],\n },\n {\n id: 'tariff-groups',\n path: `${path}/groups`,\n routes: categoryRoutes(tariffGroupsOptions(path)),\n },\n ]\n}\n"],"names":["TARIFFS_API","createTariffsApi","admin","base","data","body","query","search","id","values","ids","category","reorderItems","tariffsMessages","seeded","useTariffsMessages","i18n","useAdmin","priceLine","row","locale","whole","amount","symbol","period","part","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","onMounted","onBeforeUnmount","mayLeave","onBeforeRouteUpdate","to","from","onBeforeRouteLeave","actions","_createElementBlock","_createBlock","_unref","WxSkeleton","_Fragment","_createVNode","WxScreenHead","WxBadge","WxScreen","$event","WxActionBar","WxSaveState","WxButton","route","useRoute","router","useRouter","rows","categories","module","view","value","inBin","raw","q","typed","selected","open","close","views","order","useItemOrder","sortable","hint","emptyText","answer","watch","pause","narrow","choose","created","reorder","actionsFor","restore","removed","price","WxListScreen","WxCard","WxListDetail","_createElementVNode","_hoisted_1","WxInput","WxIcon","WxSelect","item","_normalizeClass","_createTextVNode","WxEmpty","WxSortableList","_withCtx","_openBlock","_resolveDynamicComponent","_hoisted_2","_hoisted_3","_hoisted_4","_toDisplayString","_hoisted_6","_hoisted_7","_renderList","chip","WxRowMenu","WxAlert","inline","back","TariffPane","tariffGroupsOptions","path","tariffs","options","TariffsPage","categoryRoutes"],"mappings":";;;;AAsBO,MAAMA,IAAc;AAMpB,SAASC,GAAiBC,GAAiC;AAChE,QAAMC,IAAO,GAAGD,EAAM,OAAO,IAAIF,CAAW,IACtCI,IAAO,CAAIC,MAAyBA,EAAK;AAE/C,SAAO;AAAA,IACL,MAAM,CAACC,IAAQ,OAAO;AACpB,YAAMC,IAAS,IAAI,gBAAA;AAGnB,aAAID,EAAM,UAAQC,EAAO,IAAI,UAAUD,EAAM,MAAM,GAC/CA,EAAM,YAAY,QAAMC,EAAO,IAAI,YAAY,OAAOD,EAAM,QAAQ,CAAC,GACrEA,EAAM,WAASC,EAAO,IAAI,WAAW,GAAG,GAErCL,EAAM,KAAK,IAAiBK,EAAO,OAAO,IAAI,GAAGJ,CAAI,IAAII,CAAM,KAAKJ,CAAI;AAAA,IACjF;AAAA,IACA,KAAK,CAACK,MAAON,EAAM,KAAK,IAA4B,GAAGC,CAAI,IAAIK,CAAE,EAAE,EAAE,KAAKJ,CAAI;AAAA,IAC9E,QAAQ,CAACK,MAAWP,EAAM,KAAK,KAA6BC,GAAM,EAAE,QAAAM,EAAA,CAAQ,EAAE,KAAKL,CAAI;AAAA,IACvF,MAAM,CAACI,GAAIC,MACTP,EAAM,KAAK,IAA4B,GAAGC,CAAI,IAAIK,CAAE,IAAI,EAAE,QAAAC,GAAQ,EAAE,KAAKL,CAAI;AAAA,IAC/E,QAAQ,CAACI,MAAON,EAAM,KAAK,OAAa,GAAGC,CAAI,IAAIK,CAAE,EAAE,EAAE,KAAK,MAAA;AAAA,KAAe;AAAA;AAAA,IAE7E,SAAS,CAACA,MAAON,EAAM,KAAK,KAA0B,GAAGC,CAAI,IAAIK,CAAE,YAAY,C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ACP,cAAc;AAAA,MACd,kBAAkB;AAAA,MAClB,eAAe;AAAA,MACf,SAAS;AAAA,MACT,OAAO;AAAA,MACP,eAAe;AAAA,IAAA;AAAA,EACjB;AAEJ;AAUO,SAASgJ,GAAQC,IAA0B,IAAmB;AACnE,QAAMF,IAAOE,EAAQ,QAAQ;AAE7B,SAAO;AAAA,IACL;AAAA,MACE,IAAI;AAAA,MACJ,MAAAF;AAAA;AAAA;AAAA,MAGA,QAAQ,CAAC,EAAE,MAAAA,GAAM,MAAM,gBAAgB,WAAWG,IAAa,OAAO,EAAE,MAAMH,EAAA,GAAQ;AAAA,IAAA;AAAA,IAExF;AAAA,MACE,IAAI;AAAA,MACJ,MAAM,GAAGA,CAAI;AAAA,MACb,QAAQI,GAAeL,GAAoBC,CAAI,CAAC;AAAA,IAAA;AAAA,EAClD;AAEJ;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Messages } from '@webx-ui/module-admin';
|
|
2
|
+
/**
|
|
3
|
+
* The English this package speaks on its own, before the server's dictionary arrives, or without
|
|
4
|
+
* one. The server ships the same lines in ten languages under `webx-tariffs::` and overrides
|
|
5
|
+
* these; `messages.test.ts` keeps the two sets of keys equal.
|
|
6
|
+
*
|
|
7
|
+
* Categories in the code, groups in the words (decision 14): the `category` group holds what the
|
|
8
|
+
* shared category screens say, and every one of its lines says "group".
|
|
9
|
+
*/
|
|
10
|
+
export declare const tariffsMessages: Record<string, Messages>;
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AdminModule, CategoriesOptions } from '@webx-ui/module-admin';
|
|
2
|
+
export interface TariffsOptions {
|
|
3
|
+
/** Where the tariffs live inside the panel. The groups sit under it. */
|
|
4
|
+
path?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The groups of the tariffs as the panel's shared category screens see them. Exported so that a
|
|
8
|
+
* panel mounting the screens somewhere of its own does not have to repeat the words.
|
|
9
|
+
*
|
|
10
|
+
* Categories in the code and groups in the words (decision 14): the API and the tables speak the
|
|
11
|
+
* shared code's language, the editor reads "group" — “For individuals”, “For business”. No words
|
|
12
|
+
* about addresses: a group has none (decision 2), and the shared list leaves the address line out
|
|
13
|
+
* when the server says so.
|
|
14
|
+
*/
|
|
15
|
+
export declare function tariffGroupsOptions(path?: string): CategoriesOptions;
|
|
16
|
+
/**
|
|
17
|
+
* The tariffs as sections of the panel: tariffs, and their groups (§5.2).
|
|
18
|
+
*
|
|
19
|
+
* Two modules rather than one, because the navigation is one entry per module; the server puts
|
|
20
|
+
* both in the `tariffs` group, which is what draws them under one heading. The panel includes
|
|
21
|
+
* them as `...tariffs()` — the line `extra.webx.panel.register` of the composer package names. A
|
|
22
|
+
* section whose server half is not installed never appears — the entry is built from the manifest.
|
|
23
|
+
*/
|
|
24
|
+
export declare function tariffs(options?: TariffsOptions): AdminModule[];
|
package/dist/price.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TariffRow } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The price of a row on one line, the way the offered block prints it: the symbol before the
|
|
4
|
+
* number, the period after it (“$750 /mo”), or the words where there is no number (“On request”).
|
|
5
|
+
* `''` when there is neither — the row says nothing rather than “0”.
|
|
6
|
+
*
|
|
7
|
+
* The number follows the same rule as the card's `amount` (§4.1): no fraction when it is whole,
|
|
8
|
+
* two places when it is not, the separators of the panel's language. Zero is a number (decision
|
|
9
|
+
* 16): “$0”, and “Free” is the words.
|
|
10
|
+
*/
|
|
11
|
+
export declare function priceLine(row: Pick<TariffRow, 'price' | 'symbol' | 'currency' | 'period' | 'price_text'>, locale: string): string;
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.wx-tariff[data-v-2c8988e3]{display:flex;flex-direction:column;gap:var(--wx-gap, var(--wx-space-16));min-width:0;padding:var(--wx-gap, var(--wx-space-16));container-type:inline-size}.wx-tariff__ghost[data-v-2c8988e3]{max-width:480px}.wx-tariffs>.wx-card__body{display:flex;flex-direction:column;overflow:clip;border-radius:inherit}.wx-tariffs__bar[data-v-d86b91c1]{display:flex;flex-wrap:wrap;gap:var(--wx-space-8);padding:var(--wx-space-12) var(--wx-space-12) var(--wx-space-8)}.wx-tariffs__search[data-v-d86b91c1]{flex:1 1 180px;min-width:0}.wx-tariffs__bar[data-v-d86b91c1]>.wx-select{flex:1 1 140px;min-width:0}.wx-tariffs__new[data-v-d86b91c1]{display:flex;align-items:center;gap:var(--wx-space-8);width:calc(100% - 2 * var(--wx-space-8));margin:0 var(--wx-space-8) var(--wx-space-4);padding:var(--wx-space-8);border:1px dashed var(--wx-border-default);border-radius:var(--wx-radius-sm);background:none;font:inherit;color:var(--wx-color-primary);text-align:start;cursor:pointer}.wx-tariffs__new[data-v-d86b91c1]:hover,.wx-tariffs__new.is-current[data-v-d86b91c1]{background:var(--wx-bg-subtle)}.wx-tariffs__loading[data-v-d86b91c1]{padding:var(--wx-space-12)}.wx-tariffs__list[data-v-d86b91c1]{padding-inline:var(--wx-space-8)}.wx-tariffs__list.is-loading[data-v-d86b91c1]{opacity:.6}.wx-tariffs__list[data-v-d86b91c1] .wx-sortable-list__row{gap:var(--wx-space-4);padding-inline:var(--wx-space-4);border-radius:var(--wx-radius-sm)}.wx-tariffs__list[data-v-d86b91c1] .wx-sortable-list__row:hover,.wx-tariffs__list[data-v-d86b91c1] .wx-sortable-list__row:has(.is-current){background:var(--wx-bg-subtle)}.wx-tariffs__note[data-v-d86b91c1]{margin:var(--wx-space-8)}.wx-tariff-row[data-v-d86b91c1]{display:flex;align-items:flex-start;gap:var(--wx-space-10);flex:1 1 auto;width:100%;min-width:0;padding-block:var(--wx-space-8);padding-inline:0;border:0;background:none;font:inherit;color:inherit;text-align:start}button.wx-tariff-row[data-v-d86b91c1]{cursor:pointer}.wx-tariff-row__body[data-v-d86b91c1]{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--wx-space-2);min-width:0}.wx-tariff-row__who[data-v-d86b91c1]{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:var(--wx-space-8);min-width:0}.wx-tariff-row__name[data-v-d86b91c1]{min-width:0;overflow:hidden;font-weight:var(--wx-font-weight-medium);text-overflow:ellipsis;white-space:nowrap}.wx-tariff-row.is-current .wx-tariff-row__name[data-v-d86b91c1]{color:var(--wx-color-primary)}.wx-tariff-row__star[data-v-d86b91c1]{display:inline-flex;flex:none;align-self:center;color:var(--wx-color-warning)}.wx-tariff-row__price[data-v-d86b91c1]{overflow:hidden;font-size:var(--wx-font-size-sm);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.wx-tariff-row__price.is-missing[data-v-d86b91c1]{color:var(--wx-text-muted);font-style:italic}.wx-tariff-row__facts[data-v-d86b91c1]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wx-space-4);min-width:0;margin-top:var(--wx-space-2)}.wx-tariff-row__facts[data-v-d86b91c1]:empty{display:none}.wx-tariff-row__badge[data-v-d86b91c1]{min-width:0;overflow:hidden;color:var(--wx-text-muted);font-size:var(--wx-font-size-xs);text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ScreenModel } from '@webx-ui/schema';
|
|
2
|
+
/** A group as a row of the list names one: the filter, and the chips on the row. */
|
|
3
|
+
export interface TariffGroupRef {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* One tariff as the section lists it (§5.4).
|
|
9
|
+
*
|
|
10
|
+
* The words are in the language the panel is open in, in the default one where there is none —
|
|
11
|
+
* the same fallback the site uses for them (decision 12), so the row shows the price the page
|
|
12
|
+
* would print.
|
|
13
|
+
*/
|
|
14
|
+
export interface TariffRow {
|
|
15
|
+
id: number;
|
|
16
|
+
/** The name, or `#id` when there is none in either language. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** The short plate over the name (“30 HOURS / 25$”); `''` or `null` when there is none. */
|
|
19
|
+
badge: string | null;
|
|
20
|
+
/** A number, or `null` — then `price_text` is what the site prints. */
|
|
21
|
+
price: number | null;
|
|
22
|
+
/** A key of `webx-tariffs.currencies`, or `null` when none was chosen. */
|
|
23
|
+
currency: string | null;
|
|
24
|
+
/** The symbol the config gives the currency — the code itself for one the config dropped. */
|
|
25
|
+
symbol: string | null;
|
|
26
|
+
/** “/mo”, “a year”; `''` or `null` when there is none. */
|
|
27
|
+
period: string | null;
|
|
28
|
+
/** The words printed instead of a number (“On request”); `''` or `null` when there are none. */
|
|
29
|
+
price_text: string | null;
|
|
30
|
+
/** Picked out among the others on the site. */
|
|
31
|
+
featured: boolean;
|
|
32
|
+
published: boolean;
|
|
33
|
+
/** Its place in the whole list. */
|
|
34
|
+
position: number;
|
|
35
|
+
categories: TariffGroupRef[];
|
|
36
|
+
updated_at: string | null;
|
|
37
|
+
deleted_at: string | null;
|
|
38
|
+
}
|
|
39
|
+
/** Every tariff — no pages: the list is where tariffs are put in order. */
|
|
40
|
+
export interface TariffsList {
|
|
41
|
+
data: TariffRow[];
|
|
42
|
+
filters: {
|
|
43
|
+
categories: TariffGroupRef[];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface TariffQuery {
|
|
47
|
+
/** The name, the plate or the description, in any language the site has. */
|
|
48
|
+
search?: string;
|
|
49
|
+
/** One group: the list comes in its own order, and a drag writes that order. */
|
|
50
|
+
category?: number | null;
|
|
51
|
+
/** What was deleted. The only way back to a tariff in the bin is through this list. */
|
|
52
|
+
trashed?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** The record half of the form's answer — what the head of the form needs. */
|
|
55
|
+
export interface TariffSummary {
|
|
56
|
+
id: number;
|
|
57
|
+
name: string;
|
|
58
|
+
published: boolean;
|
|
59
|
+
deleted_at: string | null;
|
|
60
|
+
}
|
|
61
|
+
/** One tariff as its form opens it: the record, and the values of `tariffs.form` by field name. */
|
|
62
|
+
export interface TariffDetail {
|
|
63
|
+
tariff: TariffSummary;
|
|
64
|
+
values: ScreenModel;
|
|
65
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webx-ui/module-tariffs",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Tariffs for the WebX UI admin panel: price cards with a currency, a period, what is included and a button, in groups, ordered by hand, shown on the site by a block.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"webx-ui",
|
|
12
|
+
"vue",
|
|
13
|
+
"admin",
|
|
14
|
+
"cms",
|
|
15
|
+
"tariffs",
|
|
16
|
+
"pricing"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/webx-ui/webx-ui.git",
|
|
21
|
+
"directory": "packages/module-tariffs"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://webx-ui.github.io/webx-ui/guide/tariffs.html",
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"module": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./style.css": "./dist/style.css",
|
|
39
|
+
"./dist/style.css": "./dist/style.css",
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"vue": "^3.5.0",
|
|
44
|
+
"vue-router": "^4.5.0"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@webx-ui/core": "^0.34.0",
|
|
48
|
+
"@webx-ui/module-admin": "^0.18.1",
|
|
49
|
+
"@webx-ui/schema": "^0.6.3"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^24.10.1",
|
|
53
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
54
|
+
"typescript": "^5.9.3",
|
|
55
|
+
"vite": "^7.1.14",
|
|
56
|
+
"vite-plugin-dts": "^4.5.4",
|
|
57
|
+
"vue": "^3.5.24",
|
|
58
|
+
"vue-router": "^4.5.1",
|
|
59
|
+
"vue-tsc": "^3.1.3"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "vite build",
|
|
63
|
+
"dev": "vite build --watch",
|
|
64
|
+
"typecheck": "vue-tsc -p tsconfig.json --noEmit"
|
|
65
|
+
}
|
|
66
|
+
}
|