@wssto2/vue-core 0.4.16 → 0.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Activity-CVO3sJwy.js → Activity-DB9ABAMb.js} +3 -3
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-B7qSUiee.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-Bm0sxqNz.js} +64 -63
- package/dist/{Changes-Bzvl3cEx.js → Changes-IIczcs6O.js} +2 -2
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-CD5zZ29o.js → CollectionPage.vue_vue_type_script_setup_true_lang-CUoyYpaW.js} +6 -6
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-ChS9ULwk.js → DataTable.vue_vue_type_script_setup_true_lang-Wuvo-l_z.js} +1 -1
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-BufoFwVQ.js → DateField.vue_vue_type_script_setup_true_lang-8mvjzRA-.js} +3 -3
- package/dist/{DeadLetters-DmwUtgf9.js → DeadLetters-Bq5YpnvT.js} +3 -3
- package/dist/{General-CUEjJBD4.js → General-DQruOZs2.js} +5 -5
- package/dist/{NewRolePage-Cyn-oV6r.js → NewRolePage-BcA8jBBQ.js} +3 -3
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-a8kN3A7k.js → NumberField.vue_vue_type_script_setup_true_lang-CC8bKyR_.js} +1 -1
- package/dist/{Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js → Popover.vue_vue_type_script_setup_true_lang-BTOzgIQF.js} +12 -12
- package/dist/{ProfilePage-I74SQBFO.js → ProfilePage-BqdCzyax.js} +7 -7
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-D87Hs75d.js → RecordHeader.vue_vue_type_script_setup_true_lang-DijFQnU6.js} +1 -1
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-Da0M-hen.js → ResourcePage.vue_vue_type_script_setup_true_lang-BpLnmA6n.js} +1 -1
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-Ce6wjptT.js → RoleEditor.vue_vue_type_script_setup_true_lang-DPpCuJWk.js} +2 -2
- package/dist/{RolePage-DWQP3qQl.js → RolePage-IES_ADt5.js} +6 -6
- package/dist/{RolesPage-BeEsHIQ2.js → RolesPage-D0K7tEL-.js} +3 -3
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-B0p_8xQG.js → SectionList.vue_vue_type_script_setup_true_lang-D5QWy-c1.js} +1 -1
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-D5Cnb4_O.js → SectionNavigator.vue_vue_type_script_setup_true_lang-CW81A_bn.js} +2 -2
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-DkbBJpYX.js +489 -0
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-DoUo68xE.js → SessionList.vue_vue_type_script_setup_true_lang-C0XvavBw.js} +1 -1
- package/dist/{Sessions-D8IXcb5M.js → Sessions-BfpiOhGs.js} +2 -2
- package/dist/{SettingsPage-DRQP2nrH.js → SettingsPage-BnEpURcU.js} +5 -5
- package/dist/{SignIn-CAZkovhb.js → SignIn-DrLE0gNr.js} +2 -2
- package/dist/{SignInPage-D-49oLY3.js → SignInPage-CRynZCU2.js} +2 -2
- package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-CIv34nRn.js → SignInTable.vue_vue_type_script_setup_true_lang-7Z9EmLs-.js} +1 -1
- package/dist/{SignIns-BtNfgMLc.js → SignIns-BQ8tISWn.js} +2 -2
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-D3-R5XXG.js → TextField.vue_vue_type_script_setup_true_lang-CWgn-vGl.js} +97 -90
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-pAdLPYXA.js → TimeField.vue_vue_type_script_setup_true_lang-BebAIPeL.js} +3 -3
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-FVRUr-9y.js → Timestamp.vue_vue_type_script_setup_true_lang-CU2Y5oYl.js} +1 -1
- package/dist/{UserRecord-BSbNuRFi.js → UserRecord-CqmPm4Fv.js} +7 -7
- package/dist/{UsersList-DPHxcaDm.js → UsersList-CHAray61.js} +8 -8
- package/dist/access/index.js +1 -1
- package/dist/app/index.js +1 -1
- package/dist/collection/index.js +3 -3
- package/dist/content/index.js +1 -1
- package/dist/{fieldMessages-DV6sESpn.js → fieldMessages-6HVzSDqG.js} +1 -1
- package/dist/form/ComboField.vue.d.ts +11 -8
- package/dist/form/CommandDialog.vue.d.ts +3 -0
- package/dist/form/MultiSelectField.vue.d.ts +8 -5
- package/dist/form/OptionList.vue.d.ts +7 -4
- package/dist/form/SelectField.vue.d.ts +11 -8
- package/dist/form/SuggestionList.vue.d.ts +11 -6
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.js +981 -928
- package/dist/form/options.d.ts +18 -5
- package/dist/form/suggestions.d.ts +12 -12
- package/dist/form/useOptions.d.ts +12 -12
- package/dist/form/useRecordDialog.d.ts +47 -0
- package/dist/format/index.js +1 -1
- package/dist/format-D8X4zsx6.js +78 -0
- package/dist/identity/index.js +1 -1
- package/dist/{index-CWeNiBX6.js → index-91Lo0hJy.js} +4 -4
- package/dist/{index-Bq96L43f.js → index-sYamgVg7.js} +12 -12
- package/dist/{index-yKIOaisE.js → index-wlRejl73.js} +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/intlLocale.d.ts +2 -0
- package/dist/intlLocale-CeRU44qJ.js +4 -0
- package/dist/notifications/index.js +1 -1
- package/dist/overlay/index.js +1 -1
- package/dist/page/index.js +5 -5
- package/dist/phone/index.js +112 -111
- package/dist/resource/index.js +1 -1
- package/dist/{rowLayout-D1cYQghV.js → rowLayout-BFz4Kdoy.js} +2 -2
- package/dist/shell/index.js +1 -1
- package/dist/{status-DzmySsWw.js → status-B_IMA25a.js} +1 -1
- package/dist/{suggestions-BxMm6MQA.js → suggestions-DHJFKB26.js} +50 -50
- package/dist/testing/index.js +1 -1
- package/dist/{useCommand-B-N6HJOz.js → useCommand-YN9EMb7s.js} +41 -38
- package/dist/{useTypedEntry-aTfPBAhw.js → useTypedEntry-C7k7Dyl-.js} +237 -236
- package/package.json +1 -1
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-C1Flb1hA.js +0 -465
- package/dist/format-B8mJm946.js +0 -77
package/dist/form/options.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Tone } from "../state";
|
|
2
2
|
/** One choice of a select, chips, segments or cards. `Value` is what lands in the form. */
|
|
3
|
-
export interface SelectOption<Value extends string | number = string | number> {
|
|
3
|
+
export interface SelectOption<Value extends string | number = string | number, Meta = undefined> {
|
|
4
4
|
readonly value: Value;
|
|
5
5
|
readonly label: string;
|
|
6
6
|
/** A caption at the end of the row (tells equal names apart). */
|
|
@@ -10,14 +10,27 @@ export interface SelectOption<Value extends string | number = string | number> {
|
|
|
10
10
|
readonly disabled?: boolean;
|
|
11
11
|
/** Options with the same group are listed together, under its name, in the order the groups first appear. */
|
|
12
12
|
readonly group?: string;
|
|
13
|
+
/** Whatever else the app knows about the option (a vehicle's VIN and photo, a category); typed through `#option`. */
|
|
14
|
+
readonly meta?: Meta;
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
/** An option whose `meta` is there: what the `#option` slot reads. */
|
|
17
|
+
export type OptionWithMeta<Value extends string | number, Meta> = SelectOption<Value, Meta> & {
|
|
18
|
+
readonly meta: Meta;
|
|
19
|
+
};
|
|
20
|
+
/** What an `#option` slot receives for one row: the option, whether it is the highlighted (or focused) row, and whether it is the chosen one. */
|
|
21
|
+
export interface OptionSlotScope<Value extends string | number, Meta = undefined> {
|
|
22
|
+
/** The row's option, with the `meta` the app gave it (give every option one when the slot reads it). */
|
|
23
|
+
readonly option: OptionWithMeta<Value, Meta>;
|
|
24
|
+
readonly active: boolean;
|
|
25
|
+
readonly selected: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface OptionGroup<Value extends string | number, Meta = undefined> {
|
|
15
28
|
readonly title: string | null;
|
|
16
|
-
readonly options: readonly SelectOption<Value>[];
|
|
29
|
+
readonly options: readonly SelectOption<Value, Meta>[];
|
|
17
30
|
}
|
|
18
31
|
/** The options split into their groups, in order; ungrouped ones first, under no title. */
|
|
19
|
-
export declare function groupOptions<Value extends string | number>(options: readonly SelectOption<Value>[]): readonly OptionGroup<Value>[];
|
|
32
|
+
export declare function groupOptions<Value extends string | number, Meta = undefined>(options: readonly SelectOption<Value, Meta>[]): readonly OptionGroup<Value, Meta>[];
|
|
20
33
|
/** Options whose label contains the text, ignoring case and accents. */
|
|
21
|
-
export declare function matchOptions<Value extends string | number>(options: readonly SelectOption<Value>[], query: string): readonly SelectOption<Value>[];
|
|
34
|
+
export declare function matchOptions<Value extends string | number, Meta = undefined>(options: readonly SelectOption<Value, Meta>[], query: string): readonly SelectOption<Value, Meta>[];
|
|
22
35
|
/** The text without case and accents: what matching compares. */
|
|
23
36
|
export declare const foldText: (text: string) => string;
|
|
@@ -5,9 +5,9 @@ import { type SelectOption } from "./options";
|
|
|
5
5
|
* `ComboField` (a record pick: what lands is the option's id). A source is a list filtered as the user types, or a
|
|
6
6
|
* function that asks the server for the text typed.
|
|
7
7
|
*/
|
|
8
|
-
export type SuggestionSource<Value extends string | number> = readonly SelectOption<Value>[] | ((query: string, context: {
|
|
8
|
+
export type SuggestionSource<Value extends string | number, Meta = undefined> = readonly SelectOption<Value, Meta>[] | ((query: string, context: {
|
|
9
9
|
signal: AbortSignal;
|
|
10
|
-
}) => Promise<readonly SelectOption<Value>[]>);
|
|
10
|
+
}) => Promise<readonly SelectOption<Value, Meta>[]>);
|
|
11
11
|
/** A text suggested to a free-text field, with a line of detail under it in the list ("Zagreb", "Croatia · 10 000"). What lands in the field is the text. */
|
|
12
12
|
export type TextSuggestion = string | {
|
|
13
13
|
readonly text: string;
|
|
@@ -43,8 +43,8 @@ export declare function useLatestLoad<Item>(): {
|
|
|
43
43
|
run: (load: (signal: AbortSignal) => Promise<readonly Item[]>, settle?: (found: readonly Item[]) => readonly Item[]) => Promise<void>;
|
|
44
44
|
cancel: () => void;
|
|
45
45
|
};
|
|
46
|
-
export interface SuggestionsOptions<Value extends string | number> {
|
|
47
|
-
source: () => SuggestionSource<Value> | undefined;
|
|
46
|
+
export interface SuggestionsOptions<Value extends string | number, Meta = undefined> {
|
|
47
|
+
source: () => SuggestionSource<Value, Meta> | undefined;
|
|
48
48
|
/** The fewest characters before a function source is asked. */
|
|
49
49
|
minLength: () => number;
|
|
50
50
|
/** Milliseconds to wait after the last key before a function source is asked. */
|
|
@@ -55,8 +55,8 @@ export interface SuggestionsOptions<Value extends string | number> {
|
|
|
55
55
|
/** The id the recent choices are kept under (the field's name); undefined: the field keeps none. */
|
|
56
56
|
recents: () => string | undefined;
|
|
57
57
|
}
|
|
58
|
-
export interface KeyHooks<Value extends string | number> {
|
|
59
|
-
pick(option: SelectOption<Value>): void;
|
|
58
|
+
export interface KeyHooks<Value extends string | number, Meta = undefined> {
|
|
59
|
+
pick(option: SelectOption<Value, Meta>): void;
|
|
60
60
|
/** Free text: Enter picks only a row the user moved to, so Enter keeps meaning "done" while a first suggestion merely waits for Tab. */
|
|
61
61
|
enterNeedsMove: boolean;
|
|
62
62
|
/** Tab: accept the completion; true when there was one (the key is then taken). */
|
|
@@ -67,20 +67,20 @@ export interface KeyHooks<Value extends string | number> {
|
|
|
67
67
|
* lands), keeps the highlighted row, the recent choices shown before typing, and the keys. The field owns the text and
|
|
68
68
|
* the input; it calls `ask` on every keystroke, `show` on focus, `close` on blur and `remember` on a pick.
|
|
69
69
|
*/
|
|
70
|
-
export declare function useSuggestions<Value extends string | number>(options: SuggestionsOptions<Value>): {
|
|
71
|
-
items: import("vue").ComputedRef<readonly SelectOption<Value>[]>;
|
|
70
|
+
export declare function useSuggestions<Value extends string | number, Meta = undefined>(options: SuggestionsOptions<Value, Meta>): {
|
|
71
|
+
items: import("vue").ComputedRef<readonly SelectOption<Value, Meta>[]>;
|
|
72
72
|
showingRecent: import("vue").ComputedRef<boolean>;
|
|
73
73
|
status: import("vue").Ref<SuggestionStatus, SuggestionStatus>;
|
|
74
74
|
open: import("vue").Ref<boolean, boolean>;
|
|
75
75
|
highlighted: import("vue").Ref<number, number>;
|
|
76
76
|
moved: import("vue").Ref<boolean, boolean>;
|
|
77
|
-
current: import("vue").ComputedRef<SelectOption<Value> | undefined>;
|
|
77
|
+
current: import("vue").ComputedRef<SelectOption<Value, Meta> | undefined>;
|
|
78
78
|
ask: (next: string) => void;
|
|
79
79
|
show: (next: string) => void;
|
|
80
80
|
close: () => void;
|
|
81
81
|
cancel: () => void;
|
|
82
|
-
remember: (option: SelectOption<Value>) => void;
|
|
82
|
+
remember: (option: SelectOption<Value, Meta>) => void;
|
|
83
83
|
highlight: (index: number, byUser?: boolean) => void;
|
|
84
|
-
keydown: (event: KeyboardEvent, hooks: KeyHooks<Value>) => void;
|
|
84
|
+
keydown: (event: KeyboardEvent, hooks: KeyHooks<Value, Meta>) => void;
|
|
85
85
|
};
|
|
86
|
-
export type Suggestions<Value extends string | number> = ReturnType<typeof useSuggestions<Value>>;
|
|
86
|
+
export type Suggestions<Value extends string | number, Meta = undefined> = ReturnType<typeof useSuggestions<Value, Meta>>;
|
|
@@ -5,10 +5,10 @@ import { type SuggestionStatus } from "./suggestions";
|
|
|
5
5
|
* landed (kept while the next is loading, so the chosen option keeps its label). Pass it where a list goes:
|
|
6
6
|
* `<SelectField :options="models" />`, `<MultiSelectField :options="models" />`.
|
|
7
7
|
*/
|
|
8
|
-
export interface AsyncOptions<Value extends string | number = string | number> {
|
|
8
|
+
export interface AsyncOptions<Value extends string | number = string | number, Meta = undefined> {
|
|
9
9
|
/** `idle`: nothing to ask yet (the input this depends on is empty). */
|
|
10
10
|
readonly status: SuggestionStatus;
|
|
11
|
-
readonly options: readonly SelectOption<Value>[];
|
|
11
|
+
readonly options: readonly SelectOption<Value, Meta>[];
|
|
12
12
|
/**
|
|
13
13
|
* Counts how often the input these options depend on moved away from a value (the user picked another make). A field clears
|
|
14
14
|
* a value the options lack only when options land for a newer generation: never on the first load (a saved value the list no
|
|
@@ -19,7 +19,7 @@ export interface AsyncOptions<Value extends string | number = string | number> {
|
|
|
19
19
|
reload(): void;
|
|
20
20
|
}
|
|
21
21
|
/** What a select takes as its options: a list, or one that loads. */
|
|
22
|
-
export type OptionsSource<Value extends string | number> = readonly SelectOption<Value>[] | AsyncOptions<Value>;
|
|
22
|
+
export type OptionsSource<Value extends string | number, Meta = undefined> = readonly SelectOption<Value, Meta>[] | AsyncOptions<Value, Meta>;
|
|
23
23
|
export interface OptionsContext {
|
|
24
24
|
/** Aborted when a newer ask replaced this one or the scope ended: pass it on to the request. */
|
|
25
25
|
readonly signal: AbortSignal;
|
|
@@ -37,13 +37,13 @@ export interface OptionsContext {
|
|
|
37
37
|
* `for` is a getter of the input the options depend on (reactive); `null` or `undefined` asks nothing (the list is empty, `idle`), anything
|
|
38
38
|
* else asks, again whenever it changes. Without `for` the options load once.
|
|
39
39
|
*/
|
|
40
|
-
export declare function useOptions<Input, Value extends string | number>(options: {
|
|
40
|
+
export declare function useOptions<Input, Value extends string | number, Meta = undefined>(options: {
|
|
41
41
|
readonly for: () => Input | null | undefined;
|
|
42
|
-
readonly load: (input: Input, context: OptionsContext) => Promise<readonly SelectOption<Value>[]>;
|
|
43
|
-
}): AsyncOptions<Value>;
|
|
44
|
-
export declare function useOptions<Value extends string | number>(options: {
|
|
45
|
-
readonly load: (context: OptionsContext) => Promise<readonly SelectOption<Value>[]>;
|
|
46
|
-
}): AsyncOptions<Value>;
|
|
42
|
+
readonly load: (input: Input, context: OptionsContext) => Promise<readonly SelectOption<Value, Meta>[]>;
|
|
43
|
+
}): AsyncOptions<Value, Meta>;
|
|
44
|
+
export declare function useOptions<Value extends string | number, Meta = undefined>(options: {
|
|
45
|
+
readonly load: (context: OptionsContext) => Promise<readonly SelectOption<Value, Meta>[]>;
|
|
46
|
+
}): AsyncOptions<Value, Meta>;
|
|
47
47
|
/**
|
|
48
48
|
* What a select makes of its `options` prop, a list or a loader: the options known (also the stale ones while loading, so the
|
|
49
49
|
* chosen label stays), the rows to list (none while loading or failed), the status for the control and the list, and `arrived`,
|
|
@@ -51,9 +51,9 @@ export declare function useOptions<Value extends string | number>(options: {
|
|
|
51
51
|
* another make, or emptied it), so the field can drop a value they do not contain. The first load and a reload of the same
|
|
52
52
|
* input never call it.
|
|
53
53
|
*/
|
|
54
|
-
export declare function useOptionSource<Value extends string | number>(source: () => OptionsSource<Value>, arrived: (options: readonly SelectOption<Value>[]) => void): {
|
|
55
|
-
known: import("vue").ComputedRef<readonly SelectOption<Value>[]>;
|
|
56
|
-
rows: import("vue").ComputedRef<readonly SelectOption<Value>[]>;
|
|
54
|
+
export declare function useOptionSource<Value extends string | number, Meta = undefined>(source: () => OptionsSource<Value, Meta>, arrived: (options: readonly SelectOption<Value, Meta>[]) => void): {
|
|
55
|
+
known: import("vue").ComputedRef<readonly SelectOption<Value, Meta>[]>;
|
|
56
|
+
rows: import("vue").ComputedRef<readonly SelectOption<Value, Meta>[]>;
|
|
57
57
|
status: import("vue").ComputedRef<SuggestionStatus>;
|
|
58
58
|
loading: import("vue").ComputedRef<boolean>;
|
|
59
59
|
reload: () => void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
import { type Command } from "./useCommand";
|
|
3
|
+
import type { FormOptions, SubmitContext } from "./useForm";
|
|
4
|
+
export interface RecordDialogOptions<Values extends object, Output = Values, Done = unknown, Row = never> extends FormOptions<Values, Output> {
|
|
5
|
+
/** A new record: one call with the validator's output. */
|
|
6
|
+
readonly create: (input: Output, context: SubmitContext) => Promise<Done>;
|
|
7
|
+
/** An existing one: the row that was opened, and the output. Leave it out for a dialog that only adds. */
|
|
8
|
+
readonly update?: (row: Row, input: Output, context: SubmitContext) => Promise<Done>;
|
|
9
|
+
/** What the dialog shows for a row, laid over `defaults` (so a field the row lacks shows its default). */
|
|
10
|
+
readonly toValues?: (row: Row) => Partial<Values>;
|
|
11
|
+
/** After the call went through: the page updates itself (reload, toast). `editing` is the row that was saved, `null` for a new record, as it was when the save ran. */
|
|
12
|
+
readonly done?: (result: Done, context: {
|
|
13
|
+
readonly editing: Row | null;
|
|
14
|
+
}) => Promise<unknown> | unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface RecordDialog<Values extends object, Output = Values, Done = unknown, Row = never> {
|
|
17
|
+
/** For `<CommandDialog :command="dialog.command">`. */
|
|
18
|
+
readonly command: Command<Values, Output, Done>;
|
|
19
|
+
/** The dialog's inputs (`dialog.form.bind('name')`). */
|
|
20
|
+
readonly form: Command<Values, Output, Done>["form"];
|
|
21
|
+
/** The row being edited, `null` for a new record: the title, the fields that only a new one has, "Save and add another". */
|
|
22
|
+
readonly editing: Readonly<Ref<Row | null>>;
|
|
23
|
+
/** Opens the dialog for a new record, with the defaults. */
|
|
24
|
+
create(): void;
|
|
25
|
+
/** Opens it for `row`: `toValues(row)` over the defaults. */
|
|
26
|
+
edit(row: Row): void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A small record that is added and edited in one dialog (an admin list's rows): a `useCommand` whose call is `create` for a new
|
|
30
|
+
* record and `update` for an edited one, chosen by `editing`. The dialog (`CommandDialog`) brings the discard guard, the "saved"
|
|
31
|
+
* beat, field errors and the failure banner; "Save and add another" is `run({ addAnother: true })` in its `#actions`, shown only
|
|
32
|
+
* while `!dialog.editing.value` (it opens a fresh, new one).
|
|
33
|
+
*
|
|
34
|
+
* const dialog = useRecordDialog({
|
|
35
|
+
* defaults: () => ({ name: "", active: true }),
|
|
36
|
+
* validator: categorySchema,
|
|
37
|
+
* toValues: (category: Category) => ({ name: category.name, active: category.active }),
|
|
38
|
+
* create: (input, { idempotencyKey }) => api.createCategory(input, idempotencyKey),
|
|
39
|
+
* update: (category, input, { idempotencyKey }) => api.updateCategory(category.id, input, idempotencyKey),
|
|
40
|
+
* done: (_result, { editing }) => toast.success(t(editing ? "updated" : "created")),
|
|
41
|
+
* });
|
|
42
|
+
* <Button @click="dialog.create()">New</Button> <Button @click="dialog.edit(row)">Edit</Button>
|
|
43
|
+
* <CommandDialog :command="dialog.command" :title="dialog.editing.value ? t('edit') : t('new')" :confirm-label="t('save')"><TextField v-bind="dialog.form.bind('name')" /></CommandDialog>
|
|
44
|
+
*
|
|
45
|
+
* A record that must be read first is read by the page, which then calls `edit(record)`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function useRecordDialog<Values extends object, Output = Values, Done = unknown, Row = never>(options: RecordDialogOptions<Values, Output, Done, Row>): RecordDialog<Values, Output, Done, Row>;
|
package/dist/format/index.js
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { d as T } from "./context-Ch1r4fdN.js";
|
|
2
|
+
import { i as m } from "./intlLocale-CeRU44qJ.js";
|
|
3
|
+
const b = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
4
|
+
function o(n) {
|
|
5
|
+
if (n == null || n === "") return null;
|
|
6
|
+
let r;
|
|
7
|
+
if (n instanceof Date) r = n;
|
|
8
|
+
else if (typeof n == "number") r = new Date(n);
|
|
9
|
+
else {
|
|
10
|
+
const i = b.exec(n);
|
|
11
|
+
r = i ? new Date(Number(i[1]), Number(i[2]) - 1, Number(i[3])) : new Date(n);
|
|
12
|
+
}
|
|
13
|
+
return Number.isNaN(r.getTime()) || r.getTime() <= 0 ? null : r;
|
|
14
|
+
}
|
|
15
|
+
const u = { year: "numeric", month: "2-digit", day: "2-digit" }, d = { hour: "2-digit", minute: "2-digit" }, c = [
|
|
16
|
+
["year", 31536e3],
|
|
17
|
+
["month", 2592e3],
|
|
18
|
+
["week", 604800],
|
|
19
|
+
["day", 86400],
|
|
20
|
+
["hour", 3600],
|
|
21
|
+
["minute", 60],
|
|
22
|
+
["second", 1]
|
|
23
|
+
];
|
|
24
|
+
function y() {
|
|
25
|
+
const n = /* @__PURE__ */ new Map(), r = (t, e) => {
|
|
26
|
+
let a = n.get(t);
|
|
27
|
+
return a || (a = e(), n.set(t, a)), a;
|
|
28
|
+
}, i = (t, e) => r(`d|${t}|${JSON.stringify(e)}`, () => new Intl.DateTimeFormat(m(t), e));
|
|
29
|
+
return {
|
|
30
|
+
date: (t, e) => i(e, u).format(t),
|
|
31
|
+
dateTime: (t, e) => i(e, { ...u, ...d }).format(t),
|
|
32
|
+
time: (t, e) => i(e, d).format(t),
|
|
33
|
+
number: (t, e, a) => r(`n|${e}|${JSON.stringify(a ?? {})}`, () => new Intl.NumberFormat(m(e), a)).format(t),
|
|
34
|
+
money: (t, e, a) => r(`m|${a}|${e}`, () => new Intl.NumberFormat(m(a), { style: "currency", currency: e })).format(t),
|
|
35
|
+
relative(t, e, a) {
|
|
36
|
+
const s = Math.trunc((t.getTime() - a.getTime()) / 1e3), [f, l] = c.find(([, g]) => Math.abs(s) >= g) ?? c[c.length - 1];
|
|
37
|
+
return r(`r|${e}`, () => new Intl.RelativeTimeFormat(m(e), { numeric: "auto" })).format(Math.trunc(s / l), f);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function w(n) {
|
|
42
|
+
const r = { ...y(), ...n.formatters }, i = (t) => typeof t == "number" && Number.isFinite(t);
|
|
43
|
+
return {
|
|
44
|
+
get locale() {
|
|
45
|
+
return n.locale();
|
|
46
|
+
},
|
|
47
|
+
date: (t) => {
|
|
48
|
+
const e = o(t);
|
|
49
|
+
return e ? r.date(e, n.locale()) : "";
|
|
50
|
+
},
|
|
51
|
+
dateTime: (t) => {
|
|
52
|
+
const e = o(t);
|
|
53
|
+
return e ? r.dateTime(e, n.locale()) : "";
|
|
54
|
+
},
|
|
55
|
+
time: (t) => {
|
|
56
|
+
const e = o(t);
|
|
57
|
+
return e ? r.time(e, n.locale()) : "";
|
|
58
|
+
},
|
|
59
|
+
number: (t, e) => i(t) ? r.number(t, n.locale(), e) : "",
|
|
60
|
+
money: (t, e) => i(t) ? r.money(t, e, n.locale()) : "",
|
|
61
|
+
relative: (t, e = /* @__PURE__ */ new Date()) => {
|
|
62
|
+
const a = o(t);
|
|
63
|
+
return a ? r.relative(a, n.locale(), e) : "";
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const [N, D] = T("vue-core.formatting");
|
|
68
|
+
function I(n, r) {
|
|
69
|
+
n.provide(N, r);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
y as a,
|
|
73
|
+
w as c,
|
|
74
|
+
N as f,
|
|
75
|
+
I as i,
|
|
76
|
+
o as t,
|
|
77
|
+
D as u
|
|
78
|
+
};
|
package/dist/identity/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as t, h as n, j as a, i, k as o, d as r, l as d, m as u, n as y, r as l, o as I, s as f, q as p, t as A, f as c } from "../index-
|
|
1
|
+
import { _ as t, h as n, j as a, i, k as o, d as r, l as d, m as u, n as y, r as l, o as I, s as f, q as p, t as A, f as c } from "../index-sYamgVg7.js";
|
|
2
2
|
export {
|
|
3
3
|
t as SignInAsButton,
|
|
4
4
|
n as identityFeature,
|
|
@@ -8,11 +8,11 @@ import { _ as me } from "./AccountMenuItem.vue_vue_type_script_setup_true_lang-C
|
|
|
8
8
|
import { f as ve } from "./transport-BnP7WC0Y.js";
|
|
9
9
|
import { u as pe } from "./mediaQuery-CygcXmFW.js";
|
|
10
10
|
import { _ as be } from "./Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js";
|
|
11
|
-
import { _ as _e } from "./Popover.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import { _ as _e } from "./Popover.vue_vue_type_script_setup_true_lang-BTOzgIQF.js";
|
|
12
12
|
import { _ as H } from "./HeaderAction.vue_vue_type_script_setup_true_lang-Cgji-Jrr.js";
|
|
13
13
|
import { useRouter as ge } from "vue-router";
|
|
14
14
|
import { _ as F } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
15
|
-
import { u as ye } from "./format-
|
|
15
|
+
import { u as ye } from "./format-D8X4zsx6.js";
|
|
16
16
|
import { _ as xe } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
17
17
|
import { _ as he } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
|
|
18
18
|
const M = {
|
|
@@ -31,9 +31,9 @@ const M = {
|
|
|
31
31
|
deadLettersRetryAll: y("POST", "/v1/events/dead-letters/retry", { permission: "events.deadletter:retry" }),
|
|
32
32
|
consumers: y("GET", "/v1/events/consumers", { permission: "events.deadletter:view" })
|
|
33
33
|
}, [ke, ee] = fe("vue-core.notifications"), we = "events.deadletter:view", bt = "events.deadletter:retry", J = Z({
|
|
34
|
-
index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-
|
|
34
|
+
index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-Bq5YpnvT.js"), meta: { access: we, titleKey: "core.notifications.dead_letters.title" } }
|
|
35
35
|
}), j = Z({
|
|
36
|
-
index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-
|
|
36
|
+
index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-BnEpURcU.js"), meta: { titleKey: "core.notifications.settings.title" } }
|
|
37
37
|
}), Te = /* @__PURE__ */ z({
|
|
38
38
|
__name: "SettingsMenuItem",
|
|
39
39
|
setup(o) {
|
|
@@ -15,12 +15,12 @@ import { _ as Q } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
|
15
15
|
import { _ as L } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
16
16
|
import { u as fe } from "./leaveGuard-Cc8yeLxM.js";
|
|
17
17
|
import { _ as he } from "./FormView.vue_vue_type_script_setup_true_lang-Dz5TZt92.js";
|
|
18
|
-
import { _ as ye } from "./TextField.vue_vue_type_script_setup_true_lang-
|
|
18
|
+
import { _ as ye } from "./TextField.vue_vue_type_script_setup_true_lang-CWgn-vGl.js";
|
|
19
19
|
import { u as ge } from "./mediaQuery-CygcXmFW.js";
|
|
20
20
|
import { u as ve } from "./useDialog-CXR3hN0G.js";
|
|
21
21
|
import { c as _e } from "./closeOverlays-CjVsIrpL.js";
|
|
22
22
|
import { u as be } from "./FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
|
|
23
|
-
import { u as we } from "./format-
|
|
23
|
+
import { u as we } from "./format-D8X4zsx6.js";
|
|
24
24
|
import { _ as xe } from "./AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js";
|
|
25
25
|
import { b as Ee } from "./routeResource-DlTsGTg_.js";
|
|
26
26
|
import { _ as Se } from "./AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js";
|
|
@@ -315,7 +315,7 @@ function Cs(e) {
|
|
|
315
315
|
const Ye = async (e) => {
|
|
316
316
|
await B(e.http);
|
|
317
317
|
}, Je = z({
|
|
318
|
-
login: { name: "login", path: "/login", component: () => import("./SignInPage-
|
|
318
|
+
login: { name: "login", path: "/login", component: () => import("./SignInPage-CRynZCU2.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
|
|
319
319
|
});
|
|
320
320
|
function Os(e = {}) {
|
|
321
321
|
return H({
|
|
@@ -334,7 +334,7 @@ function Os(e = {}) {
|
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
336
|
const Z = z({
|
|
337
|
-
index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-
|
|
337
|
+
index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-BqdCzyax.js"), meta: { titleKey: "core.profile.title" } }
|
|
338
338
|
}), Qe = /* @__PURE__ */ E({
|
|
339
339
|
__name: "ProfileMenuItem",
|
|
340
340
|
setup(e) {
|
|
@@ -358,19 +358,19 @@ function es(e) {
|
|
|
358
358
|
return { name: `users.record.${e.path}`, path: e.path, component: s, meta: { ...e.meta } };
|
|
359
359
|
}
|
|
360
360
|
const W = "iam.user:view", qs = "iam.user:manage", ss = "iam.user.activity:view", ee = z({
|
|
361
|
-
index: { name: "users.index", path: "/users", component: () => import("./UsersList-
|
|
361
|
+
index: { name: "users.index", path: "/users", component: () => import("./UsersList-CHAray61.js"), meta: { access: W, titleKey: "core.users.title" } },
|
|
362
362
|
record: {
|
|
363
363
|
name: "users.record",
|
|
364
364
|
path: "/users/:id",
|
|
365
|
-
component: () => import("./UserRecord-
|
|
365
|
+
component: () => import("./UserRecord-CqmPm4Fv.js"),
|
|
366
366
|
meta: { access: W, titleKey: "core.users.title", remountOnParam: "id" },
|
|
367
367
|
children: [
|
|
368
|
-
{ name: "users.record.general", path: "general", component: () => import("./General-
|
|
369
|
-
{ name: "users.record.signin", path: "signin", component: () => import("./SignIn-
|
|
370
|
-
{ name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-
|
|
371
|
-
{ name: "users.record.signins", path: "signins", component: () => import("./SignIns-
|
|
372
|
-
{ name: "users.record.changes", path: "changes", component: () => import("./Changes-
|
|
373
|
-
{ name: "users.record.activity", path: "activity", component: () => import("./Activity-
|
|
368
|
+
{ name: "users.record.general", path: "general", component: () => import("./General-DQruOZs2.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
|
|
369
|
+
{ name: "users.record.signin", path: "signin", component: () => import("./SignIn-DrLE0gNr.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
|
|
370
|
+
{ name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-BfpiOhGs.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
|
|
371
|
+
{ name: "users.record.signins", path: "signins", component: () => import("./SignIns-BQ8tISWn.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
|
|
372
|
+
{ name: "users.record.changes", path: "changes", component: () => import("./Changes-IIczcs6O.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
|
|
373
|
+
{ name: "users.record.activity", path: "activity", component: () => import("./Activity-DB9ABAMb.js"), meta: { access: ss, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
|
|
374
374
|
]
|
|
375
375
|
}
|
|
376
376
|
});
|
|
@@ -14,9 +14,9 @@ import { t as ee } from "./toast-CqSDTWRX.js";
|
|
|
14
14
|
import { _ as ce } from "./AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js";
|
|
15
15
|
import { _ as Oe } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
|
|
16
16
|
import { u as Ae } from "./useLoad-M7V-AVwR.js";
|
|
17
|
-
import { _ as De, a as Ke } from "./SelectField.vue_vue_type_script_setup_true_lang-
|
|
17
|
+
import { _ as De, a as Ke } from "./SelectField.vue_vue_type_script_setup_true_lang-DkbBJpYX.js";
|
|
18
18
|
import { _ as Be } from "./SegmentedField.vue_vue_type_script_setup_true_lang-BMBkEmxr.js";
|
|
19
|
-
import { u as Pe, _ as Ue } from "./useCommand-
|
|
19
|
+
import { u as Pe, _ as Ue } from "./useCommand-YN9EMb7s.js";
|
|
20
20
|
import { u as Fe } from "./platform-q3cjODLx.js";
|
|
21
21
|
import { _ as Ge } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
|
|
22
22
|
import { u as Me } from "./mediaQuery-CygcXmFW.js";
|
|
@@ -43,12 +43,12 @@ const C = {
|
|
|
43
43
|
viewAccess: "iam.user:view",
|
|
44
44
|
manageBindings: "iam.user:manage"
|
|
45
45
|
}, re = Ee({
|
|
46
|
-
roles: { name: "access.roles", path: "/iam/roles", component: () => import("./RolesPage-
|
|
47
|
-
newRole: { name: "access.roles.new", path: "/iam/roles/new", component: () => import("./NewRolePage-
|
|
46
|
+
roles: { name: "access.roles", path: "/iam/roles", component: () => import("./RolesPage-D0K7tEL-.js"), meta: { access: F.viewRoles, titleKey: "core.access.title" } },
|
|
47
|
+
newRole: { name: "access.roles.new", path: "/iam/roles/new", component: () => import("./NewRolePage-BcA8jBBQ.js"), meta: { access: F.manageRoles, titleKey: "core.access.new_title" } },
|
|
48
48
|
role: {
|
|
49
49
|
name: "access.role",
|
|
50
50
|
path: "/iam/roles/:ref",
|
|
51
|
-
component: () => import("./RolePage-
|
|
51
|
+
component: () => import("./RolePage-IES_ADt5.js"),
|
|
52
52
|
// A role's ref (its key, or the id of a custom one) swaps in place when a link leads to another role.
|
|
53
53
|
meta: { access: F.viewRoles, titleKey: "core.access.title", remountOnParam: "ref" }
|
|
54
54
|
}
|
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.4.
|
|
2
|
+
export declare const version = "0.4.18";
|
package/dist/index.js
CHANGED
package/dist/overlay/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as e } from "../AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
|
|
2
2
|
import { _ as a } from "../Menu.vue_vue_type_script_setup_true_lang-uPmxWvds.js";
|
|
3
|
-
import { _ as p } from "../Popover.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as p } from "../Popover.vue_vue_type_script_setup_true_lang-BTOzgIQF.js";
|
|
4
4
|
import { _ as m } from "../Toaster.vue_vue_type_script_setup_true_lang-55boRLAj.js";
|
|
5
5
|
import { _ as x } from "../Tooltip.vue_vue_type_script_setup_true_lang-OOD_XNWx.js";
|
|
6
6
|
import { t as T } from "../toast-CqSDTWRX.js";
|
package/dist/page/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { _ as x } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { a as W, b as X, c as Y, d as Z, p as ee, u as te, e as ae } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as x } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-Bm0sxqNz.js";
|
|
2
|
+
import { a as W, b as X, c as Y, d as Z, p as ee, u as te, e as ae } from "../AdaptivePageShell.vue_vue_type_script_setup_true_lang-Bm0sxqNz.js";
|
|
3
3
|
import { _ as se } from "../BottomDock.vue_vue_type_script_setup_true_lang-CjN7xYEr.js";
|
|
4
4
|
import { b as ne, i as re, u as ie } from "../bottomDock-BZEiOPYZ.js";
|
|
5
5
|
import { defineComponent as v, openBlock as a, createBlock as b, withCtx as c, createElementVNode as s, normalizeStyle as k, createElementBlock as l, Fragment as y, renderList as B, normalizeClass as d, unref as h, createCommentVNode as p, toDisplayString as f, useModel as S, useId as C, useTemplateRef as P, computed as $, mergeProps as w, createSlots as T, renderSlot as m, mergeModels as D } from "vue";
|
|
6
6
|
import { _ as L } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
7
|
-
import { _ as ue } from "../RecordHeader.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import { _ as ue } from "../RecordHeader.vue_vue_type_script_setup_true_lang-DijFQnU6.js";
|
|
8
8
|
import { c as pe, i as fe, p as me, a as be, u as ge, b as ve } from "../chrome-nUcmVu8G.js";
|
|
9
9
|
import { s as z, u as I } from "../sectionIndex-BS0ic5W7.js";
|
|
10
10
|
import { p as _e, a as xe } from "../sectionIndex-BS0ic5W7.js";
|
|
11
|
-
import { _ as ye } from "../SectionNavigator.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { a as Se, _ as Ce } from "../SectionList.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import { _ as ye } from "../SectionNavigator.vue_vue_type_script_setup_true_lang-CW81A_bn.js";
|
|
12
|
+
import { a as Se, _ as Ce } from "../SectionList.vue_vue_type_script_setup_true_lang-D5QWy-c1.js";
|
|
13
13
|
import { _ as A } from "../Panel.vue_vue_type_script_setup_true_lang-BA0u_DtS.js";
|
|
14
14
|
const K = ["aria-label"], M = ["aria-label"], N = ["aria-selected", "tabindex", "onClick"], R = { class: "relative" }, E = {
|
|
15
15
|
key: 2,
|