@yomotech/view-toolkit 1.0.69 → 1.0.71
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 +20 -9
- package/fesm2022/yomotech-view-toolkit-catalog.mjs.map +1 -1
- package/fesm2022/yomotech-view-toolkit.mjs +146 -10
- package/fesm2022/yomotech-view-toolkit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/yomotech-view-toolkit-catalog.d.ts +1 -1
- package/types/yomotech-view-toolkit.d.ts +24 -2
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-17
|
|
2
|
+
// - new: data type "duration" (hours and minutes, HH:mm in every language) - a basic type, typed with the time picker
|
|
3
|
+
// and the time keyboard, travels as text
|
|
4
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-17
|
|
5
|
+
// - new: combobox and autocomplete settings openOnFocus (a tap into the field opens the whole list) and search
|
|
6
|
+
// (startsWith - default - or contains): the app sets them, the selection list follows (tm-guided B4)
|
|
1
7
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-09
|
|
2
8
|
// - new: control price for a text field - a price as data (option.amount, currency, from; 213/36)
|
|
3
9
|
// - new: control map for a text field - where the business is (option.lat, option.lon, option.address, option.zoom;
|
|
@@ -56,7 +62,7 @@ function resolveProperty(root, reference) {
|
|
|
56
62
|
return root?.[objectName]?.[name] ?? root?.[objectName]?.properties?.[name] ?? root?.properties?.[name] ?? {};
|
|
57
63
|
}
|
|
58
64
|
function normalizeFormat(value) {
|
|
59
|
-
return { date: 'iso-date', time: 'iso-time', 'date-time': 'iso-datetime', datetime: 'iso-datetime', 'date&time': 'iso-datetime', bigdecimal: 'decimal' }[String(value).toLowerCase()] || value || '';
|
|
65
|
+
return { date: 'iso-date', time: 'iso-time', duration: 'iso-time', 'date-time': 'iso-datetime', datetime: 'iso-datetime', 'date&time': 'iso-datetime', bigdecimal: 'decimal' }[String(value).toLowerCase()] || value || '';
|
|
60
66
|
}
|
|
61
67
|
function baseType(schema, fallback) {
|
|
62
68
|
const t = String(schema.type || fallback || '').toLowerCase();
|
|
@@ -64,11 +70,11 @@ function baseType(schema, fallback) {
|
|
|
64
70
|
return 'string';
|
|
65
71
|
if (t === 'quantity')
|
|
66
72
|
return 'integer';
|
|
67
|
-
return ['date', 'time', 'datetime', 'date-time', 'date&time'].includes(t) ? 'string' : ['decimal', 'bigdecimal'].includes(t) ? 'string' : t;
|
|
73
|
+
return ['date', 'time', 'duration', 'datetime', 'date-time', 'date&time'].includes(t) ? 'string' : ['decimal', 'bigdecimal'].includes(t) ? 'string' : t;
|
|
68
74
|
}
|
|
69
75
|
function effectiveFormat(schema, fallback, data) {
|
|
70
76
|
const semantic = String(schema.type || fallback || '').toLowerCase();
|
|
71
|
-
const temporal = ['date', 'time', 'datetime', 'date-time', 'date&time', 'decimal', 'bigdecimal'].includes(semantic);
|
|
77
|
+
const temporal = ['date', 'time', 'duration', 'datetime', 'date-time', 'date&time', 'decimal', 'bigdecimal'].includes(semantic);
|
|
72
78
|
const declared = normalizeFormat(schema.format || data.format || '');
|
|
73
79
|
// A date with its own display pattern (format "yy-mm-dd") is still a date.
|
|
74
80
|
if (temporal && declared && !DATA_FORMATS.includes(declared))
|
|
@@ -252,7 +258,7 @@ function renameDataObject(layout, oldName, newName) {
|
|
|
252
258
|
walk(layout);
|
|
253
259
|
return changed;
|
|
254
260
|
}
|
|
255
|
-
const BASIC_TYPES = ['string', 'number', 'integer', 'bigdecimal', 'boolean', 'date', 'time', 'datetime', 'dateRange', 'media', 'array'];
|
|
261
|
+
const BASIC_TYPES = ['string', 'number', 'integer', 'bigdecimal', 'boolean', 'date', 'time', 'duration', 'datetime', 'dateRange', 'media', 'array'];
|
|
256
262
|
/** Older or other names of a data type and the type they mean. */
|
|
257
263
|
const TYPE_ALIASES = { daterange: 'dateRange', image: 'media', checkbox: 'boolean', 'date-time': 'datetime', 'date&time': 'datetime', decimal: 'bigdecimal' };
|
|
258
264
|
/** The data type of a property, aliases resolved ("image" -> "media"). */
|
|
@@ -371,7 +377,8 @@ function keyboardFor(option, property = {}) {
|
|
|
371
377
|
return 'email';
|
|
372
378
|
switch (basicType(property)) {
|
|
373
379
|
case 'date': return 'date';
|
|
374
|
-
case 'time':
|
|
380
|
+
case 'time':
|
|
381
|
+
case 'duration': return 'time';
|
|
375
382
|
case 'number':
|
|
376
383
|
case 'integer':
|
|
377
384
|
case 'bigdecimal': return 'numeric';
|
|
@@ -437,6 +444,8 @@ function displaySettings(schema, fallback, option) {
|
|
|
437
444
|
result.push(setting('orientation', 'Orientation', 'select', ['horizontal', 'vertical']));
|
|
438
445
|
if (c === 'combobox')
|
|
439
446
|
result.push(yesNo('allowCustom', 'Allow values outside the list'));
|
|
447
|
+
if (['combobox', 'autocomplete'].includes(c))
|
|
448
|
+
result.push(yesNo('openOnFocus', 'Open the whole list on a tap into the field'), setting('search', 'Typing keeps entries that', 'select', ['startsWith', 'contains'], 'startsWith (default): "02" finds 02000001, "12" nothing. contains: the text anywhere in the entry.'));
|
|
440
449
|
if (c === 'autocomplete')
|
|
441
450
|
result.push(setting('source', 'Suggestion source URL'), setting('minChars', 'Minimum characters', 'number'));
|
|
442
451
|
if (c === 'picklist')
|
|
@@ -572,7 +581,7 @@ function validateSettings(schema, fallback, option, context) {
|
|
|
572
581
|
fail(currencyProperty.type !== 'string', 'The currency property must exist in the property schema and have string storage.');
|
|
573
582
|
}
|
|
574
583
|
fail(option.checkedBooleanValue !== undefined && typeof option.checkedBooleanValue !== 'boolean', 'The active Boolean value must be true or false.');
|
|
575
|
-
for (const k of ['required', 'readonly', 'allowCustom', 'showValue', 'grouping'])
|
|
584
|
+
for (const k of ['required', 'readonly', 'allowCustom', 'openOnFocus', 'showValue', 'grouping'])
|
|
576
585
|
fail(option[k] !== undefined && typeof option[k] !== 'boolean', `${k} must be a Boolean.`);
|
|
577
586
|
for (const k of ['minorUnits'])
|
|
578
587
|
fail(d[k] !== undefined && typeof d[k] !== 'boolean', `${k} must be a Boolean.`);
|
|
@@ -616,11 +625,11 @@ function validateSettings(schema, fallback, option, context) {
|
|
|
616
625
|
}
|
|
617
626
|
if (option.messages && typeof option.messages === 'object')
|
|
618
627
|
fail(Object.values(option.messages).some(v => typeof v !== 'string'), 'Validation messages must contain string captions or translation keys.');
|
|
619
|
-
for (const [key, values] of [['labelPosition', ['left', 'right']], ['orientation', ['horizontal', 'vertical']], ['numberStyle', ['decimal', 'currency', 'percent']]])
|
|
628
|
+
for (const [key, values] of [['labelPosition', ['left', 'right']], ['orientation', ['horizontal', 'vertical']], ['numberStyle', ['decimal', 'currency', 'percent']], ['search', ['startsWith', 'contains']]])
|
|
620
629
|
fail(option[key] !== undefined && !values.includes(option[key]), `Choose a supported ${key}.`);
|
|
621
630
|
fail(option.messages !== undefined && (!option.messages || typeof option.messages !== 'object' || Array.isArray(option.messages)), 'Validation messages must be a JSON object.');
|
|
622
631
|
const allowed = new Set(displaySettings(schema, fallback, option).map(s => s.key));
|
|
623
|
-
for (const k of ['placeholder', 'rows', 'mask', 'step', 'showValue', 'labelPosition', 'labelOn', 'labelOff', 'orientation', 'allowCustom', 'source', 'minChars', 'labels', 'maxVisible', 'displayFormat', 'displayTimezone', 'customDisplayFormat', 'numberStyle', 'decimals', 'grouping', 'unit', 'unitLabel', 'checkedValue', 'uncheckedValue', 'checkedBooleanValue'])
|
|
632
|
+
for (const k of ['placeholder', 'rows', 'mask', 'step', 'showValue', 'labelPosition', 'labelOn', 'labelOff', 'orientation', 'allowCustom', 'openOnFocus', 'search', 'source', 'minChars', 'labels', 'maxVisible', 'displayFormat', 'displayTimezone', 'customDisplayFormat', 'numberStyle', 'decimals', 'grouping', 'unit', 'unitLabel', 'checkedValue', 'uncheckedValue', 'checkedBooleanValue'])
|
|
624
633
|
fail(option[k] !== undefined && !allowed.has(k), `${k} is not applicable to this control and data meaning.`);
|
|
625
634
|
for (const k of ['currency', 'currencyField', 'minorUnits'])
|
|
626
635
|
fail(d[k] !== undefined && !dataSettings(schema, fallback, option).some(s => s.key === k), `${k} requires the appropriate numeric type.`);
|
|
@@ -2018,6 +2027,8 @@ function headerScrollOf(header) {
|
|
|
2018
2027
|
return HEADER_SCROLLS.includes(own) ? own : 'fixed';
|
|
2019
2028
|
}
|
|
2020
2029
|
|
|
2030
|
+
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-17
|
|
2031
|
+
// - new: keepFilter on a load from the backend - a filter page opened again shows the last filter values and its list
|
|
2021
2032
|
// Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-13
|
|
2022
2033
|
// - new: check "addon:<name>" on save (backend), saveAll and submit (browser and backend) - the add-on checks the record
|
|
2023
2034
|
// before it is kept or sent (OFFENE-PUNKTE 225 B)
|
|
@@ -2066,7 +2077,7 @@ const CALL_KINDS = {
|
|
|
2066
2077
|
storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
|
|
2067
2078
|
methods: ['GET', 'POST'],
|
|
2068
2079
|
browser: ['data_url', 'perUser'],
|
|
2069
|
-
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'dataKey', 'loadOnFilter', 'emptyMessage', 'errorMessage'],
|
|
2080
|
+
backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'dataKey', 'loadOnFilter', 'keepFilter', 'emptyMessage', 'errorMessage'],
|
|
2070
2081
|
},
|
|
2071
2082
|
link: {
|
|
2072
2083
|
does: 'A button opens a detail page that loads its record from the address; the button itself calls nothing.',
|