@yomotech/view-toolkit 1.0.42 → 1.0.44
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 +659 -1
- package/fesm2022/yomotech-view-toolkit-catalog.mjs.map +1 -1
- package/fesm2022/yomotech-view-toolkit.mjs +2707 -109
- package/fesm2022/yomotech-view-toolkit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/yomotech-view-toolkit-catalog.d.ts +205 -2
- package/types/yomotech-view-toolkit.d.ts +748 -11
package/package.json
CHANGED
|
@@ -17,8 +17,37 @@ declare function controlsFor(schema: Bag, fallback: string, option: Bag | any):
|
|
|
17
17
|
value: string;
|
|
18
18
|
label: string;
|
|
19
19
|
}[];
|
|
20
|
+
/**
|
|
21
|
+
* The controls a field can be switched to in the Designer (decision 2026-10-24: the editor keeps no list of its
|
|
22
|
+
* own): those that fit now (controlsFor) and those that fit once the field is set up for them - a plain text as
|
|
23
|
+
* check box or switch (it then becomes a two-state flag) or as radio buttons or dropdown (it then needs its
|
|
24
|
+
* values); a list of two texts as check box or switch. "Read-only output" is no choice here - read only is set
|
|
25
|
+
* with protected.
|
|
26
|
+
*/
|
|
27
|
+
declare function controlChoicesFor(schema: Bag, fallback: string, option: Bag | any): {
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
}[];
|
|
20
31
|
declare const canonicalControl: (c: string) => any;
|
|
21
32
|
/** The data types of a property after its aliases. */
|
|
33
|
+
/**
|
|
34
|
+
* A data object (objects/*.json) holds names and types only (decision 2026-10-24): each property has
|
|
35
|
+
* just these keys. Everything else is set on the layout field - DATA_OBJECT_PLACES says where.
|
|
36
|
+
*/
|
|
37
|
+
declare const DATA_OBJECT_KEYS: readonly ["type"];
|
|
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;
|
|
40
|
+
/**
|
|
41
|
+
* Where a page names a data object (objects/<name>.json) - a rename has to change every one of them,
|
|
42
|
+
* the Designer's rename and the AI contract use this list. The app's test flows name fields by their
|
|
43
|
+
* property alone, without the data object.
|
|
44
|
+
*/
|
|
45
|
+
declare const DATA_OBJECT_NAME_PLACES: Bag;
|
|
46
|
+
/**
|
|
47
|
+
* Renames the data object oldName to newName at every place of DATA_OBJECT_NAME_PLACES inside a page
|
|
48
|
+
* layout (changed in place). Returns how many values were changed.
|
|
49
|
+
*/
|
|
50
|
+
declare function renameDataObject(layout: any, oldName: string, newName: string): number;
|
|
22
51
|
declare const BASIC_TYPES: readonly ["string", "number", "integer", "bigdecimal", "boolean", "date", "time", "datetime", "dateRange", "media", "array"];
|
|
23
52
|
/** Older or other names of a data type and the type they mean. */
|
|
24
53
|
declare const TYPE_ALIASES: Bag;
|
|
@@ -212,5 +241,179 @@ declare function stepKind(step: TestStep): string | null;
|
|
|
212
241
|
/** The problems of a flow; an empty list means it can run. */
|
|
213
242
|
declare function checkTestFlow(flow: any): TestProblem[];
|
|
214
243
|
|
|
215
|
-
|
|
216
|
-
|
|
244
|
+
/** The building blocks of the app settings in Main, in the order they are shown. */
|
|
245
|
+
declare const APP_SETTING_BLOCKS: readonly ["startPage", "login", "pagination", "terms", "menu"];
|
|
246
|
+
/** The entries the library may add to the side menu, in their default order (appSettings.menu.entries). */
|
|
247
|
+
declare const MENU_ENTRY_KINDS: readonly ["home", "languages", "login", "paginationType", "terms", "projectVersion"];
|
|
248
|
+
type MenuEntryKind = typeof MENU_ENTRY_KINDS[number];
|
|
249
|
+
/**
|
|
250
|
+
* The entries Main switches on or off in the menu settings. The others are decided where they belong - one
|
|
251
|
+
* place per decision: Login by login.when (at any time), Pagination Type by pagination.userChoice, Terms &
|
|
252
|
+
* Conditions by terms.enabled; their "on" in menu.entries is not read.
|
|
253
|
+
*/
|
|
254
|
+
declare const MENU_SWITCHABLE: readonly MenuEntryKind[];
|
|
255
|
+
/** Where the other entries are decided: the building block of the app settings. */
|
|
256
|
+
declare const MENU_DECIDED_BY: Partial<Record<MenuEntryKind, AppSettingBlock>>;
|
|
257
|
+
type AppSettingBlock = typeof APP_SETTING_BLOCKS[number];
|
|
258
|
+
/** When the user signs in: never, at any time (menu entry), required at the start. */
|
|
259
|
+
declare const LOGIN_WHEN: readonly ["none", "optional", "start"];
|
|
260
|
+
type LoginWhen = typeof LOGIN_WHEN[number];
|
|
261
|
+
/** Where the sign-in answer is kept: stay signed in, or signed out when the app closes. */
|
|
262
|
+
declare const LOGIN_STORAGES: readonly ["localStorage", "sessionStorage"];
|
|
263
|
+
type LoginStorage = typeof LOGIN_STORAGES[number];
|
|
264
|
+
/** The sign-in methods of the Configuration (environment.login.type) and the flag each writes into center.option. */
|
|
265
|
+
declare const LOGIN_METHODS: Record<string, {
|
|
266
|
+
method: 'keycloak' | 'okta' | 'jwt';
|
|
267
|
+
flag: string;
|
|
268
|
+
}>;
|
|
269
|
+
/** All flags a sign-in at the start may set in center.option. */
|
|
270
|
+
declare const LOGIN_FLAGS: string[];
|
|
271
|
+
/** The keys of center.option that describe a page (the start page, a role's page, the page before the sign-in). */
|
|
272
|
+
declare const START_PAGE_KEYS: readonly ["action", "visible", "layout_url", "property_url", "data_url", "dataKey", "storageType", "protected", "setImageUrl", "passToken", "form", "card", "grid", "modal"];
|
|
273
|
+
/** How a list pages: page by page with a bar, or loading the next page while scrolling. */
|
|
274
|
+
declare const PAGINATION_TYPES: readonly ["numbered", "scroll"];
|
|
275
|
+
type PaginationType = typeof PAGINATION_TYPES[number];
|
|
276
|
+
/** Where the page bar stands and how it is aligned. */
|
|
277
|
+
declare const PAGINATION_PLACEMENTS: readonly ["top", "bottom"];
|
|
278
|
+
declare const PAGINATION_ALIGNS: readonly ["left", "center", "right", "split"];
|
|
279
|
+
type PaginationPlacement = typeof PAGINATION_PLACEMENTS[number];
|
|
280
|
+
type PaginationAlign = typeof PAGINATION_ALIGNS[number];
|
|
281
|
+
/** The documents of Terms & Conditions and how each is given: written text, a link, a PDF. */
|
|
282
|
+
declare const TERMS_DOCUMENTS: readonly ["imprint", "privacy", "agb"];
|
|
283
|
+
type TermsDocument = typeof TERMS_DOCUMENTS[number];
|
|
284
|
+
declare const DOCUMENT_KINDS: readonly ["text", "link", "pdf"];
|
|
285
|
+
type DocumentKind = typeof DOCUMENT_KINDS[number];
|
|
286
|
+
/** Where the app settings stand in main/layout_schema.json; the start page is center.option. */
|
|
287
|
+
declare const APP_SETTINGS_PATH = "center.appSettings";
|
|
288
|
+
declare const START_PAGE_PATH = "center.option";
|
|
289
|
+
interface AppSettingDef {
|
|
290
|
+
/** the building block the setting belongs to */
|
|
291
|
+
block: AppSettingBlock;
|
|
292
|
+
/** its place inside center.appSettings, dotted */
|
|
293
|
+
key: string;
|
|
294
|
+
kind: 'choice' | 'flag' | 'text' | 'number' | 'numbers' | 'pages' | 'page' | 'documents' | 'entries';
|
|
295
|
+
values?: readonly string[];
|
|
296
|
+
default: any;
|
|
297
|
+
}
|
|
298
|
+
/** Every app setting, with its values and default. The start page itself is center.option (START_PAGE_KEYS). */
|
|
299
|
+
declare const APP_SETTINGS: AppSettingDef[];
|
|
300
|
+
interface Pagination {
|
|
301
|
+
default: PaginationType;
|
|
302
|
+
userChoice: boolean;
|
|
303
|
+
placement: PaginationPlacement;
|
|
304
|
+
align: PaginationAlign;
|
|
305
|
+
defaultPageSize: number;
|
|
306
|
+
pageSizeOptions: number[];
|
|
307
|
+
pageSize: boolean;
|
|
308
|
+
caption: string;
|
|
309
|
+
}
|
|
310
|
+
interface AppSettings {
|
|
311
|
+
login: {
|
|
312
|
+
when: LoginWhen;
|
|
313
|
+
storage: LoginStorage;
|
|
314
|
+
roleKey: string;
|
|
315
|
+
/** role -> its own start page, in the Designer's order */
|
|
316
|
+
roles: Record<string, Bag>;
|
|
317
|
+
loginPage: Bag | null;
|
|
318
|
+
};
|
|
319
|
+
pagination: Pagination;
|
|
320
|
+
terms: {
|
|
321
|
+
enabled: boolean;
|
|
322
|
+
/** confirmed before anything else - before the sign-in */
|
|
323
|
+
confirmOnStart: boolean;
|
|
324
|
+
documents: Partial<Record<TermsDocument, {
|
|
325
|
+
kind: DocumentKind;
|
|
326
|
+
value: string;
|
|
327
|
+
}>>;
|
|
328
|
+
/** the state of the terms ('' = the texts themselves decide) */
|
|
329
|
+
version: string;
|
|
330
|
+
/** the app's backend keeps the acceptance: GET statusUrl -> { version, accepted }, POST acceptUrl */
|
|
331
|
+
backend: {
|
|
332
|
+
enabled: boolean;
|
|
333
|
+
statusUrl: string;
|
|
334
|
+
acceptUrl: string;
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
/** The setting entries: the folder's caption and every kind in the Designer's order, each on or off. */
|
|
338
|
+
menu: {
|
|
339
|
+
caption: string;
|
|
340
|
+
entries: {
|
|
341
|
+
kind: MenuEntryKind;
|
|
342
|
+
on: boolean;
|
|
343
|
+
caption: string;
|
|
344
|
+
}[];
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
/** The sign-in method of a Configuration (environment.json "environment") and its flag; null without one. */
|
|
348
|
+
declare function loginMethod(environment: Bag | any): {
|
|
349
|
+
method: 'keycloak' | 'okta' | 'jwt';
|
|
350
|
+
flag: string;
|
|
351
|
+
} | null;
|
|
352
|
+
/** Only the page keys of an option object (center.option, a role's page, the page before the sign-in). */
|
|
353
|
+
declare function pageOf(option: Bag | any): Bag;
|
|
354
|
+
/** The general start page of a Main layout: the page keys of center.option. */
|
|
355
|
+
declare function startPage(layout: Bag | any): Bag;
|
|
356
|
+
/**
|
|
357
|
+
* The roles of a signed-in user: what stands at roleKey in the sign-in answer or the token's claims - a
|
|
358
|
+
* text or a list. Empty without roleKey or user.
|
|
359
|
+
*/
|
|
360
|
+
declare function rolesOf(user: Bag | any, roleKey: string): string[];
|
|
361
|
+
/**
|
|
362
|
+
* The start page for a signed-in user: the page of the first role in login.roles (the Designer's order) the
|
|
363
|
+
* user has, compared without case; else the general start page.
|
|
364
|
+
*/
|
|
365
|
+
declare function startPageFor(layout: Bag | any, user?: Bag | any): Bag;
|
|
366
|
+
/**
|
|
367
|
+
* The pagination of one list: each value from the page (center.pagination of its layout) if it is there,
|
|
368
|
+
* else from Main, else the default. visible: a page with center.pagination pages unless it says
|
|
369
|
+
* visible false; a page without it does not page.
|
|
370
|
+
*/
|
|
371
|
+
declare function paginationFor(main: Bag | any, page: Bag | any): Pagination & {
|
|
372
|
+
visible: boolean;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* The app settings of a Main layout (main/layout_schema.json), every missing or unknown value replaced by
|
|
376
|
+
* its default. A Main whose center.option carries a sign-in flag counts as "required at the start".
|
|
377
|
+
*/
|
|
378
|
+
declare function readAppSettings(layout: Bag | any): AppSettings;
|
|
379
|
+
interface AppSettingsProblem {
|
|
380
|
+
code: string;
|
|
381
|
+
key: string;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* What is wrong with the app settings of a Main layout - an empty list when nothing is. The environment
|
|
385
|
+
* (environment.json "environment") is needed for the sign-in checks; without it they are skipped.
|
|
386
|
+
*/
|
|
387
|
+
declare function checkAppSettings(layout: Bag | any, environment?: Bag | any): AppSettingsProblem[];
|
|
388
|
+
/** What is wrong with the page bar of one page (center.pagination of its layout): the same values as Main's. */
|
|
389
|
+
declare function checkPagePagination(page: Bag | any): AppSettingsProblem[];
|
|
390
|
+
/** The captions of the entries the library adds - keys of the app's language files (English text). */
|
|
391
|
+
declare const SETTING_MENU_TEXTS: {
|
|
392
|
+
readonly setting: "Setting";
|
|
393
|
+
readonly home: "Home";
|
|
394
|
+
readonly projectVersion: "Project Version";
|
|
395
|
+
readonly languages: "Languages";
|
|
396
|
+
readonly login: "Login";
|
|
397
|
+
readonly paginationType: "Pagination Type";
|
|
398
|
+
readonly scroll: "Scroll";
|
|
399
|
+
readonly numbered: "Numbered";
|
|
400
|
+
readonly terms: "Terms & Conditions";
|
|
401
|
+
readonly imprint: "Imprint";
|
|
402
|
+
readonly privacy: "Privacy";
|
|
403
|
+
readonly agb: "Terms";
|
|
404
|
+
};
|
|
405
|
+
/** The name of a language in that language ("de" -> "Deutsch"); the code when it is unknown. */
|
|
406
|
+
declare function languageName(code: string): string;
|
|
407
|
+
/**
|
|
408
|
+
* The side menu with the entries the library adds by itself for an app with app settings: into the
|
|
409
|
+
* top-level folder "Setting" (caption, any case), else a folder "Setting" at the end. languages: the codes
|
|
410
|
+
* of the project's language files ("en", "de"); signedIn: whether a user is signed in. The given menu is
|
|
411
|
+
* not changed; without app settings it comes back as it is.
|
|
412
|
+
*/
|
|
413
|
+
declare function appSettingsMenu(menu: any[], center: Bag | any, context?: {
|
|
414
|
+
languages?: string[];
|
|
415
|
+
signedIn?: boolean;
|
|
416
|
+
}): any[];
|
|
417
|
+
|
|
418
|
+
export { APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BASIC_TYPES, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DISPLAY_FORMATS, DOCUMENT_KINDS, EXPECT_KINDS, FRAME_PARTS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NUMBER_STYLES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, RESULTS_DIR, RESULTS_KEEP, SETTING_MENU_TEXTS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DEVICES, TYPE_ALIASES, appSettingsMenu, assertFieldSettings, baseType, basicType, canonicalControl, checkAppSettings, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, dataSettings, defaultKeyboard, displaySettings, effectiveControl, effectiveFormat, flowDevices, keyboardFor, languageName, loginMethod, normalizeFormat, pageOf, paginationFor, parseDevice, readAppSettings, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, temporalPart, validateSettings, validationSettings };
|
|
419
|
+
export type { AppSettingBlock, AppSettingDef, AppSettings, AppSettingsProblem, Bag, DocumentKind, FlowResult, LoginStorage, LoginWhen, MenuEntryKind, Orientation, Pagination, PaginationAlign, PaginationPlacement, PaginationType, Setting, StepResult, TemporalPart, TermsDocument, TestDevice, TestExpect, TestFlow, TestProblem, TestRun, TestStep };
|