@wssto2/vue-core 0.15.1 → 0.15.3
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 +14 -0
- package/bin/templates/feature-crud/api.ts.tpl +1 -1
- package/dist/{Activity-RAk3h7Aa.js → Activity-DM9t5d3D.js} +1 -1
- package/dist/{Changes-Dsar4rXS.js → Changes-DYpysvfX.js} +1 -1
- package/dist/{General-Bu_ZIVbk.js → General-oUI2MiwO.js} +1 -1
- package/dist/{ProfilePage-7Xk2hsNL.js → ProfilePage-Di77M2cX.js} +2 -2
- package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CGvJW3bi.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C7WKxJ9i.js} +1 -1
- package/dist/{ServiceAccountRecord-Caj7mo3A.js → ServiceAccountRecord-CTU10RWy.js} +2 -2
- package/dist/{ServiceAccountsList-D-YqPi_h.js → ServiceAccountsList-BVRjoswH.js} +2 -2
- package/dist/{Sessions-Bv5GU5Oi.js → Sessions-BHwMrF7c.js} +1 -1
- package/dist/{SignIn-m6PANavm.js → SignIn-HnujOMRY.js} +1 -1
- package/dist/{SignInPage-C9--4P11.js → SignInPage-c886Fvd7.js} +1 -1
- package/dist/{SignIns-BhLnkY08.js → SignIns-BsTlN2Zc.js} +1 -1
- package/dist/{UserRecord-L3ahHNjb.js → UserRecord-DrbpVHh9.js} +1 -1
- package/dist/{UsersList-C6u3YCCp.js → UsersList-M5tBxrox.js} +1 -1
- package/dist/eslint/index.d.ts +5 -0
- package/dist/eslint/index.js +20 -11
- package/dist/form/GroupSheet.vue.d.ts +3 -1
- package/dist/form/index.js +1 -1
- package/dist/identity/index.js +1 -1
- package/dist/{index-D5DuvKP1.js → index-DM_nWOYf.js} +12 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{useGroupSheet-Qqo3ywsS.js → useGroupSheet-B-Hs4gNO.js} +104 -97
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.3 — 2026-10-21
|
|
4
|
+
|
|
5
|
+
A group sheet focuses its first error.
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- **form:** `GroupSheet` calls `focusFirstError` on its body once it has opened and after a refused Save, so a sheet opened with errors already set (`form.errors.add(field, message)` before `present()`) lands on the first flagged field in page order instead of the first control. No new API and no option: with no errors nothing changes. An application that focused the field itself after `present()` can drop that code.
|
|
9
|
+
|
|
10
|
+
## 0.15.2 — 2026-10-20
|
|
11
|
+
|
|
12
|
+
A hand-built `Idempotency-Key` header is now a lint error.
|
|
13
|
+
|
|
14
|
+
### New
|
|
15
|
+
- **eslint:** `vueCoreConfig` reports a hand-built `Idempotency-Key` header (`no-raw-idempotency-header`, a `no-restricted-syntax` entry): a `headers: { "Idempotency-Key": … }` object property in any casing, and `headers.set(...)` / `.append(...)` with that name. Use the request option `{ idempotencyKey }`, which is also re-sent on the renew-and-retry after a 401. `src/client` is excluded. An application that sets its own `no-restricted-syntax` replaces it and should spread `RAW_IDEMPOTENCY_HEADER_SELECTORS` (exported from `@wssto2/vue-core/eslint`).
|
|
16
|
+
|
|
3
17
|
## 0.15.1 — 2026-10-20
|
|
4
18
|
|
|
5
19
|
A dialog opened from a dialog could paint behind it.
|
|
@@ -17,7 +17,7 @@ export const __FEATURE_API_CLIENT__ = (http: HttpClient) => ({
|
|
|
17
17
|
|
|
18
18
|
/** A 422 lands on the form's fields (`form.submit`). */
|
|
19
19
|
async create(payload: __FEATURE_FORM_TYPE__, idempotencyKey: string): Promise<__FEATURE_ENTITY__> {
|
|
20
|
-
return (await http.request(__FEATURE_ROUTE_TABLE__.create, payload, {
|
|
20
|
+
return (await http.request(__FEATURE_ROUTE_TABLE__.create, payload, { idempotencyKey })).data;
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -13,7 +13,7 @@ import { b as W } from "./routeResource-DlTsGTg_.js";
|
|
|
13
13
|
import { _ as X } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
|
|
14
14
|
import { _ as Y } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
15
15
|
import { u as Z } from "./useLoad-M7V-AVwR.js";
|
|
16
|
-
import { P as tt, f as et, j as at } from "./index-
|
|
16
|
+
import { P as tt, f as et, j as at } from "./index-DM_nWOYf.js";
|
|
17
17
|
import { _ as st } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
|
|
18
18
|
const ot = {
|
|
19
19
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
@@ -5,7 +5,7 @@ import { u as b } from "./platform-ORzRR3Tw.js";
|
|
|
5
5
|
import { b as V } from "./routeResource-DlTsGTg_.js";
|
|
6
6
|
import { _ as R } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
|
|
7
7
|
import { u as E } from "./useLoad-M7V-AVwR.js";
|
|
8
|
-
import { P as N, f as B, k as P, j as S } from "./index-
|
|
8
|
+
import { P as N, f as B, k as P, j as S } from "./index-DM_nWOYf.js";
|
|
9
9
|
import { _ as U } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
|
|
10
10
|
import { _ as I } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BjdDXE3T.js";
|
|
11
11
|
const W = {
|
|
@@ -15,7 +15,7 @@ import { b as M } from "./routeResource-DlTsGTg_.js";
|
|
|
15
15
|
import { u as O } from "./serverMessages-Ce8-MK4e.js";
|
|
16
16
|
import { _ as U, a as $ } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
|
|
17
17
|
import { u as j } from "./keepAlive-ClGnsIzT.js";
|
|
18
|
-
import { P as z, e as H } from "./index-
|
|
18
|
+
import { P as z, e as H } from "./index-DM_nWOYf.js";
|
|
19
19
|
const J = {
|
|
20
20
|
class: "flex min-w-0 max-w-200 flex-col gap-group-gap",
|
|
21
21
|
"data-person-general": ""
|
|
@@ -5,10 +5,10 @@ import { u as F } from "./platform-ORzRR3Tw.js";
|
|
|
5
5
|
import { _ as ee } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
|
|
6
6
|
import { u as te } from "./useLoad-M7V-AVwR.js";
|
|
7
7
|
import { i as S } from "./preferences-hYhrw8Uy.js";
|
|
8
|
-
import { h as xe, q as $e, j as ke, f as qe } from "./index-
|
|
8
|
+
import { h as xe, q as $e, j as ke, f as qe } from "./index-DM_nWOYf.js";
|
|
9
9
|
import { a as K, u as ne, p as Ce } from "./FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js";
|
|
10
10
|
import { _ as de } from "./FormView.vue_vue_type_script_setup_true_lang-Bq_Qa4py.js";
|
|
11
|
-
import { u as Se, _ as Ee, a as Ve, b as Pe } from "./useGroupSheet-
|
|
11
|
+
import { u as Se, _ as Ee, a as Ve, b as Pe } from "./useGroupSheet-B-Hs4gNO.js";
|
|
12
12
|
import { t as C } from "./toast-CqSDTWRX.js";
|
|
13
13
|
import { u as T } from "./serverMessages-Ce8-MK4e.js";
|
|
14
14
|
import { g as Z } from "./options-B48UiYsG.js";
|
|
@@ -9,7 +9,7 @@ import { _ as j } from "./useCommand-DAMgQ5NE.js";
|
|
|
9
9
|
import { u as F } from "./useRecordDialog-QPKFH1Ww.js";
|
|
10
10
|
import { t as H } from "./toast-CqSDTWRX.js";
|
|
11
11
|
import { u as S } from "./platform-ORzRR3Tw.js";
|
|
12
|
-
import { l as J, m as Q } from "./index-
|
|
12
|
+
import { l as J, m as Q } from "./index-DM_nWOYf.js";
|
|
13
13
|
import { r as W } from "./http-D6qOS6xs.js";
|
|
14
14
|
import { i as X } from "./preferences-hYhrw8Uy.js";
|
|
15
15
|
import { s as l } from "./routes-Beyr5NQo.js";
|
|
@@ -15,8 +15,8 @@ import { u as ae } from "./platform-ORzRR3Tw.js";
|
|
|
15
15
|
import { u as me, a as ve } from "./routeResource-DlTsGTg_.js";
|
|
16
16
|
import { a as fe } from "./ResourcePage.vue_vue_type_script_setup_true_lang-uLrX13ab.js";
|
|
17
17
|
import { _ as O } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
18
|
-
import { m as ce, R as _e, l as pe, n as ye } from "./index-
|
|
19
|
-
import { u as W, a as X, _ as ke } from "./ServiceAccountDialog.vue_vue_type_script_setup_true_lang-
|
|
18
|
+
import { m as ce, R as _e, l as pe, n as ye } from "./index-DM_nWOYf.js";
|
|
19
|
+
import { u as W, a as X, _ as ke } from "./ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C7WKxJ9i.js";
|
|
20
20
|
import { _ as J } from "./Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js";
|
|
21
21
|
import { _ as be } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
|
|
22
22
|
import { _ as ge } from "./Modal.vue_vue_type_script_setup_true_lang-CZ7WrDwu.js";
|
|
@@ -13,8 +13,8 @@ import { u as X } from "./platform-ORzRR3Tw.js";
|
|
|
13
13
|
import { _ as Y } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
|
|
14
14
|
import { _ as Z } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
15
15
|
import { u as ee } from "./useLoad-M7V-AVwR.js";
|
|
16
|
-
import { l as te, m as $, n as A } from "./index-
|
|
17
|
-
import { u as ae, _ as oe } from "./ServiceAccountDialog.vue_vue_type_script_setup_true_lang-
|
|
16
|
+
import { l as te, m as $, n as A } from "./index-DM_nWOYf.js";
|
|
17
|
+
import { u as ae, _ as oe } from "./ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C7WKxJ9i.js";
|
|
18
18
|
const se = {
|
|
19
19
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
20
20
|
"data-test": "service-segment"
|
|
@@ -9,7 +9,7 @@ import { u as D } from "./platform-ORzRR3Tw.js";
|
|
|
9
9
|
import { b as L } from "./routeResource-DlTsGTg_.js";
|
|
10
10
|
import { _ as O } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
|
|
11
11
|
import { _ as T } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
|
|
12
|
-
import { P as V, e as I, g as j, h as z } from "./index-
|
|
12
|
+
import { P as V, e as I, g as j, h as z } from "./index-DM_nWOYf.js";
|
|
13
13
|
import { i as F } from "./usePreferences-BfMXVbSO.js";
|
|
14
14
|
const G = {
|
|
15
15
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
@@ -12,7 +12,7 @@ import { u as z, h as F } from "./platform-ORzRR3Tw.js";
|
|
|
12
12
|
import { b as L } from "./routeResource-DlTsGTg_.js";
|
|
13
13
|
import { _ as O } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
14
14
|
import { i as T } from "./usePreferences-BfMXVbSO.js";
|
|
15
|
-
import { f as j, P as G, e as H, _ as J } from "./index-
|
|
15
|
+
import { f as j, P as G, e as H, _ as J } from "./index-DM_nWOYf.js";
|
|
16
16
|
import { _ as K, a as M } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
|
|
17
17
|
const Q = {
|
|
18
18
|
key: 0,
|
|
@@ -6,7 +6,7 @@ import { _ as N } from "./Panel.vue_vue_type_script_setup_true_lang-D_Wg42hu.js"
|
|
|
6
6
|
import { _ as S } from "./FormView.vue_vue_type_script_setup_true_lang-Bq_Qa4py.js";
|
|
7
7
|
import { _ as a } from "./TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
|
|
8
8
|
import { r as $ } from "./guards-6fJxfUtk.js";
|
|
9
|
-
import { u as C, a as E } from "./index-
|
|
9
|
+
import { u as C, a as E } from "./index-DM_nWOYf.js";
|
|
10
10
|
const V = { class: "flex flex-1 flex-col items-center justify-center gap-8" }, k = { class: "text-xl font-semibold text-content-strong" }, H = /* @__PURE__ */ d({
|
|
11
11
|
__name: "SignInPage",
|
|
12
12
|
setup(q) {
|
|
@@ -5,7 +5,7 @@ import { u as b } from "./platform-ORzRR3Tw.js";
|
|
|
5
5
|
import { b as k } from "./routeResource-DlTsGTg_.js";
|
|
6
6
|
import { _ as I } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
|
|
7
7
|
import { u as R } from "./useLoad-M7V-AVwR.js";
|
|
8
|
-
import { P as C, i as E, j as B } from "./index-
|
|
8
|
+
import { P as C, i as E, j as B } from "./index-DM_nWOYf.js";
|
|
9
9
|
import { _ as P } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
|
|
10
10
|
import { _ as h } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BjdDXE3T.js";
|
|
11
11
|
const U = {
|
|
@@ -14,7 +14,7 @@ import { A as J } from "./access-DmAceEo5.js";
|
|
|
14
14
|
import { _ as Q } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
15
15
|
import { u as W } from "./useLoad-M7V-AVwR.js";
|
|
16
16
|
import { i as X } from "./usePreferences-BfMXVbSO.js";
|
|
17
|
-
import { P as Y, p as Z, c as ee, d as se, b as ae, M as te, o as oe, s as re } from "./index-
|
|
17
|
+
import { P as Y, p as Z, c as ee, d as se, b as ae, M as te, o as oe, s as re } from "./index-DM_nWOYf.js";
|
|
18
18
|
import { a as ne } from "./FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js";
|
|
19
19
|
import { _ as A } from "./TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
|
|
20
20
|
import { u as ie, _ as ce } from "./useCommand-DAMgQ5NE.js";
|
|
@@ -6,7 +6,7 @@ import { _ as V } from "./Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js
|
|
|
6
6
|
import { u as L } from "./format-Cp1h0vsC.js";
|
|
7
7
|
import { u as z } from "./platform-ORzRR3Tw.js";
|
|
8
8
|
import { _ as A } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
9
|
-
import { b as D, U as I, c as f, d as M, M as q, s as F } from "./index-
|
|
9
|
+
import { b as D, U as I, c as f, d as M, M as q, s as F } from "./index-DM_nWOYf.js";
|
|
10
10
|
const G = ["datetime"], Z = /* @__PURE__ */ C({
|
|
11
11
|
__name: "UsersList",
|
|
12
12
|
setup(K) {
|
package/dist/eslint/index.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ import type { Linter } from "eslint";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const TYPED_RULES: readonly string[];
|
|
8
8
|
export declare const TYPED_RULE_SET: ReadonlySet<string>;
|
|
9
|
+
/** Rule `no-raw-idempotency-header`, as `no-restricted-syntax` selectors: the key goes through `RequestOptions.idempotencyKey`. */
|
|
10
|
+
export declare const RAW_IDEMPOTENCY_HEADER_SELECTORS: readonly {
|
|
11
|
+
selector: string;
|
|
12
|
+
message: string;
|
|
13
|
+
}[];
|
|
9
14
|
export interface VueCoreConfigOptions {
|
|
10
15
|
/**
|
|
11
16
|
* Turn on the type-aware rules (`TYPED_RULES`, at `warn`: the ratchet counts them). Type-aware linting is slow, so it is
|
package/dist/eslint/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import l from "@eslint/js";
|
|
|
2
2
|
import u from "eslint-plugin-vue";
|
|
3
3
|
import r from "globals";
|
|
4
4
|
import t from "typescript-eslint";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import c from "vue-eslint-parser";
|
|
6
|
+
const i = [
|
|
7
7
|
"@typescript-eslint/await-thenable",
|
|
8
8
|
"@typescript-eslint/no-base-to-string",
|
|
9
9
|
"@typescript-eslint/no-floating-promises",
|
|
@@ -21,11 +21,17 @@ const o = [
|
|
|
21
21
|
"@typescript-eslint/restrict-plus-operands",
|
|
22
22
|
"@typescript-eslint/restrict-template-expressions",
|
|
23
23
|
"@typescript-eslint/unbound-method"
|
|
24
|
-
],
|
|
25
|
-
|
|
24
|
+
], b = new Set(i), o = "/^idempotency-key$/i", f = [
|
|
25
|
+
`Property[key.name='headers'] > ObjectExpression > Property[key.value=${o}]`,
|
|
26
|
+
`CallExpression[callee.property.name=/^(set|append)$/][arguments.0.value=${o}]`
|
|
27
|
+
].map((e) => ({
|
|
28
|
+
selector: e,
|
|
29
|
+
message: "Do not build the Idempotency-Key header by hand: pass the request option { idempotencyKey } (it is also re-sent on the renew-and-retry after a 401)."
|
|
30
|
+
}));
|
|
31
|
+
function h({ typed: e = !1, tsconfigRootDir: n, ignores: p = [], rules: a = {} } = {}) {
|
|
26
32
|
if (e && !n) throw new Error("vueCoreConfig: typed linting needs tsconfigRootDir (usually import.meta.dirname)");
|
|
27
33
|
return [
|
|
28
|
-
{ ignores: ["dist/**", "node_modules/**", "coverage/**", "**/*.d.ts", ...
|
|
34
|
+
{ ignores: ["dist/**", "node_modules/**", "coverage/**", "**/*.d.ts", ...p] },
|
|
29
35
|
l.configs.recommended,
|
|
30
36
|
...t.configs.recommended,
|
|
31
37
|
...u.configs["flat/recommended"],
|
|
@@ -36,7 +42,7 @@ function b({ typed: e = !1, tsconfigRootDir: n, ignores: i = [], rules: p = {} }
|
|
|
36
42
|
{
|
|
37
43
|
files: ["**/*.vue"],
|
|
38
44
|
languageOptions: {
|
|
39
|
-
parser:
|
|
45
|
+
parser: c,
|
|
40
46
|
parserOptions: { parser: t.parser, sourceType: "module", extraFileExtensions: [".vue"] }
|
|
41
47
|
}
|
|
42
48
|
},
|
|
@@ -48,7 +54,7 @@ function b({ typed: e = !1, tsconfigRootDir: n, ignores: i = [], rules: p = {} }
|
|
|
48
54
|
rules: {
|
|
49
55
|
// TypeScript reports undefined references itself, and no-undef cannot see ambient global types.
|
|
50
56
|
"no-undef": "off",
|
|
51
|
-
...e ? Object.fromEntries(
|
|
57
|
+
...e ? Object.fromEntries(i.map((s) => [s, "warn"])) : {},
|
|
52
58
|
// Superseded by @typescript-eslint/no-unused-vars below; the core rule mis-fires on type-only constructs.
|
|
53
59
|
"no-unused-vars": "off",
|
|
54
60
|
"no-useless-assignment": "error",
|
|
@@ -73,15 +79,18 @@ function b({ typed: e = !1, tsconfigRootDir: n, ignores: i = [], rules: p = {} }
|
|
|
73
79
|
"error",
|
|
74
80
|
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" }
|
|
75
81
|
],
|
|
76
|
-
...
|
|
82
|
+
...a
|
|
77
83
|
}
|
|
78
84
|
},
|
|
85
|
+
// The client implementation sets the header itself; applications must use the request option.
|
|
86
|
+
{ files: ["**/*.{ts,vue}"], ignores: ["src/client/**"], rules: { "no-restricted-syntax": ["error", ...f] } },
|
|
79
87
|
// Test files (named *.test.ts or in a tests/ folder) define stub components inline, several per file, with untyped prop lists on purpose.
|
|
80
88
|
{ files: ["**/*.test.ts", "tests/**/*.{ts,vue}"], languageOptions: { globals: r.vitest }, rules: { "vue/require-prop-types": "off", "vue/one-component-per-file": "off" } }
|
|
81
89
|
];
|
|
82
90
|
}
|
|
83
91
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
b as
|
|
92
|
+
f as RAW_IDEMPOTENCY_HEADER_SELECTORS,
|
|
93
|
+
i as TYPED_RULES,
|
|
94
|
+
b as TYPED_RULE_SET,
|
|
95
|
+
h as vueCoreConfig
|
|
87
96
|
};
|
|
@@ -3,7 +3,9 @@ import type { GroupSheetState } from "./useGroupSheet";
|
|
|
3
3
|
* The sheet of one record group (decision D22): a grouped `Modal` with one Save and the lifecycle of `useGroupSheet`. The
|
|
4
4
|
* group's values are its baseline on open and are put back on Cancel; a dismiss with edits asks first; a save says what it is
|
|
5
5
|
* doing, then that it is done, before the sheet closes. The fields go in the default slot, bound to the record's form as on its
|
|
6
|
-
* page. A save that needs another group's data says which at the top; a failure says why.
|
|
6
|
+
* page. A save that needs another group's data says which at the top; a failure says why. Focus goes to the first field with an
|
|
7
|
+
* error (`focusFirstError`): when the sheet opens with errors already set (`form.errors.add(field, message)` before `present()`), and
|
|
8
|
+
* after a refused save.
|
|
7
9
|
*
|
|
8
10
|
* <GroupSheet :sheet="contact" :title="t('contact')" :editable="canEdit" :group-label="(group) => t('group.' + group)">
|
|
9
11
|
* <RecordGroupScope only="contact" :editable="canEdit"><ContactSections :form="form" /></RecordGroupScope>
|
package/dist/form/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import { _ as Vt } from "../NumberField.vue_vue_type_script_setup_true_lang-U-_k
|
|
|
32
32
|
import { _ as Dt } from "../Sheet.vue_vue_type_script_setup_true_lang-BG8HUNfs.js";
|
|
33
33
|
import { b as Rt, a as Ke } from "../SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js";
|
|
34
34
|
import { _ as fn, u as mn } from "../SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js";
|
|
35
|
-
import { _ as pn, b as bn, a as gn, u as yn } from "../useGroupSheet-
|
|
35
|
+
import { _ as pn, b as bn, a as gn, u as yn } from "../useGroupSheet-B-Hs4gNO.js";
|
|
36
36
|
import { _ as Pe } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-DmMg1T_V.js";
|
|
37
37
|
import { _ as kn } from "../SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js";
|
|
38
38
|
import { _ as wn } from "../SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js";
|
package/dist/identity/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as a } from "../preferences-hYhrw8Uy.js";
|
|
2
|
-
import { k as o, r as n, t as i, P as r, j as u, h as c, _ as d, q as S, i as g, U as A, v as f, w as l, x as p, y as m, z as I, A as R, o as x, B as y, C as P, n as U, s as v, e as D, g as E, b, f as w, D as F, E as B, c as C } from "../index-
|
|
2
|
+
import { k as o, r as n, t as i, P as r, j as u, h as c, _ as d, q as S, i as g, U as A, v as f, w as l, x as p, y as m, z as I, A as R, o as x, B as y, C as P, n as U, s as v, e as D, g as E, b, f as w, D as F, E as B, c as C } from "../index-DM_nWOYf.js";
|
|
3
3
|
import { a as T, _ } from "../ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
|
|
4
4
|
import { i as k, l as N, r as O, s as j, a as q, u as z } from "../usePreferences-BfMXVbSO.js";
|
|
5
5
|
import { s as K } from "../routes-Beyr5NQo.js";
|
|
@@ -246,7 +246,7 @@ const ft = ["aria-labelledby"], gt = ["id"], _t = { class: "mt-1 text-subheadlin
|
|
|
246
246
|
]));
|
|
247
247
|
}
|
|
248
248
|
}), wt = X({
|
|
249
|
-
login: { name: "login", path: "/login", component: () => import("./SignInPage-
|
|
249
|
+
login: { name: "login", path: "/login", component: () => import("./SignInPage-c886Fvd7.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
|
|
250
250
|
});
|
|
251
251
|
function Xn(e = {}) {
|
|
252
252
|
return ne({
|
|
@@ -381,7 +381,7 @@ function Hn(e) {
|
|
|
381
381
|
};
|
|
382
382
|
}
|
|
383
383
|
const ke = X({
|
|
384
|
-
index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-
|
|
384
|
+
index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-Di77M2cX.js"), meta: { titleKey: "core.profile.title" } }
|
|
385
385
|
}), At = /* @__PURE__ */ $({
|
|
386
386
|
__name: "ProfileMenuItem",
|
|
387
387
|
setup(e) {
|
|
@@ -412,19 +412,19 @@ function jt(e, n) {
|
|
|
412
412
|
return [...e.flatMap((s) => [s, ...o(s)]), ...n.filter((s) => s.after === void 0).map((s) => ce(s))];
|
|
413
413
|
}
|
|
414
414
|
const le = "iam.user:view", ts = "iam.user:manage", Kt = "iam.user.activity:view", Se = X({
|
|
415
|
-
index: { name: "users.index", path: "/users", component: () => import("./UsersList-
|
|
415
|
+
index: { name: "users.index", path: "/users", component: () => import("./UsersList-M5tBxrox.js"), meta: { access: le, titleKey: "core.users.title" } },
|
|
416
416
|
record: {
|
|
417
417
|
name: "users.record",
|
|
418
418
|
path: "/users/:id",
|
|
419
|
-
component: () => import("./UserRecord-
|
|
419
|
+
component: () => import("./UserRecord-DrbpVHh9.js"),
|
|
420
420
|
meta: { access: le, titleKey: "core.users.title", remountOnParam: "id" },
|
|
421
421
|
children: [
|
|
422
|
-
{ name: "users.record.general", path: "general", component: () => import("./General-
|
|
423
|
-
{ name: "users.record.signin", path: "signin", component: () => import("./SignIn-
|
|
424
|
-
{ name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-
|
|
425
|
-
{ name: "users.record.signins", path: "signins", component: () => import("./SignIns-
|
|
426
|
-
{ name: "users.record.changes", path: "changes", component: () => import("./Changes-
|
|
427
|
-
{ name: "users.record.activity", path: "activity", component: () => import("./Activity-
|
|
422
|
+
{ name: "users.record.general", path: "general", component: () => import("./General-oUI2MiwO.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
|
|
423
|
+
{ name: "users.record.signin", path: "signin", component: () => import("./SignIn-HnujOMRY.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
|
|
424
|
+
{ name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-BHwMrF7c.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
|
|
425
|
+
{ name: "users.record.signins", path: "signins", component: () => import("./SignIns-BsTlN2Zc.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
|
|
426
|
+
{ name: "users.record.changes", path: "changes", component: () => import("./Changes-DYpysvfX.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
|
|
427
|
+
{ name: "users.record.activity", path: "activity", component: () => import("./Activity-DM9t5d3D.js"), meta: { access: Kt, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
|
|
428
428
|
]
|
|
429
429
|
}
|
|
430
430
|
});
|
|
@@ -1153,11 +1153,11 @@ const Jt = ["title"], Qt = { class: "font-mono" }, cs = /* @__PURE__ */ $({
|
|
|
1153
1153
|
}, 8, ["permission"])) : k("", !0);
|
|
1154
1154
|
}
|
|
1155
1155
|
}), [cn, ms] = N("vue-core.serviceaccounts"), ue = "iam.serviceaccount:view", ps = "iam.serviceaccount:manage", fs = "iam.serviceaccount:revoke", de = X({
|
|
1156
|
-
index: { name: "serviceaccounts.index", path: "/iam/service-accounts", component: () => import("./ServiceAccountsList-
|
|
1156
|
+
index: { name: "serviceaccounts.index", path: "/iam/service-accounts", component: () => import("./ServiceAccountsList-BVRjoswH.js"), meta: { access: ue, titleKey: "core.serviceaccounts.title_plural" } },
|
|
1157
1157
|
record: {
|
|
1158
1158
|
name: "serviceaccounts.record",
|
|
1159
1159
|
path: "/iam/service-accounts/:id",
|
|
1160
|
-
component: () => import("./ServiceAccountRecord-
|
|
1160
|
+
component: () => import("./ServiceAccountRecord-CTU10RWy.js"),
|
|
1161
1161
|
meta: { access: ue, titleKey: "core.serviceaccounts.title_plural", remountOnParam: "id" }
|
|
1162
1162
|
}
|
|
1163
1163
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
|
|
2
|
-
export declare const version = "0.15.
|
|
2
|
+
export declare const version = "0.15.3";
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as L, useModel as X, useId as Y, useTemplateRef as O, ref as
|
|
1
|
+
import { defineComponent as L, useModel as X, useId as Y, useTemplateRef as O, ref as y, computed as w, watch as N, nextTick as $, onMounted as H, openBlock as b, createElementBlock as _, normalizeClass as T, createElementVNode as D, unref as k, Fragment as I, renderList as Z, createTextVNode as ee, toDisplayString as j, createCommentVNode as C, mergeModels as P, onBeforeUnmount as te, createBlock as V, withCtx as z, createVNode as ae, renderSlot as J, provide as A, toRef as se, shallowRef as le, toValue as K } from "vue";
|
|
2
2
|
import { useI18n as Q } from "vue-i18n";
|
|
3
3
|
import { _ as oe } from "./Modal.vue_vue_type_script_setup_true_lang-CZ7WrDwu.js";
|
|
4
4
|
import { _ as q } from "./Banner.vue_vue_type_script_setup_true_lang-sv0phngk.js";
|
|
5
5
|
import { D as ne } from "./shortcut-oixX55SZ.js";
|
|
6
6
|
import { _ as re, r as ie, s as U, c as B, f as ue } from "./FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
7
|
+
import { f as ce } from "./useCommand-DAMgQ5NE.js";
|
|
8
|
+
import { d as de } from "./options-B48UiYsG.js";
|
|
9
|
+
import { t as fe } from "./toast-CqSDTWRX.js";
|
|
10
|
+
import { a as ve } from "./leaveGuard-Cc8yeLxM.js";
|
|
11
|
+
const me = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "aria-describedby"], pe = {
|
|
11
12
|
key: 1,
|
|
12
13
|
class: "h-5 w-px animate-caret-blink bg-content-strong"
|
|
13
|
-
},
|
|
14
|
+
}, Ee = /* @__PURE__ */ L({
|
|
14
15
|
__name: "OtpInput",
|
|
15
|
-
props: /* @__PURE__ */
|
|
16
|
+
props: /* @__PURE__ */ P({
|
|
16
17
|
length: { default: 6 },
|
|
17
18
|
disabled: { type: Boolean, default: !1 },
|
|
18
19
|
invalid: { type: Boolean, default: !1 },
|
|
@@ -24,44 +25,44 @@ const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "ar
|
|
|
24
25
|
modelValue: { default: "" },
|
|
25
26
|
modelModifiers: {}
|
|
26
27
|
}),
|
|
27
|
-
emits: /* @__PURE__ */
|
|
28
|
+
emits: /* @__PURE__ */ P(["complete"], ["update:modelValue"]),
|
|
28
29
|
setup(l, { expose: a, emit: t }) {
|
|
29
|
-
const o = l,
|
|
30
|
+
const o = l, u = X(l, "modelValue"), c = t, { t: d } = Q(), v = Y(), r = O("input"), f = y(!1), g = y(0), m = y(!1), h = (s) => s.replace(/\D/g, "").slice(0, o.length), i = w(() => h(u.value)), x = w(() => Math.min(g.value, o.length - 1)), G = w(() => o.label ?? d("core.form.otp.label", { length: o.length }));
|
|
30
31
|
function p() {
|
|
31
|
-
g.value = r.value?.selectionStart ??
|
|
32
|
+
g.value = r.value?.selectionStart ?? i.value.length;
|
|
32
33
|
}
|
|
33
34
|
function S(s) {
|
|
34
|
-
const e =
|
|
35
|
+
const e = h(s);
|
|
35
36
|
r.value && r.value.value !== e && (r.value.value = e);
|
|
36
|
-
const n = e !==
|
|
37
|
-
|
|
37
|
+
const n = e !== i.value;
|
|
38
|
+
u.value = e, $(p), n && e.length === o.length && c("complete", e);
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function E(s) {
|
|
40
41
|
const e = s.clipboardData?.getData("text") ?? "";
|
|
41
|
-
e && (s.preventDefault(), S(e),
|
|
42
|
-
const n =
|
|
42
|
+
e && (s.preventDefault(), S(e), $(() => {
|
|
43
|
+
const n = i.value.length;
|
|
43
44
|
r.value?.setSelectionRange(n, n), p();
|
|
44
45
|
}));
|
|
45
46
|
}
|
|
46
47
|
return N(
|
|
47
48
|
() => o.invalid,
|
|
48
49
|
(s) => {
|
|
49
|
-
s && (
|
|
50
|
+
s && (m.value = !1, requestAnimationFrame(() => m.value = !0));
|
|
50
51
|
}
|
|
51
|
-
), N(
|
|
52
|
-
r.value && r.value.value !== s && (r.value.value = s,
|
|
52
|
+
), N(i, (s) => {
|
|
53
|
+
r.value && r.value.value !== s && (r.value.value = s, $(p));
|
|
53
54
|
}), H(() => {
|
|
54
55
|
o.autofocus && r.value?.focus();
|
|
55
56
|
}), a({ focus: () => r.value?.focus() }), (s, e) => (b(), _("div", {
|
|
56
|
-
class: T(["relative inline-flex gap-2 sm:gap-3", { "motion-safe:animate-shake":
|
|
57
|
+
class: T(["relative inline-flex gap-2 sm:gap-3", { "motion-safe:animate-shake": m.value }]),
|
|
57
58
|
"data-test": "otp-input",
|
|
58
|
-
onAnimationend: e[3] || (e[3] = (n) =>
|
|
59
|
+
onAnimationend: e[3] || (e[3] = (n) => m.value = !1)
|
|
59
60
|
}, [
|
|
60
|
-
|
|
61
|
-
id:
|
|
61
|
+
D("input", {
|
|
62
|
+
id: k(v),
|
|
62
63
|
ref_key: "input",
|
|
63
64
|
ref: r,
|
|
64
|
-
value:
|
|
65
|
+
value: i.value,
|
|
65
66
|
name: o.name,
|
|
66
67
|
type: "text",
|
|
67
68
|
inputmode: "numeric",
|
|
@@ -69,34 +70,34 @@ const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "ar
|
|
|
69
70
|
pattern: "\\d*",
|
|
70
71
|
spellcheck: "false",
|
|
71
72
|
disabled: o.disabled,
|
|
72
|
-
"aria-label":
|
|
73
|
+
"aria-label": G.value,
|
|
73
74
|
"aria-invalid": o.invalid || void 0,
|
|
74
75
|
"aria-describedby": o.describedBy,
|
|
75
76
|
"data-test": "otp-input-field",
|
|
76
77
|
class: "absolute inset-0 z-10 h-full w-full cursor-text border-0 bg-transparent p-0 text-base text-transparent caret-transparent outline-none selection:bg-transparent disabled:cursor-not-allowed",
|
|
77
78
|
onInput: e[0] || (e[0] = (n) => S(n.target.value)),
|
|
78
|
-
onPaste:
|
|
79
|
+
onPaste: E,
|
|
79
80
|
onFocus: e[1] || (e[1] = (n) => {
|
|
80
|
-
|
|
81
|
+
f.value = !0, p();
|
|
81
82
|
}),
|
|
82
|
-
onBlur: e[2] || (e[2] = (n) =>
|
|
83
|
+
onBlur: e[2] || (e[2] = (n) => f.value = !1),
|
|
83
84
|
onKeyup: p,
|
|
84
85
|
onClick: p,
|
|
85
86
|
onSelect: p
|
|
86
|
-
}, null, 40,
|
|
87
|
+
}, null, 40, me),
|
|
87
88
|
(b(!0), _(I, null, Z(o.length, (n) => (b(), _("div", {
|
|
88
89
|
key: n,
|
|
89
90
|
"aria-hidden": "true",
|
|
90
91
|
"data-test": "otp-input-cell",
|
|
91
|
-
class: T(["flex size-11 items-center justify-center rounded-control bg-fill text-lg font-medium tabular-nums text-content-strong transition-[box-shadow] sm:size-13 sm:text-xl", [o.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" :
|
|
92
|
+
class: T(["flex size-11 items-center justify-center rounded-control bg-fill text-lg font-medium tabular-nums text-content-strong transition-[box-shadow] sm:size-13 sm:text-xl", [o.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" : f.value && x.value === n - 1 ? "bg-surface-cell ring-[1.5px] ring-inset ring-border-focus outline-3 outline-border-focus/20" : "", o.disabled ? "opacity-45" : ""]])
|
|
92
93
|
}, [
|
|
93
|
-
|
|
94
|
-
ee(j(
|
|
95
|
-
], 64)) :
|
|
94
|
+
i.value[n - 1] ? (b(), _(I, { key: 0 }, [
|
|
95
|
+
ee(j(i.value[n - 1]), 1)
|
|
96
|
+
], 64)) : f.value && x.value === n - 1 ? (b(), _("span", pe)) : C("", !0)
|
|
96
97
|
], 2))), 128))
|
|
97
98
|
], 34));
|
|
98
99
|
}
|
|
99
|
-
}),
|
|
100
|
+
}), be = { class: "text-footnote" }, ge = { class: "text-footnote" }, Fe = /* @__PURE__ */ L({
|
|
100
101
|
__name: "GroupSheet",
|
|
101
102
|
props: {
|
|
102
103
|
sheet: {},
|
|
@@ -109,72 +110,78 @@ const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "ar
|
|
|
109
110
|
},
|
|
110
111
|
emits: ["saved"],
|
|
111
112
|
setup(l, { emit: a }) {
|
|
112
|
-
const t = l, o = a, { t:
|
|
113
|
+
const t = l, o = a, { t: u } = Q(), c = O("modal"), d = O("body"), v = y(!1);
|
|
113
114
|
let r = null;
|
|
114
|
-
N(() => t.sheet.open.value, (
|
|
115
|
-
|
|
115
|
+
N(() => t.sheet.open.value, (h) => {
|
|
116
|
+
h ? (v.value = !1, c.value?.present()) : c.value?.dismiss();
|
|
116
117
|
}), H(() => {
|
|
117
|
-
t.sheet.open.value &&
|
|
118
|
+
t.sheet.open.value && c.value?.present();
|
|
118
119
|
}), te(() => {
|
|
119
120
|
r && clearTimeout(r);
|
|
120
121
|
});
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
const f = () => $().then(() => d.value ? ce(d.value) : !1);
|
|
123
|
+
async function g() {
|
|
124
|
+
if (!await t.sheet.save()) {
|
|
125
|
+
f();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
v.value = !0, o("saved"), r = setTimeout(() => t.sheet.dismiss(), ne);
|
|
123
129
|
}
|
|
124
|
-
const
|
|
125
|
-
return (
|
|
130
|
+
const m = w(() => t.sheet.saving.value ? "processing" : v.value ? "done" : "idle");
|
|
131
|
+
return (h, i) => (b(), V(oe, {
|
|
126
132
|
ref_key: "modal",
|
|
127
|
-
ref:
|
|
133
|
+
ref: c,
|
|
128
134
|
size: t.size,
|
|
129
135
|
grouped: "",
|
|
130
136
|
title: t.title,
|
|
131
137
|
subtitle: t.subtitle,
|
|
132
138
|
"before-dismiss": t.sheet.beforeDismiss,
|
|
133
|
-
"primary-label": t.editable ?
|
|
134
|
-
status:
|
|
135
|
-
"processing-label":
|
|
136
|
-
"done-label":
|
|
137
|
-
onPrimary:
|
|
138
|
-
|
|
139
|
+
"primary-label": t.editable ? k(u)("core.actions.save") : void 0,
|
|
140
|
+
status: m.value,
|
|
141
|
+
"processing-label": k(u)("core.actions.saving"),
|
|
142
|
+
"done-label": k(u)("core.actions.saved"),
|
|
143
|
+
onPrimary: g,
|
|
144
|
+
onPresented: f,
|
|
145
|
+
onDismissed: i[0] || (i[0] = (x) => t.sheet.closed())
|
|
139
146
|
}, {
|
|
140
|
-
default:
|
|
141
|
-
|
|
147
|
+
default: z(() => [
|
|
148
|
+
D("div", {
|
|
142
149
|
ref_key: "body",
|
|
143
|
-
ref:
|
|
150
|
+
ref: d,
|
|
144
151
|
class: "flex min-w-0 flex-col gap-group-gap"
|
|
145
152
|
}, [
|
|
146
|
-
t.sheet.notice.value ? (b(),
|
|
153
|
+
t.sheet.notice.value ? (b(), V(q, {
|
|
147
154
|
key: 0,
|
|
148
155
|
tone: "warning",
|
|
149
156
|
"data-test": "group-sheet-notice"
|
|
150
157
|
}, {
|
|
151
|
-
default:
|
|
152
|
-
|
|
158
|
+
default: z(() => [
|
|
159
|
+
D("p", be, j(t.sheet.notice.value), 1)
|
|
153
160
|
]),
|
|
154
161
|
_: 1
|
|
155
162
|
})) : C("", !0),
|
|
156
|
-
t.sheet.foreignGroups.value.length ? (b(),
|
|
163
|
+
t.sheet.foreignGroups.value.length ? (b(), V(q, {
|
|
157
164
|
key: 1,
|
|
158
165
|
tone: "warning",
|
|
159
166
|
"data-test": "group-sheet-foreign"
|
|
160
167
|
}, {
|
|
161
|
-
default:
|
|
162
|
-
|
|
168
|
+
default: z(() => [
|
|
169
|
+
D("p", ge, j(k(u)("core.form.group.foreign", { groups: t.sheet.foreignGroups.value.map(t.groupLabel).join(", ") })), 1)
|
|
163
170
|
]),
|
|
164
171
|
_: 1
|
|
165
172
|
})) : C("", !0),
|
|
166
173
|
ae(re, {
|
|
167
174
|
form: t.sheet.form,
|
|
168
175
|
label: t.fieldLabel,
|
|
169
|
-
scope:
|
|
176
|
+
scope: d.value
|
|
170
177
|
}, null, 8, ["form", "label", "scope"]),
|
|
171
|
-
J(
|
|
178
|
+
J(h.$slots, "default")
|
|
172
179
|
], 512)
|
|
173
180
|
]),
|
|
174
181
|
_: 3
|
|
175
182
|
}, 8, ["size", "title", "subtitle", "before-dismiss", "primary-label", "status", "processing-label", "done-label"]));
|
|
176
183
|
}
|
|
177
|
-
}),
|
|
184
|
+
}), he = ["data-group"], Ve = /* @__PURE__ */ L({
|
|
178
185
|
__name: "RecordGroupScope",
|
|
179
186
|
props: {
|
|
180
187
|
only: {},
|
|
@@ -182,43 +189,43 @@ const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "ar
|
|
|
182
189
|
},
|
|
183
190
|
setup(l) {
|
|
184
191
|
const a = l;
|
|
185
|
-
return
|
|
192
|
+
return A(ie, { only: se(a, "only") }), A(de, w(() => a.editable)), (t, o) => (b(), _("div", {
|
|
186
193
|
class: "flex min-w-0 flex-col gap-group-gap",
|
|
187
194
|
"data-test": "record-group-scope",
|
|
188
195
|
"data-group": a.only
|
|
189
196
|
}, [
|
|
190
197
|
J(t.$slots, "default")
|
|
191
|
-
], 8,
|
|
198
|
+
], 8, he));
|
|
192
199
|
}
|
|
193
200
|
});
|
|
194
201
|
function ze(l) {
|
|
195
202
|
const { form: a } = l;
|
|
196
203
|
if (l.rebase && !a.rebase) throw new Error("useGroupSheet: `rebase` needs a record form (useResourceForm), which can take the freshly read record as its base.");
|
|
197
|
-
const t = () => typeof l.fields == "function" ? l.fields() : l.fields, o = () =>
|
|
198
|
-
let
|
|
199
|
-
const g = (s) => Object.fromEntries(s.map((e) => [e, B(a.values[e])])),
|
|
200
|
-
function
|
|
201
|
-
|
|
204
|
+
const t = () => typeof l.fields == "function" ? l.fields() : l.fields, o = () => K(l.restore) ?? t(), u = y(!1), c = y(!1), d = y([]), v = y(null), r = le({});
|
|
205
|
+
let f = {};
|
|
206
|
+
const g = (s) => Object.fromEntries(s.map((e) => [e, B(a.values[e])])), m = w(() => u.value && !U(g(o()), r.value)), { confirmDiscard: h } = ve(() => m.value);
|
|
207
|
+
function i() {
|
|
208
|
+
f = g(o()), r.value = B(f);
|
|
202
209
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
210
|
+
function x() {
|
|
211
|
+
i(), d.value = [], v.value = null, a.dismissFailure(), u.value = !0;
|
|
205
212
|
}
|
|
206
|
-
function
|
|
207
|
-
if (
|
|
208
|
-
|
|
213
|
+
function G() {
|
|
214
|
+
if (u.value) {
|
|
215
|
+
m.value && Object.assign(a.values, B(f));
|
|
209
216
|
for (const s of t()) a.errors.clear(s);
|
|
210
|
-
a.dismissFailure(),
|
|
217
|
+
a.dismissFailure(), u.value = !1;
|
|
211
218
|
}
|
|
212
219
|
}
|
|
213
220
|
function p(s) {
|
|
214
|
-
const e = new Set(t()), n =
|
|
221
|
+
const e = new Set(t()), n = K(l.group), M = /* @__PURE__ */ new Set();
|
|
215
222
|
for (const W of Object.keys(s.all())) {
|
|
216
223
|
const R = ue(W);
|
|
217
224
|
if (e.has(R)) continue;
|
|
218
|
-
const
|
|
219
|
-
|
|
225
|
+
const F = l.groupOf?.(R) ?? l.fallbackGroup;
|
|
226
|
+
F && F !== n && M.add(F);
|
|
220
227
|
}
|
|
221
|
-
|
|
228
|
+
d.value = [...M];
|
|
222
229
|
}
|
|
223
230
|
async function S(s) {
|
|
224
231
|
const e = B(g(t().filter((n) => !U(a.values[n], r.value[n]))));
|
|
@@ -227,11 +234,11 @@ function ze(l) {
|
|
|
227
234
|
} catch {
|
|
228
235
|
return;
|
|
229
236
|
}
|
|
230
|
-
a.rebase?.() && (
|
|
237
|
+
a.rebase?.() && (i(), Object.assign(a.values, e), v.value = s.message());
|
|
231
238
|
}
|
|
232
|
-
async function
|
|
233
|
-
if (
|
|
234
|
-
|
|
239
|
+
async function E() {
|
|
240
|
+
if (c.value) return !1;
|
|
241
|
+
c.value = !0, d.value = [], v.value = null;
|
|
235
242
|
try {
|
|
236
243
|
const s = l.onSaved ? () => l.onSaved?.() : void 0;
|
|
237
244
|
let e;
|
|
@@ -240,38 +247,38 @@ function ze(l) {
|
|
|
240
247
|
else throw new Error("useGroupSheet: the form has no full-record save(), so give the sheet its own `save` for a dedicated endpoint.");
|
|
241
248
|
switch (e.status) {
|
|
242
249
|
case "saved":
|
|
243
|
-
return
|
|
250
|
+
return i(), !0;
|
|
244
251
|
case "saved-refresh-failed":
|
|
245
|
-
return
|
|
252
|
+
return i(), fe.warning(a.failure.value?.message ?? ""), !0;
|
|
246
253
|
case "aborted":
|
|
247
254
|
return !1;
|
|
248
255
|
case "failed":
|
|
249
256
|
return e.failure.kind === "conflict" && l.rebase ? await S(l.rebase) : p(a.errors), !1;
|
|
250
257
|
}
|
|
251
258
|
} finally {
|
|
252
|
-
|
|
259
|
+
c.value = !1;
|
|
253
260
|
}
|
|
254
261
|
}
|
|
255
262
|
return {
|
|
256
|
-
open:
|
|
257
|
-
saving:
|
|
258
|
-
dirty:
|
|
259
|
-
foreignGroups:
|
|
260
|
-
notice:
|
|
263
|
+
open: u,
|
|
264
|
+
saving: c,
|
|
265
|
+
dirty: m,
|
|
266
|
+
foreignGroups: d,
|
|
267
|
+
notice: v,
|
|
261
268
|
failure: a.failure,
|
|
262
269
|
form: a,
|
|
263
|
-
present:
|
|
270
|
+
present: x,
|
|
264
271
|
dismiss: () => {
|
|
265
|
-
|
|
272
|
+
u.value = !1;
|
|
266
273
|
},
|
|
267
|
-
save:
|
|
268
|
-
beforeDismiss:
|
|
269
|
-
closed:
|
|
274
|
+
save: E,
|
|
275
|
+
beforeDismiss: h,
|
|
276
|
+
closed: G
|
|
270
277
|
};
|
|
271
278
|
}
|
|
272
279
|
export {
|
|
273
|
-
|
|
280
|
+
Fe as _,
|
|
274
281
|
Ve as a,
|
|
275
|
-
|
|
282
|
+
Ee as b,
|
|
276
283
|
ze as u
|
|
277
284
|
};
|
package/package.json
CHANGED