@yomotech/view-toolkit 1.0.41 → 1.0.43
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 +1772 -476
- 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 +487 -41
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i9 from '@angular/common';
|
|
2
|
-
import { NgIf, NgStyle, NgTemplateOutlet, AsyncPipe, NgFor, DatePipe, CommonModule } from '@angular/common';
|
|
2
|
+
import { NgIf, NgStyle, NgTemplateOutlet, AsyncPipe, NgFor, NgClass, DatePipe, CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Pipe, signal, Injectable, HostListener, Input, Directive, EventEmitter, Optional, SkipSelf, ViewChild, Output, Component, inject, ViewChildren, ElementRef, NgZone, HostBinding, NgModule, effect, DestroyRef } from '@angular/core';
|
|
5
|
-
import { effectiveControl, keyboardFor } from '@yomotech/view-toolkit/catalog';
|
|
4
|
+
import { Pipe, signal, Injectable, HostListener, Input, Directive, EventEmitter, Optional, SkipSelf, ViewChild, Output, Component, inject, ViewChildren, ElementRef, NgZone, ChangeDetectorRef, HostBinding, NgModule, effect, DestroyRef } from '@angular/core';
|
|
5
|
+
import { effectiveControl, keyboardFor, startPageFor, START_PAGE_KEYS, appSettingsMenu, readAppSettings } from '@yomotech/view-toolkit/catalog';
|
|
6
6
|
import * as catalog from '@yomotech/view-toolkit/catalog';
|
|
7
7
|
export { catalog as FieldCatalog };
|
|
8
8
|
import * as i1 from '@angular/forms';
|
|
@@ -21,7 +21,7 @@ import { throwError, lastValueFrom, BehaviorSubject } from 'rxjs';
|
|
|
21
21
|
import * as i1$2 from '@angular/cdk/platform';
|
|
22
22
|
import { PlatformModule } from '@angular/cdk/platform';
|
|
23
23
|
import * as i1$1 from '@angular/common/http';
|
|
24
|
-
import { HttpHeaders
|
|
24
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
25
25
|
import * as i2$2 from 'primeng/select';
|
|
26
26
|
import { SelectModule } from 'primeng/select';
|
|
27
27
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
@@ -43,6 +43,7 @@ import { NzModalModule } from 'ng-zorro-antd/modal';
|
|
|
43
43
|
import * as i16 from '@angular/material/tooltip';
|
|
44
44
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
45
45
|
import * as i7 from 'angular-oauth2-oidc';
|
|
46
|
+
import { OAuthService } from 'angular-oauth2-oidc';
|
|
46
47
|
import * as i13 from 'ng-zorro-antd/core/transition-patch';
|
|
47
48
|
import * as i14 from 'ng-zorro-antd/core/wave';
|
|
48
49
|
import * as i7$1 from 'ng-zorro-antd/table';
|
|
@@ -67,6 +68,8 @@ import { App } from '@capacitor/app';
|
|
|
67
68
|
import { OAuth2Client } from '@byteowls/capacitor-oauth2';
|
|
68
69
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
69
70
|
|
|
71
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
72
|
+
// - change: a data object holds names and types only - the date pattern comes from the layout (displayFormat custom), not from the property
|
|
70
73
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18
|
|
71
74
|
// - new: how a date is typed and shown, the one place (CONTROLS-PLAN.md C1, step 3 date part, #166).
|
|
72
75
|
// The value stays what the backend sends and gets (ISO); only what the user sees and types
|
|
@@ -117,11 +120,6 @@ function dateInputPattern(option, property, languageCode = dateLanguage) {
|
|
|
117
120
|
if (option?.displayFormat === 'custom' && typeof option?.customDisplayFormat === 'string' && option.customDisplayFormat) {
|
|
118
121
|
return primeDatePattern(option.customDisplayFormat);
|
|
119
122
|
}
|
|
120
|
-
const own = property?.format;
|
|
121
|
-
// an explicit picker pattern of older projects ("yy-mm-dd"), not an encoding name like "iso-date"
|
|
122
|
-
if (typeof own === 'string' && /^[dmy]{1,4}([^a-z0-9][dmy]{1,4}){2}$/i.test(own)) {
|
|
123
|
-
return own;
|
|
124
|
-
}
|
|
125
123
|
return languageDatePattern(languageCode);
|
|
126
124
|
}
|
|
127
125
|
/**
|
|
@@ -290,7 +288,16 @@ function toggleMeridiem(text) {
|
|
|
290
288
|
return time ? `${time} ${now === 'PM' ? 'AM' : 'PM'}` : time;
|
|
291
289
|
}
|
|
292
290
|
|
|
291
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
292
|
+
// - change: a data object holds names and types only - the label is the layout's caption, else the property's name
|
|
293
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
294
|
+
// - change: withPropertyRules is gone - a data object holds only names and types, every rule (required,
|
|
295
|
+
// lengths, pattern) is set in the layout (decision of the user 2026-10-24)
|
|
296
|
+
// - fix: ruleMessage - an empty label caption falls back to the data object's caption (propertyCaption)
|
|
297
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
298
|
+
// - fix: a vertical form field is one grid column - the label stands above a read-only value too
|
|
293
299
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18
|
|
300
|
+
// - new: withPropertyRules - the data object's rules (validation list or object, required on the property) count too (2026-10-22)
|
|
294
301
|
// - new: fieldInnerLayoutStyle - label beside or above the field, the one rule for app and canvas (#166 E6)
|
|
295
302
|
// - new: everything a field needs to be drawn, worked out once (CONTROLS-PLAN.md step 2a, #166):
|
|
296
303
|
// which control (the field catalog's effectiveControl), which kind of building block, label,
|
|
@@ -338,7 +345,7 @@ function fieldModel(field, propertySchema, languageCode) {
|
|
|
338
345
|
: kind === 'time' ? inputFormatHint('time', languageCode) : '');
|
|
339
346
|
return {
|
|
340
347
|
name, scope, reference, property, control, kind,
|
|
341
|
-
label: field?.label?.value
|
|
348
|
+
label: field?.label?.value || field?.label?.caption || name,
|
|
342
349
|
placeholder,
|
|
343
350
|
keyboard: kind === 'toggle' || kind === 'media' || kind === 'output' ? null : keyboardFor({ ...option, control }, property),
|
|
344
351
|
required: option.required === true || field?.required === true,
|
|
@@ -399,7 +406,8 @@ function ruleMessage(field, errors, projectTexts, translations, caption) {
|
|
|
399
406
|
const text = (typeof own === 'string' && own ? translations?.[own] || own : '')
|
|
400
407
|
|| projectTexts?.[key] || DEFAULT_TEXT[key] || DEFAULT_TEXT['pattern'];
|
|
401
408
|
const e = errors[key] ?? {};
|
|
402
|
-
|
|
409
|
+
// an empty caption in the layout is no name: the next source counts (" is required." before)
|
|
410
|
+
const label = caption || field?.label?.value || field?.label?.caption || field?.propertyCaption || '';
|
|
403
411
|
return text
|
|
404
412
|
.replace(/\{\{\s*field\s*\}\}/g, label)
|
|
405
413
|
.replace(/\{\{\s*requiredLength\s*\}\}/g, String(e.requiredLength ?? ''))
|
|
@@ -419,7 +427,9 @@ function fieldInnerLayoutStyle(formField, container = 'dialog') {
|
|
|
419
427
|
if (container === 'form') {
|
|
420
428
|
return formField?.layout === 'horizontal'
|
|
421
429
|
? { display: 'grid', gridTemplateColumns: 'minmax(110px, 30%) 1fr', alignItems: 'center', gap: '10px' }
|
|
422
|
-
|
|
430
|
+
// one column: the label always stands above the value - with block a read-only value (a span)
|
|
431
|
+
// followed the label on the same line ("Total Quantity1")
|
|
432
|
+
: { display: 'grid', gridTemplateColumns: 'minmax(0, 1fr)' };
|
|
423
433
|
}
|
|
424
434
|
if (formField?.layout === 'horizontal') {
|
|
425
435
|
return {
|
|
@@ -597,6 +607,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
597
607
|
}]
|
|
598
608
|
}] });
|
|
599
609
|
|
|
610
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
611
|
+
// - change: a data object holds names and types only - the e-mail keyboard follows the layout's option.email
|
|
600
612
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18
|
|
601
613
|
// - change: the old option.keyboard counts where keyboardType is missing; DTO types dropdown
|
|
602
614
|
// (text), quantity and bigdecimal (numbers) have their keyboard like in the field catalog (#166)
|
|
@@ -637,7 +649,7 @@ function resolveCustomKeyboardType(option, property) {
|
|
|
637
649
|
if (option?.password) {
|
|
638
650
|
return null;
|
|
639
651
|
}
|
|
640
|
-
if (option?.email
|
|
652
|
+
if (option?.email) {
|
|
641
653
|
return 'email';
|
|
642
654
|
}
|
|
643
655
|
switch (property?.type) {
|
|
@@ -2293,6 +2305,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
2293
2305
|
args: ['box']
|
|
2294
2306
|
}] } });
|
|
2295
2307
|
|
|
2308
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
2309
|
+
// - new: formatDate - how a date is written for a backend, by a pattern the page sets (option.dateFormat).
|
|
2310
|
+
// Without a pattern ISO 8601 with the time zone, no milliseconds: 2026-10-20T00:00:00+02:00.
|
|
2311
|
+
// yyyy MM dd HH mm ss, SSS / SSSS milliseconds (3 or 4 digits), xxx time zone (+02:00), xx (+0200),
|
|
2312
|
+
// 'text' as it is; storageValue / fromStorageValue / parseStorageDate - the one place where a date
|
|
2313
|
+
// becomes text for browser storage and back (dates in lists - a period - too). P5 writes "yyyy-MM-dd'T'HH:mm:ss:SSSSxxx" (before fixed in the card, A4)
|
|
2314
|
+
const DEFAULT_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssxxx";
|
|
2315
|
+
const TOKENS = /'([^']*)'|yyyy|SSSS|SSS|MM|dd|HH|mm|ss|xxx|xx/g;
|
|
2316
|
+
/** The date written by the pattern, in the device's local time. */
|
|
2317
|
+
function formatDate(date, pattern = DEFAULT_DATE_FORMAT) {
|
|
2318
|
+
const pad = (n, len = 2) => String(Math.abs(n)).padStart(len, '0');
|
|
2319
|
+
const offset = -date.getTimezoneOffset();
|
|
2320
|
+
const sign = offset >= 0 ? '+' : '-';
|
|
2321
|
+
const zoneH = pad(Math.floor(Math.abs(offset) / 60));
|
|
2322
|
+
const zoneM = pad(Math.abs(offset) % 60);
|
|
2323
|
+
return (pattern || DEFAULT_DATE_FORMAT).replace(TOKENS, (token, text) => {
|
|
2324
|
+
if (text !== undefined)
|
|
2325
|
+
return text;
|
|
2326
|
+
switch (token) {
|
|
2327
|
+
case 'yyyy': return String(date.getFullYear());
|
|
2328
|
+
case 'MM': return pad(date.getMonth() + 1);
|
|
2329
|
+
case 'dd': return pad(date.getDate());
|
|
2330
|
+
case 'HH': return pad(date.getHours());
|
|
2331
|
+
case 'mm': return pad(date.getMinutes());
|
|
2332
|
+
case 'ss': return pad(date.getSeconds());
|
|
2333
|
+
case 'SSS': return pad(date.getMilliseconds(), 3);
|
|
2334
|
+
case 'SSSS': return pad(date.getMilliseconds(), 4);
|
|
2335
|
+
case 'xxx': return `${sign}${zoneH}:${zoneM}`;
|
|
2336
|
+
case 'xx': return `${sign}${zoneH}${zoneM}`;
|
|
2337
|
+
default: return token;
|
|
2338
|
+
}
|
|
2339
|
+
});
|
|
2340
|
+
}
|
|
2341
|
+
/** How the app keeps a date in browser storage: local time without time zone. */
|
|
2342
|
+
const STORAGE_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
|
|
2343
|
+
/**
|
|
2344
|
+
* A field's value as it goes into browser storage: a Date as local time without zone, a list (a
|
|
2345
|
+
* period) element by element - JSON wrote the dates of a list as UTC ("…T22:00:00.000Z", a day early).
|
|
2346
|
+
*/
|
|
2347
|
+
function storageValue(value) {
|
|
2348
|
+
if (value instanceof Date)
|
|
2349
|
+
return isNaN(value.getTime()) ? null : formatDate(value, STORAGE_DATE_FORMAT);
|
|
2350
|
+
if (Array.isArray(value))
|
|
2351
|
+
return value.map(item => (item instanceof Date ? storageValue(item) : item));
|
|
2352
|
+
return value;
|
|
2353
|
+
}
|
|
2354
|
+
/** The field types whose value is a date (date, time, date and time) or a list of dates (period). */
|
|
2355
|
+
const DATE_TYPES = new Set(['date', 'time', 'datetime', 'date-time', 'date&time']);
|
|
2356
|
+
const RANGE_TYPES = new Set(['daterange']);
|
|
2357
|
+
/**
|
|
2358
|
+
* A stored date text as the wall time it names: Z or an offset (+02:00, what the app itself sends) is
|
|
2359
|
+
* dropped, so 2026-10-18T08:00:00+02:00 reads 08:00 like 2026-10-18T08:00:00 from P5W1.
|
|
2360
|
+
*/
|
|
2361
|
+
function parseStorageDate(value) {
|
|
2362
|
+
const clean = value.trim().replace(/(Z|[+-]\d{2}:?\d{2})$/i, '');
|
|
2363
|
+
const [datePart, timePart = '00:00:00.000'] = clean.split('T');
|
|
2364
|
+
const [y, m, d] = datePart.split('-').map(Number);
|
|
2365
|
+
const [hh = 0, mm = 0, ss = 0, ms = 0] = timePart.split(/[:.]/).map(Number);
|
|
2366
|
+
return new Date(y, m - 1, d, hh, mm, ss, ms);
|
|
2367
|
+
}
|
|
2368
|
+
/**
|
|
2369
|
+
* A stored value back as the field's control expects it, by the field's type: date, time and date and
|
|
2370
|
+
* time as a Date, a period as a list of Dates; anything else unchanged.
|
|
2371
|
+
*/
|
|
2372
|
+
function fromStorageValue(value, type) {
|
|
2373
|
+
const kind = String(type ?? '').toLowerCase();
|
|
2374
|
+
const asDate = (item) => (typeof item === 'string' && /^\d{4}-\d{2}-\d{2}/.test(item) ? parseStorageDate(item) : item);
|
|
2375
|
+
if (DATE_TYPES.has(kind))
|
|
2376
|
+
return asDate(value);
|
|
2377
|
+
if (RANGE_TYPES.has(kind) && Array.isArray(value))
|
|
2378
|
+
return value.map(asDate);
|
|
2379
|
+
return value;
|
|
2380
|
+
}
|
|
2381
|
+
/** Every Date inside a value (object, list) written by the pattern; everything else stays. */
|
|
2382
|
+
function formatDates(value, pattern) {
|
|
2383
|
+
if (value instanceof Date)
|
|
2384
|
+
return isNaN(value.getTime()) ? value : formatDate(value, pattern);
|
|
2385
|
+
if (Array.isArray(value))
|
|
2386
|
+
return value.map(item => formatDates(item, pattern));
|
|
2387
|
+
if (value && typeof value === 'object') {
|
|
2388
|
+
const out = {};
|
|
2389
|
+
for (const [key, item] of Object.entries(value))
|
|
2390
|
+
out[key] = formatDates(item, pattern);
|
|
2391
|
+
return out;
|
|
2392
|
+
}
|
|
2393
|
+
return value;
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2296
2396
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-11
|
|
2297
2397
|
// - new: isNativeMobile(), the one answer to "is this the app on iOS or Android". The runtime asked
|
|
2298
2398
|
// Angular CDK's Platform (platform.IOS / platform.ANDROID), which reads the browser's user agent;
|
|
@@ -2336,6 +2436,12 @@ function backendUrl(url) {
|
|
|
2336
2436
|
return `${window.location.origin}${BACKEND_PROXY_PREFIX}/${target.host}${target.pathname}${target.search}`;
|
|
2337
2437
|
}
|
|
2338
2438
|
|
|
2439
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-25
|
|
2440
|
+
// - fix: dynamicCall (sign-in form, submit and other button calls) goes through backendUrl like the other calls -
|
|
2441
|
+
// it called a backend of another origin directly and CORS refused it (hotel login)
|
|
2442
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
2443
|
+
// - change: saveDb and getSaveOrder removed - fixed P5 time-recording calls; saving and loading with a
|
|
2444
|
+
// filter go through BackendCallService with what the page describes (A2)
|
|
2339
2445
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-15
|
|
2340
2446
|
// - change: saveDb and getSaveOrder (web) go through backendUrl (/api/proxy/<host>/...) instead of
|
|
2341
2447
|
// a direct call (CORS) or the /p5ws path only ng serve knew
|
|
@@ -2386,6 +2492,9 @@ class RequestService {
|
|
|
2386
2492
|
return this.http.get(url);
|
|
2387
2493
|
}
|
|
2388
2494
|
dynamicCall(method = "get", body = null, url, passToken = false, selectedProject = '', userInfo = null) {
|
|
2495
|
+
// in the web a backend of another origin goes through the app's own forwarding (/api/proxy/<host>/...) -
|
|
2496
|
+
// a backend without CORS for the app's address refused the sign-in (hotel); on the devices unchanged
|
|
2497
|
+
url = backendUrl(url);
|
|
2389
2498
|
switch (method.toLowerCase()) {
|
|
2390
2499
|
case 'get':
|
|
2391
2500
|
if (passToken && selectedProject) {
|
|
@@ -2443,50 +2552,6 @@ class RequestService {
|
|
|
2443
2552
|
headers: this.createAuthorizationHeader(token, true),
|
|
2444
2553
|
});
|
|
2445
2554
|
}
|
|
2446
|
-
saveDb(token, userInfo, order = {}) {
|
|
2447
|
-
if (token) {
|
|
2448
|
-
const headers = new HttpHeaders({
|
|
2449
|
-
'Authorization': `Bearer ${token}`,
|
|
2450
|
-
'Accept': 'application/json'
|
|
2451
|
-
});
|
|
2452
|
-
let url2 = `${userInfo.p5_backend_url}/assetsmobileservice/Zeiterfassung/registerTimeRecording?company=${userInfo.p5_group}/${userInfo.p5_client}/${userInfo.p5_plant ? userInfo.p5_plant : " "}&appVersion=1&resourceNo=${userInfo.p5_resource_no}`;
|
|
2453
|
-
this.http.post(backendUrl(url2), order, { headers }).subscribe({
|
|
2454
|
-
next: res => {
|
|
2455
|
-
console.log('Save-res: ', res);
|
|
2456
|
-
}
|
|
2457
|
-
});
|
|
2458
|
-
}
|
|
2459
|
-
}
|
|
2460
|
-
getSaveOrder(token, userInfo, fromDate, toDate) {
|
|
2461
|
-
if (!token) {
|
|
2462
|
-
throw new Error('Missing authentication token');
|
|
2463
|
-
}
|
|
2464
|
-
if (!userInfo?.p5_backend_url) {
|
|
2465
|
-
throw new Error('Missing p5_backend_url');
|
|
2466
|
-
}
|
|
2467
|
-
const headers = new HttpHeaders({
|
|
2468
|
-
Authorization: `Bearer ${token}`,
|
|
2469
|
-
Accept: 'application/json',
|
|
2470
|
-
'Content-Type': 'application/json'
|
|
2471
|
-
});
|
|
2472
|
-
const company = userInfo.p5_plant
|
|
2473
|
-
? `${userInfo.p5_group}/${userInfo.p5_client}/${userInfo.p5_plant}`
|
|
2474
|
-
: `${userInfo.p5_group}/${userInfo.p5_client}/`;
|
|
2475
|
-
const url = backendUrl(`${String(userInfo.p5_backend_url).replace(/\/+$/, '')}` +
|
|
2476
|
-
'/assetsmobileservice/Zeiterfassung/requestBookedTimeRecording');
|
|
2477
|
-
const params = new HttpParams()
|
|
2478
|
-
.set('resourceNo', userInfo.p5_resource_no || '')
|
|
2479
|
-
.set('workDayFrom', fromDate)
|
|
2480
|
-
.set('workDayTo', toDate)
|
|
2481
|
-
.set('company', company)
|
|
2482
|
-
.set('appVersion', '1');
|
|
2483
|
-
console.log('[Saved orders][Web] URL:', url);
|
|
2484
|
-
console.log('[Saved orders][Web] Params:', params.toString());
|
|
2485
|
-
return this.http.post(url, {}, {
|
|
2486
|
-
headers,
|
|
2487
|
-
params
|
|
2488
|
-
});
|
|
2489
|
-
}
|
|
2490
2555
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: RequestService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2491
2556
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: RequestService, providedIn: 'root' });
|
|
2492
2557
|
}
|
|
@@ -2501,6 +2566,9 @@ class UtilityService {
|
|
|
2501
2566
|
platform;
|
|
2502
2567
|
requestService;
|
|
2503
2568
|
stripe = null;
|
|
2569
|
+
cardElement = null;
|
|
2570
|
+
/** Stripe says the card field holds a whole card (number, date, CVC) - a signal, so a locked button follows it */
|
|
2571
|
+
cardComplete = signal(false, ...(ngDevMode ? [{ debugName: "cardComplete" }] : /* istanbul ignore next */ []));
|
|
2504
2572
|
constructor(platform, requestService) {
|
|
2505
2573
|
this.platform = platform;
|
|
2506
2574
|
this.requestService = requestService;
|
|
@@ -2702,7 +2770,21 @@ class UtilityService {
|
|
|
2702
2770
|
});
|
|
2703
2771
|
}
|
|
2704
2772
|
}
|
|
2773
|
+
/**
|
|
2774
|
+
* The page an entry opens for this user. The app settings form (Main with center.appSettings,
|
|
2775
|
+
* OFFENE-PUNKTE 109): the start page is center.option; a role with its own start page in
|
|
2776
|
+
* appSettings.login.roles wins (startPageFor of the catalog) - the role read through roleKey from the
|
|
2777
|
+
* sign-in answer or the token's claims (Keycloak "realm_access.roles", Okta "groups"). The older form
|
|
2778
|
+
* (the role pages in option.userRoleMapping) is read as before until every app is converted.
|
|
2779
|
+
*/
|
|
2705
2780
|
setDefaultUser(item, userInfo, environment) {
|
|
2781
|
+
if (item?.appSettings && !item?.option?.userRoleMapping) {
|
|
2782
|
+
const page = startPageFor({ center: item }, userInfo ? this.userClaims(userInfo) : null);
|
|
2783
|
+
const option = { ...(item.option ?? {}) };
|
|
2784
|
+
for (const key of START_PAGE_KEYS)
|
|
2785
|
+
delete option[key];
|
|
2786
|
+
return { ...item, option: { ...option, ...page } };
|
|
2787
|
+
}
|
|
2706
2788
|
let schema = item;
|
|
2707
2789
|
let role = "default";
|
|
2708
2790
|
/* @contract decision: login.type is one of keycloak, oktaAuth, jwtToken.
|
|
@@ -2726,6 +2808,29 @@ class UtilityService {
|
|
|
2726
2808
|
}
|
|
2727
2809
|
return schema;
|
|
2728
2810
|
}
|
|
2811
|
+
/**
|
|
2812
|
+
* The user as the roles are looked up in: the sign-in answer or user info, together with the claims of
|
|
2813
|
+
* its access token (token, authToken, access_token or keycloakInfo.access_token) - Keycloak and Okta keep
|
|
2814
|
+
* the roles there. The user's own fields win over a claim of the same name.
|
|
2815
|
+
*/
|
|
2816
|
+
userClaims(userInfo) {
|
|
2817
|
+
if (!userInfo || typeof userInfo !== 'object')
|
|
2818
|
+
return userInfo;
|
|
2819
|
+
const token = userInfo.token || userInfo.authToken || userInfo.access_token || userInfo.keycloakInfo?.access_token;
|
|
2820
|
+
let claims = {};
|
|
2821
|
+
if (typeof token === 'string' && token.split('.').length === 3) {
|
|
2822
|
+
try {
|
|
2823
|
+
const part = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');
|
|
2824
|
+
const json = decodeURIComponent(atob(part.padEnd(part.length + (4 - part.length % 4) % 4, '='))
|
|
2825
|
+
.split('').map(c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)).join(''));
|
|
2826
|
+
claims = JSON.parse(json);
|
|
2827
|
+
}
|
|
2828
|
+
catch {
|
|
2829
|
+
claims = {};
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
return { ...claims, ...userInfo };
|
|
2833
|
+
}
|
|
2729
2834
|
setTableData(data, option = {}, tableitemInfo, projectSeleted) {
|
|
2730
2835
|
if (option?.pagination?.pageSize && option?.pagination?.scrollable) {
|
|
2731
2836
|
tableitemInfo.pageSize = option?.pagination?.pageSize;
|
|
@@ -2813,7 +2918,10 @@ class UtilityService {
|
|
|
2813
2918
|
const elements = this.stripe.elements();
|
|
2814
2919
|
const cardElement = elements.create('card', { hidePostalCode: true });
|
|
2815
2920
|
cardElement.mount('#card-element');
|
|
2921
|
+
this.cardElement = cardElement;
|
|
2922
|
+
this.cardComplete.set(false);
|
|
2816
2923
|
cardElement.on('change', (event) => {
|
|
2924
|
+
this.cardComplete.set(!!event.complete);
|
|
2817
2925
|
if (event.complete) {
|
|
2818
2926
|
onCardChange('');
|
|
2819
2927
|
}
|
|
@@ -2823,6 +2931,35 @@ class UtilityService {
|
|
|
2823
2931
|
});
|
|
2824
2932
|
}
|
|
2825
2933
|
}
|
|
2934
|
+
/**
|
|
2935
|
+
* A required card field (option.required in the layout) without a whole card: the card is no field of
|
|
2936
|
+
* the Angular form (Stripe's own frame), so the form's validity does not see it.
|
|
2937
|
+
*/
|
|
2938
|
+
requiredCardMissing(layoutSchema, propertySchema) {
|
|
2939
|
+
const required = (layoutSchema?.formSections || []).some((section) => (section?.formFields || []).some((field) => {
|
|
2940
|
+
const reference = field?.scope?.reference;
|
|
2941
|
+
const scopeKey = this.getScope(reference);
|
|
2942
|
+
return field?.option?.required === true && typeof reference === 'string'
|
|
2943
|
+
&& propertySchema?.[scopeKey]?.[reference.split('/').pop()]?.type === 'creditCard';
|
|
2944
|
+
}));
|
|
2945
|
+
return required && !this.cardComplete();
|
|
2946
|
+
}
|
|
2947
|
+
/**
|
|
2948
|
+
* Pays a payment intent with the card field of the page. ok false with the reason in error when the
|
|
2949
|
+
* field is not there yet or Stripe refuses the card; the card data never leaves Stripe's own frame.
|
|
2950
|
+
*/
|
|
2951
|
+
async confirmCardPayment(clientSecret, billingDetails = {}) {
|
|
2952
|
+
if (!this.stripe || !this.cardElement) {
|
|
2953
|
+
return { ok: false, error: 'The card field is not ready.' };
|
|
2954
|
+
}
|
|
2955
|
+
const result = await this.stripe.confirmCardPayment(clientSecret, {
|
|
2956
|
+
payment_method: { card: this.cardElement, billing_details: billingDetails },
|
|
2957
|
+
});
|
|
2958
|
+
if (result.error) {
|
|
2959
|
+
return { ok: false, error: result.error.message };
|
|
2960
|
+
}
|
|
2961
|
+
return { ok: true, paymentIntent: result.paymentIntent };
|
|
2962
|
+
}
|
|
2826
2963
|
async formData(form, environment, cartInfo) {
|
|
2827
2964
|
if (form.layoutSchema?.formSections) {
|
|
2828
2965
|
for (const formSection of form.layoutSchema.formSections) {
|
|
@@ -2875,14 +3012,9 @@ class UtilityService {
|
|
|
2875
3012
|
// set date in localstorage
|
|
2876
3013
|
normalizeDatesForStorage(obj) {
|
|
2877
3014
|
const normalized = {};
|
|
3015
|
+
// a date as local time, a period (a list of dates) element by element - it went in as UTC
|
|
2878
3016
|
Object.entries(obj).forEach(([key, value]) => {
|
|
2879
|
-
|
|
2880
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
2881
|
-
normalized[key] = this.toLocalISOString(date);
|
|
2882
|
-
}
|
|
2883
|
-
else {
|
|
2884
|
-
normalized[key] = value;
|
|
2885
|
-
}
|
|
3017
|
+
normalized[key] = storageValue(value);
|
|
2886
3018
|
});
|
|
2887
3019
|
return normalized;
|
|
2888
3020
|
}
|
|
@@ -2906,40 +3038,24 @@ class UtilityService {
|
|
|
2906
3038
|
.slice(0, 19);
|
|
2907
3039
|
}
|
|
2908
3040
|
// restore date Field from localstorage
|
|
3041
|
+
/** Dates of stored records back to Date objects - date, time, date and time, period (date-format.ts). */
|
|
2909
3042
|
restoreDatesFromStorage(records, propertySchema) {
|
|
2910
|
-
if (!Array.isArray(records))
|
|
2911
|
-
return records;
|
|
2912
|
-
if (!propertySchema)
|
|
3043
|
+
if (!Array.isArray(records) || !propertySchema)
|
|
2913
3044
|
return records;
|
|
2914
3045
|
return records.map(record => {
|
|
2915
3046
|
const restored = { ...record };
|
|
2916
|
-
Object.
|
|
2917
|
-
const schemaGroup
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
const value = restored[fieldKey];
|
|
2923
|
-
if (!value || typeof value !== 'string')
|
|
2924
|
-
return;
|
|
2925
|
-
// ✅ DATE or TIME fields only
|
|
2926
|
-
if (fieldSchema.type === 'date' || fieldSchema.type === 'time') {
|
|
2927
|
-
restored[fieldKey] = this.parseLocalISODate(value);
|
|
2928
|
-
}
|
|
2929
|
-
});
|
|
2930
|
-
});
|
|
3047
|
+
for (const schemaGroup of Object.values(propertySchema)) {
|
|
3048
|
+
for (const [fieldKey, fieldSchema] of Object.entries(schemaGroup || {})) {
|
|
3049
|
+
if (restored[fieldKey] != null)
|
|
3050
|
+
restored[fieldKey] = fromStorageValue(restored[fieldKey], fieldSchema?.type);
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
2931
3053
|
return restored;
|
|
2932
3054
|
});
|
|
2933
3055
|
}
|
|
3056
|
+
/** A stored date text as the wall time it names (date-format.ts). */
|
|
2934
3057
|
parseLocalISODate(value) {
|
|
2935
|
-
|
|
2936
|
-
// 2026-10-18T08:00:00+02:00 reads 08:00 like 2026-10-18T08:00:00 from P5W1 - before, the offset
|
|
2937
|
-
// ended up in the seconds ("00+02") and gave an invalid date
|
|
2938
|
-
const clean = value.trim().replace(/(Z|[+-]\d{2}:?\d{2})$/i, '');
|
|
2939
|
-
const [datePart, timePart = '00:00:00.000'] = clean.split('T');
|
|
2940
|
-
const [y, m, d] = datePart.split('-').map(Number);
|
|
2941
|
-
const [hh = 0, mm = 0, ss = 0, ms = 0] = timePart.split(/[:.]/).map(Number);
|
|
2942
|
-
return new Date(y, m - 1, d, hh, mm, ss, ms);
|
|
3058
|
+
return parseStorageDate(value);
|
|
2943
3059
|
}
|
|
2944
3060
|
// savecard conversion
|
|
2945
3061
|
convertToDailyLogs(cardOrCards) {
|
|
@@ -3038,6 +3154,9 @@ class UtilityService {
|
|
|
3038
3154
|
getMediaSrc(file) {
|
|
3039
3155
|
if (!file)
|
|
3040
3156
|
return '';
|
|
3157
|
+
// already a source (data URL, link) - getImageSrcFromCouchDb answers one; the header logo stayed empty
|
|
3158
|
+
if (typeof file === 'string')
|
|
3159
|
+
return file;
|
|
3041
3160
|
if (file.src) {
|
|
3042
3161
|
return file.src;
|
|
3043
3162
|
}
|
|
@@ -4757,6 +4876,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
4757
4876
|
}]
|
|
4758
4877
|
}], ctorParameters: () => [{ type: Couchdb }] });
|
|
4759
4878
|
|
|
4879
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
4880
|
+
// - change: a data object holds names and types only - the start file is the layout's default (option.fieldData.default), the caption the layout's
|
|
4760
4881
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18
|
|
4761
4882
|
// - new: vl-media, the media field - the same in form, dialog, card and grid (before: the template
|
|
4762
4883
|
// and its getMediaSource/getMediaKind/getMediaLabel copied four times). Image; video and audio
|
|
@@ -4817,17 +4938,17 @@ class MediaControl {
|
|
|
4817
4938
|
clicked = new EventEmitter();
|
|
4818
4939
|
large = false;
|
|
4819
4940
|
source() {
|
|
4820
|
-
const value = this.field?.option?.src || this.value || this.
|
|
4941
|
+
const value = this.field?.option?.src || this.value || this.field?.option?.fieldData?.default || '';
|
|
4821
4942
|
return typeof value === 'string' ? value.trim() : '';
|
|
4822
4943
|
}
|
|
4823
4944
|
kind() {
|
|
4824
|
-
return mediaKind(this.source(), this.field?.option?.fileName, this.value, this.
|
|
4945
|
+
return mediaKind(this.source(), this.field?.option?.fileName, this.value, this.field?.option?.fieldData?.default);
|
|
4825
4946
|
}
|
|
4826
4947
|
label() {
|
|
4827
4948
|
const label = this.field?.label;
|
|
4828
4949
|
if (typeof label === 'string' && label.trim())
|
|
4829
4950
|
return label;
|
|
4830
|
-
return label?.value || label?.caption ||
|
|
4951
|
+
return label?.value || label?.caption || 'Media';
|
|
4831
4952
|
}
|
|
4832
4953
|
symbolClass() {
|
|
4833
4954
|
const kind = this.kind();
|
|
@@ -4958,6 +5079,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
4958
5079
|
type: Output
|
|
4959
5080
|
}] } });
|
|
4960
5081
|
|
|
5082
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
5083
|
+
// - change: a data object holds names and types only - the currency comes from the layout only
|
|
4961
5084
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18
|
|
4962
5085
|
// - new: how a number field is shown and typed, worked out once for vl-number (#166 step 4.8). The
|
|
4963
5086
|
// Designer's settings: option.numberStyle decimal / currency / percent, option.decimals (decimal
|
|
@@ -4988,8 +5111,7 @@ function numberShape(field, property, row) {
|
|
|
4988
5111
|
const value = other !== null && typeof other === 'object' ? other.value : other;
|
|
4989
5112
|
currency = typeof value === 'string' && /^[A-Za-z]{3}$/.test(value) ? value.toUpperCase() : null;
|
|
4990
5113
|
}
|
|
4991
|
-
currency = currency || (typeof option.currency === 'string' && option.currency ? option.currency : null)
|
|
4992
|
-
|| property?.currency || property?.format?.currency || null;
|
|
5114
|
+
currency = currency || (typeof option.currency === 'string' && option.currency ? option.currency : null);
|
|
4993
5115
|
const unit = typeof option.unit === 'string' && option.unit ? option.unit : null;
|
|
4994
5116
|
const unitLabel = typeof option.unitLabel === 'string' && option.unitLabel ? option.unitLabel : null;
|
|
4995
5117
|
const style = option.numberStyle === 'percent' ? 'percent'
|
|
@@ -5117,6 +5239,9 @@ function numberStep(field, shape, integer) {
|
|
|
5117
5239
|
return integer ? 1 : 'any';
|
|
5118
5240
|
}
|
|
5119
5241
|
|
|
5242
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22
|
|
5243
|
+
// - fix: the spinner's field has a small padding and a centred number - in a table cell it was 35px
|
|
5244
|
+
// wide and its 2 x 12px padding hid the number
|
|
5120
5245
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18
|
|
5121
5246
|
// - new: vl-number, the number field - the same in form, dialog, card and grid: a number field with
|
|
5122
5247
|
// the numeric keyboard; spinner adds - / + (step, default 1); slider moves between the rule's
|
|
@@ -5230,7 +5355,7 @@ class NumberControl {
|
|
|
5230
5355
|
<p class="text-danger vl-number__error" *ngIf="showError()">{{ message() }}</p>
|
|
5231
5356
|
</ng-container>
|
|
5232
5357
|
<ng-template #shownText><span class="vl-number__text">{{ shown(value) }}</span></ng-template>
|
|
5233
|
-
`, isInline: true, styles: [":host{display:block;min-width:0}.vl-number{display:flex;align-items:center;gap:6px;min-width:0}.vl-number__box{position:relative;flex:1;min-width:0;display:block}.vl-number__input{min-width:0;width:100%}.vl-number__input--sign{padding-right:2.5rem!important}.vl-number__sign{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);color:#64748b;pointer-events:none}.vl-number__step{width:2.5rem;height:2.5rem;flex:0 0 auto;border:1px solid #cbd5e1;border-radius:6px;background:#fff;font-size:1.1rem;cursor:pointer}.vl-number__range{flex:1;min-width:0}.vl-number__value{min-width:3ch;text-align:right}.vl-number__error{margin:4px 0 0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: CustomKeyboardDirective, selector: "[vlCustomKeyboard]", inputs: ["vlCustomKeyboard"] }, { kind: "pipe", type: RulesPipe, name: "vlRules" }], viewProviders: [{ provide: ControlContainer, useFactory: (form) => form, deps: [[new Optional(), new SkipSelf(), NgForm]] }] });
|
|
5358
|
+
`, isInline: true, styles: [":host{display:block;min-width:0}.vl-number{display:flex;align-items:center;gap:6px;min-width:0}.vl-number__box{position:relative;flex:1;min-width:0;display:block}.vl-number__input{min-width:0;width:100%}.vl-number--spinner .vl-number__input{padding-left:4px!important;padding-right:4px!important;text-align:center}.vl-number__input--sign{padding-right:2.5rem!important}.vl-number__sign{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);color:#64748b;pointer-events:none}.vl-number__step{width:2.5rem;height:2.5rem;flex:0 0 auto;border:1px solid #cbd5e1;border-radius:6px;background:#fff;font-size:1.1rem;cursor:pointer}.vl-number__range{flex:1;min-width:0}.vl-number__value{min-width:3ch;text-align:right}.vl-number__error{margin:4px 0 0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: CustomKeyboardDirective, selector: "[vlCustomKeyboard]", inputs: ["vlCustomKeyboard"] }, { kind: "pipe", type: RulesPipe, name: "vlRules" }], viewProviders: [{ provide: ControlContainer, useFactory: (form) => form, deps: [[new Optional(), new SkipSelf(), NgForm]] }] });
|
|
5234
5359
|
}
|
|
5235
5360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: NumberControl, decorators: [{
|
|
5236
5361
|
type: Component,
|
|
@@ -5263,7 +5388,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
5263
5388
|
<p class="text-danger vl-number__error" *ngIf="showError()">{{ message() }}</p>
|
|
5264
5389
|
</ng-container>
|
|
5265
5390
|
<ng-template #shownText><span class="vl-number__text">{{ shown(value) }}</span></ng-template>
|
|
5266
|
-
`, styles: [":host{display:block;min-width:0}.vl-number{display:flex;align-items:center;gap:6px;min-width:0}.vl-number__box{position:relative;flex:1;min-width:0;display:block}.vl-number__input{min-width:0;width:100%}.vl-number__input--sign{padding-right:2.5rem!important}.vl-number__sign{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);color:#64748b;pointer-events:none}.vl-number__step{width:2.5rem;height:2.5rem;flex:0 0 auto;border:1px solid #cbd5e1;border-radius:6px;background:#fff;font-size:1.1rem;cursor:pointer}.vl-number__range{flex:1;min-width:0}.vl-number__value{min-width:3ch;text-align:right}.vl-number__error{margin:4px 0 0}\n"] }]
|
|
5391
|
+
`, styles: [":host{display:block;min-width:0}.vl-number{display:flex;align-items:center;gap:6px;min-width:0}.vl-number__box{position:relative;flex:1;min-width:0;display:block}.vl-number__input{min-width:0;width:100%}.vl-number--spinner .vl-number__input{padding-left:4px!important;padding-right:4px!important;text-align:center}.vl-number__input--sign{padding-right:2.5rem!important}.vl-number__sign{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);color:#64748b;pointer-events:none}.vl-number__step{width:2.5rem;height:2.5rem;flex:0 0 auto;border:1px solid #cbd5e1;border-radius:6px;background:#fff;font-size:1.1rem;cursor:pointer}.vl-number__range{flex:1;min-width:0}.vl-number__value{min-width:3ch;text-align:right}.vl-number__error{margin:4px 0 0}\n"] }]
|
|
5267
5392
|
}], propDecorators: { field: [{
|
|
5268
5393
|
type: Input
|
|
5269
5394
|
}], target: [{
|
|
@@ -5744,11 +5869,11 @@ class Textbox {
|
|
|
5744
5869
|
return ruleMessage(this.formField, control?.errors, this.selectedLanguageInfo?.errorMessages || this.errorMessages, this.selectedLanguageInfo?.selectedLanguage);
|
|
5745
5870
|
}
|
|
5746
5871
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: Textbox, deps: [{ token: i0.ChangeDetectorRef }, { token: UtilityService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5747
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: Textbox, isStandalone: true, selector: "vl-textbox", inputs: { formField: "formField", modalItemInfo: "modalItemInfo", saveTried: "saveTried", errorMessages: "errorMessages", readonly: "readonly", value: "value" }, outputs: { linkClicked: "linkClicked" }, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - change: rules from the layout and their message (#166 step 4.6)\r\n - change: the one text field of the library (form, dialog, grid footer); read only it shows the text,\r\n a link when option.link (step 4.4) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: the toolkit keyboard follows the attribute type (keyboardTypeFor) -->\r\n<ng-container *ngIf=\"!readonly; else shownText\">\r\n<input pInputText [attr.type]=\"(formField | vlRules).email ? 'email' : 'text'\" #inputField=\"ngModel\" [vlCustomKeyboard]=\"keyboardTypeFor(formField)\"\r\n [required]=\"(formField | vlRules).required\" [email]=\"(formField | vlRules).email\"\r\n [minlength]=\"(formField | vlRules).minLength\" [maxlength]=\"(formField | vlRules).maxLength\"\r\n [pattern]=\"(formField | vlRules).pattern ?? ''\" [disabled]=\"formField?.option?.disabled\"\r\n [readonly]=\"\r\n modalItemInfo.propertySchema[\r\n getScope(formField.scope?.reference)\r\n ][\r\n formField.scope.reference.split('/').pop()\r\n ]?.readonly\r\n \" [style]=\"getStyleWithoutClasses(formField?.scope?.style).style\" [class]=\"\r\n formField?.scope?.style?.classes\r\n ? formField.scope.style.classes[0]\r\n : ''\r\n \" [(ngModel)]=\"\r\n modalItemInfo.propertySchema[\r\n getScope(formField.scope?.reference)\r\n ][\r\n formField.scope.reference.split('/').pop()\r\n ].value\r\n \" [name]=\"formField.scope?.reference\" [placeholder]=\"getPlaceholder(formField)\" />\r\n<p class=\"text-danger\" *ngIf=\"showError(inputField)\">{{ fieldMessage(inputField) }}</p>\r\n</ng-container>\r\n<ng-template #shownText>\r\n <span class=\"vl-textbox__text\" [class.vl-textbox__link]=\"formField?.option?.link\"\r\n (click)=\"formField?.option?.link && linkClicked.emit(value)\">{{ value === null || value === undefined || value === '' ? '--' : value }}</span>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.EmailValidator, selector: "[email][formControlName],[email][formControl],[email][ngModel]", inputs: ["email"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$3.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: CustomKeyboardDirective, selector: "[vlCustomKeyboard]", inputs: ["vlCustomKeyboard"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: RulesPipe, name: "vlRules" }], viewProviders: [{ provide: ControlContainer, useFactory: (form) => form, deps: [[new Optional(), new SkipSelf(), NgForm]] }] });
|
|
5872
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: Textbox, isStandalone: true, selector: "vl-textbox", inputs: { formField: "formField", modalItemInfo: "modalItemInfo", saveTried: "saveTried", errorMessages: "errorMessages", readonly: "readonly", value: "value" }, outputs: { linkClicked: "linkClicked" }, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - fix: read only, the text takes the field's style (scope.style) like the input does - a protected\r\n field lost its box (padding, background, border) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - change: rules from the layout and their message (#166 step 4.6)\r\n - change: the one text field of the library (form, dialog, grid footer); read only it shows the text,\r\n a link when option.link (step 4.4) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: the toolkit keyboard follows the attribute type (keyboardTypeFor) -->\r\n<ng-container *ngIf=\"!readonly; else shownText\">\r\n<input pInputText [attr.type]=\"(formField | vlRules).email ? 'email' : 'text'\" #inputField=\"ngModel\" [vlCustomKeyboard]=\"keyboardTypeFor(formField)\"\r\n [required]=\"(formField | vlRules).required\" [email]=\"(formField | vlRules).email\"\r\n [minlength]=\"(formField | vlRules).minLength\" [maxlength]=\"(formField | vlRules).maxLength\"\r\n [pattern]=\"(formField | vlRules).pattern ?? ''\" [disabled]=\"formField?.option?.disabled\"\r\n [readonly]=\"\r\n modalItemInfo.propertySchema[\r\n getScope(formField.scope?.reference)\r\n ][\r\n formField.scope.reference.split('/').pop()\r\n ]?.readonly\r\n \" [style]=\"getStyleWithoutClasses(formField?.scope?.style).style\" [class]=\"\r\n formField?.scope?.style?.classes\r\n ? formField.scope.style.classes[0]\r\n : ''\r\n \" [(ngModel)]=\"\r\n modalItemInfo.propertySchema[\r\n getScope(formField.scope?.reference)\r\n ][\r\n formField.scope.reference.split('/').pop()\r\n ].value\r\n \" [name]=\"formField.scope?.reference\" [placeholder]=\"getPlaceholder(formField)\" />\r\n<p class=\"text-danger\" *ngIf=\"showError(inputField)\">{{ fieldMessage(inputField) }}</p>\r\n</ng-container>\r\n<ng-template #shownText>\r\n <span class=\"vl-textbox__text\" [class.vl-textbox__link]=\"formField?.option?.link\"\r\n [ngClass]=\"getStyleWithoutClasses(formField?.scope?.style).classes\" [style]=\"getStyleWithoutClasses(formField?.scope?.style).style\"\r\n (click)=\"formField?.option?.link && linkClicked.emit(value)\">{{ value === null || value === undefined || value === '' ? '--' : value }}</span>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.EmailValidator, selector: "[email][formControlName],[email][formControl],[email][ngModel]", inputs: ["email"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$3.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: CustomKeyboardDirective, selector: "[vlCustomKeyboard]", inputs: ["vlCustomKeyboard"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: RulesPipe, name: "vlRules" }], viewProviders: [{ provide: ControlContainer, useFactory: (form) => form, deps: [[new Optional(), new SkipSelf(), NgForm]] }] });
|
|
5748
5873
|
}
|
|
5749
5874
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: Textbox, decorators: [{
|
|
5750
5875
|
type: Component,
|
|
5751
|
-
args: [{ selector: 'vl-textbox', standalone: true, imports: [FormsModule, InputTextModule, CustomKeyboardDirective, RulesPipe, NgIf], viewProviders: [{ provide: ControlContainer, useFactory: (form) => form, deps: [[new Optional(), new SkipSelf(), NgForm]] }], template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - change: rules from the layout and their message (#166 step 4.6)\r\n - change: the one text field of the library (form, dialog, grid footer); read only it shows the text,\r\n a link when option.link (step 4.4) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: the toolkit keyboard follows the attribute type (keyboardTypeFor) -->\r\n<ng-container *ngIf=\"!readonly; else shownText\">\r\n<input pInputText [attr.type]=\"(formField | vlRules).email ? 'email' : 'text'\" #inputField=\"ngModel\" [vlCustomKeyboard]=\"keyboardTypeFor(formField)\"\r\n [required]=\"(formField | vlRules).required\" [email]=\"(formField | vlRules).email\"\r\n [minlength]=\"(formField | vlRules).minLength\" [maxlength]=\"(formField | vlRules).maxLength\"\r\n [pattern]=\"(formField | vlRules).pattern ?? ''\" [disabled]=\"formField?.option?.disabled\"\r\n [readonly]=\"\r\n modalItemInfo.propertySchema[\r\n getScope(formField.scope?.reference)\r\n ][\r\n formField.scope.reference.split('/').pop()\r\n ]?.readonly\r\n \" [style]=\"getStyleWithoutClasses(formField?.scope?.style).style\" [class]=\"\r\n formField?.scope?.style?.classes\r\n ? formField.scope.style.classes[0]\r\n : ''\r\n \" [(ngModel)]=\"\r\n modalItemInfo.propertySchema[\r\n getScope(formField.scope?.reference)\r\n ][\r\n formField.scope.reference.split('/').pop()\r\n ].value\r\n \" [name]=\"formField.scope?.reference\" [placeholder]=\"getPlaceholder(formField)\" />\r\n<p class=\"text-danger\" *ngIf=\"showError(inputField)\">{{ fieldMessage(inputField) }}</p>\r\n</ng-container>\r\n<ng-template #shownText>\r\n <span class=\"vl-textbox__text\" [class.vl-textbox__link]=\"formField?.option?.link\"\r\n (click)=\"formField?.option?.link && linkClicked.emit(value)\">{{ value === null || value === undefined || value === '' ? '--' : value }}</span>\r\n</ng-template>\r\n" }]
|
|
5876
|
+
args: [{ selector: 'vl-textbox', standalone: true, imports: [FormsModule, InputTextModule, CustomKeyboardDirective, RulesPipe, NgIf, NgClass], viewProviders: [{ provide: ControlContainer, useFactory: (form) => form, deps: [[new Optional(), new SkipSelf(), NgForm]] }], template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - fix: read only, the text takes the field's style (scope.style) like the input does - a protected\r\n field lost its box (padding, background, border) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - change: rules from the layout and their message (#166 step 4.6)\r\n - change: the one text field of the library (form, dialog, grid footer); read only it shows the text,\r\n a link when option.link (step 4.4) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: the toolkit keyboard follows the attribute type (keyboardTypeFor) -->\r\n<ng-container *ngIf=\"!readonly; else shownText\">\r\n<input pInputText [attr.type]=\"(formField | vlRules).email ? 'email' : 'text'\" #inputField=\"ngModel\" [vlCustomKeyboard]=\"keyboardTypeFor(formField)\"\r\n [required]=\"(formField | vlRules).required\" [email]=\"(formField | vlRules).email\"\r\n [minlength]=\"(formField | vlRules).minLength\" [maxlength]=\"(formField | vlRules).maxLength\"\r\n [pattern]=\"(formField | vlRules).pattern ?? ''\" [disabled]=\"formField?.option?.disabled\"\r\n [readonly]=\"\r\n modalItemInfo.propertySchema[\r\n getScope(formField.scope?.reference)\r\n ][\r\n formField.scope.reference.split('/').pop()\r\n ]?.readonly\r\n \" [style]=\"getStyleWithoutClasses(formField?.scope?.style).style\" [class]=\"\r\n formField?.scope?.style?.classes\r\n ? formField.scope.style.classes[0]\r\n : ''\r\n \" [(ngModel)]=\"\r\n modalItemInfo.propertySchema[\r\n getScope(formField.scope?.reference)\r\n ][\r\n formField.scope.reference.split('/').pop()\r\n ].value\r\n \" [name]=\"formField.scope?.reference\" [placeholder]=\"getPlaceholder(formField)\" />\r\n<p class=\"text-danger\" *ngIf=\"showError(inputField)\">{{ fieldMessage(inputField) }}</p>\r\n</ng-container>\r\n<ng-template #shownText>\r\n <span class=\"vl-textbox__text\" [class.vl-textbox__link]=\"formField?.option?.link\"\r\n [ngClass]=\"getStyleWithoutClasses(formField?.scope?.style).classes\" [style]=\"getStyleWithoutClasses(formField?.scope?.style).style\"\r\n (click)=\"formField?.option?.link && linkClicked.emit(value)\">{{ value === null || value === undefined || value === '' ? '--' : value }}</span>\r\n</ng-template>\r\n" }]
|
|
5752
5877
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: UtilityService }], propDecorators: { formField: [{
|
|
5753
5878
|
type: Input
|
|
5754
5879
|
}], modalItemInfo: [{
|
|
@@ -5837,6 +5962,23 @@ function styleParts(styleObject) {
|
|
|
5837
5962
|
return { classes: list.filter((c) => typeof c === 'string' && c.trim()).join(' '), style };
|
|
5838
5963
|
}
|
|
5839
5964
|
|
|
5965
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
5966
|
+
// - change: no list of the missing fields under a locked button (user 2026-10-24) - goToField removed
|
|
5967
|
+
// - change: lockHints - every reason under the button (sign-in link and fields hint), the missing fields named
|
|
5968
|
+
// and clickable (goToField)
|
|
5969
|
+
// - new: a locked button stays clickable: the click is lockedClick (the container shows what is missing), not
|
|
5970
|
+
// buttonClick; lockHint stands under it, for a missing sign-in a link (signIn)
|
|
5971
|
+
// - new: a required field (option.required) has a red * after its label
|
|
5972
|
+
// - change: a locked button is really grey (vl-control__button--locked), the layout's colour half transparent looked clickable
|
|
5973
|
+
// - new: locked - a button grey and without click while its container locks it (needsLogin / needsValid)
|
|
5974
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
5975
|
+
// - change: a data object holds names and types only - label and message from the layout (a message names a field without label by its property name)
|
|
5976
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
5977
|
+
// - change: ruleField no longer takes rules from the data object - the layout alone sets them
|
|
5978
|
+
// - fix: ruleField carries the data object's caption (propertyCaption) for the messages of a field without its own label
|
|
5979
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22
|
|
5980
|
+
// - fix: the building blocks get the field with its data object's rules (ruleField, withPropertyRules) -
|
|
5981
|
+
// validation: [{ required: true }] in the data object was ignored: no check, a clear button (x)
|
|
5840
5982
|
// Shuaib 2026-10-21
|
|
5841
5983
|
// - fix: display mode shows what the record stores: an empty value is "--", never the property's
|
|
5842
5984
|
// default (a request saved without status showed "beantragt"); the rule is controls/display-value.ts
|
|
@@ -5869,6 +6011,10 @@ class ControlComponent {
|
|
|
5869
6011
|
container = 'dialog';
|
|
5870
6012
|
/** the button's type: 'submit' lets Enter in a field press it (form) */
|
|
5871
6013
|
buttonType = 'button';
|
|
6014
|
+
/** the button is grey and sends nothing (needsLogin / needsValid of its layout); a click is lockedClick */
|
|
6015
|
+
locked = false;
|
|
6016
|
+
/** the hints under a locked button: one per reason (sign-in, fields), the fields hint with the missing fields */
|
|
6017
|
+
lockHints = [];
|
|
5872
6018
|
/** 'edit': the field to type in (dialog, form); 'display': a record's value shown (card, grid) */
|
|
5873
6019
|
mode = 'edit';
|
|
5874
6020
|
/** display mode: the record whose value is shown (record[name]) */
|
|
@@ -5899,6 +6045,10 @@ class ControlComponent {
|
|
|
5899
6045
|
mediaClicked = new EventEmitter();
|
|
5900
6046
|
/** a button was clicked; its option (innerAction, action ...) */
|
|
5901
6047
|
buttonClick = new EventEmitter();
|
|
6048
|
+
/** a click on a locked button: nothing is sent, the container shows the missing fields */
|
|
6049
|
+
lockedClick = new EventEmitter();
|
|
6050
|
+
/** a click on the hint of a button locked for a missing sign-in */
|
|
6051
|
+
signIn = new EventEmitter();
|
|
5902
6052
|
kind = 'text';
|
|
5903
6053
|
property;
|
|
5904
6054
|
/** the property's object ({ fromDate: {...}, toDate: {...} }), for amounts with a currency field */
|
|
@@ -5908,11 +6058,19 @@ class ControlComponent {
|
|
|
5908
6058
|
textboxInfo = { propertySchema: {} };
|
|
5909
6059
|
vlAction = testAction;
|
|
5910
6060
|
vlWrites = testWrites;
|
|
6061
|
+
/** the field with the rules of its data object - what the building blocks get */
|
|
6062
|
+
ruleField;
|
|
5911
6063
|
/** the property's name in a record ("fromDate") */
|
|
5912
6064
|
name = '';
|
|
5913
6065
|
ngOnChanges() {
|
|
5914
6066
|
this.name = splitReference(this.field?.scope?.reference).name;
|
|
5915
6067
|
this.property = controlProperty(this.field, this.propertySchema);
|
|
6068
|
+
// the field as its building blocks see it: with the data object's rules (required, lengths)
|
|
6069
|
+
// the rules are the layout's alone (a data object holds names and types); the message names the field
|
|
6070
|
+
// even when the layout's caption is empty: the data object's caption
|
|
6071
|
+
this.ruleField = this.field && !this.field.label?.value && !this.field.label?.caption && this.name
|
|
6072
|
+
? { ...this.field, propertyCaption: this.name }
|
|
6073
|
+
: this.field;
|
|
5916
6074
|
this.row = this.propertySchema?.[splitReference(this.field?.scope?.reference).scope];
|
|
5917
6075
|
this.kind = controlKind(this.field, this.property);
|
|
5918
6076
|
// in a list, older layouts mark a date or time text by its own pattern (option.dateFormat / timeFormat)
|
|
@@ -5983,9 +6141,22 @@ class ControlComponent {
|
|
|
5983
6141
|
}
|
|
5984
6142
|
/** label.value, the layout's label.caption, then the data object's caption - translated */
|
|
5985
6143
|
get label() {
|
|
5986
|
-
const caption = this.field?.label?.value || this.field?.label?.caption ||
|
|
6144
|
+
const caption = this.field?.label?.value || this.field?.label?.caption || '';
|
|
5987
6145
|
return this.translations?.[caption] || caption;
|
|
5988
6146
|
}
|
|
6147
|
+
/** a required field (option.required true) shows a red * after its label */
|
|
6148
|
+
get required() {
|
|
6149
|
+
return this.field?.option?.required === true && !this.display;
|
|
6150
|
+
}
|
|
6151
|
+
/** a button click: a locked one sends nothing (no submit either) and asks the container to show what is missing */
|
|
6152
|
+
onButton(event) {
|
|
6153
|
+
if (this.locked) {
|
|
6154
|
+
event.preventDefault();
|
|
6155
|
+
this.lockedClick.emit();
|
|
6156
|
+
return;
|
|
6157
|
+
}
|
|
6158
|
+
this.buttonClick.emit(this.field?.option);
|
|
6159
|
+
}
|
|
5989
6160
|
/** a check box carries its own caption; every other control gets the label above or beside it */
|
|
5990
6161
|
get showLabel() {
|
|
5991
6162
|
// in a list the check box shows only the tick, so its label stands above it like any other
|
|
@@ -6014,7 +6185,7 @@ class ControlComponent {
|
|
|
6014
6185
|
return styleParts(this.field?.style);
|
|
6015
6186
|
}
|
|
6016
6187
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: ControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6017
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: ControlComponent, isStandalone: true, selector: "vl-control", inputs: { field: "field", propertySchema: "propertySchema", selectedLanguageInfo: "selectedLanguageInfo", errorMessages: "errorMessages", saveTried: "saveTried", container: "container", buttonType: "buttonType", mode: "mode", record: "record", hideLabel: "hideLabel", styleValue: "styleValue", compact: "compact", list: "list", listLoading: "listLoading", creditCardError: "creditCardError" }, outputs: { picked: "picked", changed: "changed", opened: "opened", toggled: "toggled", linkClicked: "linkClicked", mediaClicked: "mediaClicked", buttonClick: "buttonClick" }, usesOnChanges: true, ngImport: i0, template: "<!-- Shuaib 2026-10-20\r\n - new: one field of a layout with the library's building blocks, as the Designer's canvas shows it;\r\n every control gets the project's translated messages (messages) (#166)\r\n - the button carries only the layout's classes and style - no Bootstrap classes, the app does not\r\n load Bootstrap -->\r\n@if (kind === 'button') {\r\n<button [attr.type]=\"buttonType\"\r\n [attr.data-vl-action]=\"vlAction(field?.option)\" [attr.data-vl-writes]=\"vlWrites(field?.option)\"\r\n [class]=\"buttonStyle().classes\"\r\n [ngStyle]=\"buttonStyle().style\"\r\n (click)=\"buttonClick.emit(field?.option)\">\r\n {{ label }}\r\n</button>\r\n} @else if (kind === 'creditCard') {\r\n<div id=\"card-element\">\r\n <!-- a Stripe element will be inserted here -->\r\n</div>\r\n<div id=\"card-errors\" [class]=\"creditCardError?.textContent ? 'text-red-400 m-0' : ''\"></div>\r\n} @else if (display) {\r\n<!-- a list (card, grid): the record's value, read only; scope.style styles the value -->\r\n@if (showLabel) {\r\n<span [class]=\"labelStyle().classes\" [ngStyle]=\"labelStyle().style\">{{ label }}</span>\r\n}\r\n@if (kind === 'media') {\r\n<vl-media [field]=\"field\" [compact]=\"true\" [property]=\"property\" [value]=\"value\"\r\n [mediaClass]=\"valueStyle().classes\" [mediaStyle]=\"valueStyle().style\"\r\n (clicked)=\"mediaClicked.emit(field?.option)\"></vl-media>\r\n} @else {\r\n<div [class]=\"'vl-control__value ' + valueStyle().classes\"\r\n [class.vl-control__value--number]=\"kind === 'number'\"\r\n [class.vl-control__value--link]=\"isLink\"\r\n [ngStyle]=\"valueStyle().style\" (click)=\"openLink()\">\r\n @switch (kind) {\r\n @case ('number') {\r\n <vl-number style=\"display:inline-block\" [field]=\"field\" [readonly]=\"true\" [value]=\"value\"\r\n [property]=\"property\" [row]=\"numberRow\" [translations]=\"translations\"></vl-number>\r\n }\r\n @case ('password') { <vl-password [field]=\"field\" [readonly]=\"true\" [value]=\"value\"></vl-password> }\r\n @case ('textarea') { <vl-textarea [field]=\"field\" [readonly]=\"true\" [compact]=\"compact\" [value]=\"value\"></vl-textarea> }\r\n @case ('radio') {\r\n <vl-radio [field]=\"field\" [readonly]=\"true\" [value]=\"value\"\r\n [type]=\"toggleType === 'boolean' ? 'boolean' : 'string'\" [translations]=\"translations\"></vl-radio>\r\n }\r\n @case ('dropdown') {\r\n <vl-dropdown [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [items]=\"property?.data\"\r\n [translations]=\"translations\"></vl-dropdown>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [type]=\"toggleType\"\r\n [translations]=\"translations\"></vl-switch>\r\n }\r\n @case ('checkbox') {\r\n <vl-checkbox [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [type]=\"toggleType\"></vl-checkbox>\r\n }\r\n @case ('autocomplete') {\r\n <vl-autocomplete [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [list]=\"selectionList\"\r\n [translations]=\"translations\"></vl-autocomplete>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [list]=\"selectionList\" [combobox]=\"true\"\r\n [translations]=\"translations\"></vl-autocomplete>\r\n }\r\n @case ('date') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('time') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('datetime') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('daterange') {\r\n <vl-daterange [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [translations]=\"translations\"></vl-daterange>\r\n }\r\n @default { {{ text }} }\r\n }\r\n</div>\r\n}\r\n} @else {\r\n<div [ngStyle]=\"innerStyle()\">\r\n @if (showLabel) {\r\n <label [class]=\"labelStyle().classes\" [ngStyle]=\"labelStyle().style\">{{ label }}</label>\r\n }\r\n @switch (kind) {\r\n @case ('media') {\r\n <vl-media [field]=\"field\" [property]=\"property\" [value]=\"property?.value\"></vl-media>\r\n }\r\n @case ('password') {\r\n <vl-password [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-password>\r\n }\r\n @case ('textarea') {\r\n <vl-textarea [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-textarea>\r\n }\r\n @case ('autocomplete') {\r\n <vl-autocomplete [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [list]=\"selectionList\" [loading]=\"selectionLoading\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (picked)=\"picked.emit($event)\"></vl-autocomplete>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [list]=\"selectionList\" [loading]=\"selectionLoading\" [combobox]=\"true\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (picked)=\"picked.emit($event)\"></vl-autocomplete>\r\n }\r\n @case ('dropdown') {\r\n <vl-dropdown [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [items]=\"property?.data\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-dropdown>\r\n }\r\n @case ('radio') {\r\n <vl-radio [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType === 'boolean' ? 'boolean' : 'string'\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n (chosen)=\"toggled.emit($event)\"></vl-radio>\r\n }\r\n @case ('checkbox') {\r\n <vl-checkbox [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType\" [caption]=\"label\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\"\r\n (toggled)=\"toggled.emit($event)\"></vl-checkbox>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType\" [translations]=\"translations\"\r\n (switched)=\"toggled.emit($event)\"></vl-switch>\r\n }\r\n @case ('number') {\r\n <vl-number [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"property?.type || 'number'\" [property]=\"property\" [row]=\"row\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-number>\r\n }\r\n @case ('date') {\r\n <vl-datetime kind=\"date\" [field]=\"field\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-datetime>\r\n }\r\n @case ('time') {\r\n <vl-datetime kind=\"time\" [field]=\"field\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\" (opened)=\"opened.emit()\"></vl-datetime>\r\n }\r\n @case ('datetime') {\r\n <vl-datetime kind=\"datetime\" [field]=\"field\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-datetime>\r\n }\r\n @case ('daterange') {\r\n <vl-daterange [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-daterange>\r\n }\r\n @default {\r\n <!-- textInput, email and every other text control -->\r\n <vl-textbox [formField]=\"field\" [modalItemInfo]=\"textboxInfo\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\"></vl-textbox>\r\n }\r\n }\r\n</div>\r\n}\r\n", styles: [":host{display:block;min-width:0}.vl-control__value{margin:0;min-width:0;overflow-wrap:anywhere}.vl-control__value--number{font-size:1.17em;font-weight:700}.vl-control__value--link{cursor:pointer;text-decoration:underline}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: Autocomplete, selector: "vl-autocomplete", inputs: ["field", "target", "value", "readonly", "list", "loading", "combobox", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["picked"] }, { kind: "component", type: CheckboxControl, selector: "vl-checkbox", inputs: ["field", "target", "key", "value", "readonly", "type", "caption", "saveTried", "errorMessages", "translations", "inputStyle"], outputs: ["toggled"] }, { kind: "component", type: DateRangeControl, selector: "vl-daterange", inputs: ["field", "target", "value", "readonly", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["changed"] }, { kind: "component", type: DateTimeControl, selector: "vl-datetime", inputs: ["field", "target", "property", "kind", "value", "readonly", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["changed", "opened"] }, { kind: "component", type: DropdownControl, selector: "vl-dropdown", inputs: ["field", "target", "value", "readonly", "items", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["chosen"] }, { kind: "component", type: MediaControl, selector: "vl-media", inputs: ["field", "value", "property", "compact", "mediaStyle", "mediaClass"], outputs: ["clicked"] }, { kind: "component", type: NumberControl, selector: "vl-number", inputs: ["field", "target", "value", "readonly", "type", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass", "property", "row"], outputs: ["changed"] }, { kind: "component", type: PasswordControl, selector: "vl-password", inputs: ["field", "target", "value", "readonly", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"] }, { kind: "component", type: RadioControl, selector: "vl-radio", inputs: ["field", "target", "value", "readonly", "type", "saveTried", "errorMessages", "translations"], outputs: ["chosen"] }, { kind: "component", type: SwitchControl, selector: "vl-switch", inputs: ["field", "target", "value", "readonly", "type", "translations"], outputs: ["switched"] }, { kind: "component", type: TextareaControl, selector: "vl-textarea", inputs: ["field", "target", "value", "readonly", "compact", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"] }, { kind: "component", type: Textbox, selector: "vl-textbox", inputs: ["formField", "modalItemInfo", "saveTried", "errorMessages", "readonly", "value"], outputs: ["linkClicked"] }, { kind: "pipe", type: DatePipe, name: "date" }] });
|
|
6188
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: ControlComponent, isStandalone: true, selector: "vl-control", inputs: { field: "field", propertySchema: "propertySchema", selectedLanguageInfo: "selectedLanguageInfo", errorMessages: "errorMessages", saveTried: "saveTried", container: "container", buttonType: "buttonType", locked: "locked", lockHints: "lockHints", mode: "mode", record: "record", hideLabel: "hideLabel", styleValue: "styleValue", compact: "compact", list: "list", listLoading: "listLoading", creditCardError: "creditCardError" }, outputs: { picked: "picked", changed: "changed", opened: "opened", toggled: "toggled", linkClicked: "linkClicked", mediaClicked: "mediaClicked", buttonClick: "buttonClick", lockedClick: "lockedClick", signIn: "signIn" }, usesOnChanges: true, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - change: no list of the missing fields under the button (user 2026-10-24: too many red lines) - the fields show\r\n their own messages on a click\r\n - change: every reason under a locked button\r\n - new: a locked button stays clickable (onButton: lockedClick instead of buttonClick); its hint stands under it,\r\n a link to the sign-in when the sign-in is missing\r\n - new: a red * after the label of a required field\r\n - change: a locked button is grey (vl-control__button--locked), not the layout's colour half transparent -\r\n the blue looked clickable\r\n - new: a locked button is disabled, half transparent and takes no click (needsLogin / needsValid) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - fix: the text field gets ruleField like every other building block - the data object's rules\r\n (required ...) did not count for a text field -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22\r\n - fix: the building blocks get ruleField - the field with its data object's rules -->\r\n<!-- Shuaib 2026-10-20\r\n - new: one field of a layout with the library's building blocks, as the Designer's canvas shows it;\r\n every control gets the project's translated messages (messages) (#166)\r\n - the button carries only the layout's classes and style - no Bootstrap classes, the app does not\r\n load Bootstrap -->\r\n@if (kind === 'button') {\r\n<button [attr.type]=\"buttonType\"\r\n [attr.data-vl-action]=\"vlAction(field?.option)\" [attr.data-vl-writes]=\"vlWrites(field?.option)\"\r\n [class]=\"buttonStyle().classes\"\r\n [ngStyle]=\"buttonStyle().style\"\r\n [attr.aria-disabled]=\"locked || null\" [class.vl-control__button--locked]=\"locked\"\r\n (click)=\"onButton($event)\">\r\n {{ label }}\r\n</button>\r\n@if (locked) {\r\n@for (hint of lockHints; track hint.reason) {\r\n@if (hint.reason === 'login' && hint.text) {\r\n<p class=\"vl-control__lock-hint vl-control__lock-hint--link\" role=\"link\" tabindex=\"0\"\r\n (click)=\"signIn.emit()\" (keydown.enter)=\"signIn.emit()\">{{ hint.text }}</p>\r\n} @else if (hint.text) {\r\n<p class=\"vl-control__lock-hint\" role=\"status\">{{ hint.text }}</p>\r\n}\r\n}\r\n}\r\n} @else if (kind === 'creditCard') {\r\n<div id=\"card-element\">\r\n <!-- a Stripe element will be inserted here -->\r\n</div>\r\n<div id=\"card-errors\" [class]=\"creditCardError?.textContent ? 'text-red-400 m-0' : ''\"></div>\r\n} @else if (display) {\r\n<!-- a list (card, grid): the record's value, read only; scope.style styles the value -->\r\n@if (showLabel) {\r\n<span [class]=\"labelStyle().classes\" [ngStyle]=\"labelStyle().style\">{{ label }}</span>\r\n}\r\n@if (kind === 'media') {\r\n<vl-media [field]=\"ruleField\" [compact]=\"true\" [property]=\"property\" [value]=\"value\"\r\n [mediaClass]=\"valueStyle().classes\" [mediaStyle]=\"valueStyle().style\"\r\n (clicked)=\"mediaClicked.emit(field?.option)\"></vl-media>\r\n} @else {\r\n<div [class]=\"'vl-control__value ' + valueStyle().classes\"\r\n [class.vl-control__value--number]=\"kind === 'number'\"\r\n [class.vl-control__value--link]=\"isLink\"\r\n [ngStyle]=\"valueStyle().style\" (click)=\"openLink()\">\r\n @switch (kind) {\r\n @case ('number') {\r\n <vl-number style=\"display:inline-block\" [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\"\r\n [property]=\"property\" [row]=\"numberRow\" [translations]=\"translations\"></vl-number>\r\n }\r\n @case ('password') { <vl-password [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\"></vl-password> }\r\n @case ('textarea') { <vl-textarea [field]=\"ruleField\" [readonly]=\"true\" [compact]=\"compact\" [value]=\"value\"></vl-textarea> }\r\n @case ('radio') {\r\n <vl-radio [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\"\r\n [type]=\"toggleType === 'boolean' ? 'boolean' : 'string'\" [translations]=\"translations\"></vl-radio>\r\n }\r\n @case ('dropdown') {\r\n <vl-dropdown [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [items]=\"property?.data\"\r\n [translations]=\"translations\"></vl-dropdown>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [type]=\"toggleType\"\r\n [translations]=\"translations\"></vl-switch>\r\n }\r\n @case ('checkbox') {\r\n <vl-checkbox [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [type]=\"toggleType\"></vl-checkbox>\r\n }\r\n @case ('autocomplete') {\r\n <vl-autocomplete [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [list]=\"selectionList\"\r\n [translations]=\"translations\"></vl-autocomplete>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [list]=\"selectionList\" [combobox]=\"true\"\r\n [translations]=\"translations\"></vl-autocomplete>\r\n }\r\n @case ('date') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('time') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('datetime') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('daterange') {\r\n <vl-daterange [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [translations]=\"translations\"></vl-daterange>\r\n }\r\n @default { {{ text }} }\r\n }\r\n</div>\r\n}\r\n} @else {\r\n<div class=\"vl-control__inner\" [ngStyle]=\"innerStyle()\">\r\n @if (showLabel) {\r\n <label [class]=\"labelStyle().classes\" [ngStyle]=\"labelStyle().style\">{{ label }}@if (required) {<span class=\"vl-control__required\" aria-hidden=\"true\">*</span>}</label>\r\n }\r\n @switch (kind) {\r\n @case ('media') {\r\n <vl-media [field]=\"ruleField\" [property]=\"property\" [value]=\"property?.value\"></vl-media>\r\n }\r\n @case ('password') {\r\n <vl-password [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-password>\r\n }\r\n @case ('textarea') {\r\n <vl-textarea [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-textarea>\r\n }\r\n @case ('autocomplete') {\r\n <vl-autocomplete [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [list]=\"selectionList\" [loading]=\"selectionLoading\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (picked)=\"picked.emit($event)\"></vl-autocomplete>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [list]=\"selectionList\" [loading]=\"selectionLoading\" [combobox]=\"true\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (picked)=\"picked.emit($event)\"></vl-autocomplete>\r\n }\r\n @case ('dropdown') {\r\n <vl-dropdown [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [items]=\"property?.data\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-dropdown>\r\n }\r\n @case ('radio') {\r\n <vl-radio [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType === 'boolean' ? 'boolean' : 'string'\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n (chosen)=\"toggled.emit($event)\"></vl-radio>\r\n }\r\n @case ('checkbox') {\r\n <vl-checkbox [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType\" [caption]=\"label\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\"\r\n (toggled)=\"toggled.emit($event)\"></vl-checkbox>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType\" [translations]=\"translations\"\r\n (switched)=\"toggled.emit($event)\"></vl-switch>\r\n }\r\n @case ('number') {\r\n <vl-number [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"property?.type || 'number'\" [property]=\"property\" [row]=\"row\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-number>\r\n }\r\n @case ('date') {\r\n <vl-datetime kind=\"date\" [field]=\"ruleField\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-datetime>\r\n }\r\n @case ('time') {\r\n <vl-datetime kind=\"time\" [field]=\"ruleField\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\" (opened)=\"opened.emit()\"></vl-datetime>\r\n }\r\n @case ('datetime') {\r\n <vl-datetime kind=\"datetime\" [field]=\"ruleField\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-datetime>\r\n }\r\n @case ('daterange') {\r\n <vl-daterange [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-daterange>\r\n }\r\n @default {\r\n <!-- textInput, email and every other text control -->\r\n <vl-textbox [formField]=\"ruleField\" [modalItemInfo]=\"textboxInfo\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\"></vl-textbox>\r\n }\r\n }\r\n</div>\r\n}\r\n", styles: [":host{display:block;min-width:0}.vl-control__value{margin:0;min-width:0;overflow-wrap:anywhere}.vl-control__value--number{font-size:1.17em;font-weight:700}.vl-control__value--link{cursor:pointer;text-decoration:underline}.vl-control__required{color:#dc2626;margin-left:2px}.vl-control__lock-hint{margin:6px 0 0;font-size:.85em;color:#b91c1c;text-align:center}.vl-control__lock-hint--link{cursor:pointer;text-decoration:underline}.vl-control__button--locked{background:#e5e7eb!important;border-color:#d1d5db!important;color:#6b7280!important;box-shadow:none!important;cursor:not-allowed!important;filter:none!important}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: Autocomplete, selector: "vl-autocomplete", inputs: ["field", "target", "value", "readonly", "list", "loading", "combobox", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["picked"] }, { kind: "component", type: CheckboxControl, selector: "vl-checkbox", inputs: ["field", "target", "key", "value", "readonly", "type", "caption", "saveTried", "errorMessages", "translations", "inputStyle"], outputs: ["toggled"] }, { kind: "component", type: DateRangeControl, selector: "vl-daterange", inputs: ["field", "target", "value", "readonly", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["changed"] }, { kind: "component", type: DateTimeControl, selector: "vl-datetime", inputs: ["field", "target", "property", "kind", "value", "readonly", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["changed", "opened"] }, { kind: "component", type: DropdownControl, selector: "vl-dropdown", inputs: ["field", "target", "value", "readonly", "items", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["chosen"] }, { kind: "component", type: MediaControl, selector: "vl-media", inputs: ["field", "value", "property", "compact", "mediaStyle", "mediaClass"], outputs: ["clicked"] }, { kind: "component", type: NumberControl, selector: "vl-number", inputs: ["field", "target", "value", "readonly", "type", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass", "property", "row"], outputs: ["changed"] }, { kind: "component", type: PasswordControl, selector: "vl-password", inputs: ["field", "target", "value", "readonly", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"] }, { kind: "component", type: RadioControl, selector: "vl-radio", inputs: ["field", "target", "value", "readonly", "type", "saveTried", "errorMessages", "translations"], outputs: ["chosen"] }, { kind: "component", type: SwitchControl, selector: "vl-switch", inputs: ["field", "target", "value", "readonly", "type", "translations"], outputs: ["switched"] }, { kind: "component", type: TextareaControl, selector: "vl-textarea", inputs: ["field", "target", "value", "readonly", "compact", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"] }, { kind: "component", type: Textbox, selector: "vl-textbox", inputs: ["formField", "modalItemInfo", "saveTried", "errorMessages", "readonly", "value"], outputs: ["linkClicked"] }, { kind: "pipe", type: DatePipe, name: "date" }] });
|
|
6018
6189
|
}
|
|
6019
6190
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: ControlComponent, decorators: [{
|
|
6020
6191
|
type: Component,
|
|
@@ -6033,7 +6204,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
6033
6204
|
SwitchControl,
|
|
6034
6205
|
TextareaControl,
|
|
6035
6206
|
Textbox,
|
|
6036
|
-
], template: "<!-- Shuaib 2026-10-20\r\n - new: one field of a layout with the library's building blocks, as the Designer's canvas shows it;\r\n every control gets the project's translated messages (messages) (#166)\r\n - the button carries only the layout's classes and style - no Bootstrap classes, the app does not\r\n load Bootstrap -->\r\n@if (kind === 'button') {\r\n<button [attr.type]=\"buttonType\"\r\n [attr.data-vl-action]=\"vlAction(field?.option)\" [attr.data-vl-writes]=\"vlWrites(field?.option)\"\r\n [class]=\"buttonStyle().classes\"\r\n [ngStyle]=\"buttonStyle().style\"\r\n (click)=\"buttonClick.emit(field?.option)\">\r\n {{ label }}\r\n</button>\r\n} @else if (kind === 'creditCard') {\r\n<div id=\"card-element\">\r\n <!-- a Stripe element will be inserted here -->\r\n</div>\r\n<div id=\"card-errors\" [class]=\"creditCardError?.textContent ? 'text-red-400 m-0' : ''\"></div>\r\n} @else if (display) {\r\n<!-- a list (card, grid): the record's value, read only; scope.style styles the value -->\r\n@if (showLabel) {\r\n<span [class]=\"labelStyle().classes\" [ngStyle]=\"labelStyle().style\">{{ label }}</span>\r\n}\r\n@if (kind === 'media') {\r\n<vl-media [field]=\"field\" [compact]=\"true\" [property]=\"property\" [value]=\"value\"\r\n [mediaClass]=\"valueStyle().classes\" [mediaStyle]=\"valueStyle().style\"\r\n (clicked)=\"mediaClicked.emit(field?.option)\"></vl-media>\r\n} @else {\r\n<div [class]=\"'vl-control__value ' + valueStyle().classes\"\r\n [class.vl-control__value--number]=\"kind === 'number'\"\r\n [class.vl-control__value--link]=\"isLink\"\r\n [ngStyle]=\"valueStyle().style\" (click)=\"openLink()\">\r\n @switch (kind) {\r\n @case ('number') {\r\n <vl-number style=\"display:inline-block\" [field]=\"field\" [readonly]=\"true\" [value]=\"value\"\r\n [property]=\"property\" [row]=\"numberRow\" [translations]=\"translations\"></vl-number>\r\n }\r\n @case ('password') { <vl-password [field]=\"field\" [readonly]=\"true\" [value]=\"value\"></vl-password> }\r\n @case ('textarea') { <vl-textarea [field]=\"field\" [readonly]=\"true\" [compact]=\"compact\" [value]=\"value\"></vl-textarea> }\r\n @case ('radio') {\r\n <vl-radio [field]=\"field\" [readonly]=\"true\" [value]=\"value\"\r\n [type]=\"toggleType === 'boolean' ? 'boolean' : 'string'\" [translations]=\"translations\"></vl-radio>\r\n }\r\n @case ('dropdown') {\r\n <vl-dropdown [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [items]=\"property?.data\"\r\n [translations]=\"translations\"></vl-dropdown>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [type]=\"toggleType\"\r\n [translations]=\"translations\"></vl-switch>\r\n }\r\n @case ('checkbox') {\r\n <vl-checkbox [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [type]=\"toggleType\"></vl-checkbox>\r\n }\r\n @case ('autocomplete') {\r\n <vl-autocomplete [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [list]=\"selectionList\"\r\n [translations]=\"translations\"></vl-autocomplete>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [list]=\"selectionList\" [combobox]=\"true\"\r\n [translations]=\"translations\"></vl-autocomplete>\r\n }\r\n @case ('date') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('time') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('datetime') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('daterange') {\r\n <vl-daterange [field]=\"field\" [readonly]=\"true\" [value]=\"value\" [translations]=\"translations\"></vl-daterange>\r\n }\r\n @default { {{ text }} }\r\n }\r\n</div>\r\n}\r\n} @else {\r\n<div [ngStyle]=\"innerStyle()\">\r\n @if (showLabel) {\r\n <label [class]=\"labelStyle().classes\" [ngStyle]=\"labelStyle().style\">{{ label }}</label>\r\n }\r\n @switch (kind) {\r\n @case ('media') {\r\n <vl-media [field]=\"field\" [property]=\"property\" [value]=\"property?.value\"></vl-media>\r\n }\r\n @case ('password') {\r\n <vl-password [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-password>\r\n }\r\n @case ('textarea') {\r\n <vl-textarea [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-textarea>\r\n }\r\n @case ('autocomplete') {\r\n <vl-autocomplete [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [list]=\"selectionList\" [loading]=\"selectionLoading\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (picked)=\"picked.emit($event)\"></vl-autocomplete>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [list]=\"selectionList\" [loading]=\"selectionLoading\" [combobox]=\"true\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (picked)=\"picked.emit($event)\"></vl-autocomplete>\r\n }\r\n @case ('dropdown') {\r\n <vl-dropdown [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [items]=\"property?.data\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-dropdown>\r\n }\r\n @case ('radio') {\r\n <vl-radio [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType === 'boolean' ? 'boolean' : 'string'\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n (chosen)=\"toggled.emit($event)\"></vl-radio>\r\n }\r\n @case ('checkbox') {\r\n <vl-checkbox [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType\" [caption]=\"label\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\"\r\n (toggled)=\"toggled.emit($event)\"></vl-checkbox>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType\" [translations]=\"translations\"\r\n (switched)=\"toggled.emit($event)\"></vl-switch>\r\n }\r\n @case ('number') {\r\n <vl-number [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"property?.type || 'number'\" [property]=\"property\" [row]=\"row\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-number>\r\n }\r\n @case ('date') {\r\n <vl-datetime kind=\"date\" [field]=\"field\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-datetime>\r\n }\r\n @case ('time') {\r\n <vl-datetime kind=\"time\" [field]=\"field\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\" (opened)=\"opened.emit()\"></vl-datetime>\r\n }\r\n @case ('datetime') {\r\n <vl-datetime kind=\"datetime\" [field]=\"field\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-datetime>\r\n }\r\n @case ('daterange') {\r\n <vl-daterange [field]=\"field\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-daterange>\r\n }\r\n @default {\r\n <!-- textInput, email and every other text control -->\r\n <vl-textbox [formField]=\"field\" [modalItemInfo]=\"textboxInfo\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\"></vl-textbox>\r\n }\r\n }\r\n</div>\r\n}\r\n", styles: [":host{display:block;min-width:0}.vl-control__value{margin:0;min-width:0;overflow-wrap:anywhere}.vl-control__value--number{font-size:1.17em;font-weight:700}.vl-control__value--link{cursor:pointer;text-decoration:underline}\n"] }]
|
|
6207
|
+
], template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - change: no list of the missing fields under the button (user 2026-10-24: too many red lines) - the fields show\r\n their own messages on a click\r\n - change: every reason under a locked button\r\n - new: a locked button stays clickable (onButton: lockedClick instead of buttonClick); its hint stands under it,\r\n a link to the sign-in when the sign-in is missing\r\n - new: a red * after the label of a required field\r\n - change: a locked button is grey (vl-control__button--locked), not the layout's colour half transparent -\r\n the blue looked clickable\r\n - new: a locked button is disabled, half transparent and takes no click (needsLogin / needsValid) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - fix: the text field gets ruleField like every other building block - the data object's rules\r\n (required ...) did not count for a text field -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22\r\n - fix: the building blocks get ruleField - the field with its data object's rules -->\r\n<!-- Shuaib 2026-10-20\r\n - new: one field of a layout with the library's building blocks, as the Designer's canvas shows it;\r\n every control gets the project's translated messages (messages) (#166)\r\n - the button carries only the layout's classes and style - no Bootstrap classes, the app does not\r\n load Bootstrap -->\r\n@if (kind === 'button') {\r\n<button [attr.type]=\"buttonType\"\r\n [attr.data-vl-action]=\"vlAction(field?.option)\" [attr.data-vl-writes]=\"vlWrites(field?.option)\"\r\n [class]=\"buttonStyle().classes\"\r\n [ngStyle]=\"buttonStyle().style\"\r\n [attr.aria-disabled]=\"locked || null\" [class.vl-control__button--locked]=\"locked\"\r\n (click)=\"onButton($event)\">\r\n {{ label }}\r\n</button>\r\n@if (locked) {\r\n@for (hint of lockHints; track hint.reason) {\r\n@if (hint.reason === 'login' && hint.text) {\r\n<p class=\"vl-control__lock-hint vl-control__lock-hint--link\" role=\"link\" tabindex=\"0\"\r\n (click)=\"signIn.emit()\" (keydown.enter)=\"signIn.emit()\">{{ hint.text }}</p>\r\n} @else if (hint.text) {\r\n<p class=\"vl-control__lock-hint\" role=\"status\">{{ hint.text }}</p>\r\n}\r\n}\r\n}\r\n} @else if (kind === 'creditCard') {\r\n<div id=\"card-element\">\r\n <!-- a Stripe element will be inserted here -->\r\n</div>\r\n<div id=\"card-errors\" [class]=\"creditCardError?.textContent ? 'text-red-400 m-0' : ''\"></div>\r\n} @else if (display) {\r\n<!-- a list (card, grid): the record's value, read only; scope.style styles the value -->\r\n@if (showLabel) {\r\n<span [class]=\"labelStyle().classes\" [ngStyle]=\"labelStyle().style\">{{ label }}</span>\r\n}\r\n@if (kind === 'media') {\r\n<vl-media [field]=\"ruleField\" [compact]=\"true\" [property]=\"property\" [value]=\"value\"\r\n [mediaClass]=\"valueStyle().classes\" [mediaStyle]=\"valueStyle().style\"\r\n (clicked)=\"mediaClicked.emit(field?.option)\"></vl-media>\r\n} @else {\r\n<div [class]=\"'vl-control__value ' + valueStyle().classes\"\r\n [class.vl-control__value--number]=\"kind === 'number'\"\r\n [class.vl-control__value--link]=\"isLink\"\r\n [ngStyle]=\"valueStyle().style\" (click)=\"openLink()\">\r\n @switch (kind) {\r\n @case ('number') {\r\n <vl-number style=\"display:inline-block\" [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\"\r\n [property]=\"property\" [row]=\"numberRow\" [translations]=\"translations\"></vl-number>\r\n }\r\n @case ('password') { <vl-password [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\"></vl-password> }\r\n @case ('textarea') { <vl-textarea [field]=\"ruleField\" [readonly]=\"true\" [compact]=\"compact\" [value]=\"value\"></vl-textarea> }\r\n @case ('radio') {\r\n <vl-radio [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\"\r\n [type]=\"toggleType === 'boolean' ? 'boolean' : 'string'\" [translations]=\"translations\"></vl-radio>\r\n }\r\n @case ('dropdown') {\r\n <vl-dropdown [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [items]=\"property?.data\"\r\n [translations]=\"translations\"></vl-dropdown>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [type]=\"toggleType\"\r\n [translations]=\"translations\"></vl-switch>\r\n }\r\n @case ('checkbox') {\r\n <vl-checkbox [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [type]=\"toggleType\"></vl-checkbox>\r\n }\r\n @case ('autocomplete') {\r\n <vl-autocomplete [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [list]=\"selectionList\"\r\n [translations]=\"translations\"></vl-autocomplete>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [list]=\"selectionList\" [combobox]=\"true\"\r\n [translations]=\"translations\"></vl-autocomplete>\r\n }\r\n @case ('date') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('time') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('datetime') { {{ legacyDateFormat && value ? (value | date: legacyDateFormat) : dateText }} }\r\n @case ('daterange') {\r\n <vl-daterange [field]=\"ruleField\" [readonly]=\"true\" [value]=\"value\" [translations]=\"translations\"></vl-daterange>\r\n }\r\n @default { {{ text }} }\r\n }\r\n</div>\r\n}\r\n} @else {\r\n<div class=\"vl-control__inner\" [ngStyle]=\"innerStyle()\">\r\n @if (showLabel) {\r\n <label [class]=\"labelStyle().classes\" [ngStyle]=\"labelStyle().style\">{{ label }}@if (required) {<span class=\"vl-control__required\" aria-hidden=\"true\">*</span>}</label>\r\n }\r\n @switch (kind) {\r\n @case ('media') {\r\n <vl-media [field]=\"ruleField\" [property]=\"property\" [value]=\"property?.value\"></vl-media>\r\n }\r\n @case ('password') {\r\n <vl-password [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-password>\r\n }\r\n @case ('textarea') {\r\n <vl-textarea [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-textarea>\r\n }\r\n @case ('autocomplete') {\r\n <vl-autocomplete [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [list]=\"selectionList\" [loading]=\"selectionLoading\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (picked)=\"picked.emit($event)\"></vl-autocomplete>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [list]=\"selectionList\" [loading]=\"selectionLoading\" [combobox]=\"true\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (picked)=\"picked.emit($event)\"></vl-autocomplete>\r\n }\r\n @case ('dropdown') {\r\n <vl-dropdown [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [items]=\"property?.data\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-dropdown>\r\n }\r\n @case ('radio') {\r\n <vl-radio [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType === 'boolean' ? 'boolean' : 'string'\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n (chosen)=\"toggled.emit($event)\"></vl-radio>\r\n }\r\n @case ('checkbox') {\r\n <vl-checkbox [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType\" [caption]=\"label\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\"\r\n (toggled)=\"toggled.emit($event)\"></vl-checkbox>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"toggleType\" [translations]=\"translations\"\r\n (switched)=\"toggled.emit($event)\"></vl-switch>\r\n }\r\n @case ('number') {\r\n <vl-number [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [type]=\"property?.type || 'number'\" [property]=\"property\" [row]=\"row\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"></vl-number>\r\n }\r\n @case ('date') {\r\n <vl-datetime kind=\"date\" [field]=\"ruleField\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-datetime>\r\n }\r\n @case ('time') {\r\n <vl-datetime kind=\"time\" [field]=\"ruleField\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\" (opened)=\"opened.emit()\"></vl-datetime>\r\n }\r\n @case ('datetime') {\r\n <vl-datetime kind=\"datetime\" [field]=\"ruleField\" [target]=\"target\" [property]=\"property\" [readonly]=\"readonly\"\r\n [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-datetime>\r\n }\r\n @case ('daterange') {\r\n <vl-daterange [field]=\"ruleField\" [target]=\"target\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [keyboard]=\"keyboard\" [saveTried]=\"saveTried\" [errorMessages]=\"messages\" [translations]=\"translations\"\r\n [inputStyle]=\"inputStyle().style\" [inputClass]=\"inputStyle().classes\"\r\n (changed)=\"changed.emit($event)\"></vl-daterange>\r\n }\r\n @default {\r\n <!-- textInput, email and every other text control -->\r\n <vl-textbox [formField]=\"ruleField\" [modalItemInfo]=\"textboxInfo\" [readonly]=\"readonly\" [value]=\"property?.value\"\r\n [saveTried]=\"saveTried\" [errorMessages]=\"messages\"></vl-textbox>\r\n }\r\n }\r\n</div>\r\n}\r\n", styles: [":host{display:block;min-width:0}.vl-control__value{margin:0;min-width:0;overflow-wrap:anywhere}.vl-control__value--number{font-size:1.17em;font-weight:700}.vl-control__value--link{cursor:pointer;text-decoration:underline}.vl-control__required{color:#dc2626;margin-left:2px}.vl-control__lock-hint{margin:6px 0 0;font-size:.85em;color:#b91c1c;text-align:center}.vl-control__lock-hint--link{cursor:pointer;text-decoration:underline}.vl-control__button--locked{background:#e5e7eb!important;border-color:#d1d5db!important;color:#6b7280!important;box-shadow:none!important;cursor:not-allowed!important;filter:none!important}\n"] }]
|
|
6037
6208
|
}], propDecorators: { field: [{
|
|
6038
6209
|
type: Input
|
|
6039
6210
|
}], propertySchema: [{
|
|
@@ -6048,6 +6219,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
6048
6219
|
type: Input
|
|
6049
6220
|
}], buttonType: [{
|
|
6050
6221
|
type: Input
|
|
6222
|
+
}], locked: [{
|
|
6223
|
+
type: Input
|
|
6224
|
+
}], lockHints: [{
|
|
6225
|
+
type: Input
|
|
6051
6226
|
}], mode: [{
|
|
6052
6227
|
type: Input
|
|
6053
6228
|
}], record: [{
|
|
@@ -6078,8 +6253,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
6078
6253
|
type: Output
|
|
6079
6254
|
}], buttonClick: [{
|
|
6080
6255
|
type: Output
|
|
6256
|
+
}], lockedClick: [{
|
|
6257
|
+
type: Output
|
|
6258
|
+
}], signIn: [{
|
|
6259
|
+
type: Output
|
|
6081
6260
|
}] } });
|
|
6082
6261
|
|
|
6262
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22
|
|
6263
|
+
// - fix: on desktop the page buttons have a default (side by side, centred) under the page's own
|
|
6264
|
+
// listStyle; without one they stood one below the other
|
|
6083
6265
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-11
|
|
6084
6266
|
// - fix: "is this the app on iOS/Android" asks isNativeMobile() (native-platform.ts) instead of
|
|
6085
6267
|
// Angular CDK platform.IOS/ANDROID; an iPad reports itself as a Mac there, so it ran as the web
|
|
@@ -6150,7 +6332,18 @@ class PaginationComponent {
|
|
|
6150
6332
|
const baseStyle = this.getStyle(this.itemInfo?.layoutSchema
|
|
6151
6333
|
?.pagination?.listStyle);
|
|
6152
6334
|
if (!this.isMobile) {
|
|
6153
|
-
|
|
6335
|
+
// the buttons side by side unless the page styles the list itself - without a listStyle they
|
|
6336
|
+
// stood one below the other (tm-test Controls Grid)
|
|
6337
|
+
return {
|
|
6338
|
+
display: 'flex',
|
|
6339
|
+
'align-items': 'center',
|
|
6340
|
+
'justify-content': 'center',
|
|
6341
|
+
gap: '4px',
|
|
6342
|
+
'list-style': 'none',
|
|
6343
|
+
margin: '0',
|
|
6344
|
+
padding: '8px 0',
|
|
6345
|
+
...baseStyle,
|
|
6346
|
+
};
|
|
6154
6347
|
}
|
|
6155
6348
|
return {
|
|
6156
6349
|
...baseStyle,
|
|
@@ -6332,17 +6525,114 @@ let String$1 = class String {
|
|
|
6332
6525
|
return propertyScope;
|
|
6333
6526
|
}
|
|
6334
6527
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: String, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6335
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: String, isStandalone: true, selector: "vl-string", inputs: { formField: "formField", modalItemInfo: "modalItemInfo" }, ngImport: i0, template: "<h5>{{\r\n
|
|
6528
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: String, isStandalone: true, selector: "vl-string", inputs: { formField: "formField", modalItemInfo: "modalItemInfo" }, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - change: caption and date pattern from the layout - a data object holds names and types only -->\r\n<h5>{{\r\n (formField.label?.value || formField.label?.caption || '')\r\n }}\r\n</h5>", styles: [""] });
|
|
6336
6529
|
};
|
|
6337
6530
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: String$1, decorators: [{
|
|
6338
6531
|
type: Component,
|
|
6339
|
-
args: [{ selector: 'vl-string', standalone: true, template: "<h5>{{\r\n
|
|
6532
|
+
args: [{ selector: 'vl-string', standalone: true, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - change: caption and date pattern from the layout - a data object holds names and types only -->\r\n<h5>{{\r\n (formField.label?.value || formField.label?.caption || '')\r\n }}\r\n</h5>" }]
|
|
6340
6533
|
}], propDecorators: { formField: [{
|
|
6341
6534
|
type: Input
|
|
6342
6535
|
}], modalItemInfo: [{
|
|
6343
6536
|
type: Input
|
|
6344
6537
|
}] } });
|
|
6345
6538
|
|
|
6539
|
+
// Faramarz Yousefian and Agent Toni (Claude Sonnet 5.5) 2026-10-23
|
|
6540
|
+
// - new: a body template can make a list from a list: { "$each": "cart.items", "item": { "productId":
|
|
6541
|
+
// "{{item.id}}", ... } } - one filled-in "item" per element, so a page renames and picks the fields
|
|
6542
|
+
// a backend wants without the code knowing any names (purchase button, OFFENE-PUNKTE 98). The
|
|
6543
|
+
// context takes further keys (form, cart, response)
|
|
6544
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
6545
|
+
// - new: a backend call described by the page instead of written into the code (A2). Saving,
|
|
6546
|
+
// loading with a filter and selection lists read the same keys of an option:
|
|
6547
|
+
// data_url (or url) address, with {{placeholders}}
|
|
6548
|
+
// method GET, POST, PUT, DELETE (default POST)
|
|
6549
|
+
// params URL parameters, values with {{placeholders}}
|
|
6550
|
+
// body content, a template; "{{records}}" as a whole value puts in the list itself
|
|
6551
|
+
// transform a named conversion of the records before sending (dailyLogs, OFFENE-PUNKTE 91)
|
|
6552
|
+
// afterSuccess "removeLocal": take the sent records out of browser storage
|
|
6553
|
+
// dateFormat how dates in params and body are written (date-format.ts; default ISO 8601
|
|
6554
|
+
// with time zone, e.g. P5 "yyyy-MM-dd'T'HH:mm:ss:SSSSxxx")
|
|
6555
|
+
// Placeholders: {{userInfo.x}} (the signed-in user, e.g. p5_backend_url), {{record.x}},
|
|
6556
|
+
// {{filter.x}}, {{records}}, {{env.x}} (the environment); {{x|'text'}} puts in text when x is empty
|
|
6557
|
+
// (P5: an empty plant is sent as two spaces). Replaces the fixed P5 time-recording
|
|
6558
|
+
// addresses in card, request service and selection lists
|
|
6559
|
+
const WHOLE = /^\s*{{\s*([^}]+?)\s*}}\s*$/;
|
|
6560
|
+
const ANY = /{{\s*([^}]+?)\s*}}/g;
|
|
6561
|
+
/** A placeholder's value; "path|'text'" gives text when the value is missing or empty. */
|
|
6562
|
+
function lookup(placeholder, context) {
|
|
6563
|
+
const fallback = placeholder.match(/^(.*?)\|\s*(['"])(.*)\2\s*$/s);
|
|
6564
|
+
const path = (fallback ? fallback[1] : placeholder).trim();
|
|
6565
|
+
const scope = { ...(context.userInfo || {}), ...context };
|
|
6566
|
+
const value = path.split('.').reduce((acc, key) => (acc == null ? undefined : acc[key]), scope);
|
|
6567
|
+
return fallback && (value == null || value === '') ? fallback[3] : value;
|
|
6568
|
+
}
|
|
6569
|
+
/**
|
|
6570
|
+
* A template with its placeholders filled in. A string that is only one placeholder gives the value
|
|
6571
|
+
* itself (a list stays a list); inside a longer text a missing value becomes empty. Objects and
|
|
6572
|
+
* lists are filled in deeply.
|
|
6573
|
+
*/
|
|
6574
|
+
function resolveTemplate(template, context) {
|
|
6575
|
+
if (typeof template === 'string') {
|
|
6576
|
+
const whole = template.match(WHOLE);
|
|
6577
|
+
if (whole) {
|
|
6578
|
+
const value = lookup(whole[1], context);
|
|
6579
|
+
return value === undefined ? '' : value;
|
|
6580
|
+
}
|
|
6581
|
+
return template.replace(ANY, (_, path) => {
|
|
6582
|
+
const value = lookup(path, context);
|
|
6583
|
+
return value == null ? '' : value instanceof Date ? formatDate(value) : String(value);
|
|
6584
|
+
});
|
|
6585
|
+
}
|
|
6586
|
+
if (Array.isArray(template)) {
|
|
6587
|
+
return template.map(item => resolveTemplate(item, context));
|
|
6588
|
+
}
|
|
6589
|
+
if (template && typeof template === 'object') {
|
|
6590
|
+
if (typeof template.$each === 'string') {
|
|
6591
|
+
// { "$each": "cart.items", "item": { ... } }: one filled-in copy of "item" per element of the list
|
|
6592
|
+
const list = lookup(template.$each, context);
|
|
6593
|
+
return Array.isArray(list) ? list.map(item => resolveTemplate(template.item, { ...context, item })) : [];
|
|
6594
|
+
}
|
|
6595
|
+
const out = {};
|
|
6596
|
+
for (const [key, value] of Object.entries(template))
|
|
6597
|
+
out[key] = resolveTemplate(value, context);
|
|
6598
|
+
return out;
|
|
6599
|
+
}
|
|
6600
|
+
return template;
|
|
6601
|
+
}
|
|
6602
|
+
/** True when the option describes a backend call (it has an address). */
|
|
6603
|
+
function hasBackendCall(option) {
|
|
6604
|
+
return !!String(option?.data_url ?? option?.url ?? '').trim();
|
|
6605
|
+
}
|
|
6606
|
+
/**
|
|
6607
|
+
* The call of an option: address, method, URL parameters and content with the placeholders filled in.
|
|
6608
|
+
* A relative address is put after env.apiUrl. Without an address there is no call (null).
|
|
6609
|
+
*/
|
|
6610
|
+
function buildBackendCall(option, context) {
|
|
6611
|
+
if (!hasBackendCall(option))
|
|
6612
|
+
return null;
|
|
6613
|
+
let url = String(resolveTemplate(String(option.data_url ?? option.url), context)).trim();
|
|
6614
|
+
const base = String(context.env?.apiUrl ?? '').replace(/\/+$/, '');
|
|
6615
|
+
if (!/^https?:\/\//i.test(url) && base) {
|
|
6616
|
+
url = `${base}/${url.replace(/^\/+/, '')}`;
|
|
6617
|
+
}
|
|
6618
|
+
const dateFormat = option.dateFormat;
|
|
6619
|
+
const params = {};
|
|
6620
|
+
for (const [key, value] of Object.entries(resolveTemplate(option.params || {}, context) || {})) {
|
|
6621
|
+
params[key] = value == null ? '' : value instanceof Date ? formatDate(value, dateFormat) : String(value);
|
|
6622
|
+
}
|
|
6623
|
+
const body = formatDates(option.body !== undefined
|
|
6624
|
+
? resolveTemplate(option.body, context)
|
|
6625
|
+
: context.records ?? context.record ?? {}, dateFormat);
|
|
6626
|
+
return { url, method: String(option.method || 'POST').toUpperCase(), params, body };
|
|
6627
|
+
}
|
|
6628
|
+
|
|
6629
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
6630
|
+
// - change: a list's request is built like every backend call of a page (backend-call.ts). The base
|
|
6631
|
+
// address was always the user's p5_backend_url and the parameter {"type": "company"} built the P5
|
|
6632
|
+
// company key in the code; both are written in the page now ("{{p5_backend_url}}/…",
|
|
6633
|
+
// "{{p5_group}}/{{p5_client}}/{{p5_plant}}") - no P5 name left here (A2). user() for BackendCallService
|
|
6634
|
+
// - fix: setEnvironment - a relative list address goes after the app's apiUrl like every other call;
|
|
6635
|
+
// it was sent as it was (2026-10-22)
|
|
6346
6636
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-15
|
|
6347
6637
|
// - change: the web autocomplete goes through backendUrl (/api/proxy/<host>/...) instead of the
|
|
6348
6638
|
// /p5ws path only ng serve forwarded
|
|
@@ -6357,6 +6647,15 @@ class RemoteListService {
|
|
|
6357
6647
|
setUser(userInfo) {
|
|
6358
6648
|
this.currentUser = userInfo ?? null;
|
|
6359
6649
|
}
|
|
6650
|
+
/** The app's environment (apiUrl): a relative list address goes after it, like every other call. */
|
|
6651
|
+
environment = null;
|
|
6652
|
+
setEnvironment(environment) {
|
|
6653
|
+
this.environment = environment ?? null;
|
|
6654
|
+
}
|
|
6655
|
+
/** The signed-in user the app handed over, or null. */
|
|
6656
|
+
user() {
|
|
6657
|
+
return this.currentUser;
|
|
6658
|
+
}
|
|
6360
6659
|
/** Lists already loaded, by request (url + params), so a page does not ask twice. */
|
|
6361
6660
|
cache = new Map();
|
|
6362
6661
|
/** Like load(), with the current user and one request per source while the app runs. */
|
|
@@ -6392,72 +6691,27 @@ class RemoteListService {
|
|
|
6392
6691
|
}
|
|
6393
6692
|
return Array.isArray(response.data) ? response.data : [];
|
|
6394
6693
|
}
|
|
6694
|
+
/**
|
|
6695
|
+
* The request of a field's list, described like every backend call of a page (backend-call.ts):
|
|
6696
|
+
* url with {{placeholders}} from the signed-in user, method, params, passToken.
|
|
6697
|
+
*/
|
|
6395
6698
|
resolveAutocompleteConfig(config, userInfo) {
|
|
6396
|
-
const
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
value.includes('{{')) {
|
|
6401
|
-
params[key] =
|
|
6402
|
-
this.resolveToken(value, userInfo);
|
|
6403
|
-
}
|
|
6404
|
-
// Computed parameter
|
|
6405
|
-
else if (value?.type === 'company') {
|
|
6406
|
-
params[key] =
|
|
6407
|
-
this.buildCompany(userInfo);
|
|
6408
|
-
}
|
|
6409
|
-
// Static parameter
|
|
6410
|
-
else {
|
|
6411
|
-
params[key] = value;
|
|
6412
|
-
}
|
|
6413
|
-
});
|
|
6414
|
-
const requestUrl = this.getAutocompleteRequestUrl(userInfo?.p5_backend_url, config?.url);
|
|
6699
|
+
const call = buildBackendCall({ ...config, method: config?.method || 'POST' }, { userInfo, env: this.environment });
|
|
6700
|
+
if (!call) {
|
|
6701
|
+
throw new Error('Missing autocomplete endpoint URL');
|
|
6702
|
+
}
|
|
6415
6703
|
return {
|
|
6416
|
-
url:
|
|
6417
|
-
method:
|
|
6418
|
-
params,
|
|
6419
|
-
headers: config.passToken
|
|
6420
|
-
? {
|
|
6421
|
-
Authorization: `Bearer ${userInfo.token}`,
|
|
6422
|
-
Accept: 'application/json'
|
|
6423
|
-
}
|
|
6704
|
+
url: backendUrl(call.url),
|
|
6705
|
+
method: call.method,
|
|
6706
|
+
params: call.params,
|
|
6707
|
+
headers: config.passToken && userInfo?.token
|
|
6708
|
+
? { Authorization: `Bearer ${userInfo.token}`, Accept: 'application/json' }
|
|
6424
6709
|
: {}
|
|
6425
6710
|
};
|
|
6426
6711
|
}
|
|
6427
|
-
|
|
6428
|
-
const normalizedBackendUrl = backendUrl$1?.trim()?.replace(/\/+$/, '');
|
|
6429
|
-
const normalizedEndpoint = endpoint?.trim();
|
|
6430
|
-
if (!normalizedBackendUrl) {
|
|
6431
|
-
throw new Error('Missing p5_backend_url for autocomplete request');
|
|
6432
|
-
}
|
|
6433
|
-
if (!normalizedEndpoint) {
|
|
6434
|
-
throw new Error('Missing autocomplete endpoint URL');
|
|
6435
|
-
}
|
|
6436
|
-
if (Capacitor.isNativePlatform()) {
|
|
6437
|
-
if (/^https?:\/\//i.test(normalizedEndpoint)) {
|
|
6438
|
-
return normalizedEndpoint;
|
|
6439
|
-
}
|
|
6440
|
-
return (`${normalizedBackendUrl}/` +
|
|
6441
|
-
normalizedEndpoint.replace(/^\/+/, ''));
|
|
6442
|
-
}
|
|
6443
|
-
// Web: through the app's own origin (/api/proxy/<host>/...), P5 sends no CORS headers
|
|
6444
|
-
const absolute = /^https?:\/\//i.test(normalizedEndpoint)
|
|
6445
|
-
? normalizedEndpoint
|
|
6446
|
-
: `${normalizedBackendUrl}/${normalizedEndpoint.replace(/^\/+/, '')}`;
|
|
6447
|
-
return backendUrl(absolute);
|
|
6448
|
-
}
|
|
6449
|
-
buildCompany(userInfo) {
|
|
6450
|
-
return userInfo.p5_plant
|
|
6451
|
-
? `${userInfo.p5_group}/${userInfo.p5_client}/${userInfo.p5_plant}`
|
|
6452
|
-
: `${userInfo.p5_group}/${userInfo.p5_client}/`;
|
|
6453
|
-
}
|
|
6712
|
+
/** Fills {{...}} from the user info (backend-call.ts). */
|
|
6454
6713
|
resolveToken(template, context) {
|
|
6455
|
-
|
|
6456
|
-
// leading "userInfo." resolves too - inside it the value came out empty.
|
|
6457
|
-
const scope = { ...context, userInfo: context };
|
|
6458
|
-
return template.replace(/{{(.*?)}}/g, (_, path) => {
|
|
6459
|
-
return path.trim().split('.').reduce((acc, key) => acc?.[key], scope) ?? '';
|
|
6460
|
-
});
|
|
6714
|
+
return resolveTemplate(template, { userInfo: context });
|
|
6461
6715
|
}
|
|
6462
6716
|
/** Suggestions of `list` whose `field` starts with the typed `query` (case-insensitive). */
|
|
6463
6717
|
filter(list, field, query) {
|
|
@@ -6477,6 +6731,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
6477
6731
|
}]
|
|
6478
6732
|
}] });
|
|
6479
6733
|
|
|
6734
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
6735
|
+
// - new: the data source of a page and the format of its records in browser storage, in one place
|
|
6736
|
+
// (RecordStore uses it). A data source is what the page has anyway: storageType + data_url.
|
|
6737
|
+
// Records are stored as a plain JSON list [{…},{…}] - the same JSON a backend sends and receives.
|
|
6738
|
+
// Reading also takes the old format, a JSON text of that text ("double-wrapped"), which the app
|
|
6739
|
+
// wrote until now; a list written by hand or by the AI no longer stops the page (#166, A1)
|
|
6740
|
+
/** The kind of a data source, lowercase - "localStorage" of older Designer versions counts as "localstorage". */
|
|
6741
|
+
function storageKind(source) {
|
|
6742
|
+
const type = String(source?.storageType ?? '').trim().toLowerCase();
|
|
6743
|
+
if (type === 'localstorage' || type === 'sessionstorage' || type === 'filter' || type === 'database') {
|
|
6744
|
+
return type;
|
|
6745
|
+
}
|
|
6746
|
+
if (!type && source?.localStorage === true)
|
|
6747
|
+
return 'localstorage';
|
|
6748
|
+
if (!type && source?.sessionStorage === true)
|
|
6749
|
+
return 'sessionstorage';
|
|
6750
|
+
return '';
|
|
6751
|
+
}
|
|
6752
|
+
/** True when the records of the source live in the browser (local or session storage). */
|
|
6753
|
+
function isBrowserSource(source) {
|
|
6754
|
+
const kind = storageKind(source);
|
|
6755
|
+
return (kind === 'localstorage' || kind === 'sessionstorage') && !!source?.data_url;
|
|
6756
|
+
}
|
|
6757
|
+
/**
|
|
6758
|
+
* The records of a stored value: a list stays a list, a JSON text is read - also when it is the
|
|
6759
|
+
* JSON text of a JSON text. Anything else (nothing, broken JSON, an object) gives an empty list.
|
|
6760
|
+
*/
|
|
6761
|
+
function parseRecords(value) {
|
|
6762
|
+
let current = value;
|
|
6763
|
+
for (let depth = 0; depth < 3 && typeof current === 'string'; depth++) {
|
|
6764
|
+
try {
|
|
6765
|
+
current = JSON.parse(current);
|
|
6766
|
+
}
|
|
6767
|
+
catch {
|
|
6768
|
+
return [];
|
|
6769
|
+
}
|
|
6770
|
+
}
|
|
6771
|
+
return Array.isArray(current) ? current : [];
|
|
6772
|
+
}
|
|
6773
|
+
/**
|
|
6774
|
+
* The record of a form, dialog or grid row: every field's value exactly as its control holds it - text,
|
|
6775
|
+
* number, date, period (a list), yes/no, selection - nothing unpacked, no exception by type. The same
|
|
6776
|
+
* for every container; dates are turned into storage text later, in one place (RecordStore).
|
|
6777
|
+
* fields: only these names (a grid row's editable columns); without, every field of the data objects.
|
|
6778
|
+
*/
|
|
6779
|
+
function recordOf(propertySchema, fields) {
|
|
6780
|
+
const record = {};
|
|
6781
|
+
for (const group of Object.values(propertySchema || {})) {
|
|
6782
|
+
if (!group || typeof group !== 'object')
|
|
6783
|
+
continue;
|
|
6784
|
+
for (const [name, property] of Object.entries(group)) {
|
|
6785
|
+
if (fields && !fields.includes(name))
|
|
6786
|
+
continue;
|
|
6787
|
+
record[name] = property?.value ?? null;
|
|
6788
|
+
}
|
|
6789
|
+
}
|
|
6790
|
+
return record;
|
|
6791
|
+
}
|
|
6792
|
+
|
|
6793
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-20
|
|
6794
|
+
// - fix: a project without environment.login (an app without sign-in) no longer stops the app at its
|
|
6795
|
+
// start - login.type, login.mobile and login.web are read with ?. ; before, loadKeycloakConfig threw
|
|
6796
|
+
// and the page stayed white (dev_urlaub, first app built with the AI)
|
|
6480
6797
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-14
|
|
6481
6798
|
// - fix: Keycloak on iOS/Android came from a hard-coded block (realm p5, client "mobile",
|
|
6482
6799
|
// de.yomotech:/login/callback) instead of login.mobile, so every project signed in at wilken/p5
|
|
@@ -6520,7 +6837,7 @@ class ConfigService {
|
|
|
6520
6837
|
this.config = await this.couchdbService.getFileContentFromCouchDb(`${projectName}`, 'environments/environment.json');
|
|
6521
6838
|
}
|
|
6522
6839
|
if (isNativeMobile()) {
|
|
6523
|
-
if (this.config
|
|
6840
|
+
if (this.config?.environment?.login?.mobile) {
|
|
6524
6841
|
this.setConfiguration(this.config.environment.login.mobile);
|
|
6525
6842
|
}
|
|
6526
6843
|
else {
|
|
@@ -6528,7 +6845,7 @@ class ConfigService {
|
|
|
6528
6845
|
}
|
|
6529
6846
|
}
|
|
6530
6847
|
else {
|
|
6531
|
-
if (this.config
|
|
6848
|
+
if (this.config?.environment?.login?.web) {
|
|
6532
6849
|
this.setConfiguration(this.config.environment.login.web);
|
|
6533
6850
|
}
|
|
6534
6851
|
else {
|
|
@@ -6583,7 +6900,7 @@ class ConfigService {
|
|
|
6583
6900
|
else {
|
|
6584
6901
|
env = await this.couchdbService.getFileContentFromCouchDb(`${projectName}`, 'environments/environment.json');
|
|
6585
6902
|
}
|
|
6586
|
-
if (env?.environment?.login
|
|
6903
|
+
if (env?.environment?.login?.type === "keycloak") {
|
|
6587
6904
|
if (isNativeMobile()) {
|
|
6588
6905
|
// login.mobile of the project - every project its own realm and client
|
|
6589
6906
|
const mobile = env?.environment?.login?.mobile ?? {};
|
|
@@ -6648,6 +6965,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
6648
6965
|
}]
|
|
6649
6966
|
}], ctorParameters: () => [{ type: Couchdb }, { type: UtilityService }, { type: i1$2.Platform }] });
|
|
6650
6967
|
|
|
6968
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
6969
|
+
// - change: a data object holds names and types only - the media caption comes from the layout
|
|
6970
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
6971
|
+
// - change: delete, save, save all and the filter go to the page's PageData (input pageData, from the
|
|
6972
|
+
// app) - the card only draws; its own copies (deleteRecord, deleteAllRecord, saveData, showConfirm,
|
|
6973
|
+
// the filter load, cardDataChange) are gone, the same rules hold for the grid (A4)
|
|
6974
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
6975
|
+
// - fix: delete and delete all wrote the list into the fixed key "timeRecords", whatever the page's
|
|
6976
|
+
// data_url was (Urlaub "antrag": a delete hit the wrong data). They write through RecordStore into
|
|
6977
|
+
// the page's own data source - input dataSource, given by the app (#166, A1)
|
|
6978
|
+
// - fix: a delete button without deleteMessage did nothing. Deleting always asks first - its own
|
|
6979
|
+
// deleteMessage or the fixed text deleteConfirm; confirmDelete: false skips the question (OFFENE-PUNKTE 90)
|
|
6980
|
+
// - change: saving to a backend (button save, header "saveAll") and loading with a filter send what
|
|
6981
|
+
// the page describes (BackendCallService: data_url, method, params, body, transform, afterSuccess).
|
|
6982
|
+
// The fixed P5 calls registerTimeRecording / requestBookedTimeRecording, the P5 user fields and the
|
|
6983
|
+
// filter names fromDateFilter / toDateFilter are gone (saveData replaces saveToDb, A2)
|
|
6984
|
+
// - fix: a filter field not set yet counted as no filter field - the first date already loaded with
|
|
6985
|
+
// workDayTo empty; every filter field counts now, unset as null (A2 follow-up)
|
|
6986
|
+
// - change: formatToOffsetISO removed - filter dates are written by the page's dateFormat (date-format.ts)
|
|
6651
6987
|
// Shuaib 2026-10-20
|
|
6652
6988
|
// - change: the card's fields are drawn by the shared <vl-control> in display mode (ControlComponent);
|
|
6653
6989
|
// header, footer and buttons keep their own blocks (#166)
|
|
@@ -6774,6 +7110,8 @@ class CardComponent {
|
|
|
6774
7110
|
return field?.option?.control === 'dateTimepicker' || ['datetime', 'date&time', 'date-time'].includes(`${type ?? ''}`.toLowerCase()) ? 'datetime' : 'date';
|
|
6775
7111
|
}
|
|
6776
7112
|
itemInfo = {};
|
|
7113
|
+
/** The records of the page and what is done with them (PageData, shared with the grid). */
|
|
7114
|
+
pageData = null;
|
|
6777
7115
|
currentPage = 0;
|
|
6778
7116
|
pageSize = 5;
|
|
6779
7117
|
selectedLanguageInfo = {};
|
|
@@ -6788,7 +7126,6 @@ class CardComponent {
|
|
|
6788
7126
|
onPageChange = new EventEmitter();
|
|
6789
7127
|
paginationMode = 'server';
|
|
6790
7128
|
paginationLoading = false;
|
|
6791
|
-
cardDataChange = new EventEmitter();
|
|
6792
7129
|
scrollPaginationSentinel;
|
|
6793
7130
|
scrollObserver;
|
|
6794
7131
|
requestedScrollPage = null;
|
|
@@ -6942,24 +7279,6 @@ class CardComponent {
|
|
|
6942
7279
|
}
|
|
6943
7280
|
return this.itemInfo.data.indexOf(record);
|
|
6944
7281
|
}
|
|
6945
|
-
publishCardDataChange(resetPage = false) {
|
|
6946
|
-
const records = Array.isArray(this.itemInfo?.data)
|
|
6947
|
-
? [...this.itemInfo.data]
|
|
6948
|
-
: [];
|
|
6949
|
-
this.cardDataChange.emit({
|
|
6950
|
-
records,
|
|
6951
|
-
resetPage
|
|
6952
|
-
});
|
|
6953
|
-
}
|
|
6954
|
-
setFilteredCardData(records) {
|
|
6955
|
-
const normalizedRecords = this.utilityService.restoreDatesFromStorage(Array.isArray(records) ? records : [], this.itemInfo.propertySchema);
|
|
6956
|
-
this.itemInfo.data = normalizedRecords;
|
|
6957
|
-
/*
|
|
6958
|
-
* Filtering creates a new complete client-side dataset.
|
|
6959
|
-
* Move pagination back to the first page.
|
|
6960
|
-
*/
|
|
6961
|
-
this.publishCardDataChange(true);
|
|
6962
|
-
}
|
|
6963
7282
|
updateDeviceMode() {
|
|
6964
7283
|
if (typeof window === 'undefined') {
|
|
6965
7284
|
this.deviceMode = this.mobileDisplay ? 'mobile' : 'desktop';
|
|
@@ -7082,109 +7401,20 @@ class CardComponent {
|
|
|
7082
7401
|
this.itemInfo.propertySchema[scope][field].value = value;
|
|
7083
7402
|
this.applyDateFilter(this.extractFilterValues(this.itemInfo.propertySchema[scope]));
|
|
7084
7403
|
}
|
|
7404
|
+
/** The filter values go to the page's data; it loads once every filter field is set. */
|
|
7085
7405
|
async applyDateFilter(filters) {
|
|
7086
|
-
const
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
// both dates there: the search starts - the keyboard has done its job and closes
|
|
7406
|
+
const values = Object.values(filters || {});
|
|
7407
|
+
if (values.length && values.every(value => value != null && value !== '')) {
|
|
7408
|
+
// every filter set: the search starts - the keyboard has done its job and closes
|
|
7090
7409
|
this.keyboard.close({ blurTarget: true });
|
|
7091
|
-
const formattedFrom = this.formatToOffsetISO(from);
|
|
7092
|
-
const formattedTo = this.formatToOffsetISO(to);
|
|
7093
|
-
const keycloakInfo = await this.utilityService.getLocalStorage('KeycloakInfo');
|
|
7094
|
-
const logined = await this.utilityService.getLocalStorage('loginedUser');
|
|
7095
|
-
this.safeUpdate(() => this.isLoading = true);
|
|
7096
|
-
if (isNativeMobile()) {
|
|
7097
|
-
try {
|
|
7098
|
-
const saveOrders = await this.getSaveOrder(keycloakInfo?.token, keycloakInfo, formattedFrom, formattedTo);
|
|
7099
|
-
this.safeUpdate(() => {
|
|
7100
|
-
this.setFilteredCardData(saveOrders);
|
|
7101
|
-
this.isLoading = false;
|
|
7102
|
-
});
|
|
7103
|
-
}
|
|
7104
|
-
catch (error) {
|
|
7105
|
-
console.error('Failed to fetch saved work orders', error);
|
|
7106
|
-
this.safeUpdate(() => {
|
|
7107
|
-
this.setFilteredCardData([]);
|
|
7108
|
-
this.isLoading = false;
|
|
7109
|
-
});
|
|
7110
|
-
}
|
|
7111
|
-
return;
|
|
7112
|
-
}
|
|
7113
|
-
else {
|
|
7114
|
-
this.requestService
|
|
7115
|
-
.getSaveOrder(logined?.token, logined, formattedFrom, formattedTo)
|
|
7116
|
-
.subscribe({
|
|
7117
|
-
next: (saveOrders) => {
|
|
7118
|
-
this.safeUpdate(() => {
|
|
7119
|
-
this.setFilteredCardData(saveOrders);
|
|
7120
|
-
this.isLoading = false;
|
|
7121
|
-
});
|
|
7122
|
-
},
|
|
7123
|
-
error: (error) => {
|
|
7124
|
-
console.error('Failed to fetch saved work orders', error);
|
|
7125
|
-
this.safeUpdate(() => {
|
|
7126
|
-
this.setFilteredCardData([]);
|
|
7127
|
-
this.isLoading = false;
|
|
7128
|
-
});
|
|
7129
|
-
}
|
|
7130
|
-
});
|
|
7131
|
-
}
|
|
7132
7410
|
}
|
|
7411
|
+
await this.pageData?.setFilter(filters || {});
|
|
7133
7412
|
}
|
|
7134
|
-
|
|
7135
|
-
if (!token) {
|
|
7136
|
-
return;
|
|
7137
|
-
}
|
|
7138
|
-
const company = userInfo.p5_plant
|
|
7139
|
-
? `${userInfo.p5_group}/${userInfo.p5_client}/${userInfo.p5_plant}`
|
|
7140
|
-
: `${userInfo.p5_group}/${userInfo.p5_client}/`;
|
|
7141
|
-
const url = `${userInfo.p5_backend_url}/assetsmobileservice/Zeiterfassung/requestBookedTimeRecording`;
|
|
7142
|
-
try {
|
|
7143
|
-
const response = await stagedRequest(() => CapacitorHttp.post({
|
|
7144
|
-
url,
|
|
7145
|
-
params: {
|
|
7146
|
-
resourceNo: userInfo.p5_resource_no,
|
|
7147
|
-
workDayFrom: fromDate,
|
|
7148
|
-
workDayTo: toDate,
|
|
7149
|
-
company,
|
|
7150
|
-
appVersion: '1',
|
|
7151
|
-
},
|
|
7152
|
-
headers: {
|
|
7153
|
-
Authorization: `Bearer ${token}`, // ✅ REQUIRED
|
|
7154
|
-
Accept: 'application/json',
|
|
7155
|
-
},
|
|
7156
|
-
// ❗ NO BODY needed for this endpoint
|
|
7157
|
-
}));
|
|
7158
|
-
console.log('getSaveOrder response:', response.data);
|
|
7159
|
-
return response.data;
|
|
7160
|
-
}
|
|
7161
|
-
catch (error) {
|
|
7162
|
-
console.error('Failed to fetch saved orders', error);
|
|
7163
|
-
throw error;
|
|
7164
|
-
}
|
|
7165
|
-
}
|
|
7166
|
-
formatToOffsetISO(date) {
|
|
7167
|
-
if (!date)
|
|
7168
|
-
return '';
|
|
7169
|
-
const pad = (n, len = 2) => String(n).padStart(len, '0');
|
|
7170
|
-
const year = date.getFullYear();
|
|
7171
|
-
const month = pad(date.getMonth() + 1);
|
|
7172
|
-
const day = pad(date.getDate());
|
|
7173
|
-
const hours = pad(date.getHours());
|
|
7174
|
-
const minutes = pad(date.getMinutes());
|
|
7175
|
-
const seconds = pad(date.getSeconds());
|
|
7176
|
-
const ms = pad(date.getMilliseconds(), 4); // 4-digit milliseconds
|
|
7177
|
-
// timezone offset
|
|
7178
|
-
const offset = -date.getTimezoneOffset(); // in minutes
|
|
7179
|
-
const offSign = offset >= 0 ? '+' : '-';
|
|
7180
|
-
const offHours = pad(Math.floor(Math.abs(offset) / 60));
|
|
7181
|
-
const offMinutes = pad(Math.abs(offset) % 60);
|
|
7182
|
-
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}:${ms}${offSign}${offHours}:${offMinutes}`;
|
|
7183
|
-
}
|
|
7413
|
+
/** Every filter field of the page, an unset one as null - the page loads only when none is empty. */
|
|
7184
7414
|
extractFilterValues(schema) {
|
|
7185
7415
|
return Object.keys(schema).reduce((acc, key) => {
|
|
7186
|
-
if (key.includes('Filter')
|
|
7187
|
-
acc[key] = schema[key]
|
|
7416
|
+
if (key.includes('Filter')) {
|
|
7417
|
+
acc[key] = schema[key]?.value ?? null;
|
|
7188
7418
|
}
|
|
7189
7419
|
return acc;
|
|
7190
7420
|
}, {});
|
|
@@ -7207,7 +7437,7 @@ class CardComponent {
|
|
|
7207
7437
|
}
|
|
7208
7438
|
invokeOnCardHeader(element) {
|
|
7209
7439
|
if (element.option && element.option.innerAction === "saveAll") {
|
|
7210
|
-
this.
|
|
7440
|
+
this.saveAllData(element.option);
|
|
7211
7441
|
}
|
|
7212
7442
|
else {
|
|
7213
7443
|
this.cardHeaderButtonClick.emit(element);
|
|
@@ -7216,157 +7446,27 @@ class CardComponent {
|
|
|
7216
7446
|
invokeOnCardFooter(element) {
|
|
7217
7447
|
// this.cardHeaderButtonClick.emit(element);
|
|
7218
7448
|
}
|
|
7449
|
+
/** Delete (asks first) and save to a backend go to the page's data; anything else to the app. */
|
|
7219
7450
|
async invokeButtonClick(layout, record, recordIndex) {
|
|
7220
|
-
if (layout?.option?.action === 'delete' && layout?.option
|
|
7221
|
-
|
|
7222
|
-
this.showConfirm(layout?.option, recordIndex);
|
|
7223
|
-
}
|
|
7451
|
+
if (layout?.option?.action === 'delete' && storageKind(layout?.option) === 'localstorage') {
|
|
7452
|
+
await this.pageData?.remove(recordIndex, layout);
|
|
7224
7453
|
}
|
|
7225
|
-
else if (layout?.option?.action === 'save' && layout?.option
|
|
7226
|
-
this.
|
|
7227
|
-
const final_array = this.utilityService.convertToDailyLogs(record);
|
|
7228
|
-
await this.saveToDb(final_array, recordIndex, layout.option.data_url);
|
|
7454
|
+
else if (layout?.option?.action === 'save' && storageKind(layout?.option) === 'database') {
|
|
7455
|
+
await this.pageData?.send(layout, recordIndex);
|
|
7229
7456
|
}
|
|
7230
7457
|
else {
|
|
7231
7458
|
this.cardButtonClick.emit({ layout: layout, record: record, recordIndex: recordIndex });
|
|
7232
7459
|
}
|
|
7233
7460
|
}
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
: 'Confirm',
|
|
7239
|
-
nzContent: this.selectedLanguageInfo && this.selectedLanguageInfo?.selectedLanguage &&
|
|
7240
|
-
this.selectedLanguageInfo?.selectedLanguage[option.deleteMessage]
|
|
7241
|
-
? this.selectedLanguageInfo.selectedLanguage[option.deleteMessage]
|
|
7242
|
-
: option.deleteMessage,
|
|
7243
|
-
nzOkText: this.selectedLanguageInfo && this.selectedLanguageInfo?.selectedLanguage && this.selectedLanguageInfo?.selectedLanguage['Delete']
|
|
7244
|
-
? this.selectedLanguageInfo.selectedLanguage['Delete']
|
|
7245
|
-
: 'Delete',
|
|
7246
|
-
nzCancelText: this.selectedLanguageInfo && this.selectedLanguageInfo?.selectedLanguage && this.selectedLanguageInfo?.selectedLanguage['Cancel']
|
|
7247
|
-
? this.selectedLanguageInfo.selectedLanguage['Cancel']
|
|
7248
|
-
: 'Cancel',
|
|
7249
|
-
nzOnOk: () => this.deleteRecord(recordIndex),
|
|
7250
|
-
});
|
|
7251
|
-
}
|
|
7252
|
-
async d4_SaveAll() {
|
|
7253
|
-
if (this.itemInfo?.data?.length) {
|
|
7254
|
-
let allOrders = [];
|
|
7255
|
-
for (let i = 0; i < this.itemInfo.data.length; i++) {
|
|
7256
|
-
const element = this.itemInfo.data[i];
|
|
7257
|
-
const dailyLogs = this.utilityService.convertToDailyLogs(element);
|
|
7258
|
-
if (Array.isArray(dailyLogs)) {
|
|
7259
|
-
allOrders.push(...dailyLogs);
|
|
7260
|
-
}
|
|
7261
|
-
}
|
|
7262
|
-
await this.saveToDb(allOrders, null, true);
|
|
7461
|
+
/** "Save all": every record of the page in one call. */
|
|
7462
|
+
async saveAllData(option) {
|
|
7463
|
+
if (this.pageData?.records.length) {
|
|
7464
|
+
await this.pageData.send({ option }, 'all');
|
|
7263
7465
|
}
|
|
7264
7466
|
else {
|
|
7265
7467
|
this.notificationService.warning(this.selectedLanguageInfo?.selectedLanguage['noRecordFound'] ? this.selectedLanguageInfo?.selectedLanguage['noRecordFound'] : 'No Record Found');
|
|
7266
7468
|
}
|
|
7267
7469
|
}
|
|
7268
|
-
async deleteRecord(recordIndex) {
|
|
7269
|
-
if (!Array.isArray(this.itemInfo?.data) ||
|
|
7270
|
-
recordIndex < 0 ||
|
|
7271
|
-
recordIndex >= this.itemInfo.data.length) {
|
|
7272
|
-
this.configService.updateLoader(false);
|
|
7273
|
-
return;
|
|
7274
|
-
}
|
|
7275
|
-
this.itemInfo.data.splice(recordIndex, 1);
|
|
7276
|
-
await this.utilityService.setLocalStorage('timeRecords', JSON.stringify(this.itemInfo.data));
|
|
7277
|
-
/*
|
|
7278
|
-
* Notify AppComponent so page count is recalculated.
|
|
7279
|
-
*/
|
|
7280
|
-
this.publishCardDataChange(false);
|
|
7281
|
-
this.configService.updateLoader(false);
|
|
7282
|
-
}
|
|
7283
|
-
async deleteAllRecord() {
|
|
7284
|
-
this.itemInfo.data = [];
|
|
7285
|
-
await this.utilityService.setLocalStorage('timeRecords', JSON.stringify([]));
|
|
7286
|
-
this.publishCardDataChange(true);
|
|
7287
|
-
this.configService.updateLoader(false);
|
|
7288
|
-
}
|
|
7289
|
-
async saveToDb(orders, orderIndex, data_url, deleteAll = false) {
|
|
7290
|
-
this.safeUpdate(() => (this.isLoading = true));
|
|
7291
|
-
const token = this.oauthService.getAccessToken();
|
|
7292
|
-
const logined = await this.utilityService.getLocalStorage('loginedUser');
|
|
7293
|
-
const keycloakInfo = await this.utilityService.getLocalStorage('KeycloakInfo');
|
|
7294
|
-
let saveobject = {
|
|
7295
|
-
ressourceNo: logined?.p5_resource_no ? logined.p5_resource_no : keycloakInfo?.p5_resource_no,
|
|
7296
|
-
returnTimeRecordingLine: orders
|
|
7297
|
-
};
|
|
7298
|
-
if (isNativeMobile()) {
|
|
7299
|
-
const res = await this.mobileSaveDb(keycloakInfo.token, keycloakInfo, saveobject, orderIndex, data_url, deleteAll);
|
|
7300
|
-
}
|
|
7301
|
-
else {
|
|
7302
|
-
this.webSaveDb(token, logined, saveobject, orderIndex, data_url, deleteAll);
|
|
7303
|
-
}
|
|
7304
|
-
}
|
|
7305
|
-
webSaveDb(token, userInfo, order = {}, orderIndex, dataUrl, deleteAll = false) {
|
|
7306
|
-
if (token) {
|
|
7307
|
-
const headers = new HttpHeaders({
|
|
7308
|
-
'Authorization': `Bearer ${token}`,
|
|
7309
|
-
'Accept': 'application/json'
|
|
7310
|
-
});
|
|
7311
|
-
let url2 = `${userInfo.p5_backend_url}/assetsmobileservice/Zeiterfassung/registerTimeRecording?company=${userInfo.p5_group}/${userInfo.p5_client}/${userInfo.p5_plant ? userInfo.p5_plant : " "}&appVersion=1&resourceNo=${userInfo.p5_resource_no}`;
|
|
7312
|
-
this.http.post(backendUrl(url2), order, { headers }).subscribe({
|
|
7313
|
-
next: res => {
|
|
7314
|
-
this.safeUpdate(() => this.isLoading = false);
|
|
7315
|
-
if (orderIndex > -1) {
|
|
7316
|
-
this.deleteRecord(orderIndex);
|
|
7317
|
-
}
|
|
7318
|
-
else {
|
|
7319
|
-
this.deleteAllRecord();
|
|
7320
|
-
}
|
|
7321
|
-
},
|
|
7322
|
-
error: (error) => {
|
|
7323
|
-
// The loader kept turning and the record stayed without any message.
|
|
7324
|
-
this.safeUpdate(() => this.isLoading = false);
|
|
7325
|
-
console.error('Failed to save time recording', error);
|
|
7326
|
-
this.notificationService.error(this.selectedLanguageInfo?.selectedLanguage?.['saveFailed'] ?? 'The record could not be saved.');
|
|
7327
|
-
}
|
|
7328
|
-
});
|
|
7329
|
-
}
|
|
7330
|
-
}
|
|
7331
|
-
async mobileSaveDb(token, userInfo, order = {}, orderIndex, dataUrl, deleteAll = false) {
|
|
7332
|
-
if (!token) {
|
|
7333
|
-
console.log('NO-token', token);
|
|
7334
|
-
return;
|
|
7335
|
-
}
|
|
7336
|
-
const company = userInfo.p5_plant
|
|
7337
|
-
? `${userInfo.p5_group}/${userInfo.p5_client}/${userInfo.p5_plant}`
|
|
7338
|
-
: `${userInfo.p5_group}/${userInfo.p5_client}/`;
|
|
7339
|
-
const url = `${userInfo.p5_backend_url}/assetsmobileservice/Zeiterfassung/registerTimeRecording`;
|
|
7340
|
-
try {
|
|
7341
|
-
const response = await stagedRequest(() => CapacitorHttp.post({
|
|
7342
|
-
url,
|
|
7343
|
-
params: {
|
|
7344
|
-
company,
|
|
7345
|
-
appVersion: '1',
|
|
7346
|
-
resourceNo: userInfo.p5_resource_no,
|
|
7347
|
-
},
|
|
7348
|
-
headers: {
|
|
7349
|
-
Authorization: `Bearer ${token}`,
|
|
7350
|
-
Accept: 'application/json',
|
|
7351
|
-
'Content-Type': 'application/json',
|
|
7352
|
-
},
|
|
7353
|
-
data: order,
|
|
7354
|
-
}));
|
|
7355
|
-
if (orderIndex != null && orderIndex > -1) {
|
|
7356
|
-
this.deleteRecord(orderIndex);
|
|
7357
|
-
}
|
|
7358
|
-
else {
|
|
7359
|
-
this.deleteAllRecord();
|
|
7360
|
-
}
|
|
7361
|
-
this.safeUpdate(() => (this.isLoading = false));
|
|
7362
|
-
return response.data;
|
|
7363
|
-
}
|
|
7364
|
-
catch (error) {
|
|
7365
|
-
this.safeUpdate(() => (this.isLoading = false));
|
|
7366
|
-
console.error('Failed to save time recording', error);
|
|
7367
|
-
throw error;
|
|
7368
|
-
}
|
|
7369
|
-
}
|
|
7370
7470
|
showLinkDetails(option, record) {
|
|
7371
7471
|
this.linkDetails.emit({ option: option, record: record });
|
|
7372
7472
|
}
|
|
@@ -7501,9 +7601,7 @@ class CardComponent {
|
|
|
7501
7601
|
const reference = layout?.scope?.reference;
|
|
7502
7602
|
const field = reference?.split('/').pop();
|
|
7503
7603
|
const scope = reference ? this.getScope(reference) : '';
|
|
7504
|
-
return label?.caption
|
|
7505
|
-
|| this.itemInfo?.propertySchema?.[scope]?.[field]?.caption
|
|
7506
|
-
|| 'Media';
|
|
7604
|
+
return label?.caption || 'Media';
|
|
7507
7605
|
}
|
|
7508
7606
|
getMediaKind(layout, record) {
|
|
7509
7607
|
const source = this.getMediaSource(layout, record);
|
|
@@ -7569,7 +7667,7 @@ class CardComponent {
|
|
|
7569
7667
|
return resolveCustomKeyboardType(field?.option, property);
|
|
7570
7668
|
}
|
|
7571
7669
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CardComponent, deps: [{ token: UtilityService }, { token: i1$2.Platform }, { token: i1$1.HttpClient }, { token: ConfigService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i5.NzModalService }, { token: NotificationService }, { token: i7.OAuthService }, { token: RequestService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7572
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: CardComponent, isStandalone: true, selector: "vl-card", inputs: { itemInfo: "itemInfo", currentPage: "currentPage", pageSize: "pageSize", selectedLanguageInfo: "selectedLanguageInfo", mobileDisplay: "mobileDisplay", scrollPagination: "scrollPagination", pages: "pages", paginationMode: "paginationMode", paginationLoading: "paginationLoading" }, outputs: { cardButtonClick: "cardButtonClick", cardHeaderButtonClick: "cardHeaderButtonClick", linkDetails: "linkDetails", imageDetails: "imageDetails", onPageSizeChange: "onPageSizeChange", onPageChange: "onPageChange", cardDataChange: "cardDataChange" }, host: { listeners: { "window:resize": "onWindowResize()" } }, viewQueries: [{ propertyName: "scrollPaginationSentinel", first: true, predicate: ["scrollPaginationSentinel"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- Shuaib 2026-10-20\r\n - change: the card's fields (top level and in a horizontal layout) show the record's value through the\r\n shared <vl-control> in display mode instead of four switch blocks over types and controls (#166)\r\n - change: every field shows its value read only - a combobox, autocomplete or drop-down in a card was\r\n an input writing into the property schema; a text, date or time that was not locked showed only\r\n its label; an autocomplete showed only with a currency format; the period showed nothing\r\n - change: the value is styled by scope.style only (it was on the wrapper and on the value) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: locked fields through the read-only building blocks (password as dots, radio text, the\r\n record's tick), numbers with their label (#166, tests F8-F11)\r\n - fix: a text field (textInput) that is not locked shows its value; only the label showed (#166)\r\n - new: a value with date and time is shown with its time (cardDateKind) (#166 E5)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the date filter is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - new: spinner/slider shown with vl-number instead of \"not Implemented yet\" (#166 step 4.4)\r\n - new: radiobutton shown with vl-radio (caption of the chosen value) (#166 step 4.4)\r\n - new: switch shown with vl-switch (locked, caption) instead of \"not supported\" (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea shown with vl-textarea (line breaks kept) instead of \"not supported\" (#166 step 4.4)\r\n - new: password shown with vl-password (dots, eye) instead of \"not supported\" (#166 step 4.4)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the bottom pagination read itemInfo?.data.length; before the records arrive data is\r\n undefined, the template threw and the cards stayed half drawn (luv2shop start page: one\r\n card without texts)\r\n - fix: the price fields read ...?.format.currency; a property without format threw the same\r\n way (luv2shop: no prices, cards cut off) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: the date filter uses the shared picker markup (picker-field, DateTimePickerService) -->\r\n\r\n<!-- shuaib 2026-09-24\r\n - change: card field switches use renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment naming the types this container does not render. It carries four\r\n ngSwitch blocks, so the gap belongs to the container and not to one of them -->\r\n\r\n<!-- @contract the card's fields are drawn by <vl-control mode=\"display\"> (controls/control.ts): every\r\n type shows the record's value read only, the period (dateRange) included. Header and footer keep\r\n their own blocks (date filter, buttons). -->\r\n\r\n<!-- Loader Spinner -->\r\n\r\n<div *ngIf=\"isLoading\" class=\"loader-overlay\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n<div class=\"vl-card-runtime\">\r\n <!-- top pagination on card -->\r\n <div *ngIf=\"\r\n itemInfo?.layoutSchema?.pagination?.visible &&\r\n itemInfo?.layoutSchema?.pagination?.top\r\n \" class=\"card-pagination-wrapper\">\r\n <vl-pagination [itemInfo]=\"itemInfo\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\" [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n </div>\r\n <div *ngIf=\"itemInfo?.header?.elements?.length\" [ngStyle]=\"getHeaderStyle()\"\r\n [class]=\"getStyleWithoutClasses(\r\n itemInfo?.header?.style\r\n ).classes\">\r\n <div *ngFor=\"let element of itemInfo.header?.elements; let c = index\"\r\n [attr.data-vl-field]=\"vlFieldKey(element)\"\r\n [ngStyle]=\"getHeaderElementWrapperStyle(element)\"\r\n [class]=\"element.option?.innerAction && element.option?.innerAction === 'saveAll' && !displayedRecords?.length ? \r\n 'hidden' :getStyleWithoutClasses(element?.wrapperStyle).classes\">\r\n <ng-container\r\n [ngSwitch]=\"renderFieldType(element.scope?.reference && itemInfo.propertySchema[getScope(element.scope?.reference)] ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.type : 'default')\">\r\n\r\n <!-- String Control -->\r\n <div *ngSwitchCase=\"'string'\"\r\n [class]=\"element.option?.visible ? 'card-field-wrapper' : 'hidden'\">\r\n\r\n <!-- LABEL -->\r\n <span *ngIf=\"element.label?.caption\"\r\n [style]=\"getStyleWithoutClasses(element.label?.style).style\"\r\n [class]=\"element.label?.style?.classes?.[0]\">\r\n {{ element.label.caption }}\r\n </span>\r\n </div>\r\n\r\n <!-- Date control -->\r\n <div *ngSwitchCase=\"'date'\" class=\"mb-3\">\r\n <span *ngIf=\"element.option.protected\"\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">\r\n <vl-string [formField]=\"element\"\r\n [modalItemInfo]=\"itemInfo\">\r\n </vl-string>\r\n </span>\r\n <div *ngIf=\"!element.option.protected\"\r\n [class]=\"element?.layout == 'horizontal' ? 'horizontal-layout' : ''\"\r\n [ngClass]=\"element?.style?.classes[0]\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">{{\r\n element.label?.value\r\n ?\r\n element.label?.value : element.label?.caption ?\r\n element.label?.caption :\r\n itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.caption\r\n }}</label>\r\n <vl-datetime kind=\"date\" [field]=\"element\" [target]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]\"\r\n [keyboard]=\"keyboardTypeFor(element, itemInfo.propertySchema)\"\r\n [inputClass]=\"element?.scope?.style?.classes?.[0] || ''\" [inputStyle]=\"getStyleWithoutClasses(element?.scope?.style).style\"\r\n (changed)=\"dateChangeEvent(element, $event)\"></vl-datetime>\r\n </div>\r\n </div>\r\n\r\n <!-- Button Control -->\r\n <div *ngSwitchCase=\"'default'\"\r\n [class]=\"element.option?.visible ? 'row' : 'hidden'\"\r\n (click)=\"invokeOnCardHeader(element)\">\r\n <button nz-button type=\"button\" [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [matTooltip]=\"element?.option?.tooltip || ''\"\r\n [matTooltipTouchGestures]=\"'auto'\"\r\n [ngStyle]=\"getStyleWithoutClasses(element.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element.style).classes\">\r\n <ng-container\r\n *ngIf=\"!element.caption; else headerTextContent\">\r\n <i nz-icon [nzType]=\"element.icon\"\r\n nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #headerTextContent>{{ element.caption\r\n }}</ng-template>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <div class=\"card-responsive-grid\" [ngStyle]=\"getCardContainerStyle()\"\r\n [class]=\"getStyleWithoutClasses(\r\n itemInfo?.layoutSchema?.style\r\n ).classes\">\r\n <div *ngFor=\"let record of displayedRecords; let k = index\"\r\n class=\"card-grid-item\" [attr.data-vl-record]=\"k\">\r\n <div [ngStyle]=\"getSingleCardStyle()\"\r\n [class]=\"getStyleWithoutClasses(itemInfo?.layoutSchema?.stylePerCard).classes\">\r\n <div *ngFor=\"let layout of itemInfo?.layoutSchema?.cards || []\"\r\n class=\"card-layout-item\" [ngStyle]=\"\r\n layout?.type === 'HorizontalLayout'\r\n ? {}\r\n : getStyleWithoutClasses(layout?.style).style\r\n \" [class]=\"\r\n layout?.type === 'HorizontalLayout'\r\n ? ''\r\n : getStyleWithoutClasses(layout?.style).classes\r\n \">\r\n @if (!layout?.scope?.reference && layout?.type === 'HorizontalLayout') {\r\n <div class=\"card-horizontal-layout\"\r\n [class]=\"getStyleWithoutClasses(layout?.style).classes\"\r\n [ngStyle]=\"getHorizontalLayoutStyle(layout)\">\r\n <ng-container *ngFor=\"let innerLayout of layout.elements\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cardElement; context: { element: innerLayout, record: record, inner: true }\">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n } @else {\r\n <ng-container\r\n *ngTemplateOutlet=\"cardElement; context: { element: layout, record: record, inner: false }\">\r\n </ng-container>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"itemInfo?.footer?.elements && itemInfo?.data && itemInfo?.data.length\"\r\n [class]=\"getStyleWithoutClasses(itemInfo?.footer?.style).classes\">\r\n <span\r\n *ngFor=\"let element of itemInfo.footer?.elements; let c = index\">\r\n <ng-container\r\n [ngSwitch]=\"renderFieldType(element.scope?.reference && itemInfo.propertySchema[getScope(element.scope?.reference)] ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.type : 'default')\">\r\n\r\n <!-- Date control -->\r\n <div *ngSwitchCase=\"'date'\" class=\"form-group mb-3\">\r\n <span *ngIf=\"element.option.protected\"\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">\r\n <h5>{{\r\n itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.caption\r\n }}\r\n </h5>\r\n </span>\r\n <div *ngIf=\"!element.option.protected\">\r\n <div\r\n [class]=\"element?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">{{\r\n element.label?.value\r\n ?\r\n element.label?.value :\r\n element.label?.caption ?\r\n element.label?.caption :\r\n itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.caption\r\n }}</label>\r\n\r\n <nz-date-picker\r\n [required]=\"element.option.required\"\r\n [name]=\"element.scope?.reference\"\r\n [nzDisabled]=\"element?.option?.disabled\"\r\n (ngModelChange)=\"dateChangeEvent(element, $event)\"\r\n [nzFormat]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.format ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.format : 'yyyy-MM-dd'\"\r\n [(ngModel)]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()].value\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"></nz-date-picker>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <!-- Button Control -->\r\n <div *ngSwitchCase=\"'default'\"\r\n [class]=\"element.option?.visible ? 'row' : 'hidden'\"\r\n (click)=\"invokeOnCardFooter(element)\">\r\n <button nz-button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [style]=\"getStyleWithoutClasses(element.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element.style).classes\">\r\n <ng-container\r\n *ngIf=\"!element.caption; else textContent\">\r\n <i nz-icon [nzType]=\"element.icon\"\r\n nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #textContent>\r\n {{ element.caption }}\r\n </ng-template>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </span>\r\n </div>\r\n <!-- bottom pagination on card -->\r\n <div *ngIf=\"\r\n itemInfo?.data?.length && \r\n itemInfo?.layoutSchema?.pagination?.visible &&\r\n !itemInfo?.layoutSchema?.pagination?.top &&\r\n !scrollPagination\r\n \" class=\"card-pagination-wrapper\">\r\n <vl-pagination [itemInfo]=\"itemInfo\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n </div>\r\n\r\n @if (scrollPagination) {\r\n <div #scrollPaginationSentinel class=\"scroll-pagination-sentinel\"\r\n aria-hidden=\"true\">\r\n </div>\r\n }\r\n</div>\r\n<!-- one element of a card: a field shows the record's value through the shared <vl-control> in display\r\n mode; an element without a property is a button. A field the layout does not mark visible is hidden -->\r\n<ng-template #cardElement let-element=\"element\" let-record=\"record\" let-inner=\"inner\">\r\n @if (element?.scope?.reference) {\r\n <div [ngClass]=\"[element?.option?.visible ? 'card-field-wrapper' : 'hidden', inner ? getStyleWithoutClasses(element?.style).classes : '']\"\r\n [ngStyle]=\"inner ? getStyleWithoutClasses(element?.style).style : {}\">\r\n <vl-control mode=\"display\" [field]=\"element\" [record]=\"record\"\r\n [propertySchema]=\"itemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [list]=\"remoteData[element.scope.reference]\"\r\n (linkClicked)=\"showLinkDetails(element.option, record)\"\r\n (mediaClicked)=\"showImageDetails(element.option, record)\">\r\n </vl-control>\r\n </div>\r\n } @else if (inner) {\r\n <div>\r\n <button nz-button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [matTooltip]=\"getHorizontalLayoutTooltip(element)\"\r\n [matTooltipTouchGestures]=\"'auto'\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"\r\n [class]=\"element.option?.visible ? element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element?.style).classes : 'hidden'\"\r\n (click)=\"invokeButtonClick(element, record, getRecordIndex(record))\">\r\n <span class=\"schema-btn-content\">\r\n <i *ngIf=\"showButtonIcon(element)\" nz-icon [nzType]=\"element.icon\" nzTheme=\"outline\"></i>\r\n <span *ngIf=\"showButtonCaption(element)\">{{ element.caption }}</span>\r\n <span *ngIf=\"!showButtonIcon(element) && !showButtonCaption(element)\">Button</span>\r\n </span>\r\n </button>\r\n </div>\r\n } @else {\r\n <div [class]=\"element.option?.visible ? 'row' : 'hidden'\">\r\n <button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element?.style).classes\"\r\n (click)=\"invokeButtonClick(element, record, getRecordIndex(record))\">\r\n <ng-container *ngIf=\"!element.caption; else textContent\">\r\n <i nz-icon [nzType]=\"element.icon\" nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #textContent>{{ element.caption }}</ng-template>\r\n </button>\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block;width:100%;min-width:0}.vl-card-runtime{min-width:0;box-sizing:border-box}.card-responsive-grid{width:100%;min-width:0;box-sizing:border-box}.scroll-pagination-sentinel{width:100%;height:1px}.card-grid-item,.card-layout-item,.card-horizontal-layout,.card-field-wrapper{width:100%;min-width:0;box-sizing:border-box}.card-field-wrapper{overflow-wrap:anywhere}.card-field-wrapper p,.card-field-wrapper h3{margin:0;min-width:0}.card-layout-item img{display:block;max-width:100%;height:auto}.card-layout-item button{max-width:100%;box-sizing:border-box}.schema-btn-content{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0}.hidden{display:none!important}.card-pagination-wrapper{width:100%;min-width:0;box-sizing:border-box;padding:0 10px}\n"], dependencies: [{ kind: "component", type: ControlComponent, selector: "vl-control", inputs: ["field", "propertySchema", "selectedLanguageInfo", "errorMessages", "saveTried", "container", "buttonType", "mode", "record", "hideLabel", "styleValue", "compact", "list", "listLoading", "creditCardError"], outputs: ["picked", "changed", "opened", "toggled", "linkClicked", "mediaClicked", "buttonClick"] }, { kind: "component", type: DateTimeControl, selector: "vl-datetime", inputs: ["field", "target", "property", "kind", "value", "readonly", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["changed", "opened"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i9.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i9.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i11.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i12.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i13.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i14.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "ngmodule", type: NzDatePickerModule }, { kind: "component", type: i15.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-quarter-picker,nz-year-picker,nz-range-picker", inputs: ["nzInline", "nzAllowClear", "nzAutoFocus", "nzDisabled", "nzInputReadOnly", "nzOpen", "nzDisabledDate", "nzLocale", "nzPlaceHolder", "nzPopupStyle", "nzDropdownClassName", "nzSize", "nzStatus", "nzFormat", "nzVariant", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzShowToday", "nzMode", "nzShowNow", "nzRanges", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzPlacement", "nzShowWeekNumber", "nzShowTime"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }, { kind: "ngmodule", type: NzModalModule }, { kind: "component", type: PaginationComponent, selector: "vl-pagination", inputs: ["itemInfo", "pageSize", "currentPage", "selectedLanguageInfo", "pages"], outputs: ["pageSizeChange", "onGoToPage"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i16.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: String$1, selector: "vl-string", inputs: ["formField", "modalItemInfo"] }] });
|
|
7670
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: CardComponent, isStandalone: true, selector: "vl-card", inputs: { itemInfo: "itemInfo", pageData: "pageData", currentPage: "currentPage", pageSize: "pageSize", selectedLanguageInfo: "selectedLanguageInfo", mobileDisplay: "mobileDisplay", scrollPagination: "scrollPagination", pages: "pages", paginationMode: "paginationMode", paginationLoading: "paginationLoading" }, outputs: { cardButtonClick: "cardButtonClick", cardHeaderButtonClick: "cardHeaderButtonClick", linkDetails: "linkDetails", imageDetails: "imageDetails", onPageSizeChange: "onPageSizeChange", onPageChange: "onPageChange" }, host: { listeners: { "window:resize": "onWindowResize()" } }, viewQueries: [{ propertyName: "scrollPaginationSentinel", first: true, predicate: ["scrollPaginationSentinel"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - change: caption and date pattern from the layout - a data object holds names and types only -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21\r\n - change: the loader also shows while the page's PageData loads or sends (A4)\r\n - fix: a grid page draws no card area - an empty gap stood between filter fields and table -->\r\n<!-- Shuaib 2026-10-20\r\n - change: the card's fields (top level and in a horizontal layout) show the record's value through the\r\n shared <vl-control> in display mode instead of four switch blocks over types and controls (#166)\r\n - change: every field shows its value read only - a combobox, autocomplete or drop-down in a card was\r\n an input writing into the property schema; a text, date or time that was not locked showed only\r\n its label; an autocomplete showed only with a currency format; the period showed nothing\r\n - change: the value is styled by scope.style only (it was on the wrapper and on the value) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: locked fields through the read-only building blocks (password as dots, radio text, the\r\n record's tick), numbers with their label (#166, tests F8-F11)\r\n - fix: a text field (textInput) that is not locked shows its value; only the label showed (#166)\r\n - new: a value with date and time is shown with its time (cardDateKind) (#166 E5)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the date filter is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - new: spinner/slider shown with vl-number instead of \"not Implemented yet\" (#166 step 4.4)\r\n - new: radiobutton shown with vl-radio (caption of the chosen value) (#166 step 4.4)\r\n - new: switch shown with vl-switch (locked, caption) instead of \"not supported\" (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea shown with vl-textarea (line breaks kept) instead of \"not supported\" (#166 step 4.4)\r\n - new: password shown with vl-password (dots, eye) instead of \"not supported\" (#166 step 4.4)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the bottom pagination read itemInfo?.data.length; before the records arrive data is\r\n undefined, the template threw and the cards stayed half drawn (luv2shop start page: one\r\n card without texts)\r\n - fix: the price fields read ...?.format.currency; a property without format threw the same\r\n way (luv2shop: no prices, cards cut off) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: the date filter uses the shared picker markup (picker-field, DateTimePickerService) -->\r\n\r\n<!-- shuaib 2026-09-24\r\n - change: card field switches use renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment naming the types this container does not render. It carries four\r\n ngSwitch blocks, so the gap belongs to the container and not to one of them -->\r\n\r\n<!-- @contract the card's fields are drawn by <vl-control mode=\"display\"> (controls/control.ts): every\r\n type shows the record's value read only, the period (dateRange) included. Header and footer keep\r\n their own blocks (date filter, buttons). -->\r\n\r\n<!-- Loader Spinner -->\r\n\r\n<div *ngIf=\"isLoading || pageData?.loading\" class=\"loader-overlay\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n<div class=\"vl-card-runtime\">\r\n <!-- top pagination on card -->\r\n <div *ngIf=\"\r\n itemInfo?.layoutSchema?.pagination?.visible &&\r\n itemInfo?.layoutSchema?.pagination?.top\r\n \" class=\"card-pagination-wrapper\">\r\n <vl-pagination [itemInfo]=\"itemInfo\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\" [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n </div>\r\n <div *ngIf=\"itemInfo?.header?.elements?.length\" [ngStyle]=\"getHeaderStyle()\"\r\n [class]=\"getStyleWithoutClasses(\r\n itemInfo?.header?.style\r\n ).classes\">\r\n <div *ngFor=\"let element of itemInfo.header?.elements; let c = index\"\r\n [attr.data-vl-field]=\"vlFieldKey(element)\"\r\n [ngStyle]=\"getHeaderElementWrapperStyle(element)\"\r\n [class]=\"element.option?.innerAction && element.option?.innerAction === 'saveAll' && !displayedRecords?.length ? \r\n 'hidden' :getStyleWithoutClasses(element?.wrapperStyle).classes\">\r\n <ng-container\r\n [ngSwitch]=\"renderFieldType(element.scope?.reference && itemInfo.propertySchema[getScope(element.scope?.reference)] ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.type : 'default')\">\r\n\r\n <!-- String Control -->\r\n <div *ngSwitchCase=\"'string'\"\r\n [class]=\"element.option?.visible ? 'card-field-wrapper' : 'hidden'\">\r\n\r\n <!-- LABEL -->\r\n <span *ngIf=\"element.label?.caption\"\r\n [style]=\"getStyleWithoutClasses(element.label?.style).style\"\r\n [class]=\"element.label?.style?.classes?.[0]\">\r\n {{ element.label.caption }}\r\n </span>\r\n </div>\r\n\r\n <!-- Date control -->\r\n <div *ngSwitchCase=\"'date'\" class=\"mb-3\">\r\n <span *ngIf=\"element.option.protected\"\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">\r\n <vl-string [formField]=\"element\"\r\n [modalItemInfo]=\"itemInfo\">\r\n </vl-string>\r\n </span>\r\n <div *ngIf=\"!element.option.protected\"\r\n [class]=\"element?.layout == 'horizontal' ? 'horizontal-layout' : ''\"\r\n [ngClass]=\"element?.style?.classes[0]\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">{{\r\n element.label?.value\r\n ?\r\n element.label?.value : element.label?.caption ?\r\n element.label?.caption :\r\n (element.label?.value || element.label?.caption || '')\r\n }}</label>\r\n <vl-datetime kind=\"date\" [field]=\"element\" [target]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]\"\r\n [keyboard]=\"keyboardTypeFor(element, itemInfo.propertySchema)\"\r\n [inputClass]=\"element?.scope?.style?.classes?.[0] || ''\" [inputStyle]=\"getStyleWithoutClasses(element?.scope?.style).style\"\r\n (changed)=\"dateChangeEvent(element, $event)\"></vl-datetime>\r\n </div>\r\n </div>\r\n\r\n <!-- Button Control -->\r\n <div *ngSwitchCase=\"'default'\"\r\n [class]=\"element.option?.visible ? 'row' : 'hidden'\"\r\n (click)=\"invokeOnCardHeader(element)\">\r\n <button nz-button type=\"button\" [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [matTooltip]=\"element?.option?.tooltip || ''\"\r\n [matTooltipTouchGestures]=\"'auto'\"\r\n [ngStyle]=\"getStyleWithoutClasses(element.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element.style).classes\">\r\n <ng-container\r\n *ngIf=\"!element.caption; else headerTextContent\">\r\n <i nz-icon [nzType]=\"element.icon\"\r\n nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #headerTextContent>{{ element.caption\r\n }}</ng-template>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <!-- a grid page (container grid): the card draws only the header, the app shows vl-grid below (A4) -->\r\n <div *ngIf=\"itemInfo?.layoutSchema?.container !== 'grid'\" class=\"card-responsive-grid\" [ngStyle]=\"getCardContainerStyle()\"\r\n [class]=\"getStyleWithoutClasses(\r\n itemInfo?.layoutSchema?.style\r\n ).classes\">\r\n <div *ngFor=\"let record of displayedRecords; let k = index\"\r\n class=\"card-grid-item\" [attr.data-vl-record]=\"k\">\r\n <div [ngStyle]=\"getSingleCardStyle()\"\r\n [class]=\"getStyleWithoutClasses(itemInfo?.layoutSchema?.stylePerCard).classes\">\r\n <div *ngFor=\"let layout of itemInfo?.layoutSchema?.cards || []\"\r\n class=\"card-layout-item\" [ngStyle]=\"\r\n layout?.type === 'HorizontalLayout'\r\n ? {}\r\n : getStyleWithoutClasses(layout?.style).style\r\n \" [class]=\"\r\n layout?.type === 'HorizontalLayout'\r\n ? ''\r\n : getStyleWithoutClasses(layout?.style).classes\r\n \">\r\n @if (!layout?.scope?.reference && layout?.type === 'HorizontalLayout') {\r\n <div class=\"card-horizontal-layout\"\r\n [class]=\"getStyleWithoutClasses(layout?.style).classes\"\r\n [ngStyle]=\"getHorizontalLayoutStyle(layout)\">\r\n <ng-container *ngFor=\"let innerLayout of layout.elements\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cardElement; context: { element: innerLayout, record: record, inner: true }\">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n } @else {\r\n <ng-container\r\n *ngTemplateOutlet=\"cardElement; context: { element: layout, record: record, inner: false }\">\r\n </ng-container>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"itemInfo?.footer?.elements && itemInfo?.data && itemInfo?.data.length\"\r\n [class]=\"getStyleWithoutClasses(itemInfo?.footer?.style).classes\">\r\n <span\r\n *ngFor=\"let element of itemInfo.footer?.elements; let c = index\">\r\n <ng-container\r\n [ngSwitch]=\"renderFieldType(element.scope?.reference && itemInfo.propertySchema[getScope(element.scope?.reference)] ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.type : 'default')\">\r\n\r\n <!-- Date control -->\r\n <div *ngSwitchCase=\"'date'\" class=\"form-group mb-3\">\r\n <span *ngIf=\"element.option.protected\"\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">\r\n <h5>{{\r\n (element.label?.value || element.label?.caption || '')\r\n }}\r\n </h5>\r\n </span>\r\n <div *ngIf=\"!element.option.protected\">\r\n <div\r\n [class]=\"element?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">{{\r\n element.label?.value\r\n ?\r\n element.label?.value :\r\n element.label?.caption ?\r\n element.label?.caption :\r\n (element.label?.value || element.label?.caption || '')\r\n }}</label>\r\n\r\n <nz-date-picker\r\n [required]=\"element.option.required\"\r\n [name]=\"element.scope?.reference\"\r\n [nzDisabled]=\"element?.option?.disabled\"\r\n (ngModelChange)=\"dateChangeEvent(element, $event)\"\r\n [nzFormat]=\"(element.option?.customDisplayFormat || 'yyyy-MM-dd')\"\r\n [(ngModel)]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()].value\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"></nz-date-picker>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <!-- Button Control -->\r\n <div *ngSwitchCase=\"'default'\"\r\n [class]=\"element.option?.visible ? 'row' : 'hidden'\"\r\n (click)=\"invokeOnCardFooter(element)\">\r\n <button nz-button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [style]=\"getStyleWithoutClasses(element.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element.style).classes\">\r\n <ng-container\r\n *ngIf=\"!element.caption; else textContent\">\r\n <i nz-icon [nzType]=\"element.icon\"\r\n nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #textContent>\r\n {{ element.caption }}\r\n </ng-template>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </span>\r\n </div>\r\n <!-- bottom pagination on card -->\r\n <div *ngIf=\"\r\n itemInfo?.data?.length && \r\n itemInfo?.layoutSchema?.pagination?.visible &&\r\n !itemInfo?.layoutSchema?.pagination?.top &&\r\n !scrollPagination\r\n \" class=\"card-pagination-wrapper\">\r\n <vl-pagination [itemInfo]=\"itemInfo\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n </div>\r\n\r\n @if (scrollPagination) {\r\n <div #scrollPaginationSentinel class=\"scroll-pagination-sentinel\"\r\n aria-hidden=\"true\">\r\n </div>\r\n }\r\n</div>\r\n<!-- one element of a card: a field shows the record's value through the shared <vl-control> in display\r\n mode; an element without a property is a button. A field the layout does not mark visible is hidden -->\r\n<ng-template #cardElement let-element=\"element\" let-record=\"record\" let-inner=\"inner\">\r\n @if (element?.scope?.reference) {\r\n <div [ngClass]=\"[element?.option?.visible ? 'card-field-wrapper' : 'hidden', inner ? getStyleWithoutClasses(element?.style).classes : '']\"\r\n [ngStyle]=\"inner ? getStyleWithoutClasses(element?.style).style : {}\">\r\n <vl-control mode=\"display\" [field]=\"element\" [record]=\"record\"\r\n [propertySchema]=\"itemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [list]=\"remoteData[element.scope.reference]\"\r\n (linkClicked)=\"showLinkDetails(element.option, record)\"\r\n (mediaClicked)=\"showImageDetails(element.option, record)\">\r\n </vl-control>\r\n </div>\r\n } @else if (inner) {\r\n <div>\r\n <button nz-button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [matTooltip]=\"getHorizontalLayoutTooltip(element)\"\r\n [matTooltipTouchGestures]=\"'auto'\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"\r\n [class]=\"element.option?.visible ? element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element?.style).classes : 'hidden'\"\r\n (click)=\"invokeButtonClick(element, record, getRecordIndex(record))\">\r\n <span class=\"schema-btn-content\">\r\n <i *ngIf=\"showButtonIcon(element)\" nz-icon [nzType]=\"element.icon\" nzTheme=\"outline\"></i>\r\n <span *ngIf=\"showButtonCaption(element)\">{{ element.caption }}</span>\r\n <span *ngIf=\"!showButtonIcon(element) && !showButtonCaption(element)\">Button</span>\r\n </span>\r\n </button>\r\n </div>\r\n } @else {\r\n <div [class]=\"element.option?.visible ? 'row' : 'hidden'\">\r\n <button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element?.style).classes\"\r\n (click)=\"invokeButtonClick(element, record, getRecordIndex(record))\">\r\n <ng-container *ngIf=\"!element.caption; else textContent\">\r\n <i nz-icon [nzType]=\"element.icon\" nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #textContent>{{ element.caption }}</ng-template>\r\n </button>\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block;width:100%;min-width:0}.vl-card-runtime{min-width:0;box-sizing:border-box}.card-responsive-grid{width:100%;min-width:0;box-sizing:border-box}.scroll-pagination-sentinel{width:100%;height:1px}.card-grid-item,.card-layout-item,.card-horizontal-layout,.card-field-wrapper{width:100%;min-width:0;box-sizing:border-box}.card-grid-item>div{margin-left:auto;margin-right:auto}.card-field-wrapper{overflow-wrap:anywhere}.card-field-wrapper p,.card-field-wrapper h3{margin:0;min-width:0}.card-layout-item img{display:block;max-width:100%;height:auto}.card-layout-item button{max-width:100%;box-sizing:border-box}.schema-btn-content{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0}.hidden{display:none!important}.card-pagination-wrapper{width:100%;min-width:0;box-sizing:border-box;padding:0 10px}\n"], dependencies: [{ kind: "component", type: ControlComponent, selector: "vl-control", inputs: ["field", "propertySchema", "selectedLanguageInfo", "errorMessages", "saveTried", "container", "buttonType", "locked", "lockHints", "mode", "record", "hideLabel", "styleValue", "compact", "list", "listLoading", "creditCardError"], outputs: ["picked", "changed", "opened", "toggled", "linkClicked", "mediaClicked", "buttonClick", "lockedClick", "signIn"] }, { kind: "component", type: DateTimeControl, selector: "vl-datetime", inputs: ["field", "target", "property", "kind", "value", "readonly", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["changed", "opened"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i9.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i9.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i11.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i12.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i13.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i14.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "ngmodule", type: NzDatePickerModule }, { kind: "component", type: i15.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-quarter-picker,nz-year-picker,nz-range-picker", inputs: ["nzInline", "nzAllowClear", "nzAutoFocus", "nzDisabled", "nzInputReadOnly", "nzOpen", "nzDisabledDate", "nzLocale", "nzPlaceHolder", "nzPopupStyle", "nzDropdownClassName", "nzSize", "nzStatus", "nzFormat", "nzVariant", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzShowToday", "nzMode", "nzShowNow", "nzRanges", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzPlacement", "nzShowWeekNumber", "nzShowTime"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }, { kind: "ngmodule", type: NzModalModule }, { kind: "component", type: PaginationComponent, selector: "vl-pagination", inputs: ["itemInfo", "pageSize", "currentPage", "selectedLanguageInfo", "pages"], outputs: ["pageSizeChange", "onGoToPage"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i16.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: String$1, selector: "vl-string", inputs: ["formField", "modalItemInfo"] }] });
|
|
7573
7671
|
}
|
|
7574
7672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: CardComponent, decorators: [{
|
|
7575
7673
|
type: Component,
|
|
@@ -7585,9 +7683,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
7585
7683
|
PaginationComponent,
|
|
7586
7684
|
MatTooltipModule,
|
|
7587
7685
|
String$1,
|
|
7588
|
-
], standalone: true, template: "<!-- Shuaib 2026-10-20\r\n - change: the card's fields (top level and in a horizontal layout) show the record's value through the\r\n shared <vl-control> in display mode instead of four switch blocks over types and controls (#166)\r\n - change: every field shows its value read only - a combobox, autocomplete or drop-down in a card was\r\n an input writing into the property schema; a text, date or time that was not locked showed only\r\n its label; an autocomplete showed only with a currency format; the period showed nothing\r\n - change: the value is styled by scope.style only (it was on the wrapper and on the value) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: locked fields through the read-only building blocks (password as dots, radio text, the\r\n record's tick), numbers with their label (#166, tests F8-F11)\r\n - fix: a text field (textInput) that is not locked shows its value; only the label showed (#166)\r\n - new: a value with date and time is shown with its time (cardDateKind) (#166 E5)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the date filter is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - new: spinner/slider shown with vl-number instead of \"not Implemented yet\" (#166 step 4.4)\r\n - new: radiobutton shown with vl-radio (caption of the chosen value) (#166 step 4.4)\r\n - new: switch shown with vl-switch (locked, caption) instead of \"not supported\" (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea shown with vl-textarea (line breaks kept) instead of \"not supported\" (#166 step 4.4)\r\n - new: password shown with vl-password (dots, eye) instead of \"not supported\" (#166 step 4.4)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the bottom pagination read itemInfo?.data.length; before the records arrive data is\r\n undefined, the template threw and the cards stayed half drawn (luv2shop start page: one\r\n card without texts)\r\n - fix: the price fields read ...?.format.currency; a property without format threw the same\r\n way (luv2shop: no prices, cards cut off) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: the date filter uses the shared picker markup (picker-field, DateTimePickerService) -->\r\n\r\n<!-- shuaib 2026-09-24\r\n - change: card field switches use renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment naming the types this container does not render. It carries four\r\n ngSwitch blocks, so the gap belongs to the container and not to one of them -->\r\n\r\n<!-- @contract the card's fields are drawn by <vl-control mode=\"display\"> (controls/control.ts): every\r\n type shows the record's value read only, the period (dateRange) included. Header and footer keep\r\n their own blocks (date filter, buttons). -->\r\n\r\n<!-- Loader Spinner -->\r\n\r\n<div *ngIf=\"isLoading\" class=\"loader-overlay\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n<div class=\"vl-card-runtime\">\r\n <!-- top pagination on card -->\r\n <div *ngIf=\"\r\n itemInfo?.layoutSchema?.pagination?.visible &&\r\n itemInfo?.layoutSchema?.pagination?.top\r\n \" class=\"card-pagination-wrapper\">\r\n <vl-pagination [itemInfo]=\"itemInfo\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\" [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n </div>\r\n <div *ngIf=\"itemInfo?.header?.elements?.length\" [ngStyle]=\"getHeaderStyle()\"\r\n [class]=\"getStyleWithoutClasses(\r\n itemInfo?.header?.style\r\n ).classes\">\r\n <div *ngFor=\"let element of itemInfo.header?.elements; let c = index\"\r\n [attr.data-vl-field]=\"vlFieldKey(element)\"\r\n [ngStyle]=\"getHeaderElementWrapperStyle(element)\"\r\n [class]=\"element.option?.innerAction && element.option?.innerAction === 'saveAll' && !displayedRecords?.length ? \r\n 'hidden' :getStyleWithoutClasses(element?.wrapperStyle).classes\">\r\n <ng-container\r\n [ngSwitch]=\"renderFieldType(element.scope?.reference && itemInfo.propertySchema[getScope(element.scope?.reference)] ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.type : 'default')\">\r\n\r\n <!-- String Control -->\r\n <div *ngSwitchCase=\"'string'\"\r\n [class]=\"element.option?.visible ? 'card-field-wrapper' : 'hidden'\">\r\n\r\n <!-- LABEL -->\r\n <span *ngIf=\"element.label?.caption\"\r\n [style]=\"getStyleWithoutClasses(element.label?.style).style\"\r\n [class]=\"element.label?.style?.classes?.[0]\">\r\n {{ element.label.caption }}\r\n </span>\r\n </div>\r\n\r\n <!-- Date control -->\r\n <div *ngSwitchCase=\"'date'\" class=\"mb-3\">\r\n <span *ngIf=\"element.option.protected\"\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">\r\n <vl-string [formField]=\"element\"\r\n [modalItemInfo]=\"itemInfo\">\r\n </vl-string>\r\n </span>\r\n <div *ngIf=\"!element.option.protected\"\r\n [class]=\"element?.layout == 'horizontal' ? 'horizontal-layout' : ''\"\r\n [ngClass]=\"element?.style?.classes[0]\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">{{\r\n element.label?.value\r\n ?\r\n element.label?.value : element.label?.caption ?\r\n element.label?.caption :\r\n itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.caption\r\n }}</label>\r\n <vl-datetime kind=\"date\" [field]=\"element\" [target]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]\"\r\n [keyboard]=\"keyboardTypeFor(element, itemInfo.propertySchema)\"\r\n [inputClass]=\"element?.scope?.style?.classes?.[0] || ''\" [inputStyle]=\"getStyleWithoutClasses(element?.scope?.style).style\"\r\n (changed)=\"dateChangeEvent(element, $event)\"></vl-datetime>\r\n </div>\r\n </div>\r\n\r\n <!-- Button Control -->\r\n <div *ngSwitchCase=\"'default'\"\r\n [class]=\"element.option?.visible ? 'row' : 'hidden'\"\r\n (click)=\"invokeOnCardHeader(element)\">\r\n <button nz-button type=\"button\" [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [matTooltip]=\"element?.option?.tooltip || ''\"\r\n [matTooltipTouchGestures]=\"'auto'\"\r\n [ngStyle]=\"getStyleWithoutClasses(element.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element.style).classes\">\r\n <ng-container\r\n *ngIf=\"!element.caption; else headerTextContent\">\r\n <i nz-icon [nzType]=\"element.icon\"\r\n nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #headerTextContent>{{ element.caption\r\n }}</ng-template>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <div class=\"card-responsive-grid\" [ngStyle]=\"getCardContainerStyle()\"\r\n [class]=\"getStyleWithoutClasses(\r\n itemInfo?.layoutSchema?.style\r\n ).classes\">\r\n <div *ngFor=\"let record of displayedRecords; let k = index\"\r\n class=\"card-grid-item\" [attr.data-vl-record]=\"k\">\r\n <div [ngStyle]=\"getSingleCardStyle()\"\r\n [class]=\"getStyleWithoutClasses(itemInfo?.layoutSchema?.stylePerCard).classes\">\r\n <div *ngFor=\"let layout of itemInfo?.layoutSchema?.cards || []\"\r\n class=\"card-layout-item\" [ngStyle]=\"\r\n layout?.type === 'HorizontalLayout'\r\n ? {}\r\n : getStyleWithoutClasses(layout?.style).style\r\n \" [class]=\"\r\n layout?.type === 'HorizontalLayout'\r\n ? ''\r\n : getStyleWithoutClasses(layout?.style).classes\r\n \">\r\n @if (!layout?.scope?.reference && layout?.type === 'HorizontalLayout') {\r\n <div class=\"card-horizontal-layout\"\r\n [class]=\"getStyleWithoutClasses(layout?.style).classes\"\r\n [ngStyle]=\"getHorizontalLayoutStyle(layout)\">\r\n <ng-container *ngFor=\"let innerLayout of layout.elements\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cardElement; context: { element: innerLayout, record: record, inner: true }\">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n } @else {\r\n <ng-container\r\n *ngTemplateOutlet=\"cardElement; context: { element: layout, record: record, inner: false }\">\r\n </ng-container>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"itemInfo?.footer?.elements && itemInfo?.data && itemInfo?.data.length\"\r\n [class]=\"getStyleWithoutClasses(itemInfo?.footer?.style).classes\">\r\n <span\r\n *ngFor=\"let element of itemInfo.footer?.elements; let c = index\">\r\n <ng-container\r\n [ngSwitch]=\"renderFieldType(element.scope?.reference && itemInfo.propertySchema[getScope(element.scope?.reference)] ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.type : 'default')\">\r\n\r\n <!-- Date control -->\r\n <div *ngSwitchCase=\"'date'\" class=\"form-group mb-3\">\r\n <span *ngIf=\"element.option.protected\"\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">\r\n <h5>{{\r\n itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.caption\r\n }}\r\n </h5>\r\n </span>\r\n <div *ngIf=\"!element.option.protected\">\r\n <div\r\n [class]=\"element?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">{{\r\n element.label?.value\r\n ?\r\n element.label?.value :\r\n element.label?.caption ?\r\n element.label?.caption :\r\n itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.caption\r\n }}</label>\r\n\r\n <nz-date-picker\r\n [required]=\"element.option.required\"\r\n [name]=\"element.scope?.reference\"\r\n [nzDisabled]=\"element?.option?.disabled\"\r\n (ngModelChange)=\"dateChangeEvent(element, $event)\"\r\n [nzFormat]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.format ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.format : 'yyyy-MM-dd'\"\r\n [(ngModel)]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()].value\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"></nz-date-picker>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <!-- Button Control -->\r\n <div *ngSwitchCase=\"'default'\"\r\n [class]=\"element.option?.visible ? 'row' : 'hidden'\"\r\n (click)=\"invokeOnCardFooter(element)\">\r\n <button nz-button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [style]=\"getStyleWithoutClasses(element.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element.style).classes\">\r\n <ng-container\r\n *ngIf=\"!element.caption; else textContent\">\r\n <i nz-icon [nzType]=\"element.icon\"\r\n nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #textContent>\r\n {{ element.caption }}\r\n </ng-template>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </span>\r\n </div>\r\n <!-- bottom pagination on card -->\r\n <div *ngIf=\"\r\n itemInfo?.data?.length && \r\n itemInfo?.layoutSchema?.pagination?.visible &&\r\n !itemInfo?.layoutSchema?.pagination?.top &&\r\n !scrollPagination\r\n \" class=\"card-pagination-wrapper\">\r\n <vl-pagination [itemInfo]=\"itemInfo\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n </div>\r\n\r\n @if (scrollPagination) {\r\n <div #scrollPaginationSentinel class=\"scroll-pagination-sentinel\"\r\n aria-hidden=\"true\">\r\n </div>\r\n }\r\n</div>\r\n<!-- one element of a card: a field shows the record's value through the shared <vl-control> in display\r\n mode; an element without a property is a button. A field the layout does not mark visible is hidden -->\r\n<ng-template #cardElement let-element=\"element\" let-record=\"record\" let-inner=\"inner\">\r\n @if (element?.scope?.reference) {\r\n <div [ngClass]=\"[element?.option?.visible ? 'card-field-wrapper' : 'hidden', inner ? getStyleWithoutClasses(element?.style).classes : '']\"\r\n [ngStyle]=\"inner ? getStyleWithoutClasses(element?.style).style : {}\">\r\n <vl-control mode=\"display\" [field]=\"element\" [record]=\"record\"\r\n [propertySchema]=\"itemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [list]=\"remoteData[element.scope.reference]\"\r\n (linkClicked)=\"showLinkDetails(element.option, record)\"\r\n (mediaClicked)=\"showImageDetails(element.option, record)\">\r\n </vl-control>\r\n </div>\r\n } @else if (inner) {\r\n <div>\r\n <button nz-button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [matTooltip]=\"getHorizontalLayoutTooltip(element)\"\r\n [matTooltipTouchGestures]=\"'auto'\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"\r\n [class]=\"element.option?.visible ? element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element?.style).classes : 'hidden'\"\r\n (click)=\"invokeButtonClick(element, record, getRecordIndex(record))\">\r\n <span class=\"schema-btn-content\">\r\n <i *ngIf=\"showButtonIcon(element)\" nz-icon [nzType]=\"element.icon\" nzTheme=\"outline\"></i>\r\n <span *ngIf=\"showButtonCaption(element)\">{{ element.caption }}</span>\r\n <span *ngIf=\"!showButtonIcon(element) && !showButtonCaption(element)\">Button</span>\r\n </span>\r\n </button>\r\n </div>\r\n } @else {\r\n <div [class]=\"element.option?.visible ? 'row' : 'hidden'\">\r\n <button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element?.style).classes\"\r\n (click)=\"invokeButtonClick(element, record, getRecordIndex(record))\">\r\n <ng-container *ngIf=\"!element.caption; else textContent\">\r\n <i nz-icon [nzType]=\"element.icon\" nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #textContent>{{ element.caption }}</ng-template>\r\n </button>\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block;width:100%;min-width:0}.vl-card-runtime{min-width:0;box-sizing:border-box}.card-responsive-grid{width:100%;min-width:0;box-sizing:border-box}.scroll-pagination-sentinel{width:100%;height:1px}.card-grid-item,.card-layout-item,.card-horizontal-layout,.card-field-wrapper{width:100%;min-width:0;box-sizing:border-box}.card-field-wrapper{overflow-wrap:anywhere}.card-field-wrapper p,.card-field-wrapper h3{margin:0;min-width:0}.card-layout-item img{display:block;max-width:100%;height:auto}.card-layout-item button{max-width:100%;box-sizing:border-box}.schema-btn-content{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0}.hidden{display:none!important}.card-pagination-wrapper{width:100%;min-width:0;box-sizing:border-box;padding:0 10px}\n"] }]
|
|
7686
|
+
], standalone: true, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - change: caption and date pattern from the layout - a data object holds names and types only -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21\r\n - change: the loader also shows while the page's PageData loads or sends (A4)\r\n - fix: a grid page draws no card area - an empty gap stood between filter fields and table -->\r\n<!-- Shuaib 2026-10-20\r\n - change: the card's fields (top level and in a horizontal layout) show the record's value through the\r\n shared <vl-control> in display mode instead of four switch blocks over types and controls (#166)\r\n - change: every field shows its value read only - a combobox, autocomplete or drop-down in a card was\r\n an input writing into the property schema; a text, date or time that was not locked showed only\r\n its label; an autocomplete showed only with a currency format; the period showed nothing\r\n - change: the value is styled by scope.style only (it was on the wrapper and on the value) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: locked fields through the read-only building blocks (password as dots, radio text, the\r\n record's tick), numbers with their label (#166, tests F8-F11)\r\n - fix: a text field (textInput) that is not locked shows its value; only the label showed (#166)\r\n - new: a value with date and time is shown with its time (cardDateKind) (#166 E5)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the date filter is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - new: spinner/slider shown with vl-number instead of \"not Implemented yet\" (#166 step 4.4)\r\n - new: radiobutton shown with vl-radio (caption of the chosen value) (#166 step 4.4)\r\n - new: switch shown with vl-switch (locked, caption) instead of \"not supported\" (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea shown with vl-textarea (line breaks kept) instead of \"not supported\" (#166 step 4.4)\r\n - new: password shown with vl-password (dots, eye) instead of \"not supported\" (#166 step 4.4)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the bottom pagination read itemInfo?.data.length; before the records arrive data is\r\n undefined, the template threw and the cards stayed half drawn (luv2shop start page: one\r\n card without texts)\r\n - fix: the price fields read ...?.format.currency; a property without format threw the same\r\n way (luv2shop: no prices, cards cut off) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: the date filter uses the shared picker markup (picker-field, DateTimePickerService) -->\r\n\r\n<!-- shuaib 2026-09-24\r\n - change: card field switches use renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment naming the types this container does not render. It carries four\r\n ngSwitch blocks, so the gap belongs to the container and not to one of them -->\r\n\r\n<!-- @contract the card's fields are drawn by <vl-control mode=\"display\"> (controls/control.ts): every\r\n type shows the record's value read only, the period (dateRange) included. Header and footer keep\r\n their own blocks (date filter, buttons). -->\r\n\r\n<!-- Loader Spinner -->\r\n\r\n<div *ngIf=\"isLoading || pageData?.loading\" class=\"loader-overlay\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n<div class=\"vl-card-runtime\">\r\n <!-- top pagination on card -->\r\n <div *ngIf=\"\r\n itemInfo?.layoutSchema?.pagination?.visible &&\r\n itemInfo?.layoutSchema?.pagination?.top\r\n \" class=\"card-pagination-wrapper\">\r\n <vl-pagination [itemInfo]=\"itemInfo\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\" [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n </div>\r\n <div *ngIf=\"itemInfo?.header?.elements?.length\" [ngStyle]=\"getHeaderStyle()\"\r\n [class]=\"getStyleWithoutClasses(\r\n itemInfo?.header?.style\r\n ).classes\">\r\n <div *ngFor=\"let element of itemInfo.header?.elements; let c = index\"\r\n [attr.data-vl-field]=\"vlFieldKey(element)\"\r\n [ngStyle]=\"getHeaderElementWrapperStyle(element)\"\r\n [class]=\"element.option?.innerAction && element.option?.innerAction === 'saveAll' && !displayedRecords?.length ? \r\n 'hidden' :getStyleWithoutClasses(element?.wrapperStyle).classes\">\r\n <ng-container\r\n [ngSwitch]=\"renderFieldType(element.scope?.reference && itemInfo.propertySchema[getScope(element.scope?.reference)] ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.type : 'default')\">\r\n\r\n <!-- String Control -->\r\n <div *ngSwitchCase=\"'string'\"\r\n [class]=\"element.option?.visible ? 'card-field-wrapper' : 'hidden'\">\r\n\r\n <!-- LABEL -->\r\n <span *ngIf=\"element.label?.caption\"\r\n [style]=\"getStyleWithoutClasses(element.label?.style).style\"\r\n [class]=\"element.label?.style?.classes?.[0]\">\r\n {{ element.label.caption }}\r\n </span>\r\n </div>\r\n\r\n <!-- Date control -->\r\n <div *ngSwitchCase=\"'date'\" class=\"mb-3\">\r\n <span *ngIf=\"element.option.protected\"\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">\r\n <vl-string [formField]=\"element\"\r\n [modalItemInfo]=\"itemInfo\">\r\n </vl-string>\r\n </span>\r\n <div *ngIf=\"!element.option.protected\"\r\n [class]=\"element?.layout == 'horizontal' ? 'horizontal-layout' : ''\"\r\n [ngClass]=\"element?.style?.classes[0]\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">{{\r\n element.label?.value\r\n ?\r\n element.label?.value : element.label?.caption ?\r\n element.label?.caption :\r\n (element.label?.value || element.label?.caption || '')\r\n }}</label>\r\n <vl-datetime kind=\"date\" [field]=\"element\" [target]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]\"\r\n [keyboard]=\"keyboardTypeFor(element, itemInfo.propertySchema)\"\r\n [inputClass]=\"element?.scope?.style?.classes?.[0] || ''\" [inputStyle]=\"getStyleWithoutClasses(element?.scope?.style).style\"\r\n (changed)=\"dateChangeEvent(element, $event)\"></vl-datetime>\r\n </div>\r\n </div>\r\n\r\n <!-- Button Control -->\r\n <div *ngSwitchCase=\"'default'\"\r\n [class]=\"element.option?.visible ? 'row' : 'hidden'\"\r\n (click)=\"invokeOnCardHeader(element)\">\r\n <button nz-button type=\"button\" [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [matTooltip]=\"element?.option?.tooltip || ''\"\r\n [matTooltipTouchGestures]=\"'auto'\"\r\n [ngStyle]=\"getStyleWithoutClasses(element.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element.style).classes\">\r\n <ng-container\r\n *ngIf=\"!element.caption; else headerTextContent\">\r\n <i nz-icon [nzType]=\"element.icon\"\r\n nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #headerTextContent>{{ element.caption\r\n }}</ng-template>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <!-- a grid page (container grid): the card draws only the header, the app shows vl-grid below (A4) -->\r\n <div *ngIf=\"itemInfo?.layoutSchema?.container !== 'grid'\" class=\"card-responsive-grid\" [ngStyle]=\"getCardContainerStyle()\"\r\n [class]=\"getStyleWithoutClasses(\r\n itemInfo?.layoutSchema?.style\r\n ).classes\">\r\n <div *ngFor=\"let record of displayedRecords; let k = index\"\r\n class=\"card-grid-item\" [attr.data-vl-record]=\"k\">\r\n <div [ngStyle]=\"getSingleCardStyle()\"\r\n [class]=\"getStyleWithoutClasses(itemInfo?.layoutSchema?.stylePerCard).classes\">\r\n <div *ngFor=\"let layout of itemInfo?.layoutSchema?.cards || []\"\r\n class=\"card-layout-item\" [ngStyle]=\"\r\n layout?.type === 'HorizontalLayout'\r\n ? {}\r\n : getStyleWithoutClasses(layout?.style).style\r\n \" [class]=\"\r\n layout?.type === 'HorizontalLayout'\r\n ? ''\r\n : getStyleWithoutClasses(layout?.style).classes\r\n \">\r\n @if (!layout?.scope?.reference && layout?.type === 'HorizontalLayout') {\r\n <div class=\"card-horizontal-layout\"\r\n [class]=\"getStyleWithoutClasses(layout?.style).classes\"\r\n [ngStyle]=\"getHorizontalLayoutStyle(layout)\">\r\n <ng-container *ngFor=\"let innerLayout of layout.elements\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cardElement; context: { element: innerLayout, record: record, inner: true }\">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n } @else {\r\n <ng-container\r\n *ngTemplateOutlet=\"cardElement; context: { element: layout, record: record, inner: false }\">\r\n </ng-container>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"itemInfo?.footer?.elements && itemInfo?.data && itemInfo?.data.length\"\r\n [class]=\"getStyleWithoutClasses(itemInfo?.footer?.style).classes\">\r\n <span\r\n *ngFor=\"let element of itemInfo.footer?.elements; let c = index\">\r\n <ng-container\r\n [ngSwitch]=\"renderFieldType(element.scope?.reference && itemInfo.propertySchema[getScope(element.scope?.reference)] ? itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()]?.type : 'default')\">\r\n\r\n <!-- Date control -->\r\n <div *ngSwitchCase=\"'date'\" class=\"form-group mb-3\">\r\n <span *ngIf=\"element.option.protected\"\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">\r\n <h5>{{\r\n (element.label?.value || element.label?.caption || '')\r\n }}\r\n </h5>\r\n </span>\r\n <div *ngIf=\"!element.option.protected\">\r\n <div\r\n [class]=\"element?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(element?.label?.style).style\"\r\n [class]=\"element?.label?.style?.classes[0]\">{{\r\n element.label?.value\r\n ?\r\n element.label?.value :\r\n element.label?.caption ?\r\n element.label?.caption :\r\n (element.label?.value || element.label?.caption || '')\r\n }}</label>\r\n\r\n <nz-date-picker\r\n [required]=\"element.option.required\"\r\n [name]=\"element.scope?.reference\"\r\n [nzDisabled]=\"element?.option?.disabled\"\r\n (ngModelChange)=\"dateChangeEvent(element, $event)\"\r\n [nzFormat]=\"(element.option?.customDisplayFormat || 'yyyy-MM-dd')\"\r\n [(ngModel)]=\"itemInfo.propertySchema[getScope(element.scope?.reference)][element.scope?.reference.split('/').pop()].value\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"></nz-date-picker>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <!-- Button Control -->\r\n <div *ngSwitchCase=\"'default'\"\r\n [class]=\"element.option?.visible ? 'row' : 'hidden'\"\r\n (click)=\"invokeOnCardFooter(element)\">\r\n <button nz-button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [style]=\"getStyleWithoutClasses(element.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element.style).classes\">\r\n <ng-container\r\n *ngIf=\"!element.caption; else textContent\">\r\n <i nz-icon [nzType]=\"element.icon\"\r\n nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #textContent>\r\n {{ element.caption }}\r\n </ng-template>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </span>\r\n </div>\r\n <!-- bottom pagination on card -->\r\n <div *ngIf=\"\r\n itemInfo?.data?.length && \r\n itemInfo?.layoutSchema?.pagination?.visible &&\r\n !itemInfo?.layoutSchema?.pagination?.top &&\r\n !scrollPagination\r\n \" class=\"card-pagination-wrapper\">\r\n <vl-pagination [itemInfo]=\"itemInfo\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n </div>\r\n\r\n @if (scrollPagination) {\r\n <div #scrollPaginationSentinel class=\"scroll-pagination-sentinel\"\r\n aria-hidden=\"true\">\r\n </div>\r\n }\r\n</div>\r\n<!-- one element of a card: a field shows the record's value through the shared <vl-control> in display\r\n mode; an element without a property is a button. A field the layout does not mark visible is hidden -->\r\n<ng-template #cardElement let-element=\"element\" let-record=\"record\" let-inner=\"inner\">\r\n @if (element?.scope?.reference) {\r\n <div [ngClass]=\"[element?.option?.visible ? 'card-field-wrapper' : 'hidden', inner ? getStyleWithoutClasses(element?.style).classes : '']\"\r\n [ngStyle]=\"inner ? getStyleWithoutClasses(element?.style).style : {}\">\r\n <vl-control mode=\"display\" [field]=\"element\" [record]=\"record\"\r\n [propertySchema]=\"itemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [list]=\"remoteData[element.scope.reference]\"\r\n (linkClicked)=\"showLinkDetails(element.option, record)\"\r\n (mediaClicked)=\"showImageDetails(element.option, record)\">\r\n </vl-control>\r\n </div>\r\n } @else if (inner) {\r\n <div>\r\n <button nz-button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [matTooltip]=\"getHorizontalLayoutTooltip(element)\"\r\n [matTooltipTouchGestures]=\"'auto'\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"\r\n [class]=\"element.option?.visible ? element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element?.style).classes : 'hidden'\"\r\n (click)=\"invokeButtonClick(element, record, getRecordIndex(record))\">\r\n <span class=\"schema-btn-content\">\r\n <i *ngIf=\"showButtonIcon(element)\" nz-icon [nzType]=\"element.icon\" nzTheme=\"outline\"></i>\r\n <span *ngIf=\"showButtonCaption(element)\">{{ element.caption }}</span>\r\n <span *ngIf=\"!showButtonIcon(element) && !showButtonCaption(element)\">Button</span>\r\n </span>\r\n </button>\r\n </div>\r\n } @else {\r\n <div [class]=\"element.option?.visible ? 'row' : 'hidden'\">\r\n <button [attr.data-vl-action]=\"vlAction(element?.option)\" [attr.data-vl-writes]=\"vlWrites(element?.option)\"\r\n [style]=\"getStyleWithoutClasses(element?.style).style\"\r\n [class]=\"element.option.protected ? 'disabled-button' : getStyleWithoutClasses(element?.style).classes\"\r\n (click)=\"invokeButtonClick(element, record, getRecordIndex(record))\">\r\n <ng-container *ngIf=\"!element.caption; else textContent\">\r\n <i nz-icon [nzType]=\"element.icon\" nzTheme=\"outline\"></i>\r\n </ng-container>\r\n <ng-template #textContent>{{ element.caption }}</ng-template>\r\n </button>\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block;width:100%;min-width:0}.vl-card-runtime{min-width:0;box-sizing:border-box}.card-responsive-grid{width:100%;min-width:0;box-sizing:border-box}.scroll-pagination-sentinel{width:100%;height:1px}.card-grid-item,.card-layout-item,.card-horizontal-layout,.card-field-wrapper{width:100%;min-width:0;box-sizing:border-box}.card-grid-item>div{margin-left:auto;margin-right:auto}.card-field-wrapper{overflow-wrap:anywhere}.card-field-wrapper p,.card-field-wrapper h3{margin:0;min-width:0}.card-layout-item img{display:block;max-width:100%;height:auto}.card-layout-item button{max-width:100%;box-sizing:border-box}.schema-btn-content{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0}.hidden{display:none!important}.card-pagination-wrapper{width:100%;min-width:0;box-sizing:border-box;padding:0 10px}\n"] }]
|
|
7589
7687
|
}], ctorParameters: () => [{ type: UtilityService }, { type: i1$2.Platform }, { type: i1$1.HttpClient }, { type: ConfigService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i5.NzModalService }, { type: NotificationService }, { type: i7.OAuthService }, { type: RequestService }], propDecorators: { itemInfo: [{
|
|
7590
7688
|
type: Input
|
|
7689
|
+
}], pageData: [{
|
|
7690
|
+
type: Input
|
|
7591
7691
|
}], currentPage: [{
|
|
7592
7692
|
type: Input
|
|
7593
7693
|
}], pageSize: [{
|
|
@@ -7616,8 +7716,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
7616
7716
|
type: Input
|
|
7617
7717
|
}], paginationLoading: [{
|
|
7618
7718
|
type: Input
|
|
7619
|
-
}], cardDataChange: [{
|
|
7620
|
-
type: Output
|
|
7621
7719
|
}], scrollPaginationSentinel: [{
|
|
7622
7720
|
type: ViewChild,
|
|
7623
7721
|
args: ['scrollPaginationSentinel']
|
|
@@ -7650,6 +7748,162 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
7650
7748
|
}]
|
|
7651
7749
|
}] });
|
|
7652
7750
|
|
|
7751
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
7752
|
+
// - new: tabletGridSpan - a section's width on a tablet (768-1023px); without it the desktop width counts
|
|
7753
|
+
// - new: the layout of a form's sections (user decision 2026-10-24, checkout): gridSpan - a section is 1..12 of the
|
|
7754
|
+
// form's 12 columns wide (sections side by side; on a phone one under the other), sticky - the section stays in
|
|
7755
|
+
// view while the others scroll, visibleWhen { field, value } - the section is shown only while that field holds
|
|
7756
|
+
// the value (a hidden section's fields do not count for the form)
|
|
7757
|
+
/** How many of the form's 12 columns a section takes: gridSpan 1..12, else the whole width. */
|
|
7758
|
+
function sectionSpan(section) {
|
|
7759
|
+
const span = Number(section?.gridSpan);
|
|
7760
|
+
return Number.isInteger(span) && span >= 1 && span <= 12 ? span : 12;
|
|
7761
|
+
}
|
|
7762
|
+
/** A section's width on a tablet (768-1023px): tabletGridSpan 1..12, else its desktop width. */
|
|
7763
|
+
function sectionTabletSpan(section) {
|
|
7764
|
+
const span = Number(section?.tabletGridSpan);
|
|
7765
|
+
return Number.isInteger(span) && span >= 1 && span <= 12 ? span : sectionSpan(section);
|
|
7766
|
+
}
|
|
7767
|
+
/** A section that stays in view while the page scrolls (sticky true). */
|
|
7768
|
+
function sectionSticky(section) {
|
|
7769
|
+
return section?.sticky === true;
|
|
7770
|
+
}
|
|
7771
|
+
/** true / "true" / "Y" / 1 … count as on - a check box keeps its value as boolean or as text flag. */
|
|
7772
|
+
function isOn(value) {
|
|
7773
|
+
if (typeof value === 'string')
|
|
7774
|
+
return ['true', 'y', 'yes', '1', 'on'].includes(value.trim().toLowerCase());
|
|
7775
|
+
return value === true || value === 1;
|
|
7776
|
+
}
|
|
7777
|
+
/**
|
|
7778
|
+
* Whether a section is shown: without visibleWhen always; with it only while the field (scope reference
|
|
7779
|
+
* "#/<object>/properties/<name>") holds the value. A true/false condition compares on/off, so a check box
|
|
7780
|
+
* kept as "Y"/"N" counts too; an empty field equals false.
|
|
7781
|
+
*/
|
|
7782
|
+
function sectionVisible(section, propertySchema) {
|
|
7783
|
+
const condition = section?.visibleWhen;
|
|
7784
|
+
if (!condition || typeof condition !== 'object' || typeof condition.field !== 'string')
|
|
7785
|
+
return true;
|
|
7786
|
+
const parts = condition.field.replace(/^#\//, '').split('/');
|
|
7787
|
+
const group = parts[0];
|
|
7788
|
+
const name = parts[parts.length - 1];
|
|
7789
|
+
const value = propertySchema?.[group]?.[name]?.value;
|
|
7790
|
+
if (typeof condition.value === 'boolean')
|
|
7791
|
+
return isOn(value) === condition.value;
|
|
7792
|
+
return String(value ?? '') === String(condition.value ?? '');
|
|
7793
|
+
}
|
|
7794
|
+
|
|
7795
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
7796
|
+
// - new: a button of a form or dialog is locked (grey, no click) by its layout - option.needsLogin while
|
|
7797
|
+
// nobody is signed in, option.needsValid while a field breaks a rule of its layout (#166, purchase)
|
|
7798
|
+
// - new: isSignedIn - the one check whether someone is signed in (was in the side menu only)
|
|
7799
|
+
// - change: isSignedIn - a token with an expiry (JWT exp) decides: all expired = signed out (an expired Okta token
|
|
7800
|
+
// kept the button free while the menu showed signed out)
|
|
7801
|
+
// - new: lockReasons - every reason at once (sign-in AND fields), LockHint - a hint (the missing fields are no longer
|
|
7802
|
+
// listed under the button)
|
|
7803
|
+
// - new: lockReason / lockHint - why a button is locked and the layout's hint for it (option.needsLoginHint /
|
|
7804
|
+
// needsValidHint { caption } - a caption, so the language editor takes it like every other); the grey button stays clickable and shows what is missing
|
|
7805
|
+
// - change: isSignedIn counts any key with a real value, not a fixed list - a login with user and password
|
|
7806
|
+
// answers in any shape ({ jwt }, { accessToken }, { userId })
|
|
7807
|
+
/**
|
|
7808
|
+
* Signed in only with a real value: the app sets { authToken: undefined } for Okta before any sign-in,
|
|
7809
|
+
* so an object with keys is not enough. Any key counts, so a login of any backend works
|
|
7810
|
+
* ({ jwt }, { accessToken }, { userId }, Keycloak, OAuth2): a non-empty text, a number, or an object
|
|
7811
|
+
* or list holding such a value; true / false say nothing about a user.
|
|
7812
|
+
*/
|
|
7813
|
+
function isSignedIn(userInfo, now = Date.now()) {
|
|
7814
|
+
// a token with an expiry (JWT exp: Okta, Keycloak, a JWT sign-in) decides: all expired = signed out, even with
|
|
7815
|
+
// a name or e-mail beside it - the menu shows signed out then, and an order must not go out with it
|
|
7816
|
+
const expiries = [];
|
|
7817
|
+
collectExpiries(userInfo, 0, expiries);
|
|
7818
|
+
if (expiries.length)
|
|
7819
|
+
return expiries.some(exp => exp * 1000 > now);
|
|
7820
|
+
return realValue(userInfo, 0);
|
|
7821
|
+
}
|
|
7822
|
+
/** The exp (seconds) of every JWT in the sign-in answer. */
|
|
7823
|
+
function collectExpiries(value, depth, out) {
|
|
7824
|
+
if (typeof value === 'string') {
|
|
7825
|
+
const exp = jwtExpiry(value);
|
|
7826
|
+
if (exp !== null)
|
|
7827
|
+
out.push(exp);
|
|
7828
|
+
return;
|
|
7829
|
+
}
|
|
7830
|
+
if (!value || typeof value !== 'object' || depth > 3)
|
|
7831
|
+
return;
|
|
7832
|
+
for (const inner of Object.values(value))
|
|
7833
|
+
collectExpiries(inner, depth + 1, out);
|
|
7834
|
+
}
|
|
7835
|
+
/** A JWT's exp in seconds, null when the text is no JWT or has no exp. */
|
|
7836
|
+
function jwtExpiry(text) {
|
|
7837
|
+
const parts = text.trim().split('.');
|
|
7838
|
+
if (parts.length !== 3 || parts[1].length < 4)
|
|
7839
|
+
return null;
|
|
7840
|
+
try {
|
|
7841
|
+
const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/');
|
|
7842
|
+
const payload = JSON.parse(atob(base64 + '='.repeat((4 - base64.length % 4) % 4)));
|
|
7843
|
+
return typeof payload?.exp === 'number' ? payload.exp : null;
|
|
7844
|
+
}
|
|
7845
|
+
catch {
|
|
7846
|
+
return null;
|
|
7847
|
+
}
|
|
7848
|
+
}
|
|
7849
|
+
function realValue(value, depth) {
|
|
7850
|
+
if (typeof value === 'string')
|
|
7851
|
+
return value.trim() !== '';
|
|
7852
|
+
if (typeof value === 'number')
|
|
7853
|
+
return Number.isFinite(value);
|
|
7854
|
+
if (!value || typeof value !== 'object' || depth > 3)
|
|
7855
|
+
return false;
|
|
7856
|
+
return Object.values(value).some(inner => realValue(inner, depth + 1));
|
|
7857
|
+
}
|
|
7858
|
+
/** Why a button is locked: needsLogin without a signed-in user first, then needsValid with a broken rule. */
|
|
7859
|
+
function lockReason(option, state) {
|
|
7860
|
+
if (option?.needsLogin === true && !state.signedIn)
|
|
7861
|
+
return 'login';
|
|
7862
|
+
if (option?.needsValid === true && !state.valid)
|
|
7863
|
+
return 'valid';
|
|
7864
|
+
return null;
|
|
7865
|
+
}
|
|
7866
|
+
/** Every reason a button is locked, the sign-in first: both show their hint under the button. */
|
|
7867
|
+
function lockReasons(option, state) {
|
|
7868
|
+
const reasons = [];
|
|
7869
|
+
if (option?.needsLogin === true && !state.signedIn)
|
|
7870
|
+
reasons.push('login');
|
|
7871
|
+
if (option?.needsValid === true && !state.valid)
|
|
7872
|
+
reasons.push('valid');
|
|
7873
|
+
return reasons;
|
|
7874
|
+
}
|
|
7875
|
+
/** Whether a button is locked: needsLogin without a signed-in user, needsValid with a broken rule. */
|
|
7876
|
+
function buttonLocked(option, state) {
|
|
7877
|
+
return lockReason(option, state) !== null;
|
|
7878
|
+
}
|
|
7879
|
+
/**
|
|
7880
|
+
* The hint under a locked button: the layout's caption for the reason (option.needsLoginHint.caption /
|
|
7881
|
+
* needsValidHint.caption), in the app's language when the language file has it (the caption is its key).
|
|
7882
|
+
* Empty when the layout gives none.
|
|
7883
|
+
*/
|
|
7884
|
+
function lockHint(option, reason, translations) {
|
|
7885
|
+
const text = reason === 'login' ? option?.needsLoginHint?.caption : reason === 'valid' ? option?.needsValidHint?.caption : '';
|
|
7886
|
+
if (typeof text !== 'string' || !text.trim())
|
|
7887
|
+
return '';
|
|
7888
|
+
return translations?.[text.trim()] || text.trim();
|
|
7889
|
+
}
|
|
7890
|
+
|
|
7891
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
7892
|
+
// - new: sectionTabletSpanOf / stickyTabletSpan - the widths on a tablet (tabletGridSpan)
|
|
7893
|
+
// - new: sectionSpanOf / sectionStickyOf / sectionShown - the layout of the sections (field/section-layout.ts)
|
|
7894
|
+
// - change: no list of the missing fields under the button any more (missingFields only decides needsValid)
|
|
7895
|
+
// - change: lockHintsOf - every reason under the button, missingFields named and clickable (goToField); a click
|
|
7896
|
+
// on the locked button no longer jumps to the first field
|
|
7897
|
+
// - new: lockReasonOf / lockHintOf / showMissing - the hint under a locked button, a click on it shows the
|
|
7898
|
+
// missing fields; signIn - its hint asks the app to start the sign-in
|
|
7899
|
+
// - change: isLocked - a required card field without a whole card counts as a broken rule (needsValid)
|
|
7900
|
+
// - new: userInfo and isLocked - a button is grey and without click by needsLogin / needsValid of its layout
|
|
7901
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
7902
|
+
// - change: a data object holds names and types only - a message names a field without label by its property name
|
|
7903
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
7904
|
+
// - fix: the language pass runs only when the language or the form changes and keeps the entered values -
|
|
7905
|
+
// it ran on every input change and put the empty copy of the opening back (checkout lost all entries
|
|
7906
|
+
// on Purchase or a card error)
|
|
7653
7907
|
// Shuaib 2026-10-20
|
|
7654
7908
|
// - change: the fields are drawn by the shared <vl-control> (controls/control.ts) like the dialog's;
|
|
7655
7909
|
// the template helpers it replaces are gone (renderFieldType, getLabel, keyboardTypeFor,
|
|
@@ -7750,6 +8004,7 @@ class FormComponent {
|
|
|
7750
8004
|
/** Date and time picker behaviour shared by all containers. */
|
|
7751
8005
|
picker = inject(DateTimePickerService);
|
|
7752
8006
|
host = inject((ElementRef));
|
|
8007
|
+
utility = inject(UtilityService);
|
|
7753
8008
|
ngOnDestroy() {
|
|
7754
8009
|
this.picker.closeIfWithin(this.host.nativeElement);
|
|
7755
8010
|
}
|
|
@@ -7760,8 +8015,12 @@ class FormComponent {
|
|
|
7760
8015
|
creditCardError = {};
|
|
7761
8016
|
form = {};
|
|
7762
8017
|
selectedLanguageInfo = {};
|
|
8018
|
+
/** the signed-in user, for needsLogin on a button */
|
|
8019
|
+
userInfo = null;
|
|
7763
8020
|
formButtonClick = new EventEmitter();
|
|
7764
8021
|
checkBoxChangeEvent = new EventEmitter();
|
|
8022
|
+
/** the hint of a button locked for a missing sign-in was clicked: the app starts its sign-in */
|
|
8023
|
+
signIn = new EventEmitter();
|
|
7765
8024
|
ngOnInit() { }
|
|
7766
8025
|
ngOnChanges(changes) {
|
|
7767
8026
|
// Backend lists of fields with option.autocomplete (any data type, any control).
|
|
@@ -7772,7 +8031,9 @@ class FormComponent {
|
|
|
7772
8031
|
this.formCopy = this.safeClone(this.form);
|
|
7773
8032
|
// rules come only from the layout now (vlRules); setValidations read them from the data object
|
|
7774
8033
|
}
|
|
7775
|
-
|
|
8034
|
+
// only when the language or the form itself changes - every other input (an error of the card field,
|
|
8035
|
+
// the save attempt) ran it too and put the empty copy of the opening back: all entries were gone
|
|
8036
|
+
if ((changes['selectedLanguageInfo'] || changes['form']) &&
|
|
7776
8037
|
this.selectedLanguageInfo?.selectedLanguage) {
|
|
7777
8038
|
this.applySelectedLanguage();
|
|
7778
8039
|
}
|
|
@@ -7797,9 +8058,18 @@ class FormComponent {
|
|
|
7797
8058
|
return;
|
|
7798
8059
|
}
|
|
7799
8060
|
const selectedLanguage = this.selectedLanguageInfo.selectedLanguage;
|
|
8061
|
+
const entered = this.form.propertySchema || {};
|
|
7800
8062
|
this.form.propertySchema = this.formCopy.propertySchema
|
|
7801
8063
|
? this.safeClone(this.formCopy.propertySchema)
|
|
7802
8064
|
: {};
|
|
8065
|
+
// the texts come from the untranslated copy, the values the user entered stay
|
|
8066
|
+
for (const [group, fields] of Object.entries(this.form.propertySchema)) {
|
|
8067
|
+
for (const [key, field] of Object.entries(fields || {})) {
|
|
8068
|
+
const current = entered?.[group]?.[key];
|
|
8069
|
+
if (field && typeof field === 'object' && current && 'value' in current)
|
|
8070
|
+
field.value = current.value;
|
|
8071
|
+
}
|
|
8072
|
+
}
|
|
7803
8073
|
this.form.propertySchema = this.translateSchema(this.form.propertySchema, selectedLanguage);
|
|
7804
8074
|
if (this.formCopy?.layoutSchema?.formSections?.length) {
|
|
7805
8075
|
this.formCopy.layoutSchema.formSections.forEach((formSection, sectionIndex) => {
|
|
@@ -7866,6 +8136,39 @@ class FormComponent {
|
|
|
7866
8136
|
style: styleWithoutClasses || {},
|
|
7867
8137
|
};
|
|
7868
8138
|
}
|
|
8139
|
+
/** A section's width in the form's 12 columns (layout gridSpan). */
|
|
8140
|
+
sectionSpanOf(formSection) {
|
|
8141
|
+
return sectionSpan(formSection);
|
|
8142
|
+
}
|
|
8143
|
+
/** A section's width on a tablet (layout tabletGridSpan, else gridSpan). */
|
|
8144
|
+
sectionTabletSpanOf(formSection) {
|
|
8145
|
+
return sectionTabletSpan(formSection);
|
|
8146
|
+
}
|
|
8147
|
+
/** The sticky column's width on a tablet: the widest of its sections; 12 puts it under the others there. */
|
|
8148
|
+
stickyTabletSpan() {
|
|
8149
|
+
const sticky = this.sectionsIn(true);
|
|
8150
|
+
const spans = sticky.map(s => s?.gridSpan || s?.tabletGridSpan ? sectionTabletSpan(s) : 0).filter(Boolean);
|
|
8151
|
+
return spans.length ? Math.max(...spans) : 4;
|
|
8152
|
+
}
|
|
8153
|
+
/** The sections that stay in view (true) or flow (false), in the order of the layout - the same list while the layout is the same. */
|
|
8154
|
+
sectionsIn(sticky) {
|
|
8155
|
+
const sections = this.form?.layoutSchema?.formSections;
|
|
8156
|
+
if (sections !== this.sectionSplit.of) {
|
|
8157
|
+
const list = Array.isArray(sections) ? sections : [];
|
|
8158
|
+
this.sectionSplit = { of: sections, flow: list.filter(s => !sectionSticky(s)), sticky: list.filter(s => sectionSticky(s)) };
|
|
8159
|
+
}
|
|
8160
|
+
return sticky ? this.sectionSplit.sticky : this.sectionSplit.flow;
|
|
8161
|
+
}
|
|
8162
|
+
sectionSplit = { of: undefined, flow: [], sticky: [] };
|
|
8163
|
+
/** The width of the sticky column: the widest of its sections (gridSpan), 4 when none says. */
|
|
8164
|
+
stickySpan() {
|
|
8165
|
+
const spans = this.sectionsIn(true).map(s => s?.gridSpan ? sectionSpan(s) : 0).filter(Boolean);
|
|
8166
|
+
return spans.length ? Math.max(...spans) : 4;
|
|
8167
|
+
}
|
|
8168
|
+
/** A section with visibleWhen is shown only while its field holds the value. */
|
|
8169
|
+
sectionShown(formSection) {
|
|
8170
|
+
return sectionVisible(formSection, this.form?.propertySchema);
|
|
8171
|
+
}
|
|
7869
8172
|
getSectionBodyStyle(formSection) {
|
|
7870
8173
|
const layout = formSection?.layout || {};
|
|
7871
8174
|
const schemaStyle = this.getStyleWithoutClasses(formSection?.style).style;
|
|
@@ -7903,6 +8206,68 @@ class FormComponent {
|
|
|
7903
8206
|
togglePasswordVisibility() {
|
|
7904
8207
|
this.showPassword = !this.showPassword;
|
|
7905
8208
|
}
|
|
8209
|
+
/** A button grey and without click: needsLogin without a user, needsValid with a broken field rule. */
|
|
8210
|
+
isLocked(formField, form) {
|
|
8211
|
+
return this.lockReasonOf(formField, form) !== null;
|
|
8212
|
+
}
|
|
8213
|
+
/** Why a button is locked: 'login' (needsLogin, nobody signed in) or 'valid' (needsValid, a field or the required card missing). */
|
|
8214
|
+
lockReasonOf(formField, form) {
|
|
8215
|
+
const valid = !!form && this.missingFields(form).length === 0;
|
|
8216
|
+
return lockReason(formField?.option, { signedIn: isSignedIn(this.userInfo), valid });
|
|
8217
|
+
}
|
|
8218
|
+
/** Under a locked button: one hint per reason (sign-in, fields), the layout's texts only. */
|
|
8219
|
+
lockHintsOf(formField, form) {
|
|
8220
|
+
const option = formField?.option;
|
|
8221
|
+
const valid = !!form && this.missingFields(form).length === 0;
|
|
8222
|
+
const translations = this.selectedLanguageInfo?.selectedLanguage;
|
|
8223
|
+
const hints = lockReasons(option, { signedIn: isSignedIn(this.userInfo), valid }).map(reason => ({
|
|
8224
|
+
reason,
|
|
8225
|
+
text: lockHint(option, reason, translations),
|
|
8226
|
+
}));
|
|
8227
|
+
// the same list again while nothing changed - a new one on every check would redraw (and trip NG0100)
|
|
8228
|
+
const key = vlLockKey(formField) + JSON.stringify(hints);
|
|
8229
|
+
const cached = this.lockHintCache.get(vlLockKey(formField));
|
|
8230
|
+
if (cached && cached.key === key)
|
|
8231
|
+
return cached.hints;
|
|
8232
|
+
this.lockHintCache.set(vlLockKey(formField), { key, hints });
|
|
8233
|
+
return hints;
|
|
8234
|
+
}
|
|
8235
|
+
lockHintCache = new Map();
|
|
8236
|
+
/**
|
|
8237
|
+
* The fields that keep a needsValid button locked, in the order of the page: a field whose control
|
|
8238
|
+
* breaks a rule, and a required card field without a whole card (named by its section). Only shown
|
|
8239
|
+
* sections count; none missing means the form is valid for needsValid.
|
|
8240
|
+
*/
|
|
8241
|
+
missingFields(form) {
|
|
8242
|
+
const translations = this.selectedLanguageInfo?.selectedLanguage || {};
|
|
8243
|
+
const cardMissing = this.utility.requiredCardMissing(this.form?.layoutSchema, this.form?.propertySchema);
|
|
8244
|
+
const fields = [];
|
|
8245
|
+
for (const section of this.form?.layoutSchema?.formSections || []) {
|
|
8246
|
+
// a hidden section (visibleWhen) does not count - Angular takes its fields off the form only later
|
|
8247
|
+
if (!this.sectionShown(section))
|
|
8248
|
+
continue;
|
|
8249
|
+
for (const field of visibleFields(section?.formFields)) {
|
|
8250
|
+
const reference = field?.scope?.reference;
|
|
8251
|
+
if (typeof reference !== 'string')
|
|
8252
|
+
continue;
|
|
8253
|
+
const control = form?.controls?.[reference];
|
|
8254
|
+
const card = cardMissing && field?.option?.required === true
|
|
8255
|
+
&& this.form?.propertySchema?.[this.utility.getScope(reference)]?.[reference.split('/').pop()]?.type === 'creditCard';
|
|
8256
|
+
if (!control?.invalid && !card)
|
|
8257
|
+
continue;
|
|
8258
|
+
const caption = field?.label?.caption || (card ? section?.label?.caption : '') || field?.option?.placeholder || reference.split('/').pop();
|
|
8259
|
+
fields.push({ key: card ? 'card' : (this.vlFieldKey(field) ?? reference), label: translations[caption] || caption });
|
|
8260
|
+
}
|
|
8261
|
+
}
|
|
8262
|
+
return fields;
|
|
8263
|
+
}
|
|
8264
|
+
/**
|
|
8265
|
+
* A click on a locked button: nothing is sent; every field shows its message. The page stays where it is.
|
|
8266
|
+
*/
|
|
8267
|
+
showMissing(form) {
|
|
8268
|
+
this.saveTried = true;
|
|
8269
|
+
form?.control?.markAllAsTouched();
|
|
8270
|
+
}
|
|
7906
8271
|
invokeFormBtnClick(option, propertySchema) {
|
|
7907
8272
|
this.saveTried = true;
|
|
7908
8273
|
this.formButtonClick.emit({
|
|
@@ -7934,8 +8299,8 @@ class FormComponent {
|
|
|
7934
8299
|
else {
|
|
7935
8300
|
const scope = this.getScope(formField?.scope?.reference);
|
|
7936
8301
|
const key = formField?.scope?.reference?.split('/').pop();
|
|
7937
|
-
|
|
7938
|
-
fieldName =
|
|
8302
|
+
// without a label the property's name (a data object holds names and types only)
|
|
8303
|
+
fieldName = scope ? key || '' : '';
|
|
7939
8304
|
}
|
|
7940
8305
|
if (error && error.toString().includes('{{requiredLength}}')) {
|
|
7941
8306
|
error = error.replace(/{{\s*requiredLength\s*}}/g, formField?.minlength?.toString() || '');
|
|
@@ -7990,11 +8355,11 @@ class FormComponent {
|
|
|
7990
8355
|
return !!control?.invalid && ((!!control.dirty && !!control.touched) || this.saveTried);
|
|
7991
8356
|
}
|
|
7992
8357
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7993
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: FormComponent, isStandalone: true, selector: "vl-form", inputs: { errorMessages: "errorMessages", creditCardError: "creditCardError", form: "form", selectedLanguageInfo: "selectedLanguageInfo" }, outputs: { formButtonClick: "formButtonClick", checkBoxChangeEvent: "checkBoxChangeEvent" }, usesOnChanges: true, ngImport: i0, template: "<!-- Shuaib 2026-10-20\r\n - change: every field is drawn by the shared <vl-control> (controls/control.ts) instead of the switch\r\n over types and controls in this template - the same building block as the dialog (#166)\r\n - change: scope.style is the input of every control (the drop-down took the field's style, check box\r\n and drop-down put scope.style around label and input); all classes of a style count\r\n - change: option.protected makes every control read only - check box, switch, radio, drop-down,\r\n password, text area, media were still editable; a protected field shows label and value -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: every field label by getLabel (label.value, the layout's label.caption, then the DTO caption) -\r\n numbers and the period showed no label; a text field's control dropdown/switch/checkbox is used (#166, tests F2-F4)\r\n - new: date and time in one field (type datetime or control dateTimepicker) with vl-datetime (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: numbers with vl-number (plain, spinner, slider) (#166 step 4.4)\r\n - change: the text field is the one vl-textbox (#166 step 4.4)\r\n - new: radiobutton with vl-radio (text and Boolean) (#166 step 4.4)\r\n - new: a Boolean with control switch uses vl-switch (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea with vl-textarea instead of a one-line field (#166 step 4.4)\r\n - change: password with vl-password, the same field and eye as in dialog and card (#166 step 4.4)\r\n - change: validation rules only from the layout (vlRules: required, email, min/max length, pattern,\r\n minimum/maximum), messages via fieldMessage; number fields checked too (#166 step 4.6)\r\n - change: fields/columns with option.visible false are left out (vlVisible, #166)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: date and time fields use the shared picker markup (picker-field, DateTimePickerService)\r\n instead of PrimeNG's own icon with empty handlers -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: the form field switch uses renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - change: the credit card type is spelled creditCard. The rename of 2026-09-15 reached\r\n model.component.html and the whole Designer but not this file, so one data object rendered\r\n in a modal and stayed empty here\r\n - new: a @contract comment on the type switch and on the credit card case, so the rule sits\r\n next to the code that implements it -->\r\n<div class=\"form-renderer\"\r\n [ngClass]=\"getStyleWithoutClasses(form?.layoutSchema?.style)?.classes\"\r\n [ngStyle]=\"getStyleWithoutClasses(form?.layoutSchema?.style)?.style\">\r\n <form *ngIf=\"form?.layoutSchema?.formSections?.length > 0\">\r\n <div\r\n *ngFor=\"let formSection of form?.layoutSchema?.formSections; let i = index\"\r\n class=\"section-card\">\r\n <div *ngIf=\"formSection?.label?.caption\" class=\"section-header\">\r\n <div class=\"section-title\"\r\n [ngClass]=\"getStyleWithoutClasses(formSection?.label?.style)?.classes\"\r\n [ngStyle]=\"getStyleWithoutClasses(formSection?.label?.style)?.style\">\r\n {{ formSection.label.caption }}\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"formSection?.formFields?.length > 0\" class=\"section-body\"\r\n [ngClass]=\"getStyleWithoutClasses(formSection?.style)?.classes\"\r\n [ngStyle]=\"getSectionBodyStyle(formSection)\">\r\n <!-- the field's style is its wrapper in the section grid; label, input and button are drawn by\r\n the shared <vl-control>. The button is a submit button, so Enter in a field presses it -->\r\n <div *ngFor=\"let formField of formSection.formFields | vlVisible\" class=\"field-row\"\r\n [attr.data-vl-field]=\"vlFieldKey(formField)\"\r\n [ngClass]=\"getStyleWithoutClasses(formField?.style)?.classes\"\r\n [ngStyle]=\"getFieldWrapperStyle(formField)\">\r\n <vl-control [field]=\"formField\"\r\n [propertySchema]=\"form.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"saveTried\"\r\n container=\"form\"\r\n buttonType=\"submit\"\r\n [list]=\"remoteData[formField.scope?.reference]\"\r\n [listLoading]=\"remoteLoading[formField.scope?.reference]\"\r\n [creditCardError]=\"creditCardError\"\r\n (toggled)=\"setformData()\"\r\n (buttonClick)=\"invokeFormBtnClick($event, form.propertySchema)\">\r\n </vl-control>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%;min-height:0}.form-renderer{width:100%;height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;padding:12px}.section-card{border:1px solid #e5e7eb;border-radius:var(--radius-sm, 8px);padding:12px;margin-bottom:12px;background:#fff;box-sizing:border-box}.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-weight:600}.section-title{font-size:14px;color:#0f172a}.section-body{position:relative;width:100%;min-height:78px;box-sizing:border-box}.field-row{position:relative;min-width:0;width:100%;box-sizing:border-box}.field-row input,.field-row select,.field-row nz-select,.field-row textarea,.field-row button{max-width:100%;box-sizing:border-box}@media(max-width:768px){.section-body{grid-template-columns:repeat(1,minmax(0,1fr))!important}.field-row{grid-column:span 1!important}}@media(min-width:769px)and (max-width:1024px){.section-body{grid-template-columns:repeat(6,minmax(0,1fr))!important}.field-row{grid-column:span 6!important}}:host-context(.mobile-frame) .section-body,:host-context(.device-mobile) .section-body{grid-template-columns:repeat(1,minmax(0,1fr))!important}:host-context(.mobile-frame) .field-row,:host-context(.device-mobile) .field-row{grid-column:span 1!important}:host-context(.tablet-frame) .section-body,:host-context(.device-tablet) .section-body{grid-template-columns:repeat(6,minmax(0,1fr))!important}:host-context(.tablet-frame) .field-row,:host-context(.device-tablet) .field-row{grid-column:span 6!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ControlComponent, selector: "vl-control", inputs: ["field", "propertySchema", "selectedLanguageInfo", "errorMessages", "saveTried", "container", "buttonType", "mode", "record", "hideLabel", "styleValue", "compact", "list", "listLoading", "creditCardError"], outputs: ["picked", "changed", "opened", "toggled", "linkClicked", "mediaClicked", "buttonClick"] }, { kind: "pipe", type: VisiblePipe, name: "vlVisible" }] });
|
|
8358
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: FormComponent, isStandalone: true, selector: "vl-form", inputs: { errorMessages: "errorMessages", creditCardError: "creditCardError", form: "form", selectedLanguageInfo: "selectedLanguageInfo", userInfo: "userInfo" }, outputs: { formButtonClick: "formButtonClick", checkBoxChangeEvent: "checkBoxChangeEvent", signIn: "signIn" }, usesOnChanges: true, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - new: sections side by side (gridSpan), the sticky ones as one column at the right, visibleWhen\r\n - change: lockHints (every reason, the missing fields as links), goToField; space under the last section\r\n - new: a locked button shows its hint, a click shows the missing fields (showMissing), the hint of a missing\r\n sign-in asks the app to sign in (signIn)\r\n - change: the wrapper of a locked button drops the layout's colour and shadow (field-row--locked) - the blue\r\n of the field style stayed around the grey button\r\n - new: a button is locked by needsLogin / needsValid of its layout (isLocked, field/button-lock.ts) -->\r\n<!-- Shuaib 2026-10-20\r\n - change: every field is drawn by the shared <vl-control> (controls/control.ts) instead of the switch\r\n over types and controls in this template - the same building block as the dialog (#166)\r\n - change: scope.style is the input of every control (the drop-down took the field's style, check box\r\n and drop-down put scope.style around label and input); all classes of a style count\r\n - change: option.protected makes every control read only - check box, switch, radio, drop-down,\r\n password, text area, media were still editable; a protected field shows label and value -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: every field label by getLabel (label.value, the layout's label.caption, then the DTO caption) -\r\n numbers and the period showed no label; a text field's control dropdown/switch/checkbox is used (#166, tests F2-F4)\r\n - new: date and time in one field (type datetime or control dateTimepicker) with vl-datetime (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: numbers with vl-number (plain, spinner, slider) (#166 step 4.4)\r\n - change: the text field is the one vl-textbox (#166 step 4.4)\r\n - new: radiobutton with vl-radio (text and Boolean) (#166 step 4.4)\r\n - new: a Boolean with control switch uses vl-switch (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea with vl-textarea instead of a one-line field (#166 step 4.4)\r\n - change: password with vl-password, the same field and eye as in dialog and card (#166 step 4.4)\r\n - change: validation rules only from the layout (vlRules: required, email, min/max length, pattern,\r\n minimum/maximum), messages via fieldMessage; number fields checked too (#166 step 4.6)\r\n - change: fields/columns with option.visible false are left out (vlVisible, #166)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: date and time fields use the shared picker markup (picker-field, DateTimePickerService)\r\n instead of PrimeNG's own icon with empty handlers -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: the form field switch uses renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - change: the credit card type is spelled creditCard. The rename of 2026-09-15 reached\r\n model.component.html and the whole Designer but not this file, so one data object rendered\r\n in a modal and stayed empty here\r\n - new: a @contract comment on the type switch and on the credit card case, so the rule sits\r\n next to the code that implements it -->\r\n<div class=\"form-renderer\"\r\n [ngClass]=\"getStyleWithoutClasses(form?.layoutSchema?.style)?.classes\"\r\n [ngStyle]=\"getStyleWithoutClasses(form?.layoutSchema?.style)?.style\">\r\n <form #formRef=\"ngForm\" *ngIf=\"form?.layoutSchema?.formSections?.length > 0\">\r\n <!-- the sections stand in the form's 12 columns, gridSpan wide; the sticky ones together form a column at the\r\n right that stays in view (on a phone it stands at the end); visibleWhen shows a section only while its\r\n field holds the value (a hidden section's fields do not count) -->\r\n <ng-template #sectionTpl let-formSection>\r\n <div class=\"section-card\" [style.--vl-section-span]=\"sectionSpanOf(formSection)\"\r\n [style.--vl-section-span-tablet]=\"sectionTabletSpanOf(formSection)\">\r\n <div *ngIf=\"formSection?.label?.caption\" class=\"section-header\">\r\n <div class=\"section-title\"\r\n [ngClass]=\"getStyleWithoutClasses(formSection?.label?.style)?.classes\"\r\n [ngStyle]=\"getStyleWithoutClasses(formSection?.label?.style)?.style\">\r\n {{ formSection.label.caption }}\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"formSection?.formFields?.length > 0\" class=\"section-body\"\r\n [ngClass]=\"getStyleWithoutClasses(formSection?.style)?.classes\"\r\n [ngStyle]=\"getSectionBodyStyle(formSection)\">\r\n <!-- the field's style is its wrapper in the section grid; label, input and button are drawn by\r\n the shared <vl-control>. The button is a submit button, so Enter in a field presses it -->\r\n <div *ngFor=\"let formField of formSection.formFields | vlVisible\" class=\"field-row\"\r\n [attr.data-vl-field]=\"vlFieldKey(formField)\"\r\n [ngClass]=\"getStyleWithoutClasses(formField?.style)?.classes\"\r\n [ngStyle]=\"getFieldWrapperStyle(formField)\"\r\n [class.field-row--locked]=\"isLocked(formField, formRef)\">\r\n <vl-control [field]=\"formField\"\r\n [propertySchema]=\"form.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"saveTried\"\r\n container=\"form\"\r\n buttonType=\"submit\"\r\n [locked]=\"isLocked(formField, formRef)\"\r\n [lockHints]=\"lockHintsOf(formField, formRef)\"\r\n (lockedClick)=\"showMissing(formRef)\"\r\n (signIn)=\"signIn.emit()\"\r\n [list]=\"remoteData[formField.scope?.reference]\"\r\n [listLoading]=\"remoteLoading[formField.scope?.reference]\"\r\n [creditCardError]=\"creditCardError\"\r\n (toggled)=\"setformData()\"\r\n (buttonClick)=\"invokeFormBtnClick($event, form.propertySchema)\">\r\n </vl-control>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-container *ngFor=\"let formSection of sectionsIn(false)\">\r\n <ng-container *ngIf=\"sectionShown(formSection)\">\r\n <ng-container *ngTemplateOutlet=\"sectionTpl; context: { $implicit: formSection }\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <div *ngIf=\"sectionsIn(true).length\" class=\"sticky-column\" [style.--vl-section-span]=\"stickySpan()\"\r\n [style.--vl-section-span-tablet]=\"stickyTabletSpan()\"\r\n [class.sticky-column--stack-tablet]=\"stickyTabletSpan() === 12\">\r\n <ng-container *ngFor=\"let formSection of sectionsIn(true)\">\r\n <ng-container *ngIf=\"sectionShown(formSection)\">\r\n <ng-container *ngTemplateOutlet=\"sectionTpl; context: { $implicit: formSection }\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%;min-height:0}.form-renderer{width:100%;height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;padding:12px}.section-card{border:1px solid #e5e7eb;border-radius:var(--radius-sm, 8px);padding:12px;margin-bottom:12px;background:#fff;box-sizing:border-box}.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-weight:600}.section-title{font-size:14px;color:#0f172a}.section-body{position:relative;width:100%;min-height:78px;box-sizing:border-box}.field-row{position:relative;min-width:0;width:100%;box-sizing:border-box}.field-row input,.field-row select,.field-row nz-select,.field-row textarea,.field-row button{max-width:100%;box-sizing:border-box}@media(max-width:768px){.section-body{grid-template-columns:repeat(1,minmax(0,1fr))!important}.field-row{grid-column:span 1!important}}@media(min-width:769px)and (max-width:1024px){.section-body{grid-template-columns:repeat(6,minmax(0,1fr))!important}.field-row{grid-column:span 6!important}}:host-context(.mobile-frame) .section-body,:host-context(.device-mobile) .section-body{grid-template-columns:repeat(1,minmax(0,1fr))!important}:host-context(.mobile-frame) .field-row,:host-context(.device-mobile) .field-row{grid-column:span 1!important}:host-context(.tablet-frame) .section-body,:host-context(.device-tablet) .section-body{grid-template-columns:repeat(6,minmax(0,1fr))!important}:host-context(.tablet-frame) .field-row,:host-context(.device-tablet) .field-row{grid-column:span 6!important}.field-row--locked{background:transparent!important;box-shadow:none!important;height:auto!important}form{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:16px;align-items:start;padding-bottom:32px}.section-card{grid-column:span var(--vl-section-span, 12);min-width:0}.sticky-column .section-card{grid-column:auto}.sticky-column{grid-column:span var(--vl-section-span, 4) / -1;grid-row:1 / span 40;align-self:start;position:sticky;top:12px;z-index:2;min-width:0}@media(min-width:768px)and (max-width:1023px){.section-card{grid-column:span var(--vl-section-span-tablet, var(--vl-section-span, 12))}.sticky-column{grid-column:span var(--vl-section-span-tablet, var(--vl-section-span, 4)) / -1}.sticky-column.sticky-column--stack-tablet{grid-column:1 / -1;grid-row:auto;position:static}.sticky-column .section-card{grid-column:auto}}@media(max-width:767px){.section-card,.sticky-column{grid-column:1 / -1;grid-row:auto;position:static}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ControlComponent, selector: "vl-control", inputs: ["field", "propertySchema", "selectedLanguageInfo", "errorMessages", "saveTried", "container", "buttonType", "locked", "lockHints", "mode", "record", "hideLabel", "styleValue", "compact", "list", "listLoading", "creditCardError"], outputs: ["picked", "changed", "opened", "toggled", "linkClicked", "mediaClicked", "buttonClick", "lockedClick", "signIn"] }, { kind: "pipe", type: VisiblePipe, name: "vlVisible" }] });
|
|
7994
8359
|
}
|
|
7995
8360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: FormComponent, decorators: [{
|
|
7996
8361
|
type: Component,
|
|
7997
|
-
args: [{ standalone: true, imports: [CommonModule, FormsModule, VisiblePipe, ControlComponent], selector: 'vl-form', template: "<!-- Shuaib 2026-10-20\r\n - change: every field is drawn by the shared <vl-control> (controls/control.ts) instead of the switch\r\n over types and controls in this template - the same building block as the dialog (#166)\r\n - change: scope.style is the input of every control (the drop-down took the field's style, check box\r\n and drop-down put scope.style around label and input); all classes of a style count\r\n - change: option.protected makes every control read only - check box, switch, radio, drop-down,\r\n password, text area, media were still editable; a protected field shows label and value -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: every field label by getLabel (label.value, the layout's label.caption, then the DTO caption) -\r\n numbers and the period showed no label; a text field's control dropdown/switch/checkbox is used (#166, tests F2-F4)\r\n - new: date and time in one field (type datetime or control dateTimepicker) with vl-datetime (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: numbers with vl-number (plain, spinner, slider) (#166 step 4.4)\r\n - change: the text field is the one vl-textbox (#166 step 4.4)\r\n - new: radiobutton with vl-radio (text and Boolean) (#166 step 4.4)\r\n - new: a Boolean with control switch uses vl-switch (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea with vl-textarea instead of a one-line field (#166 step 4.4)\r\n - change: password with vl-password, the same field and eye as in dialog and card (#166 step 4.4)\r\n - change: validation rules only from the layout (vlRules: required, email, min/max length, pattern,\r\n minimum/maximum), messages via fieldMessage; number fields checked too (#166 step 4.6)\r\n - change: fields/columns with option.visible false are left out (vlVisible, #166)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: date and time fields use the shared picker markup (picker-field, DateTimePickerService)\r\n instead of PrimeNG's own icon with empty handlers -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: the form field switch uses renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - change: the credit card type is spelled creditCard. The rename of 2026-09-15 reached\r\n model.component.html and the whole Designer but not this file, so one data object rendered\r\n in a modal and stayed empty here\r\n - new: a @contract comment on the type switch and on the credit card case, so the rule sits\r\n next to the code that implements it -->\r\n<div class=\"form-renderer\"\r\n [ngClass]=\"getStyleWithoutClasses(form?.layoutSchema?.style)?.classes\"\r\n [ngStyle]=\"getStyleWithoutClasses(form?.layoutSchema?.style)?.style\">\r\n <form *ngIf=\"form?.layoutSchema?.formSections?.length > 0\">\r\n <div\r\n *ngFor=\"let formSection of form?.layoutSchema?.formSections; let i = index\"\r\n class=\"section-card\">\r\n <div *ngIf=\"formSection?.label?.caption\" class=\"section-header\">\r\n <div class=\"section-title\"\r\n [ngClass]=\"getStyleWithoutClasses(formSection?.label?.style)?.classes\"\r\n [ngStyle]=\"getStyleWithoutClasses(formSection?.label?.style)?.style\">\r\n {{ formSection.label.caption }}\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"formSection?.formFields?.length > 0\" class=\"section-body\"\r\n [ngClass]=\"getStyleWithoutClasses(formSection?.style)?.classes\"\r\n [ngStyle]=\"getSectionBodyStyle(formSection)\">\r\n <!-- the field's style is its wrapper in the section grid; label, input and button are drawn by\r\n the shared <vl-control>. The button is a submit button, so Enter in a field presses it -->\r\n <div *ngFor=\"let formField of formSection.formFields | vlVisible\" class=\"field-row\"\r\n [attr.data-vl-field]=\"vlFieldKey(formField)\"\r\n [ngClass]=\"getStyleWithoutClasses(formField?.style)?.classes\"\r\n [ngStyle]=\"getFieldWrapperStyle(formField)\">\r\n <vl-control [field]=\"formField\"\r\n [propertySchema]=\"form.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"saveTried\"\r\n container=\"form\"\r\n buttonType=\"submit\"\r\n [list]=\"remoteData[formField.scope?.reference]\"\r\n [listLoading]=\"remoteLoading[formField.scope?.reference]\"\r\n [creditCardError]=\"creditCardError\"\r\n (toggled)=\"setformData()\"\r\n (buttonClick)=\"invokeFormBtnClick($event, form.propertySchema)\">\r\n </vl-control>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%;min-height:0}.form-renderer{width:100%;height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;padding:12px}.section-card{border:1px solid #e5e7eb;border-radius:var(--radius-sm, 8px);padding:12px;margin-bottom:12px;background:#fff;box-sizing:border-box}.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-weight:600}.section-title{font-size:14px;color:#0f172a}.section-body{position:relative;width:100%;min-height:78px;box-sizing:border-box}.field-row{position:relative;min-width:0;width:100%;box-sizing:border-box}.field-row input,.field-row select,.field-row nz-select,.field-row textarea,.field-row button{max-width:100%;box-sizing:border-box}@media(max-width:768px){.section-body{grid-template-columns:repeat(1,minmax(0,1fr))!important}.field-row{grid-column:span 1!important}}@media(min-width:769px)and (max-width:1024px){.section-body{grid-template-columns:repeat(6,minmax(0,1fr))!important}.field-row{grid-column:span 6!important}}:host-context(.mobile-frame) .section-body,:host-context(.device-mobile) .section-body{grid-template-columns:repeat(1,minmax(0,1fr))!important}:host-context(.mobile-frame) .field-row,:host-context(.device-mobile) .field-row{grid-column:span 1!important}:host-context(.tablet-frame) .section-body,:host-context(.device-tablet) .section-body{grid-template-columns:repeat(6,minmax(0,1fr))!important}:host-context(.tablet-frame) .field-row,:host-context(.device-tablet) .field-row{grid-column:span 6!important}\n"] }]
|
|
8362
|
+
args: [{ standalone: true, imports: [CommonModule, FormsModule, VisiblePipe, ControlComponent], selector: 'vl-form', template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - new: sections side by side (gridSpan), the sticky ones as one column at the right, visibleWhen\r\n - change: lockHints (every reason, the missing fields as links), goToField; space under the last section\r\n - new: a locked button shows its hint, a click shows the missing fields (showMissing), the hint of a missing\r\n sign-in asks the app to sign in (signIn)\r\n - change: the wrapper of a locked button drops the layout's colour and shadow (field-row--locked) - the blue\r\n of the field style stayed around the grey button\r\n - new: a button is locked by needsLogin / needsValid of its layout (isLocked, field/button-lock.ts) -->\r\n<!-- Shuaib 2026-10-20\r\n - change: every field is drawn by the shared <vl-control> (controls/control.ts) instead of the switch\r\n over types and controls in this template - the same building block as the dialog (#166)\r\n - change: scope.style is the input of every control (the drop-down took the field's style, check box\r\n and drop-down put scope.style around label and input); all classes of a style count\r\n - change: option.protected makes every control read only - check box, switch, radio, drop-down,\r\n password, text area, media were still editable; a protected field shows label and value -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: every field label by getLabel (label.value, the layout's label.caption, then the DTO caption) -\r\n numbers and the period showed no label; a text field's control dropdown/switch/checkbox is used (#166, tests F2-F4)\r\n - new: date and time in one field (type datetime or control dateTimepicker) with vl-datetime (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: numbers with vl-number (plain, spinner, slider) (#166 step 4.4)\r\n - change: the text field is the one vl-textbox (#166 step 4.4)\r\n - new: radiobutton with vl-radio (text and Boolean) (#166 step 4.4)\r\n - new: a Boolean with control switch uses vl-switch (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea with vl-textarea instead of a one-line field (#166 step 4.4)\r\n - change: password with vl-password, the same field and eye as in dialog and card (#166 step 4.4)\r\n - change: validation rules only from the layout (vlRules: required, email, min/max length, pattern,\r\n minimum/maximum), messages via fieldMessage; number fields checked too (#166 step 4.6)\r\n - change: fields/columns with option.visible false are left out (vlVisible, #166)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: date and time fields use the shared picker markup (picker-field, DateTimePickerService)\r\n instead of PrimeNG's own icon with empty handlers -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: the form field switch uses renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - change: the credit card type is spelled creditCard. The rename of 2026-09-15 reached\r\n model.component.html and the whole Designer but not this file, so one data object rendered\r\n in a modal and stayed empty here\r\n - new: a @contract comment on the type switch and on the credit card case, so the rule sits\r\n next to the code that implements it -->\r\n<div class=\"form-renderer\"\r\n [ngClass]=\"getStyleWithoutClasses(form?.layoutSchema?.style)?.classes\"\r\n [ngStyle]=\"getStyleWithoutClasses(form?.layoutSchema?.style)?.style\">\r\n <form #formRef=\"ngForm\" *ngIf=\"form?.layoutSchema?.formSections?.length > 0\">\r\n <!-- the sections stand in the form's 12 columns, gridSpan wide; the sticky ones together form a column at the\r\n right that stays in view (on a phone it stands at the end); visibleWhen shows a section only while its\r\n field holds the value (a hidden section's fields do not count) -->\r\n <ng-template #sectionTpl let-formSection>\r\n <div class=\"section-card\" [style.--vl-section-span]=\"sectionSpanOf(formSection)\"\r\n [style.--vl-section-span-tablet]=\"sectionTabletSpanOf(formSection)\">\r\n <div *ngIf=\"formSection?.label?.caption\" class=\"section-header\">\r\n <div class=\"section-title\"\r\n [ngClass]=\"getStyleWithoutClasses(formSection?.label?.style)?.classes\"\r\n [ngStyle]=\"getStyleWithoutClasses(formSection?.label?.style)?.style\">\r\n {{ formSection.label.caption }}\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"formSection?.formFields?.length > 0\" class=\"section-body\"\r\n [ngClass]=\"getStyleWithoutClasses(formSection?.style)?.classes\"\r\n [ngStyle]=\"getSectionBodyStyle(formSection)\">\r\n <!-- the field's style is its wrapper in the section grid; label, input and button are drawn by\r\n the shared <vl-control>. The button is a submit button, so Enter in a field presses it -->\r\n <div *ngFor=\"let formField of formSection.formFields | vlVisible\" class=\"field-row\"\r\n [attr.data-vl-field]=\"vlFieldKey(formField)\"\r\n [ngClass]=\"getStyleWithoutClasses(formField?.style)?.classes\"\r\n [ngStyle]=\"getFieldWrapperStyle(formField)\"\r\n [class.field-row--locked]=\"isLocked(formField, formRef)\">\r\n <vl-control [field]=\"formField\"\r\n [propertySchema]=\"form.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"saveTried\"\r\n container=\"form\"\r\n buttonType=\"submit\"\r\n [locked]=\"isLocked(formField, formRef)\"\r\n [lockHints]=\"lockHintsOf(formField, formRef)\"\r\n (lockedClick)=\"showMissing(formRef)\"\r\n (signIn)=\"signIn.emit()\"\r\n [list]=\"remoteData[formField.scope?.reference]\"\r\n [listLoading]=\"remoteLoading[formField.scope?.reference]\"\r\n [creditCardError]=\"creditCardError\"\r\n (toggled)=\"setformData()\"\r\n (buttonClick)=\"invokeFormBtnClick($event, form.propertySchema)\">\r\n </vl-control>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-container *ngFor=\"let formSection of sectionsIn(false)\">\r\n <ng-container *ngIf=\"sectionShown(formSection)\">\r\n <ng-container *ngTemplateOutlet=\"sectionTpl; context: { $implicit: formSection }\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <div *ngIf=\"sectionsIn(true).length\" class=\"sticky-column\" [style.--vl-section-span]=\"stickySpan()\"\r\n [style.--vl-section-span-tablet]=\"stickyTabletSpan()\"\r\n [class.sticky-column--stack-tablet]=\"stickyTabletSpan() === 12\">\r\n <ng-container *ngFor=\"let formSection of sectionsIn(true)\">\r\n <ng-container *ngIf=\"sectionShown(formSection)\">\r\n <ng-container *ngTemplateOutlet=\"sectionTpl; context: { $implicit: formSection }\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%;min-height:0}.form-renderer{width:100%;height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;padding:12px}.section-card{border:1px solid #e5e7eb;border-radius:var(--radius-sm, 8px);padding:12px;margin-bottom:12px;background:#fff;box-sizing:border-box}.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-weight:600}.section-title{font-size:14px;color:#0f172a}.section-body{position:relative;width:100%;min-height:78px;box-sizing:border-box}.field-row{position:relative;min-width:0;width:100%;box-sizing:border-box}.field-row input,.field-row select,.field-row nz-select,.field-row textarea,.field-row button{max-width:100%;box-sizing:border-box}@media(max-width:768px){.section-body{grid-template-columns:repeat(1,minmax(0,1fr))!important}.field-row{grid-column:span 1!important}}@media(min-width:769px)and (max-width:1024px){.section-body{grid-template-columns:repeat(6,minmax(0,1fr))!important}.field-row{grid-column:span 6!important}}:host-context(.mobile-frame) .section-body,:host-context(.device-mobile) .section-body{grid-template-columns:repeat(1,minmax(0,1fr))!important}:host-context(.mobile-frame) .field-row,:host-context(.device-mobile) .field-row{grid-column:span 1!important}:host-context(.tablet-frame) .section-body,:host-context(.device-tablet) .section-body{grid-template-columns:repeat(6,minmax(0,1fr))!important}:host-context(.tablet-frame) .field-row,:host-context(.device-tablet) .field-row{grid-column:span 6!important}.field-row--locked{background:transparent!important;box-shadow:none!important;height:auto!important}form{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:16px;align-items:start;padding-bottom:32px}.section-card{grid-column:span var(--vl-section-span, 12);min-width:0}.sticky-column .section-card{grid-column:auto}.sticky-column{grid-column:span var(--vl-section-span, 4) / -1;grid-row:1 / span 40;align-self:start;position:sticky;top:12px;z-index:2;min-width:0}@media(min-width:768px)and (max-width:1023px){.section-card{grid-column:span var(--vl-section-span-tablet, var(--vl-section-span, 12))}.sticky-column{grid-column:span var(--vl-section-span-tablet, var(--vl-section-span, 4)) / -1}.sticky-column.sticky-column--stack-tablet{grid-column:1 / -1;grid-row:auto;position:static}.sticky-column .section-card{grid-column:auto}}@media(max-width:767px){.section-card,.sticky-column{grid-column:1 / -1;grid-row:auto;position:static}}\n"] }]
|
|
7998
8363
|
}], propDecorators: { errorMessages: [{
|
|
7999
8364
|
type: Input
|
|
8000
8365
|
}], creditCardError: [{
|
|
@@ -8003,12 +8368,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
8003
8368
|
type: Input
|
|
8004
8369
|
}], selectedLanguageInfo: [{
|
|
8005
8370
|
type: Input
|
|
8371
|
+
}], userInfo: [{
|
|
8372
|
+
type: Input
|
|
8006
8373
|
}], formButtonClick: [{
|
|
8007
8374
|
type: Output
|
|
8008
8375
|
}], checkBoxChangeEvent: [{
|
|
8009
8376
|
type: Output
|
|
8377
|
+
}], signIn: [{
|
|
8378
|
+
type: Output
|
|
8010
8379
|
}] } });
|
|
8380
|
+
/** The cache key of a button's hints: its place on the page (reference or caption). */
|
|
8381
|
+
function vlLockKey(formField) {
|
|
8382
|
+
return String(formField?.scope?.reference || formField?.label?.caption || '');
|
|
8383
|
+
}
|
|
8011
8384
|
|
|
8385
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
8386
|
+
// - change: a data object holds names and types only - the media caption comes from the layout
|
|
8387
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22
|
|
8388
|
+
// - new: input pageData - a grid page from browser storage or a filter (A4): rows come from the app as
|
|
8389
|
+
// PageData.visible, the delete icon deletes through PageData (asks first, the page's own list),
|
|
8390
|
+
// paging goes to PageData; without pageData everything works as before (backend, table: true)
|
|
8391
|
+
// - new: editing as the page sets it (layoutSchema.edit.mode): "row" - startEdit/saveRow/cancelEdit with
|
|
8392
|
+
// a copy of the data objects per row, checked through the form like the dialog, saved through
|
|
8393
|
+
// PageData; "dialog" - editRow asks the app to open the page's dialog. inlineEditable and
|
|
8394
|
+
// checkboxEditable are gone - without edit the grid is read only
|
|
8012
8395
|
// Shuaib 2026-10-20
|
|
8013
8396
|
// - change: the cells that show a value are drawn by the shared <vl-control> in display mode
|
|
8014
8397
|
// (ControlComponent); cellType, inlineEditable, checkboxEditable decide which cells keep their own
|
|
@@ -8134,6 +8517,15 @@ class GridComponent {
|
|
|
8134
8517
|
currentPage = 0;
|
|
8135
8518
|
pages = [];
|
|
8136
8519
|
userInfo;
|
|
8520
|
+
/** A page from browser storage or a filter (A4): its records, delete and paging go through PageData. */
|
|
8521
|
+
pageData = null;
|
|
8522
|
+
/** "dialog" edit: the app opens the page's dialog with the record (like a card's showModal). */
|
|
8523
|
+
editRow = new EventEmitter();
|
|
8524
|
+
gridForm;
|
|
8525
|
+
/** The row being edited ("row" mode), its own copy of the data objects with the row's values. */
|
|
8526
|
+
editingRow = null;
|
|
8527
|
+
rowSchema = {};
|
|
8528
|
+
rowSaveTried = false;
|
|
8137
8529
|
onPageChange = new EventEmitter();
|
|
8138
8530
|
onPageSizeChange = new EventEmitter();
|
|
8139
8531
|
onGridScroll = new EventEmitter();
|
|
@@ -8345,11 +8737,131 @@ class GridComponent {
|
|
|
8345
8737
|
this.gridDecreamentClick.emit({ index: index, field: field, option: option });
|
|
8346
8738
|
}
|
|
8347
8739
|
invokeOnPageSizeChange(pageSize) {
|
|
8740
|
+
if (this.pageData) {
|
|
8741
|
+
this.pageData.setPageSize(Number(pageSize));
|
|
8742
|
+
return;
|
|
8743
|
+
}
|
|
8348
8744
|
this.onPageSizeChange.emit(pageSize);
|
|
8349
8745
|
}
|
|
8350
8746
|
invokeGoToPage(page) {
|
|
8747
|
+
if (this.pageData) {
|
|
8748
|
+
this.pageData.goTo(Number(page));
|
|
8749
|
+
return;
|
|
8750
|
+
}
|
|
8351
8751
|
this.onPageChange.emit(page);
|
|
8352
8752
|
}
|
|
8753
|
+
/** layoutSchema.edit: { mode: "row" | "dialog", layout_url?, property_url?, modalTitle?, data_url?, method? } */
|
|
8754
|
+
get editConfig() {
|
|
8755
|
+
return this.tableitemInfo?.layoutSchema?.edit ?? null;
|
|
8756
|
+
}
|
|
8757
|
+
get editMode() {
|
|
8758
|
+
const mode = this.editConfig?.mode;
|
|
8759
|
+
return mode === 'row' || mode === 'dialog' ? mode : null;
|
|
8760
|
+
}
|
|
8761
|
+
/** The edit column shows when the page sets a mode and has at least one unlocked field. */
|
|
8762
|
+
get canEdit() {
|
|
8763
|
+
return !!this.editMode && (this.tableitemInfo?.layoutSchema?.elements || [])
|
|
8764
|
+
.some((col) => col?.scope?.reference && !col?.option?.protected);
|
|
8765
|
+
}
|
|
8766
|
+
/** A column whose cells can be edited: it has a field and the field is not locked. */
|
|
8767
|
+
editableCol(col) {
|
|
8768
|
+
return !!col?.scope?.reference && !col?.option?.protected;
|
|
8769
|
+
}
|
|
8770
|
+
/** A cell is an input only in the row being edited, and only when its field is not locked. */
|
|
8771
|
+
cellEditing(col, data) {
|
|
8772
|
+
return this.editingRow === data && this.editableCol(col);
|
|
8773
|
+
}
|
|
8774
|
+
/** A cell that needs more room while edited: multi-line text, a period, date and time. */
|
|
8775
|
+
wideEditCell(col) {
|
|
8776
|
+
const type = this.cellType(col).toLowerCase();
|
|
8777
|
+
const control = String(col?.option?.control ?? '').toLowerCase();
|
|
8778
|
+
return type === 'daterange' || type === 'datetime' || control === 'textarea' || control === 'daterangepicker';
|
|
8779
|
+
}
|
|
8780
|
+
/** The project's text for a fixed key (Edit, Save, Cancel), else the key. */
|
|
8781
|
+
t(key) {
|
|
8782
|
+
return this.selectedLanguageInfo?.selectedLanguage?.[key] ?? key;
|
|
8783
|
+
}
|
|
8784
|
+
recordIndexOf(data) {
|
|
8785
|
+
return this.pageData ? this.pageData.records.indexOf(data) : (this.tableitemInfo?.data || []).indexOf(data);
|
|
8786
|
+
}
|
|
8787
|
+
startEdit(data) {
|
|
8788
|
+
if (this.editMode === 'dialog') {
|
|
8789
|
+
const config = this.editConfig || {};
|
|
8790
|
+
const source = this.pageData?.source || {};
|
|
8791
|
+
this.editRow.emit({
|
|
8792
|
+
option: {
|
|
8793
|
+
innerAction: 'showModal',
|
|
8794
|
+
layout_url: config.layout_url,
|
|
8795
|
+
property_url: config.property_url ?? source.property_url,
|
|
8796
|
+
modalTitle: config.modalTitle,
|
|
8797
|
+
storageType: source.storageType,
|
|
8798
|
+
data_url: source.data_url,
|
|
8799
|
+
},
|
|
8800
|
+
record: data,
|
|
8801
|
+
recordIndex: this.recordIndexOf(data),
|
|
8802
|
+
});
|
|
8803
|
+
return;
|
|
8804
|
+
}
|
|
8805
|
+
// a copy of the data objects with the row's values - the controls write there, the row stays
|
|
8806
|
+
// untouched until ✓ (JSON keeps no Date, so the values are set afterwards)
|
|
8807
|
+
const schema = JSON.parse(JSON.stringify(this.tableitemInfo?.propertySchema || {}));
|
|
8808
|
+
for (const group of Object.values(schema)) {
|
|
8809
|
+
for (const [name, property] of Object.entries(group || {})) {
|
|
8810
|
+
if (property && typeof property === 'object')
|
|
8811
|
+
property.value = fromStorageValue(data?.[name], property.type) ?? null;
|
|
8812
|
+
}
|
|
8813
|
+
}
|
|
8814
|
+
this.rowSchema = schema;
|
|
8815
|
+
this.rowSaveTried = false;
|
|
8816
|
+
this.editingRow = data;
|
|
8817
|
+
}
|
|
8818
|
+
cancelEdit() {
|
|
8819
|
+
this.editingRow = null;
|
|
8820
|
+
this.rowSchema = {};
|
|
8821
|
+
this.rowSaveTried = false;
|
|
8822
|
+
}
|
|
8823
|
+
/** ✓: checks the row's controls like the dialog, then saves the record (browser list or backend). */
|
|
8824
|
+
async saveRow() {
|
|
8825
|
+
if (!this.editingRow)
|
|
8826
|
+
return;
|
|
8827
|
+
this.rowSaveTried = true;
|
|
8828
|
+
const form = this.gridForm;
|
|
8829
|
+
if (form) {
|
|
8830
|
+
Object.values(form.controls).forEach(control => {
|
|
8831
|
+
control.markAsTouched();
|
|
8832
|
+
control.updateValueAndValidity();
|
|
8833
|
+
});
|
|
8834
|
+
if (!form.valid)
|
|
8835
|
+
return;
|
|
8836
|
+
}
|
|
8837
|
+
const editable = (this.tableitemInfo?.layoutSchema?.elements || [])
|
|
8838
|
+
.filter((col) => this.cellEditing(col, this.editingRow))
|
|
8839
|
+
.map((col) => splitReference(col.scope.reference).name);
|
|
8840
|
+
const values = recordOf(this.rowSchema, editable);
|
|
8841
|
+
const record = { ...this.editingRow, ...values };
|
|
8842
|
+
const index = this.recordIndexOf(this.editingRow);
|
|
8843
|
+
let saved = false;
|
|
8844
|
+
if (this.pageData && isBrowserSource(this.pageData.source)) {
|
|
8845
|
+
saved = await this.pageData.saveRecord(record, index);
|
|
8846
|
+
}
|
|
8847
|
+
else if (this.pageData && this.editConfig?.data_url) {
|
|
8848
|
+
// a backend page: the edit's own address (method default PUT), then the page loads again
|
|
8849
|
+
this.pageData.records[index] = record;
|
|
8850
|
+
saved = await this.pageData.send({ option: { method: 'PUT', ...this.editConfig } }, index);
|
|
8851
|
+
if (saved)
|
|
8852
|
+
await this.pageData.load();
|
|
8853
|
+
}
|
|
8854
|
+
if (saved)
|
|
8855
|
+
this.cancelEdit();
|
|
8856
|
+
}
|
|
8857
|
+
/** The delete icon of a row: a browser list deletes through PageData (asks first), a backend as before. */
|
|
8858
|
+
deleteRow(option, data) {
|
|
8859
|
+
if (this.pageData && isBrowserSource(this.pageData.source)) {
|
|
8860
|
+
this.pageData.remove(this.pageData.records.indexOf(data), { option: { action: 'delete', ...option } });
|
|
8861
|
+
return;
|
|
8862
|
+
}
|
|
8863
|
+
this.upsertAction(option, data);
|
|
8864
|
+
}
|
|
8353
8865
|
authenticating() {
|
|
8354
8866
|
this.utilityService.getStorage(`${this.projectSeleted}Logined`).then((logined) => {
|
|
8355
8867
|
if (logined == "true") {
|
|
@@ -8560,7 +9072,7 @@ class GridComponent {
|
|
|
8560
9072
|
const property = reference && key
|
|
8561
9073
|
? this.tableitemInfo?.propertySchema?.[this.getScope(reference)]?.[key]
|
|
8562
9074
|
: undefined;
|
|
8563
|
-
return col?.label?.caption ||
|
|
9075
|
+
return col?.label?.caption || 'Media';
|
|
8564
9076
|
}
|
|
8565
9077
|
getMediaKind(col, data) {
|
|
8566
9078
|
const source = this.getMediaSource(col, data);
|
|
@@ -8665,22 +9177,8 @@ class GridComponent {
|
|
|
8665
9177
|
const reference = col?.scope?.reference || '';
|
|
8666
9178
|
return this.tableitemInfo?.propertySchema?.[this.getScope(reference)]?.[reference.split('/').pop() || '']?.type ?? '';
|
|
8667
9179
|
}
|
|
8668
|
-
/**
|
|
8669
|
-
* An unlocked text or number cell is typed in; the action column saves the row. A column with a
|
|
8670
|
-
* shared control (password, text area, switch, combobox, radio) is shown, not typed in.
|
|
8671
|
-
*/
|
|
8672
|
-
inlineEditable(col) {
|
|
8673
|
-
const type = this.cellType(col);
|
|
8674
|
-
return !col?.option?.protected && !this.cellControl(col) && (type === 'string' || type === 'number');
|
|
8675
|
-
}
|
|
8676
|
-
/** An unlocked Boolean column without switch or radio ticks the row's value. */
|
|
8677
|
-
checkboxEditable(col) {
|
|
8678
|
-
const type = this.cellType(col);
|
|
8679
|
-
return !col?.option?.protected && !this.cellControl(col)
|
|
8680
|
-
&& (type === 'boolean' || this.isLegacyCheckboxFieldType(type));
|
|
8681
|
-
}
|
|
8682
9180
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: GridComponent, deps: [{ token: RequestService }, { token: UtilityService }, { token: NotificationService }, { token: i4.OktaAuthStateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8683
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: GridComponent, isStandalone: true, selector: "vl-grid", inputs: { errorMessages: "errorMessages", environment: "environment", selectedLanguageInfo: "selectedLanguageInfo", tableitemInfo: "tableitemInfo", form: "form", isTableDataLoad: "isTableDataLoad", currenTableOptions: "currenTableOptions", projectSeleted: "projectSeleted", pageSize: "pageSize", currentPage: "currentPage", pages: "pages", userInfo: "userInfo" }, outputs: { onPageChange: "onPageChange", onPageSizeChange: "onPageSizeChange", onGridScroll: "onGridScroll", showGridLink: "showGridLink", gridButtonClick: "gridButtonClick", gridIncreamentClick: "gridIncreamentClick", gridDecreamentClick: "gridDecreamentClick", gridImgClick: "gridImgClick" }, usesOnChanges: true, ngImport: i0, template: "<!-- Shuaib 2026-10-20\r\n - change: the cells that show a value are drawn by the shared <vl-control> in display mode (#166):\r\n the row's value of every type, read only - date, time, drop-down, autocomplete and period cells\r\n were inputs bound to the form's property (the same value in every row); integer and bigdecimal\r\n columns stayed empty\r\n - kept: unlocked text and number cells (typed in, saved by the action column), quantity +/-, multiply,\r\n the check box of the row, action columns, buttons, the footer\r\n - change: a locked check box is shown read only; it could be ticked\r\n - fix: action icons, button and footer labels read style.classes?.[0]; a style without classes (the Designer's default {}) threw -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - new: date and time in one value (type datetime or control dateTimepicker): field and display (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: the footer's number field is the one vl-number (#166 step 4.4)\r\n - change: the footer's text field is the one vl-textbox (#166 step 4.4)\r\n - change: cells and footer follow the layout's control (password, textArea, switch, combobox) with the\r\n shared controls, cells read only and compact (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - change: footer fields: rules only from the layout (vlRules) and the message of the first error (#166 step 4.6)\r\n - change: fields/columns with option.visible false are left out (vlVisible, #166)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: date and time cells use the shared picker markup (picker-field, DateTimePickerService);\r\n their PrimeNG icon opened the calendar together with the system keyboard -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: grid cells render legacy checkbox fields through the boolean control. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: @contract comments on the sorting, on the column filter and on the footer. The filter\r\n reads option.filter and never option.columnFilter, which is the mistake a layout author\r\n makes without being told -->\r\n<div *ngIf=\"!tableitemInfo.data?.length\" class=\"alert alert-warning col-md-12\"\r\n role=\"alert\">\r\n {{ tableitemInfo.layoutSchema?.noRecordMessage}}\r\n</div>\r\n<div *ngIf=\"tableitemInfo.data?.length\" class=\"reservation-container pt-5 px-3\">\r\n <nz-table #basicTable [nzData]=\"gridDisplayData\"\r\n [nzNoResult]=\"'No matching records found'\" [nzBordered]=\"true\"\r\n [nzFrontPagination]=\"currenTableOptions?.pagination?.tabs\"\r\n [style]=\"getStyleWithoutClasses(currenTableOptions?.style).style\"\r\n (scroll)=\"onScrollEvent($event)\"\r\n [nzLoading]=\"isTableDataLoad\">\r\n <thead>\r\n <!-- @contract decision: option.sortable is read here\r\n reality: nzSortFn is wired to getColumnSortFn since 2026-09-16; before that\r\n the key was decoration. The column also needs a scope.reference -\r\n without one getColumnSortFn has nothing to sort by.\r\n seen: grid.component.ts:338 -->\r\n <!-- Column headings and sorting -->\r\n <tr>\r\n <th *ngFor=\"let column of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n [nzSortFn]=\"\r\n column?.option?.sortable\r\n ? getColumnSortFn(column)\r\n : false\r\n \">\r\n\r\n {{ column?.label?.caption }}\r\n </th>\r\n </tr>\r\n\r\n <!-- @contract decision: the column filter reads option.filter, NOT option.columnFilter\r\n reality: option.filter.filtering switches it on, option.filter.defaultOperator\r\n starts the comparison (the renderer falls back to contains), and\r\n option.filter.placeholder labels the input.\r\n failure: option.columnFilter is read nowhere, here or in the runtime app. A\r\n column carrying it looks filterable in the file and is not on screen.\r\n seen: grid.component.ts:450-475; 5 uses of columnFilter across the reference\r\n projects, all of them dead -->\r\n <!-- Column filters -->\r\n <tr *ngIf=\"hasAnyColumnFilter()\" class=\"grid-filter-row\">\r\n\r\n <th *ngFor=\"let column of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n class=\"grid-filter-cell\">\r\n\r\n <ng-container *ngIf=\"\r\n column?.option?.filter?.filtering === true &&\r\n column?.scope?.reference\r\n \">\r\n\r\n <div class=\"grid-filter-input-wrapper\">\r\n <input type=\"text\" class=\"grid-filter-input\" vlCustomKeyboard=\"string\"\r\n [placeholder]=\"getColumnFilterPlaceholder(column)\"\r\n [ngModel]=\"getColumnFilterState(column).value\"\r\n (ngModelChange)=\"\r\n setColumnFilterValue(column, $event)\r\n \" />\r\n\r\n <!-- Operator selection button -->\r\n <button type=\"button\"\r\n class=\"grid-filter-operator-button\" nz-dropdown\r\n nzTrigger=\"click\"\r\n [nzDropdownMenu]=\"operatorMenu\"\r\n [class.grid-filter-operator-button--active]=\"\r\n hasActiveColumnFilter(column)\r\n \" [title]=\"\r\n 'Operator: ' +\r\n getFilterOperatorLabel(\r\n getColumnFilterState(column).operator\r\n )\r\n \">\r\n\r\n <span nz-icon nzType=\"filter\"></span>\r\n </button>\r\n\r\n <!-- Clear current column filter -->\r\n <button *ngIf=\"hasActiveColumnFilter(column)\"\r\n type=\"button\" class=\"grid-filter-clear-button\"\r\n aria-label=\"Clear column filter\"\r\n title=\"Clear filter\"\r\n (click)=\"clearColumnFilter(column)\">\r\n\r\n <span nz-icon nzType=\"close\"></span>\r\n </button>\r\n </div>\r\n\r\n <!-- Operator dropdown -->\r\n <nz-dropdown-menu #operatorMenu=\"nzDropdownMenu\">\r\n <ul nz-menu class=\"grid-filter-operator-menu\">\r\n <li *ngFor=\"let operator of filterOperators\"\r\n nz-menu-item [nzSelected]=\"\r\n getColumnFilterState(column).operator ===\r\n operator.value\r\n \" (click)=\"\r\n setColumnFilterOperator(\r\n column,\r\n operator.value\r\n )\r\n \">\r\n\r\n <span *ngIf=\"\r\n getColumnFilterState(column).operator ===\r\n operator.value\r\n \" nz-icon nzType=\"check\">\r\n </span>\r\n\r\n {{ operator.label }}\r\n </li>\r\n </ul>\r\n </nz-dropdown-menu>\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </thead>\r\n <!-- @contract decision: a cell shows the row's value through <vl-control mode=\"display\">\r\n reality: every type is shown (integer, bigdecimal and the credit card stayed empty before);\r\n unlocked text and number cells, quantity, multiply and the check box keep their own\r\n blocks, because they write into the row.\r\n\r\n @contract decision: columns without scope.reference are valid\r\n reality: with option.actionColumn they render save/delete icons, otherwise a\r\n button. That is why the conditions below all guard on the reference. -->\r\n <tbody>\r\n <tr *ngFor=\"let data of basicTable.data; let i = index\">\r\n <td *ngFor=\"let col of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n [style]=\"getStyleWithoutClasses(col?.scope?.style).style\">\r\n <!-- a column without property: action icons or a button. Unlocked text and number cells\r\n are typed in (the row is saved by the action column), a check box ticks the row; every\r\n other cell shows the row's value through the shared <vl-control> in display mode -->\r\n @if (!col?.scope?.reference) {\r\n <span *ngIf=\"col.option?.actionColumn\">\r\n <span nz-icon\r\n *ngIf=\"setActionColumn(col.option?.save, data)\"\r\n [nzType]=\"col.option?.save?.icon\"\r\n [nzTheme]=\"'twotone'\"\r\n [style]=\"col.option?.save?.style\"\r\n [nzTwotoneColor]=\"'#52c41a'\"\r\n [class]=\"col.option?.save?.style?.classes?.[0]\"\r\n (click)=\"upsertAction(col.option?.save, data)\">\r\n </span>\r\n <span nz-icon\r\n *ngIf=\"setActionColumn(col.option?.delete, data)\"\r\n [nzType]=\"col.option?.delete?.icon\"\r\n [nzTheme]=\"'twotone'\"\r\n [style]=\"col.option?.delete?.style\"\r\n [nzTwotoneColor]=\"'#FF0000'\"\r\n [class]=\"col.option?.delete?.style?.classes?.[0]\"\r\n (click)=\"upsertAction(col.option?.delete, data)\"></span>\r\n\r\n </span>\r\n <span *ngIf=\"!col.option?.actionColumn\">\r\n <button type=\"submit\"\r\n [style]=\"getStyleWithoutClasses(col?.label?.style).style\"\r\n (click)=\"invokeGridBtnClick(col.option, data)\"\r\n [class]=\"col?.label?.style?.classes?.[0]\">\r\n {{ col.label?.caption }}\r\n </button>\r\n </span>\r\n } @else if (cellType(col) === 'quantity') {\r\n <div style=\"display: flex; align-items: center;\">\r\n <button pButton icon=\"pi pi-minus\"\r\n (click)=\"decrementQuantity(i,col.scope?.reference.split('/').pop(), col.option)\"\r\n [disabled]=\"data.quantity <= 0\"\r\n style=\"margin-right: 8px; height: 10px; width: 10px;\"></button>\r\n <span>{{ data[col.scope?.reference.split('/').pop()]\r\n }}</span>\r\n <button pButton icon=\"pi pi-plus\"\r\n (click)=\"incrementQuantity(i, col.scope?.reference.split('/').pop(), col.option)\"\r\n style=\"margin-left: 8px; height: 10px; width: 10px;\"></button>\r\n </div>\r\n } @else if (inlineEditable(col)) {\r\n @if (cellType(col) === 'number') {\r\n <input [vlCustomKeyboard]=\"keyboardTypeFor(col, tableitemInfo.propertySchema)\"\r\n [(ngModel)]=\"data[col.scope?.reference.split('/').pop()]\"\r\n type=\"number\"\r\n class=\"p-inputtext p-component\" />\r\n } @else {\r\n <input [vlCustomKeyboard]=\"keyboardTypeFor(col, tableitemInfo.propertySchema)\"\r\n [(ngModel)]=\"data[col.scope?.reference.split('/').pop()]\"\r\n class=\"p-inputtext p-component\" />\r\n }\r\n } @else if (cellType(col) === 'number' && col.option?.innerAction?.action == 'multiply') {\r\n <span>{{ (data[col.option?.innerAction?.from] * data[col.option?.innerAction?.to]) | number:'1.2-2' }}</span>\r\n } @else if (checkboxEditable(col)) {\r\n <vl-checkbox [field]=\"col\" type=\"boolean\" [target]=\"data\" [key]=\"col.scope?.reference.split('/').pop()\"\r\n [inputStyle]=\"getStyleWithoutClasses(col?.scope?.style).style\"></vl-checkbox>\r\n } @else {\r\n <vl-control mode=\"display\" [field]=\"col\" [record]=\"data\"\r\n [propertySchema]=\"tableitemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [list]=\"remoteData[col.scope.reference]\"\r\n [hideLabel]=\"true\" [styleValue]=\"false\" [compact]=\"true\"\r\n (linkClicked)=\"showLinkDetails(col.option, data)\"\r\n (mediaClicked)=\"invokeTableImageClick(col, data)\">\r\n </vl-control>\r\n }\r\n </td>\r\n </tr>\r\n </tbody>\r\n </nz-table>\r\n</div>\r\n\r\n<!-- table footer -->\r\n<div *ngIf=\"tableitemInfo?.footer?.formFields && tableitemInfo.data?.length\"\r\n class=\"table-footer flex flex-column align-items-end gap-2 pt-2 mx-4 border-top-1 border-cyan-500\">\r\n <!-- @contract decision: the footer renders string and number only\r\n reality: the switch below carries those two cases and a default. It did NOT change\r\n when the columns gained their types on 2026-09-18.\r\n failure: any other type in a footer field renders empty.\r\n instead: keep aggregates numeric, or pre-format them as text in the endpoint. -->\r\n <div *ngFor=\"let tableField of tableitemInfo?.footer?.formFields | vlVisible\">\r\n <!-- the layout's control decides (#166 step 4.4): the shared controls, editable -->\r\n @switch (cellControl(tableField)) {\r\n @case ('password') {\r\n <vl-password [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-password>\r\n }\r\n @case ('textArea') {\r\n <vl-textarea [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [keyboard]=\"keyboardTypeFor(tableField, tableitemInfo.propertySchema)\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-textarea>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [type]=\"propertyType(tableField)\"\r\n [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-switch>\r\n }\r\n @case ('radiobutton') {\r\n <vl-radio [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [type]=\"propertyType(tableField) === 'boolean' ? 'boolean' : 'string'\"\r\n [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-radio>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [combobox]=\"true\"\r\n [list]=\"remoteData[tableField.scope?.reference]\" [loading]=\"false\"\r\n [keyboard]=\"keyboardTypeFor(tableField, tableitemInfo.propertySchema)\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-autocomplete>\r\n }\r\n @default {\r\n <div\r\n [ngSwitch]=\"tableField?.scope?.reference && tableitemInfo.propertySchema[getScope(tableField.scope?.reference)] && tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()] ?\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.type : 'default'\">\r\n\r\n <!-- string control -->\r\n <div *ngSwitchCase=\"'string'\" class=\"form-group\">\r\n <span *ngIf=\"tableField.option.protected\">\r\n <h5 style=\"display: flex; justify-content: space-between;\">\r\n <span\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">\r\n {{\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.caption\r\n }}\r\n </span>\r\n <span>\r\n {{\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.value\r\n }}\r\n </span>\r\n </h5>\r\n </span>\r\n <div *ngIf=\"!tableField.option.protected\">\r\n <div\r\n [class]=\"tableField?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">{{\r\n tableField.label?.value ?\r\n tableField.label?.value :\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.caption\r\n }}</label>\r\n <vl-textbox [formField]=\"tableField\" [modalItemInfo]=\"tableitemInfo\" [saveTried]=\"false\"\r\n [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\"></vl-textbox>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- number control -->\r\n <div *ngSwitchCase=\"'number'\" class=\"form-group\">\r\n <span *ngIf=\"tableField.option.protected\"\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">\r\n <h5>{{\r\n form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.caption\r\n }} <vl-number style=\"display:inline-block\" [field]=\"tableField\" [readonly]=\"true\" [value]=\"form.propertySchema[getScope(tableField.scope?.reference)]?.[tableField.scope?.reference.split('/').pop()]?.value\" [property]=\"form.propertySchema[getScope(tableField.scope?.reference)]?.[tableField.scope?.reference.split('/').pop()]\" [row]=\"form.propertySchema[getScope(tableField.scope?.reference)]\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-number>\r\n </h5>\r\n </span>\r\n <span *ngIf=\"!tableField.option.protected\">\r\n <div\r\n [class]=\"tableField?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">{{\r\n tableField.label?.value ?\r\n tableField.label?.value :\r\n form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.caption\r\n }}</label>\r\n <vl-number [field]=\"tableField\" [target]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [property]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [row]=\"form.propertySchema[getScope(tableField.scope?.reference)]\"\r\n [type]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.type || 'number'\"\r\n [keyboard]=\"keyboardTypeFor(tableField, form.propertySchema)\" [saveTried]=\"false\"\r\n [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\"\r\n [translations]=\"selectedLanguageInfo?.selectedLanguage\"\r\n [inputStyle]=\"getStyleWithoutClasses(tableField?.scope?.style).style\"\r\n [inputClass]=\"tableField.scope?.style?.classes?.[0] ?? ''\"></vl-number>\r\n </div>\r\n\r\n </span>\r\n </div>\r\n\r\n <!-- button control -->\r\n <div *ngSwitchCase=\"'default'\">\r\n <button type=\"submit\"\r\n [style]=\"getStyleWithoutClasses(tableField.label.style).style\"\r\n (click)=\"invokeGridBtnClick(tableField.option, tableitemInfo.propertySchema)\">\r\n {{ tableField.label?.caption }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</div>\r\n\r\n<!-- bottom pagination on grid -->\r\n<div\r\n *ngIf=\"tableitemInfo.data?.length && !tableitemInfo?.layoutSchema?.pagination?.top && tableitemInfo?.layoutSchema?.pagination?.bottom\">\r\n <vl-pagination [itemInfo]=\"tableitemInfo\" [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n</div>\r\n", styles: [".grid-filter-row th{padding:8px;vertical-align:middle;background:#fafafa}.grid-filter-cell{min-width:150px}.grid-filter-input-wrapper{display:flex;align-items:stretch;width:100%}.grid-filter-input{width:100%;min-width:0;min-height:34px;padding:5px 8px;border:1px solid #d9d9d9;border-right:0;border-radius:4px 0 0 4px;outline:none}.grid-filter-input:focus{border-color:#1677ff}.grid-filter-operator-button,.grid-filter-clear-button{display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:34px;padding:0;cursor:pointer;background:#fff;border:1px solid #d9d9d9}.grid-filter-operator-button{color:#595959;border-radius:0 4px 4px 0}.grid-filter-operator-button:hover,.grid-filter-operator-button--active{color:#1677ff;border-color:#1677ff}.grid-filter-clear-button{margin-left:5px;color:#ff4d4f;border-radius:4px}.grid-filter-clear-button:hover{color:#fff;background:#ff4d4f;border-color:#ff4d4f}.grid-filter-operator-menu{min-width:190px}:host ::ng-deep .ant-table-content.has-more-right{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent)}:host ::ng-deep .ant-table-content.has-more-left{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent)}:host ::ng-deep .ant-table-content.has-more-left.has-more-right{-webkit-mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent)}\n"], dependencies: [{ kind: "component", type: ControlComponent, selector: "vl-control", inputs: ["field", "propertySchema", "selectedLanguageInfo", "errorMessages", "saveTried", "container", "buttonType", "mode", "record", "hideLabel", "styleValue", "compact", "list", "listLoading", "creditCardError"], outputs: ["picked", "changed", "opened", "toggled", "linkClicked", "mediaClicked", "buttonClick"] }, { kind: "component", type: Textbox, selector: "vl-textbox", inputs: ["formField", "modalItemInfo", "saveTried", "errorMessages", "readonly", "value"], outputs: ["linkClicked"] }, { kind: "component", type: Autocomplete, selector: "vl-autocomplete", inputs: ["field", "target", "value", "readonly", "list", "loading", "combobox", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["picked"] }, { kind: "component", type: PasswordControl, selector: "vl-password", inputs: ["field", "target", "value", "readonly", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"] }, { kind: "component", type: TextareaControl, selector: "vl-textarea", inputs: ["field", "target", "value", "readonly", "compact", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"] }, { kind: "component", type: SwitchControl, selector: "vl-switch", inputs: ["field", "target", "value", "readonly", "type", "translations"], outputs: ["switched"] }, { kind: "component", type: RadioControl, selector: "vl-radio", inputs: ["field", "target", "value", "readonly", "type", "saveTried", "errorMessages", "translations"], outputs: ["chosen"] }, { kind: "component", type: NumberControl, selector: "vl-number", inputs: ["field", "target", "value", "readonly", "type", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass", "property", "row"], outputs: ["changed"] }, { kind: "component", type: CheckboxControl, selector: "vl-checkbox", inputs: ["field", "target", "key", "value", "readonly", "type", "caption", "saveTried", "errorMessages", "translations", "inputStyle"], outputs: ["toggled"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i9.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzTableModule }, { kind: "component", type: i7$1.NzTableComponent, selector: "nz-table", inputs: ["nzTableLayout", "nzShowTotal", "nzItemRender", "nzTitle", "nzFooter", "nzNoResult", "nzPageSizeOptions", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualForTrackBy", "nzLoadingDelay", "nzPageIndex", "nzPageSize", "nzTotal", "nzWidthConfig", "nzData", "nzCustomColumn", "nzPaginationPosition", "nzScroll", "noDataVirtualHeight", "nzPaginationType", "nzFrontPagination", "nzTemplateMode", "nzShowPagination", "nzLoading", "nzOuterBordered", "nzLoadingIndicator", "nzBordered", "nzSize", "nzShowSizeChanger", "nzHideOnSinglePage", "nzShowQuickJumper", "nzSimple"], outputs: ["nzPageSizeChange", "nzPageIndexChange", "nzQueryParams", "nzCurrentPageDataChange", "nzCustomColumnChange"], exportAs: ["nzTable"] }, { kind: "component", type: i7$1.NzThAddOnComponent, selector: "th[nzColumnKey], th[nzSortFn], th[nzSortOrder], th[nzFilters], th[nzShowSort], th[nzShowFilter], th[nzCustomFilter]", inputs: ["nzColumnKey", "nzFilterMultiple", "nzSortOrder", "nzSortPriority", "nzSortDirections", "nzFilters", "nzSortFn", "nzFilterFn", "nzShowSort", "nzShowFilter", "nzCustomFilter"], outputs: ["nzCheckedChange", "nzSortOrderChange", "nzFilterChange"] }, { kind: "directive", type: i7$1.NzTableCellDirective, selector: "th:not(.nz-disable-th), td:not(.nz-disable-td)" }, { kind: "directive", type: i7$1.NzThMeasureDirective, selector: "th", inputs: ["nzWidth", "colspan", "colSpan", "rowspan", "rowSpan"] }, { kind: "component", type: i7$1.NzTheadComponent, selector: "thead:not(.ant-table-thead)", outputs: ["nzSortOrderChange"] }, { kind: "component", type: i7$1.NzTbodyComponent, selector: "tbody" }, { kind: "directive", type: i7$1.NzTrDirective, selector: "tr:not([nz-table-measure-row]):not([nzExpand]):not([nz-table-fixed-row])" }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i11.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i9$1.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i11$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i11$1.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i11$2.NzDropdownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzArrow", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i11$2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "ngmodule", type: NzMenuModule }, { kind: "component", type: PaginationComponent, selector: "vl-pagination", inputs: ["itemInfo", "pageSize", "currentPage", "selectedLanguageInfo", "pages"], outputs: ["pageSizeChange", "onGoToPage"] }, { kind: "directive", type: CustomKeyboardDirective, selector: "[vlCustomKeyboard]", inputs: ["vlCustomKeyboard"] }, { kind: "pipe", type: VisiblePipe, name: "vlVisible" }, { kind: "pipe", type: i9.DecimalPipe, name: "number" }] });
|
|
9181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: GridComponent, isStandalone: true, selector: "vl-grid", inputs: { errorMessages: "errorMessages", environment: "environment", selectedLanguageInfo: "selectedLanguageInfo", tableitemInfo: "tableitemInfo", form: "form", isTableDataLoad: "isTableDataLoad", currenTableOptions: "currenTableOptions", projectSeleted: "projectSeleted", pageSize: "pageSize", currentPage: "currentPage", pages: "pages", userInfo: "userInfo", pageData: "pageData" }, outputs: { editRow: "editRow", onPageChange: "onPageChange", onPageSizeChange: "onPageSizeChange", onGridScroll: "onGridScroll", showGridLink: "showGridLink", gridButtonClick: "gridButtonClick", gridIncreamentClick: "gridIncreamentClick", gridDecreamentClick: "gridDecreamentClick", gridImgClick: "gridImgClick" }, viewQueries: [{ propertyName: "gridForm", first: true, predicate: ["gridForm"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - change: caption and date pattern from the layout - a data object holds names and types only -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22\r\n - change: the delete icon of a row goes through deleteRow (PageData for a browser list, A4)\r\n - new: editing as the page sets it (layoutSchema.edit.mode): \"row\" - pencil, the unlocked cells of\r\n that row become <vl-control mode=\"edit\"> (every type, checked like the dialog), \u2713 saves, \u2715 cancels;\r\n \"dialog\" - pencil opens the page's dialog with the record; without edit the grid is read only.\r\n The old inputs that wrote text, number and check box cells into the row without saving are gone\r\n - fix: the table takes its style from its page (layoutSchema.style); the menu or header option's style\r\n is the style of that button - luv2shop's cart table got the cart pill's max-width 90px -->\r\n<!-- Shuaib 2026-10-20\r\n - change: the cells that show a value are drawn by the shared <vl-control> in display mode (#166):\r\n the row's value of every type, read only - date, time, drop-down, autocomplete and period cells\r\n were inputs bound to the form's property (the same value in every row); integer and bigdecimal\r\n columns stayed empty\r\n - kept: unlocked text and number cells (typed in, saved by the action column), quantity +/-, multiply,\r\n the check box of the row, action columns, buttons, the footer\r\n - change: a locked check box is shown read only; it could be ticked\r\n - fix: action icons, button and footer labels read style.classes?.[0]; a style without classes (the Designer's default {}) threw -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - new: date and time in one value (type datetime or control dateTimepicker): field and display (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: the footer's number field is the one vl-number (#166 step 4.4)\r\n - change: the footer's text field is the one vl-textbox (#166 step 4.4)\r\n - change: cells and footer follow the layout's control (password, textArea, switch, combobox) with the\r\n shared controls, cells read only and compact (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - change: footer fields: rules only from the layout (vlRules) and the message of the first error (#166 step 4.6)\r\n - change: fields/columns with option.visible false are left out (vlVisible, #166)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: date and time cells use the shared picker markup (picker-field, DateTimePickerService);\r\n their PrimeNG icon opened the calendar together with the system keyboard -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: grid cells render legacy checkbox fields through the boolean control. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: @contract comments on the sorting, on the column filter and on the footer. The filter\r\n reads option.filter and never option.columnFilter, which is the mistake a layout author\r\n makes without being told -->\r\n<div *ngIf=\"!tableitemInfo.data?.length\" class=\"alert alert-warning col-md-12\"\r\n role=\"alert\">\r\n {{ tableitemInfo.layoutSchema?.noRecordMessage}}\r\n</div>\r\n<div *ngIf=\"tableitemInfo.data?.length\" class=\"reservation-container pt-5 px-3\">\r\n <!-- the controls of the row being edited join this form, so \u2713 checks them like the dialog does -->\r\n <form #gridForm=\"ngForm\" (ngSubmit)=\"saveRow()\">\r\n <nz-table #basicTable [nzData]=\"gridDisplayData\"\r\n [nzNoResult]=\"'No matching records found'\" [nzBordered]=\"true\"\r\n [nzFrontPagination]=\"currenTableOptions?.pagination?.tabs\"\r\n [style]=\"getStyleWithoutClasses(tableitemInfo?.layoutSchema?.style).style\"\r\n (scroll)=\"onScrollEvent($event)\"\r\n [nzLoading]=\"isTableDataLoad\">\r\n <thead>\r\n <!-- @contract decision: option.sortable is read here\r\n reality: nzSortFn is wired to getColumnSortFn since 2026-09-16; before that\r\n the key was decoration. The column also needs a scope.reference -\r\n without one getColumnSortFn has nothing to sort by.\r\n seen: grid.component.ts:338 -->\r\n <!-- Column headings and sorting -->\r\n <tr>\r\n <th *ngFor=\"let column of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n [nzSortFn]=\"\r\n column?.option?.sortable\r\n ? getColumnSortFn(column)\r\n : false\r\n \"\r\n [class.grid-cell--editing]=\"editingRow && editableCol(column)\"\r\n [class.grid-cell--wide]=\"editingRow && editableCol(column) && wideEditCell(column)\">\r\n\r\n {{ column?.label?.caption }}\r\n </th>\r\n <th *ngIf=\"canEdit\" class=\"grid-edit-cell\"></th>\r\n </tr>\r\n\r\n <!-- @contract decision: the column filter reads option.filter, NOT option.columnFilter\r\n reality: option.filter.filtering switches it on, option.filter.defaultOperator\r\n starts the comparison (the renderer falls back to contains), and\r\n option.filter.placeholder labels the input.\r\n failure: option.columnFilter is read nowhere, here or in the runtime app. A\r\n column carrying it looks filterable in the file and is not on screen.\r\n seen: grid.component.ts:450-475; 5 uses of columnFilter across the reference\r\n projects, all of them dead -->\r\n <!-- Column filters -->\r\n <tr *ngIf=\"hasAnyColumnFilter()\" class=\"grid-filter-row\">\r\n\r\n <th *ngFor=\"let column of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n class=\"grid-filter-cell\">\r\n\r\n <ng-container *ngIf=\"\r\n column?.option?.filter?.filtering === true &&\r\n column?.scope?.reference\r\n \">\r\n\r\n <div class=\"grid-filter-input-wrapper\">\r\n <input type=\"text\" class=\"grid-filter-input\" vlCustomKeyboard=\"string\"\r\n [placeholder]=\"getColumnFilterPlaceholder(column)\"\r\n [ngModel]=\"getColumnFilterState(column).value\"\r\n (ngModelChange)=\"\r\n setColumnFilterValue(column, $event)\r\n \" />\r\n\r\n <!-- Operator selection button -->\r\n <button type=\"button\"\r\n class=\"grid-filter-operator-button\" nz-dropdown\r\n nzTrigger=\"click\"\r\n [nzDropdownMenu]=\"operatorMenu\"\r\n [class.grid-filter-operator-button--active]=\"\r\n hasActiveColumnFilter(column)\r\n \" [title]=\"\r\n 'Operator: ' +\r\n getFilterOperatorLabel(\r\n getColumnFilterState(column).operator\r\n )\r\n \">\r\n\r\n <span nz-icon nzType=\"filter\"></span>\r\n </button>\r\n\r\n <!-- Clear current column filter -->\r\n <button *ngIf=\"hasActiveColumnFilter(column)\"\r\n type=\"button\" class=\"grid-filter-clear-button\"\r\n aria-label=\"Clear column filter\"\r\n title=\"Clear filter\"\r\n (click)=\"clearColumnFilter(column)\">\r\n\r\n <span nz-icon nzType=\"close\"></span>\r\n </button>\r\n </div>\r\n\r\n <!-- Operator dropdown -->\r\n <nz-dropdown-menu #operatorMenu=\"nzDropdownMenu\">\r\n <ul nz-menu class=\"grid-filter-operator-menu\">\r\n <li *ngFor=\"let operator of filterOperators\"\r\n nz-menu-item [nzSelected]=\"\r\n getColumnFilterState(column).operator ===\r\n operator.value\r\n \" (click)=\"\r\n setColumnFilterOperator(\r\n column,\r\n operator.value\r\n )\r\n \">\r\n\r\n <span *ngIf=\"\r\n getColumnFilterState(column).operator ===\r\n operator.value\r\n \" nz-icon nzType=\"check\">\r\n </span>\r\n\r\n {{ operator.label }}\r\n </li>\r\n </ul>\r\n </nz-dropdown-menu>\r\n </ng-container>\r\n </th>\r\n <th *ngIf=\"canEdit\" class=\"grid-edit-cell\"></th>\r\n </tr>\r\n </thead>\r\n <!-- @contract decision: a cell shows the row's value through <vl-control mode=\"display\">\r\n reality: every type is shown (integer, bigdecimal and the credit card stayed empty before);\r\n unlocked text and number cells, quantity, multiply and the check box keep their own\r\n blocks, because they write into the row.\r\n\r\n @contract decision: columns without scope.reference are valid\r\n reality: with option.actionColumn they render save/delete icons, otherwise a\r\n button. That is why the conditions below all guard on the reference. -->\r\n <tbody>\r\n <tr *ngFor=\"let data of basicTable.data; let i = index\">\r\n <td *ngFor=\"let col of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n [style]=\"getStyleWithoutClasses(col?.scope?.style).style\"\r\n [class.grid-cell--editing]=\"cellEditing(col, data)\"\r\n [class.grid-cell--wide]=\"cellEditing(col, data) && wideEditCell(col)\">\r\n <!-- a column without property: action icons or a button. Unlocked text and number cells\r\n are typed in (the row is saved by the action column), a check box ticks the row; every\r\n other cell shows the row's value through the shared <vl-control> in display mode -->\r\n @if (cellEditing(col, data)) {\r\n <vl-control mode=\"edit\" [field]=\"col\" [propertySchema]=\"rowSchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\" [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"rowSaveTried\" [list]=\"remoteData[col.scope.reference]\"\r\n [hideLabel]=\"true\" [compact]=\"true\">\r\n </vl-control>\r\n } @else if (!col?.scope?.reference) {\r\n <span *ngIf=\"col.option?.actionColumn\">\r\n <span nz-icon\r\n *ngIf=\"setActionColumn(col.option?.save, data)\"\r\n [nzType]=\"col.option?.save?.icon\"\r\n [nzTheme]=\"'twotone'\"\r\n [style]=\"col.option?.save?.style\"\r\n [nzTwotoneColor]=\"'#52c41a'\"\r\n [class]=\"col.option?.save?.style?.classes?.[0]\"\r\n (click)=\"upsertAction(col.option?.save, data)\">\r\n </span>\r\n <span nz-icon\r\n *ngIf=\"setActionColumn(col.option?.delete, data)\"\r\n [nzType]=\"col.option?.delete?.icon\"\r\n [nzTheme]=\"'twotone'\"\r\n [style]=\"col.option?.delete?.style\"\r\n [nzTwotoneColor]=\"'#FF0000'\"\r\n [class]=\"col.option?.delete?.style?.classes?.[0]\"\r\n (click)=\"deleteRow(col.option?.delete, data)\"></span>\r\n\r\n </span>\r\n <span *ngIf=\"!col.option?.actionColumn\">\r\n <button type=\"submit\"\r\n [style]=\"getStyleWithoutClasses(col?.label?.style).style\"\r\n (click)=\"invokeGridBtnClick(col.option, data)\"\r\n [class]=\"col?.label?.style?.classes?.[0]\">\r\n {{ col.label?.caption }}\r\n </button>\r\n </span>\r\n } @else if (cellType(col) === 'quantity') {\r\n <div style=\"display: flex; align-items: center;\">\r\n <button pButton icon=\"pi pi-minus\"\r\n (click)=\"decrementQuantity(i,col.scope?.reference.split('/').pop(), col.option)\"\r\n [disabled]=\"data.quantity <= 0\"\r\n style=\"margin-right: 8px; height: 10px; width: 10px;\"></button>\r\n <span>{{ data[col.scope?.reference.split('/').pop()]\r\n }}</span>\r\n <button pButton icon=\"pi pi-plus\"\r\n (click)=\"incrementQuantity(i, col.scope?.reference.split('/').pop(), col.option)\"\r\n style=\"margin-left: 8px; height: 10px; width: 10px;\"></button>\r\n </div>\r\n } @else if (cellType(col) === 'number' && col.option?.innerAction?.action == 'multiply') {\r\n <span>{{ (data[col.option?.innerAction?.from] * data[col.option?.innerAction?.to]) | number:'1.2-2' }}</span>\r\n } @else {\r\n <vl-control mode=\"display\" [field]=\"col\" [record]=\"data\"\r\n [propertySchema]=\"tableitemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [list]=\"remoteData[col.scope.reference]\"\r\n [hideLabel]=\"true\" [styleValue]=\"false\" [compact]=\"true\"\r\n (linkClicked)=\"showLinkDetails(col.option, data)\"\r\n (mediaClicked)=\"invokeTableImageClick(col, data)\">\r\n </vl-control>\r\n }\r\n </td>\r\n <!-- edit: pencil, or \u2713 save / \u2715 cancel on the row being edited (layoutSchema.edit) -->\r\n <td *ngIf=\"canEdit\" class=\"grid-edit-cell\">\r\n @if (editingRow === data) {\r\n <button type=\"submit\" class=\"grid-edit-btn grid-edit-btn--save\" [attr.aria-label]=\"t('Save')\"\r\n data-vl-action=\"saveRow\">✓</button>\r\n <button type=\"button\" class=\"grid-edit-btn\" [attr.aria-label]=\"t('Cancel')\"\r\n data-vl-action=\"cancelRow\" (click)=\"cancelEdit()\">✕</button>\r\n } @else {\r\n <button type=\"button\" class=\"grid-edit-btn\" [attr.aria-label]=\"t('Edit')\" [disabled]=\"editingRow\"\r\n data-vl-action=\"editRow\" (click)=\"startEdit(data)\">✎</button>\r\n }\r\n </td>\r\n </tr>\r\n </tbody>\r\n </nz-table>\r\n </form>\r\n</div>\r\n\r\n<!-- table footer -->\r\n<div *ngIf=\"tableitemInfo?.footer?.formFields && tableitemInfo.data?.length\"\r\n class=\"table-footer flex flex-column align-items-end gap-2 pt-2 mx-4 border-top-1 border-cyan-500\">\r\n <!-- @contract decision: the footer renders string and number only\r\n reality: the switch below carries those two cases and a default. It did NOT change\r\n when the columns gained their types on 2026-09-18.\r\n failure: any other type in a footer field renders empty.\r\n instead: keep aggregates numeric, or pre-format them as text in the endpoint. -->\r\n <div *ngFor=\"let tableField of tableitemInfo?.footer?.formFields | vlVisible\">\r\n <!-- the layout's control decides (#166 step 4.4): the shared controls, editable -->\r\n @switch (cellControl(tableField)) {\r\n @case ('password') {\r\n <vl-password [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-password>\r\n }\r\n @case ('textArea') {\r\n <vl-textarea [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [keyboard]=\"keyboardTypeFor(tableField, tableitemInfo.propertySchema)\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-textarea>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [type]=\"propertyType(tableField)\"\r\n [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-switch>\r\n }\r\n @case ('radiobutton') {\r\n <vl-radio [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [type]=\"propertyType(tableField) === 'boolean' ? 'boolean' : 'string'\"\r\n [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-radio>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [combobox]=\"true\"\r\n [list]=\"remoteData[tableField.scope?.reference]\" [loading]=\"false\"\r\n [keyboard]=\"keyboardTypeFor(tableField, tableitemInfo.propertySchema)\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-autocomplete>\r\n }\r\n @default {\r\n <div\r\n [ngSwitch]=\"tableField?.scope?.reference && tableitemInfo.propertySchema[getScope(tableField.scope?.reference)] && tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()] ?\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.type : 'default'\">\r\n\r\n <!-- string control -->\r\n <div *ngSwitchCase=\"'string'\" class=\"form-group\">\r\n <span *ngIf=\"tableField.option.protected\">\r\n <h5 style=\"display: flex; justify-content: space-between;\">\r\n <span\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">\r\n {{\r\n (tableField.label?.value || tableField.label?.caption || '')\r\n }}\r\n </span>\r\n <span>\r\n {{\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.value\r\n }}\r\n </span>\r\n </h5>\r\n </span>\r\n <div *ngIf=\"!tableField.option.protected\">\r\n <div\r\n [class]=\"tableField?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">{{\r\n tableField.label?.value ?\r\n tableField.label?.value :\r\n (tableField.label?.value || tableField.label?.caption || '')\r\n }}</label>\r\n <vl-textbox [formField]=\"tableField\" [modalItemInfo]=\"tableitemInfo\" [saveTried]=\"false\"\r\n [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\"></vl-textbox>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- number control -->\r\n <div *ngSwitchCase=\"'number'\" class=\"form-group\">\r\n <span *ngIf=\"tableField.option.protected\"\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">\r\n <h5>{{\r\n (tableField.label?.value || tableField.label?.caption || '')\r\n }} <vl-number style=\"display:inline-block\" [field]=\"tableField\" [readonly]=\"true\" [value]=\"form.propertySchema[getScope(tableField.scope?.reference)]?.[tableField.scope?.reference.split('/').pop()]?.value\" [property]=\"form.propertySchema[getScope(tableField.scope?.reference)]?.[tableField.scope?.reference.split('/').pop()]\" [row]=\"form.propertySchema[getScope(tableField.scope?.reference)]\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-number>\r\n </h5>\r\n </span>\r\n <span *ngIf=\"!tableField.option.protected\">\r\n <div\r\n [class]=\"tableField?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">{{\r\n tableField.label?.value ?\r\n tableField.label?.value :\r\n (tableField.label?.value || tableField.label?.caption || '')\r\n }}</label>\r\n <vl-number [field]=\"tableField\" [target]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [property]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [row]=\"form.propertySchema[getScope(tableField.scope?.reference)]\"\r\n [type]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.type || 'number'\"\r\n [keyboard]=\"keyboardTypeFor(tableField, form.propertySchema)\" [saveTried]=\"false\"\r\n [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\"\r\n [translations]=\"selectedLanguageInfo?.selectedLanguage\"\r\n [inputStyle]=\"getStyleWithoutClasses(tableField?.scope?.style).style\"\r\n [inputClass]=\"tableField.scope?.style?.classes?.[0] ?? ''\"></vl-number>\r\n </div>\r\n\r\n </span>\r\n </div>\r\n\r\n <!-- button control -->\r\n <div *ngSwitchCase=\"'default'\">\r\n <button type=\"submit\"\r\n [style]=\"getStyleWithoutClasses(tableField.label.style).style\"\r\n (click)=\"invokeGridBtnClick(tableField.option, tableitemInfo.propertySchema)\">\r\n {{ tableField.label?.caption }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</div>\r\n\r\n<!-- bottom pagination on grid -->\r\n<div\r\n *ngIf=\"tableitemInfo.data?.length && !tableitemInfo?.layoutSchema?.pagination?.top && tableitemInfo?.layoutSchema?.pagination?.bottom\">\r\n <vl-pagination [itemInfo]=\"tableitemInfo\" [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n</div>\r\n", styles: [".grid-filter-row th{padding:8px;vertical-align:middle;background:#fafafa}.grid-filter-cell{min-width:150px}.grid-filter-input-wrapper{display:flex;align-items:stretch;width:100%}.grid-filter-input{width:100%;min-width:0;min-height:34px;padding:5px 8px;border:1px solid #d9d9d9;border-right:0;border-radius:4px 0 0 4px;outline:none}.grid-filter-input:focus{border-color:#1677ff}.grid-filter-operator-button,.grid-filter-clear-button{display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:34px;padding:0;cursor:pointer;background:#fff;border:1px solid #d9d9d9}.grid-filter-operator-button{color:#595959;border-radius:0 4px 4px 0}.grid-filter-operator-button:hover,.grid-filter-operator-button--active{color:#1677ff;border-color:#1677ff}.grid-filter-clear-button{margin-left:5px;color:#ff4d4f;border-radius:4px}.grid-filter-clear-button:hover{color:#fff;background:#ff4d4f;border-color:#ff4d4f}.grid-filter-operator-menu{min-width:190px}:host ::ng-deep .ant-table-content.has-more-right{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent)}:host ::ng-deep .ant-table-content.has-more-left{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent)}:host ::ng-deep .ant-table-content.has-more-left.has-more-right{-webkit-mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent)}::ng-deep :where(.grid-edit-cell){width:1%;white-space:nowrap;text-align:center}::ng-deep :where(.grid-edit-btn){min-width:32px;height:32px;margin:0 2px;border:1px solid #d1d5db;border-radius:4px;background:#fff;cursor:pointer;font-size:15px;line-height:1}::ng-deep :where(.grid-edit-btn--save){border-color:#16a34a;background:#16a34a;color:#fff}::ng-deep :where(.grid-edit-btn:disabled){opacity:.4;cursor:default}::ng-deep :where(.grid-cell--editing){min-width:160px}::ng-deep :where(.grid-cell--wide){min-width:240px}.grid-cell--editing ::ng-deep vl-control,.grid-cell--editing ::ng-deep vl-textbox input,.grid-cell--editing ::ng-deep vl-password input,.grid-cell--editing ::ng-deep vl-textarea textarea,.grid-cell--editing ::ng-deep .ant-picker,.grid-cell--editing ::ng-deep .ant-select{display:block;width:100%!important;max-width:100%;box-sizing:border-box}\n"], dependencies: [{ kind: "component", type: ControlComponent, selector: "vl-control", inputs: ["field", "propertySchema", "selectedLanguageInfo", "errorMessages", "saveTried", "container", "buttonType", "locked", "lockHints", "mode", "record", "hideLabel", "styleValue", "compact", "list", "listLoading", "creditCardError"], outputs: ["picked", "changed", "opened", "toggled", "linkClicked", "mediaClicked", "buttonClick", "lockedClick", "signIn"] }, { kind: "component", type: Textbox, selector: "vl-textbox", inputs: ["formField", "modalItemInfo", "saveTried", "errorMessages", "readonly", "value"], outputs: ["linkClicked"] }, { kind: "component", type: Autocomplete, selector: "vl-autocomplete", inputs: ["field", "target", "value", "readonly", "list", "loading", "combobox", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"], outputs: ["picked"] }, { kind: "component", type: PasswordControl, selector: "vl-password", inputs: ["field", "target", "value", "readonly", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"] }, { kind: "component", type: TextareaControl, selector: "vl-textarea", inputs: ["field", "target", "value", "readonly", "compact", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass"] }, { kind: "component", type: SwitchControl, selector: "vl-switch", inputs: ["field", "target", "value", "readonly", "type", "translations"], outputs: ["switched"] }, { kind: "component", type: RadioControl, selector: "vl-radio", inputs: ["field", "target", "value", "readonly", "type", "saveTried", "errorMessages", "translations"], outputs: ["chosen"] }, { kind: "component", type: NumberControl, selector: "vl-number", inputs: ["field", "target", "value", "readonly", "type", "keyboard", "saveTried", "errorMessages", "translations", "inputStyle", "inputClass", "property", "row"], outputs: ["changed"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i9.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NzTableModule }, { kind: "component", type: i7$1.NzTableComponent, selector: "nz-table", inputs: ["nzTableLayout", "nzShowTotal", "nzItemRender", "nzTitle", "nzFooter", "nzNoResult", "nzPageSizeOptions", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualForTrackBy", "nzLoadingDelay", "nzPageIndex", "nzPageSize", "nzTotal", "nzWidthConfig", "nzData", "nzCustomColumn", "nzPaginationPosition", "nzScroll", "noDataVirtualHeight", "nzPaginationType", "nzFrontPagination", "nzTemplateMode", "nzShowPagination", "nzLoading", "nzOuterBordered", "nzLoadingIndicator", "nzBordered", "nzSize", "nzShowSizeChanger", "nzHideOnSinglePage", "nzShowQuickJumper", "nzSimple"], outputs: ["nzPageSizeChange", "nzPageIndexChange", "nzQueryParams", "nzCurrentPageDataChange", "nzCustomColumnChange"], exportAs: ["nzTable"] }, { kind: "component", type: i7$1.NzThAddOnComponent, selector: "th[nzColumnKey], th[nzSortFn], th[nzSortOrder], th[nzFilters], th[nzShowSort], th[nzShowFilter], th[nzCustomFilter]", inputs: ["nzColumnKey", "nzFilterMultiple", "nzSortOrder", "nzSortPriority", "nzSortDirections", "nzFilters", "nzSortFn", "nzFilterFn", "nzShowSort", "nzShowFilter", "nzCustomFilter"], outputs: ["nzCheckedChange", "nzSortOrderChange", "nzFilterChange"] }, { kind: "directive", type: i7$1.NzTableCellDirective, selector: "th:not(.nz-disable-th), td:not(.nz-disable-td)" }, { kind: "directive", type: i7$1.NzThMeasureDirective, selector: "th", inputs: ["nzWidth", "colspan", "colSpan", "rowspan", "rowSpan"] }, { kind: "component", type: i7$1.NzTheadComponent, selector: "thead:not(.ant-table-thead)", outputs: ["nzSortOrderChange"] }, { kind: "component", type: i7$1.NzTbodyComponent, selector: "tbody" }, { kind: "directive", type: i7$1.NzTrDirective, selector: "tr:not([nz-table-measure-row]):not([nzExpand]):not([nz-table-fixed-row])" }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i11.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i9$1.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i11$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i11$1.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i11$2.NzDropdownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzArrow", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i11$2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "ngmodule", type: NzMenuModule }, { kind: "component", type: PaginationComponent, selector: "vl-pagination", inputs: ["itemInfo", "pageSize", "currentPage", "selectedLanguageInfo", "pages"], outputs: ["pageSizeChange", "onGoToPage"] }, { kind: "directive", type: CustomKeyboardDirective, selector: "[vlCustomKeyboard]", inputs: ["vlCustomKeyboard"] }, { kind: "pipe", type: VisiblePipe, name: "vlVisible" }, { kind: "pipe", type: i9.DecimalPipe, name: "number" }] });
|
|
8684
9182
|
}
|
|
8685
9183
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: GridComponent, decorators: [{
|
|
8686
9184
|
type: Component,
|
|
@@ -8704,7 +9202,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
8704
9202
|
NzMenuModule,
|
|
8705
9203
|
PaginationComponent,
|
|
8706
9204
|
CustomKeyboardDirective,
|
|
8707
|
-
], selector: 'vl-grid', template: "<!-- Shuaib 2026-10-20\r\n - change: the cells that show a value are drawn by the shared <vl-control> in display mode (#166):\r\n the row's value of every type, read only - date, time, drop-down, autocomplete and period cells\r\n were inputs bound to the form's property (the same value in every row); integer and bigdecimal\r\n columns stayed empty\r\n - kept: unlocked text and number cells (typed in, saved by the action column), quantity +/-, multiply,\r\n the check box of the row, action columns, buttons, the footer\r\n - change: a locked check box is shown read only; it could be ticked\r\n - fix: action icons, button and footer labels read style.classes?.[0]; a style without classes (the Designer's default {}) threw -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - new: date and time in one value (type datetime or control dateTimepicker): field and display (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: the footer's number field is the one vl-number (#166 step 4.4)\r\n - change: the footer's text field is the one vl-textbox (#166 step 4.4)\r\n - change: cells and footer follow the layout's control (password, textArea, switch, combobox) with the\r\n shared controls, cells read only and compact (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - change: footer fields: rules only from the layout (vlRules) and the message of the first error (#166 step 4.6)\r\n - change: fields/columns with option.visible false are left out (vlVisible, #166)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: date and time cells use the shared picker markup (picker-field, DateTimePickerService);\r\n their PrimeNG icon opened the calendar together with the system keyboard -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: grid cells render legacy checkbox fields through the boolean control. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: @contract comments on the sorting, on the column filter and on the footer. The filter\r\n reads option.filter and never option.columnFilter, which is the mistake a layout author\r\n makes without being told -->\r\n<div *ngIf=\"!tableitemInfo.data?.length\" class=\"alert alert-warning col-md-12\"\r\n role=\"alert\">\r\n {{ tableitemInfo.layoutSchema?.noRecordMessage}}\r\n</div>\r\n<div *ngIf=\"tableitemInfo.data?.length\" class=\"reservation-container pt-5 px-3\">\r\n <nz-table #basicTable [nzData]=\"gridDisplayData\"\r\n [nzNoResult]=\"'No matching records found'\" [nzBordered]=\"true\"\r\n [nzFrontPagination]=\"currenTableOptions?.pagination?.tabs\"\r\n [style]=\"getStyleWithoutClasses(currenTableOptions?.style).style\"\r\n (scroll)=\"onScrollEvent($event)\"\r\n [nzLoading]=\"isTableDataLoad\">\r\n <thead>\r\n <!-- @contract decision: option.sortable is read here\r\n reality: nzSortFn is wired to getColumnSortFn since 2026-09-16; before that\r\n the key was decoration. The column also needs a scope.reference -\r\n without one getColumnSortFn has nothing to sort by.\r\n seen: grid.component.ts:338 -->\r\n <!-- Column headings and sorting -->\r\n <tr>\r\n <th *ngFor=\"let column of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n [nzSortFn]=\"\r\n column?.option?.sortable\r\n ? getColumnSortFn(column)\r\n : false\r\n \">\r\n\r\n {{ column?.label?.caption }}\r\n </th>\r\n </tr>\r\n\r\n <!-- @contract decision: the column filter reads option.filter, NOT option.columnFilter\r\n reality: option.filter.filtering switches it on, option.filter.defaultOperator\r\n starts the comparison (the renderer falls back to contains), and\r\n option.filter.placeholder labels the input.\r\n failure: option.columnFilter is read nowhere, here or in the runtime app. A\r\n column carrying it looks filterable in the file and is not on screen.\r\n seen: grid.component.ts:450-475; 5 uses of columnFilter across the reference\r\n projects, all of them dead -->\r\n <!-- Column filters -->\r\n <tr *ngIf=\"hasAnyColumnFilter()\" class=\"grid-filter-row\">\r\n\r\n <th *ngFor=\"let column of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n class=\"grid-filter-cell\">\r\n\r\n <ng-container *ngIf=\"\r\n column?.option?.filter?.filtering === true &&\r\n column?.scope?.reference\r\n \">\r\n\r\n <div class=\"grid-filter-input-wrapper\">\r\n <input type=\"text\" class=\"grid-filter-input\" vlCustomKeyboard=\"string\"\r\n [placeholder]=\"getColumnFilterPlaceholder(column)\"\r\n [ngModel]=\"getColumnFilterState(column).value\"\r\n (ngModelChange)=\"\r\n setColumnFilterValue(column, $event)\r\n \" />\r\n\r\n <!-- Operator selection button -->\r\n <button type=\"button\"\r\n class=\"grid-filter-operator-button\" nz-dropdown\r\n nzTrigger=\"click\"\r\n [nzDropdownMenu]=\"operatorMenu\"\r\n [class.grid-filter-operator-button--active]=\"\r\n hasActiveColumnFilter(column)\r\n \" [title]=\"\r\n 'Operator: ' +\r\n getFilterOperatorLabel(\r\n getColumnFilterState(column).operator\r\n )\r\n \">\r\n\r\n <span nz-icon nzType=\"filter\"></span>\r\n </button>\r\n\r\n <!-- Clear current column filter -->\r\n <button *ngIf=\"hasActiveColumnFilter(column)\"\r\n type=\"button\" class=\"grid-filter-clear-button\"\r\n aria-label=\"Clear column filter\"\r\n title=\"Clear filter\"\r\n (click)=\"clearColumnFilter(column)\">\r\n\r\n <span nz-icon nzType=\"close\"></span>\r\n </button>\r\n </div>\r\n\r\n <!-- Operator dropdown -->\r\n <nz-dropdown-menu #operatorMenu=\"nzDropdownMenu\">\r\n <ul nz-menu class=\"grid-filter-operator-menu\">\r\n <li *ngFor=\"let operator of filterOperators\"\r\n nz-menu-item [nzSelected]=\"\r\n getColumnFilterState(column).operator ===\r\n operator.value\r\n \" (click)=\"\r\n setColumnFilterOperator(\r\n column,\r\n operator.value\r\n )\r\n \">\r\n\r\n <span *ngIf=\"\r\n getColumnFilterState(column).operator ===\r\n operator.value\r\n \" nz-icon nzType=\"check\">\r\n </span>\r\n\r\n {{ operator.label }}\r\n </li>\r\n </ul>\r\n </nz-dropdown-menu>\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </thead>\r\n <!-- @contract decision: a cell shows the row's value through <vl-control mode=\"display\">\r\n reality: every type is shown (integer, bigdecimal and the credit card stayed empty before);\r\n unlocked text and number cells, quantity, multiply and the check box keep their own\r\n blocks, because they write into the row.\r\n\r\n @contract decision: columns without scope.reference are valid\r\n reality: with option.actionColumn they render save/delete icons, otherwise a\r\n button. That is why the conditions below all guard on the reference. -->\r\n <tbody>\r\n <tr *ngFor=\"let data of basicTable.data; let i = index\">\r\n <td *ngFor=\"let col of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n [style]=\"getStyleWithoutClasses(col?.scope?.style).style\">\r\n <!-- a column without property: action icons or a button. Unlocked text and number cells\r\n are typed in (the row is saved by the action column), a check box ticks the row; every\r\n other cell shows the row's value through the shared <vl-control> in display mode -->\r\n @if (!col?.scope?.reference) {\r\n <span *ngIf=\"col.option?.actionColumn\">\r\n <span nz-icon\r\n *ngIf=\"setActionColumn(col.option?.save, data)\"\r\n [nzType]=\"col.option?.save?.icon\"\r\n [nzTheme]=\"'twotone'\"\r\n [style]=\"col.option?.save?.style\"\r\n [nzTwotoneColor]=\"'#52c41a'\"\r\n [class]=\"col.option?.save?.style?.classes?.[0]\"\r\n (click)=\"upsertAction(col.option?.save, data)\">\r\n </span>\r\n <span nz-icon\r\n *ngIf=\"setActionColumn(col.option?.delete, data)\"\r\n [nzType]=\"col.option?.delete?.icon\"\r\n [nzTheme]=\"'twotone'\"\r\n [style]=\"col.option?.delete?.style\"\r\n [nzTwotoneColor]=\"'#FF0000'\"\r\n [class]=\"col.option?.delete?.style?.classes?.[0]\"\r\n (click)=\"upsertAction(col.option?.delete, data)\"></span>\r\n\r\n </span>\r\n <span *ngIf=\"!col.option?.actionColumn\">\r\n <button type=\"submit\"\r\n [style]=\"getStyleWithoutClasses(col?.label?.style).style\"\r\n (click)=\"invokeGridBtnClick(col.option, data)\"\r\n [class]=\"col?.label?.style?.classes?.[0]\">\r\n {{ col.label?.caption }}\r\n </button>\r\n </span>\r\n } @else if (cellType(col) === 'quantity') {\r\n <div style=\"display: flex; align-items: center;\">\r\n <button pButton icon=\"pi pi-minus\"\r\n (click)=\"decrementQuantity(i,col.scope?.reference.split('/').pop(), col.option)\"\r\n [disabled]=\"data.quantity <= 0\"\r\n style=\"margin-right: 8px; height: 10px; width: 10px;\"></button>\r\n <span>{{ data[col.scope?.reference.split('/').pop()]\r\n }}</span>\r\n <button pButton icon=\"pi pi-plus\"\r\n (click)=\"incrementQuantity(i, col.scope?.reference.split('/').pop(), col.option)\"\r\n style=\"margin-left: 8px; height: 10px; width: 10px;\"></button>\r\n </div>\r\n } @else if (inlineEditable(col)) {\r\n @if (cellType(col) === 'number') {\r\n <input [vlCustomKeyboard]=\"keyboardTypeFor(col, tableitemInfo.propertySchema)\"\r\n [(ngModel)]=\"data[col.scope?.reference.split('/').pop()]\"\r\n type=\"number\"\r\n class=\"p-inputtext p-component\" />\r\n } @else {\r\n <input [vlCustomKeyboard]=\"keyboardTypeFor(col, tableitemInfo.propertySchema)\"\r\n [(ngModel)]=\"data[col.scope?.reference.split('/').pop()]\"\r\n class=\"p-inputtext p-component\" />\r\n }\r\n } @else if (cellType(col) === 'number' && col.option?.innerAction?.action == 'multiply') {\r\n <span>{{ (data[col.option?.innerAction?.from] * data[col.option?.innerAction?.to]) | number:'1.2-2' }}</span>\r\n } @else if (checkboxEditable(col)) {\r\n <vl-checkbox [field]=\"col\" type=\"boolean\" [target]=\"data\" [key]=\"col.scope?.reference.split('/').pop()\"\r\n [inputStyle]=\"getStyleWithoutClasses(col?.scope?.style).style\"></vl-checkbox>\r\n } @else {\r\n <vl-control mode=\"display\" [field]=\"col\" [record]=\"data\"\r\n [propertySchema]=\"tableitemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [list]=\"remoteData[col.scope.reference]\"\r\n [hideLabel]=\"true\" [styleValue]=\"false\" [compact]=\"true\"\r\n (linkClicked)=\"showLinkDetails(col.option, data)\"\r\n (mediaClicked)=\"invokeTableImageClick(col, data)\">\r\n </vl-control>\r\n }\r\n </td>\r\n </tr>\r\n </tbody>\r\n </nz-table>\r\n</div>\r\n\r\n<!-- table footer -->\r\n<div *ngIf=\"tableitemInfo?.footer?.formFields && tableitemInfo.data?.length\"\r\n class=\"table-footer flex flex-column align-items-end gap-2 pt-2 mx-4 border-top-1 border-cyan-500\">\r\n <!-- @contract decision: the footer renders string and number only\r\n reality: the switch below carries those two cases and a default. It did NOT change\r\n when the columns gained their types on 2026-09-18.\r\n failure: any other type in a footer field renders empty.\r\n instead: keep aggregates numeric, or pre-format them as text in the endpoint. -->\r\n <div *ngFor=\"let tableField of tableitemInfo?.footer?.formFields | vlVisible\">\r\n <!-- the layout's control decides (#166 step 4.4): the shared controls, editable -->\r\n @switch (cellControl(tableField)) {\r\n @case ('password') {\r\n <vl-password [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-password>\r\n }\r\n @case ('textArea') {\r\n <vl-textarea [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [keyboard]=\"keyboardTypeFor(tableField, tableitemInfo.propertySchema)\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-textarea>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [type]=\"propertyType(tableField)\"\r\n [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-switch>\r\n }\r\n @case ('radiobutton') {\r\n <vl-radio [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [type]=\"propertyType(tableField) === 'boolean' ? 'boolean' : 'string'\"\r\n [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-radio>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [combobox]=\"true\"\r\n [list]=\"remoteData[tableField.scope?.reference]\" [loading]=\"false\"\r\n [keyboard]=\"keyboardTypeFor(tableField, tableitemInfo.propertySchema)\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-autocomplete>\r\n }\r\n @default {\r\n <div\r\n [ngSwitch]=\"tableField?.scope?.reference && tableitemInfo.propertySchema[getScope(tableField.scope?.reference)] && tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()] ?\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.type : 'default'\">\r\n\r\n <!-- string control -->\r\n <div *ngSwitchCase=\"'string'\" class=\"form-group\">\r\n <span *ngIf=\"tableField.option.protected\">\r\n <h5 style=\"display: flex; justify-content: space-between;\">\r\n <span\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">\r\n {{\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.caption\r\n }}\r\n </span>\r\n <span>\r\n {{\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.value\r\n }}\r\n </span>\r\n </h5>\r\n </span>\r\n <div *ngIf=\"!tableField.option.protected\">\r\n <div\r\n [class]=\"tableField?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">{{\r\n tableField.label?.value ?\r\n tableField.label?.value :\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.caption\r\n }}</label>\r\n <vl-textbox [formField]=\"tableField\" [modalItemInfo]=\"tableitemInfo\" [saveTried]=\"false\"\r\n [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\"></vl-textbox>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- number control -->\r\n <div *ngSwitchCase=\"'number'\" class=\"form-group\">\r\n <span *ngIf=\"tableField.option.protected\"\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">\r\n <h5>{{\r\n form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.caption\r\n }} <vl-number style=\"display:inline-block\" [field]=\"tableField\" [readonly]=\"true\" [value]=\"form.propertySchema[getScope(tableField.scope?.reference)]?.[tableField.scope?.reference.split('/').pop()]?.value\" [property]=\"form.propertySchema[getScope(tableField.scope?.reference)]?.[tableField.scope?.reference.split('/').pop()]\" [row]=\"form.propertySchema[getScope(tableField.scope?.reference)]\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-number>\r\n </h5>\r\n </span>\r\n <span *ngIf=\"!tableField.option.protected\">\r\n <div\r\n [class]=\"tableField?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">{{\r\n tableField.label?.value ?\r\n tableField.label?.value :\r\n form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.caption\r\n }}</label>\r\n <vl-number [field]=\"tableField\" [target]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [property]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [row]=\"form.propertySchema[getScope(tableField.scope?.reference)]\"\r\n [type]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.type || 'number'\"\r\n [keyboard]=\"keyboardTypeFor(tableField, form.propertySchema)\" [saveTried]=\"false\"\r\n [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\"\r\n [translations]=\"selectedLanguageInfo?.selectedLanguage\"\r\n [inputStyle]=\"getStyleWithoutClasses(tableField?.scope?.style).style\"\r\n [inputClass]=\"tableField.scope?.style?.classes?.[0] ?? ''\"></vl-number>\r\n </div>\r\n\r\n </span>\r\n </div>\r\n\r\n <!-- button control -->\r\n <div *ngSwitchCase=\"'default'\">\r\n <button type=\"submit\"\r\n [style]=\"getStyleWithoutClasses(tableField.label.style).style\"\r\n (click)=\"invokeGridBtnClick(tableField.option, tableitemInfo.propertySchema)\">\r\n {{ tableField.label?.caption }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</div>\r\n\r\n<!-- bottom pagination on grid -->\r\n<div\r\n *ngIf=\"tableitemInfo.data?.length && !tableitemInfo?.layoutSchema?.pagination?.top && tableitemInfo?.layoutSchema?.pagination?.bottom\">\r\n <vl-pagination [itemInfo]=\"tableitemInfo\" [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n</div>\r\n", styles: [".grid-filter-row th{padding:8px;vertical-align:middle;background:#fafafa}.grid-filter-cell{min-width:150px}.grid-filter-input-wrapper{display:flex;align-items:stretch;width:100%}.grid-filter-input{width:100%;min-width:0;min-height:34px;padding:5px 8px;border:1px solid #d9d9d9;border-right:0;border-radius:4px 0 0 4px;outline:none}.grid-filter-input:focus{border-color:#1677ff}.grid-filter-operator-button,.grid-filter-clear-button{display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:34px;padding:0;cursor:pointer;background:#fff;border:1px solid #d9d9d9}.grid-filter-operator-button{color:#595959;border-radius:0 4px 4px 0}.grid-filter-operator-button:hover,.grid-filter-operator-button--active{color:#1677ff;border-color:#1677ff}.grid-filter-clear-button{margin-left:5px;color:#ff4d4f;border-radius:4px}.grid-filter-clear-button:hover{color:#fff;background:#ff4d4f;border-color:#ff4d4f}.grid-filter-operator-menu{min-width:190px}:host ::ng-deep .ant-table-content.has-more-right{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent)}:host ::ng-deep .ant-table-content.has-more-left{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent)}:host ::ng-deep .ant-table-content.has-more-left.has-more-right{-webkit-mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent)}\n"] }]
|
|
9205
|
+
], selector: 'vl-grid', template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - change: caption and date pattern from the layout - a data object holds names and types only -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22\r\n - change: the delete icon of a row goes through deleteRow (PageData for a browser list, A4)\r\n - new: editing as the page sets it (layoutSchema.edit.mode): \"row\" - pencil, the unlocked cells of\r\n that row become <vl-control mode=\"edit\"> (every type, checked like the dialog), \u2713 saves, \u2715 cancels;\r\n \"dialog\" - pencil opens the page's dialog with the record; without edit the grid is read only.\r\n The old inputs that wrote text, number and check box cells into the row without saving are gone\r\n - fix: the table takes its style from its page (layoutSchema.style); the menu or header option's style\r\n is the style of that button - luv2shop's cart table got the cart pill's max-width 90px -->\r\n<!-- Shuaib 2026-10-20\r\n - change: the cells that show a value are drawn by the shared <vl-control> in display mode (#166):\r\n the row's value of every type, read only - date, time, drop-down, autocomplete and period cells\r\n were inputs bound to the form's property (the same value in every row); integer and bigdecimal\r\n columns stayed empty\r\n - kept: unlocked text and number cells (typed in, saved by the action column), quantity +/-, multiply,\r\n the check box of the row, action columns, buttons, the footer\r\n - change: a locked check box is shown read only; it could be ticked\r\n - fix: action icons, button and footer labels read style.classes?.[0]; a style without classes (the Designer's default {}) threw -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - new: date and time in one value (type datetime or control dateTimepicker): field and display (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: the footer's number field is the one vl-number (#166 step 4.4)\r\n - change: the footer's text field is the one vl-textbox (#166 step 4.4)\r\n - change: cells and footer follow the layout's control (password, textArea, switch, combobox) with the\r\n shared controls, cells read only and compact (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - change: footer fields: rules only from the layout (vlRules) and the message of the first error (#166 step 4.6)\r\n - change: fields/columns with option.visible false are left out (vlVisible, #166)\r\n - change: every input field gets the toolkit keyboard of its field/attribute (keyboardTypeFor, #166)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: autocompletes get their suggestions from RemoteListService (completeRemote) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: autocomplete fields take the toolkit string keyboard unless option.keyboardType\r\n names another one ('native' keeps the system keyboard)\r\n - change: date and time cells use the shared picker markup (picker-field, DateTimePickerService);\r\n their PrimeNG icon opened the calendar together with the system keyboard -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: grid cells render legacy checkbox fields through the boolean control. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: @contract comments on the sorting, on the column filter and on the footer. The filter\r\n reads option.filter and never option.columnFilter, which is the mistake a layout author\r\n makes without being told -->\r\n<div *ngIf=\"!tableitemInfo.data?.length\" class=\"alert alert-warning col-md-12\"\r\n role=\"alert\">\r\n {{ tableitemInfo.layoutSchema?.noRecordMessage}}\r\n</div>\r\n<div *ngIf=\"tableitemInfo.data?.length\" class=\"reservation-container pt-5 px-3\">\r\n <!-- the controls of the row being edited join this form, so \u2713 checks them like the dialog does -->\r\n <form #gridForm=\"ngForm\" (ngSubmit)=\"saveRow()\">\r\n <nz-table #basicTable [nzData]=\"gridDisplayData\"\r\n [nzNoResult]=\"'No matching records found'\" [nzBordered]=\"true\"\r\n [nzFrontPagination]=\"currenTableOptions?.pagination?.tabs\"\r\n [style]=\"getStyleWithoutClasses(tableitemInfo?.layoutSchema?.style).style\"\r\n (scroll)=\"onScrollEvent($event)\"\r\n [nzLoading]=\"isTableDataLoad\">\r\n <thead>\r\n <!-- @contract decision: option.sortable is read here\r\n reality: nzSortFn is wired to getColumnSortFn since 2026-09-16; before that\r\n the key was decoration. The column also needs a scope.reference -\r\n without one getColumnSortFn has nothing to sort by.\r\n seen: grid.component.ts:338 -->\r\n <!-- Column headings and sorting -->\r\n <tr>\r\n <th *ngFor=\"let column of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n [nzSortFn]=\"\r\n column?.option?.sortable\r\n ? getColumnSortFn(column)\r\n : false\r\n \"\r\n [class.grid-cell--editing]=\"editingRow && editableCol(column)\"\r\n [class.grid-cell--wide]=\"editingRow && editableCol(column) && wideEditCell(column)\">\r\n\r\n {{ column?.label?.caption }}\r\n </th>\r\n <th *ngIf=\"canEdit\" class=\"grid-edit-cell\"></th>\r\n </tr>\r\n\r\n <!-- @contract decision: the column filter reads option.filter, NOT option.columnFilter\r\n reality: option.filter.filtering switches it on, option.filter.defaultOperator\r\n starts the comparison (the renderer falls back to contains), and\r\n option.filter.placeholder labels the input.\r\n failure: option.columnFilter is read nowhere, here or in the runtime app. A\r\n column carrying it looks filterable in the file and is not on screen.\r\n seen: grid.component.ts:450-475; 5 uses of columnFilter across the reference\r\n projects, all of them dead -->\r\n <!-- Column filters -->\r\n <tr *ngIf=\"hasAnyColumnFilter()\" class=\"grid-filter-row\">\r\n\r\n <th *ngFor=\"let column of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n class=\"grid-filter-cell\">\r\n\r\n <ng-container *ngIf=\"\r\n column?.option?.filter?.filtering === true &&\r\n column?.scope?.reference\r\n \">\r\n\r\n <div class=\"grid-filter-input-wrapper\">\r\n <input type=\"text\" class=\"grid-filter-input\" vlCustomKeyboard=\"string\"\r\n [placeholder]=\"getColumnFilterPlaceholder(column)\"\r\n [ngModel]=\"getColumnFilterState(column).value\"\r\n (ngModelChange)=\"\r\n setColumnFilterValue(column, $event)\r\n \" />\r\n\r\n <!-- Operator selection button -->\r\n <button type=\"button\"\r\n class=\"grid-filter-operator-button\" nz-dropdown\r\n nzTrigger=\"click\"\r\n [nzDropdownMenu]=\"operatorMenu\"\r\n [class.grid-filter-operator-button--active]=\"\r\n hasActiveColumnFilter(column)\r\n \" [title]=\"\r\n 'Operator: ' +\r\n getFilterOperatorLabel(\r\n getColumnFilterState(column).operator\r\n )\r\n \">\r\n\r\n <span nz-icon nzType=\"filter\"></span>\r\n </button>\r\n\r\n <!-- Clear current column filter -->\r\n <button *ngIf=\"hasActiveColumnFilter(column)\"\r\n type=\"button\" class=\"grid-filter-clear-button\"\r\n aria-label=\"Clear column filter\"\r\n title=\"Clear filter\"\r\n (click)=\"clearColumnFilter(column)\">\r\n\r\n <span nz-icon nzType=\"close\"></span>\r\n </button>\r\n </div>\r\n\r\n <!-- Operator dropdown -->\r\n <nz-dropdown-menu #operatorMenu=\"nzDropdownMenu\">\r\n <ul nz-menu class=\"grid-filter-operator-menu\">\r\n <li *ngFor=\"let operator of filterOperators\"\r\n nz-menu-item [nzSelected]=\"\r\n getColumnFilterState(column).operator ===\r\n operator.value\r\n \" (click)=\"\r\n setColumnFilterOperator(\r\n column,\r\n operator.value\r\n )\r\n \">\r\n\r\n <span *ngIf=\"\r\n getColumnFilterState(column).operator ===\r\n operator.value\r\n \" nz-icon nzType=\"check\">\r\n </span>\r\n\r\n {{ operator.label }}\r\n </li>\r\n </ul>\r\n </nz-dropdown-menu>\r\n </ng-container>\r\n </th>\r\n <th *ngIf=\"canEdit\" class=\"grid-edit-cell\"></th>\r\n </tr>\r\n </thead>\r\n <!-- @contract decision: a cell shows the row's value through <vl-control mode=\"display\">\r\n reality: every type is shown (integer, bigdecimal and the credit card stayed empty before);\r\n unlocked text and number cells, quantity, multiply and the check box keep their own\r\n blocks, because they write into the row.\r\n\r\n @contract decision: columns without scope.reference are valid\r\n reality: with option.actionColumn they render save/delete icons, otherwise a\r\n button. That is why the conditions below all guard on the reference. -->\r\n <tbody>\r\n <tr *ngFor=\"let data of basicTable.data; let i = index\">\r\n <td *ngFor=\"let col of tableitemInfo.layoutSchema.elements | vlVisible\"\r\n [style]=\"getStyleWithoutClasses(col?.scope?.style).style\"\r\n [class.grid-cell--editing]=\"cellEditing(col, data)\"\r\n [class.grid-cell--wide]=\"cellEditing(col, data) && wideEditCell(col)\">\r\n <!-- a column without property: action icons or a button. Unlocked text and number cells\r\n are typed in (the row is saved by the action column), a check box ticks the row; every\r\n other cell shows the row's value through the shared <vl-control> in display mode -->\r\n @if (cellEditing(col, data)) {\r\n <vl-control mode=\"edit\" [field]=\"col\" [propertySchema]=\"rowSchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\" [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"rowSaveTried\" [list]=\"remoteData[col.scope.reference]\"\r\n [hideLabel]=\"true\" [compact]=\"true\">\r\n </vl-control>\r\n } @else if (!col?.scope?.reference) {\r\n <span *ngIf=\"col.option?.actionColumn\">\r\n <span nz-icon\r\n *ngIf=\"setActionColumn(col.option?.save, data)\"\r\n [nzType]=\"col.option?.save?.icon\"\r\n [nzTheme]=\"'twotone'\"\r\n [style]=\"col.option?.save?.style\"\r\n [nzTwotoneColor]=\"'#52c41a'\"\r\n [class]=\"col.option?.save?.style?.classes?.[0]\"\r\n (click)=\"upsertAction(col.option?.save, data)\">\r\n </span>\r\n <span nz-icon\r\n *ngIf=\"setActionColumn(col.option?.delete, data)\"\r\n [nzType]=\"col.option?.delete?.icon\"\r\n [nzTheme]=\"'twotone'\"\r\n [style]=\"col.option?.delete?.style\"\r\n [nzTwotoneColor]=\"'#FF0000'\"\r\n [class]=\"col.option?.delete?.style?.classes?.[0]\"\r\n (click)=\"deleteRow(col.option?.delete, data)\"></span>\r\n\r\n </span>\r\n <span *ngIf=\"!col.option?.actionColumn\">\r\n <button type=\"submit\"\r\n [style]=\"getStyleWithoutClasses(col?.label?.style).style\"\r\n (click)=\"invokeGridBtnClick(col.option, data)\"\r\n [class]=\"col?.label?.style?.classes?.[0]\">\r\n {{ col.label?.caption }}\r\n </button>\r\n </span>\r\n } @else if (cellType(col) === 'quantity') {\r\n <div style=\"display: flex; align-items: center;\">\r\n <button pButton icon=\"pi pi-minus\"\r\n (click)=\"decrementQuantity(i,col.scope?.reference.split('/').pop(), col.option)\"\r\n [disabled]=\"data.quantity <= 0\"\r\n style=\"margin-right: 8px; height: 10px; width: 10px;\"></button>\r\n <span>{{ data[col.scope?.reference.split('/').pop()]\r\n }}</span>\r\n <button pButton icon=\"pi pi-plus\"\r\n (click)=\"incrementQuantity(i, col.scope?.reference.split('/').pop(), col.option)\"\r\n style=\"margin-left: 8px; height: 10px; width: 10px;\"></button>\r\n </div>\r\n } @else if (cellType(col) === 'number' && col.option?.innerAction?.action == 'multiply') {\r\n <span>{{ (data[col.option?.innerAction?.from] * data[col.option?.innerAction?.to]) | number:'1.2-2' }}</span>\r\n } @else {\r\n <vl-control mode=\"display\" [field]=\"col\" [record]=\"data\"\r\n [propertySchema]=\"tableitemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [list]=\"remoteData[col.scope.reference]\"\r\n [hideLabel]=\"true\" [styleValue]=\"false\" [compact]=\"true\"\r\n (linkClicked)=\"showLinkDetails(col.option, data)\"\r\n (mediaClicked)=\"invokeTableImageClick(col, data)\">\r\n </vl-control>\r\n }\r\n </td>\r\n <!-- edit: pencil, or \u2713 save / \u2715 cancel on the row being edited (layoutSchema.edit) -->\r\n <td *ngIf=\"canEdit\" class=\"grid-edit-cell\">\r\n @if (editingRow === data) {\r\n <button type=\"submit\" class=\"grid-edit-btn grid-edit-btn--save\" [attr.aria-label]=\"t('Save')\"\r\n data-vl-action=\"saveRow\">✓</button>\r\n <button type=\"button\" class=\"grid-edit-btn\" [attr.aria-label]=\"t('Cancel')\"\r\n data-vl-action=\"cancelRow\" (click)=\"cancelEdit()\">✕</button>\r\n } @else {\r\n <button type=\"button\" class=\"grid-edit-btn\" [attr.aria-label]=\"t('Edit')\" [disabled]=\"editingRow\"\r\n data-vl-action=\"editRow\" (click)=\"startEdit(data)\">✎</button>\r\n }\r\n </td>\r\n </tr>\r\n </tbody>\r\n </nz-table>\r\n </form>\r\n</div>\r\n\r\n<!-- table footer -->\r\n<div *ngIf=\"tableitemInfo?.footer?.formFields && tableitemInfo.data?.length\"\r\n class=\"table-footer flex flex-column align-items-end gap-2 pt-2 mx-4 border-top-1 border-cyan-500\">\r\n <!-- @contract decision: the footer renders string and number only\r\n reality: the switch below carries those two cases and a default. It did NOT change\r\n when the columns gained their types on 2026-09-18.\r\n failure: any other type in a footer field renders empty.\r\n instead: keep aggregates numeric, or pre-format them as text in the endpoint. -->\r\n <div *ngFor=\"let tableField of tableitemInfo?.footer?.formFields | vlVisible\">\r\n <!-- the layout's control decides (#166 step 4.4): the shared controls, editable -->\r\n @switch (cellControl(tableField)) {\r\n @case ('password') {\r\n <vl-password [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-password>\r\n }\r\n @case ('textArea') {\r\n <vl-textarea [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [keyboard]=\"keyboardTypeFor(tableField, tableitemInfo.propertySchema)\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-textarea>\r\n }\r\n @case ('switch') {\r\n <vl-switch [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [type]=\"propertyType(tableField)\"\r\n [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-switch>\r\n }\r\n @case ('radiobutton') {\r\n <vl-radio [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [type]=\"propertyType(tableField) === 'boolean' ? 'boolean' : 'string'\"\r\n [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-radio>\r\n }\r\n @case ('combobox') {\r\n <vl-autocomplete [field]=\"tableField\" [target]=\"tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [combobox]=\"true\"\r\n [list]=\"remoteData[tableField.scope?.reference]\" [loading]=\"false\"\r\n [keyboard]=\"keyboardTypeFor(tableField, tableitemInfo.propertySchema)\" [saveTried]=\"false\" [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-autocomplete>\r\n }\r\n @default {\r\n <div\r\n [ngSwitch]=\"tableField?.scope?.reference && tableitemInfo.propertySchema[getScope(tableField.scope?.reference)] && tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()] ?\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.type : 'default'\">\r\n\r\n <!-- string control -->\r\n <div *ngSwitchCase=\"'string'\" class=\"form-group\">\r\n <span *ngIf=\"tableField.option.protected\">\r\n <h5 style=\"display: flex; justify-content: space-between;\">\r\n <span\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">\r\n {{\r\n (tableField.label?.value || tableField.label?.caption || '')\r\n }}\r\n </span>\r\n <span>\r\n {{\r\n tableitemInfo.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.value\r\n }}\r\n </span>\r\n </h5>\r\n </span>\r\n <div *ngIf=\"!tableField.option.protected\">\r\n <div\r\n [class]=\"tableField?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">{{\r\n tableField.label?.value ?\r\n tableField.label?.value :\r\n (tableField.label?.value || tableField.label?.caption || '')\r\n }}</label>\r\n <vl-textbox [formField]=\"tableField\" [modalItemInfo]=\"tableitemInfo\" [saveTried]=\"false\"\r\n [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\"></vl-textbox>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- number control -->\r\n <div *ngSwitchCase=\"'number'\" class=\"form-group\">\r\n <span *ngIf=\"tableField.option.protected\"\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">\r\n <h5>{{\r\n (tableField.label?.value || tableField.label?.caption || '')\r\n }} <vl-number style=\"display:inline-block\" [field]=\"tableField\" [readonly]=\"true\" [value]=\"form.propertySchema[getScope(tableField.scope?.reference)]?.[tableField.scope?.reference.split('/').pop()]?.value\" [property]=\"form.propertySchema[getScope(tableField.scope?.reference)]?.[tableField.scope?.reference.split('/').pop()]\" [row]=\"form.propertySchema[getScope(tableField.scope?.reference)]\" [translations]=\"selectedLanguageInfo?.selectedLanguage\"></vl-number>\r\n </h5>\r\n </span>\r\n <span *ngIf=\"!tableField.option.protected\">\r\n <div\r\n [class]=\"tableField?.layout == 'horizontal' ? 'horizontal-layout' : 'row'\">\r\n <label\r\n [style]=\"getStyleWithoutClasses(tableField?.label?.style).style\"\r\n [class]=\"tableField?.label?.style?.classes?.[0]\">{{\r\n tableField.label?.value ?\r\n tableField.label?.value :\r\n (tableField.label?.value || tableField.label?.caption || '')\r\n }}</label>\r\n <vl-number [field]=\"tableField\" [target]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [property]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]\" [row]=\"form.propertySchema[getScope(tableField.scope?.reference)]\"\r\n [type]=\"form.propertySchema[getScope(tableField.scope?.reference)][tableField.scope?.reference.split('/').pop()]?.type || 'number'\"\r\n [keyboard]=\"keyboardTypeFor(tableField, form.propertySchema)\" [saveTried]=\"false\"\r\n [errorMessages]=\"selectedLanguageInfo?.errorMessages || errorMessages\"\r\n [translations]=\"selectedLanguageInfo?.selectedLanguage\"\r\n [inputStyle]=\"getStyleWithoutClasses(tableField?.scope?.style).style\"\r\n [inputClass]=\"tableField.scope?.style?.classes?.[0] ?? ''\"></vl-number>\r\n </div>\r\n\r\n </span>\r\n </div>\r\n\r\n <!-- button control -->\r\n <div *ngSwitchCase=\"'default'\">\r\n <button type=\"submit\"\r\n [style]=\"getStyleWithoutClasses(tableField.label.style).style\"\r\n (click)=\"invokeGridBtnClick(tableField.option, tableitemInfo.propertySchema)\">\r\n {{ tableField.label?.caption }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</div>\r\n\r\n<!-- bottom pagination on grid -->\r\n<div\r\n *ngIf=\"tableitemInfo.data?.length && !tableitemInfo?.layoutSchema?.pagination?.top && tableitemInfo?.layoutSchema?.pagination?.bottom\">\r\n <vl-pagination [itemInfo]=\"tableitemInfo\" [pageSize]=\"pageSize\"\r\n [currentPage]=\"currentPage\" [pages]=\"pages\"\r\n (pageSizeChange)=\"invokeOnPageSizeChange($event)\"\r\n (onGoToPage)=\"invokeGoToPage($event)\">\r\n </vl-pagination>\r\n</div>\r\n", styles: [".grid-filter-row th{padding:8px;vertical-align:middle;background:#fafafa}.grid-filter-cell{min-width:150px}.grid-filter-input-wrapper{display:flex;align-items:stretch;width:100%}.grid-filter-input{width:100%;min-width:0;min-height:34px;padding:5px 8px;border:1px solid #d9d9d9;border-right:0;border-radius:4px 0 0 4px;outline:none}.grid-filter-input:focus{border-color:#1677ff}.grid-filter-operator-button,.grid-filter-clear-button{display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:34px;padding:0;cursor:pointer;background:#fff;border:1px solid #d9d9d9}.grid-filter-operator-button{color:#595959;border-radius:0 4px 4px 0}.grid-filter-operator-button:hover,.grid-filter-operator-button--active{color:#1677ff;border-color:#1677ff}.grid-filter-clear-button{margin-left:5px;color:#ff4d4f;border-radius:4px}.grid-filter-clear-button:hover{color:#fff;background:#ff4d4f;border-color:#ff4d4f}.grid-filter-operator-menu{min-width:190px}:host ::ng-deep .ant-table-content.has-more-right{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent)}:host ::ng-deep .ant-table-content.has-more-left{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent)}:host ::ng-deep .ant-table-content.has-more-left.has-more-right{-webkit-mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent)}::ng-deep :where(.grid-edit-cell){width:1%;white-space:nowrap;text-align:center}::ng-deep :where(.grid-edit-btn){min-width:32px;height:32px;margin:0 2px;border:1px solid #d1d5db;border-radius:4px;background:#fff;cursor:pointer;font-size:15px;line-height:1}::ng-deep :where(.grid-edit-btn--save){border-color:#16a34a;background:#16a34a;color:#fff}::ng-deep :where(.grid-edit-btn:disabled){opacity:.4;cursor:default}::ng-deep :where(.grid-cell--editing){min-width:160px}::ng-deep :where(.grid-cell--wide){min-width:240px}.grid-cell--editing ::ng-deep vl-control,.grid-cell--editing ::ng-deep vl-textbox input,.grid-cell--editing ::ng-deep vl-password input,.grid-cell--editing ::ng-deep vl-textarea textarea,.grid-cell--editing ::ng-deep .ant-picker,.grid-cell--editing ::ng-deep .ant-select{display:block;width:100%!important;max-width:100%;box-sizing:border-box}\n"] }]
|
|
8708
9206
|
}], ctorParameters: () => [{ type: RequestService }, { type: UtilityService }, { type: NotificationService }, { type: i4.OktaAuthStateService }], propDecorators: { errorMessages: [{
|
|
8709
9207
|
type: Input
|
|
8710
9208
|
}], environment: [{
|
|
@@ -8729,6 +9227,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
8729
9227
|
type: Input
|
|
8730
9228
|
}], userInfo: [{
|
|
8731
9229
|
type: Input
|
|
9230
|
+
}], pageData: [{
|
|
9231
|
+
type: Input
|
|
9232
|
+
}], editRow: [{
|
|
9233
|
+
type: Output
|
|
9234
|
+
}], gridForm: [{
|
|
9235
|
+
type: ViewChild,
|
|
9236
|
+
args: ['gridForm']
|
|
8732
9237
|
}], onPageChange: [{
|
|
8733
9238
|
type: Output
|
|
8734
9239
|
}], onPageSizeChange: [{
|
|
@@ -8747,6 +9252,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
8747
9252
|
type: Output
|
|
8748
9253
|
}] } });
|
|
8749
9254
|
|
|
9255
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22
|
|
9256
|
+
// - fix: the header logo is drawn once loaded (markForCheck after setHeaderItems) - without zone.js it
|
|
9257
|
+
// kept the file path "Media/favicon.ico" and showed a broken image
|
|
8750
9258
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-19
|
|
8751
9259
|
// - new: data-vl-field / data-vl-action marks for the app's test runner (#166)
|
|
8752
9260
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-11
|
|
@@ -8781,6 +9289,7 @@ class HeaderMenuComponent {
|
|
|
8781
9289
|
buttonClick = new EventEmitter();
|
|
8782
9290
|
showTableContent = new EventEmitter();
|
|
8783
9291
|
searchItems = new EventEmitter();
|
|
9292
|
+
cdr = inject(ChangeDetectorRef);
|
|
8784
9293
|
constructor(oktaAuthService, requestService, utilityService, couchdbService, platform) {
|
|
8785
9294
|
this.oktaAuthService = oktaAuthService;
|
|
8786
9295
|
this.requestService = requestService;
|
|
@@ -8791,8 +9300,10 @@ class HeaderMenuComponent {
|
|
|
8791
9300
|
ngOnChanges(changes) {
|
|
8792
9301
|
if (changes['headerItems'] && this.headerItems) {
|
|
8793
9302
|
this.setHeaderItems(this.headerItems).then((updatedHeaderItems) => {
|
|
8794
|
-
|
|
8795
|
-
|
|
9303
|
+
// a new array, and the view is told: the app runs without zone.js, so after the awaits of
|
|
9304
|
+
// setHeaderItems the logo kept its file path instead of the loaded image
|
|
9305
|
+
this.headerItems = [...updatedHeaderItems];
|
|
9306
|
+
this.cdr.markForCheck();
|
|
8796
9307
|
});
|
|
8797
9308
|
}
|
|
8798
9309
|
if (changes['environment'] && this.environment && this.environment?.login && this.environment?.login?.type == "oktaAuth") {
|
|
@@ -8963,6 +9474,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
8963
9474
|
], selector: 'vl-logs', template: "<div class=\"network-log-wrapper\">\r\n\r\n <div class=\"network-log-table\">\r\n <table>\r\n <thead>\r\n <tr>\r\n <th>#</th>\r\n <th>Time</th>\r\n <th>Method</th>\r\n <th>URL</th>\r\n <th>Status</th>\r\n <th>Duration (ms)</th>\r\n <th>Size (KB)</th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <ng-container *ngFor=\"let log of logs; let i = index\">\r\n\r\n <!-- MAIN ROW -->\r\n <tr class=\"log-row\" (click)=\"toggleRow(i)\">\r\n <td>{{ i + 1 }}</td>\r\n <td>{{ log.time }}</td>\r\n\r\n <td>\r\n <span class=\"method\" [class.get]=\"log.method === 'GET'\" [class.post]=\"log.method === 'POST'\"\r\n [class.put]=\"log.method === 'PUT'\" [class.delete]=\"log.method === 'DELETE'\">\r\n {{ log.method }}\r\n </span>\r\n </td>\r\n\r\n <td class=\"ellipsis\" [title]=\"log.url\">\r\n {{ log.url }}\r\n </td>\r\n\r\n <td [class.error]=\"log.status >= 400\">\r\n {{ log.status }}\r\n </td>\r\n\r\n <td>{{ log.duration }}</td>\r\n\r\n <td>{{ log.size | number:'1.0-2' }}</td>\r\n </tr>\r\n\r\n <!-- DETAILS ROW -->\r\n <tr *ngIf=\"expandedRow === i\" class=\"details-row\">\r\n <td colspan=\"7\">\r\n <div class=\"details-container\">\r\n\r\n <!-- META -->\r\n <div class=\"detail-block\">\r\n <h4>Meta</h4>\r\n <p><strong>Date:</strong> {{ log.date }}</p>\r\n <p><strong>Type:</strong> {{ log.type }}</p>\r\n </div>\r\n\r\n <!-- REQUEST -->\r\n <div class=\"detail-block\">\r\n <h4>Request</h4>\r\n <p><strong>Headers</strong></p>\r\n <pre>{{ log.requestHeaders | json }}</pre>\r\n\r\n <p><strong>Body</strong></p>\r\n <pre>{{ log.requestBody | json }}</pre>\r\n </div>\r\n\r\n <!-- RESPONSE -->\r\n <div class=\"detail-block\">\r\n <h4>Response</h4>\r\n <pre>{{ log.responseBody | json }}</pre>\r\n </div>\r\n\r\n <!-- PERFORMANCE -->\r\n <div class=\"detail-block\">\r\n <h4>Performance</h4>\r\n <p><strong>Duration:</strong> {{ log.duration }} ms</p>\r\n <p><strong>Size:</strong> {{ log.size | number:'1.0-2' }} KB</p>\r\n </div>\r\n\r\n </div>\r\n </td>\r\n </tr>\r\n\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n\r\n</div>", styles: [".network-log-wrapper{padding:12px}.network-log-table{width:100%;overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:13px;min-width:900px}thead th{background:#06b6d4;color:#fff;padding:8px;text-align:left;position:sticky;top:0;z-index:2}tbody td{padding:8px;border-bottom:1px solid #e5e7eb}.log-row{cursor:pointer}.log-row:hover{background:#f1f5f9}.details-row{background:#f8fafc}.method{padding:2px 8px;border-radius:4px;font-weight:600;font-size:11px;color:#fff}.method.get{background:#16a34a}.method.post{background:#2563eb}.method.put{background:#d97706}.method.delete{background:#dc2626}td.error{color:#dc2626;font-weight:700}.ellipsis{max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.details-container{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.detail-block{background:#fff;border:1px solid #e5e7eb;border-radius:6px;padding:10px}.detail-block h4{margin:0 0 6px;font-size:14px;color:#0f172a}pre{background:#020617;color:#e5e7eb;padding:8px;border-radius:6px;max-height:260px;overflow:auto;font-size:12px;white-space:pre-wrap;word-break:break-word}@media(max-width:768px){table{min-width:100%;font-size:12px}.ellipsis{max-width:140px}.details-container{grid-template-columns:1fr}pre{max-height:200px}}\n"] }]
|
|
8964
9475
|
}], ctorParameters: () => [{ type: NetworkLogService }] });
|
|
8965
9476
|
|
|
9477
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
9478
|
+
// - new: lockReasonOf / lockHintOf / showMissing - the hint under a locked button, a click on it shows the missing fields
|
|
9479
|
+
// - new: isLocked - a button is grey and without click by needsLogin / needsValid of its layout
|
|
9480
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
9481
|
+
// - change: a data object holds names and types only - a message names a field without label by its property name
|
|
9482
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
9483
|
+
// - change: buildCompany removed - the P5 company key is written in the page now (A2)
|
|
9484
|
+
// - fix: a record's dates fill the dialog through fromStorageValue - a period (also as UTC text after
|
|
9485
|
+
// a copy of the record) stayed empty
|
|
8966
9486
|
// Shuaib 2026-10-20
|
|
8967
9487
|
// - change: the fields are drawn by the shared <vl-control> (controls/control.ts); the switch over
|
|
8968
9488
|
// types and controls and its helpers (renderFieldType, keyboardTypeFor, getLabel, getButtonCaption,
|
|
@@ -9145,7 +9665,12 @@ class ModelComponent {
|
|
|
9145
9665
|
if (!schemaFields[fieldKey]) {
|
|
9146
9666
|
schemaFields[fieldKey] = {};
|
|
9147
9667
|
}
|
|
9148
|
-
|
|
9668
|
+
// through the one place for dates: a period or a date that came as text (also as UTC after a
|
|
9669
|
+
// copy of the record) becomes the Date the control expects - the period stayed empty before
|
|
9670
|
+
const value = data[fieldKey] instanceof Date || Array.isArray(data[fieldKey]) && data[fieldKey].every((v) => v instanceof Date)
|
|
9671
|
+
? data[fieldKey]
|
|
9672
|
+
: fromStorageValue(data[fieldKey], schemaFields[fieldKey]?.type);
|
|
9673
|
+
schemaFields[fieldKey].value = value;
|
|
9149
9674
|
}
|
|
9150
9675
|
});
|
|
9151
9676
|
}
|
|
@@ -9201,9 +9726,6 @@ class ModelComponent {
|
|
|
9201
9726
|
resolveToken(template, context) {
|
|
9202
9727
|
return this.remoteLists.resolveToken(template, context);
|
|
9203
9728
|
}
|
|
9204
|
-
buildCompany(userInfo) {
|
|
9205
|
-
return this.remoteLists.buildCompany(userInfo);
|
|
9206
|
-
}
|
|
9207
9729
|
getScope(scope) {
|
|
9208
9730
|
let propertyScope = "";
|
|
9209
9731
|
let start = scope?.indexOf("#/") + 2;
|
|
@@ -9254,7 +9776,7 @@ class ModelComponent {
|
|
|
9254
9776
|
}
|
|
9255
9777
|
setErroMessage(formField, errorMessages, errorType) {
|
|
9256
9778
|
let error = "";
|
|
9257
|
-
let fieldName = formField.label?.value ? formField.label?.value : formField.label?.caption ? formField.label?.caption :
|
|
9779
|
+
let fieldName = formField.label?.value ? formField.label?.value : formField.label?.caption ? formField.label?.caption : formField.scope?.reference?.split('/').pop();
|
|
9258
9780
|
if (errorType == "required") {
|
|
9259
9781
|
error = this.selectedLanguageInfo?.errorMessages?.required ? this.selectedLanguageInfo?.errorMessages.required : errorMessages.required;
|
|
9260
9782
|
}
|
|
@@ -9407,6 +9929,40 @@ class ModelComponent {
|
|
|
9407
9929
|
return;
|
|
9408
9930
|
}
|
|
9409
9931
|
}
|
|
9932
|
+
/** A button grey and without click: needsLogin without a user, needsValid with a broken field rule. */
|
|
9933
|
+
isLocked(formField, form) {
|
|
9934
|
+
return this.lockReasonOf(formField, form) !== null;
|
|
9935
|
+
}
|
|
9936
|
+
/** Why a button is locked: 'login' (needsLogin, nobody signed in) or 'valid' (needsValid, a field rule broken). */
|
|
9937
|
+
lockReasonOf(formField, form) {
|
|
9938
|
+
return lockReason(formField?.option, { signedIn: isSignedIn(this.userInfo), valid: !!form?.valid });
|
|
9939
|
+
}
|
|
9940
|
+
/** Under a locked button: the fields hint (a dialog has no sign-in link), the same list while nothing changed. */
|
|
9941
|
+
lockHintsOf(formField, form) {
|
|
9942
|
+
const option = formField?.option;
|
|
9943
|
+
const translations = this.selectedLanguageInfo?.selectedLanguage;
|
|
9944
|
+
const hints = lockReasons(option, { signedIn: isSignedIn(this.userInfo), valid: !!form?.valid })
|
|
9945
|
+
.map(reason => ({ reason, text: lockHint(option, reason, translations) }));
|
|
9946
|
+
const id = String(formField?.scope?.reference || formField?.label?.caption || '');
|
|
9947
|
+
const key = JSON.stringify(hints);
|
|
9948
|
+
const cached = this.lockHintCache.get(id);
|
|
9949
|
+
if (cached && cached.key === key)
|
|
9950
|
+
return cached.hints;
|
|
9951
|
+
this.lockHintCache.set(id, { key, hints });
|
|
9952
|
+
return hints;
|
|
9953
|
+
}
|
|
9954
|
+
lockHintCache = new Map();
|
|
9955
|
+
/** A click on a locked button: nothing is sent; every field shows its message, the first missing one comes into view. */
|
|
9956
|
+
showMissing(form) {
|
|
9957
|
+
this.saveTried = true;
|
|
9958
|
+
form?.control?.markAllAsTouched();
|
|
9959
|
+
setTimeout(() => {
|
|
9960
|
+
const field = document.querySelector('.vl-dialog-field .ng-invalid:not(form)');
|
|
9961
|
+
field?.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
9962
|
+
const input = field?.matches('input, textarea') ? field : field?.querySelector('input, textarea');
|
|
9963
|
+
input?.focus({ preventScroll: true });
|
|
9964
|
+
});
|
|
9965
|
+
}
|
|
9410
9966
|
checkValidty(form) {
|
|
9411
9967
|
if (!form) {
|
|
9412
9968
|
return false;
|
|
@@ -9433,7 +9989,7 @@ class ModelComponent {
|
|
|
9433
9989
|
return !!control?.invalid && ((!!control.dirty && !!control.touched) || this.saveTried);
|
|
9434
9990
|
}
|
|
9435
9991
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: ModelComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$4.DynamicDialogRef }, { token: i1$4.DynamicDialogConfig }, { token: UtilityService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9436
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: ModelComponent, isStandalone: true, selector: "vl-model", inputs: { errorMessages: "errorMessages", modalItemInfo: "modalItemInfo", selectedLanguageInfo: "selectedLanguageInfo", userInfo: "userInfo", setFormDataHandler: "setFormDataHandler" }, usesOnChanges: true, ngImport: i0, template: "<!-- Shuaib 2026-10-20\r\n - change: every field is drawn by the shared <vl-control> instead of a switch over types and\r\n controls in this template (#166)\r\n - change: follows the Designer's modal layout: the field's style is its wrapper, scope.style is the\r\n input of every control (dropdown, number and period took the wrapper's style before), all classes\r\n of a style count\r\n - change: a protected field shows its label and value read only; a protected text showed only the\r\n data object's caption -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: a text field with the control email (or any other text control) is drawn as the text field;\r\n it was not drawn at all (#166, test F6)\r\n - fix: every field label by getLabel (label.value, the layout's label.caption, then the DTO caption) (#166, test F3)\r\n - new: date and time in one field (type datetime or control dateTimepicker) with vl-datetime (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: numbers with vl-number (plain, spinner, slider) (#166 step 4.4)\r\n - new: radiobutton with vl-radio (text and Boolean) instead of \"not supported yet\" (#166 step 4.4)\r\n - new: switch with vl-switch (string flag and Boolean) instead of \"not supported yet\" (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea with vl-textarea (rows, new-line key) instead of \"not supported yet\" (#166 step 4.4)\r\n - new: password with vl-password (hidden, eye) instead of \"not supported yet\" (#166 step 4.4)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: number, autocomplete, date and time fields take the toolkit keyboard of their\r\n attribute type (keyboardTypeFor) instead of only an explicit option.keyboardType\r\n - change: the date picker docks at the bottom on the devices (model-datepicker-panel--docked);\r\n the time picker stays attached to its field in a compact form (model-timepicker-panel);\r\n both report which picker closed (onPickerClose(picker)) -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: the model field switch uses renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment on the widest type coverage in the toolkit, and one on the credit\r\n card case recording that the rename reached this file first -->\r\n<!-- Loader Spinner -->\r\n<div *ngIf=\"isLoading\" class=\"loader-overlay\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n<div [ngStyle]=\"styleOf(modalItemInfo?.layoutSchema?.style).style\"\r\n [class]=\"styleOf(modalItemInfo?.layoutSchema?.style).classes\">\r\n <form #dynamicForm=\"ngForm\"\r\n *ngIf=\"modalItemInfo?.layoutSchema?.formSections?.length > 0\"\r\n (submit)=\"$event.preventDefault()\">\r\n <div *ngFor=\"let formSection of modalItemInfo?.layoutSchema?.formSections\">\r\n <div *ngIf=\"formSection?.label?.caption\"\r\n [class]=\"styleOf(formSection?.label?.style).classes\"\r\n [ngStyle]=\"styleOf(formSection?.label?.style).style\">\r\n {{ formSection.label.caption }}\r\n </div>\r\n <div *ngIf=\"formSection?.formFields?.length > 0\"\r\n [class]=\"styleOf(formSection?.style).classes\"\r\n [ngStyle]=\"getSectionBodyStyle(formSection)\">\r\n <!-- the field's style is its wrapper in the section grid (gridColumn \"span N\"), as in\r\n the Designer; label, input and button are drawn by <vl-control> -->\r\n <div *ngFor=\"let formField of formSection.formFields | vlVisible\"\r\n [attr.data-vl-field]=\"vlFieldKey(formField)\"\r\n [ngStyle]=\"getFieldWrapperStyle(formField)\"\r\n [class]=\"styleOf(formField?.style).classes\">\r\n <vl-control [field]=\"formField\"\r\n [propertySchema]=\"modalItemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"saveTried\"\r\n container=\"dialog\"\r\n (picked)=\"autocompSelectEvent($event, formField)\"\r\n (changed)=\"handleRules(formField, $event)\"\r\n (opened)=\"onTimePanelShow(formField)\"\r\n (toggled)=\"invokeSetformData()\"\r\n (buttonClick)=\"invokeFormBtnClick($event, modalItemInfo.propertySchema, dynamicForm)\">\r\n </vl-control>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [":host ::ng-deep .custom-datepicker .p-datepicker-dropdown{height:100%;border-radius:4px}:host ::ng-deep .custom-datepicker .p-datepicker-input{border-radius:4px}::ng-deep .p-autocomplete-list{background-color:#fff}:host ::ng-deep .custom-autocomplete{display:flex;width:100%}:host ::ng-deep .custom-autocomplete .p-autocomplete-input{flex:1;width:100%;min-width:0;border:none!important;outline:none!important;box-shadow:none!important;background:transparent!important}:host ::ng-deep .custom-autocomplete .p-autocomplete-dropdown{height:100%;border-radius:4px}:host ::ng-deep .custom-autocomplete .p-autocomplete-input:focus,:host ::ng-deep .custom-autocomplete .p-autocomplete-input:focus-visible,:host ::ng-deep .custom-autocomplete .p-inputtext:enabled:focus{border:none!important;outline:none!important;box-shadow:none!important}.responsive-modal-grid{width:100%;min-width:0;box-sizing:border-box}:host{display:block;container-type:inline-size}.responsive-modal-field [style*=grid-template-columns]{align-items:start!important}.responsive-modal-field [style*=grid-template-columns]>:first-child{padding-top:10px}@container (max-width: 660px){.responsive-modal-grid{grid-template-columns:repeat(12,minmax(0,1fr))!important;gap:10px!important}.responsive-modal-field{grid-column:1 / -1!important;width:100%!important;max-width:none!important;min-width:0!important}.responsive-modal-action:nth-last-child(2){grid-column:1 / span 6!important}.responsive-modal-action:last-child{grid-column:7 / span 6!important}.responsive-modal-action{width:100%!important;max-width:none!important;min-width:0!important;justify-self:stretch!important;box-sizing:border-box!important}.responsive-modal-action button{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;box-sizing:border-box!important}}:host{--modal-field-focus-color: var(--p-primary-color, #10b981);--modal-field-focus-shadow: 0 0 0 2px rgba(16, 185, 129, .16)}:host ::ng-deep input:not([type=checkbox]):not(:disabled):focus,:host ::ng-deep textarea:not(:disabled):focus{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-autocomplete:focus-within{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-autocomplete:focus-within .p-autocomplete-input{border:none!important;outline:none!important;box-shadow:none!important}:host ::ng-deep select:not(:disabled):focus{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .ant-select-focused:not(.ant-select-disabled) .ant-select-selector,:host ::ng-deep nz-select:not(.ant-select-disabled):focus-within .ant-select-selector{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .p-select:not(.p-disabled).p-focus,:host ::ng-deep .p-select:not(.p-disabled):focus-within,:host ::ng-deep .p-dropdown:not(.p-disabled).p-focus,:host ::ng-deep .p-dropdown:not(.p-disabled):focus-within{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-datepicker:focus-within .p-datepicker-input{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep input:disabled,:host ::ng-deep textarea:disabled,:host ::ng-deep select:disabled,:host ::ng-deep .p-disabled,:host ::ng-deep .ant-select-disabled .ant-select-selector{box-shadow:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ControlComponent, selector: "vl-control", inputs: ["field", "propertySchema", "selectedLanguageInfo", "errorMessages", "saveTried", "container", "buttonType", "mode", "record", "hideLabel", "styleValue", "compact", "list", "listLoading", "creditCardError"], outputs: ["picked", "changed", "opened", "toggled", "linkClicked", "mediaClicked", "buttonClick"] }, { kind: "pipe", type: VisiblePipe, name: "vlVisible" }] });
|
|
9992
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: ModelComponent, isStandalone: true, selector: "vl-model", inputs: { errorMessages: "errorMessages", modalItemInfo: "modalItemInfo", selectedLanguageInfo: "selectedLanguageInfo", userInfo: "userInfo", setFormDataHandler: "setFormDataHandler" }, usesOnChanges: true, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - new: a locked button shows its hint (in a dialog without the sign-in link), a click shows the missing fields\r\n - change: the wrapper of a locked button drops the layout's colour and shadow (vl-dialog-field--locked)\r\n - new: a button is locked by needsLogin / needsValid of its layout (isLocked, field/button-lock.ts) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22\r\n - new: class vl-dialog-field on every field - on a phone each field takes the whole width with its\r\n label above (model.component.css), whatever columns the page sets for tablet and desktop -->\r\n<!-- Shuaib 2026-10-20\r\n - change: every field is drawn by the shared <vl-control> instead of a switch over types and\r\n controls in this template (#166)\r\n - change: follows the Designer's modal layout: the field's style is its wrapper, scope.style is the\r\n input of every control (dropdown, number and period took the wrapper's style before), all classes\r\n of a style count\r\n - change: a protected field shows its label and value read only; a protected text showed only the\r\n data object's caption -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: a text field with the control email (or any other text control) is drawn as the text field;\r\n it was not drawn at all (#166, test F6)\r\n - fix: every field label by getLabel (label.value, the layout's label.caption, then the DTO caption) (#166, test F3)\r\n - new: date and time in one field (type datetime or control dateTimepicker) with vl-datetime (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: numbers with vl-number (plain, spinner, slider) (#166 step 4.4)\r\n - new: radiobutton with vl-radio (text and Boolean) instead of \"not supported yet\" (#166 step 4.4)\r\n - new: switch with vl-switch (string flag and Boolean) instead of \"not supported yet\" (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea with vl-textarea (rows, new-line key) instead of \"not supported yet\" (#166 step 4.4)\r\n - new: password with vl-password (hidden, eye) instead of \"not supported yet\" (#166 step 4.4)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: number, autocomplete, date and time fields take the toolkit keyboard of their\r\n attribute type (keyboardTypeFor) instead of only an explicit option.keyboardType\r\n - change: the date picker docks at the bottom on the devices (model-datepicker-panel--docked);\r\n the time picker stays attached to its field in a compact form (model-timepicker-panel);\r\n both report which picker closed (onPickerClose(picker)) -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: the model field switch uses renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment on the widest type coverage in the toolkit, and one on the credit\r\n card case recording that the rename reached this file first -->\r\n<!-- Loader Spinner -->\r\n<div *ngIf=\"isLoading\" class=\"loader-overlay\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n<div [ngStyle]=\"styleOf(modalItemInfo?.layoutSchema?.style).style\"\r\n [class]=\"styleOf(modalItemInfo?.layoutSchema?.style).classes\">\r\n <form #dynamicForm=\"ngForm\"\r\n *ngIf=\"modalItemInfo?.layoutSchema?.formSections?.length > 0\"\r\n (submit)=\"$event.preventDefault()\">\r\n <div *ngFor=\"let formSection of modalItemInfo?.layoutSchema?.formSections\">\r\n <div *ngIf=\"formSection?.label?.caption\"\r\n [class]=\"styleOf(formSection?.label?.style).classes\"\r\n [ngStyle]=\"styleOf(formSection?.label?.style).style\">\r\n {{ formSection.label.caption }}\r\n </div>\r\n <div *ngIf=\"formSection?.formFields?.length > 0\"\r\n [class]=\"styleOf(formSection?.style).classes\"\r\n [ngStyle]=\"getSectionBodyStyle(formSection)\">\r\n <!-- the field's style is its wrapper in the section grid (gridColumn \"span N\"), as in\r\n the Designer; label, input and button are drawn by <vl-control> -->\r\n <div *ngFor=\"let formField of formSection.formFields | vlVisible\" class=\"vl-dialog-field\"\r\n [attr.data-vl-field]=\"vlFieldKey(formField)\"\r\n [ngStyle]=\"getFieldWrapperStyle(formField)\"\r\n [class]=\"'vl-dialog-field ' + styleOf(formField?.style).classes\"\r\n [class.vl-dialog-field--locked]=\"isLocked(formField, dynamicForm)\">\r\n <vl-control [field]=\"formField\"\r\n [propertySchema]=\"modalItemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"saveTried\"\r\n container=\"dialog\"\r\n [locked]=\"isLocked(formField, dynamicForm)\"\r\n [lockHints]=\"lockHintsOf(formField, dynamicForm)\"\r\n (lockedClick)=\"showMissing(dynamicForm)\"\r\n (picked)=\"autocompSelectEvent($event, formField)\"\r\n (changed)=\"handleRules(formField, $event)\"\r\n (opened)=\"onTimePanelShow(formField)\"\r\n (toggled)=\"invokeSetformData()\"\r\n (buttonClick)=\"invokeFormBtnClick($event, modalItemInfo.propertySchema, dynamicForm)\">\r\n </vl-control>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [":host ::ng-deep .custom-datepicker .p-datepicker-dropdown{height:100%;border-radius:4px}:host ::ng-deep .custom-datepicker .p-datepicker-input{border-radius:4px}::ng-deep .p-autocomplete-list{background-color:#fff}:host ::ng-deep .custom-autocomplete{display:flex;width:100%}:host ::ng-deep .custom-autocomplete .p-autocomplete-input{flex:1;width:100%;min-width:0;border:none!important;outline:none!important;box-shadow:none!important;background:transparent!important}:host ::ng-deep .custom-autocomplete .p-autocomplete-dropdown{height:100%;border-radius:4px}:host ::ng-deep .custom-autocomplete .p-autocomplete-input:focus,:host ::ng-deep .custom-autocomplete .p-autocomplete-input:focus-visible,:host ::ng-deep .custom-autocomplete .p-inputtext:enabled:focus{border:none!important;outline:none!important;box-shadow:none!important}.responsive-modal-grid{width:100%;min-width:0;box-sizing:border-box}:host{display:block;container-type:inline-size}.responsive-modal-field [style*=grid-template-columns]{align-items:start!important}.responsive-modal-field [style*=grid-template-columns]>:first-child{padding-top:10px}@container (max-width: 660px){.responsive-modal-grid{grid-template-columns:repeat(12,minmax(0,1fr))!important;gap:10px!important}.responsive-modal-field{grid-column:1 / -1!important;width:100%!important;max-width:none!important;min-width:0!important}.responsive-modal-action:nth-last-child(2){grid-column:1 / span 6!important}.responsive-modal-action:last-child{grid-column:7 / span 6!important}.responsive-modal-action{width:100%!important;max-width:none!important;min-width:0!important;justify-self:stretch!important;box-sizing:border-box!important}.responsive-modal-action button{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;box-sizing:border-box!important}}:host{--modal-field-focus-color: var(--p-primary-color, #10b981);--modal-field-focus-shadow: 0 0 0 2px rgba(16, 185, 129, .16)}:host ::ng-deep input:not([type=checkbox]):not(:disabled):focus,:host ::ng-deep textarea:not(:disabled):focus{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-autocomplete:focus-within{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-autocomplete:focus-within .p-autocomplete-input{border:none!important;outline:none!important;box-shadow:none!important}:host ::ng-deep select:not(:disabled):focus{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .ant-select-focused:not(.ant-select-disabled) .ant-select-selector,:host ::ng-deep nz-select:not(.ant-select-disabled):focus-within .ant-select-selector{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .p-select:not(.p-disabled).p-focus,:host ::ng-deep .p-select:not(.p-disabled):focus-within,:host ::ng-deep .p-dropdown:not(.p-disabled).p-focus,:host ::ng-deep .p-dropdown:not(.p-disabled):focus-within{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-datepicker:focus-within .p-datepicker-input{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep input:disabled,:host ::ng-deep textarea:disabled,:host ::ng-deep select:disabled,:host ::ng-deep .p-disabled,:host ::ng-deep .ant-select-disabled .ant-select-selector{box-shadow:none!important}@media(max-width:599px){.vl-dialog-field{grid-column:1 / -1!important}.vl-dialog-field ::ng-deep .vl-control__inner{grid-template-columns:minmax(0,1fr)!important}}.vl-dialog-field--locked{background:transparent!important;box-shadow:none!important;height:auto!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ControlComponent, selector: "vl-control", inputs: ["field", "propertySchema", "selectedLanguageInfo", "errorMessages", "saveTried", "container", "buttonType", "locked", "lockHints", "mode", "record", "hideLabel", "styleValue", "compact", "list", "listLoading", "creditCardError"], outputs: ["picked", "changed", "opened", "toggled", "linkClicked", "mediaClicked", "buttonClick", "lockedClick", "signIn"] }, { kind: "pipe", type: VisiblePipe, name: "vlVisible" }] });
|
|
9437
9993
|
}
|
|
9438
9994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: ModelComponent, decorators: [{
|
|
9439
9995
|
type: Component,
|
|
@@ -9442,7 +9998,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
9442
9998
|
FormsModule,
|
|
9443
9999
|
VisiblePipe,
|
|
9444
10000
|
ControlComponent,
|
|
9445
|
-
], template: "<!-- Shuaib 2026-10-20\r\n - change: every field is drawn by the shared <vl-control> instead of a switch over types and\r\n controls in this template (#166)\r\n - change: follows the Designer's modal layout: the field's style is its wrapper, scope.style is the\r\n input of every control (dropdown, number and period took the wrapper's style before), all classes\r\n of a style count\r\n - change: a protected field shows its label and value read only; a protected text showed only the\r\n data object's caption -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: a text field with the control email (or any other text control) is drawn as the text field;\r\n it was not drawn at all (#166, test F6)\r\n - fix: every field label by getLabel (label.value, the layout's label.caption, then the DTO caption) (#166, test F3)\r\n - new: date and time in one field (type datetime or control dateTimepicker) with vl-datetime (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: numbers with vl-number (plain, spinner, slider) (#166 step 4.4)\r\n - new: radiobutton with vl-radio (text and Boolean) instead of \"not supported yet\" (#166 step 4.4)\r\n - new: switch with vl-switch (string flag and Boolean) instead of \"not supported yet\" (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea with vl-textarea (rows, new-line key) instead of \"not supported yet\" (#166 step 4.4)\r\n - new: password with vl-password (hidden, eye) instead of \"not supported yet\" (#166 step 4.4)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: number, autocomplete, date and time fields take the toolkit keyboard of their\r\n attribute type (keyboardTypeFor) instead of only an explicit option.keyboardType\r\n - change: the date picker docks at the bottom on the devices (model-datepicker-panel--docked);\r\n the time picker stays attached to its field in a compact form (model-timepicker-panel);\r\n both report which picker closed (onPickerClose(picker)) -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: the model field switch uses renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment on the widest type coverage in the toolkit, and one on the credit\r\n card case recording that the rename reached this file first -->\r\n<!-- Loader Spinner -->\r\n<div *ngIf=\"isLoading\" class=\"loader-overlay\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n<div [ngStyle]=\"styleOf(modalItemInfo?.layoutSchema?.style).style\"\r\n [class]=\"styleOf(modalItemInfo?.layoutSchema?.style).classes\">\r\n <form #dynamicForm=\"ngForm\"\r\n *ngIf=\"modalItemInfo?.layoutSchema?.formSections?.length > 0\"\r\n (submit)=\"$event.preventDefault()\">\r\n <div *ngFor=\"let formSection of modalItemInfo?.layoutSchema?.formSections\">\r\n <div *ngIf=\"formSection?.label?.caption\"\r\n [class]=\"styleOf(formSection?.label?.style).classes\"\r\n [ngStyle]=\"styleOf(formSection?.label?.style).style\">\r\n {{ formSection.label.caption }}\r\n </div>\r\n <div *ngIf=\"formSection?.formFields?.length > 0\"\r\n [class]=\"styleOf(formSection?.style).classes\"\r\n [ngStyle]=\"getSectionBodyStyle(formSection)\">\r\n <!-- the field's style is its wrapper in the section grid (gridColumn \"span N\"), as in\r\n the Designer; label, input and button are drawn by <vl-control> -->\r\n <div *ngFor=\"let formField of formSection.formFields | vlVisible\"\r\n [attr.data-vl-field]=\"vlFieldKey(formField)\"\r\n [ngStyle]=\"getFieldWrapperStyle(formField)\"\r\n [class]=\"styleOf(formField?.style).classes\">\r\n <vl-control [field]=\"formField\"\r\n [propertySchema]=\"modalItemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"saveTried\"\r\n container=\"dialog\"\r\n (picked)=\"autocompSelectEvent($event, formField)\"\r\n (changed)=\"handleRules(formField, $event)\"\r\n (opened)=\"onTimePanelShow(formField)\"\r\n (toggled)=\"invokeSetformData()\"\r\n (buttonClick)=\"invokeFormBtnClick($event, modalItemInfo.propertySchema, dynamicForm)\">\r\n </vl-control>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [":host ::ng-deep .custom-datepicker .p-datepicker-dropdown{height:100%;border-radius:4px}:host ::ng-deep .custom-datepicker .p-datepicker-input{border-radius:4px}::ng-deep .p-autocomplete-list{background-color:#fff}:host ::ng-deep .custom-autocomplete{display:flex;width:100%}:host ::ng-deep .custom-autocomplete .p-autocomplete-input{flex:1;width:100%;min-width:0;border:none!important;outline:none!important;box-shadow:none!important;background:transparent!important}:host ::ng-deep .custom-autocomplete .p-autocomplete-dropdown{height:100%;border-radius:4px}:host ::ng-deep .custom-autocomplete .p-autocomplete-input:focus,:host ::ng-deep .custom-autocomplete .p-autocomplete-input:focus-visible,:host ::ng-deep .custom-autocomplete .p-inputtext:enabled:focus{border:none!important;outline:none!important;box-shadow:none!important}.responsive-modal-grid{width:100%;min-width:0;box-sizing:border-box}:host{display:block;container-type:inline-size}.responsive-modal-field [style*=grid-template-columns]{align-items:start!important}.responsive-modal-field [style*=grid-template-columns]>:first-child{padding-top:10px}@container (max-width: 660px){.responsive-modal-grid{grid-template-columns:repeat(12,minmax(0,1fr))!important;gap:10px!important}.responsive-modal-field{grid-column:1 / -1!important;width:100%!important;max-width:none!important;min-width:0!important}.responsive-modal-action:nth-last-child(2){grid-column:1 / span 6!important}.responsive-modal-action:last-child{grid-column:7 / span 6!important}.responsive-modal-action{width:100%!important;max-width:none!important;min-width:0!important;justify-self:stretch!important;box-sizing:border-box!important}.responsive-modal-action button{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;box-sizing:border-box!important}}:host{--modal-field-focus-color: var(--p-primary-color, #10b981);--modal-field-focus-shadow: 0 0 0 2px rgba(16, 185, 129, .16)}:host ::ng-deep input:not([type=checkbox]):not(:disabled):focus,:host ::ng-deep textarea:not(:disabled):focus{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-autocomplete:focus-within{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-autocomplete:focus-within .p-autocomplete-input{border:none!important;outline:none!important;box-shadow:none!important}:host ::ng-deep select:not(:disabled):focus{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .ant-select-focused:not(.ant-select-disabled) .ant-select-selector,:host ::ng-deep nz-select:not(.ant-select-disabled):focus-within .ant-select-selector{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .p-select:not(.p-disabled).p-focus,:host ::ng-deep .p-select:not(.p-disabled):focus-within,:host ::ng-deep .p-dropdown:not(.p-disabled).p-focus,:host ::ng-deep .p-dropdown:not(.p-disabled):focus-within{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-datepicker:focus-within .p-datepicker-input{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep input:disabled,:host ::ng-deep textarea:disabled,:host ::ng-deep select:disabled,:host ::ng-deep .p-disabled,:host ::ng-deep .ant-select-disabled .ant-select-selector{box-shadow:none!important}\n"] }]
|
|
10001
|
+
], template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24\r\n - new: a locked button shows its hint (in a dialog without the sign-in link), a click shows the missing fields\r\n - change: the wrapper of a locked button drops the layout's colour and shadow (vl-dialog-field--locked)\r\n - new: a button is locked by needsLogin / needsValid of its layout (isLocked, field/button-lock.ts) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-22\r\n - new: class vl-dialog-field on every field - on a phone each field takes the whole width with its\r\n label above (model.component.css), whatever columns the page sets for tablet and desktop -->\r\n<!-- Shuaib 2026-10-20\r\n - change: every field is drawn by the shared <vl-control> instead of a switch over types and\r\n controls in this template (#166)\r\n - change: follows the Designer's modal layout: the field's style is its wrapper, scope.style is the\r\n input of every control (dropdown, number and period took the wrapper's style before), all classes\r\n of a style count\r\n - change: a protected field shows its label and value read only; a protected text showed only the\r\n data object's caption -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - fix: a text field with the control email (or any other text control) is drawn as the text field;\r\n it was not drawn at all (#166, test F6)\r\n - fix: every field label by getLabel (label.value, the layout's label.caption, then the DTO caption) (#166, test F3)\r\n - new: date and time in one field (type datetime or control dateTimepicker) with vl-datetime (#166 E5)\r\n - new: the control dateRangepicker shows the period like the type dateRange (#166 E4)\r\n - change: protected numbers and amounts are shown by vl-number (currency, percent, unit) (#166 step 4.8)\r\n - change: media fields are the one vl-media (#166 step 4.4)\r\n - change: the period is the one vl-daterange instead of nz-range-picker (#166 step 4.4)\r\n - change: every date and time picker is the one vl-datetime (#166 step 4.4)\r\n - change: every drop-down is the one vl-dropdown (#166 step 4.4)\r\n - change: check boxes with vl-checkbox (#166 step 4.4)\r\n - change: numbers with vl-number (plain, spinner, slider) (#166 step 4.4)\r\n - new: radiobutton with vl-radio (text and Boolean) instead of \"not supported yet\" (#166 step 4.4)\r\n - new: switch with vl-switch (string flag and Boolean) instead of \"not supported yet\" (#166 step 4.4)\r\n - change: every selection list (autocomplete, combobox) is the one vl-autocomplete (#166 step 4.4)\r\n - new: combobox = the autocomplete list, values outside the list only with allowCustom (#166 step 4.4)\r\n - new: textArea with vl-textarea (rows, new-line key) instead of \"not supported yet\" (#166 step 4.4)\r\n - new: password with vl-password (hidden, eye) instead of \"not supported yet\" (#166 step 4.4)\r\n - change: placeholders from the layout first (vlPlaceholder with the field's option, #166)\r\n - new: date and time fields: input pattern, hint and display in the app language, year with four digits (vlDateFormat, vlDateHint, vlDateText - services/date-display.ts, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - fix: the placeholder comes from vlPlaceholder (pipes/placeholder.pipe.ts) - empty where the\r\n project defines none; it showed the text \"undefined\" -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - change: number, autocomplete, date and time fields take the toolkit keyboard of their\r\n attribute type (keyboardTypeFor) instead of only an explicit option.keyboardType\r\n - change: the date picker docks at the bottom on the devices (model-datepicker-panel--docked);\r\n the time picker stays attached to its field in a compact form (model-timepicker-panel);\r\n both report which picker closed (onPickerClose(picker)) -->\r\n\r\n<!-- Shuaib 2026-09-24\r\n - change: the model field switch uses renderFieldType so legacy checkbox fields render as boolean. -->\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment on the widest type coverage in the toolkit, and one on the credit\r\n card case recording that the rename reached this file first -->\r\n<!-- Loader Spinner -->\r\n<div *ngIf=\"isLoading\" class=\"loader-overlay\">\r\n <div class=\"spinner\"></div>\r\n</div>\r\n<div [ngStyle]=\"styleOf(modalItemInfo?.layoutSchema?.style).style\"\r\n [class]=\"styleOf(modalItemInfo?.layoutSchema?.style).classes\">\r\n <form #dynamicForm=\"ngForm\"\r\n *ngIf=\"modalItemInfo?.layoutSchema?.formSections?.length > 0\"\r\n (submit)=\"$event.preventDefault()\">\r\n <div *ngFor=\"let formSection of modalItemInfo?.layoutSchema?.formSections\">\r\n <div *ngIf=\"formSection?.label?.caption\"\r\n [class]=\"styleOf(formSection?.label?.style).classes\"\r\n [ngStyle]=\"styleOf(formSection?.label?.style).style\">\r\n {{ formSection.label.caption }}\r\n </div>\r\n <div *ngIf=\"formSection?.formFields?.length > 0\"\r\n [class]=\"styleOf(formSection?.style).classes\"\r\n [ngStyle]=\"getSectionBodyStyle(formSection)\">\r\n <!-- the field's style is its wrapper in the section grid (gridColumn \"span N\"), as in\r\n the Designer; label, input and button are drawn by <vl-control> -->\r\n <div *ngFor=\"let formField of formSection.formFields | vlVisible\" class=\"vl-dialog-field\"\r\n [attr.data-vl-field]=\"vlFieldKey(formField)\"\r\n [ngStyle]=\"getFieldWrapperStyle(formField)\"\r\n [class]=\"'vl-dialog-field ' + styleOf(formField?.style).classes\"\r\n [class.vl-dialog-field--locked]=\"isLocked(formField, dynamicForm)\">\r\n <vl-control [field]=\"formField\"\r\n [propertySchema]=\"modalItemInfo.propertySchema\"\r\n [selectedLanguageInfo]=\"selectedLanguageInfo\"\r\n [errorMessages]=\"errorMessages\"\r\n [saveTried]=\"saveTried\"\r\n container=\"dialog\"\r\n [locked]=\"isLocked(formField, dynamicForm)\"\r\n [lockHints]=\"lockHintsOf(formField, dynamicForm)\"\r\n (lockedClick)=\"showMissing(dynamicForm)\"\r\n (picked)=\"autocompSelectEvent($event, formField)\"\r\n (changed)=\"handleRules(formField, $event)\"\r\n (opened)=\"onTimePanelShow(formField)\"\r\n (toggled)=\"invokeSetformData()\"\r\n (buttonClick)=\"invokeFormBtnClick($event, modalItemInfo.propertySchema, dynamicForm)\">\r\n </vl-control>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [":host ::ng-deep .custom-datepicker .p-datepicker-dropdown{height:100%;border-radius:4px}:host ::ng-deep .custom-datepicker .p-datepicker-input{border-radius:4px}::ng-deep .p-autocomplete-list{background-color:#fff}:host ::ng-deep .custom-autocomplete{display:flex;width:100%}:host ::ng-deep .custom-autocomplete .p-autocomplete-input{flex:1;width:100%;min-width:0;border:none!important;outline:none!important;box-shadow:none!important;background:transparent!important}:host ::ng-deep .custom-autocomplete .p-autocomplete-dropdown{height:100%;border-radius:4px}:host ::ng-deep .custom-autocomplete .p-autocomplete-input:focus,:host ::ng-deep .custom-autocomplete .p-autocomplete-input:focus-visible,:host ::ng-deep .custom-autocomplete .p-inputtext:enabled:focus{border:none!important;outline:none!important;box-shadow:none!important}.responsive-modal-grid{width:100%;min-width:0;box-sizing:border-box}:host{display:block;container-type:inline-size}.responsive-modal-field [style*=grid-template-columns]{align-items:start!important}.responsive-modal-field [style*=grid-template-columns]>:first-child{padding-top:10px}@container (max-width: 660px){.responsive-modal-grid{grid-template-columns:repeat(12,minmax(0,1fr))!important;gap:10px!important}.responsive-modal-field{grid-column:1 / -1!important;width:100%!important;max-width:none!important;min-width:0!important}.responsive-modal-action:nth-last-child(2){grid-column:1 / span 6!important}.responsive-modal-action:last-child{grid-column:7 / span 6!important}.responsive-modal-action{width:100%!important;max-width:none!important;min-width:0!important;justify-self:stretch!important;box-sizing:border-box!important}.responsive-modal-action button{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;box-sizing:border-box!important}}:host{--modal-field-focus-color: var(--p-primary-color, #10b981);--modal-field-focus-shadow: 0 0 0 2px rgba(16, 185, 129, .16)}:host ::ng-deep input:not([type=checkbox]):not(:disabled):focus,:host ::ng-deep textarea:not(:disabled):focus{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-autocomplete:focus-within{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-autocomplete:focus-within .p-autocomplete-input{border:none!important;outline:none!important;box-shadow:none!important}:host ::ng-deep select:not(:disabled):focus{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .ant-select-focused:not(.ant-select-disabled) .ant-select-selector,:host ::ng-deep nz-select:not(.ant-select-disabled):focus-within .ant-select-selector{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .p-select:not(.p-disabled).p-focus,:host ::ng-deep .p-select:not(.p-disabled):focus-within,:host ::ng-deep .p-dropdown:not(.p-disabled).p-focus,:host ::ng-deep .p-dropdown:not(.p-disabled):focus-within{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep .custom-datepicker:focus-within .p-datepicker-input{border-color:var(--modal-field-focus-color)!important;outline:none!important;box-shadow:var(--modal-field-focus-shadow)!important}:host ::ng-deep input:disabled,:host ::ng-deep textarea:disabled,:host ::ng-deep select:disabled,:host ::ng-deep .p-disabled,:host ::ng-deep .ant-select-disabled .ant-select-selector{box-shadow:none!important}@media(max-width:599px){.vl-dialog-field{grid-column:1 / -1!important}.vl-dialog-field ::ng-deep .vl-control__inner{grid-template-columns:minmax(0,1fr)!important}}.vl-dialog-field--locked{background:transparent!important;box-shadow:none!important;height:auto!important}\n"] }]
|
|
9446
10002
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$4.DynamicDialogRef }, { type: i1$4.DynamicDialogConfig }, { type: UtilityService }], propDecorators: { errorMessages: [{
|
|
9447
10003
|
type: Input
|
|
9448
10004
|
}], modalItemInfo: [{
|
|
@@ -9482,6 +10038,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
9482
10038
|
args: [{ selector: 'vl-error-message', standalone: true, template: "<p>error-message works!</p>\r\n" }]
|
|
9483
10039
|
}] });
|
|
9484
10040
|
|
|
10041
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
10042
|
+
// - change: a data object holds names and types only - the label comes from the layout only
|
|
9485
10043
|
class Label {
|
|
9486
10044
|
cdr;
|
|
9487
10045
|
utilityService;
|
|
@@ -9519,7 +10077,7 @@ class Label {
|
|
|
9519
10077
|
return { classes: classes && classes.length > 0 ? classes[0] : '', style: styleWithoutClasses };
|
|
9520
10078
|
}
|
|
9521
10079
|
getlabel(formField) {
|
|
9522
|
-
let caption = formField.label?.value ? formField.label?.value : formField.label?.caption ? formField.label?.caption :
|
|
10080
|
+
let caption = formField.label?.value ? formField.label?.value : formField.label?.caption ? formField.label?.caption : '';
|
|
9523
10081
|
const translation = this.selectedLanguageInfo?.selectedLanguage;
|
|
9524
10082
|
return translation && translation[caption] ? translation[caption] : caption;
|
|
9525
10083
|
}
|
|
@@ -9544,6 +10102,128 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
9544
10102
|
args: [{ selector: 'vl-time', standalone: true, template: "<p>time works!</p>\r\n" }]
|
|
9545
10103
|
}] });
|
|
9546
10104
|
|
|
10105
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
10106
|
+
// - new: <vl-terms-dialog> - a document of Terms & Conditions to read (Close), or the terms to confirm before the
|
|
10107
|
+
// sign-in (Accept / Decline, imprint and privacy reachable from it). Texts come from the app's language
|
|
10108
|
+
// (fixed texts Accept, Decline, Close, termsConfirm …), English when the language has none
|
|
10109
|
+
class TermsDialog {
|
|
10110
|
+
/** the documents; to confirm, the terms (agb) come first, imprint and privacy as links */
|
|
10111
|
+
set documents(docs) {
|
|
10112
|
+
this.docs = docs || [];
|
|
10113
|
+
this.main = this.docs.find(d => d.name === 'agb') || this.docs[0] || null;
|
|
10114
|
+
this.current = this.main;
|
|
10115
|
+
}
|
|
10116
|
+
/** true: Accept / Decline before the sign-in; false: a document to read */
|
|
10117
|
+
confirm = false;
|
|
10118
|
+
/** the app's language (selectedLanguage) */
|
|
10119
|
+
translations = null;
|
|
10120
|
+
accepted = new EventEmitter();
|
|
10121
|
+
declined = new EventEmitter();
|
|
10122
|
+
closed = new EventEmitter();
|
|
10123
|
+
docs = [];
|
|
10124
|
+
main = null;
|
|
10125
|
+
current = null;
|
|
10126
|
+
get others() {
|
|
10127
|
+
return this.docs.filter(d => d !== this.main && d !== this.current);
|
|
10128
|
+
}
|
|
10129
|
+
show(doc) {
|
|
10130
|
+
if (!doc)
|
|
10131
|
+
return;
|
|
10132
|
+
if (doc.kind !== 'text') {
|
|
10133
|
+
window.open(doc.value, '_blank', 'noopener');
|
|
10134
|
+
return;
|
|
10135
|
+
}
|
|
10136
|
+
this.current = doc;
|
|
10137
|
+
}
|
|
10138
|
+
t(key, english) {
|
|
10139
|
+
return this.translations?.[key] || english;
|
|
10140
|
+
}
|
|
10141
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: TermsDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10142
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: TermsDialog, isStandalone: true, selector: "vl-terms-dialog", inputs: { documents: "documents", confirm: "confirm", translations: "translations" }, outputs: { accepted: "accepted", declined: "declined", closed: "closed" }, ngImport: i0, template: `
|
|
10143
|
+
<div class="vl-terms" role="dialog" aria-modal="true" [attr.aria-label]="current?.caption">
|
|
10144
|
+
<div class="vl-terms__card">
|
|
10145
|
+
<div class="vl-terms__head">
|
|
10146
|
+
<h2 class="vl-terms__title">{{ confirm ? t('termsConfirm', 'Please accept the terms') : current?.caption }}</h2>
|
|
10147
|
+
@if (!confirm) {
|
|
10148
|
+
<button type="button" class="vl-terms__x" [attr.aria-label]="t('Close', 'Close')" (click)="closed.emit()">✕</button>
|
|
10149
|
+
}
|
|
10150
|
+
</div>
|
|
10151
|
+
@if (confirm && current) {
|
|
10152
|
+
<div class="vl-terms__sub">{{ current.caption }}</div>
|
|
10153
|
+
}
|
|
10154
|
+
<div class="vl-terms__text">{{ current?.value }}</div>
|
|
10155
|
+
@if (confirm && others.length) {
|
|
10156
|
+
<div class="vl-terms__links">
|
|
10157
|
+
@for (doc of others; track doc.name) {
|
|
10158
|
+
<button type="button" class="vl-terms__link" (click)="show(doc)">{{ doc.caption }}</button>
|
|
10159
|
+
}
|
|
10160
|
+
@if (current !== main) {
|
|
10161
|
+
<button type="button" class="vl-terms__link" (click)="show(main)">{{ main?.caption }}</button>
|
|
10162
|
+
}
|
|
10163
|
+
</div>
|
|
10164
|
+
}
|
|
10165
|
+
<div class="vl-terms__actions">
|
|
10166
|
+
@if (confirm) {
|
|
10167
|
+
<button type="button" class="vl-terms__btn" (click)="declined.emit()">{{ t('Decline', 'Decline') }}</button>
|
|
10168
|
+
<button type="button" class="vl-terms__btn vl-terms__btn--primary" (click)="accepted.emit()">{{ t('Accept', 'Accept') }}</button>
|
|
10169
|
+
} @else {
|
|
10170
|
+
<button type="button" class="vl-terms__btn vl-terms__btn--primary" (click)="closed.emit()">{{ t('Close', 'Close') }}</button>
|
|
10171
|
+
}
|
|
10172
|
+
</div>
|
|
10173
|
+
</div>
|
|
10174
|
+
</div>
|
|
10175
|
+
`, isInline: true, styles: [".vl-terms{position:fixed;inset:0;z-index:2000;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:16px}.vl-terms__card{background:#fff;border-radius:12px;width:min(560px,100%);max-height:calc(100vh - 32px);display:flex;flex-direction:column;box-shadow:0 20px 50px #0f172a4d}.vl-terms__head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px 6px}.vl-terms__title{margin:0;font-size:1.15rem;font-weight:600;color:#0f172a}.vl-terms__sub{padding:0 20px;font-weight:600;color:#334155}.vl-terms__x{border:none;background:none;font-size:1rem;color:#475569;cursor:pointer}.vl-terms__text{padding:12px 20px;overflow-y:auto;white-space:pre-line;line-height:1.5;color:#1e293b}.vl-terms__links{display:flex;flex-wrap:wrap;gap:12px;padding:0 20px 8px}.vl-terms__link{border:none;background:none;padding:0;color:#2563eb;text-decoration:underline;cursor:pointer;font:inherit}.vl-terms__actions{display:flex;justify-content:flex-end;gap:10px;padding:12px 20px 18px;border-top:1px solid #e2e8f0}.vl-terms__btn{border:1px solid #cbd5e1;background:#fff;color:#0f172a;border-radius:8px;padding:8px 16px;cursor:pointer;font:inherit}.vl-terms__btn--primary{background:#2563eb;border-color:#2563eb;color:#fff}\n"] });
|
|
10176
|
+
}
|
|
10177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: TermsDialog, decorators: [{
|
|
10178
|
+
type: Component,
|
|
10179
|
+
args: [{ selector: 'vl-terms-dialog', standalone: true, template: `
|
|
10180
|
+
<div class="vl-terms" role="dialog" aria-modal="true" [attr.aria-label]="current?.caption">
|
|
10181
|
+
<div class="vl-terms__card">
|
|
10182
|
+
<div class="vl-terms__head">
|
|
10183
|
+
<h2 class="vl-terms__title">{{ confirm ? t('termsConfirm', 'Please accept the terms') : current?.caption }}</h2>
|
|
10184
|
+
@if (!confirm) {
|
|
10185
|
+
<button type="button" class="vl-terms__x" [attr.aria-label]="t('Close', 'Close')" (click)="closed.emit()">✕</button>
|
|
10186
|
+
}
|
|
10187
|
+
</div>
|
|
10188
|
+
@if (confirm && current) {
|
|
10189
|
+
<div class="vl-terms__sub">{{ current.caption }}</div>
|
|
10190
|
+
}
|
|
10191
|
+
<div class="vl-terms__text">{{ current?.value }}</div>
|
|
10192
|
+
@if (confirm && others.length) {
|
|
10193
|
+
<div class="vl-terms__links">
|
|
10194
|
+
@for (doc of others; track doc.name) {
|
|
10195
|
+
<button type="button" class="vl-terms__link" (click)="show(doc)">{{ doc.caption }}</button>
|
|
10196
|
+
}
|
|
10197
|
+
@if (current !== main) {
|
|
10198
|
+
<button type="button" class="vl-terms__link" (click)="show(main)">{{ main?.caption }}</button>
|
|
10199
|
+
}
|
|
10200
|
+
</div>
|
|
10201
|
+
}
|
|
10202
|
+
<div class="vl-terms__actions">
|
|
10203
|
+
@if (confirm) {
|
|
10204
|
+
<button type="button" class="vl-terms__btn" (click)="declined.emit()">{{ t('Decline', 'Decline') }}</button>
|
|
10205
|
+
<button type="button" class="vl-terms__btn vl-terms__btn--primary" (click)="accepted.emit()">{{ t('Accept', 'Accept') }}</button>
|
|
10206
|
+
} @else {
|
|
10207
|
+
<button type="button" class="vl-terms__btn vl-terms__btn--primary" (click)="closed.emit()">{{ t('Close', 'Close') }}</button>
|
|
10208
|
+
}
|
|
10209
|
+
</div>
|
|
10210
|
+
</div>
|
|
10211
|
+
</div>
|
|
10212
|
+
`, styles: [".vl-terms{position:fixed;inset:0;z-index:2000;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:16px}.vl-terms__card{background:#fff;border-radius:12px;width:min(560px,100%);max-height:calc(100vh - 32px);display:flex;flex-direction:column;box-shadow:0 20px 50px #0f172a4d}.vl-terms__head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px 6px}.vl-terms__title{margin:0;font-size:1.15rem;font-weight:600;color:#0f172a}.vl-terms__sub{padding:0 20px;font-weight:600;color:#334155}.vl-terms__x{border:none;background:none;font-size:1rem;color:#475569;cursor:pointer}.vl-terms__text{padding:12px 20px;overflow-y:auto;white-space:pre-line;line-height:1.5;color:#1e293b}.vl-terms__links{display:flex;flex-wrap:wrap;gap:12px;padding:0 20px 8px}.vl-terms__link{border:none;background:none;padding:0;color:#2563eb;text-decoration:underline;cursor:pointer;font:inherit}.vl-terms__actions{display:flex;justify-content:flex-end;gap:10px;padding:12px 20px 18px;border-top:1px solid #e2e8f0}.vl-terms__btn{border:1px solid #cbd5e1;background:#fff;color:#0f172a;border-radius:8px;padding:8px 16px;cursor:pointer;font:inherit}.vl-terms__btn--primary{background:#2563eb;border-color:#2563eb;color:#fff}\n"] }]
|
|
10213
|
+
}], propDecorators: { documents: [{
|
|
10214
|
+
type: Input
|
|
10215
|
+
}], confirm: [{
|
|
10216
|
+
type: Input
|
|
10217
|
+
}], translations: [{
|
|
10218
|
+
type: Input
|
|
10219
|
+
}], accepted: [{
|
|
10220
|
+
type: Output
|
|
10221
|
+
}], declined: [{
|
|
10222
|
+
type: Output
|
|
10223
|
+
}], closed: [{
|
|
10224
|
+
type: Output
|
|
10225
|
+
}] } });
|
|
10226
|
+
|
|
9547
10227
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-17
|
|
9548
10228
|
// - change: discovery and userinfo are reads (stagedRead): asked again on a weak network. The token
|
|
9549
10229
|
// and logout requests stay sent once (a code can be exchanged only once)
|
|
@@ -9894,6 +10574,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
9894
10574
|
}]
|
|
9895
10575
|
}], ctorParameters: () => [{ type: ConfigService }, { type: i1$1.HttpClient }, { type: UtilityService }, { type: i1$2.Platform }, { type: MobileOidcService }] });
|
|
9896
10576
|
|
|
10577
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
10578
|
+
// - change: a text document of Terms & Conditions opens in vl-terms-dialog (it was a notice in the corner)
|
|
10579
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-23
|
|
10580
|
+
// - fix: Login of the setting entries shows while nobody is signed in - an empty { authToken: undefined } (set
|
|
10581
|
+
// for Okta before any sign-in) no longer counts as signed in
|
|
10582
|
+
// - new: the setting entries by the app settings (OFFENE-PUNKTE 106/108): with mainCenter.appSettings the menu
|
|
10583
|
+
// gets Home, Project Version, Languages (the project's language files, from two on), Login (at any time, not
|
|
10584
|
+
// signed in), Pagination Type (user choice) and Terms & Conditions - into "Setting" or a folder "Setting" at
|
|
10585
|
+
// the end (appSettingsMenu of the catalog). Home opens Main's start page (the role's, if it has one),
|
|
10586
|
+
// Project Version shows the app's version, a Terms document opens its link, PDF or text
|
|
10587
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-20
|
|
10588
|
+
// - change: the start language comes from the app (startLanguages, in order: in the Designer's preview
|
|
10589
|
+
// the project's main language; otherwise the device language, then the main language) and is the
|
|
10590
|
+
// first one the project HAS - before, it was the device language if German, else always English,
|
|
10591
|
+
// also for a project without English (dev_urlaub: English dates and messages, "en.json not found").
|
|
10592
|
+
// English is the last resort. A language the user chose in the menu is kept
|
|
9897
10593
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18
|
|
9898
10594
|
// - fix: the web app loads the language file at start too (browser language, de or en), like the
|
|
9899
10595
|
// phone; it showed the layout's raw texts until a language was chosen in the menu (#166)
|
|
@@ -9907,6 +10603,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
9907
10603
|
// - change: the menu starts closed and closes after a choice wherever the app behaves like on a device
|
|
9908
10604
|
// (toolkitKeyboardActive - also the Designer preview with Mobile/Tablet, the tablet too, wider than
|
|
9909
10605
|
// 768 px); sign-in stays native-only
|
|
10606
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
10607
|
+
// - change: signed in by isSignedIn (field/button-lock.ts), the same check as the buttons' needsLogin
|
|
9910
10608
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13
|
|
9911
10609
|
// - new: activeLanguage, the language file in use ("de.json"); its menu entry gets a check mark
|
|
9912
10610
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-11
|
|
@@ -9965,6 +10663,16 @@ class SideMenuComponent {
|
|
|
9965
10663
|
environment;
|
|
9966
10664
|
projectSeleted;
|
|
9967
10665
|
appVersionInfo;
|
|
10666
|
+
/** Languages to start in, best first (language codes "de", "en" ...); the first the project has wins. */
|
|
10667
|
+
startLanguages = [];
|
|
10668
|
+
/** Main's start page area (center) - with appSettings the library adds the setting entries itself (OFFENE-PUNKTE 106/108). */
|
|
10669
|
+
mainCenter = null;
|
|
10670
|
+
/** The menu as the app hands it over, before the setting entries are added. */
|
|
10671
|
+
rawMenuItems = [];
|
|
10672
|
+
/** The codes of the project's language files ("en", "de") for the entry Languages. */
|
|
10673
|
+
projectLanguages = [];
|
|
10674
|
+
/** Set once the user picks a language in the menu - the start language then no longer applies. */
|
|
10675
|
+
languageChosenByUser = false;
|
|
9968
10676
|
languageChange = new EventEmitter();
|
|
9969
10677
|
invokeMenu = new EventEmitter();
|
|
9970
10678
|
menuToggle = new EventEmitter();
|
|
@@ -10130,6 +10838,18 @@ class SideMenuComponent {
|
|
|
10130
10838
|
}
|
|
10131
10839
|
}
|
|
10132
10840
|
ngOnChanges(changes) {
|
|
10841
|
+
if (changes['menuItems'])
|
|
10842
|
+
this.rawMenuItems = this.menuItems ?? [];
|
|
10843
|
+
if (changes['tenantName'] || changes['projectSeleted'])
|
|
10844
|
+
void this.loadProjectLanguages();
|
|
10845
|
+
const settingEntries = !!this.mainCenter?.appSettings
|
|
10846
|
+
&& !!(changes['menuItems'] || changes['mainCenter'] || changes['userInfo']);
|
|
10847
|
+
if (settingEntries)
|
|
10848
|
+
this.addSettingEntries();
|
|
10849
|
+
// the main language arrives with the settings, after the first start - take it then
|
|
10850
|
+
if (changes['startLanguages'] && !changes['startLanguages'].firstChange && !this.languageChosenByUser) {
|
|
10851
|
+
void this.applyStartLanguage();
|
|
10852
|
+
}
|
|
10133
10853
|
if (changes['environment'] ||
|
|
10134
10854
|
changes['userInfo'] ||
|
|
10135
10855
|
changes['projectSeleted']) {
|
|
@@ -10139,7 +10859,7 @@ class SideMenuComponent {
|
|
|
10139
10859
|
changes['projectSeleted']) {
|
|
10140
10860
|
this.initializeProjects();
|
|
10141
10861
|
}
|
|
10142
|
-
if (changes['menuItems'] &&
|
|
10862
|
+
if ((changes['menuItems'] || settingEntries) &&
|
|
10143
10863
|
this.menuItems?.length) {
|
|
10144
10864
|
this.menuItemsCopy =
|
|
10145
10865
|
JSON.parse(JSON.stringify(this.menuItems));
|
|
@@ -10164,6 +10884,35 @@ class SideMenuComponent {
|
|
|
10164
10884
|
void this.setSettingImages();
|
|
10165
10885
|
}
|
|
10166
10886
|
}
|
|
10887
|
+
/** The setting entries of the app settings added to the menu as the app handed it over. */
|
|
10888
|
+
addSettingEntries() {
|
|
10889
|
+
const signedIn = isSignedIn(this.userInfo);
|
|
10890
|
+
this.menuItems = appSettingsMenu(this.rawMenuItems, this.mainCenter, { languages: this.projectLanguages, signedIn });
|
|
10891
|
+
// the mark beside Scroll / Numbered: the user's choice, else Main's default
|
|
10892
|
+
if (this.scrollPagination !== true && this.scrollPagination !== false && this.scrollPagination !== 'true' && this.scrollPagination !== 'false') {
|
|
10893
|
+
this.scrollPagination = readAppSettings({ center: this.mainCenter }).pagination.default === 'scroll';
|
|
10894
|
+
}
|
|
10895
|
+
}
|
|
10896
|
+
/** The languages of the project - its files languages/<code>.json, not the error messages. */
|
|
10897
|
+
async loadProjectLanguages() {
|
|
10898
|
+
if (!this.tenantName || !this.projectSeleted)
|
|
10899
|
+
return;
|
|
10900
|
+
const files = await this.couchdbService.listFiles(`${this.tenantName}_${this.projectSeleted}`, 'languages/');
|
|
10901
|
+
const codes = files
|
|
10902
|
+
.map(id => /^languages\/([a-z]{2,3}(?:[-_][a-z0-9]+)?)\.json$/i.exec(id)?.[1])
|
|
10903
|
+
.filter((code) => !!code);
|
|
10904
|
+
if (JSON.stringify(codes) === JSON.stringify(this.projectLanguages))
|
|
10905
|
+
return;
|
|
10906
|
+
this.projectLanguages = codes;
|
|
10907
|
+
if (!this.mainCenter?.appSettings)
|
|
10908
|
+
return;
|
|
10909
|
+
this.addSettingEntries();
|
|
10910
|
+
this.menuItemsCopy = JSON.parse(JSON.stringify(this.menuItems));
|
|
10911
|
+
if (this.lastMenuTranslations)
|
|
10912
|
+
this.applyMenuTranslations(this.lastMenuTranslations);
|
|
10913
|
+
// the app runs without zone.js: after the await the view has to be told
|
|
10914
|
+
this.injector.get(ChangeDetectorRef).markForCheck();
|
|
10915
|
+
}
|
|
10167
10916
|
async getPaginationType() {
|
|
10168
10917
|
if (isNativeMobile()) {
|
|
10169
10918
|
this.scrollPagination = await this.utilityService.getLocalStorage('scrollPagination');
|
|
@@ -10177,13 +10926,29 @@ class SideMenuComponent {
|
|
|
10177
10926
|
// the project's texts in the device's (web: the browser's) language right from the start, on the
|
|
10178
10927
|
// web as on the phone - before, the web showed the layout's raw texts until a language was
|
|
10179
10928
|
// chosen in the menu (#166)
|
|
10929
|
+
await this.applyStartLanguage();
|
|
10930
|
+
}
|
|
10931
|
+
/**
|
|
10932
|
+
* The first language of startLanguages the project has a file for - without startLanguages the
|
|
10933
|
+
* device language - and English as the last resort.
|
|
10934
|
+
*/
|
|
10935
|
+
async applyStartLanguage() {
|
|
10180
10936
|
try {
|
|
10181
|
-
const
|
|
10182
|
-
|
|
10183
|
-
|
|
10937
|
+
const wanted = this.startLanguages?.length
|
|
10938
|
+
? this.startLanguages
|
|
10939
|
+
: [await this.getDeviceLanguage()];
|
|
10940
|
+
const candidates = [...new Set([...wanted, 'en']
|
|
10941
|
+
.map((code) => String(code || '').slice(0, 2).toLowerCase())
|
|
10942
|
+
.filter(Boolean))];
|
|
10943
|
+
for (const code of candidates) {
|
|
10944
|
+
if (this.languageChosenByUser)
|
|
10945
|
+
return;
|
|
10946
|
+
if (await this.changeLanguage(`${code}.json`))
|
|
10947
|
+
return;
|
|
10948
|
+
}
|
|
10184
10949
|
}
|
|
10185
10950
|
catch (error) {
|
|
10186
|
-
console.error('Failed to load
|
|
10951
|
+
console.error('Failed to load the start language:', error);
|
|
10187
10952
|
}
|
|
10188
10953
|
}
|
|
10189
10954
|
ngOnDestroy() {
|
|
@@ -10583,6 +11348,7 @@ class SideMenuComponent {
|
|
|
10583
11348
|
if (this.mobileMode && !this.isCollapsed) {
|
|
10584
11349
|
this.toggleCollapsed();
|
|
10585
11350
|
}
|
|
11351
|
+
this.languageChosenByUser = true;
|
|
10586
11352
|
await this.changeLanguage(option.data_url);
|
|
10587
11353
|
return;
|
|
10588
11354
|
}
|
|
@@ -10594,6 +11360,17 @@ class SideMenuComponent {
|
|
|
10594
11360
|
this.openLogsTable();
|
|
10595
11361
|
return;
|
|
10596
11362
|
}
|
|
11363
|
+
if (option.home) {
|
|
11364
|
+
if (this.mobileMode && !this.isCollapsed)
|
|
11365
|
+
this.toggleCollapsed();
|
|
11366
|
+
// Main's center itself: the app then picks the start page of the user's role
|
|
11367
|
+
this.invokeMenu.emit(this.mainCenter ?? menu);
|
|
11368
|
+
return;
|
|
11369
|
+
}
|
|
11370
|
+
if (option.terms && option.document) {
|
|
11371
|
+
await this.openTermsDocument({ ...option.document, caption: menu?.label?.caption || '' });
|
|
11372
|
+
return;
|
|
11373
|
+
}
|
|
10597
11374
|
if (option.terms) {
|
|
10598
11375
|
this.notificationService.info('Term Not Apply');
|
|
10599
11376
|
return;
|
|
@@ -10603,7 +11380,12 @@ class SideMenuComponent {
|
|
|
10603
11380
|
return;
|
|
10604
11381
|
}
|
|
10605
11382
|
if (option.projectVersion) {
|
|
10606
|
-
this.
|
|
11383
|
+
const info = this.appVersionInfo ?? {};
|
|
11384
|
+
const version = [info.appVersion, info.appBuild, info.appBuildNumber].filter(Boolean).join(' · ');
|
|
11385
|
+
if (version)
|
|
11386
|
+
this.notificationService.info(version);
|
|
11387
|
+
else
|
|
11388
|
+
this.notificationService.warning('Project Version Not Apply');
|
|
10607
11389
|
return;
|
|
10608
11390
|
}
|
|
10609
11391
|
if (option.action === 'login' &&
|
|
@@ -10642,11 +11424,38 @@ class SideMenuComponent {
|
|
|
10642
11424
|
navigateToProject(project) {
|
|
10643
11425
|
this.invokeProject.emit(project);
|
|
10644
11426
|
}
|
|
11427
|
+
/**
|
|
11428
|
+
* A document of Terms & Conditions: a link opens in a new window, a PDF from the project's Media as
|
|
11429
|
+
* well, a written text is shown as a message.
|
|
11430
|
+
*/
|
|
11431
|
+
async openTermsDocument(document) {
|
|
11432
|
+
if (document.kind === 'link') {
|
|
11433
|
+
window.open(document.value, '_blank', 'noopener');
|
|
11434
|
+
return;
|
|
11435
|
+
}
|
|
11436
|
+
if (document.kind === 'pdf') {
|
|
11437
|
+
try {
|
|
11438
|
+
const path = document.value.startsWith('Media/') ? document.value : `Media/${document.value}`;
|
|
11439
|
+
const src = await this.couchdbService.getImageSrcFromCouchDb(`${this.tenantName}_${this.projectSeleted}`, path);
|
|
11440
|
+
const url = src.startsWith('data:') ? URL.createObjectURL(await (await fetch(src)).blob()) : src;
|
|
11441
|
+
window.open(url, '_blank', 'noopener');
|
|
11442
|
+
}
|
|
11443
|
+
catch (error) {
|
|
11444
|
+
console.error('The PDF of Terms & Conditions could not be opened', error);
|
|
11445
|
+
}
|
|
11446
|
+
return;
|
|
11447
|
+
}
|
|
11448
|
+
// a text: the dialog (a notice in the corner was too small and went away by itself)
|
|
11449
|
+
this.termsDocument = [{ name: 'doc', caption: document.caption || '', kind: 'text', value: document.value }];
|
|
11450
|
+
}
|
|
11451
|
+
/** The text document of Terms & Conditions open now (vl-terms-dialog), null when none. */
|
|
11452
|
+
termsDocument = null;
|
|
11453
|
+
/** Loads a language of the project; false when the project has no such language file. */
|
|
10645
11454
|
async changeLanguage(lang) {
|
|
10646
11455
|
if (!lang ||
|
|
10647
11456
|
!this.tenantName ||
|
|
10648
11457
|
!this.projectSeleted) {
|
|
10649
|
-
return;
|
|
11458
|
+
return false;
|
|
10650
11459
|
}
|
|
10651
11460
|
try {
|
|
10652
11461
|
if (lang === 'de.json') {
|
|
@@ -10665,7 +11474,7 @@ class SideMenuComponent {
|
|
|
10665
11474
|
if (!selectedLanguage ||
|
|
10666
11475
|
typeof selectedLanguage !== 'object') {
|
|
10667
11476
|
console.warn(`Language file "${lang}" was not found.`);
|
|
10668
|
-
return;
|
|
11477
|
+
return false;
|
|
10669
11478
|
}
|
|
10670
11479
|
this.languageChange.emit({
|
|
10671
11480
|
selectedLanguage,
|
|
@@ -10678,9 +11487,11 @@ class SideMenuComponent {
|
|
|
10678
11487
|
this.lastMenuTranslations = selectedLanguage;
|
|
10679
11488
|
this.applyMenuTranslations(selectedLanguage);
|
|
10680
11489
|
this.applySettingTranslations(selectedLanguage);
|
|
11490
|
+
return true;
|
|
10681
11491
|
}
|
|
10682
11492
|
catch (error) {
|
|
10683
11493
|
console.error(`Failed to change language to "${lang}":`, error);
|
|
11494
|
+
return false;
|
|
10684
11495
|
}
|
|
10685
11496
|
}
|
|
10686
11497
|
applyMenuTranslations(selectedLanguage) {
|
|
@@ -10737,11 +11548,11 @@ class SideMenuComponent {
|
|
|
10737
11548
|
});
|
|
10738
11549
|
}
|
|
10739
11550
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: SideMenuComponent, deps: [{ token: i1$5.NzI18nService }, { token: MobileKeycloakService }, { token: Couchdb }, { token: i7.OAuthService }, { token: i1$2.Platform }, { token: RequestService }, { token: UtilityService }, { token: i1$4.DialogService }, { token: NotificationService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
10740
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: SideMenuComponent, isStandalone: true, selector: "vl-side-menu", inputs: { menuItems: "menuItems", userInfo: "userInfo", settings: "settings", projects: "projects", tenantName: "tenantName", environment: "environment", projectSeleted: "projectSeleted", appVersionInfo: "appVersionInfo" }, outputs: { languageChange: "languageChange", invokeMenu: "invokeMenu", menuToggle: "menuToggle", invokeProject: "invokeProject", errorMessage: "errorMessage", deleteProject: "deleteProject", paginationType: "paginationType" }, host: { listeners: { "window:resize": "onResizeMobileMode()", "document:click": "onDocumentClick($event)" }, properties: { "class.sidemenu-mobile": "this.mobileMode" } }, viewQueries: [{ propertyName: "sideMenu", first: true, predicate: ["sideMenu"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: the active language has a check mark, like the active pagination type\r\n - fix: all check marks (pagination, language) stand in one column at the right edge; the\r\n pagination marks followed their caption at a fixed distance and landed elsewhere on iOS\r\n - change: the version footer has three columns - version, build (source commit) and build\r\n number (appBuildNumber), the three values build.sh and the web Docker build produce -->\r\n<!-- Shuaib 2026-09-24\r\n - change: sign-in visibility checks now include jwtToken alongside keycloak and oktaAuth. -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment on the option key, singular since 2026-09-16, and on the sign-in\r\n branches, which know keycloak and oktaAuth but not jwtToken -->\r\n<div class=\"left-wrap sidemenu\" [class.collapsed]=\"isCollapsed\"\r\n [ngStyle]=\"{ 'z-index': !isCollapsed && isMobile ? 999999 : 'auto' }\"\r\n #sideMenu>\r\n <!-- Move toggle button OUTSIDE menu container -->\r\n <div class=\"side-toggle-handle\" id=\"toggle-id\" (click)=\"toggleCollapsed()\"\r\n [class.collapsed]=\"isCollapsed\">\r\n <span id=\"toggle-icon\" nz-icon\r\n [nzType]=\"isCollapsed ? 'caret-right' : 'caret-left'\"></span>\r\n </div>\r\n <div class=\"side-menu\" id=\"sidemenuwrap\"\r\n [ngStyle]=\"{ width: (isMobile && isCollapsed) ? '1px' : isCollapsed ? '60px' : '' }\">\r\n <!-- user content -->\r\n <ng-container *ngIf=\"loginedUserInfo && loginedUserInfo?.name\">\r\n <div class=\"user-profile\" [class.collapsed]=\"isCollapsed\">\r\n <img class=\"avatar\" [src]=\"loginedUserInfo?.image\" alt=\"User\" />\r\n <div [class]=\"isMobile ? '' : 'details'\" *ngIf=\"!isCollapsed\">\r\n <div class=\"name\">{{ loginedUserInfo.name }}</div>\r\n <div class=\"email\">{{ loginedUserInfo?.email }}</div>\r\n <div class=\"actions\" *ngIf=\"loginedUserInfo?.actions?.length\">\r\n <button *ngFor=\"let action of loginedUserInfo?.actions\" nz-button\r\n nzType=\"link\" nzSize=\"small\"\r\n (click)=\"invokeNavigate(action)\">\r\n <span>{{ action?.label?.caption }}</span>\r\n <span nz-icon [nzType]=\"action.icon\"></span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <!-- @contract decision: this container reads option (singular), like every other one\r\n reality: it read options (plural) until 2026-09-16. A menu file written for the old\r\n spelling is ignored without an error.\r\n\r\n @contract decision: sign-in visibility supports keycloak, oktaAuth and jwtToken.\r\n A JWT project uses the decoded user's login state, like the other providers.\r\n seen: the login type comparisons in the lines below -->\r\n <!-- dynamic menu -->\r\n <ul nz-menu nzMode=\"inline\" nzTheme=\"dark\"\r\n [nzInlineCollapsed]=\"isCollapsed\">\r\n <ng-container *ngFor=\"let item of menuItems\">\r\n <ng-container\r\n *ngIf=\"!item.submenu && item?.option?.action != 'logout'; else submenu\">\r\n <span\r\n [class]=\"environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' || environment?.login?.type === 'jwtToken' ? item.option?.login === true ? loginedUserInfo?.name ? '' : 'hidden' : item.option?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : '' : userInfo?.userId ? item.option?.login ? item.option.role ? item.option.role == userInfo.userRole ? '' : 'hidden' : '' : 'hidden' : !item.option?.login ? '' : 'hidden' \">\r\n <li (click)=\"invokeNavigate(item)\" nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? item?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"item.icon\"></span>\r\n <span>{{ item?.label?.caption }}</span>\r\n </li>\r\n </span>\r\n </ng-container>\r\n <ng-template #submenu>\r\n <span\r\n [class]=\"item.option?.login === true && (environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' || environment?.login?.type === 'jwtToken') ? loginedUserInfo?.name ? '' : 'hidden' : item.option?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : ''\">\r\n <li nz-submenu *ngIf=\"item?.option?.action != 'logout'\"\r\n [nzTitle]=\"item?.label?.caption\"\r\n [nzIcon]=\"item.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let child of item.submenu\">\r\n <li (click)=\"invokeNavigate(child)\" *ngIf=\"!child.submenu\"\r\n nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? child?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"child?.icon\"></span>\r\n <span>{{ child?.label?.caption }}</span>\r\n </li>\r\n <ng-container *ngIf=\"child.submenu\">\r\n <li nz-submenu [nzTitle]=\"child?.label?.caption\"\r\n [nzIcon]=\"child?.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let subChild of child.submenu\">\r\n <li (click)=\"invokeNavigate(subChild)\" nz-menu-item>\r\n <ng-container\r\n *ngIf=\"subChild?.option?.setImageUrl; else antIcon\">\r\n <img *ngIf=\"isUrl(subChild?.icon)\"\r\n [src]=\"subChild?.icon\" alt=\"icon\"\r\n style=\"width: 16px; height: 16px; margin-right: 8px;\" />\r\n </ng-container>\r\n <ng-template #antIcon>\r\n <span nz-icon [nzType]=\"subChild?.icon\"></span>\r\n </ng-template>\r\n <span>{{ subChild?.label?.caption }}</span>\r\n @if(subChild?.option?.numberedPagination &&\r\n !scrollPagination){\r\n <span nz-icon\r\n nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n @if(subChild?.option?.scrollPagination &&\r\n scrollPagination){\r\n <span nz-icon\r\n nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n @if(subChild?.option?.changeLang &&\r\n subChild?.option?.data_url === activeLanguage){\r\n <span nz-icon nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <!-- separator -->\r\n <li *ngIf=\"settingMenu.submenu\" class=\"menu-separator\"></li>\r\n\r\n <!-- settings menu -->\r\n <ng-container *ngIf=\"!settingMenu.submenu; else settingSubmenu\"\r\n style=\"position: absolute; bottom: 0;\">\r\n <li (click)=\"invokeNavigate(settingMenu)\" nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? settingMenu?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"settingMenu.icon\"></span>\r\n <span>{{ settingMenu?.label?.caption }}</span>\r\n </li>\r\n </ng-container>\r\n <ng-template #settingSubmenu>\r\n <li nz-submenu [nzTitle]=\"settingMenu?.label?.caption\"\r\n [nzIcon]=\"settingMenu.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let child of settingMenu.submenu\">\r\n <li (click)=\"invokeNavigate(child)\" *ngIf=\"!child.submenu\"\r\n nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? child?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"child?.icon\"></span>\r\n <span>{{ child?.label?.caption }}</span>\r\n </li>\r\n <ng-container *ngIf=\"child.submenu\">\r\n <li nz-submenu [nzTitle]=\"child?.label?.caption\"\r\n [nzIcon]=\"child?.icon\">\r\n <ul style=\"width: 260px;\">\r\n <ng-container\r\n *ngFor=\"let subChild of child.submenu; let i = index\">\r\n <li (click)=\"invokeNavigate(subChild, child)\"\r\n nz-menu-item>\r\n <span\r\n [class]=\"child?.label?.caption === 'Languages' ? '' : 'menu-row'\">\r\n <ng-container\r\n *ngIf=\"subChild?.option?.changeProject; else antIcon\">\r\n <img [src]=\"subChild?.icon\" alt=\"icon\"\r\n style=\"width: 16px; height: 16px; margin-right: 8px;\" />\r\n </ng-container>\r\n <ng-template #antIcon>\r\n <span nz-icon [nzType]=\"subChild?.icon\"></span>\r\n </ng-template>\r\n <span>{{ subChild?.label?.caption }}</span>\r\n <!-- Delete icon (prevent click bubbling) -->\r\n <span *ngIf=\"child?.label?.caption != 'Languages'\"\r\n nz-icon nzType=\"delete\" class=\"delete-icon\"\r\n style=\"padding-left: 5%;\"\r\n (click)=\"deleteMenuItem(subChild, i, $event)\"></span>\r\n </span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-template>\r\n </ul>\r\n @if (!isCollapsed && appVersionInfo?.appVersion) {\r\n <div class=\"app-version-footer\">\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Version</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appVersion }}</span>\r\n </div>\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Build</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appBuild || '-' }}</span>\r\n </div>\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Build No.</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appBuildNumber || '-' }}</span>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [":host{position:relative;display:block;flex:0 0 auto;width:250px;height:100%;min-height:0;overflow:visible;transition:width .3s ease}.left-wrap.sidemenu{position:relative;width:250px;height:100%;min-height:0;overflow:visible;transition:width .3s ease,transform .3s ease}.side-menu{position:relative;display:flex;flex-direction:column;width:250px;height:100%;min-height:0;color:#fff;background-color:#0d1b2a;overflow:hidden;transition:width .3s ease,box-shadow .3s ease}:host:has(.left-wrap.sidemenu.collapsed){width:64px}.left-wrap.sidemenu.collapsed,.left-wrap.sidemenu.collapsed .side-menu{width:64px}.menu-separator{flex:0 0 auto;height:1px;margin:15px 12px 6px;background-color:#ffffff26;border:0;list-style:none}.user-profile{flex:0 0 auto;padding:20px 10px 16px;margin-top:40px;text-align:center;border-bottom:1px solid rgba(255,255,255,.1);overflow:hidden;transition:padding .25s ease,margin .25s ease,opacity .25s ease,max-height .25s ease}.user-profile .avatar{display:block;width:64px;height:64px;margin:0 auto 8px;object-fit:cover;border:2px solid #ffffff;border-radius:50%;transition:width .25s ease,height .25s ease,margin .25s ease}.user-profile .details{min-width:0;overflow:hidden;transition:opacity .2s ease}.user-profile .name{color:#fff;font-size:14px;font-weight:600;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-profile .email{margin:2px 0 8px;color:#aaa;font-size:12px;line-height:1.4;overflow-wrap:anywhere;word-break:break-word}.user-profile .actions{display:flex;align-items:center;justify-content:center;gap:6px}.user-profile .actions button{margin:0;color:#fff}.left-wrap.sidemenu.collapsed .user-profile{padding:12px 8px}.left-wrap.sidemenu.collapsed .user-profile .avatar{width:40px;height:40px;margin-bottom:0}.left-wrap.sidemenu.collapsed .user-profile .details,.left-wrap.sidemenu.collapsed .user-profile .name,.left-wrap.sidemenu.collapsed .user-profile .email,.left-wrap.sidemenu.collapsed .user-profile .actions{display:none}.side-menu ul[nz-menu]{flex:1 1 auto;width:100%;min-height:0;margin:0;padding:4px 0 8px;overflow-x:hidden;overflow-y:auto;background-color:transparent;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.28) transparent;scroll-behavior:smooth}.side-menu ul[nz-menu]::-webkit-scrollbar{width:6px}.side-menu ul[nz-menu]::-webkit-scrollbar-track{background:transparent}.side-menu ul[nz-menu]::-webkit-scrollbar-thumb{background-color:#ffffff47;border-radius:999px}.side-menu ul[nz-menu]::-webkit-scrollbar-thumb:hover{background-color:#ffffff6b}.menu-row{display:flex;align-items:center;width:100%;min-width:0}.menu-text{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.delete-icon{flex:0 0 auto;margin-left:auto;color:#ffffffb3;cursor:pointer;transition:color .18s ease,transform .18s ease}.delete-icon:hover{color:#ff7875;transform:scale(1.08)}.projects{position:static;flex:0 0 auto;width:100%;margin-top:auto;background-color:#0d1b2a}.side-toggle-handle{position:absolute;top:24px;right:-14px;z-index:10000;display:flex;align-items:center;justify-content:center;width:28px;height:48px;padding:0;color:#fff;background-color:#0d1b2a;border:0;border-radius:0 6px 6px 0;box-shadow:2px 0 6px #00000040;cursor:pointer;transform:translateY(-50%);transition:background-color .2s ease,box-shadow .2s ease}.side-toggle-handle:hover{background-color:#142a40;box-shadow:3px 0 9px #0000004d}.side-toggle-handle:focus-visible{outline:3px solid rgba(24,144,255,.45);outline-offset:2px}.side-toggle-handle span{color:#fff;font-size:14px;line-height:1;transition:transform .25s ease}.collapse-btn{position:absolute;top:8px;right:8px;z-index:10001}:host(:not(.sidemenu-mobile)) .left-wrap.sidemenu.collapsed:hover{transform:translate(0)}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed{width:64px!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title{display:flex!important;align-items:center!important;justify-content:center!important;width:45px!important;height:32px!important;margin-inline:0!important;padding-inline:0!important;overflow:hidden!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-title-content,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .menu-text,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .delete-icon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-submenu-arrow{display:none!important;width:0!important;min-width:0!important;max-width:0!important;margin:0!important;padding:0!important;visibility:hidden!important;overflow:hidden!important;text-overflow:clip!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-item-icon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item>.anticon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title>.anticon{display:inline-flex!important;flex:0 0 auto;align-items:center;justify-content:center;width:auto!important;min-width:18px;margin:0!important;padding:0!important;color:inherit;font-size:18px;line-height:1;visibility:visible!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .menu-row{display:contents}:host(.sidemenu-mobile){position:absolute;top:0;bottom:0;left:0;z-index:9999;width:250px;height:100%}:host(.sidemenu-mobile):has(.left-wrap.sidemenu.collapsed){width:0}:host(.sidemenu-mobile) .left-wrap.sidemenu{width:250px;height:100%}:host(.sidemenu-mobile) .side-menu,:host(.sidemenu-mobile) .side-menu.open{width:250px;height:100%;box-shadow:8px 0 22px #0000003d}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed{width:250px;transform:translate(-250px)}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .side-menu{width:250px;box-shadow:none}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .side-toggle-handle{right:-28px}:host(.sidemenu-mobile) .side-toggle-handle{top:0;right:0;padding:0;transform:none!important}:host(.sidemenu-mobile) .collapse-btn{top:8px;right:8px}:host(.sidemenu-mobile) .user-profile{margin-top:40px}:host(.sidemenu-mobile) .user-profile .avatar{width:48px;height:48px}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .user-profile{max-height:0;padding:0;margin:0;opacity:0;overflow:hidden;border-bottom:0}@media(prefers-reduced-motion:reduce){:host,.left-wrap.sidemenu,.side-menu,.user-profile,.user-profile .avatar,.side-toggle-handle,.side-toggle-handle span{transition:none}.side-menu ul[nz-menu]{scroll-behavior:auto}}.app-version-footer{flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:10px 12px;border-top:1px solid rgba(255,255,255,.15);color:#ffffffa6;font-size:11px;line-height:1.4;text-align:center}.app-version-footer__item{display:flex;flex-direction:column;min-width:0}.app-version-footer__label{font-size:10px;opacity:.7}.app-version-footer__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pagination-check{position:absolute;top:50%;right:42px;transform:translateY(-50%)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: PlatformModule }, { kind: "ngmodule", type:
|
|
11551
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.2", type: SideMenuComponent, isStandalone: true, selector: "vl-side-menu", inputs: { menuItems: "menuItems", userInfo: "userInfo", settings: "settings", projects: "projects", tenantName: "tenantName", environment: "environment", projectSeleted: "projectSeleted", appVersionInfo: "appVersionInfo", startLanguages: "startLanguages", mainCenter: "mainCenter" }, outputs: { languageChange: "languageChange", invokeMenu: "invokeMenu", menuToggle: "menuToggle", invokeProject: "invokeProject", errorMessage: "errorMessage", deleteProject: "deleteProject", paginationType: "paginationType" }, host: { listeners: { "window:resize": "onResizeMobileMode()", "document:click": "onDocumentClick($event)" }, properties: { "class.sidemenu-mobile": "this.mobileMode" } }, viewQueries: [{ propertyName: "sideMenu", first: true, predicate: ["sideMenu"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-20\r\n - new: a fourth footer row \"App\" with the export of the app (appVersionInfo.appRelease, issue #57) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: the active language has a check mark, like the active pagination type\r\n - fix: all check marks (pagination, language) stand in one column at the right edge; the\r\n pagination marks followed their caption at a fixed distance and landed elsewhere on iOS\r\n - change: the version footer has three columns - version, build (source commit) and build\r\n number (appBuildNumber), the three values build.sh and the web Docker build produce -->\r\n<!-- Shuaib 2026-09-24\r\n - change: sign-in visibility checks now include jwtToken alongside keycloak and oktaAuth. -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment on the option key, singular since 2026-09-16, and on the sign-in\r\n branches, which know keycloak and oktaAuth but not jwtToken -->\r\n<div class=\"left-wrap sidemenu\" [class.collapsed]=\"isCollapsed\"\r\n [ngStyle]=\"{ 'z-index': !isCollapsed && isMobile ? 999999 : 'auto' }\"\r\n #sideMenu>\r\n <!-- Move toggle button OUTSIDE menu container -->\r\n <div class=\"side-toggle-handle\" id=\"toggle-id\" (click)=\"toggleCollapsed()\"\r\n [class.collapsed]=\"isCollapsed\">\r\n <span id=\"toggle-icon\" nz-icon\r\n [nzType]=\"isCollapsed ? 'caret-right' : 'caret-left'\"></span>\r\n </div>\r\n <div class=\"side-menu\" id=\"sidemenuwrap\"\r\n [ngStyle]=\"{ width: (isMobile && isCollapsed) ? '1px' : isCollapsed ? '60px' : '' }\">\r\n <!-- user content -->\r\n <ng-container *ngIf=\"loginedUserInfo && loginedUserInfo?.name\">\r\n <div class=\"user-profile\" [class.collapsed]=\"isCollapsed\">\r\n <img class=\"avatar\" [src]=\"loginedUserInfo?.image\" alt=\"User\" />\r\n <div [class]=\"isMobile ? '' : 'details'\" *ngIf=\"!isCollapsed\">\r\n <div class=\"name\">{{ loginedUserInfo.name }}</div>\r\n <div class=\"email\">{{ loginedUserInfo?.email }}</div>\r\n <div class=\"actions\" *ngIf=\"loginedUserInfo?.actions?.length\">\r\n <button *ngFor=\"let action of loginedUserInfo?.actions\" nz-button\r\n nzType=\"link\" nzSize=\"small\"\r\n (click)=\"invokeNavigate(action)\">\r\n <span>{{ action?.label?.caption }}</span>\r\n <span nz-icon [nzType]=\"action.icon\"></span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <!-- @contract decision: this container reads option (singular), like every other one\r\n reality: it read options (plural) until 2026-09-16. A menu file written for the old\r\n spelling is ignored without an error.\r\n\r\n @contract decision: sign-in visibility supports keycloak, oktaAuth and jwtToken.\r\n A JWT project uses the decoded user's login state, like the other providers.\r\n seen: the login type comparisons in the lines below -->\r\n <!-- dynamic menu -->\r\n <ul nz-menu nzMode=\"inline\" nzTheme=\"dark\"\r\n [nzInlineCollapsed]=\"isCollapsed\">\r\n <ng-container *ngFor=\"let item of menuItems\">\r\n <ng-container\r\n *ngIf=\"!item.submenu && item?.option?.action != 'logout'; else submenu\">\r\n <span\r\n [class]=\"environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' || environment?.login?.type === 'jwtToken' ? item.option?.login === true ? loginedUserInfo?.name ? '' : 'hidden' : item.option?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : '' : userInfo?.userId ? item.option?.login ? item.option.role ? item.option.role == userInfo.userRole ? '' : 'hidden' : '' : 'hidden' : !item.option?.login ? '' : 'hidden' \">\r\n <li (click)=\"invokeNavigate(item)\" nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? item?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"item.icon\"></span>\r\n <span>{{ item?.label?.caption }}</span>\r\n </li>\r\n </span>\r\n </ng-container>\r\n <ng-template #submenu>\r\n <span\r\n [class]=\"item.option?.login === true && (environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' || environment?.login?.type === 'jwtToken') ? loginedUserInfo?.name ? '' : 'hidden' : item.option?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : ''\">\r\n <li nz-submenu *ngIf=\"item?.option?.action != 'logout'\"\r\n [nzTitle]=\"item?.label?.caption\"\r\n [nzIcon]=\"item.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let child of item.submenu\">\r\n <li (click)=\"invokeNavigate(child)\" *ngIf=\"!child.submenu\"\r\n nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? child?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"child?.icon\"></span>\r\n <span>{{ child?.label?.caption }}</span>\r\n </li>\r\n <ng-container *ngIf=\"child.submenu\">\r\n <li nz-submenu [nzTitle]=\"child?.label?.caption\"\r\n [nzIcon]=\"child?.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let subChild of child.submenu\">\r\n <li (click)=\"invokeNavigate(subChild)\" nz-menu-item>\r\n <ng-container\r\n *ngIf=\"subChild?.option?.setImageUrl; else antIcon\">\r\n <img *ngIf=\"isUrl(subChild?.icon)\"\r\n [src]=\"subChild?.icon\" alt=\"icon\"\r\n style=\"width: 16px; height: 16px; margin-right: 8px;\" />\r\n </ng-container>\r\n <ng-template #antIcon>\r\n <span nz-icon [nzType]=\"subChild?.icon\"></span>\r\n </ng-template>\r\n <span>{{ subChild?.label?.caption }}</span>\r\n @if(subChild?.option?.numberedPagination &&\r\n !scrollPagination){\r\n <span nz-icon\r\n nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n @if(subChild?.option?.scrollPagination &&\r\n scrollPagination){\r\n <span nz-icon\r\n nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n @if(subChild?.option?.changeLang &&\r\n subChild?.option?.data_url === activeLanguage){\r\n <span nz-icon nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <!-- separator -->\r\n <li *ngIf=\"settingMenu.submenu\" class=\"menu-separator\"></li>\r\n\r\n <!-- settings menu -->\r\n <ng-container *ngIf=\"!settingMenu.submenu; else settingSubmenu\"\r\n style=\"position: absolute; bottom: 0;\">\r\n <li (click)=\"invokeNavigate(settingMenu)\" nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? settingMenu?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"settingMenu.icon\"></span>\r\n <span>{{ settingMenu?.label?.caption }}</span>\r\n </li>\r\n </ng-container>\r\n <ng-template #settingSubmenu>\r\n <li nz-submenu [nzTitle]=\"settingMenu?.label?.caption\"\r\n [nzIcon]=\"settingMenu.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let child of settingMenu.submenu\">\r\n <li (click)=\"invokeNavigate(child)\" *ngIf=\"!child.submenu\"\r\n nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? child?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"child?.icon\"></span>\r\n <span>{{ child?.label?.caption }}</span>\r\n </li>\r\n <ng-container *ngIf=\"child.submenu\">\r\n <li nz-submenu [nzTitle]=\"child?.label?.caption\"\r\n [nzIcon]=\"child?.icon\">\r\n <ul style=\"width: 260px;\">\r\n <ng-container\r\n *ngFor=\"let subChild of child.submenu; let i = index\">\r\n <li (click)=\"invokeNavigate(subChild, child)\"\r\n nz-menu-item>\r\n <span\r\n [class]=\"child?.label?.caption === 'Languages' ? '' : 'menu-row'\">\r\n <ng-container\r\n *ngIf=\"subChild?.option?.changeProject; else antIcon\">\r\n <img [src]=\"subChild?.icon\" alt=\"icon\"\r\n style=\"width: 16px; height: 16px; margin-right: 8px;\" />\r\n </ng-container>\r\n <ng-template #antIcon>\r\n <span nz-icon [nzType]=\"subChild?.icon\"></span>\r\n </ng-template>\r\n <span>{{ subChild?.label?.caption }}</span>\r\n <!-- Delete icon (prevent click bubbling) -->\r\n <span *ngIf=\"child?.label?.caption != 'Languages'\"\r\n nz-icon nzType=\"delete\" class=\"delete-icon\"\r\n style=\"padding-left: 5%;\"\r\n (click)=\"deleteMenuItem(subChild, i, $event)\"></span>\r\n </span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-template>\r\n </ul>\r\n @if (!isCollapsed && appVersionInfo?.appVersion) {\r\n <div class=\"app-version-footer\">\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Version</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appVersion }}</span>\r\n </div>\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Build</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appBuild || '-' }}</span>\r\n </div>\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Build No.</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appBuildNumber || '-' }}</span>\r\n </div>\r\n <!-- the app's own export (issue #57): \"Export 2 \u00B7 41908dd \u00B7 20.10.2026\", only when it has one -->\r\n @if (appVersionInfo.appRelease) {\r\n <div class=\"app-version-footer__item app-version-footer__release\" [title]=\"appVersionInfo.appRelease\">\r\n <span class=\"app-version-footer__label\">App</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appRelease }}</span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24 - a text document of Terms & Conditions -->\r\n@if (termsDocument) {\r\n<vl-terms-dialog [documents]=\"termsDocument\" [translations]=\"lastMenuTranslations\" (closed)=\"termsDocument = null\"></vl-terms-dialog>\r\n}\r\n", styles: [":host{position:relative;display:block;flex:0 0 auto;width:250px;height:100%;min-height:0;overflow:visible;transition:width .3s ease}.left-wrap.sidemenu{position:relative;width:250px;height:100%;min-height:0;overflow:visible;transition:width .3s ease,transform .3s ease}.side-menu{position:relative;display:flex;flex-direction:column;width:250px;height:100%;min-height:0;color:#fff;background-color:#0d1b2a;overflow:hidden;transition:width .3s ease,box-shadow .3s ease}:host:has(.left-wrap.sidemenu.collapsed){width:64px}.left-wrap.sidemenu.collapsed,.left-wrap.sidemenu.collapsed .side-menu{width:64px}.menu-separator{flex:0 0 auto;height:1px;margin:15px 12px 6px;background-color:#ffffff26;border:0;list-style:none}.user-profile{flex:0 0 auto;padding:20px 10px 16px;margin-top:40px;text-align:center;border-bottom:1px solid rgba(255,255,255,.1);overflow:hidden;transition:padding .25s ease,margin .25s ease,opacity .25s ease,max-height .25s ease}.user-profile .avatar{display:block;width:64px;height:64px;margin:0 auto 8px;object-fit:cover;border:2px solid #ffffff;border-radius:50%;transition:width .25s ease,height .25s ease,margin .25s ease}.user-profile .details{min-width:0;overflow:hidden;transition:opacity .2s ease}.user-profile .name{color:#fff;font-size:14px;font-weight:600;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-profile .email{margin:2px 0 8px;color:#aaa;font-size:12px;line-height:1.4;overflow-wrap:anywhere;word-break:break-word}.user-profile .actions{display:flex;align-items:center;justify-content:center;gap:6px}.user-profile .actions button{margin:0;color:#fff}.left-wrap.sidemenu.collapsed .user-profile{padding:12px 8px}.left-wrap.sidemenu.collapsed .user-profile .avatar{width:40px;height:40px;margin-bottom:0}.left-wrap.sidemenu.collapsed .user-profile .details,.left-wrap.sidemenu.collapsed .user-profile .name,.left-wrap.sidemenu.collapsed .user-profile .email,.left-wrap.sidemenu.collapsed .user-profile .actions{display:none}.side-menu ul[nz-menu]{flex:1 1 auto;width:100%;min-height:0;margin:0;padding:4px 0 8px;overflow-x:hidden;overflow-y:auto;background-color:transparent;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.28) transparent;scroll-behavior:smooth}.side-menu ul[nz-menu]::-webkit-scrollbar{width:6px}.side-menu ul[nz-menu]::-webkit-scrollbar-track{background:transparent}.side-menu ul[nz-menu]::-webkit-scrollbar-thumb{background-color:#ffffff47;border-radius:999px}.side-menu ul[nz-menu]::-webkit-scrollbar-thumb:hover{background-color:#ffffff6b}.menu-row{display:flex;align-items:center;width:100%;min-width:0}.menu-text{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.delete-icon{flex:0 0 auto;margin-left:auto;color:#ffffffb3;cursor:pointer;transition:color .18s ease,transform .18s ease}.delete-icon:hover{color:#ff7875;transform:scale(1.08)}.projects{position:static;flex:0 0 auto;width:100%;margin-top:auto;background-color:#0d1b2a}.side-toggle-handle{position:absolute;top:24px;right:-14px;z-index:10000;display:flex;align-items:center;justify-content:center;width:28px;height:48px;padding:0;color:#fff;background-color:#0d1b2a;border:0;border-radius:0 6px 6px 0;box-shadow:2px 0 6px #00000040;cursor:pointer;transform:translateY(-50%);transition:background-color .2s ease,box-shadow .2s ease}.side-toggle-handle:hover{background-color:#142a40;box-shadow:3px 0 9px #0000004d}.side-toggle-handle:focus-visible{outline:3px solid rgba(24,144,255,.45);outline-offset:2px}.side-toggle-handle span{color:#fff;font-size:14px;line-height:1;transition:transform .25s ease}.collapse-btn{position:absolute;top:8px;right:8px;z-index:10001}:host(:not(.sidemenu-mobile)) .left-wrap.sidemenu.collapsed:hover{transform:translate(0)}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed{width:64px!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title{display:flex!important;align-items:center!important;justify-content:center!important;width:45px!important;height:32px!important;margin-inline:0!important;padding-inline:0!important;overflow:hidden!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-title-content,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .menu-text,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .delete-icon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-submenu-arrow{display:none!important;width:0!important;min-width:0!important;max-width:0!important;margin:0!important;padding:0!important;visibility:hidden!important;overflow:hidden!important;text-overflow:clip!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-item-icon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item>.anticon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title>.anticon{display:inline-flex!important;flex:0 0 auto;align-items:center;justify-content:center;width:auto!important;min-width:18px;margin:0!important;padding:0!important;color:inherit;font-size:18px;line-height:1;visibility:visible!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .menu-row{display:contents}:host(.sidemenu-mobile){position:absolute;top:0;bottom:0;left:0;z-index:9999;width:250px;height:100%}:host(.sidemenu-mobile):has(.left-wrap.sidemenu.collapsed){width:0}:host(.sidemenu-mobile) .left-wrap.sidemenu{width:250px;height:100%}:host(.sidemenu-mobile) .side-menu,:host(.sidemenu-mobile) .side-menu.open{width:250px;height:100%;box-shadow:8px 0 22px #0000003d}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed{width:250px;transform:translate(-250px)}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .side-menu{width:250px;box-shadow:none}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .side-toggle-handle{right:-28px}:host(.sidemenu-mobile) .side-toggle-handle{top:0;right:0;padding:0;transform:none!important}:host(.sidemenu-mobile) .collapse-btn{top:8px;right:8px}:host(.sidemenu-mobile) .user-profile{margin-top:40px}:host(.sidemenu-mobile) .user-profile .avatar{width:48px;height:48px}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .user-profile{max-height:0;padding:0;margin:0;opacity:0;overflow:hidden;border-bottom:0}@media(prefers-reduced-motion:reduce){:host,.left-wrap.sidemenu,.side-menu,.user-profile,.user-profile .avatar,.side-toggle-handle,.side-toggle-handle span{transition:none}.side-menu ul[nz-menu]{scroll-behavior:auto}}.app-version-footer{flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:10px 12px;border-top:1px solid rgba(255,255,255,.15);color:#ffffffa6;font-size:11px;line-height:1.4;text-align:center}.app-version-footer__item{display:flex;flex-direction:column;min-width:0}.app-version-footer__label{font-size:10px;opacity:.7}.app-version-footer__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.app-version-footer__release{grid-column:1 / -1}.pagination-check{position:absolute;top:50%;right:42px;transform:translateY(-50%)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: PlatformModule }, { kind: "ngmodule", type:
|
|
10741
11552
|
// NG-ZORRO
|
|
10742
11553
|
NzMenuModule }, { kind: "directive", type: i11$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i11$1.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "component", type: i11$1.NzSubMenuComponent, selector: "[nz-submenu]", inputs: ["nzMenuClassName", "nzPaddingLeft", "nzTitle", "nzIcon", "nzTriggerSubMenuAction", "nzOpen", "nzDisabled", "nzPlacement"], outputs: ["nzOpenChange"], exportAs: ["nzSubmenu"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i11.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTooltipModule }, { kind: "directive", type: i13$1.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i12.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i13.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type:
|
|
10743
11554
|
// PrimeNG
|
|
10744
|
-
DynamicDialogModule }] });
|
|
11555
|
+
DynamicDialogModule }, { kind: "component", type: TermsDialog, selector: "vl-terms-dialog", inputs: ["documents", "confirm", "translations"], outputs: ["accepted", "declined", "closed"] }] });
|
|
10745
11556
|
}
|
|
10746
11557
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: SideMenuComponent, decorators: [{
|
|
10747
11558
|
type: Component,
|
|
@@ -10754,8 +11565,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
10754
11565
|
NzTooltipModule,
|
|
10755
11566
|
NzButtonModule,
|
|
10756
11567
|
// PrimeNG
|
|
10757
|
-
DynamicDialogModule
|
|
10758
|
-
], template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: the active language has a check mark, like the active pagination type\r\n - fix: all check marks (pagination, language) stand in one column at the right edge; the\r\n pagination marks followed their caption at a fixed distance and landed elsewhere on iOS\r\n - change: the version footer has three columns - version, build (source commit) and build\r\n number (appBuildNumber), the three values build.sh and the web Docker build produce -->\r\n<!-- Shuaib 2026-09-24\r\n - change: sign-in visibility checks now include jwtToken alongside keycloak and oktaAuth. -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment on the option key, singular since 2026-09-16, and on the sign-in\r\n branches, which know keycloak and oktaAuth but not jwtToken -->\r\n<div class=\"left-wrap sidemenu\" [class.collapsed]=\"isCollapsed\"\r\n [ngStyle]=\"{ 'z-index': !isCollapsed && isMobile ? 999999 : 'auto' }\"\r\n #sideMenu>\r\n <!-- Move toggle button OUTSIDE menu container -->\r\n <div class=\"side-toggle-handle\" id=\"toggle-id\" (click)=\"toggleCollapsed()\"\r\n [class.collapsed]=\"isCollapsed\">\r\n <span id=\"toggle-icon\" nz-icon\r\n [nzType]=\"isCollapsed ? 'caret-right' : 'caret-left'\"></span>\r\n </div>\r\n <div class=\"side-menu\" id=\"sidemenuwrap\"\r\n [ngStyle]=\"{ width: (isMobile && isCollapsed) ? '1px' : isCollapsed ? '60px' : '' }\">\r\n <!-- user content -->\r\n <ng-container *ngIf=\"loginedUserInfo && loginedUserInfo?.name\">\r\n <div class=\"user-profile\" [class.collapsed]=\"isCollapsed\">\r\n <img class=\"avatar\" [src]=\"loginedUserInfo?.image\" alt=\"User\" />\r\n <div [class]=\"isMobile ? '' : 'details'\" *ngIf=\"!isCollapsed\">\r\n <div class=\"name\">{{ loginedUserInfo.name }}</div>\r\n <div class=\"email\">{{ loginedUserInfo?.email }}</div>\r\n <div class=\"actions\" *ngIf=\"loginedUserInfo?.actions?.length\">\r\n <button *ngFor=\"let action of loginedUserInfo?.actions\" nz-button\r\n nzType=\"link\" nzSize=\"small\"\r\n (click)=\"invokeNavigate(action)\">\r\n <span>{{ action?.label?.caption }}</span>\r\n <span nz-icon [nzType]=\"action.icon\"></span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <!-- @contract decision: this container reads option (singular), like every other one\r\n reality: it read options (plural) until 2026-09-16. A menu file written for the old\r\n spelling is ignored without an error.\r\n\r\n @contract decision: sign-in visibility supports keycloak, oktaAuth and jwtToken.\r\n A JWT project uses the decoded user's login state, like the other providers.\r\n seen: the login type comparisons in the lines below -->\r\n <!-- dynamic menu -->\r\n <ul nz-menu nzMode=\"inline\" nzTheme=\"dark\"\r\n [nzInlineCollapsed]=\"isCollapsed\">\r\n <ng-container *ngFor=\"let item of menuItems\">\r\n <ng-container\r\n *ngIf=\"!item.submenu && item?.option?.action != 'logout'; else submenu\">\r\n <span\r\n [class]=\"environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' || environment?.login?.type === 'jwtToken' ? item.option?.login === true ? loginedUserInfo?.name ? '' : 'hidden' : item.option?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : '' : userInfo?.userId ? item.option?.login ? item.option.role ? item.option.role == userInfo.userRole ? '' : 'hidden' : '' : 'hidden' : !item.option?.login ? '' : 'hidden' \">\r\n <li (click)=\"invokeNavigate(item)\" nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? item?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"item.icon\"></span>\r\n <span>{{ item?.label?.caption }}</span>\r\n </li>\r\n </span>\r\n </ng-container>\r\n <ng-template #submenu>\r\n <span\r\n [class]=\"item.option?.login === true && (environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' || environment?.login?.type === 'jwtToken') ? loginedUserInfo?.name ? '' : 'hidden' : item.option?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : ''\">\r\n <li nz-submenu *ngIf=\"item?.option?.action != 'logout'\"\r\n [nzTitle]=\"item?.label?.caption\"\r\n [nzIcon]=\"item.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let child of item.submenu\">\r\n <li (click)=\"invokeNavigate(child)\" *ngIf=\"!child.submenu\"\r\n nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? child?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"child?.icon\"></span>\r\n <span>{{ child?.label?.caption }}</span>\r\n </li>\r\n <ng-container *ngIf=\"child.submenu\">\r\n <li nz-submenu [nzTitle]=\"child?.label?.caption\"\r\n [nzIcon]=\"child?.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let subChild of child.submenu\">\r\n <li (click)=\"invokeNavigate(subChild)\" nz-menu-item>\r\n <ng-container\r\n *ngIf=\"subChild?.option?.setImageUrl; else antIcon\">\r\n <img *ngIf=\"isUrl(subChild?.icon)\"\r\n [src]=\"subChild?.icon\" alt=\"icon\"\r\n style=\"width: 16px; height: 16px; margin-right: 8px;\" />\r\n </ng-container>\r\n <ng-template #antIcon>\r\n <span nz-icon [nzType]=\"subChild?.icon\"></span>\r\n </ng-template>\r\n <span>{{ subChild?.label?.caption }}</span>\r\n @if(subChild?.option?.numberedPagination &&\r\n !scrollPagination){\r\n <span nz-icon\r\n nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n @if(subChild?.option?.scrollPagination &&\r\n scrollPagination){\r\n <span nz-icon\r\n nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n @if(subChild?.option?.changeLang &&\r\n subChild?.option?.data_url === activeLanguage){\r\n <span nz-icon nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <!-- separator -->\r\n <li *ngIf=\"settingMenu.submenu\" class=\"menu-separator\"></li>\r\n\r\n <!-- settings menu -->\r\n <ng-container *ngIf=\"!settingMenu.submenu; else settingSubmenu\"\r\n style=\"position: absolute; bottom: 0;\">\r\n <li (click)=\"invokeNavigate(settingMenu)\" nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? settingMenu?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"settingMenu.icon\"></span>\r\n <span>{{ settingMenu?.label?.caption }}</span>\r\n </li>\r\n </ng-container>\r\n <ng-template #settingSubmenu>\r\n <li nz-submenu [nzTitle]=\"settingMenu?.label?.caption\"\r\n [nzIcon]=\"settingMenu.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let child of settingMenu.submenu\">\r\n <li (click)=\"invokeNavigate(child)\" *ngIf=\"!child.submenu\"\r\n nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? child?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"child?.icon\"></span>\r\n <span>{{ child?.label?.caption }}</span>\r\n </li>\r\n <ng-container *ngIf=\"child.submenu\">\r\n <li nz-submenu [nzTitle]=\"child?.label?.caption\"\r\n [nzIcon]=\"child?.icon\">\r\n <ul style=\"width: 260px;\">\r\n <ng-container\r\n *ngFor=\"let subChild of child.submenu; let i = index\">\r\n <li (click)=\"invokeNavigate(subChild, child)\"\r\n nz-menu-item>\r\n <span\r\n [class]=\"child?.label?.caption === 'Languages' ? '' : 'menu-row'\">\r\n <ng-container\r\n *ngIf=\"subChild?.option?.changeProject; else antIcon\">\r\n <img [src]=\"subChild?.icon\" alt=\"icon\"\r\n style=\"width: 16px; height: 16px; margin-right: 8px;\" />\r\n </ng-container>\r\n <ng-template #antIcon>\r\n <span nz-icon [nzType]=\"subChild?.icon\"></span>\r\n </ng-template>\r\n <span>{{ subChild?.label?.caption }}</span>\r\n <!-- Delete icon (prevent click bubbling) -->\r\n <span *ngIf=\"child?.label?.caption != 'Languages'\"\r\n nz-icon nzType=\"delete\" class=\"delete-icon\"\r\n style=\"padding-left: 5%;\"\r\n (click)=\"deleteMenuItem(subChild, i, $event)\"></span>\r\n </span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-template>\r\n </ul>\r\n @if (!isCollapsed && appVersionInfo?.appVersion) {\r\n <div class=\"app-version-footer\">\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Version</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appVersion }}</span>\r\n </div>\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Build</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appBuild || '-' }}</span>\r\n </div>\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Build No.</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appBuildNumber || '-' }}</span>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [":host{position:relative;display:block;flex:0 0 auto;width:250px;height:100%;min-height:0;overflow:visible;transition:width .3s ease}.left-wrap.sidemenu{position:relative;width:250px;height:100%;min-height:0;overflow:visible;transition:width .3s ease,transform .3s ease}.side-menu{position:relative;display:flex;flex-direction:column;width:250px;height:100%;min-height:0;color:#fff;background-color:#0d1b2a;overflow:hidden;transition:width .3s ease,box-shadow .3s ease}:host:has(.left-wrap.sidemenu.collapsed){width:64px}.left-wrap.sidemenu.collapsed,.left-wrap.sidemenu.collapsed .side-menu{width:64px}.menu-separator{flex:0 0 auto;height:1px;margin:15px 12px 6px;background-color:#ffffff26;border:0;list-style:none}.user-profile{flex:0 0 auto;padding:20px 10px 16px;margin-top:40px;text-align:center;border-bottom:1px solid rgba(255,255,255,.1);overflow:hidden;transition:padding .25s ease,margin .25s ease,opacity .25s ease,max-height .25s ease}.user-profile .avatar{display:block;width:64px;height:64px;margin:0 auto 8px;object-fit:cover;border:2px solid #ffffff;border-radius:50%;transition:width .25s ease,height .25s ease,margin .25s ease}.user-profile .details{min-width:0;overflow:hidden;transition:opacity .2s ease}.user-profile .name{color:#fff;font-size:14px;font-weight:600;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-profile .email{margin:2px 0 8px;color:#aaa;font-size:12px;line-height:1.4;overflow-wrap:anywhere;word-break:break-word}.user-profile .actions{display:flex;align-items:center;justify-content:center;gap:6px}.user-profile .actions button{margin:0;color:#fff}.left-wrap.sidemenu.collapsed .user-profile{padding:12px 8px}.left-wrap.sidemenu.collapsed .user-profile .avatar{width:40px;height:40px;margin-bottom:0}.left-wrap.sidemenu.collapsed .user-profile .details,.left-wrap.sidemenu.collapsed .user-profile .name,.left-wrap.sidemenu.collapsed .user-profile .email,.left-wrap.sidemenu.collapsed .user-profile .actions{display:none}.side-menu ul[nz-menu]{flex:1 1 auto;width:100%;min-height:0;margin:0;padding:4px 0 8px;overflow-x:hidden;overflow-y:auto;background-color:transparent;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.28) transparent;scroll-behavior:smooth}.side-menu ul[nz-menu]::-webkit-scrollbar{width:6px}.side-menu ul[nz-menu]::-webkit-scrollbar-track{background:transparent}.side-menu ul[nz-menu]::-webkit-scrollbar-thumb{background-color:#ffffff47;border-radius:999px}.side-menu ul[nz-menu]::-webkit-scrollbar-thumb:hover{background-color:#ffffff6b}.menu-row{display:flex;align-items:center;width:100%;min-width:0}.menu-text{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.delete-icon{flex:0 0 auto;margin-left:auto;color:#ffffffb3;cursor:pointer;transition:color .18s ease,transform .18s ease}.delete-icon:hover{color:#ff7875;transform:scale(1.08)}.projects{position:static;flex:0 0 auto;width:100%;margin-top:auto;background-color:#0d1b2a}.side-toggle-handle{position:absolute;top:24px;right:-14px;z-index:10000;display:flex;align-items:center;justify-content:center;width:28px;height:48px;padding:0;color:#fff;background-color:#0d1b2a;border:0;border-radius:0 6px 6px 0;box-shadow:2px 0 6px #00000040;cursor:pointer;transform:translateY(-50%);transition:background-color .2s ease,box-shadow .2s ease}.side-toggle-handle:hover{background-color:#142a40;box-shadow:3px 0 9px #0000004d}.side-toggle-handle:focus-visible{outline:3px solid rgba(24,144,255,.45);outline-offset:2px}.side-toggle-handle span{color:#fff;font-size:14px;line-height:1;transition:transform .25s ease}.collapse-btn{position:absolute;top:8px;right:8px;z-index:10001}:host(:not(.sidemenu-mobile)) .left-wrap.sidemenu.collapsed:hover{transform:translate(0)}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed{width:64px!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title{display:flex!important;align-items:center!important;justify-content:center!important;width:45px!important;height:32px!important;margin-inline:0!important;padding-inline:0!important;overflow:hidden!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-title-content,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .menu-text,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .delete-icon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-submenu-arrow{display:none!important;width:0!important;min-width:0!important;max-width:0!important;margin:0!important;padding:0!important;visibility:hidden!important;overflow:hidden!important;text-overflow:clip!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-item-icon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item>.anticon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title>.anticon{display:inline-flex!important;flex:0 0 auto;align-items:center;justify-content:center;width:auto!important;min-width:18px;margin:0!important;padding:0!important;color:inherit;font-size:18px;line-height:1;visibility:visible!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .menu-row{display:contents}:host(.sidemenu-mobile){position:absolute;top:0;bottom:0;left:0;z-index:9999;width:250px;height:100%}:host(.sidemenu-mobile):has(.left-wrap.sidemenu.collapsed){width:0}:host(.sidemenu-mobile) .left-wrap.sidemenu{width:250px;height:100%}:host(.sidemenu-mobile) .side-menu,:host(.sidemenu-mobile) .side-menu.open{width:250px;height:100%;box-shadow:8px 0 22px #0000003d}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed{width:250px;transform:translate(-250px)}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .side-menu{width:250px;box-shadow:none}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .side-toggle-handle{right:-28px}:host(.sidemenu-mobile) .side-toggle-handle{top:0;right:0;padding:0;transform:none!important}:host(.sidemenu-mobile) .collapse-btn{top:8px;right:8px}:host(.sidemenu-mobile) .user-profile{margin-top:40px}:host(.sidemenu-mobile) .user-profile .avatar{width:48px;height:48px}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .user-profile{max-height:0;padding:0;margin:0;opacity:0;overflow:hidden;border-bottom:0}@media(prefers-reduced-motion:reduce){:host,.left-wrap.sidemenu,.side-menu,.user-profile,.user-profile .avatar,.side-toggle-handle,.side-toggle-handle span{transition:none}.side-menu ul[nz-menu]{scroll-behavior:auto}}.app-version-footer{flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:10px 12px;border-top:1px solid rgba(255,255,255,.15);color:#ffffffa6;font-size:11px;line-height:1.4;text-align:center}.app-version-footer__item{display:flex;flex-direction:column;min-width:0}.app-version-footer__label{font-size:10px;opacity:.7}.app-version-footer__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pagination-check{position:absolute;top:50%;right:42px;transform:translateY(-50%)}\n"] }]
|
|
11568
|
+
DynamicDialogModule,
|
|
11569
|
+
TermsDialog
|
|
11570
|
+
], template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-20\r\n - new: a fourth footer row \"App\" with the export of the app (appVersionInfo.appRelease, issue #57) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - new: the active language has a check mark, like the active pagination type\r\n - fix: all check marks (pagination, language) stand in one column at the right edge; the\r\n pagination marks followed their caption at a fixed distance and landed elsewhere on iOS\r\n - change: the version footer has three columns - version, build (source commit) and build\r\n number (appBuildNumber), the three values build.sh and the web Docker build produce -->\r\n<!-- Shuaib 2026-09-24\r\n - change: sign-in visibility checks now include jwtToken alongside keycloak and oktaAuth. -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-09-19\r\n - new: a @contract comment on the option key, singular since 2026-09-16, and on the sign-in\r\n branches, which know keycloak and oktaAuth but not jwtToken -->\r\n<div class=\"left-wrap sidemenu\" [class.collapsed]=\"isCollapsed\"\r\n [ngStyle]=\"{ 'z-index': !isCollapsed && isMobile ? 999999 : 'auto' }\"\r\n #sideMenu>\r\n <!-- Move toggle button OUTSIDE menu container -->\r\n <div class=\"side-toggle-handle\" id=\"toggle-id\" (click)=\"toggleCollapsed()\"\r\n [class.collapsed]=\"isCollapsed\">\r\n <span id=\"toggle-icon\" nz-icon\r\n [nzType]=\"isCollapsed ? 'caret-right' : 'caret-left'\"></span>\r\n </div>\r\n <div class=\"side-menu\" id=\"sidemenuwrap\"\r\n [ngStyle]=\"{ width: (isMobile && isCollapsed) ? '1px' : isCollapsed ? '60px' : '' }\">\r\n <!-- user content -->\r\n <ng-container *ngIf=\"loginedUserInfo && loginedUserInfo?.name\">\r\n <div class=\"user-profile\" [class.collapsed]=\"isCollapsed\">\r\n <img class=\"avatar\" [src]=\"loginedUserInfo?.image\" alt=\"User\" />\r\n <div [class]=\"isMobile ? '' : 'details'\" *ngIf=\"!isCollapsed\">\r\n <div class=\"name\">{{ loginedUserInfo.name }}</div>\r\n <div class=\"email\">{{ loginedUserInfo?.email }}</div>\r\n <div class=\"actions\" *ngIf=\"loginedUserInfo?.actions?.length\">\r\n <button *ngFor=\"let action of loginedUserInfo?.actions\" nz-button\r\n nzType=\"link\" nzSize=\"small\"\r\n (click)=\"invokeNavigate(action)\">\r\n <span>{{ action?.label?.caption }}</span>\r\n <span nz-icon [nzType]=\"action.icon\"></span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <!-- @contract decision: this container reads option (singular), like every other one\r\n reality: it read options (plural) until 2026-09-16. A menu file written for the old\r\n spelling is ignored without an error.\r\n\r\n @contract decision: sign-in visibility supports keycloak, oktaAuth and jwtToken.\r\n A JWT project uses the decoded user's login state, like the other providers.\r\n seen: the login type comparisons in the lines below -->\r\n <!-- dynamic menu -->\r\n <ul nz-menu nzMode=\"inline\" nzTheme=\"dark\"\r\n [nzInlineCollapsed]=\"isCollapsed\">\r\n <ng-container *ngFor=\"let item of menuItems\">\r\n <ng-container\r\n *ngIf=\"!item.submenu && item?.option?.action != 'logout'; else submenu\">\r\n <span\r\n [class]=\"environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' || environment?.login?.type === 'jwtToken' ? item.option?.login === true ? loginedUserInfo?.name ? '' : 'hidden' : item.option?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : '' : userInfo?.userId ? item.option?.login ? item.option.role ? item.option.role == userInfo.userRole ? '' : 'hidden' : '' : 'hidden' : !item.option?.login ? '' : 'hidden' \">\r\n <li (click)=\"invokeNavigate(item)\" nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? item?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"item.icon\"></span>\r\n <span>{{ item?.label?.caption }}</span>\r\n </li>\r\n </span>\r\n </ng-container>\r\n <ng-template #submenu>\r\n <span\r\n [class]=\"item.option?.login === true && (environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' || environment?.login?.type === 'jwtToken') ? loginedUserInfo?.name ? '' : 'hidden' : item.option?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : ''\">\r\n <li nz-submenu *ngIf=\"item?.option?.action != 'logout'\"\r\n [nzTitle]=\"item?.label?.caption\"\r\n [nzIcon]=\"item.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let child of item.submenu\">\r\n <li (click)=\"invokeNavigate(child)\" *ngIf=\"!child.submenu\"\r\n nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? child?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"child?.icon\"></span>\r\n <span>{{ child?.label?.caption }}</span>\r\n </li>\r\n <ng-container *ngIf=\"child.submenu\">\r\n <li nz-submenu [nzTitle]=\"child?.label?.caption\"\r\n [nzIcon]=\"child?.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let subChild of child.submenu\">\r\n <li (click)=\"invokeNavigate(subChild)\" nz-menu-item>\r\n <ng-container\r\n *ngIf=\"subChild?.option?.setImageUrl; else antIcon\">\r\n <img *ngIf=\"isUrl(subChild?.icon)\"\r\n [src]=\"subChild?.icon\" alt=\"icon\"\r\n style=\"width: 16px; height: 16px; margin-right: 8px;\" />\r\n </ng-container>\r\n <ng-template #antIcon>\r\n <span nz-icon [nzType]=\"subChild?.icon\"></span>\r\n </ng-template>\r\n <span>{{ subChild?.label?.caption }}</span>\r\n @if(subChild?.option?.numberedPagination &&\r\n !scrollPagination){\r\n <span nz-icon\r\n nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n @if(subChild?.option?.scrollPagination &&\r\n scrollPagination){\r\n <span nz-icon\r\n nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n @if(subChild?.option?.changeLang &&\r\n subChild?.option?.data_url === activeLanguage){\r\n <span nz-icon nzType=\"check\" nzTheme=\"outline\"\r\n class=\"pagination-check\">\r\n </span>\r\n }\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <!-- separator -->\r\n <li *ngIf=\"settingMenu.submenu\" class=\"menu-separator\"></li>\r\n\r\n <!-- settings menu -->\r\n <ng-container *ngIf=\"!settingMenu.submenu; else settingSubmenu\"\r\n style=\"position: absolute; bottom: 0;\">\r\n <li (click)=\"invokeNavigate(settingMenu)\" nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? settingMenu?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"settingMenu.icon\"></span>\r\n <span>{{ settingMenu?.label?.caption }}</span>\r\n </li>\r\n </ng-container>\r\n <ng-template #settingSubmenu>\r\n <li nz-submenu [nzTitle]=\"settingMenu?.label?.caption\"\r\n [nzIcon]=\"settingMenu.icon\">\r\n <ul>\r\n <ng-container *ngFor=\"let child of settingMenu.submenu\">\r\n <li (click)=\"invokeNavigate(child)\" *ngIf=\"!child.submenu\"\r\n nz-menu-item nz-tooltip\r\n nzTooltipPlacement=\"right\"\r\n [nzTooltipTitle]=\"isCollapsed && !isMobile ? child?.label?.caption : ''\">\r\n <span nz-icon [nzType]=\"child?.icon\"></span>\r\n <span>{{ child?.label?.caption }}</span>\r\n </li>\r\n <ng-container *ngIf=\"child.submenu\">\r\n <li nz-submenu [nzTitle]=\"child?.label?.caption\"\r\n [nzIcon]=\"child?.icon\">\r\n <ul style=\"width: 260px;\">\r\n <ng-container\r\n *ngFor=\"let subChild of child.submenu; let i = index\">\r\n <li (click)=\"invokeNavigate(subChild, child)\"\r\n nz-menu-item>\r\n <span\r\n [class]=\"child?.label?.caption === 'Languages' ? '' : 'menu-row'\">\r\n <ng-container\r\n *ngIf=\"subChild?.option?.changeProject; else antIcon\">\r\n <img [src]=\"subChild?.icon\" alt=\"icon\"\r\n style=\"width: 16px; height: 16px; margin-right: 8px;\" />\r\n </ng-container>\r\n <ng-template #antIcon>\r\n <span nz-icon [nzType]=\"subChild?.icon\"></span>\r\n </ng-template>\r\n <span>{{ subChild?.label?.caption }}</span>\r\n <!-- Delete icon (prevent click bubbling) -->\r\n <span *ngIf=\"child?.label?.caption != 'Languages'\"\r\n nz-icon nzType=\"delete\" class=\"delete-icon\"\r\n style=\"padding-left: 5%;\"\r\n (click)=\"deleteMenuItem(subChild, i, $event)\"></span>\r\n </span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-template>\r\n </ul>\r\n @if (!isCollapsed && appVersionInfo?.appVersion) {\r\n <div class=\"app-version-footer\">\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Version</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appVersion }}</span>\r\n </div>\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Build</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appBuild || '-' }}</span>\r\n </div>\r\n <div class=\"app-version-footer__item\">\r\n <span class=\"app-version-footer__label\">Build No.</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appBuildNumber || '-' }}</span>\r\n </div>\r\n <!-- the app's own export (issue #57): \"Export 2 \u00B7 41908dd \u00B7 20.10.2026\", only when it has one -->\r\n @if (appVersionInfo.appRelease) {\r\n <div class=\"app-version-footer__item app-version-footer__release\" [title]=\"appVersionInfo.appRelease\">\r\n <span class=\"app-version-footer__label\">App</span>\r\n <span class=\"app-version-footer__value\">{{ appVersionInfo.appRelease }}</span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24 - a text document of Terms & Conditions -->\r\n@if (termsDocument) {\r\n<vl-terms-dialog [documents]=\"termsDocument\" [translations]=\"lastMenuTranslations\" (closed)=\"termsDocument = null\"></vl-terms-dialog>\r\n}\r\n", styles: [":host{position:relative;display:block;flex:0 0 auto;width:250px;height:100%;min-height:0;overflow:visible;transition:width .3s ease}.left-wrap.sidemenu{position:relative;width:250px;height:100%;min-height:0;overflow:visible;transition:width .3s ease,transform .3s ease}.side-menu{position:relative;display:flex;flex-direction:column;width:250px;height:100%;min-height:0;color:#fff;background-color:#0d1b2a;overflow:hidden;transition:width .3s ease,box-shadow .3s ease}:host:has(.left-wrap.sidemenu.collapsed){width:64px}.left-wrap.sidemenu.collapsed,.left-wrap.sidemenu.collapsed .side-menu{width:64px}.menu-separator{flex:0 0 auto;height:1px;margin:15px 12px 6px;background-color:#ffffff26;border:0;list-style:none}.user-profile{flex:0 0 auto;padding:20px 10px 16px;margin-top:40px;text-align:center;border-bottom:1px solid rgba(255,255,255,.1);overflow:hidden;transition:padding .25s ease,margin .25s ease,opacity .25s ease,max-height .25s ease}.user-profile .avatar{display:block;width:64px;height:64px;margin:0 auto 8px;object-fit:cover;border:2px solid #ffffff;border-radius:50%;transition:width .25s ease,height .25s ease,margin .25s ease}.user-profile .details{min-width:0;overflow:hidden;transition:opacity .2s ease}.user-profile .name{color:#fff;font-size:14px;font-weight:600;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-profile .email{margin:2px 0 8px;color:#aaa;font-size:12px;line-height:1.4;overflow-wrap:anywhere;word-break:break-word}.user-profile .actions{display:flex;align-items:center;justify-content:center;gap:6px}.user-profile .actions button{margin:0;color:#fff}.left-wrap.sidemenu.collapsed .user-profile{padding:12px 8px}.left-wrap.sidemenu.collapsed .user-profile .avatar{width:40px;height:40px;margin-bottom:0}.left-wrap.sidemenu.collapsed .user-profile .details,.left-wrap.sidemenu.collapsed .user-profile .name,.left-wrap.sidemenu.collapsed .user-profile .email,.left-wrap.sidemenu.collapsed .user-profile .actions{display:none}.side-menu ul[nz-menu]{flex:1 1 auto;width:100%;min-height:0;margin:0;padding:4px 0 8px;overflow-x:hidden;overflow-y:auto;background-color:transparent;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.28) transparent;scroll-behavior:smooth}.side-menu ul[nz-menu]::-webkit-scrollbar{width:6px}.side-menu ul[nz-menu]::-webkit-scrollbar-track{background:transparent}.side-menu ul[nz-menu]::-webkit-scrollbar-thumb{background-color:#ffffff47;border-radius:999px}.side-menu ul[nz-menu]::-webkit-scrollbar-thumb:hover{background-color:#ffffff6b}.menu-row{display:flex;align-items:center;width:100%;min-width:0}.menu-text{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.delete-icon{flex:0 0 auto;margin-left:auto;color:#ffffffb3;cursor:pointer;transition:color .18s ease,transform .18s ease}.delete-icon:hover{color:#ff7875;transform:scale(1.08)}.projects{position:static;flex:0 0 auto;width:100%;margin-top:auto;background-color:#0d1b2a}.side-toggle-handle{position:absolute;top:24px;right:-14px;z-index:10000;display:flex;align-items:center;justify-content:center;width:28px;height:48px;padding:0;color:#fff;background-color:#0d1b2a;border:0;border-radius:0 6px 6px 0;box-shadow:2px 0 6px #00000040;cursor:pointer;transform:translateY(-50%);transition:background-color .2s ease,box-shadow .2s ease}.side-toggle-handle:hover{background-color:#142a40;box-shadow:3px 0 9px #0000004d}.side-toggle-handle:focus-visible{outline:3px solid rgba(24,144,255,.45);outline-offset:2px}.side-toggle-handle span{color:#fff;font-size:14px;line-height:1;transition:transform .25s ease}.collapse-btn{position:absolute;top:8px;right:8px;z-index:10001}:host(:not(.sidemenu-mobile)) .left-wrap.sidemenu.collapsed:hover{transform:translate(0)}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed{width:64px!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title{display:flex!important;align-items:center!important;justify-content:center!important;width:45px!important;height:32px!important;margin-inline:0!important;padding-inline:0!important;overflow:hidden!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-title-content,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .menu-text,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .delete-icon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-submenu-arrow{display:none!important;width:0!important;min-width:0!important;max-width:0!important;margin:0!important;padding:0!important;visibility:hidden!important;overflow:hidden!important;text-overflow:clip!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .ant-menu-item-icon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-item>.anticon,:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title>.anticon{display:inline-flex!important;flex:0 0 auto;align-items:center;justify-content:center;width:auto!important;min-width:18px;margin:0!important;padding:0!important;color:inherit;font-size:18px;line-height:1;visibility:visible!important}:host(:not(.sidemenu-mobile)) ::ng-deep .ant-menu.ant-menu-inline-collapsed .menu-row{display:contents}:host(.sidemenu-mobile){position:absolute;top:0;bottom:0;left:0;z-index:9999;width:250px;height:100%}:host(.sidemenu-mobile):has(.left-wrap.sidemenu.collapsed){width:0}:host(.sidemenu-mobile) .left-wrap.sidemenu{width:250px;height:100%}:host(.sidemenu-mobile) .side-menu,:host(.sidemenu-mobile) .side-menu.open{width:250px;height:100%;box-shadow:8px 0 22px #0000003d}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed{width:250px;transform:translate(-250px)}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .side-menu{width:250px;box-shadow:none}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .side-toggle-handle{right:-28px}:host(.sidemenu-mobile) .side-toggle-handle{top:0;right:0;padding:0;transform:none!important}:host(.sidemenu-mobile) .collapse-btn{top:8px;right:8px}:host(.sidemenu-mobile) .user-profile{margin-top:40px}:host(.sidemenu-mobile) .user-profile .avatar{width:48px;height:48px}:host(.sidemenu-mobile) .left-wrap.sidemenu.collapsed .user-profile{max-height:0;padding:0;margin:0;opacity:0;overflow:hidden;border-bottom:0}@media(prefers-reduced-motion:reduce){:host,.left-wrap.sidemenu,.side-menu,.user-profile,.user-profile .avatar,.side-toggle-handle,.side-toggle-handle span{transition:none}.side-menu ul[nz-menu]{scroll-behavior:auto}}.app-version-footer{flex-shrink:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:10px 12px;border-top:1px solid rgba(255,255,255,.15);color:#ffffffa6;font-size:11px;line-height:1.4;text-align:center}.app-version-footer__item{display:flex;flex-direction:column;min-width:0}.app-version-footer__label{font-size:10px;opacity:.7}.app-version-footer__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.app-version-footer__release{grid-column:1 / -1}.pagination-check{position:absolute;top:50%;right:42px;transform:translateY(-50%)}\n"] }]
|
|
10759
11571
|
}], ctorParameters: () => [{ type: i1$5.NzI18nService }, { type: MobileKeycloakService }, { type: Couchdb }, { type: i7.OAuthService }, { type: i1$2.Platform }, { type: RequestService }, { type: UtilityService }, { type: i1$4.DialogService }, { type: NotificationService }, { type: i0.Injector }], propDecorators: { menuItems: [{
|
|
10760
11572
|
type: Input
|
|
10761
11573
|
}], userInfo: [{
|
|
@@ -10772,6 +11584,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
10772
11584
|
type: Input
|
|
10773
11585
|
}], appVersionInfo: [{
|
|
10774
11586
|
type: Input
|
|
11587
|
+
}], startLanguages: [{
|
|
11588
|
+
type: Input
|
|
11589
|
+
}], mainCenter: [{
|
|
11590
|
+
type: Input
|
|
10775
11591
|
}], languageChange: [{
|
|
10776
11592
|
type: Output
|
|
10777
11593
|
}], invokeMenu: [{
|
|
@@ -11198,6 +12014,486 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
11198
12014
|
args: [{ selector: 'vl-custom-keyboard', standalone: true, template: "<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - new: an AM/PM key on the keyboard of a 12-hour time field (#166 step 4.9) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-18\r\n - new: a new-line key on the text keyboard of a multi-line field (textArea, #166) -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-13\r\n - change: the space key has no label (it said \"Space\" in every language); a label per language\r\n would have to be maintained for each new project language -->\r\n<!-- Faramarz Yousefian and Agent Toni (Claude Opus 5) 2026-10-07\r\n - new: a ?123 / ABC key switches string keyboards between letters and the symbol page -->\r\n@if (keyboard.activeSession(); as session) {\r\n<section class=\"custom-keyboard\" data-vl-custom-keyboard [class.custom-keyboard--numeric]=\"\r\n session.type === 'numeric' ||\r\n session.type === 'date' ||\r\n session.type === 'time'\" [class.custom-keyboard--opening]=\"keyboard.interactionBlocked()\"\r\n [attr.aria-label]=\"session.type + ' keyboard'\" (pointerdown)=\"$event.preventDefault()\">\r\n\r\n @for (row of rows; track $index) {\r\n <div class=\"custom-keyboard__row\">\r\n @for (key of row; track key) {\r\n <button type=\"button\" class=\"custom-keyboard__key\" (click)=\"enterKey(key)\">\r\n {{ key }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- One mobile-style action row for every keyboard type -->\r\n <div class=\"custom-keyboard__actions\" [class.custom-keyboard__actions--compact]=\"\r\n session.type !== 'alpha' &&\r\n session.type !== 'string'\r\n \" [class.custom-keyboard__actions--symbols]=\"hasSymbolPage\">\r\n\r\n @if (\r\n session.type === 'alpha' ||\r\n session.type === 'string'\r\n ) {\r\n <button type=\"button\" class=\"custom-keyboard__action-button custom-keyboard__shift\" [class.active]=\"uppercase()\"\r\n [disabled]=\"symbols()\" aria-label=\"Change letter case\" title=\"Shift\" (click)=\"toggleCase()\">\r\n <i class=\"pi pi-arrow-up\"></i>\r\n </button>\r\n\r\n @if (hasSymbolPage) {\r\n <button type=\"button\" class=\"custom-keyboard__action-button custom-keyboard__page\"\r\n [attr.aria-label]=\"symbols() ? 'Letters' : 'Digits and symbols'\" (click)=\"toggleSymbols()\">\r\n {{ symbols() ? 'ABC' : '?123' }}\r\n </button>\r\n }\r\n\r\n <button type=\"button\" class=\"custom-keyboard__action-button custom-keyboard__space\" aria-label=\"Space\" (click)=\"enterSpace()\">\r\n </button>\r\n\r\n @if (multiLine) {\r\n <!-- new line: only in a multi-line field (textArea), #166 step 4.4 -->\r\n <button type=\"button\" class=\"custom-keyboard__action-button custom-keyboard__newline\"\r\n aria-label=\"New line\" title=\"New line\" (click)=\"enterNewLine()\">\r\n <i class=\"pi pi-arrow-down-left\"></i>\r\n </button>\r\n }\r\n }\r\n\r\n @if (session.type === 'time' && keyboard.twelveHours(session.target)) {\r\n <!-- AM/PM: a time field typed with 12 hours (English), #166 step 4.9 -->\r\n <button type=\"button\" class=\"custom-keyboard__action-button custom-keyboard__meridiem\"\r\n aria-label=\"AM or PM\" title=\"AM/PM\" (click)=\"keyboard.toggleMeridiem()\">AM/PM</button>\r\n }\r\n\r\n <button type=\"button\" class=\"custom-keyboard__action-button custom-keyboard__delete\"\r\n aria-label=\"Delete previous character\" title=\"Delete\" (click)=\"keyboard.backspace()\">\r\n <i class=\"pi pi-delete-left\"></i>\r\n </button>\r\n\r\n <button type=\"button\" class=\"custom-keyboard__action-button custom-keyboard__done\" aria-label=\"Done\"\r\n title=\"Done\" (click)=\"keyboard.close()\">\r\n <i class=\"pi pi-check\"></i>\r\n </button>\r\n </div>\r\n</section>\r\n}\r\n", styles: [":host{display:contents}.custom-keyboard{position:fixed;right:0;bottom:0;left:0;z-index:200000;display:block;width:100%;max-height:min(52dvh,390px);padding:8px 6px calc(8px + env(safe-area-inset-bottom,0px));background:var(--vl-keyboard-background, var(--vl-page-background, #ffffff));box-shadow:0 -6px 20px #0f172a38;box-sizing:border-box;overflow-x:hidden;overflow-y:auto;user-select:none;-webkit-user-select:none;touch-action:manipulation;-webkit-overflow-scrolling:touch}.custom-keyboard__row{display:flex;justify-content:center;gap:4px;width:100%;margin-bottom:6px}.custom-keyboard__key{display:flex;flex:1 1 0;width:auto;max-width:52px;min-width:0;height:42px;align-items:center;justify-content:center;padding:0;color:#111827;font-size:16px;font-weight:700;line-height:1;background:#fff;border:1px solid #d1d5db;border-radius:5px;box-shadow:0 1px 2px #0f172a47;cursor:pointer;appearance:none;-webkit-appearance:none;touch-action:manipulation;transition:transform 80ms ease,background-color 80ms ease}.custom-keyboard__key:active{background:#e6f4ff;transform:scale(.96)}.custom-keyboard--numeric .custom-keyboard__key{max-width:92px;height:46px;font-size:18px}.custom-keyboard__actions{display:grid;grid-template-columns:46px minmax(90px,1fr) 46px 54px;gap:6px;width:100%;margin-top:4px;padding:0 4px}.custom-keyboard__actions--compact{grid-template-columns:minmax(52px,1fr) minmax(52px,1fr)}.custom-keyboard__actions--symbols{grid-template-columns:46px 54px minmax(70px,1fr) 46px 54px}.custom-keyboard__action-button{display:flex;width:100%;min-width:0;height:42px;align-items:center;justify-content:center;padding:0 8px;color:#172033;font-size:15px;font-weight:700;line-height:1;border:0;border-radius:6px;box-shadow:0 1px 2px #0f172a40;cursor:pointer;appearance:none;-webkit-appearance:none;touch-action:manipulation;transition:transform 80ms ease,background-color 80ms ease}.custom-keyboard__action-button i{font-size:17px;line-height:1;pointer-events:none}.custom-keyboard__action-button:active{transform:scale(.96)}.custom-keyboard__shift{color:#172033;background:#aeb6c2}.custom-keyboard__shift.active{color:#fff;background:#64748b}.custom-keyboard__space{color:#172033;background:#fff}.custom-keyboard__delete{color:#172033;background:#aeb6c2}.custom-keyboard__done{color:#fff;background:#1890ff}.custom-keyboard__page{color:#172033;font-size:14px;background:#aeb6c2}.custom-keyboard__shift:disabled{opacity:.45}.custom-keyboard__key:focus-visible,.custom-keyboard__action-button:focus-visible{outline:3px solid rgba(24,144,255,.35);outline-offset:1px}@media(max-height:650px){.custom-keyboard{max-height:58dvh;padding-top:6px}.custom-keyboard__row{gap:3px;margin-bottom:4px}.custom-keyboard__key{height:35px;font-size:14px}.custom-keyboard--numeric .custom-keyboard__key{height:38px;font-size:16px}.custom-keyboard__action-button{height:36px}}@media(max-width:360px){.custom-keyboard{padding-right:4px;padding-left:4px}.custom-keyboard__row{gap:3px}.custom-keyboard__key{font-size:14px}.custom-keyboard__actions{grid-template-columns:42px minmax(70px,1fr) 42px 48px;gap:4px;padding-right:2px;padding-left:2px}.custom-keyboard__actions--compact{grid-template-columns:minmax(48px,1fr) minmax(48px,1fr)}.custom-keyboard__actions--symbols{grid-template-columns:40px 48px minmax(56px,1fr) 40px 46px}}.custom-keyboard--opening .custom-keyboard__key,.custom-keyboard--opening .custom-keyboard__action-button{pointer-events:none}.custom-keyboard--opening{cursor:default}::ng-deep .p-overlay:has(.p-autocomplete-overlay),::ng-deep .p-overlay:has(.p-select-overlay){width:0!important}::ng-deep .p-autocomplete-overlay .p-autocomplete-option,::ng-deep .p-select-overlay .p-select-option{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}::ng-deep .p-autocomplete-overlay .p-autocomplete-list-container,::ng-deep .p-select-overlay .p-select-list-container{overflow-x:hidden!important}::ng-deep .vl-option-full-text{position:fixed;z-index:2147483000;transform:translateY(-100%);padding:8px 10px;border-radius:8px;background:#1f2328;color:#fff;font-size:14px;line-height:1.4;box-shadow:0 6px 18px #1f232840;pointer-events:none;white-space:normal}::ng-deep .p-datepicker-panel.model-datepicker-panel--docked,::ng-deep .model-datepicker-panel--docked{position:fixed!important;background:var(--vl-keyboard-background, var(--vl-page-background, #ffffff))!important;inset:auto 0 0!important;width:100%!important;min-width:100%!important;max-width:100%!important;max-height:min(52dvh,420px)!important;margin:0!important;padding-bottom:env(safe-area-inset-bottom,0px)!important;overflow-y:auto!important;transform:none!important;border-radius:12px 12px 0 0!important;box-shadow:0 -6px 20px #0f172a38!important;box-sizing:border-box!important}::ng-deep .model-timepicker-panel.p-datepicker-panel:not(.model-datepicker-panel--docked){width:auto!important;min-width:0!important;padding:4px 8px!important;border-radius:8px!important}::ng-deep .model-timepicker-panel .p-datepicker-time-picker{gap:4px!important;padding:0!important;border:0!important}::ng-deep .model-timepicker-panel .p-datepicker-hour-picker,::ng-deep .model-timepicker-panel .p-datepicker-minute-picker{gap:0!important}::ng-deep .model-timepicker-panel .p-datepicker-hour-picker span,::ng-deep .model-timepicker-panel .p-datepicker-minute-picker span,::ng-deep .model-timepicker-panel .p-datepicker-separator{font-size:1rem!important;line-height:1.2!important}::ng-deep .model-timepicker-panel .p-datepicker-increment-button,::ng-deep .model-timepicker-panel .p-datepicker-decrement-button{width:2rem!important;height:1.75rem!important}::ng-deep body.vl-side-dock .model-datepicker-panel--docked{inset:0 0 0 auto!important;width:var(--vl-side-dock-width, 50vw)!important;min-width:0!important;max-width:var(--vl-side-dock-width, 50vw)!important;height:100dvh!important;max-height:100dvh!important;min-height:0!important;padding-top:env(safe-area-inset-top,0px)!important;padding-right:env(safe-area-inset-right,0px)!important;border-left:1px solid #e5e7eb!important;box-shadow:-6px 0 20px #0f172a2e!important}.custom-keyboard__key{height:clamp(26px,5.2dvh,42px)}.custom-keyboard--numeric .custom-keyboard__key{height:clamp(28px,5.6dvh,46px)}.custom-keyboard__action-button{height:clamp(28px,5.2dvh,42px)}.custom-keyboard__row{margin-bottom:clamp(3px,.8dvh,6px)}::ng-deep body.vl-side-dock .custom-keyboard{inset:0 0 0 auto;width:var(--vl-side-dock-width, 50vw);max-height:none;height:100dvh;display:flex;flex-direction:column;justify-content:flex-start;padding-top:env(safe-area-inset-top,0px);padding-right:max(6px,env(safe-area-inset-right,0px));box-shadow:-6px 0 20px #0f172a2e}.custom-keyboard,::ng-deep .model-datepicker-panel--docked{border-top-left-radius:var(--p-dialog-border-radius, 12px)!important;border-top-right-radius:var(--p-dialog-border-radius, 12px)!important;overflow:hidden}::ng-deep .model-datepicker-panel--docked .p-datepicker-header{padding-top:clamp(2px,.6dvh,8px)!important;padding-bottom:clamp(2px,.6dvh,8px)!important}::ng-deep .model-datepicker-panel--docked .p-datepicker-day-cell,::ng-deep .model-datepicker-panel--docked .p-datepicker-weekday-cell{padding:1px!important}::ng-deep .model-datepicker-panel--docked .p-datepicker-day{width:var(--vl-day-size, clamp(28px, 4.4dvh, 40px))!important;height:var(--vl-day-size, clamp(28px, 4.4dvh, 40px))!important}::ng-deep body.vl-side-dock .model-datepicker-panel--docked,::ng-deep body.vl-side-dock .custom-keyboard{top:var(--vl-side-dock-top, max(8px, env(safe-area-inset-top, 0px)))!important;bottom:var(--vl-side-dock-bottom, max(8px, env(safe-area-inset-bottom, 0px)))!important;right:max(8px,env(safe-area-inset-right,0px))!important;left:auto!important;width:calc(var(--vl-side-dock-width, 50vw) - max(8px,env(safe-area-inset-right,0px)))!important;max-width:none!important;height:auto!important;max-height:none!important;padding-top:6px!important;padding-right:6px!important;border-radius:var(--p-dialog-border-radius, 12px)!important;overflow:hidden!important;box-shadow:var(--p-dialog-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1))!important}::ng-deep body.vl-custom-keyboard-open .custom-keyboard,::ng-deep body.vl-custom-keyboard-open .model-datepicker-panel--docked{left:var(--vl-dock-left, 0px)!important;right:var(--vl-dock-right, 0px)!important;width:auto!important;min-width:0!important;max-width:none!important;bottom:var(--vl-dock-bottom-gap)!important;padding-bottom:8px!important;border-radius:var(--p-dialog-border-radius, 12px)!important;box-shadow:var(--p-dialog-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1))!important}::ng-deep body{--vl-dock-bottom-gap: max(8px, env(safe-area-inset-bottom, 0px))}::ng-deep .vl-field-active,::ng-deep .picker-field--active input{border-color:var(--modal-field-focus-color, var(--p-primary-color, #10b981))!important;box-shadow:0 0 0 .2rem color-mix(in srgb,var(--modal-field-focus-color, var(--p-primary-color, #10b981)) 30%,transparent)!important;outline:none!important}\n"] }]
|
|
11199
12015
|
}], ctorParameters: () => [] });
|
|
11200
12016
|
|
|
12017
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
12018
|
+
// - new: RecordStore - reads, writes and deletes the records of a page's data source. Card and app
|
|
12019
|
+
// no longer write browser storage themselves; the card deleted into the fixed key "timeRecords"
|
|
12020
|
+
// whatever the page's data_url was (Urlaub: "antrag"). New kinds (database, roles) come here
|
|
12021
|
+
// later, without touching card, grid or dialog (#166, A1)
|
|
12022
|
+
class RecordStore {
|
|
12023
|
+
utilityService;
|
|
12024
|
+
constructor(utilityService) {
|
|
12025
|
+
this.utilityService = utilityService;
|
|
12026
|
+
}
|
|
12027
|
+
/** The records of the source; an empty list when it has none or is not kept in the browser. */
|
|
12028
|
+
async read(source) {
|
|
12029
|
+
const key = source?.data_url;
|
|
12030
|
+
if (!key)
|
|
12031
|
+
return [];
|
|
12032
|
+
switch (storageKind(source)) {
|
|
12033
|
+
case 'localstorage':
|
|
12034
|
+
return parseRecords(await this.utilityService.getLocalStorage(key));
|
|
12035
|
+
case 'sessionstorage':
|
|
12036
|
+
return parseRecords(await this.utilityService.getStorage(key));
|
|
12037
|
+
default:
|
|
12038
|
+
return [];
|
|
12039
|
+
}
|
|
12040
|
+
}
|
|
12041
|
+
/**
|
|
12042
|
+
* Stores the records as a plain JSON list, dates as local ISO text. False when the source is not
|
|
12043
|
+
* kept in the browser (a backend source is written by its own call).
|
|
12044
|
+
*/
|
|
12045
|
+
async write(source, records) {
|
|
12046
|
+
const key = source?.data_url;
|
|
12047
|
+
if (!key)
|
|
12048
|
+
return false;
|
|
12049
|
+
const list = (Array.isArray(records) ? records : []).map(record => record && typeof record === 'object' ? this.utilityService.normalizeDatesForStorage(record) : record);
|
|
12050
|
+
switch (storageKind(source)) {
|
|
12051
|
+
case 'localstorage':
|
|
12052
|
+
await this.utilityService.setLocalStorage(key, list);
|
|
12053
|
+
return true;
|
|
12054
|
+
case 'sessionstorage':
|
|
12055
|
+
await this.utilityService.setStorage(key, JSON.stringify(list));
|
|
12056
|
+
return true;
|
|
12057
|
+
default:
|
|
12058
|
+
return false;
|
|
12059
|
+
}
|
|
12060
|
+
}
|
|
12061
|
+
/** Removes the record at index from the stored list. */
|
|
12062
|
+
async remove(source, index) {
|
|
12063
|
+
const records = await this.read(source);
|
|
12064
|
+
if (index < 0 || index >= records.length)
|
|
12065
|
+
return false;
|
|
12066
|
+
records.splice(index, 1);
|
|
12067
|
+
return this.write(source, records);
|
|
12068
|
+
}
|
|
12069
|
+
/** Empties the stored list. */
|
|
12070
|
+
async clear(source) {
|
|
12071
|
+
return this.write(source, []);
|
|
12072
|
+
}
|
|
12073
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: RecordStore, deps: [{ token: UtilityService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12074
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: RecordStore, providedIn: 'root' });
|
|
12075
|
+
}
|
|
12076
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: RecordStore, decorators: [{
|
|
12077
|
+
type: Injectable,
|
|
12078
|
+
args: [{ providedIn: 'root' }]
|
|
12079
|
+
}], ctorParameters: () => [{ type: UtilityService }] });
|
|
12080
|
+
|
|
12081
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
12082
|
+
// - new: BackendCallService - sends a backend call a page describes (backend-call.ts): the user's
|
|
12083
|
+
// token when the option says passToken, on the devices directly, in the web through the app's own
|
|
12084
|
+
// origin (backendUrl), under the waiting rule of every request. saveData / loadData replace the
|
|
12085
|
+
// fixed P5 time-recording calls of card and request service (A2)
|
|
12086
|
+
const TRANSFORMS = {
|
|
12087
|
+
dailyLogs: (records, utility) => records.flatMap(record => utility.convertToDailyLogs(record) || []),
|
|
12088
|
+
};
|
|
12089
|
+
class BackendCallService {
|
|
12090
|
+
remoteLists = inject(RemoteListService);
|
|
12091
|
+
utilityService = inject(UtilityService);
|
|
12092
|
+
oauthService = inject(OAuthService, { optional: true });
|
|
12093
|
+
/** The signed-in user (claims + token): from the app, else the stored sign-in. */
|
|
12094
|
+
async currentUser() {
|
|
12095
|
+
const known = this.remoteLists.user();
|
|
12096
|
+
if (known)
|
|
12097
|
+
return known;
|
|
12098
|
+
return isNativeMobile()
|
|
12099
|
+
? await this.utilityService.getLocalStorage('KeycloakInfo')
|
|
12100
|
+
: await this.utilityService.getLocalStorage('loginedUser');
|
|
12101
|
+
}
|
|
12102
|
+
/** The records after the option's named conversion; unknown names change nothing. */
|
|
12103
|
+
transform(option, records) {
|
|
12104
|
+
const convert = option?.transform ? TRANSFORMS[option.transform] : undefined;
|
|
12105
|
+
return convert ? convert(records, this.utilityService) : records;
|
|
12106
|
+
}
|
|
12107
|
+
/** Sends the records to the option's backend; true on success. */
|
|
12108
|
+
async saveData(option, records, extra = {}) {
|
|
12109
|
+
const userInfo = await this.currentUser();
|
|
12110
|
+
const call = buildBackendCall(option, { ...extra, userInfo, records: this.transform(option, records) });
|
|
12111
|
+
if (!call)
|
|
12112
|
+
throw new Error('The button has no backend address (data_url).');
|
|
12113
|
+
return this.send(call, option, userInfo);
|
|
12114
|
+
}
|
|
12115
|
+
/** Loads from the option's backend with the given context (e.g. filter values). */
|
|
12116
|
+
async loadData(option, extra = {}) {
|
|
12117
|
+
const userInfo = await this.currentUser();
|
|
12118
|
+
const call = buildBackendCall(option, { ...extra, userInfo });
|
|
12119
|
+
if (!call)
|
|
12120
|
+
return [];
|
|
12121
|
+
return this.send(call, option, userInfo);
|
|
12122
|
+
}
|
|
12123
|
+
/** Sends a call; the answer's data, an error from status 400 on. */
|
|
12124
|
+
async send(call, option, userInfo) {
|
|
12125
|
+
const headers = { Accept: 'application/json', 'Content-Type': 'application/json' };
|
|
12126
|
+
if (option?.passToken) {
|
|
12127
|
+
const token = userInfo?.token || this.oauthService?.getAccessToken();
|
|
12128
|
+
if (token)
|
|
12129
|
+
headers['Authorization'] = `Bearer ${token}`;
|
|
12130
|
+
}
|
|
12131
|
+
const hasBody = call.method !== 'GET' && call.method !== 'DELETE';
|
|
12132
|
+
const response = await stagedRequest(() => CapacitorHttp.request({
|
|
12133
|
+
url: backendUrl(call.url),
|
|
12134
|
+
method: call.method,
|
|
12135
|
+
params: call.params,
|
|
12136
|
+
headers,
|
|
12137
|
+
...(hasBody ? { data: call.body } : {}),
|
|
12138
|
+
}));
|
|
12139
|
+
if (response.status >= 400) {
|
|
12140
|
+
throw new Error(`${call.method} ${call.url} failed: ${response.status}`);
|
|
12141
|
+
}
|
|
12142
|
+
return response.data;
|
|
12143
|
+
}
|
|
12144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: BackendCallService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12145
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: BackendCallService, providedIn: 'root' });
|
|
12146
|
+
}
|
|
12147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: BackendCallService, decorators: [{
|
|
12148
|
+
type: Injectable,
|
|
12149
|
+
args: [{ providedIn: 'root' }]
|
|
12150
|
+
}] });
|
|
12151
|
+
|
|
12152
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-21
|
|
12153
|
+
// - new: PageData - the records of one open page and everything done with them, in one place for
|
|
12154
|
+
// every container (A4, variant c). Card and grid only draw `visible` and call the actions:
|
|
12155
|
+
// load() browser list | backend | filter page (starts empty); useRecords(list)
|
|
12156
|
+
// takes records the app loaded itself
|
|
12157
|
+
// setFilter(values) loads once every filter field has a value ({{filter.<field>}})
|
|
12158
|
+
// goTo(page), setPageSize(n)
|
|
12159
|
+
// saveRecord(record, i?) from a dialog or form: append, or replace record i
|
|
12160
|
+
// remove(i, button) asks first (confirmDelete: false skips), browser list or backend DELETE
|
|
12161
|
+
// send(button, i|'all') save / save all to the backend the button describes, then afterSuccess
|
|
12162
|
+
// An index always means the position in all records, not on the current page.
|
|
12163
|
+
// No Angular here: storage, backend, question and message come in as PageDataDeps, so it is tested
|
|
12164
|
+
// with node --test (page-data.spec.mjs)
|
|
12165
|
+
class PageData {
|
|
12166
|
+
records = [];
|
|
12167
|
+
visible = [];
|
|
12168
|
+
page = 0;
|
|
12169
|
+
pageSize;
|
|
12170
|
+
pageCount = 0;
|
|
12171
|
+
totalItems = 0;
|
|
12172
|
+
loading = false;
|
|
12173
|
+
filter = {};
|
|
12174
|
+
/** Called after every change of the state above - the container redraws. */
|
|
12175
|
+
onChange = () => { };
|
|
12176
|
+
source;
|
|
12177
|
+
deps;
|
|
12178
|
+
constructor(source, deps, pageSize = 5) {
|
|
12179
|
+
this.source = source;
|
|
12180
|
+
this.deps = deps;
|
|
12181
|
+
this.pageSize = pageSize > 0 ? pageSize : 5;
|
|
12182
|
+
}
|
|
12183
|
+
/** Browser list and filter page: all records are here and paged in the app; a backend pages itself. */
|
|
12184
|
+
get clientPaging() {
|
|
12185
|
+
const kind = storageKind(this.source);
|
|
12186
|
+
return kind === 'localstorage' || kind === 'sessionstorage' || kind === 'filter';
|
|
12187
|
+
}
|
|
12188
|
+
async load() {
|
|
12189
|
+
const kind = storageKind(this.source);
|
|
12190
|
+
if (kind === 'filter') {
|
|
12191
|
+
return this.filterComplete() ? this.loadBackendRecords() : this.setRecords([]);
|
|
12192
|
+
}
|
|
12193
|
+
if (isBrowserSource(this.source)) {
|
|
12194
|
+
const records = await this.deps.readRecords(this.source);
|
|
12195
|
+
return this.setRecords(this.deps.restoreDates ? this.deps.restoreDates(records) : records);
|
|
12196
|
+
}
|
|
12197
|
+
if (String(this.source?.data_url ?? '').trim()) {
|
|
12198
|
+
return this.loadBackendRecords();
|
|
12199
|
+
}
|
|
12200
|
+
this.setRecords([]);
|
|
12201
|
+
}
|
|
12202
|
+
/** Records the app loaded itself (a backend page with images, its own paging). */
|
|
12203
|
+
useRecords(records) {
|
|
12204
|
+
this.setRecords(records);
|
|
12205
|
+
}
|
|
12206
|
+
async setFilter(values) {
|
|
12207
|
+
this.filter = { ...this.filter, ...values };
|
|
12208
|
+
if (this.filterComplete()) {
|
|
12209
|
+
this.page = 0;
|
|
12210
|
+
await this.loadBackendRecords();
|
|
12211
|
+
}
|
|
12212
|
+
}
|
|
12213
|
+
async goTo(page) {
|
|
12214
|
+
const last = Math.max(this.pageCount - 1, 0);
|
|
12215
|
+
this.page = Math.min(Math.max(page, 0), last);
|
|
12216
|
+
if (this.clientPaging) {
|
|
12217
|
+
this.slice();
|
|
12218
|
+
}
|
|
12219
|
+
else {
|
|
12220
|
+
await this.loadBackendRecords();
|
|
12221
|
+
}
|
|
12222
|
+
}
|
|
12223
|
+
async setPageSize(size) {
|
|
12224
|
+
this.pageSize = size > 0 ? size : this.pageSize;
|
|
12225
|
+
this.page = 0;
|
|
12226
|
+
if (this.clientPaging) {
|
|
12227
|
+
this.slice();
|
|
12228
|
+
}
|
|
12229
|
+
else {
|
|
12230
|
+
await this.loadBackendRecords();
|
|
12231
|
+
}
|
|
12232
|
+
}
|
|
12233
|
+
/** A record from a dialog or form: replaces record index, else is appended (and its page shown). */
|
|
12234
|
+
async saveRecord(record, index) {
|
|
12235
|
+
const replace = index != null && index > -1 && index < this.records.length;
|
|
12236
|
+
const records = [...this.records];
|
|
12237
|
+
if (replace)
|
|
12238
|
+
records[index] = record;
|
|
12239
|
+
else
|
|
12240
|
+
records.push(record);
|
|
12241
|
+
if (isBrowserSource(this.source) && !(await this.deps.writeRecords(this.source, records))) {
|
|
12242
|
+
return false;
|
|
12243
|
+
}
|
|
12244
|
+
this.records = records;
|
|
12245
|
+
if (!replace)
|
|
12246
|
+
this.page = Math.max(Math.ceil(records.length / this.pageSize) - 1, 0);
|
|
12247
|
+
this.slice();
|
|
12248
|
+
return true;
|
|
12249
|
+
}
|
|
12250
|
+
/** Deletes record index after the question; browser list, or the button's backend (then reloads). */
|
|
12251
|
+
async remove(index, button = {}) {
|
|
12252
|
+
if (index < 0 || index >= this.records.length)
|
|
12253
|
+
return false;
|
|
12254
|
+
const option = button?.option ?? button;
|
|
12255
|
+
if (option?.confirmDelete !== false && !(await this.deps.confirmDelete(option)))
|
|
12256
|
+
return false;
|
|
12257
|
+
try {
|
|
12258
|
+
if (isBrowserSource(this.source)) {
|
|
12259
|
+
return await this.removeLocal([index]);
|
|
12260
|
+
}
|
|
12261
|
+
const record = this.records[index];
|
|
12262
|
+
await this.deps.sendBackend({ method: 'DELETE', ...option, data_url: this.legacyUrl(option, record) }, [record], { record });
|
|
12263
|
+
await this.load();
|
|
12264
|
+
return true;
|
|
12265
|
+
}
|
|
12266
|
+
catch (error) {
|
|
12267
|
+
this.deps.failed('deleteFailed', error);
|
|
12268
|
+
return false;
|
|
12269
|
+
}
|
|
12270
|
+
}
|
|
12271
|
+
/** Sends one record (index) or all ('all') to the backend the button describes; afterSuccess removeLocal. */
|
|
12272
|
+
async send(button, index) {
|
|
12273
|
+
const option = button?.option ?? button;
|
|
12274
|
+
const indexes = index === 'all' ? this.records.map((_, i) => i) : [index];
|
|
12275
|
+
const records = indexes.map(i => this.records[i]).filter(r => r !== undefined);
|
|
12276
|
+
if (!records.length)
|
|
12277
|
+
return false;
|
|
12278
|
+
this.setLoading(true);
|
|
12279
|
+
try {
|
|
12280
|
+
await this.deps.sendBackend(option, records, { record: records[0] });
|
|
12281
|
+
if (option?.afterSuccess === 'removeLocal')
|
|
12282
|
+
await this.removeLocal(indexes);
|
|
12283
|
+
return true;
|
|
12284
|
+
}
|
|
12285
|
+
catch (error) {
|
|
12286
|
+
this.deps.failed('saveFailed', error);
|
|
12287
|
+
return false;
|
|
12288
|
+
}
|
|
12289
|
+
finally {
|
|
12290
|
+
this.setLoading(false);
|
|
12291
|
+
}
|
|
12292
|
+
}
|
|
12293
|
+
// ---- inside ----
|
|
12294
|
+
/** Filter fields are the keys set by setFilter; a filter page loads only when none is empty. */
|
|
12295
|
+
filterComplete() {
|
|
12296
|
+
const values = Object.values(this.filter);
|
|
12297
|
+
return values.length > 0 && values.every(v => v != null && v !== '');
|
|
12298
|
+
}
|
|
12299
|
+
async loadBackendRecords() {
|
|
12300
|
+
this.setLoading(true);
|
|
12301
|
+
try {
|
|
12302
|
+
const filter = {};
|
|
12303
|
+
for (const [key, value] of Object.entries(this.filter))
|
|
12304
|
+
filter[key] = this.filterValue(value);
|
|
12305
|
+
const data = await this.deps.loadBackend(this.source, { filter, pageNumber: this.page, pageSize: this.pageSize });
|
|
12306
|
+
const records = Array.isArray(data) ? data
|
|
12307
|
+
: Array.isArray(data?.[this.source?.['dataKey']]) ? data[this.source['dataKey']]
|
|
12308
|
+
: Array.isArray(data?.content) ? data.content : [];
|
|
12309
|
+
if (this.clientPaging) {
|
|
12310
|
+
this.setRecords(this.deps.restoreDates ? this.deps.restoreDates(records) : records);
|
|
12311
|
+
}
|
|
12312
|
+
else {
|
|
12313
|
+
this.records = records;
|
|
12314
|
+
this.visible = records;
|
|
12315
|
+
this.totalItems = Number(data?.totalElements ?? data?.page?.totalElements ?? records.length);
|
|
12316
|
+
this.pageCount = Number(data?.totalPages ?? data?.page?.totalPages ?? Math.ceil(this.totalItems / this.pageSize)) || 0;
|
|
12317
|
+
}
|
|
12318
|
+
}
|
|
12319
|
+
catch (error) {
|
|
12320
|
+
this.deps.failed('loadFailed', error);
|
|
12321
|
+
this.setRecords([]);
|
|
12322
|
+
}
|
|
12323
|
+
finally {
|
|
12324
|
+
this.setLoading(false);
|
|
12325
|
+
}
|
|
12326
|
+
}
|
|
12327
|
+
/** A filter date goes on as a Date - the call writes it by the page's dateFormat. */
|
|
12328
|
+
filterValue(value) {
|
|
12329
|
+
const date = value instanceof Date ? value
|
|
12330
|
+
: typeof value === 'string' && /^\d{4}-\d{2}-\d{2}/.test(value) ? new Date(value) : null;
|
|
12331
|
+
return date && !isNaN(date.getTime()) ? date : value;
|
|
12332
|
+
}
|
|
12333
|
+
async removeLocal(indexes) {
|
|
12334
|
+
const drop = new Set(indexes);
|
|
12335
|
+
const records = this.records.filter((_, i) => !drop.has(i));
|
|
12336
|
+
if (isBrowserSource(this.source) && !(await this.deps.writeRecords(this.source, records))) {
|
|
12337
|
+
return false;
|
|
12338
|
+
}
|
|
12339
|
+
this.records = records;
|
|
12340
|
+
this.slice();
|
|
12341
|
+
return true;
|
|
12342
|
+
}
|
|
12343
|
+
/** The old delete address "orders/{{id}}" took record[button.key] for any placeholder. */
|
|
12344
|
+
legacyUrl(option, record) {
|
|
12345
|
+
const url = String(option?.data_url ?? '');
|
|
12346
|
+
if (!option?.key || /{{\s*(record|userInfo|filter|env)\./.test(url))
|
|
12347
|
+
return url;
|
|
12348
|
+
return url.replace(/{{(.*?)}}/g, () => String(record?.[option.key] ?? ''));
|
|
12349
|
+
}
|
|
12350
|
+
setRecords(records) {
|
|
12351
|
+
this.records = Array.isArray(records) ? records : [];
|
|
12352
|
+
this.slice();
|
|
12353
|
+
}
|
|
12354
|
+
/** Browser list and filter page: the current page out of all records; a backend page is shown as it came. */
|
|
12355
|
+
slice() {
|
|
12356
|
+
if (this.clientPaging) {
|
|
12357
|
+
this.totalItems = this.records.length;
|
|
12358
|
+
this.pageCount = Math.ceil(this.totalItems / this.pageSize);
|
|
12359
|
+
this.page = Math.min(this.page, Math.max(this.pageCount - 1, 0));
|
|
12360
|
+
const start = this.page * this.pageSize;
|
|
12361
|
+
this.visible = this.records.slice(start, start + this.pageSize);
|
|
12362
|
+
}
|
|
12363
|
+
else {
|
|
12364
|
+
this.visible = this.records;
|
|
12365
|
+
}
|
|
12366
|
+
this.onChange();
|
|
12367
|
+
}
|
|
12368
|
+
setLoading(loading) {
|
|
12369
|
+
this.loading = loading;
|
|
12370
|
+
this.onChange();
|
|
12371
|
+
}
|
|
12372
|
+
}
|
|
12373
|
+
|
|
12374
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
12375
|
+
// - new: the start value of a field comes from the layout (option.fieldData.default, the Designer's
|
|
12376
|
+
// "Default value") - a data object holds names and types only (decision of the user 2026-10-24).
|
|
12377
|
+
// A placeholder such as {{quantity}} or {{id}} becomes the field's value at once, so the app replaces
|
|
12378
|
+
// it as before (cart sums, the record's or the signed-in user's value); a plain value fills an empty
|
|
12379
|
+
// field (asValue) or is the default of a new record (dialog). option.fromUser: the placeholder is
|
|
12380
|
+
// taken from the signed-in user, not from the record.
|
|
12381
|
+
const isObject = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
|
|
12382
|
+
const empty = (value) => value === undefined || value === null || value === '';
|
|
12383
|
+
/** "#/cart/properties/totalPrice" -> ["cart", "totalPrice"] */
|
|
12384
|
+
function referenceOf(reference) {
|
|
12385
|
+
const match = typeof reference === 'string' ? reference.match(/^#\/([^/]+)\/properties\/([^/]+)$/) : null;
|
|
12386
|
+
return match ? [match[1], match[2]] : null;
|
|
12387
|
+
}
|
|
12388
|
+
/** Every layout node that shows a property (scope.reference), wherever it stands. */
|
|
12389
|
+
function propertyNodes(layout) {
|
|
12390
|
+
const nodes = [];
|
|
12391
|
+
const walk = (value) => {
|
|
12392
|
+
if (Array.isArray(value))
|
|
12393
|
+
value.forEach(walk);
|
|
12394
|
+
else if (isObject(value)) {
|
|
12395
|
+
if (referenceOf(value.scope?.reference))
|
|
12396
|
+
nodes.push(value);
|
|
12397
|
+
Object.values(value).forEach(walk);
|
|
12398
|
+
}
|
|
12399
|
+
};
|
|
12400
|
+
walk(layout);
|
|
12401
|
+
return nodes;
|
|
12402
|
+
}
|
|
12403
|
+
/**
|
|
12404
|
+
* The layout's start values into the data objects' properties ({ object: { name: property } }).
|
|
12405
|
+
* asValue: a plain start value fills an empty field (form, list); otherwise it is the property's default,
|
|
12406
|
+
* used for a new record only (dialog). A placeholder always becomes the value.
|
|
12407
|
+
*/
|
|
12408
|
+
function applyLayoutDefaults(schemas, layout, asValue) {
|
|
12409
|
+
if (!isObject(schemas) || !layout)
|
|
12410
|
+
return;
|
|
12411
|
+
for (const node of propertyNodes(layout)) {
|
|
12412
|
+
const [object, name] = referenceOf(node.scope.reference);
|
|
12413
|
+
const property = schemas[object]?.[name];
|
|
12414
|
+
if (!isObject(property))
|
|
12415
|
+
continue;
|
|
12416
|
+
const option = node.option ?? {};
|
|
12417
|
+
if (option.fromUser === true)
|
|
12418
|
+
property.loginUser = true;
|
|
12419
|
+
const value = option.fieldData?.default;
|
|
12420
|
+
if (value === undefined)
|
|
12421
|
+
continue;
|
|
12422
|
+
const placeholder = typeof value === 'string' && /^\{\{.+\}\}$/.test(value.trim());
|
|
12423
|
+
if (placeholder || asValue) {
|
|
12424
|
+
if (empty(property.value))
|
|
12425
|
+
property.value = value;
|
|
12426
|
+
}
|
|
12427
|
+
else if (property.default === undefined) {
|
|
12428
|
+
property.default = value;
|
|
12429
|
+
}
|
|
12430
|
+
}
|
|
12431
|
+
}
|
|
12432
|
+
|
|
12433
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-24
|
|
12434
|
+
// - new: the acceptance of the terms (user decision 2026-10-24): confirmed before the sign-in, kept in the browser
|
|
12435
|
+
// per app and state of the terms; with a backend (center.appSettings.terms.backend) the app asks for the state
|
|
12436
|
+
// after the sign-in and sends the acceptance - the backend may name a newer state, then the app asks again
|
|
12437
|
+
/** The terms must be confirmed before anything else: switched on and something to read. */
|
|
12438
|
+
function termsToConfirm(terms) {
|
|
12439
|
+
return !!terms?.enabled && !!terms.confirmOnStart && Object.values(terms.documents || {}).some(doc => !!doc?.value);
|
|
12440
|
+
}
|
|
12441
|
+
/**
|
|
12442
|
+
* The state of the terms: the version of the layout, else a short checksum of the documents - a changed text is
|
|
12443
|
+
* a new state without anybody counting versions.
|
|
12444
|
+
*/
|
|
12445
|
+
function termsStamp(terms) {
|
|
12446
|
+
if (terms.version)
|
|
12447
|
+
return terms.version;
|
|
12448
|
+
const text = Object.entries(terms.documents || {})
|
|
12449
|
+
.filter(([, doc]) => !!doc?.value)
|
|
12450
|
+
.map(([name, doc]) => `${name}:${doc.kind}:${doc.value}`)
|
|
12451
|
+
.sort()
|
|
12452
|
+
.join('\n');
|
|
12453
|
+
let hash = 5381;
|
|
12454
|
+
for (let i = 0; i < text.length; i++)
|
|
12455
|
+
hash = ((hash << 5) + hash + text.charCodeAt(i)) >>> 0;
|
|
12456
|
+
return `text-${hash.toString(36)}`;
|
|
12457
|
+
}
|
|
12458
|
+
/** The browser's key for an app's acceptance. */
|
|
12459
|
+
function termsStorageKey(project) {
|
|
12460
|
+
return `${project}TermsAccepted`;
|
|
12461
|
+
}
|
|
12462
|
+
/** Whether the browser's acceptance covers this state. */
|
|
12463
|
+
function acceptedLocally(stored, stamp) {
|
|
12464
|
+
return !!stored && stored.stamp === stamp;
|
|
12465
|
+
}
|
|
12466
|
+
/** An address with {{user}}, {{version}} and {{env.x}} filled in (URL-encoded); a relative one goes after apiUrl. */
|
|
12467
|
+
function termsUrl(url, values) {
|
|
12468
|
+
const filled = url
|
|
12469
|
+
.replace(/\{\{\s*user\s*\}\}/g, encodeURIComponent(values.user))
|
|
12470
|
+
.replace(/\{\{\s*version\s*\}\}/g, encodeURIComponent(values.version))
|
|
12471
|
+
.replace(/\{\{\s*env\.([\w.]+)\s*\}\}/g, (_m, key) => String(values.env?.[key] ?? ''));
|
|
12472
|
+
if (/^https?:\/\//i.test(filled))
|
|
12473
|
+
return filled;
|
|
12474
|
+
const base = String(values.env?.['apiUrl'] ?? '').replace(/\/$/, '');
|
|
12475
|
+
return base ? `${base}/${filled.replace(/^\//, '')}` : filled;
|
|
12476
|
+
}
|
|
12477
|
+
/**
|
|
12478
|
+
* The backend's answer to the status question: { version, accepted }. The backend's version is the state that
|
|
12479
|
+
* counts then; accepted false (or a newer version than the browser knows) means: ask again.
|
|
12480
|
+
*/
|
|
12481
|
+
function backendTermsState(answer, stamp) {
|
|
12482
|
+
const version = typeof answer?.version === 'string' && answer.version.trim() ? answer.version.trim() : stamp;
|
|
12483
|
+
return { version, accepted: answer?.accepted === true };
|
|
12484
|
+
}
|
|
12485
|
+
/** The user the acceptance belongs to: e-mail, user name or subject of the sign-in. */
|
|
12486
|
+
function termsUser(userInfo) {
|
|
12487
|
+
for (const key of ['email', 'preferred_username', 'username', 'name', 'sub', 'userId']) {
|
|
12488
|
+
const value = userInfo?.[key];
|
|
12489
|
+
if (typeof value === 'string' && value.trim())
|
|
12490
|
+
return value.trim();
|
|
12491
|
+
if (typeof value === 'number')
|
|
12492
|
+
return String(value);
|
|
12493
|
+
}
|
|
12494
|
+
return '';
|
|
12495
|
+
}
|
|
12496
|
+
|
|
11201
12497
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-15
|
|
11202
12498
|
// - new: exports MediaSourcePipe (vlMedia, #145)
|
|
11203
12499
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-10-14
|
|
@@ -11214,5 +12510,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
|
|
|
11214
12510
|
* Generated bundle index. Do not edit.
|
|
11215
12511
|
*/
|
|
11216
12512
|
|
|
11217
|
-
export { AppVersionResetService, Autocomplete, BACKEND_PROXY_PREFIX, CardComponent, CheckboxControl, ConfigService, ControlComponent, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, DateFormatPipe, DateHintPipe, DateRangeControl, DateTextPipe, DateTimeControl, DropdownControl, FormComponent, GridComponent, HeaderMenuComponent, LogsComponent, MediaControl, MediaSourcePipe, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, NumberControl, PaginationComponent, PasswordControl, PlaceholderPipe, READ_ATTEMPT_TIMEOUT, REQUEST_STAGES, RETRY_PAUSES, RETRY_STATUSES, RadioControl, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, RulesPipe, SIDE_DOCK_CLASS, SideMenuComponent, SwitchControl, TextareaControl, Textbox, UtilityService, ViewToolkitModule, VisiblePipe, backendUrl, controlKind, controlProperty, currencyDigits, currentDateLanguage, dateDigitCount, dateInputPattern, displayDateValue, displayNumber, fieldInnerLayoutStyle, fieldModel, fieldRules, fixedTimeText, inputFormatHint, isNativeMobile, isNativePhone, languageDatePattern, layoutPlaceholder, mediaKind, normalizeCustomKeyboardType, numberShape, numberStep, numberSuffix, primeDatePattern, resolveCustomKeyboardType, resolvePlaceholder, ruleMessage, setDateLanguage, setInputHintLanguage, setToolkitKeyboardOnWeb, shapeDateDigits, shapeTimeText, sideDockWidth, splitReference, stagedRead, stagedRequest, storedToTyped, styleParts, testAction, testFieldKey, testWrites, timeHourFormat, toggleMeridiem, toolkitKeyboardActive, typedToStored, usesTwelveHours, visibleFields, whenOnline };
|
|
12513
|
+
export { AppVersionResetService, Autocomplete, BACKEND_PROXY_PREFIX, BackendCallService, CardComponent, CheckboxControl, ConfigService, ControlComponent, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, DEFAULT_DATE_FORMAT, DateFormatPipe, DateHintPipe, DateRangeControl, DateTextPipe, DateTimeControl, DropdownControl, FormComponent, GridComponent, HeaderMenuComponent, LogsComponent, MediaControl, MediaSourcePipe, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, NumberControl, PageData, PaginationComponent, PasswordControl, PlaceholderPipe, READ_ATTEMPT_TIMEOUT, REQUEST_STAGES, RETRY_PAUSES, RETRY_STATUSES, RadioControl, RecordStore, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, RulesPipe, SIDE_DOCK_CLASS, STORAGE_DATE_FORMAT, SideMenuComponent, SwitchControl, TermsDialog, TextareaControl, Textbox, UtilityService, ViewToolkitModule, VisiblePipe, acceptedLocally, applyLayoutDefaults, backendTermsState, backendUrl, buildBackendCall, buttonLocked, controlKind, controlProperty, currencyDigits, currentDateLanguage, dateDigitCount, dateInputPattern, displayDateValue, displayNumber, fieldInnerLayoutStyle, fieldModel, fieldRules, fixedTimeText, formatDate, formatDates, fromStorageValue, hasBackendCall, inputFormatHint, isBrowserSource, isNativeMobile, isNativePhone, isSignedIn, languageDatePattern, layoutPlaceholder, lockHint, lockReason, lockReasons, mediaKind, normalizeCustomKeyboardType, numberShape, numberStep, numberSuffix, parseRecords, parseStorageDate, primeDatePattern, recordOf, resolveCustomKeyboardType, resolvePlaceholder, resolveTemplate, ruleMessage, sectionSpan, sectionSticky, sectionTabletSpan, sectionVisible, setDateLanguage, setInputHintLanguage, setToolkitKeyboardOnWeb, shapeDateDigits, shapeTimeText, sideDockWidth, splitReference, stagedRead, stagedRequest, storageKind, storageValue, storedToTyped, styleParts, termsStamp, termsStorageKey, termsToConfirm, termsUrl, termsUser, testAction, testFieldKey, testWrites, timeHourFormat, toggleMeridiem, toolkitKeyboardActive, typedToStored, usesTwelveHours, visibleFields, whenOnline };
|
|
11218
12514
|
//# sourceMappingURL=yomotech-view-toolkit.mjs.map
|