@wssto2/vue-core 0.20.0 → 0.22.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.
Files changed (138) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +2 -1
  3. package/dist/{AccountMenuItem.vue_vue_type_script_setup_true_lang-rmH1XbU9.js → AccountMenuItem.vue_vue_type_script_setup_true_lang-C2TmmH38.js} +1 -1
  4. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-_TDoIg53.js → ActionRow.vue_vue_type_script_setup_true_lang-BEV0drwF.js} +2 -2
  5. package/dist/{Activity-BDVYmNgy.js → Activity-COtW_n6d.js} +8 -8
  6. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-DryXyklZ.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-BkZzuICH.js} +3 -3
  7. package/dist/{AlertDialog.vue_vue_type_script_setup_true_lang-QYvbly_-.js → AlertDialog.vue_vue_type_script_setup_true_lang-B0UvzCoE.js} +1 -1
  8. package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-DRP4BnMb.js → AsyncSection.vue_vue_type_script_setup_true_lang-DuPS_zMX.js} +4 -4
  9. package/dist/{Banner.vue_vue_type_script_setup_true_lang-ukLpznql.js → Banner.vue_vue_type_script_setup_true_lang-BXZVOhfH.js} +1 -1
  10. package/dist/{Button.vue_vue_type_script_setup_true_lang-DkRuLqQK.js → Button.vue_vue_type_script_setup_true_lang-CZkTqGtE.js} +1 -1
  11. package/dist/{Changes-DRij0rEQ.js → Changes-DGjV18aQ.js} +4 -4
  12. package/dist/CharacteristicsPage-fGnahf62.js +4 -0
  13. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Aoof1prZ.js → CollectionPage.vue_vue_type_script_setup_true_lang-Bf5WXVFZ.js} +11 -11
  14. package/dist/CollectionTree.vue_vue_type_script_setup_true_lang-DV0OhquO.js +345 -0
  15. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DGcNcRkO.js → DataTable.vue_vue_type_script_setup_true_lang-Cw_E8w48.js} +1 -1
  16. package/dist/{DateField.vue_vue_type_script_setup_true_lang-J04KjxmR.js → DateField.vue_vue_type_script_setup_true_lang-Cn8CNAwM.js} +4 -4
  17. package/dist/{DeadLetters-Dpm4UY__.js → DeadLetters--js7aeC6.js} +3 -3
  18. package/dist/{DiscardChangesModal.vue_vue_type_script_setup_true_lang-CxNVKoYI.js → DiscardChangesModal.vue_vue_type_script_setup_true_lang-lnFUie1d.js} +1 -1
  19. package/dist/{EmptyState.vue_vue_type_script_setup_true_lang-ByKvrNSg.js → EmptyState.vue_vue_type_script_setup_true_lang-DHmu-UG-.js} +1 -1
  20. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-7bIssY9f.js → FormGroup.vue_vue_type_script_setup_true_lang-BUhKKybf.js} +3 -3
  21. package/dist/{FormRow.vue_vue_type_script_setup_true_lang-okuxbKyI.js → FormRow.vue_vue_type_script_setup_true_lang-B-uth5RB.js} +1 -1
  22. package/dist/{FormView.vue_vue_type_script_setup_true_lang-CiYprNRr.js → FormView.vue_vue_type_script_setup_true_lang-CoQZG-hB.js} +2 -2
  23. package/dist/{General-BmVEbYqv.js → General-xayJ3Y-j.js} +7 -7
  24. package/dist/{HeaderAction.vue_vue_type_script_setup_true_lang-DVfkuOy-.js → HeaderAction.vue_vue_type_script_setup_true_lang-Uw0vwV-o.js} +2 -2
  25. package/dist/{Icon.vue_vue_type_script_lang-0pW1XBaE.js → Icon.vue_vue_type_script_lang-BIzh8LF1.js} +41 -37
  26. package/dist/{IconTile.vue_vue_type_script_setup_true_lang-BWHQiA7d.js → IconTile.vue_vue_type_script_setup_true_lang-DRirnJvd.js} +1 -1
  27. package/dist/{IncidentRecord-DWY6Bws1.js → IncidentRecord-BETFfXbI.js} +15 -15
  28. package/dist/{IncidentsList-C21UNIhT.js → IncidentsList-BIr3a2To.js} +5 -5
  29. package/dist/{LeaveGuardRoot.vue_vue_type_script_setup_true_lang-CpEd_Psg.js → LeaveGuardRoot.vue_vue_type_script_setup_true_lang-DjXYh-p0.js} +1 -1
  30. package/dist/{Menu.vue_vue_type_script_setup_true_lang-DobycRxf.js → Menu.vue_vue_type_script_setup_true_lang-D2FsOVYA.js} +1 -1
  31. package/dist/{MenuButton.vue_vue_type_script_setup_true_lang-qDKt6gX9.js → MenuButton.vue_vue_type_script_setup_true_lang-BNzrYIzR.js} +1 -1
  32. package/dist/{Modal.vue_vue_type_script_setup_true_lang-C0tQAYQ4.js → Modal.vue_vue_type_script_setup_true_lang-BRRMKXOV.js} +2 -2
  33. package/dist/{NewRolePage-K5zts3e_.js → NewRolePage-B2qo3_Ht.js} +4 -4
  34. package/dist/{NoAccess.vue_vue_type_script_setup_true_lang-BYnTQCtW.js → NoAccess.vue_vue_type_script_setup_true_lang-CnfE_AEl.js} +1 -1
  35. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-CxgVJrdv.js → NumberField.vue_vue_type_script_setup_true_lang-BDZ_0TH7.js} +2 -2
  36. package/dist/{Panel.vue_vue_type_script_setup_true_lang-DTCmFSwg.js → Panel.vue_vue_type_script_setup_true_lang-CwcJadT7.js} +1 -1
  37. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-Kp9g93wE.js → PersonAccess.vue_vue_type_script_setup_true_lang-DrD0Y-Zm.js} +11 -11
  38. package/dist/{PhotoViewer.vue_vue_type_script_setup_true_lang-D2-uQbSV.js → PhotoViewer.vue_vue_type_script_setup_true_lang-BL485L63.js} +1 -1
  39. package/dist/{ProfilePage-C3mLBer6.js → ProfilePage-KK6lV4Yd.js} +15 -15
  40. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-Dz5Qw8II.js → RecordHeader.vue_vue_type_script_setup_true_lang-D4PcZnbo.js} +2 -2
  41. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-R3eJKPq5.js → ResourcePage.vue_vue_type_script_setup_true_lang-CpGwm2tv.js} +4 -4
  42. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CGMpBpnK.js → RoleEditor.vue_vue_type_script_setup_true_lang-DbyVIoj9.js} +12 -12
  43. package/dist/{RolePage-C62_sGxx.js → RolePage-QLKrhjd_.js} +12 -12
  44. package/dist/{RolesPage-CS8ryIQq.js → RolesPage-UHWfuxiU.js} +8 -8
  45. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-C6eOVjpa.js → SectionList.vue_vue_type_script_setup_true_lang-BdJ11lZo.js} +2 -2
  46. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-DqDcFvS0.js → SectionNavigator.vue_vue_type_script_setup_true_lang-CnzECivO.js} +4 -4
  47. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-Du4YUcw9.js → SegmentedField.vue_vue_type_script_setup_true_lang-D3IZil4q.js} +2 -2
  48. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-BA5YMCXA.js → SelectField.vue_vue_type_script_setup_true_lang-DxCEwED6.js} +6 -6
  49. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-BoeV2_MN.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-qKkn3XrU.js} +7 -7
  50. package/dist/{ServiceAccountRecord-BDkaaOte.js → ServiceAccountRecord-04tOH3XA.js} +17 -17
  51. package/dist/{ServiceAccountsList-KaZwNlK5.js → ServiceAccountsList-CDtwLH3o.js} +9 -9
  52. package/dist/{Sessions-DhOpUlRc.js → Sessions-BClXu0cg.js} +5 -5
  53. package/dist/{SettingsPage-DPzg7zwX.js → SettingsPage-4Dolsr0t.js} +17 -17
  54. package/dist/{Sheet.vue_vue_type_script_setup_true_lang-C1jpmLYN.js → Sheet.vue_vue_type_script_setup_true_lang-BVU5yzXe.js} +1 -1
  55. package/dist/{SignIn-4aUxE2LU.js → SignIn-BVQtcHZv.js} +6 -6
  56. package/dist/{SignInPage-B80pQ8tG.js → SignInPage-2ocu1_7y.js} +5 -5
  57. package/dist/{SignIns-CLX8Puf1.js → SignIns-CdUgFZ1e.js} +4 -4
  58. package/dist/SortableList.vue_vue_type_script_setup_true_lang-D2-5Z_jO.js +112 -0
  59. package/dist/{StatusLine.vue_vue_type_script_setup_true_lang-BN8nG1CW.js → StatusLine.vue_vue_type_script_setup_true_lang-DBkQueB0.js} +1 -1
  60. package/dist/{SwipeActions.vue_vue_type_script_setup_true_lang-BBqcW3MR.js → SwipeActions.vue_vue_type_script_setup_true_lang-DUjUWq3G.js} +1 -1
  61. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-Dw7BbBU4.js → SwitchField.vue_vue_type_script_setup_true_lang-CTMjlNid.js} +2 -2
  62. package/dist/{Tabs.vue_vue_type_script_setup_true_lang-Cma_ma6V.js → Tabs.vue_vue_type_script_setup_true_lang-7CJto6Mp.js} +1 -1
  63. package/dist/{TextField.vue_vue_type_script_setup_true_lang-DS6RPR-h.js → TextField.vue_vue_type_script_setup_true_lang-B6Q65aQA.js} +4 -4
  64. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-BqpZt1Hv.js → TextareaField.vue_vue_type_script_setup_true_lang-Cj0LKDdo.js} +2 -2
  65. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-BeS1cfqL.js → TimeField.vue_vue_type_script_setup_true_lang-TSnnjMn1.js} +4 -4
  66. package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-XbbupD9A.js → Timestamp.vue_vue_type_script_setup_true_lang-0WL7PP0j.js} +1 -1
  67. package/dist/{UserRecord-BFqw2Pi8.js → UserRecord-Ces8OW7J.js} +7 -7
  68. package/dist/{UsersList-C52C1lN1.js → UsersList-Ad4zHRYa.js} +2 -2
  69. package/dist/{ViewTabs.vue_vue_type_script_setup_true_lang-CBYrLPL4.js → ViewTabs.vue_vue_type_script_setup_true_lang-BKI5DGuS.js} +1 -1
  70. package/dist/access/index.js +7 -7
  71. package/dist/app/index.js +1 -1
  72. package/dist/{application-cTqMhmFf.js → application-C5fZyCB9.js} +4 -4
  73. package/dist/button/index.js +1 -1
  74. package/dist/characteristics/CharacteristicsPage.vue.d.ts +2 -0
  75. package/dist/characteristics/DeleteDialog.vue.d.ts +22 -0
  76. package/dist/characteristics/ItemSheet.vue.d.ts +25 -0
  77. package/dist/characteristics/access.d.ts +3 -0
  78. package/dist/characteristics/api.d.ts +23 -0
  79. package/dist/characteristics/context.d.ts +12 -0
  80. package/dist/characteristics/feature.d.ts +27 -0
  81. package/dist/characteristics/index.d.ts +10 -0
  82. package/dist/characteristics/index.js +617 -0
  83. package/dist/characteristics/model.d.ts +34 -0
  84. package/dist/characteristics/routes.d.ts +13 -0
  85. package/dist/collection/CollectionTree.vue.d.ts +51 -0
  86. package/dist/collection/CollectionTreeBranch.vue.d.ts +12 -0
  87. package/dist/collection/FileExplorer.vue.d.ts +53 -0
  88. package/dist/collection/RowMore.vue.d.ts +11 -0
  89. package/dist/collection/explorer.d.ts +11 -0
  90. package/dist/collection/index.d.ts +5 -0
  91. package/dist/collection/index.js +431 -158
  92. package/dist/collection/tree.d.ts +64 -0
  93. package/dist/content/index.js +4 -4
  94. package/dist/controls/SortableList.vue.d.ts +1 -0
  95. package/dist/controls/index.js +35 -132
  96. package/dist/form/CharacteristicField.vue.d.ts +36 -0
  97. package/dist/form/dynamic/schema.d.ts +4 -0
  98. package/dist/form/index.d.ts +1 -0
  99. package/dist/form/index.js +1774 -1930
  100. package/dist/i18n/index.js +39 -39
  101. package/dist/icon/core.d.ts +4 -0
  102. package/dist/icon/index.js +1 -1
  103. package/dist/identity/index.js +2 -2
  104. package/dist/incidents/index.js +1 -1
  105. package/dist/{index-DLkQwWt9.js → index-4wyfEeIw.js} +8 -8
  106. package/dist/{index-CMx77x5P.js → index-DlD5ZlZq.js} +24 -24
  107. package/dist/{index-CxUfs3Xz.js → index-OVbtHAtG.js} +9 -9
  108. package/dist/index.d.ts +1 -1
  109. package/dist/index.js +1 -1
  110. package/dist/modal/index.js +5 -5
  111. package/dist/modules/characteristics/entities.d.ts +67 -0
  112. package/dist/modules/characteristics/routes.d.ts +55 -0
  113. package/dist/modules/characteristics/schemas.d.ts +50 -0
  114. package/dist/modules/identity/entities.d.ts +1 -0
  115. package/dist/notifications/index.js +1 -1
  116. package/dist/onboarding/index.js +1 -1
  117. package/dist/{options-DIp_lVAj.js → options-DDCG86OV.js} +2 -2
  118. package/dist/overlay/index.js +4 -4
  119. package/dist/page/index.js +7 -7
  120. package/dist/phone/index.js +3 -3
  121. package/dist/pwa/index.js +3 -3
  122. package/dist/resource/index.js +1 -1
  123. package/dist/{resources-BAxfEEv1.js → resources-DkI60fHL.js} +1 -1
  124. package/dist/router/index.js +1 -1
  125. package/dist/routes-DC8BWFz8.js +251 -0
  126. package/dist/{rowLayout-3W9TvFNt.js → rowLayout-zd3Yw6fO.js} +34 -33
  127. package/dist/shell/index.js +8 -8
  128. package/dist/state/index.js +8 -8
  129. package/dist/styles.css +1 -1
  130. package/dist/{suggestions-D0-qmRFy.js → suggestions-DZ3B5RVH.js} +1 -1
  131. package/dist/testing/index.js +1 -1
  132. package/dist/{useCommand-D6K6o6dx.js → useCommand-DerEnzIW.js} +4 -4
  133. package/dist/{useGroupSheet-Daxi2mzi.js → useGroupSheet-B9TCHIKH.js} +5 -5
  134. package/dist/{useRecordDialog-CfBp0kuP.js → useRecordDialog-DX97ivZD.js} +1 -1
  135. package/dist/{useResourceForm-Ddxk7mc0.js → useResourceForm-D8T1snBQ.js} +1 -1
  136. package/dist/{useTypedEntry-r4AqWlV7.js → useTypedEntry-CTkgM29Y.js} +2 -2
  137. package/package.json +8 -3
  138. package/src/styles/base.css +6 -0
