@yomotech/view-toolkit 1.0.52 → 1.0.58
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/fesm2022/yomotech-view-toolkit-catalog.mjs +533 -41
- package/fesm2022/yomotech-view-toolkit-catalog.mjs.map +1 -1
- package/fesm2022/yomotech-view-toolkit.mjs +854 -254
- package/fesm2022/yomotech-view-toolkit.mjs.map +1 -1
- package/package.json +3 -2
- package/types/yomotech-view-toolkit-catalog.d.ts +201 -52
- package/types/yomotech-view-toolkit.d.ts +172 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yomotech/view-toolkit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/cdk": "^21.0.0",
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"primeicons": "^7.0.0",
|
|
28
28
|
"primeng": "^21.1.3",
|
|
29
29
|
"rxjs": "^7.8.1",
|
|
30
|
-
"@aparajita/capacitor-secure-storage": "^7.1.6"
|
|
30
|
+
"@aparajita/capacitor-secure-storage": "^7.1.6",
|
|
31
|
+
"pdfjs-dist": "^5.0.0"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"tslib": "^2.8.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Pure policy shared by inspectors and layout validation. No DTO mutation. */
|
|
2
|
-
type Bag = Record<string, any>;
|
|
2
|
+
type Bag$1 = Record<string, any>;
|
|
3
3
|
interface Setting {
|
|
4
4
|
key: string;
|
|
5
5
|
label: string;
|
|
@@ -8,12 +8,12 @@ interface Setting {
|
|
|
8
8
|
hint?: string;
|
|
9
9
|
}
|
|
10
10
|
declare const clone: <T>(value: T) => T;
|
|
11
|
-
declare function resolveProperty(root: Bag | any, reference: string): Bag;
|
|
11
|
+
declare function resolveProperty(root: Bag$1 | any, reference: string): Bag$1;
|
|
12
12
|
declare function normalizeFormat(value: string): string;
|
|
13
|
-
declare function baseType(schema: Bag | any, fallback: string): string;
|
|
14
|
-
declare function effectiveFormat(schema: Bag | any, fallback: string, data: Bag | any): string;
|
|
15
|
-
declare function rulesFor(schema: Bag | any, data: Bag | any): Bag;
|
|
16
|
-
declare function controlsFor(schema: Bag, fallback: string, option: Bag | any): {
|
|
13
|
+
declare function baseType(schema: Bag$1 | any, fallback: string): string;
|
|
14
|
+
declare function effectiveFormat(schema: Bag$1 | any, fallback: string, data: Bag$1 | any): string;
|
|
15
|
+
declare function rulesFor(schema: Bag$1 | any, data: Bag$1 | any): Bag$1;
|
|
16
|
+
declare function controlsFor(schema: Bag$1, fallback: string, option: Bag$1 | any): {
|
|
17
17
|
value: string;
|
|
18
18
|
label: string;
|
|
19
19
|
}[];
|
|
@@ -24,7 +24,7 @@ declare function controlsFor(schema: Bag, fallback: string, option: Bag | any):
|
|
|
24
24
|
* values); a list of two texts as check box or switch. "Read-only output" is no choice here - read only is set
|
|
25
25
|
* with protected.
|
|
26
26
|
*/
|
|
27
|
-
declare function controlChoicesFor(schema: Bag, fallback: string, option: Bag | any): {
|
|
27
|
+
declare function controlChoicesFor(schema: Bag$1, fallback: string, option: Bag$1 | any): {
|
|
28
28
|
value: string;
|
|
29
29
|
label: string;
|
|
30
30
|
}[];
|
|
@@ -36,13 +36,13 @@ declare const canonicalControl: (c: string) => any;
|
|
|
36
36
|
*/
|
|
37
37
|
declare const DATA_OBJECT_KEYS: readonly ["type"];
|
|
38
38
|
/** Where what older data objects carried is set now: on the layout field that shows the property. */
|
|
39
|
-
declare const DATA_OBJECT_PLACES: Bag;
|
|
39
|
+
declare const DATA_OBJECT_PLACES: Bag$1;
|
|
40
40
|
/**
|
|
41
41
|
* Where a page names a data object (objects/<name>.json) - a rename has to change every one of them,
|
|
42
42
|
* the Designer's rename and the AI contract use this list. The app's test flows name fields by their
|
|
43
43
|
* property alone, without the data object.
|
|
44
44
|
*/
|
|
45
|
-
declare const DATA_OBJECT_NAME_PLACES: Bag;
|
|
45
|
+
declare const DATA_OBJECT_NAME_PLACES: Bag$1;
|
|
46
46
|
/**
|
|
47
47
|
* Renames the data object oldName to newName at every place of DATA_OBJECT_NAME_PLACES inside a page
|
|
48
48
|
* layout (changed in place). Returns how many values were changed.
|
|
@@ -50,20 +50,20 @@ declare const DATA_OBJECT_NAME_PLACES: Bag;
|
|
|
50
50
|
declare function renameDataObject(layout: any, oldName: string, newName: string): number;
|
|
51
51
|
declare const BASIC_TYPES: readonly ["string", "number", "integer", "bigdecimal", "boolean", "date", "time", "datetime", "dateRange", "media", "array"];
|
|
52
52
|
/** Older or other names of a data type and the type they mean. */
|
|
53
|
-
declare const TYPE_ALIASES: Bag;
|
|
53
|
+
declare const TYPE_ALIASES: Bag$1;
|
|
54
54
|
/** The data type of a property, aliases resolved ("image" -> "media"). */
|
|
55
|
-
declare function basicType(property: Bag | any): string;
|
|
55
|
+
declare function basicType(property: Bag$1 | any): string;
|
|
56
56
|
/** Every control the Designer offers (option.control), with the name it is shown under. */
|
|
57
|
-
declare const CONTROLS: Bag;
|
|
57
|
+
declare const CONTROLS: Bag$1;
|
|
58
58
|
/** DTO types that name their control themselves (older projects). */
|
|
59
|
-
declare const CONTROL_TYPES: Bag;
|
|
59
|
+
declare const CONTROL_TYPES: Bag$1;
|
|
60
60
|
/**
|
|
61
61
|
* The control a field is shown with: option.control; without one what the app uses - an old switch
|
|
62
62
|
* (password, email, timeOnly), a DTO type that is a control (dropdown, creditCard, quantity), else
|
|
63
63
|
* the first control that fits the data (date -> datepicker, boolean -> checkbox, text -> textInput).
|
|
64
64
|
* '' when nothing fits (media, objects).
|
|
65
65
|
*/
|
|
66
|
-
declare function effectiveControl(option: Bag | any, schema?: Bag | any, fallback?: string): string;
|
|
66
|
+
declare function effectiveControl(option: Bag$1 | any, schema?: Bag$1 | any, fallback?: string): string;
|
|
67
67
|
/** Controls a value is typed or chosen in - they take a placeholder. */
|
|
68
68
|
declare const PLACEHOLDER_CONTROLS: string[];
|
|
69
69
|
/**
|
|
@@ -74,7 +74,7 @@ declare const PLACEHOLDER_CONTROLS: string[];
|
|
|
74
74
|
declare const CARD_LAYOUTS: readonly ["oneRow", "twoRows", "threeRows"];
|
|
75
75
|
type CardLayout = typeof CARD_LAYOUTS[number];
|
|
76
76
|
/** The card field's layout, oneRow when the layout names none or an unknown one. */
|
|
77
|
-
declare function cardLayoutOf(option: Bag | any): CardLayout;
|
|
77
|
+
declare function cardLayoutOf(option: Bag$1 | any): CardLayout;
|
|
78
78
|
/**
|
|
79
79
|
* The key at the bottom right of the app keyboard (option.enterKey), set in the Designer per field:
|
|
80
80
|
* done closes the keyboard (default), search sends Enter so the field's action runs (a search starts),
|
|
@@ -83,7 +83,7 @@ declare function cardLayoutOf(option: Bag | any): CardLayout;
|
|
|
83
83
|
declare const ENTER_KEYS: readonly ["done", "search", "next"];
|
|
84
84
|
type EnterKey = (typeof ENTER_KEYS)[number];
|
|
85
85
|
/** A field's key at the bottom right: its option.enterKey when known, else the given default. */
|
|
86
|
-
declare function enterKeyFor(option: Bag | any, fallback?: EnterKey): EnterKey;
|
|
86
|
+
declare function enterKeyFor(option: Bag$1 | any, fallback?: EnterKey): EnterKey;
|
|
87
87
|
/** The toolkit keyboards a field can ask for (option.keyboardType). */
|
|
88
88
|
declare const KEYBOARD_TYPES: readonly ["string", "alpha", "numeric", "email", "date", "time"];
|
|
89
89
|
/** keyboardType values that keep the device's system keyboard. */
|
|
@@ -91,18 +91,18 @@ declare const SYSTEM_KEYBOARDS: readonly ["native", "none"];
|
|
|
91
91
|
/** Controls a keyboard is chosen for. */
|
|
92
92
|
declare const KEYBOARD_CONTROLS: string[];
|
|
93
93
|
/** The keyboard a control brings when the field names none (as the Designer preselects it). */
|
|
94
|
-
declare function defaultKeyboard(control: string, schema?: Bag | any, fallback?: string, data?: Bag | any): string;
|
|
94
|
+
declare function defaultKeyboard(control: string, schema?: Bag$1 | any, fallback?: string, data?: Bag$1 | any): string;
|
|
95
95
|
/**
|
|
96
96
|
* The keyboard of a field: its keyboardType; native/none (and a password without one) keep the
|
|
97
97
|
* system keyboard (null); without keyboardType the control's default; without a control the data
|
|
98
98
|
* type's (date, time, number/integer, string, email format). The per-type keyboards are only the
|
|
99
99
|
* fallback.
|
|
100
100
|
*/
|
|
101
|
-
declare function keyboardFor(option: Bag | any, property?: Bag | any): string | null;
|
|
101
|
+
declare function keyboardFor(option: Bag$1 | any, property?: Bag$1 | any): string | null;
|
|
102
102
|
/** What a date/time property shows and takes: date and time stay separate fields. */
|
|
103
103
|
type TemporalPart = 'date' | 'time' | 'datetime';
|
|
104
104
|
/** The part of a date/time a property shows and takes (DTO type date / time / date&time), else null. */
|
|
105
|
-
declare function temporalPart(property: Bag | any): TemporalPart | null;
|
|
105
|
+
declare function temporalPart(property: Bag$1 | any): TemporalPart | null;
|
|
106
106
|
/**
|
|
107
107
|
* How date and time values travel - the same for every project:
|
|
108
108
|
* - every value is a string (JSON has no date type); the app turns it into a date for showing and
|
|
@@ -110,34 +110,34 @@ declare function temporalPart(property: Bag | any): TemporalPart | null;
|
|
|
110
110
|
* - read: ISO, date and time, a value without timezone is local wall time; Z or an offset is
|
|
111
111
|
* dropped (wall time) - P5W1 sends 2025-11-04T16:30:00
|
|
112
112
|
* - send: ISO with the device's offset, 2026-10-18T08:00:00+02:00 (the daily split of the time
|
|
113
|
-
* recording,
|
|
113
|
+
* recording, its add-on, stays as it is)
|
|
114
114
|
* - shown and typed: the app language, year with four digits (de 18.10.2026, time 08:05);
|
|
115
|
-
* lists: displayFormat short / medium (default) / long / custom
|
|
115
|
+
* lists: displayFormat short / medium (default) / long / iso (2026-10-30 in every language) / custom
|
|
116
116
|
*/
|
|
117
117
|
declare const TEMPORAL_TRANSFER: {
|
|
118
118
|
readonly read: "iso, local wall time, offset dropped";
|
|
119
119
|
readonly send: "iso with local offset";
|
|
120
120
|
readonly show: "app language, four-digit year";
|
|
121
|
-
readonly listStyles: readonly ["short", "medium", "long", "custom"];
|
|
121
|
+
readonly listStyles: readonly ["short", "medium", "long", "iso", "custom"];
|
|
122
122
|
readonly listDefault: "medium";
|
|
123
123
|
};
|
|
124
124
|
/** The encodings a field can declare (option.fieldData.format). */
|
|
125
125
|
declare const DATA_FORMATS: readonly ["iso-date", "iso-time", "iso-datetime", "flag", "decimal"];
|
|
126
126
|
/** How a date or time is shown (option.displayFormat). */
|
|
127
|
-
declare const DISPLAY_FORMATS: readonly ["short", "medium", "long", "custom"];
|
|
127
|
+
declare const DISPLAY_FORMATS: readonly ["short", "medium", "long", "iso", "custom"];
|
|
128
128
|
/** How a number is shown (option.numberStyle). */
|
|
129
129
|
declare const NUMBER_STYLES: readonly ["decimal", "currency", "percent"];
|
|
130
|
-
declare function displaySettings(schema: Bag, fallback: string, option: Bag | any): Setting[];
|
|
131
|
-
declare function dataSettings(schema: Bag, fallback: string, option: Bag | any): Setting[];
|
|
132
|
-
declare function validationSettings(schema: Bag, fallback: string, option: Bag | any): Setting[];
|
|
133
|
-
declare function validateSettings(schema: Bag | any, fallback: string, option: Bag | any, context?: {
|
|
134
|
-
propertySchema: Bag;
|
|
130
|
+
declare function displaySettings(schema: Bag$1, fallback: string, option: Bag$1 | any): Setting[];
|
|
131
|
+
declare function dataSettings(schema: Bag$1, fallback: string, option: Bag$1 | any): Setting[];
|
|
132
|
+
declare function validationSettings(schema: Bag$1, fallback: string, option: Bag$1 | any): Setting[];
|
|
133
|
+
declare function validateSettings(schema: Bag$1 | any, fallback: string, option: Bag$1 | any, context?: {
|
|
134
|
+
propertySchema: Bag$1;
|
|
135
135
|
reference: string;
|
|
136
136
|
allowPendingValues?: boolean;
|
|
137
137
|
}): string[];
|
|
138
138
|
/** Call before activating a saved field layout; throws rather than warning. */
|
|
139
|
-
declare function assertFieldSettings(schema: Bag, fallback: string, option: Bag, context?: {
|
|
140
|
-
propertySchema: Bag;
|
|
139
|
+
declare function assertFieldSettings(schema: Bag$1, fallback: string, option: Bag$1, context?: {
|
|
140
|
+
propertySchema: Bag$1;
|
|
141
141
|
reference: string;
|
|
142
142
|
allowPendingValues?: boolean;
|
|
143
143
|
}): void;
|
|
@@ -160,9 +160,9 @@ declare const TEST_DEVICES: readonly ["mobile", "tablet", "laptop", "desktop"];
|
|
|
160
160
|
/** Old spellings of a device, still taken: "phone" is "mobile" (2026-10-31, the preview's word). */
|
|
161
161
|
declare const OLD_DEVICE_NAMES: Record<string, string>;
|
|
162
162
|
declare const ORIENTATIONS: readonly ["portrait", "landscape"];
|
|
163
|
-
declare const STEP_KINDS: readonly ["open", "menu", "tap", "type", "pick", "press", "scroll", "openRecord", "close", "cart", "rotate", "device", "wait", "language", "reload", "signIn", "expect"];
|
|
163
|
+
declare const STEP_KINDS: readonly ["open", "menu", "tap", "type", "pick", "press", "scroll", "openRecord", "ifRecords", "goToPage", "close", "cart", "rotate", "device", "wait", "language", "reload", "signIn", "signOut", "expect"];
|
|
164
164
|
/** What an expect step can check - one of them per step. */
|
|
165
|
-
declare const EXPECT_KINDS: readonly ["value", "shows", "keyboard", "list", "message", "visible", "hidden", "locked", "blocked", "inFrame", "page", "records", "recordsAtLeast", "samePlace", "cartCount", "toast", "checked", "unchecked", "cardRows", "formatted", "translated", "fieldVisible", "restored", "layout"];
|
|
165
|
+
declare const EXPECT_KINDS: readonly ["value", "shows", "keyboard", "list", "message", "visible", "hidden", "locked", "blocked", "inFrame", "page", "records", "recordsAtLeast", "listLoaded", "pdf", "samePlace", "cartCount", "toast", "checked", "unchecked", "cardRows", "formatted", "translated", "fieldVisible", "restored", "layout"];
|
|
166
166
|
/** How a value is shown in the language's form (expect formatted). */
|
|
167
167
|
declare const FORMATS: readonly ["date", "time", "datetime", "number", "currency"];
|
|
168
168
|
/** Languages written right to left - not tested until right-to-left is supported (decision 2026-10-30). */
|
|
@@ -194,6 +194,10 @@ interface TestExpect {
|
|
|
194
194
|
/** the records the open list shows now (exactly / at least) */
|
|
195
195
|
records?: number;
|
|
196
196
|
recordsAtLeast?: number;
|
|
197
|
+
/** the open list has finished loading without a failure - it may be empty (live data) */
|
|
198
|
+
listLoaded?: true;
|
|
199
|
+
/** true: the PDF viewer shows a page; false: no viewer open */
|
|
200
|
+
pdf?: boolean;
|
|
197
201
|
/** back with the X the list stands where it was left (records and scroll position before openRecord) */
|
|
198
202
|
samePlace?: true;
|
|
199
203
|
/** items in the cart (the header's count); "+1" = one more than at the flow's last cart check */
|
|
@@ -233,10 +237,14 @@ interface TestStep {
|
|
|
233
237
|
press?: string;
|
|
234
238
|
/** pages to go on in the open list (swipe up / its end into view), 1-20 */
|
|
235
239
|
scroll?: number;
|
|
240
|
+
/** a list with page numbers: the number n is pressed; fewer pages than n is noted, not failed */
|
|
241
|
+
goToPage?: number;
|
|
236
242
|
/** a record of the open list by its position (1 = first) or by its shown name - its link opens its page */
|
|
237
243
|
openRecord?: number | string;
|
|
238
244
|
/** the page X - back to the page before */
|
|
239
245
|
close?: true;
|
|
246
|
+
/** with an empty list the rest of the flow is skipped - noted, not failed */
|
|
247
|
+
ifRecords?: true;
|
|
240
248
|
/** the cart in the header */
|
|
241
249
|
cart?: true;
|
|
242
250
|
rotate?: Orientation;
|
|
@@ -248,6 +256,8 @@ interface TestStep {
|
|
|
248
256
|
/** signed in from here on: already signed in - done; else a person signs in (preview, the runner waits) or the
|
|
249
257
|
* runner signs in with the test user (simulators, signin.mjs). A test never types a name or password. */
|
|
250
258
|
signIn?: true | string;
|
|
259
|
+
/** signed out from here on - the sign-out of the user in the side menu, like a person; signed out already: done */
|
|
260
|
+
signOut?: true;
|
|
251
261
|
/** milliseconds */
|
|
252
262
|
wait?: number;
|
|
253
263
|
expect?: TestExpect;
|
|
@@ -336,6 +346,22 @@ declare function parseDevice(text: string): {
|
|
|
336
346
|
device: TestDevice;
|
|
337
347
|
orientation: Orientation;
|
|
338
348
|
} | null;
|
|
349
|
+
/**
|
|
350
|
+
* Stripe's test cards and the test payment methods Stripe has for them (stripe.com/docs/testing). A test run cannot
|
|
351
|
+
* type into Stripe's card frame (another site's frame) - the card field pays with the test payment method instead.
|
|
352
|
+
*/
|
|
353
|
+
declare const STRIPE_TEST_CARDS: Readonly<Record<string, string>>;
|
|
354
|
+
/**
|
|
355
|
+
* The Stripe test payment method for a card number typed in a test ("4242 4242 4242 4242"), or null: only a test
|
|
356
|
+
* card of STRIPE_TEST_CARDS and only with a test key (pk_test_) - a live key never pays this way.
|
|
357
|
+
*/
|
|
358
|
+
declare function stripeTestPaymentMethod(cardNumber: string, publishableKey: string): string | null;
|
|
359
|
+
/** The devices that type on the app's own keyboard. A laptop or desktop types on its own keyboard - nothing opens. */
|
|
360
|
+
declare const APP_KEYBOARD_DEVICES: readonly TestDevice[];
|
|
361
|
+
/** Does the device ("tablet:landscape") type on the app's keyboard? The keyboard checks are only for those. */
|
|
362
|
+
declare function hasAppKeyboard(device: string): boolean;
|
|
363
|
+
/** A check about the app's keyboard - made only where the app keyboard opens (hasAppKeyboard). */
|
|
364
|
+
declare function isKeyboardCheck(e: TestExpect | undefined): boolean;
|
|
339
365
|
/** The devices a flow runs on. */
|
|
340
366
|
declare function flowDevices(flow: TestFlow): string[];
|
|
341
367
|
/** The kind of a step - the first step key it has. */
|
|
@@ -351,9 +377,9 @@ declare function dateOrder(lang: string): string;
|
|
|
351
377
|
* (en 10302026, de 30102026), a time as digits with P/A in a 12-hour language (0200P) or 24 hours (1400), a number
|
|
352
378
|
* with the language's decimal sign (de 12,50). Any other text stays as it is - older flows typed the keys themselves.
|
|
353
379
|
*/
|
|
354
|
-
declare function localeKeys(value: string, lang: string): string;
|
|
380
|
+
declare function localeKeys(value: string, lang: string, dateDisplay?: string): string;
|
|
355
381
|
/** Every way the language writes this value (expect formatted) - the field must show one of them; spaces are made plain. */
|
|
356
|
-
declare function localeRenderings(value: string, as: typeof FORMATS[number], lang: string, currency?: string): string[];
|
|
382
|
+
declare function localeRenderings(value: string, as: typeof FORMATS[number], lang: string, currency?: string, dateDisplay?: string): string[];
|
|
357
383
|
/** One element on the page as the runner measured it (layoutProblems). */
|
|
358
384
|
interface LayoutBox {
|
|
359
385
|
/** what it is: field, button, label, text */
|
|
@@ -433,13 +459,19 @@ declare function withTestData(flow: TestFlow, data: any): {
|
|
|
433
459
|
declare function checkTestFlow(flow: any, data?: any): TestProblem[];
|
|
434
460
|
/**
|
|
435
461
|
* How fast a run goes - chosen only where the run is started (preview: the choice beside "Run tests"; devices:
|
|
436
|
-
* --tempo=…), never in a test (user 2026-11-01):
|
|
437
|
-
* (a long pause, to watch it). The checks' time limits start after the pause.
|
|
462
|
+
* --tempo=…), never in a test (user 2026-11-01): the seconds before each step (user 2026-11-04), or one of the names
|
|
463
|
+
* fast (no pause), normal (a short pause), slow (a long pause, to watch it). The checks' time limits start after the pause.
|
|
438
464
|
*/
|
|
439
465
|
declare const TEST_TEMPOS: readonly ["fast", "normal", "slow"];
|
|
440
466
|
type TestTempo = (typeof TEST_TEMPOS)[number];
|
|
441
|
-
/**
|
|
442
|
-
|
|
467
|
+
/**
|
|
468
|
+
* The seconds before each step when nobody chose. A form takes a typed value only in a later task of the browser: a step
|
|
469
|
+
* right after the typing found the field still empty; a person's next click is always later (measured 2026-11-04: 0.1 is
|
|
470
|
+
* enough, 0.2 leaves a margin).
|
|
471
|
+
*/
|
|
472
|
+
declare const DEFAULT_TEMPO_SECONDS = 0.2;
|
|
473
|
+
/** The pause before a step in ms - from seconds or a name; unknown tempo: fast. */
|
|
474
|
+
declare function tempoPause(tempo: string | number | undefined): number;
|
|
443
475
|
|
|
444
476
|
/**
|
|
445
477
|
* The app's test users (.liveforge/test-data.json testUsers) - name -> where its sign-in data stand in Vault, e.g.
|
|
@@ -554,8 +586,8 @@ interface AppSettings {
|
|
|
554
586
|
storage: LoginStorage;
|
|
555
587
|
roleKey: string;
|
|
556
588
|
/** role -> its own start page, in the Designer's order */
|
|
557
|
-
roles: Record<string, Bag>;
|
|
558
|
-
loginPage: Bag | null;
|
|
589
|
+
roles: Record<string, Bag$1>;
|
|
590
|
+
loginPage: Bag$1 | null;
|
|
559
591
|
};
|
|
560
592
|
pagination: Pagination;
|
|
561
593
|
terms: {
|
|
@@ -586,37 +618,37 @@ interface AppSettings {
|
|
|
586
618
|
};
|
|
587
619
|
}
|
|
588
620
|
/** The sign-in method of a Configuration (environment.json "environment") and its flag; null without one. */
|
|
589
|
-
declare function loginMethod(environment: Bag | any): {
|
|
621
|
+
declare function loginMethod(environment: Bag$1 | any): {
|
|
590
622
|
method: 'keycloak' | 'okta' | 'jwt';
|
|
591
623
|
flag: string;
|
|
592
624
|
} | null;
|
|
593
625
|
/** Only the page keys of an option object (center.option, a role's page, the page before the sign-in). */
|
|
594
|
-
declare function pageOf(option: Bag | any): Bag;
|
|
626
|
+
declare function pageOf(option: Bag$1 | any): Bag$1;
|
|
595
627
|
/** The general start page of a Main layout: the page keys of center.option. */
|
|
596
|
-
declare function startPage(layout: Bag | any): Bag;
|
|
628
|
+
declare function startPage(layout: Bag$1 | any): Bag$1;
|
|
597
629
|
/**
|
|
598
630
|
* The roles of a signed-in user: what stands at roleKey in the sign-in answer or the token's claims - a
|
|
599
631
|
* text or a list. Empty without roleKey or user.
|
|
600
632
|
*/
|
|
601
|
-
declare function rolesOf(user: Bag | any, roleKey: string): string[];
|
|
633
|
+
declare function rolesOf(user: Bag$1 | any, roleKey: string): string[];
|
|
602
634
|
/**
|
|
603
635
|
* The start page for a signed-in user: the page of the first role in login.roles (the Designer's order) the
|
|
604
636
|
* user has, compared without case; else the general start page.
|
|
605
637
|
*/
|
|
606
|
-
declare function startPageFor(layout: Bag | any, user?: Bag | any): Bag;
|
|
638
|
+
declare function startPageFor(layout: Bag$1 | any, user?: Bag$1 | any): Bag$1;
|
|
607
639
|
/**
|
|
608
640
|
* The pagination of one list: each value from the page (center.pagination of its layout) if it is there,
|
|
609
641
|
* else from Main, else the default. visible: a page with center.pagination pages unless it says
|
|
610
642
|
* visible false; a page without it does not page.
|
|
611
643
|
*/
|
|
612
|
-
declare function paginationFor(main: Bag | any, page: Bag | any): Pagination & {
|
|
644
|
+
declare function paginationFor(main: Bag$1 | any, page: Bag$1 | any): Pagination & {
|
|
613
645
|
visible: boolean;
|
|
614
646
|
};
|
|
615
647
|
/**
|
|
616
648
|
* The app settings of a Main layout (main/layout_schema.json), every missing or unknown value replaced by
|
|
617
649
|
* its default. A Main whose center.option carries a sign-in flag counts as "required at the start".
|
|
618
650
|
*/
|
|
619
|
-
declare function readAppSettings(layout: Bag | any): AppSettings;
|
|
651
|
+
declare function readAppSettings(layout: Bag$1 | any): AppSettings;
|
|
620
652
|
interface AppSettingsProblem {
|
|
621
653
|
code: string;
|
|
622
654
|
key: string;
|
|
@@ -625,9 +657,9 @@ interface AppSettingsProblem {
|
|
|
625
657
|
* What is wrong with the app settings of a Main layout - an empty list when nothing is. The environment
|
|
626
658
|
* (environment.json "environment") is needed for the sign-in checks; without it they are skipped.
|
|
627
659
|
*/
|
|
628
|
-
declare function checkAppSettings(layout: Bag | any, environment?: Bag | any): AppSettingsProblem[];
|
|
660
|
+
declare function checkAppSettings(layout: Bag$1 | any, environment?: Bag$1 | any): AppSettingsProblem[];
|
|
629
661
|
/** What is wrong with the page bar of one page (center.pagination of its layout): the same values as Main's. */
|
|
630
|
-
declare function checkPagePagination(page: Bag | any): AppSettingsProblem[];
|
|
662
|
+
declare function checkPagePagination(page: Bag$1 | any): AppSettingsProblem[];
|
|
631
663
|
/** The captions of the entries the library adds - keys of the app's language files (English text). */
|
|
632
664
|
declare const SETTING_MENU_TEXTS: {
|
|
633
665
|
readonly setting: "Setting";
|
|
@@ -651,7 +683,7 @@ declare function languageName(code: string): string;
|
|
|
651
683
|
* of the project's language files ("en", "de"); signedIn: whether a user is signed in. The given menu is
|
|
652
684
|
* not changed; without app settings it comes back as it is.
|
|
653
685
|
*/
|
|
654
|
-
declare function appSettingsMenu(menu: any[], center: Bag | any, context?: {
|
|
686
|
+
declare function appSettingsMenu(menu: any[], center: Bag$1 | any, context?: {
|
|
655
687
|
languages?: string[];
|
|
656
688
|
signedIn?: boolean;
|
|
657
689
|
}): any[];
|
|
@@ -741,6 +773,91 @@ interface CallProblem {
|
|
|
741
773
|
* the kind, an address for the backend. Keys outside CALL_KEYS (style, visible, …) are not looked at.
|
|
742
774
|
*/
|
|
743
775
|
declare function checkCall(option: any, kind: CallKind): CallProblem[];
|
|
776
|
+
/** Where an action stands. A field is a checkbox or input of a form, a column a column of a table. */
|
|
777
|
+
type ActionPlace = 'menu' | 'button' | 'field' | 'column';
|
|
778
|
+
interface ActionRule {
|
|
779
|
+
/** what it does, for the (i) */
|
|
780
|
+
does: string;
|
|
781
|
+
/** where it may stand */
|
|
782
|
+
places: readonly ActionPlace[];
|
|
783
|
+
/** the option keys that belong to it besides the action itself */
|
|
784
|
+
keys: readonly string[];
|
|
785
|
+
}
|
|
786
|
+
/** Actions that stay in the app. */
|
|
787
|
+
declare const INNER_ACTIONS: Readonly<Record<string, ActionRule>>;
|
|
788
|
+
/** Actions that call the backend - each with its kind of call (CALL_KINDS). */
|
|
789
|
+
declare const BACKEND_ACTIONS: Readonly<Record<string, ActionRule & {
|
|
790
|
+
kind: CallKind;
|
|
791
|
+
}>>;
|
|
792
|
+
/** The operators of calculate. */
|
|
793
|
+
declare const CALCULATE_OPERATORS: readonly ["multiply", "add", "subtract", "divide"];
|
|
794
|
+
/** What an element does, in the new form - read from the new form and from every older one. */
|
|
795
|
+
interface ElementAction {
|
|
796
|
+
/** the backend action (save, saveAll, submit, delete) */
|
|
797
|
+
action?: string;
|
|
798
|
+
/** the app action (openPage, addToCart, showModal, cancel, login, logout, cart, copy, calculate) */
|
|
799
|
+
innerAction?: string;
|
|
800
|
+
/** the keys that belong to it (from, to, operator, fields) */
|
|
801
|
+
params: Record<string, any>;
|
|
802
|
+
/** the value as it stood, when it is not the new form (for the check and the conversion) */
|
|
803
|
+
old?: string;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* What an element does. Older forms are understood: a menu entry's action "get" (opens its page - no action),
|
|
807
|
+
* its cart / login / logout; a button's action "get" (openPage); innerAction saveAll / submit (backend actions);
|
|
808
|
+
* innerAction as an object { action: copy | multiply, from, to }.
|
|
809
|
+
*/
|
|
810
|
+
declare function elementAction(option: any, place: ActionPlace): ElementAction;
|
|
811
|
+
/** The option written in the new form - keys of the old form removed, everything else kept. */
|
|
812
|
+
declare function withElementAction(option: any, place: ActionPlace): any;
|
|
813
|
+
/** Problems of an element's action for the check: an unknown value or one in the wrong place. */
|
|
814
|
+
declare function checkElementAction(option: any, place: ActionPlace): string[];
|
|
815
|
+
/**
|
|
816
|
+
* The name of what an element does, in the new form ('' = nothing): save, saveAll, submit, delete, openPage,
|
|
817
|
+
* addToCart, showModal, cancel, login, logout, cart, copy, calculate. Code asks this instead of comparing action or
|
|
818
|
+
* innerAction with a value, so older forms (a button's "get", innerAction "saveAll") mean the same.
|
|
819
|
+
*/
|
|
820
|
+
declare function actionName(option: any, place?: ActionPlace): string;
|
|
821
|
+
/** The keys of what an element does (copy: from, to; calculate: operator, fields; openPage: layout_url). */
|
|
822
|
+
declare function actionParams(option: any, place?: ActionPlace): Record<string, any>;
|
|
823
|
+
/**
|
|
824
|
+
* The page's own data source (OFFENE-PUNKTE 145): a page loads its records itself - "dataSource" in its
|
|
825
|
+
* layout_schema.json holds the call (storageType, data_url, method, passToken, params, body, dateFormat, dataKey,
|
|
826
|
+
* loadOnFilter, proxy, messages) and its data object (property_url). Opened from a menu entry or a button, the
|
|
827
|
+
* page's source wins; without one the opener's keys count as before.
|
|
828
|
+
*/
|
|
829
|
+
declare function withPageSource(option: any, pageLayout: any): any;
|
|
830
|
+
/** One line of the conversion list: where, what it was, what it is now - or why it stays. */
|
|
831
|
+
interface ConversionChange {
|
|
832
|
+
/** the file, e.g. main/layout_schema.json or pages/books/layout_schema.json */
|
|
833
|
+
file: string;
|
|
834
|
+
/** the element in the file, e.g. left.elements[0] */
|
|
835
|
+
where: string;
|
|
836
|
+
caption?: string;
|
|
837
|
+
old: string;
|
|
838
|
+
new: string;
|
|
839
|
+
/** false: left as it is - reason says why */
|
|
840
|
+
done: boolean;
|
|
841
|
+
reason?: string;
|
|
842
|
+
/** why it stays, for the Designer's own texts: searchField, cart, noPage, hasSource, severalWays, openedByButtons, unknown */
|
|
843
|
+
reasonCode?: 'searchField' | 'cart' | 'noPage' | 'hasSource' | 'severalWays' | 'openedByButtons' | 'unknown';
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* An app written in the new form (OFFENE-PUNKTE 105/145 step 5). files: Main and the pages by their path
|
|
847
|
+
* (main/layout_schema.json, pages/<path>/layout_schema.json). Returns the changed files (copies - the given ones are
|
|
848
|
+
* not touched) and the list of every change and of what stays:
|
|
849
|
+
* - every element's action in the new form (withElementAction: button get -> innerAction openPage, innerAction
|
|
850
|
+
* submit / saveAll -> action, menu logout / login / cart -> innerAction, copy / multiply -> copy / calculate, a
|
|
851
|
+
* sign-in form with an address -> action loginForm; a menu entry's get is dropped);
|
|
852
|
+
* - a menu entry's call (data_url, storageType, method, dataKey, property_url …) moved into its page as dataSource -
|
|
853
|
+
* only when the menu entries opening that page all carry the same call and nothing else opens it (the page's source
|
|
854
|
+
* would win over any other opener). It stays at the header search field (its call depends on the typed text), at
|
|
855
|
+
* the cart (data_url is the cart's storage name) and at a page that has a dataSource already.
|
|
856
|
+
*/
|
|
857
|
+
declare function convertOlderForms(files: Record<string, any>): {
|
|
858
|
+
files: Record<string, any>;
|
|
859
|
+
changes: ConversionChange[];
|
|
860
|
+
};
|
|
744
861
|
|
|
745
862
|
/** The keys whose text is shown to a person: a caption (label.caption or an element's own), placeholder, tooltip, dialog title. */
|
|
746
863
|
declare const SHOWN_TEXT_KEYS: readonly ["caption", "placeholder", "tooltip", "modalTitle"];
|
|
@@ -809,5 +926,37 @@ declare function probeField(key: string): {
|
|
|
809
926
|
ambiguous: string[];
|
|
810
927
|
} | null;
|
|
811
928
|
|
|
812
|
-
|
|
813
|
-
|
|
929
|
+
type Bag = Record<string, any>;
|
|
930
|
+
/** "fontSize" -> "font-size", "WebkitLineClamp" -> "-webkit-line-clamp"; a CSS name (and --var) stays. */
|
|
931
|
+
declare function cssStyleKey(key: string): string;
|
|
932
|
+
/** "font-size" -> "fontSize" - for code that reads a property in both spellings. */
|
|
933
|
+
declare function camelStyleKey(key: string): string;
|
|
934
|
+
/** A property of a style object in either spelling: styleValue(style, 'align-items'). */
|
|
935
|
+
declare function styleValue(style: Bag | null | undefined, cssName: string): any;
|
|
936
|
+
/**
|
|
937
|
+
* The style object in CSS spelling. A property written twice keeps the later one - the browser applies the keys
|
|
938
|
+
* in their order, so that is the value the app shows today. classes and non-property values (objects) stay.
|
|
939
|
+
*/
|
|
940
|
+
declare function cssStyle<T extends Bag | null | undefined>(style: T): T;
|
|
941
|
+
/** A key that holds a style object in a page: style, stylePerCard and every …Style (wrapperStyle, labelStyle …). */
|
|
942
|
+
declare function isStyleHolder(key: string, value: unknown): boolean;
|
|
943
|
+
interface StyleSpellingFinding {
|
|
944
|
+
/** where in the page: center.formSections[0].formFields[2].style */
|
|
945
|
+
path: string;
|
|
946
|
+
/** the camelCase name as written */
|
|
947
|
+
key: string;
|
|
948
|
+
/** its CSS name */
|
|
949
|
+
css: string;
|
|
950
|
+
/** the block holds the property in both spellings - the later value is kept */
|
|
951
|
+
twice: boolean;
|
|
952
|
+
}
|
|
953
|
+
/** Style properties of a page written in camelCase. */
|
|
954
|
+
declare function styleSpellingFindings(doc: unknown): StyleSpellingFinding[];
|
|
955
|
+
/** The page with every style object in CSS spelling, and what was changed. The page is not changed in place. */
|
|
956
|
+
declare function normalizeStyleSpelling<T>(doc: T): {
|
|
957
|
+
doc: T;
|
|
958
|
+
findings: StyleSpellingFinding[];
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
export { APP_DATA_KEEP, APP_KEYBOARD_DEVICES, APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BACKEND_ACTIONS, BASIC_TYPES, BROWSER_STORAGES, CALCULATE_OPERATORS, CALL_KEYS, CALL_KINDS, CARD_LAYOUTS, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DEFAULT_TEMPO_SECONDS, DISPLAY_FORMATS, DOCUMENT_KINDS, ENTER_KEYS, EXPECT_KINDS, FORMATS, FRAME_PARTS, FRAME_SELECTORS, HEADER_SCROLLS, INNER_ACTIONS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NO_CALL_ACTIONS, NUMBER_STYLES, OLD_CALL_KEYS, OLD_DEVICE_NAMES, OLD_STORAGES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, PLACEHOLDER_SOURCE, RESULTS_DIR, RESULTS_KEEP, RTL_LANGUAGES, SETTING_MENU_TEXTS, SHOWN_TEXT_KEYS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, STORAGES, STRIPE_TEST_CARDS, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DATA_FILE, TEST_DEVICES, TEST_TEMPOS, TYPE_ALIASES, actionName, actionParams, alignRowsOf, appSettingsMenu, assertFieldSettings, base32Bytes, baseType, basicType, callAttributes, callKindOf, camelStyleKey, canonicalControl, cardLayoutOf, checkAppSettings, checkCall, checkElementAction, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, convertOlderForms, cssStyle, cssStyleKey, dataSettings, dateOrder, defaultKeyboard, deviceChoices, displaySettings, effectiveControl, effectiveFormat, elementAction, enterKeyFor, flowDevices, flowLanguages, hasAppKeyboard, headerScrollOf, isKeyboardCheck, isStyleHolder, keyboardFor, languageName, layoutNotes, layoutProblems, localeKeys, localeRenderings, loginMethod, matchesTemplate, maxLinesOf, menuCaption, menuEntries, menuEntryByCaption, menuEntryForPage, menuPage, methodOf, normalizeFormat, normalizeStyleSpelling, pageOf, paginationFor, parseDevice, probeClearAppData, probeField, probeFieldVisible, probeInFrame, probeLayoutSnapshot, probePagePlace, probeRestoreStorage, probeStorageSnapshot, probeUntranslated, readAppSettings, readTestUser, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, storageOf, stripeTestPaymentMethod, styleSpellingFindings, styleValue, successMessageOf, tempoPause, temporalPart, testDataRefs, testUserEntry, totp, translateCaptions, uses12Hours, validateSettings, validationSettings, vaultJwtLogin, vaultPlace, waitsForFilter, withElementAction, withPageSource, withTestData };
|
|
962
|
+
export type { ActionPlace, ActionRule, AppSettingBlock, AppSettingDef, AppSettings, AppSettingsProblem, Bag$1 as Bag, CallKind, CallKindRule, CallProblem, CardLayout, ConversionChange, DocumentKind, ElementAction, EnterKey, FlowResult, HeaderScroll, LayoutBox, LayoutScroller, LayoutSnapshot, LoginStorage, LoginWhen, MenuEntryKind, Orientation, Pagination, PaginationAlign, PaginationPlacement, PaginationType, Setting, StepResult, Storage, StyleSpellingFinding, TemporalPart, TermsDocument, TestDevice, TestExpect, TestFlow, TestProblem, TestRun, TestStep, TestTempo, TestUser, TestUserEntry };
|