@wssto2/vue-core 0.19.0 → 0.21.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/CHANGELOG.md +31 -0
- package/README.md +5 -1
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-Bg8JFAOT.js → AccessGate.vue_vue_type_script_setup_true_lang-Dw_pnsh9.js} +1 -1
- package/dist/{AccountMenuItem.vue_vue_type_script_setup_true_lang-BIYgaihv.js → AccountMenuItem.vue_vue_type_script_setup_true_lang-C2TmmH38.js} +1 -1
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-B5IMNnTf.js → ActionRow.vue_vue_type_script_setup_true_lang-BEV0drwF.js} +2 -2
- package/dist/{Activity-CiYn5E6A.js → Activity-CZzAt3SH.js} +9 -9
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-oXWQTfBs.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-BkZzuICH.js} +6 -6
- package/dist/{AlertDialog.vue_vue_type_script_setup_true_lang-WuGvAOrj.js → AlertDialog.vue_vue_type_script_setup_true_lang-B0UvzCoE.js} +1 -1
- package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js → AsyncSection.vue_vue_type_script_setup_true_lang-DuPS_zMX.js} +4 -4
- package/dist/{Banner.vue_vue_type_script_setup_true_lang-sv0phngk.js → Banner.vue_vue_type_script_setup_true_lang-BXZVOhfH.js} +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js → Button.vue_vue_type_script_setup_true_lang-CZkTqGtE.js} +1 -1
- package/dist/{Changes-Cy8STpLX.js → Changes-B0bhSNU3.js} +5 -5
- package/dist/CharacteristicsPage-fGnahf62.js +4 -0
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Dr6nFNBB.js → CollectionPage.vue_vue_type_script_setup_true_lang-Bf5WXVFZ.js} +12 -12
- package/dist/CollectionTree.vue_vue_type_script_setup_true_lang-DV0OhquO.js +345 -0
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-D372wlxR.js → DataTable.vue_vue_type_script_setup_true_lang-Cw_E8w48.js} +1 -1
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-D0KcfW8R.js → DateField.vue_vue_type_script_setup_true_lang-Cn8CNAwM.js} +4 -4
- package/dist/{DeadLetters-DhJkMpd_.js → DeadLetters--js7aeC6.js} +4 -4
- package/dist/{DiscardChangesModal.vue_vue_type_script_setup_true_lang-92szOrYd.js → DiscardChangesModal.vue_vue_type_script_setup_true_lang-lnFUie1d.js} +1 -1
- package/dist/{EmptyState.vue_vue_type_script_setup_true_lang-DbZiO2RF.js → EmptyState.vue_vue_type_script_setup_true_lang-DHmu-UG-.js} +1 -1
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-lvAuBG-0.js → FormGroup.vue_vue_type_script_setup_true_lang-BUhKKybf.js} +4 -4
- package/dist/{FormRow.vue_vue_type_script_setup_true_lang-CpgNVQF4.js → FormRow.vue_vue_type_script_setup_true_lang-B-uth5RB.js} +1 -1
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-D01Jr4UU.js → FormView.vue_vue_type_script_setup_true_lang-CoQZG-hB.js} +2 -2
- package/dist/{General-CwTPC5UP.js → General-BGT9H69S.js} +8 -8
- package/dist/{HeaderAction.vue_vue_type_script_setup_true_lang-Da59TLBh.js → HeaderAction.vue_vue_type_script_setup_true_lang-Uw0vwV-o.js} +2 -2
- package/dist/{Icon.vue_vue_type_script_lang-BhhsFYwp.js → Icon.vue_vue_type_script_lang-BIzh8LF1.js} +19 -13
- package/dist/{IconTile.vue_vue_type_script_setup_true_lang-BmxCuUZ9.js → IconTile.vue_vue_type_script_setup_true_lang-DRirnJvd.js} +1 -1
- package/dist/{IncidentRecord-hXEGuLGg.js → IncidentRecord-BETFfXbI.js} +17 -17
- package/dist/{IncidentsList-C41VyDwK.js → IncidentsList-BIr3a2To.js} +6 -6
- package/dist/{LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CrGrjrlO.js → LeaveGuardRoot.vue_vue_type_script_setup_true_lang-DjXYh-p0.js} +1 -1
- package/dist/{Menu.vue_vue_type_script_setup_true_lang-Cqu4Ebsb.js → Menu.vue_vue_type_script_setup_true_lang-D2FsOVYA.js} +1 -1
- package/dist/{MenuButton.vue_vue_type_script_setup_true_lang-C-XRr5f2.js → MenuButton.vue_vue_type_script_setup_true_lang-BNzrYIzR.js} +1 -1
- package/dist/{Modal.vue_vue_type_script_setup_true_lang-CZ7WrDwu.js → Modal.vue_vue_type_script_setup_true_lang-BRRMKXOV.js} +2 -2
- package/dist/{NewRolePage-BYYZJkK7.js → NewRolePage-B0Y5MrTu.js} +4 -4
- package/dist/{NoAccess.vue_vue_type_script_setup_true_lang-BHzZtZ50.js → NoAccess.vue_vue_type_script_setup_true_lang-CnfE_AEl.js} +1 -1
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-BhNZgEW6.js → NumberField.vue_vue_type_script_setup_true_lang-BDZ_0TH7.js} +2 -2
- package/dist/{Panel.vue_vue_type_script_setup_true_lang-D_Wg42hu.js → Panel.vue_vue_type_script_setup_true_lang-CwcJadT7.js} +1 -1
- package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-mYFuG-Y3.js → PersonAccess.vue_vue_type_script_setup_true_lang-CJMV9BDQ.js} +12 -12
- package/dist/{PhotoViewer.vue_vue_type_script_setup_true_lang-DmMg1T_V.js → PhotoViewer.vue_vue_type_script_setup_true_lang-BL485L63.js} +1 -1
- package/dist/{ProfilePage-DGEsIycR.js → ProfilePage-CMy2Dkr2.js} +17 -17
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-B3BnYg1x.js → RecordHeader.vue_vue_type_script_setup_true_lang-D4PcZnbo.js} +2 -2
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-1iZtj3rh.js → ResourcePage.vue_vue_type_script_setup_true_lang-CpGwm2tv.js} +4 -4
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-BslSDDiM.js → RoleEditor.vue_vue_type_script_setup_true_lang-CMo8PrO7.js} +12 -12
- package/dist/{RolePage-C08ZUqw1.js → RolePage-DGFISfM1.js} +13 -13
- package/dist/{RolesPage-FOuY1VKg.js → RolesPage-Bq9EVB_3.js} +9 -9
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-CodyVezo.js → SectionList.vue_vue_type_script_setup_true_lang-BdJ11lZo.js} +3 -3
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-DCTFxfPB.js → SectionNavigator.vue_vue_type_script_setup_true_lang-CnzECivO.js} +6 -6
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-CLR6EvzO.js → SegmentedField.vue_vue_type_script_setup_true_lang-D3IZil4q.js} +2 -2
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-D5xYofdb.js → SelectField.vue_vue_type_script_setup_true_lang-DxCEwED6.js} +6 -6
- package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CDr4WNIb.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-DtVXUOdP.js} +8 -8
- package/dist/{ServiceAccountRecord-kWwIQGZb.js → ServiceAccountRecord-Dc7Gn52W.js} +18 -18
- package/dist/{ServiceAccountsList-CKy9_YHP.js → ServiceAccountsList-DBUFeka-.js} +10 -10
- package/dist/{Sessions-BDc8gdYH.js → Sessions-BMmqYZrJ.js} +7 -7
- package/dist/{SettingsPage-t-8kmFVT.js → SettingsPage-4Dolsr0t.js} +18 -18
- package/dist/Sheet.vue_vue_type_script_setup_true_lang-BVU5yzXe.js +163 -0
- package/dist/{SignIn-CqtkvtCZ.js → SignIn-uFn1ZWG8.js} +8 -8
- package/dist/{SignInPage-DcdNKZIb.js → SignInPage-DouCg9aD.js} +6 -6
- package/dist/{SignIns-D4-nGu0B.js → SignIns-CqN5UNmh.js} +5 -5
- package/dist/SortableList.vue_vue_type_script_setup_true_lang-D2-5Z_jO.js +112 -0
- package/dist/{StatusLine.vue_vue_type_script_setup_true_lang-DsdQmLq6.js → StatusLine.vue_vue_type_script_setup_true_lang-DBkQueB0.js} +1 -1
- package/dist/{SwipeActions.vue_vue_type_script_setup_true_lang-D8SiC0G7.js → SwipeActions.vue_vue_type_script_setup_true_lang-DUjUWq3G.js} +1 -1
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-CLtcuofe.js → SwitchField.vue_vue_type_script_setup_true_lang-CTMjlNid.js} +2 -2
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-7CJto6Mp.js +169 -0
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-CVGh-p3J.js → TextField.vue_vue_type_script_setup_true_lang-B6Q65aQA.js} +4 -4
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-YxUlNHSk.js → TextareaField.vue_vue_type_script_setup_true_lang-Cj0LKDdo.js} +2 -2
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DHNC_MLt.js → TimeField.vue_vue_type_script_setup_true_lang-TSnnjMn1.js} +4 -4
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-d_KuxWjH.js → Timestamp.vue_vue_type_script_setup_true_lang-0WL7PP0j.js} +1 -1
- package/dist/{UserRecord-CwZCr9Im.js → UserRecord-CH5oNRLg.js} +10 -10
- package/dist/{UsersList-Cn19sFgv.js → UsersList-BmxWpt9h.js} +3 -3
- package/dist/{ViewTabs.vue_vue_type_script_setup_true_lang-BjdDXE3T.js → ViewTabs.vue_vue_type_script_setup_true_lang-BKI5DGuS.js} +1 -1
- package/dist/access/index.js +7 -7
- package/dist/app/index.js +2 -2
- package/dist/{application-CDSweJb9.js → application-C5fZyCB9.js} +8 -8
- package/dist/{back-LcLlFodC.js → back-CeozxCgQ.js} +2 -2
- package/dist/button/index.js +1 -1
- package/dist/characteristics/CharacteristicsPage.vue.d.ts +2 -0
- package/dist/characteristics/DeleteDialog.vue.d.ts +22 -0
- package/dist/characteristics/ItemSheet.vue.d.ts +25 -0
- package/dist/characteristics/access.d.ts +3 -0
- package/dist/characteristics/api.d.ts +23 -0
- package/dist/characteristics/context.d.ts +12 -0
- package/dist/characteristics/feature.d.ts +27 -0
- package/dist/characteristics/index.d.ts +10 -0
- package/dist/characteristics/index.js +617 -0
- package/dist/characteristics/model.d.ts +34 -0
- package/dist/characteristics/routes.d.ts +13 -0
- package/dist/collection/CollectionTree.vue.d.ts +51 -0
- package/dist/collection/CollectionTreeBranch.vue.d.ts +12 -0
- package/dist/collection/FileExplorer.vue.d.ts +53 -0
- package/dist/collection/RowMore.vue.d.ts +11 -0
- package/dist/collection/explorer.d.ts +11 -0
- package/dist/collection/index.d.ts +5 -0
- package/dist/collection/index.js +431 -158
- package/dist/collection/tree.d.ts +64 -0
- package/dist/content/DiffView.vue.d.ts +22 -0
- package/dist/content/PreviewFrame.vue.d.ts +46 -0
- package/dist/content/diff.d.ts +27 -0
- package/dist/content/index.d.ts +4 -0
- package/dist/content/index.js +552 -218
- package/dist/content/previewFrame.d.ts +50 -0
- package/dist/{contributions-B0x5x5xD.js → contributions-BSmIRPg1.js} +1 -1
- package/dist/controls/SortableList.vue.d.ts +32 -0
- package/dist/controls/Tabs.vue.d.ts +2 -0
- package/dist/controls/index.d.ts +1 -0
- package/dist/controls/index.js +18 -16
- package/dist/form/CharacteristicField.vue.d.ts +36 -0
- package/dist/form/CodeEditor.vue.d.ts +61 -0
- package/dist/form/I18nField.vue.d.ts +1 -1
- package/dist/form/MarkerList.vue.d.ts +20 -0
- package/dist/form/TextareaField.vue.d.ts +1 -1
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.js +1769 -1805
- package/dist/{guards-CNJ0ATVC.js → guards-BP9x7CLF.js} +1 -1
- package/dist/i18n/index.js +46 -46
- package/dist/icon/core.d.ts +6 -0
- package/dist/icon/index.js +1 -1
- package/dist/identity/index.js +3 -3
- package/dist/identity/profile/EmailChangeDialog.vue.d.ts +2 -2
- package/dist/incidents/index.js +1 -1
- package/dist/{index-SLJWm40T.js → index-4wyfEeIw.js} +9 -9
- package/dist/{index-BA2w8uwD.js → index-C_ZVaTkR.js} +27 -27
- package/dist/{index-1HS7O2-e.js → index-OVbtHAtG.js} +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modal/Sheet.vue.d.ts +13 -0
- package/dist/modal/TabbedSheet.vue.d.ts +46 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/index.js +123 -41
- package/dist/modules/characteristics/entities.d.ts +67 -0
- package/dist/modules/characteristics/routes.d.ts +55 -0
- package/dist/modules/characteristics/schemas.d.ts +50 -0
- package/dist/modules/identity/entities.d.ts +1 -0
- package/dist/navigation-C05vGEN8.js +55 -0
- package/dist/{neighbors-Dg_LU9ry.js → neighbors-BqfO6zf3.js} +2 -2
- package/dist/notifications/index.js +1 -1
- package/dist/onboarding/index.js +2 -2
- package/dist/{options-mOOX6JSS.js → options-DDCG86OV.js} +2 -2
- package/dist/overlay/index.js +4 -4
- package/dist/page/SectionNavigator.vue.d.ts +1 -1
- package/dist/page/SplitPane.vue.d.ts +54 -0
- package/dist/page/WorkbenchPage.vue.d.ts +72 -0
- package/dist/page/index.d.ts +2 -0
- package/dist/page/index.js +343 -104
- package/dist/phone/index.js +3 -3
- package/dist/platform/index.js +3 -3
- package/dist/platform/navigation.d.ts +10 -0
- package/dist/{platform-DU9QFts8.js → platform-YWfOO7b2.js} +94 -88
- package/dist/pwa/index.js +3 -3
- package/dist/resource/index.js +1 -1
- package/dist/{resources-BZLlAtoS.js → resources-DkI60fHL.js} +1 -1
- package/dist/router/index.js +4 -4
- package/dist/router/navigation.d.ts +2 -0
- package/dist/routes-DC8BWFz8.js +251 -0
- package/dist/{rowLayout-PIuD7MGo.js → rowLayout-zd3Yw6fO.js} +34 -33
- package/dist/{sectionIndex-BS0ic5W7.js → sectionIndex-CSr457Lb.js} +2 -2
- package/dist/{sections-BpiRLntE.js → sections-DXso1JSV.js} +2 -2
- package/dist/shell/NavigationList.vue.d.ts +1 -1
- package/dist/shell/index.js +522 -501
- package/dist/shell/navigationGroups.d.ts +4 -1
- package/dist/state/index.js +8 -8
- package/dist/{state-z1iPF1DT.js → state-DqCZdet7.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{suggestions-DeMgs_ki.js → suggestions-DZ3B5RVH.js} +1 -1
- package/dist/testing/index.js +2 -2
- package/dist/{useCommand-DQKvro1n.js → useCommand-DerEnzIW.js} +4 -4
- package/dist/{useGroupSheet-CRw3MUmX.js → useGroupSheet-B9TCHIKH.js} +5 -5
- package/dist/{usePreferences-DB29UTFD.js → usePreferences-D38x73re.js} +1 -1
- package/dist/{useRecordDialog-0azHxxvm.js → useRecordDialog-DX97ivZD.js} +1 -1
- package/dist/{useResourceForm-zVuWerSn.js → useResourceForm-D8T1snBQ.js} +1 -1
- package/dist/{useTypedEntry-BsMV66Yc.js → useTypedEntry-CTkgM29Y.js} +2 -2
- package/package.json +6 -2
- package/dist/Sheet.vue_vue_type_script_setup_true_lang-BG8HUNfs.js +0 -145
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-tpkGp98F.js +0 -155
- package/dist/navigation-d-JAPBGA.js +0 -53
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Feature } from "../app";
|
|
2
|
+
import { type CharacteristicsContext } from "./context";
|
|
3
|
+
import type { Destination } from "../router";
|
|
4
|
+
export interface CharacteristicsFeatureOptions {
|
|
5
|
+
/** The destination of the backend's menu that opens the screen. Without it the application links to `characteristicsPages.index` itself. */
|
|
6
|
+
destination?: Destination;
|
|
7
|
+
/**
|
|
8
|
+
* The add phrase of a level, whole, in the application's words: `addLabel: (parent, level) => (parent?.name === "Marke" ? t("add_brand") : undefined)`.
|
|
9
|
+
* The server's description has no text for it (only the level's name, which a sentence cannot be built from in Croatian), so without this
|
|
10
|
+
* the screen says "Dodaj skupinu" at the top level and "Dodaj stavku" below.
|
|
11
|
+
*/
|
|
12
|
+
addLabel?: NonNullable<CharacteristicsContext["addLabel"]>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The screen of go-core's characteristics module, one feature to install: `/characteristics` (route `characteristics.index`) with the tree of
|
|
16
|
+
* lookup lists, the sheet that edits an item, activating, reordering and deleting after the usage is shown. It is behind `characteristics:view`
|
|
17
|
+
* (route access), its write actions behind `characteristics:edit`; go-core grants neither to anybody, so the application gives
|
|
18
|
+
* `characteristics.Grants()` to its webmaster role. The server must have the module installed (`characteristics.Install`).
|
|
19
|
+
*
|
|
20
|
+
* The screen has no project-specific code: the levels, languages and extra fields come from the server's description of the tables.
|
|
21
|
+
*
|
|
22
|
+
* createApplication({ platform, shell: backofficeShell(), features: [identityFeature(), characteristicsFeature({ destination: "characteristics" })] })
|
|
23
|
+
*
|
|
24
|
+
* Why a feature, not a page to mount: the screen needs its route, its access rule and its title together, as the access and service account
|
|
25
|
+
* screens do; `CharacteristicsPage` is exported for an application that wants its own route.
|
|
26
|
+
*/
|
|
27
|
+
export declare function characteristicsFeature(options?: CharacteristicsFeatureOptions): Feature;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type * from "../modules/characteristics/entities";
|
|
2
|
+
export type * as Inputs from "../modules/characteristics/schemas";
|
|
3
|
+
export { characteristicsRoutes } from "../modules/characteristics/routes";
|
|
4
|
+
export { characteristicsFeature } from "./feature";
|
|
5
|
+
export type { CharacteristicsFeatureOptions } from "./feature";
|
|
6
|
+
export { characteristicsPages } from "./routes";
|
|
7
|
+
export type { CharacteristicsPages } from "./routes";
|
|
8
|
+
export { createCharacteristicsApi, useCharacteristicsApi } from "./api";
|
|
9
|
+
export type { CharacteristicsApi } from "./api";
|
|
10
|
+
export { default as CharacteristicsPage } from "./CharacteristicsPage.vue";
|
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
import { c as K, _ as $e } from "../routes-DC8BWFz8.js";
|
|
2
|
+
import { d as Ce, p as Se } from "../feature-DdUAfyi4.js";
|
|
3
|
+
import { d as Ee } from "../context-Ch1r4fdN.js";
|
|
4
|
+
import { d as qe } from "../defineRoutes-BGAdiIrt.js";
|
|
5
|
+
import { u as Ae, j as Ve } from "../platform-YWfOO7b2.js";
|
|
6
|
+
import { defineComponent as me, useTemplateRef as re, ref as z, computed as h, openBlock as f, createElementBlock as R, Fragment as ee, createVNode as B, unref as t, withCtx as A, createElementVNode as H, toDisplayString as q, createBlock as E, createTextVNode as j, createCommentVNode as F, provide as Le, mergeProps as Q, renderList as ne, createSlots as Te } from "vue";
|
|
7
|
+
import { useI18n as fe } from "vue-i18n";
|
|
8
|
+
import { a as De } from "../CollectionTree.vue_vue_type_script_setup_true_lang-DV0OhquO.js";
|
|
9
|
+
import { _ as Fe } from "../Tabs.vue_vue_type_script_setup_true_lang-7CJto6Mp.js";
|
|
10
|
+
import { _ as ue } from "../TextField.vue_vue_type_script_setup_true_lang-B6Q65aQA.js";
|
|
11
|
+
import { u as we } from "../describeError-B-NMa--w.js";
|
|
12
|
+
import { t as ie } from "../toast-CqSDTWRX.js";
|
|
13
|
+
import { _ as Ie } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-BkZzuICH.js";
|
|
14
|
+
import { _ as Oe } from "../AsyncSection.vue_vue_type_script_setup_true_lang-DuPS_zMX.js";
|
|
15
|
+
import { _ as Re } from "../Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
16
|
+
import { u as je } from "../useLoad-M7V-AVwR.js";
|
|
17
|
+
import { _ as te } from "../Button.vue_vue_type_script_setup_true_lang-CZkTqGtE.js";
|
|
18
|
+
import { _ as Be } from "../Modal.vue_vue_type_script_setup_true_lang-BRRMKXOV.js";
|
|
19
|
+
import { _ as Pe } from "../AlertDialog.vue_vue_type_script_setup_true_lang-B0UvzCoE.js";
|
|
20
|
+
import { _ as de } from "../Banner.vue_vue_type_script_setup_true_lang-BXZVOhfH.js";
|
|
21
|
+
import { u as Ne, _ as Ue, a as ye } from "../FormGroup.vue_vue_type_script_setup_true_lang-BUhKKybf.js";
|
|
22
|
+
import { c as Ke } from "../FormRow.vue_vue_type_script_setup_true_lang-B-uth5RB.js";
|
|
23
|
+
import { _ as Me } from "../NumberField.vue_vue_type_script_setup_true_lang-BDZ_0TH7.js";
|
|
24
|
+
import { _ as ze } from "../SelectField.vue_vue_type_script_setup_true_lang-DxCEwED6.js";
|
|
25
|
+
import { _ as ge } from "../SwitchField.vue_vue_type_script_setup_true_lang-CTMjlNid.js";
|
|
26
|
+
import { _ as He } from "../Sheet.vue_vue_type_script_setup_true_lang-BVU5yzXe.js";
|
|
27
|
+
const [We, Ge] = Ee("vue-core.characteristics"), Je = "characteristics:view", Qe = "characteristics:edit", be = qe({
|
|
28
|
+
index: { name: "characteristics.index", path: "/characteristics", component: () => import("../CharacteristicsPage-fGnahf62.js"), meta: { access: Je, titleKey: "core.characteristics.title" } }
|
|
29
|
+
});
|
|
30
|
+
function Ut(c = {}) {
|
|
31
|
+
return Ce({
|
|
32
|
+
id: "characteristics",
|
|
33
|
+
routes: be.records,
|
|
34
|
+
context: Se(We, { addLabel: c.addLabel ?? null }),
|
|
35
|
+
navigation: c.destination ? [{ destination: c.destination, to: be.index }] : []
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function Xe(c) {
|
|
39
|
+
return {
|
|
40
|
+
tree: async (e) => (await c.request(K.tree, void 0, e)).data.items,
|
|
41
|
+
description: async (e) => (await c.request(K.description, void 0, e)).data,
|
|
42
|
+
usage: async (e, v, m) => (await c.request(K.usage, { level: e, id: v }, m)).data,
|
|
43
|
+
create: async (e, v) => (await c.request(K.create, e, { idempotencyKey: v })).data,
|
|
44
|
+
update: async (e, v) => (await c.request(K.update, e, { idempotencyKey: v })).data,
|
|
45
|
+
setActive: async (e, v, m) => (await c.request(K.setActive, { level: e, id: v, active: m })).data,
|
|
46
|
+
/** `position` counts from 1 among the siblings. */
|
|
47
|
+
move: async (e, v, m) => void await c.request(K.move, { level: e, id: v, position: m }),
|
|
48
|
+
/** Refused with `characteristics.in_use` or `characteristics.has_children` unless `force`. */
|
|
49
|
+
remove: async (e, v, m = !1) => (await c.request(K.delete, { level: e, id: v, ...m ? { force: !0 } : {} })).data
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const pe = () => Xe(Ae().http), Ye = ["aria-busy"], Ze = {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: "text-content-muted"
|
|
55
|
+
}, et = {
|
|
56
|
+
key: 0,
|
|
57
|
+
"data-test": "usage-unknown"
|
|
58
|
+
}, tt = {
|
|
59
|
+
key: 1,
|
|
60
|
+
"data-test": "usage-uses"
|
|
61
|
+
}, at = {
|
|
62
|
+
key: 2,
|
|
63
|
+
"data-test": "usage-children"
|
|
64
|
+
}, lt = {
|
|
65
|
+
class: "flex flex-wrap items-center justify-end gap-2 pt-1",
|
|
66
|
+
"data-test": "delete-actions"
|
|
67
|
+
}, st = /* @__PURE__ */ me({
|
|
68
|
+
__name: "DeleteDialog",
|
|
69
|
+
props: {
|
|
70
|
+
canDeactivate: { type: Function }
|
|
71
|
+
},
|
|
72
|
+
emits: ["deleted", "deactivate"],
|
|
73
|
+
setup(c, { expose: e, emit: v }) {
|
|
74
|
+
const m = v, { t: u } = fe(), l = pe(), g = we(), _ = re("modal"), V = re("confirm"), o = z(null), w = z(null), b = z("loading"), k = z(!1);
|
|
75
|
+
async function P(S) {
|
|
76
|
+
o.value = S, w.value = null, b.value = "loading", _.value?.present();
|
|
77
|
+
try {
|
|
78
|
+
w.value = await l.usage(S.level, S.item.id), b.value = "ready";
|
|
79
|
+
} catch {
|
|
80
|
+
b.value = "failed";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const I = h(() => (w.value?.uses ?? []).filter((S) => S.count > 0)), $ = h(() => w.value?.children ?? 0), W = h(() => b.value !== "ready" || w.value?.known === !1 || I.value.length > 0 || $.value > 0), U = h(() => {
|
|
84
|
+
const S = I.value.map((y) => `${y.count} ${y.what}`);
|
|
85
|
+
return S.length < 2 ? S[0] ?? "" : `${S.slice(0, -1).join(", ")} ${u("core.characteristics.delete_dialog.and")} ${S[S.length - 1]}`;
|
|
86
|
+
});
|
|
87
|
+
async function N(S) {
|
|
88
|
+
const y = o.value;
|
|
89
|
+
if (y !== null) {
|
|
90
|
+
try {
|
|
91
|
+
await l.remove(y.level, y.item.id, S);
|
|
92
|
+
} catch (x) {
|
|
93
|
+
throw ie.error(g(x, { fallback: u("core.resource.unavailable") })), x;
|
|
94
|
+
}
|
|
95
|
+
ie.success(u("core.characteristics.toasts.deleted")), m("deleted", y), _.value?.dismiss();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function X() {
|
|
99
|
+
if (W.value) return V.value?.present();
|
|
100
|
+
k.value = !0;
|
|
101
|
+
try {
|
|
102
|
+
await N(!1);
|
|
103
|
+
} catch {
|
|
104
|
+
P(o.value);
|
|
105
|
+
} finally {
|
|
106
|
+
k.value = !1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return e({ show: P }), (S, y) => (f(), R(ee, null, [
|
|
110
|
+
B(Be, {
|
|
111
|
+
ref_key: "modal",
|
|
112
|
+
ref: _,
|
|
113
|
+
size: "md",
|
|
114
|
+
"without-footer": "",
|
|
115
|
+
title: t(u)("core.characteristics.delete_dialog.title", { name: o.value?.item.name ?? "" }),
|
|
116
|
+
onDismissed: y[3] || (y[3] = (x) => o.value = null)
|
|
117
|
+
}, {
|
|
118
|
+
default: A(() => [
|
|
119
|
+
H("div", {
|
|
120
|
+
class: "flex flex-col gap-3 text-body",
|
|
121
|
+
"data-test": "characteristic-usage",
|
|
122
|
+
"aria-busy": b.value === "loading" || void 0
|
|
123
|
+
}, [
|
|
124
|
+
b.value === "loading" ? (f(), R("p", Ze, q(t(u)("core.characteristics.delete_dialog.checking")), 1)) : b.value === "failed" ? (f(), E(de, {
|
|
125
|
+
key: 1,
|
|
126
|
+
tone: "critical",
|
|
127
|
+
icon: "errorWarningLine"
|
|
128
|
+
}, {
|
|
129
|
+
default: A(() => [
|
|
130
|
+
j(q(t(u)("core.characteristics.delete_dialog.usage_failed")), 1)
|
|
131
|
+
]),
|
|
132
|
+
_: 1
|
|
133
|
+
})) : (f(), R(ee, { key: 2 }, [
|
|
134
|
+
w.value?.known === !1 ? (f(), R("p", et, q(t(u)("core.characteristics.delete_dialog.unknown")), 1)) : I.value.length > 0 ? (f(), R("p", tt, q(t(u)("core.characteristics.delete_dialog.used", { uses: U.value })), 1)) : F("", !0),
|
|
135
|
+
$.value > 0 ? (f(), R("p", at, q(t(u)("core.characteristics.delete_dialog.children", $.value)), 1)) : F("", !0),
|
|
136
|
+
W.value ? (f(), E(de, {
|
|
137
|
+
key: 3,
|
|
138
|
+
tone: "warning",
|
|
139
|
+
icon: "alertTriangle"
|
|
140
|
+
}, {
|
|
141
|
+
default: A(() => [
|
|
142
|
+
j(q(t(u)("core.characteristics.delete_dialog.warning")), 1)
|
|
143
|
+
]),
|
|
144
|
+
_: 1
|
|
145
|
+
})) : F("", !0)
|
|
146
|
+
], 64)),
|
|
147
|
+
H("div", lt, [
|
|
148
|
+
B(te, {
|
|
149
|
+
prominence: "plain",
|
|
150
|
+
onClick: y[0] || (y[0] = (x) => _.value?.dismiss())
|
|
151
|
+
}, {
|
|
152
|
+
default: A(() => [
|
|
153
|
+
j(q(t(u)("core.actions.cancel")), 1)
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}),
|
|
157
|
+
B(te, {
|
|
158
|
+
tone: "critical",
|
|
159
|
+
icon: "deleteBin2Line",
|
|
160
|
+
disabled: b.value === "loading" || k.value,
|
|
161
|
+
processing: k.value,
|
|
162
|
+
"data-test": "characteristic-delete-confirm",
|
|
163
|
+
onClick: y[1] || (y[1] = (x) => X())
|
|
164
|
+
}, {
|
|
165
|
+
default: A(() => [
|
|
166
|
+
j(q(W.value && b.value === "ready" ? t(u)("core.characteristics.delete_dialog.delete_anyway") : t(u)("core.characteristics.delete_dialog.delete")), 1)
|
|
167
|
+
]),
|
|
168
|
+
_: 1
|
|
169
|
+
}, 8, ["disabled", "processing"]),
|
|
170
|
+
o.value && c.canDeactivate(o.value) && o.value.item.active ? (f(), E(te, {
|
|
171
|
+
key: 0,
|
|
172
|
+
prominence: "primary",
|
|
173
|
+
"data-test": "characteristic-deactivate",
|
|
174
|
+
onClick: y[2] || (y[2] = (x) => {
|
|
175
|
+
m("deactivate", o.value), _.value?.dismiss();
|
|
176
|
+
})
|
|
177
|
+
}, {
|
|
178
|
+
default: A(() => [
|
|
179
|
+
j(q(t(u)("core.characteristics.delete_dialog.deactivate")), 1)
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
})) : F("", !0)
|
|
183
|
+
])
|
|
184
|
+
], 8, Ye)
|
|
185
|
+
]),
|
|
186
|
+
_: 1
|
|
187
|
+
}, 8, ["title"]),
|
|
188
|
+
B(Pe, {
|
|
189
|
+
ref_key: "confirm",
|
|
190
|
+
ref: V,
|
|
191
|
+
tone: "critical",
|
|
192
|
+
title: t(u)("core.characteristics.delete_dialog.confirm_title"),
|
|
193
|
+
message: t(u)("core.characteristics.delete_dialog.confirm_message", { name: o.value?.item.name ?? "" }),
|
|
194
|
+
"confirm-label": t(u)("core.characteristics.delete_dialog.confirm_action"),
|
|
195
|
+
icon: "deleteBin2Line",
|
|
196
|
+
action: () => N(!0)
|
|
197
|
+
}, null, 8, ["title", "message", "confirm-label", "action"])
|
|
198
|
+
], 64));
|
|
199
|
+
}
|
|
200
|
+
}), M = (c, e) => `${c}:${e}`, ke = (c) => {
|
|
201
|
+
const [e = 0, v = 0] = String(c).split(":").map(Number);
|
|
202
|
+
return { level: e, id: v };
|
|
203
|
+
}, se = (c, e) => (/^(hr|bs|sr)/.test(e) ? c.hr : c.en) || c.hr || c.en;
|
|
204
|
+
function ve(c, e) {
|
|
205
|
+
return c.fields.filter((v) => v.under === null || e.some((m) => m.level === v.under?.level && m.id === v.under.id));
|
|
206
|
+
}
|
|
207
|
+
function rt(c, e) {
|
|
208
|
+
const v = /* @__PURE__ */ new Map();
|
|
209
|
+
for (const l of c) {
|
|
210
|
+
const g = l.level === 1 ? "root" : M(l.level - 1, l.parent_id);
|
|
211
|
+
v.set(g, [...v.get(g) ?? [], l]);
|
|
212
|
+
}
|
|
213
|
+
const m = e.levels.length, u = (l, g) => {
|
|
214
|
+
const _ = e.levels.find((w) => w.level === l.level), V = [...g, l], o = l.level < m ? (v.get(M(l.level, l.id)) ?? []).sort(xe).map((w) => u(w, V)) : void 0;
|
|
215
|
+
return { id: M(l.level, l.id), label: l.name, active: _?.has_active ? l.active : void 0, item: l, level: l.level, ancestors: g, ...o ? { children: o } : {} };
|
|
216
|
+
};
|
|
217
|
+
return (v.get("root") ?? []).sort(xe).map((l) => u(l, []));
|
|
218
|
+
}
|
|
219
|
+
const xe = (c, e) => c.order - e.order || c.id - e.id;
|
|
220
|
+
function it(c, e) {
|
|
221
|
+
const v = /* @__PURE__ */ new Map();
|
|
222
|
+
for (const m of c.levels)
|
|
223
|
+
for (const u of m.fields.filter((l) => l.in_list)) {
|
|
224
|
+
const l = se(u.label, e), g = v.get(`${u.column}|${l}`) ?? { label: l, fields: [] };
|
|
225
|
+
g.fields.push({ level: m, field: u }), v.set(`${u.column}|${l}`, g);
|
|
226
|
+
}
|
|
227
|
+
return [...v.values()].map((m, u) => ({
|
|
228
|
+
fields: m.fields,
|
|
229
|
+
column: {
|
|
230
|
+
key: `field${u}`,
|
|
231
|
+
label: m.label,
|
|
232
|
+
width: 160,
|
|
233
|
+
visible: (l) => m.fields.some(({ level: g, field: _ }) => g.level === l.level && ve(g, [...l.ancestors, l.item]).includes(_))
|
|
234
|
+
}
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
function ct(c, e, v, m, u) {
|
|
238
|
+
if (e == null || e === "") return "";
|
|
239
|
+
if (c.type === "yesno") return e === !0 || e === 1 || e === "1" ? m : u;
|
|
240
|
+
if (c.type === "choice") {
|
|
241
|
+
const l = c.choices.find((g) => g.value === String(e));
|
|
242
|
+
return l ? se(l.label, v) : String(e);
|
|
243
|
+
}
|
|
244
|
+
return String(e);
|
|
245
|
+
}
|
|
246
|
+
const ot = {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: "flex min-w-0 flex-col gap-group-gap",
|
|
249
|
+
"data-test": "characteristic-form"
|
|
250
|
+
}, nt = {
|
|
251
|
+
key: 0,
|
|
252
|
+
class: "text-footnote text-content-muted",
|
|
253
|
+
"data-test": "characteristic-path"
|
|
254
|
+
}, ut = { class: "flex w-full items-center gap-2" }, dt = /* @__PURE__ */ me({
|
|
255
|
+
__name: "ItemSheet",
|
|
256
|
+
props: {
|
|
257
|
+
description: {},
|
|
258
|
+
editable: { type: Boolean },
|
|
259
|
+
createTitle: { type: Function }
|
|
260
|
+
},
|
|
261
|
+
emits: ["saved", "remove"],
|
|
262
|
+
setup(c, { expose: e, emit: v }) {
|
|
263
|
+
const m = c, u = v, { t: l, locale: g } = fe(), _ = pe(), V = re("sheet"), o = z(null);
|
|
264
|
+
Le(Ke, h(() => m.editable));
|
|
265
|
+
const w = h(() => m.description.languages), b = h(() => w.value[0] ?? ""), k = h(() => o.value?.level ?? null), P = h(() => o.value === null ? [] : o.value.mode === "edit" ? o.value.node.ancestors : o.value.parent ? [...o.value.parent.ancestors, o.value.parent.item] : []), I = h(() => k.value ? ve(k.value, P.value) : []), $ = h(() => I.value.filter((r) => !r.read_only)), W = h(() => I.value.filter((r) => r.read_only)), U = h(() => P.value.map((r) => r.name).join(" › ")), N = h(() => o.value === null ? "" : o.value.mode === "edit" ? o.value.node.item.name : m.createTitle(o.value.parent, o.value.level.level)), X = () => l("core.validation_errors.required"), S = {
|
|
266
|
+
safeParse(r) {
|
|
267
|
+
const n = r, a = [], T = k.value;
|
|
268
|
+
if (T === null) return { success: !1, error: { issues: a } };
|
|
269
|
+
if (T.has_translations) {
|
|
270
|
+
(n.names[b.value]?.trim() === "" || n.names[b.value] === void 0) && a.push({ path: ["names"], message: X() });
|
|
271
|
+
for (const C of w.value) (n.names[C] ?? "").trim().length > T.name_max && a.push({ path: ["names"], message: l("core.validation_errors.max", { max: T.name_max }) });
|
|
272
|
+
} else n.name.trim() === "" ? a.push({ path: ["name"], message: X() }) : n.name.trim().length > T.name_max && a.push({ path: ["name"], message: l("core.validation_errors.max", { max: T.name_max }) });
|
|
273
|
+
for (const C of $.value) {
|
|
274
|
+
const Z = n.values[C.column];
|
|
275
|
+
C.type === "text" && C.max > 0 && String(Z ?? "").length > C.max && a.push({ path: ["values", C.column], message: l("core.validation_errors.max", { max: C.max }) });
|
|
276
|
+
}
|
|
277
|
+
return a.length > 0 ? { success: !1, error: { issues: a } } : { success: !0, data: n };
|
|
278
|
+
}
|
|
279
|
+
}, y = (r) => r.type === "yesno" ? !1 : r.type === "number" ? null : "", x = Ne({ defaults: () => ({ name: "", names: {}, active: !0, values: {} }), validator: S });
|
|
280
|
+
function ae(r) {
|
|
281
|
+
o.value = r;
|
|
282
|
+
const n = ve(r.level, r.mode === "edit" ? r.node.ancestors : r.parent ? [...r.parent.ancestors, r.parent.item] : []), a = r.mode === "edit" ? r.node.item : null, T = {};
|
|
283
|
+
for (const C of w.value) T[C] = a?.translations?.[C] ?? (C === b.value ? a?.name ?? "" : "");
|
|
284
|
+
x.hydrate({
|
|
285
|
+
name: a?.name ?? "",
|
|
286
|
+
names: T,
|
|
287
|
+
active: a?.active ?? !0,
|
|
288
|
+
values: Object.fromEntries(n.map((C) => [C.column, a?.values?.[C.column] ?? y(C)]))
|
|
289
|
+
}), V.value?.present();
|
|
290
|
+
}
|
|
291
|
+
async function ce() {
|
|
292
|
+
const r = o.value;
|
|
293
|
+
if (r === null) return;
|
|
294
|
+
const n = await x.submit(async (a, { idempotencyKey: T }) => {
|
|
295
|
+
const C = r.level.has_translations ? (a.names[b.value] ?? "").trim() || (Object.values(a.names).find((L) => L.trim() !== "") ?? "").trim() : a.name.trim(), Z = r.level.has_translations ? Object.fromEntries(w.value.map((L) => [L, (a.names[L] ?? "").trim()])) : void 0, s = Object.fromEntries($.value.map((L) => [L.column, a.values[L.column]])), i = { name: C, ...Z ? { translations: Z } : {}, ...$.value.length > 0 ? { values: s } : {} };
|
|
296
|
+
if (r.mode === "create")
|
|
297
|
+
return { item: await _.create({ ...i, level: r.level.level, ...r.parent ? { parent_id: r.parent.item.id } : {}, active: a.active }, T), created: !0 };
|
|
298
|
+
const { item: d } = r.node;
|
|
299
|
+
let p = await _.update({ ...i, level: d.level, id: d.id }, T);
|
|
300
|
+
return r.level.has_active && a.active !== d.active && (p = await _.setActive(d.level, d.id, a.active)), { item: p, created: !1 };
|
|
301
|
+
});
|
|
302
|
+
(n.status === "saved" || n.status === "saved-refresh-failed") && (ie.success(l(n.value.created ? "core.characteristics.toasts.created" : "core.characteristics.toasts.saved")), u("saved", n.value.item, n.value.created), V.value?.dismiss());
|
|
303
|
+
}
|
|
304
|
+
const Y = (r) => ({
|
|
305
|
+
modelValue: x.values.values[r.column],
|
|
306
|
+
"onUpdate:modelValue": (n) => x.values.values[r.column] = n,
|
|
307
|
+
error: x.errors.first(`values.${r.column}`)
|
|
308
|
+
}), le = (r) => r.choices.map((n) => ({ value: n.value, label: se(n.label, g.value) })), G = (r) => se(r.label, g.value);
|
|
309
|
+
return e({
|
|
310
|
+
/** A new item below `parent` (null: a root of level 1). */
|
|
311
|
+
create: (r) => {
|
|
312
|
+
const n = m.description.levels.find((a) => a.level === (r ? r.level + 1 : 1));
|
|
313
|
+
n && ae({ mode: "create", level: n, parent: r });
|
|
314
|
+
},
|
|
315
|
+
edit: (r) => {
|
|
316
|
+
const n = m.description.levels.find((a) => a.level === r.level);
|
|
317
|
+
n && ae({ mode: "edit", node: r, level: n });
|
|
318
|
+
}
|
|
319
|
+
}), (r, n) => (f(), E(He, {
|
|
320
|
+
ref_key: "sheet",
|
|
321
|
+
ref: V,
|
|
322
|
+
size: "md",
|
|
323
|
+
grouped: "",
|
|
324
|
+
title: N.value,
|
|
325
|
+
onDismissed: n[3] || (n[3] = (a) => o.value = null)
|
|
326
|
+
}, {
|
|
327
|
+
footer: A(() => [
|
|
328
|
+
H("div", ut, [
|
|
329
|
+
m.editable && o.value?.mode === "edit" ? (f(), E(te, {
|
|
330
|
+
key: 0,
|
|
331
|
+
prominence: "plain",
|
|
332
|
+
tone: "critical",
|
|
333
|
+
icon: "deleteBin2Line",
|
|
334
|
+
"data-test": "characteristic-delete",
|
|
335
|
+
onClick: n[0] || (n[0] = (a) => o.value?.mode === "edit" && u("remove", o.value.node))
|
|
336
|
+
}, {
|
|
337
|
+
default: A(() => [
|
|
338
|
+
j(q(t(l)("core.characteristics.delete")), 1)
|
|
339
|
+
]),
|
|
340
|
+
_: 1
|
|
341
|
+
})) : F("", !0),
|
|
342
|
+
n[4] || (n[4] = H("span", { class: "flex-1" }, null, -1)),
|
|
343
|
+
B(te, {
|
|
344
|
+
prominence: "plain",
|
|
345
|
+
onClick: n[1] || (n[1] = (a) => V.value?.dismiss())
|
|
346
|
+
}, {
|
|
347
|
+
default: A(() => [
|
|
348
|
+
j(q(m.editable ? t(l)("core.actions.cancel") : t(l)("core.actions.close")), 1)
|
|
349
|
+
]),
|
|
350
|
+
_: 1
|
|
351
|
+
}),
|
|
352
|
+
m.editable ? (f(), E(te, {
|
|
353
|
+
key: 1,
|
|
354
|
+
prominence: "primary",
|
|
355
|
+
icon: "save",
|
|
356
|
+
processing: t(x).submitting.value,
|
|
357
|
+
"data-test": "characteristic-save",
|
|
358
|
+
onClick: n[2] || (n[2] = (a) => ce())
|
|
359
|
+
}, {
|
|
360
|
+
default: A(() => [
|
|
361
|
+
j(q(o.value?.mode === "create" ? t(l)("core.characteristics.sheet.create") : t(l)("core.characteristics.sheet.save")), 1)
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
}, 8, ["processing"])) : F("", !0)
|
|
365
|
+
])
|
|
366
|
+
]),
|
|
367
|
+
default: A(() => [
|
|
368
|
+
o.value && k.value ? (f(), R("div", ot, [
|
|
369
|
+
U.value ? (f(), R("p", nt, q(U.value), 1)) : F("", !0),
|
|
370
|
+
B(t(Ue), {
|
|
371
|
+
form: t(x),
|
|
372
|
+
label: (a) => a
|
|
373
|
+
}, null, 8, ["form", "label"]),
|
|
374
|
+
B(t(ye), null, {
|
|
375
|
+
default: A(() => [
|
|
376
|
+
k.value.has_translations ? (f(), E(t($e), Q({ key: 0 }, t(x).bind("names"), {
|
|
377
|
+
label: t(l)("core.characteristics.sheet.name"),
|
|
378
|
+
locales: w.value,
|
|
379
|
+
"default-locale": b.value,
|
|
380
|
+
"required-locales": [b.value],
|
|
381
|
+
"max-length": k.value.name_max,
|
|
382
|
+
required: ""
|
|
383
|
+
}), null, 16, ["label", "locales", "default-locale", "required-locales", "max-length"])) : (f(), E(t(ue), Q({ key: 1 }, t(x).bind("name"), {
|
|
384
|
+
label: t(l)("core.characteristics.sheet.name"),
|
|
385
|
+
"max-length": k.value.name_max,
|
|
386
|
+
required: ""
|
|
387
|
+
}), null, 16, ["label", "max-length"])),
|
|
388
|
+
k.value.has_active ? (f(), E(t(ge), Q({ key: 2 }, t(x).bind("active"), {
|
|
389
|
+
label: t(l)("core.characteristics.sheet.active")
|
|
390
|
+
}), null, 16, ["label"])) : F("", !0)
|
|
391
|
+
]),
|
|
392
|
+
_: 1
|
|
393
|
+
}),
|
|
394
|
+
I.value.length > 0 ? (f(), E(t(ye), {
|
|
395
|
+
key: 1,
|
|
396
|
+
header: t(l)("core.characteristics.sheet.extra"),
|
|
397
|
+
"locked-footer": t(l)("core.characteristics.sheet.locked")
|
|
398
|
+
}, {
|
|
399
|
+
default: A(() => [
|
|
400
|
+
(f(!0), R(ee, null, ne(I.value, (a) => (f(), R(ee, {
|
|
401
|
+
key: a.column
|
|
402
|
+
}, [
|
|
403
|
+
a.type === "yesno" ? (f(), E(t(ge), Q({
|
|
404
|
+
key: 0,
|
|
405
|
+
ref_for: !0
|
|
406
|
+
}, Y(a), {
|
|
407
|
+
label: G(a),
|
|
408
|
+
disabled: a.read_only,
|
|
409
|
+
"data-field-key": `values.${a.column}`
|
|
410
|
+
}), null, 16, ["label", "disabled", "data-field-key"])) : a.type === "number" ? (f(), E(t(Me), Q({
|
|
411
|
+
key: 1,
|
|
412
|
+
ref_for: !0
|
|
413
|
+
}, Y(a), {
|
|
414
|
+
label: G(a),
|
|
415
|
+
disabled: a.read_only,
|
|
416
|
+
"data-field-key": `values.${a.column}`
|
|
417
|
+
}), null, 16, ["label", "disabled", "data-field-key"])) : a.type === "choice" ? (f(), E(t(ze), Q({
|
|
418
|
+
key: 2,
|
|
419
|
+
ref_for: !0
|
|
420
|
+
}, Y(a), {
|
|
421
|
+
options: le(a),
|
|
422
|
+
label: G(a),
|
|
423
|
+
disabled: a.read_only,
|
|
424
|
+
clearable: "",
|
|
425
|
+
"data-field-key": `values.${a.column}`
|
|
426
|
+
}), null, 16, ["options", "label", "disabled", "data-field-key"])) : (f(), E(t(ue), Q({
|
|
427
|
+
key: 3,
|
|
428
|
+
ref_for: !0
|
|
429
|
+
}, Y(a), {
|
|
430
|
+
label: G(a),
|
|
431
|
+
"max-length": a.max > 0 ? a.max : void 0,
|
|
432
|
+
disabled: a.read_only,
|
|
433
|
+
"data-field-key": `values.${a.column}`
|
|
434
|
+
}), null, 16, ["label", "max-length", "disabled", "data-field-key"]))
|
|
435
|
+
], 64))), 128))
|
|
436
|
+
]),
|
|
437
|
+
_: 1
|
|
438
|
+
}, 8, ["header", "locked-footer"])) : F("", !0),
|
|
439
|
+
(f(!0), R(ee, null, ne(W.value, (a) => (f(), E(de, {
|
|
440
|
+
key: a.column,
|
|
441
|
+
tone: "info",
|
|
442
|
+
"data-test": "characteristic-locked-note"
|
|
443
|
+
}, {
|
|
444
|
+
default: A(() => [
|
|
445
|
+
j(q(t(l)("core.characteristics.sheet.note", { field: G(a), path: U.value || t(se)(k.value.label, t(g)) })), 1)
|
|
446
|
+
]),
|
|
447
|
+
_: 2
|
|
448
|
+
}, 1024))), 128))
|
|
449
|
+
])) : F("", !0)
|
|
450
|
+
]),
|
|
451
|
+
_: 1
|
|
452
|
+
}, 8, ["title"]));
|
|
453
|
+
}
|
|
454
|
+
}), vt = {
|
|
455
|
+
class: "flex min-w-0 flex-col gap-group-gap",
|
|
456
|
+
"data-test": "characteristics"
|
|
457
|
+
}, mt = { class: "flex flex-wrap items-center gap-3" }, ft = { class: "truncate font-mono text-footnote text-content-muted" }, pt = {
|
|
458
|
+
class: "px-1 text-footnote text-content-muted",
|
|
459
|
+
"data-test": "characteristics-footer"
|
|
460
|
+
}, Kt = /* @__PURE__ */ me({
|
|
461
|
+
__name: "CharacteristicsPage",
|
|
462
|
+
setup(c) {
|
|
463
|
+
const { t: e, locale: v } = fe(), m = Ve(), u = pe(), l = Ge(), g = we(), _ = h(() => m.can(Qe)), V = je(async ({ signal: s }) => {
|
|
464
|
+
const [i, d] = await Promise.all([u.description({ signal: s }), u.tree({ signal: s })]);
|
|
465
|
+
return { description: i, items: d };
|
|
466
|
+
}), o = z("all"), w = z(""), b = z([]), k = re("sheet"), P = re("removal"), I = h(() => V.data.value?.items ?? []), $ = h(() => V.data.value?.description ?? null), W = h(() => $.value ? rt(I.value, $.value) : []), U = h(() => $.value ? it($.value, v.value) : []), N = (s) => $.value?.levels.find((i) => i.level === s), X = h(() => $.value?.levels.some((s) => s.has_active) ?? !1), S = h(() => _.value && ($.value?.levels.some((s) => s.has_order) ?? !1)), y = (s) => $.value && V.update({ description: $.value, items: s(I.value) }), x = (s) => y((i) => i.some((d) => d.level === s.level && d.id === s.id) ? i.map((d) => d.level === s.level && d.id === s.id ? s : d) : [...i, s]), ae = (s) => {
|
|
467
|
+
ie.error(g(s, { fallback: e("core.resource.unavailable") })), V.reload();
|
|
468
|
+
}, ce = h(() => [
|
|
469
|
+
{ value: "all", label: e("core.characteristics.views.all") },
|
|
470
|
+
{ value: "active", label: e("core.characteristics.views.active") },
|
|
471
|
+
{ value: "inactive", label: e("core.characteristics.views.inactive") }
|
|
472
|
+
]), Y = h(() => o.value === "all" ? void 0 : (s) => (s.active ?? !0) === (o.value === "active"));
|
|
473
|
+
async function le(s, i) {
|
|
474
|
+
const d = s.item;
|
|
475
|
+
x({ ...d, active: i });
|
|
476
|
+
try {
|
|
477
|
+
x(await u.setActive(d.level, d.id, i)), ie.success(e(i ? "core.characteristics.toasts.activated" : "core.characteristics.toasts.deactivated"));
|
|
478
|
+
} catch (p) {
|
|
479
|
+
ae(p);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
async function G({ id: s, parentId: i, index: d }) {
|
|
483
|
+
const p = ke(s), L = i === null ? null : ke(i), J = I.value.filter((D) => D.level === p.level && (L === null || D.parent_id === L.id)).sort((D, O) => D.order - O.order || D.id - O.id), he = J.findIndex((D) => D.id === p.id);
|
|
484
|
+
if (he < 0) return;
|
|
485
|
+
const oe = [...J];
|
|
486
|
+
oe.splice(d, 0, ...oe.splice(he, 1));
|
|
487
|
+
const _e = new Map(oe.map((D, O) => [M(D.level, D.id), O + 1]));
|
|
488
|
+
y((D) => D.map((O) => _e.has(M(O.level, O.id)) ? { ...O, order: _e.get(M(O.level, O.id)) ?? O.order } : O));
|
|
489
|
+
try {
|
|
490
|
+
await u.move(p.level, p.id, d + 1);
|
|
491
|
+
} catch (D) {
|
|
492
|
+
ae(D);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function r(s, i) {
|
|
496
|
+
x(s), i && s.level > 1 && (b.value = [.../* @__PURE__ */ new Set([...b.value, M(s.level - 1, s.parent_id)])]);
|
|
497
|
+
}
|
|
498
|
+
function n(s) {
|
|
499
|
+
const i = /* @__PURE__ */ new Set(), d = (p) => {
|
|
500
|
+
i.add(p.id), p.children?.forEach(d);
|
|
501
|
+
};
|
|
502
|
+
d(s), y((p) => p.filter((L) => !i.has(M(L.level, L.id))));
|
|
503
|
+
}
|
|
504
|
+
const a = (s, i) => l.addLabel?.(s ? { level: s.level, name: s.item.name } : null, i) ?? e(i === 1 ? "core.characteristics.add_group" : "core.characteristics.add_item"), T = (s, i) => _.value && N(i) ? a(s, i) : null, C = (s) => _.value ? [
|
|
505
|
+
{ key: "edit", label: e("core.characteristics.edit"), icon: "edit", onSelect: () => k.value?.edit(s) },
|
|
506
|
+
...N(s.level)?.has_active ? [{ key: "active", label: e(s.item.active ? "core.characteristics.deactivate" : "core.characteristics.activate"), icon: s.item.active ? "eyeOff" : "eye", onSelect: () => void le(s, !s.item.active) }] : [],
|
|
507
|
+
{ key: "delete", label: e("core.characteristics.delete"), icon: "deleteBin2Line", tone: "critical", onSelect: () => P.value?.show(s) }
|
|
508
|
+
] : [{ key: "open", label: e("core.actions.open"), icon: "eye", onSelect: () => k.value?.edit(s) }], Z = h(() => _.value && N(1) ? [{ id: "add", label: a(null, 1), icon: "addLine", placement: "primary", onClick: () => k.value?.create(null) }] : []);
|
|
509
|
+
return (s, i) => (f(), E(t(Ie), {
|
|
510
|
+
title: t(e)("core.characteristics.title"),
|
|
511
|
+
description: t(e)("core.characteristics.description"),
|
|
512
|
+
actions: Z.value
|
|
513
|
+
}, {
|
|
514
|
+
default: A(() => [
|
|
515
|
+
H("div", vt, [
|
|
516
|
+
B(t(Oe), {
|
|
517
|
+
state: t(V).state.value,
|
|
518
|
+
"skeleton-rows": 5,
|
|
519
|
+
"is-empty": (d) => d.items.length === 0,
|
|
520
|
+
"empty-title": t(e)("core.characteristics.empty"),
|
|
521
|
+
onRetry: i[5] || (i[5] = (d) => t(V).reload())
|
|
522
|
+
}, {
|
|
523
|
+
default: A(({ value: d }) => [
|
|
524
|
+
H("div", mt, [
|
|
525
|
+
B(t(ue), {
|
|
526
|
+
modelValue: w.value,
|
|
527
|
+
"onUpdate:modelValue": i[0] || (i[0] = (p) => w.value = p),
|
|
528
|
+
class: "min-w-[14rem] max-w-md flex-1",
|
|
529
|
+
label: t(e)("core.characteristics.search"),
|
|
530
|
+
"label-hidden": "",
|
|
531
|
+
placeholder: t(e)("core.characteristics.search")
|
|
532
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
533
|
+
B(t(Fe), {
|
|
534
|
+
modelValue: o.value,
|
|
535
|
+
"onUpdate:modelValue": i[1] || (i[1] = (p) => o.value = p),
|
|
536
|
+
tabs: ce.value,
|
|
537
|
+
presentation: "scope",
|
|
538
|
+
label: t(e)("core.characteristics.title")
|
|
539
|
+
}, null, 8, ["modelValue", "tabs", "label"]),
|
|
540
|
+
_.value ? F("", !0) : (f(), E(t(Re), {
|
|
541
|
+
key: 0,
|
|
542
|
+
tone: "neutral",
|
|
543
|
+
class: "ml-auto",
|
|
544
|
+
"data-test": "characteristics-read-only"
|
|
545
|
+
}, {
|
|
546
|
+
default: A(() => [
|
|
547
|
+
j(q(t(e)("core.characteristics.read_only")), 1)
|
|
548
|
+
]),
|
|
549
|
+
_: 1
|
|
550
|
+
}))
|
|
551
|
+
]),
|
|
552
|
+
B(t(De), {
|
|
553
|
+
expanded: b.value,
|
|
554
|
+
"onUpdate:expanded": i[2] || (i[2] = (p) => b.value = p),
|
|
555
|
+
nodes: W.value,
|
|
556
|
+
columns: U.value.map((p) => p.column),
|
|
557
|
+
label: t(e)("core.characteristics.title"),
|
|
558
|
+
reorderable: S.value,
|
|
559
|
+
readonly: !_.value,
|
|
560
|
+
"active-label": X.value ? t(e)("core.characteristics.active") : void 0,
|
|
561
|
+
search: w.value,
|
|
562
|
+
filter: Y.value,
|
|
563
|
+
"add-label": T,
|
|
564
|
+
"row-actions": C,
|
|
565
|
+
onReorder: G,
|
|
566
|
+
onToggle: le,
|
|
567
|
+
onAdd: i[3] || (i[3] = (p) => k.value?.create(p)),
|
|
568
|
+
onOpen: i[4] || (i[4] = (p) => k.value?.edit(p))
|
|
569
|
+
}, Te({ _: 2 }, [
|
|
570
|
+
ne(U.value, (p) => ({
|
|
571
|
+
name: `cell-${p.column.key}`,
|
|
572
|
+
fn: A(({ node: L }) => [
|
|
573
|
+
H("code", ft, q(p.fields.map(({ field: J }) => t(ct)(J, L.item.values?.[J.column], t(v), t(e)("core.form.yes"), t(e)("core.form.no"))).find((J) => J !== "") ?? ""), 1)
|
|
574
|
+
])
|
|
575
|
+
}))
|
|
576
|
+
]), 1032, ["expanded", "nodes", "columns", "label", "reorderable", "readonly", "active-label", "search", "filter"]),
|
|
577
|
+
H("p", pt, [
|
|
578
|
+
j(q(t(e)("core.characteristics.levels", d.description.levels.length)), 1),
|
|
579
|
+
S.value ? (f(), R(ee, { key: 0 }, [
|
|
580
|
+
j(" · " + q(t(e)("core.characteristics.reorder_hint")), 1)
|
|
581
|
+
], 64)) : F("", !0)
|
|
582
|
+
])
|
|
583
|
+
]),
|
|
584
|
+
_: 1
|
|
585
|
+
}, 8, ["state", "is-empty", "empty-title"])
|
|
586
|
+
]),
|
|
587
|
+
$.value ? (f(), E(dt, {
|
|
588
|
+
key: 0,
|
|
589
|
+
ref_key: "sheet",
|
|
590
|
+
ref: k,
|
|
591
|
+
description: $.value,
|
|
592
|
+
editable: _.value,
|
|
593
|
+
"create-title": a,
|
|
594
|
+
onSaved: r,
|
|
595
|
+
onRemove: i[6] || (i[6] = (d) => P.value?.show(d))
|
|
596
|
+
}, null, 8, ["description", "editable"])) : F("", !0),
|
|
597
|
+
_.value && $.value ? (f(), E(st, {
|
|
598
|
+
key: 1,
|
|
599
|
+
ref_key: "removal",
|
|
600
|
+
ref: P,
|
|
601
|
+
"can-deactivate": (d) => N(d.level)?.has_active ?? !1,
|
|
602
|
+
onDeleted: n,
|
|
603
|
+
onDeactivate: i[7] || (i[7] = (d) => le(d, !1))
|
|
604
|
+
}, null, 8, ["can-deactivate"])) : F("", !0)
|
|
605
|
+
]),
|
|
606
|
+
_: 1
|
|
607
|
+
}, 8, ["title", "description", "actions"]));
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
export {
|
|
611
|
+
Kt as CharacteristicsPage,
|
|
612
|
+
Ut as characteristicsFeature,
|
|
613
|
+
be as characteristicsPages,
|
|
614
|
+
K as characteristicsRoutes,
|
|
615
|
+
Xe as createCharacteristicsApi,
|
|
616
|
+
pe as useCharacteristicsApi
|
|
617
|
+
};
|