@@ -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
+ };
@@ -0,0 +1,34 @@
1
+ import type { TreeColumn, TreeNode } from "../collection";
2
+ import type { DescriptionResponse, FieldResponse, ItemResponse, LabelResponse, LevelResponse } from "../modules/characteristics/entities";
3
+ /** One item of the tree as the screen draws it. `id` is `"<level>:<id>"`: ids repeat from one level's table to the next. */
4
+ export interface CharacteristicNode extends TreeNode<CharacteristicNode> {
5
+ readonly item: ItemResponse;
6
+ readonly level: number;
7
+ /** The items from the root down to this one's parent. */
8
+ readonly ancestors: readonly ItemResponse[];
9
+ readonly children?: readonly CharacteristicNode[];
10
+ }
11
+ export declare const keyOf: (level: number, id: number) => string;
12
+ export declare const parseKey: (key: string | number) => {
13
+ level: number;
14
+ id: number;
15
+ };
16
+ /** A label in the administration's language: Croatian for the Croatian-family locales, English otherwise. */
17
+ export declare const labelIn: (label: LabelResponse, locale: string) => string;
18
+ /** The fields of `level` that apply to an item below `path` (the item's ancestors, and the item itself once it exists): a field with `under` is for one branch only. */
19
+ export declare function fieldsFor(level: LevelResponse, path: readonly {
20
+ level: number;
21
+ id: number;
22
+ }[]): readonly FieldResponse[];
23
+ /** The tree of the flat, depth-first list the server sends: siblings by `order`, the described levels' extras on `item`. */
24
+ export declare function buildTree(items: readonly ItemResponse[], description: DescriptionResponse): CharacteristicNode[];
25
+ /** The columns of the list: every `in_list` field of every level, a column once however many branches describe it. */
26
+ export declare function listColumns(description: DescriptionResponse, locale: string): {
27
+ column: TreeColumn<CharacteristicNode>;
28
+ fields: readonly {
29
+ level: LevelResponse;
30
+ field: FieldResponse;
31
+ }[];
32
+ }[];
33
+ /** A value as the list shows it: a choice by its label, a yes/no as words. */
34
+ export declare function displayValue(field: FieldResponse, value: unknown, locale: string, yes: string, no: string): string;
@@ -0,0 +1,13 @@
1
+ import type { RouteRecordRaw } from "vue-router";
2
+ /**
3
+ * The route of `characteristicsFeature`: a typed target for links (`characteristicsPages.index`) and the record the feature installs.
4
+ * The name and path are fixed, so a link or a menu binding of the application can name them.
5
+ */
6
+ export interface CharacteristicsPages {
7
+ /** The records `characteristicsFeature` installs. */
8
+ readonly records: readonly RouteRecordRaw[];
9
+ readonly index: {
10
+ readonly name: "characteristics.index";
11
+ };
12
+ }
13
+ export declare const characteristicsPages: CharacteristicsPages;