@simai-studio/view 1.3.0 → 1.4.0
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/README.md +4 -4
- package/dist/package-receipt.json +106 -106
- package/dist/set.json +1 -1
- package/dist/smart/view/component.json +19 -10
- package/dist/smart/view/component.json.gz +0 -0
- package/dist/smart/view/js/view.js +2 -2
- package/dist/smart/view/js/view.js.gz +0 -0
- package/dist/smart/view/js/view.min.js +1 -1
- package/dist/smart/view/js/view.min.js.gz +0 -0
- package/dist/smart/view/smart.manifest.json +14 -6
- package/dist/smart/view/smart.manifest.json.gz +0 -0
- package/dist/smart/view/static/default/open-record.html +1 -1
- package/dist/smart/view/static/default/open-record.html.gz +0 -0
- package/dist/smart/view/static/default/reference.html +1 -1
- package/dist/smart/view/static/default/reference.html.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.js +388 -31
- package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.min.js +213 -201
- package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
- package/dist/smart/view-flow/static/default/ask.html +1 -1
- package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
- package/dist/smart/view-flow/static/default/reference.html +2 -2
- package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
- package/dist/smart/view-properties/component.json +8 -1
- package/dist/smart/view-properties/component.json.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.css +17 -4
- package/dist/smart/view-properties/css/view-properties.css.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.min.css +1 -1
- package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.js +389 -32
- package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.min.js +167 -155
- package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
- package/dist/smart/view-properties/smart.manifest.json +9 -2
- package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
- package/dist/smart/view-properties/template/default.css +13 -2
- package/dist/smart/view-properties/template/default.css.gz +0 -0
- package/dist/smart/view-table/component.json +8 -1
- package/dist/smart/view-table/component.json.gz +0 -0
- package/dist/smart/view-table/js/view-table.js +393 -33
- package/dist/smart/view-table/js/view-table.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.min.js +152 -139
- package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
- package/dist/smart/view-table/smart.manifest.json +9 -2
- package/dist/smart/view-table/smart.manifest.json.gz +0 -0
- package/package.json +1 -1
|
@@ -441,6 +441,173 @@ function composeTime(original, text) {
|
|
|
441
441
|
|
|
442
442
|
/***/ },
|
|
443
443
|
|
|
444
|
+
/***/ "ab3947ea3647"
|
|
445
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
446
|
+
|
|
447
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
448
|
+
__webpack_require__.r(__webpack_exports__);
|
|
449
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
450
|
+
/* harmony export */ formatDecimal: () => (/* binding */ formatDecimal),
|
|
451
|
+
/* harmony export */ formatMoney: () => (/* binding */ formatMoney),
|
|
452
|
+
/* harmony export */ formatPercent: () => (/* binding */ formatPercent),
|
|
453
|
+
/* harmony export */ fractionDigits: () => (/* binding */ fractionDigits),
|
|
454
|
+
/* harmony export */ moneyParts: () => (/* binding */ moneyParts),
|
|
455
|
+
/* harmony export */ readDecimal: () => (/* binding */ readDecimal)
|
|
456
|
+
/* harmony export */ });
|
|
457
|
+
/* harmony import */ var _core_js_format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("15b4e93ff6ed");
|
|
458
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_js_format_intl_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
459
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
460
|
+
_core_js_format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
461
|
+
// Decimal numbers as strings, never as floats (simai.property-view-port
|
|
462
|
+
// 1.18.0; Larena property types standard, notes of 2026-11-03: «Never a float
|
|
463
|
+
// on the wire»). What a person typed is read into a canonical decimal string,
|
|
464
|
+
// and a decimal, a money amount and a percent are shown in the page's language
|
|
465
|
+
// through Intl, which formats a string by its digits: «1500.10» never passes
|
|
466
|
+
// through a float on the way to «1 500,10 ₽». Pure, so the unit suite reads it
|
|
467
|
+
// without a browser; the View set draws the editors of money, percent and
|
|
468
|
+
// items with its own copy of the same rules.
|
|
469
|
+
|
|
470
|
+
const TYPED = /^([+-]?)(\d*)(?:[.,](\d*))?$/u; // Spaces a person or a formatter puts between groups of digits: the plain
|
|
471
|
+
// space, the no-break space and the narrow no-break space ru-RU writes, and
|
|
472
|
+
// the apostrophe some locales group with.
|
|
473
|
+
|
|
474
|
+
const GROUP_SPACES = /[\s ']/gu;
|
|
475
|
+
/**
|
|
476
|
+
* What a person typed, read as a decimal: `{ok: true, value}` with the
|
|
477
|
+
* canonical string (an optional minus, the integer digits without leading
|
|
478
|
+
* zeros, the fraction digits as typed; null for nothing typed), or
|
|
479
|
+
* `{ok: false}` for text that is not a number. A comma and a point both
|
|
480
|
+
* separate the fraction. A JSON integer is read as its digits; a float is not
|
|
481
|
+
* a decimal and is refused rather than guessed at.
|
|
482
|
+
*/
|
|
483
|
+
|
|
484
|
+
function readDecimal(text) {
|
|
485
|
+
if (text === null || typeof text === 'undefined') return {
|
|
486
|
+
ok: true,
|
|
487
|
+
value: null
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
if (typeof text === 'number') {
|
|
491
|
+
return Number.isSafeInteger(text) ? {
|
|
492
|
+
ok: true,
|
|
493
|
+
value: String(text)
|
|
494
|
+
} : {
|
|
495
|
+
ok: false
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
const plain = String(text).replace(GROUP_SPACES, '');
|
|
500
|
+
if (plain === '') return {
|
|
501
|
+
ok: true,
|
|
502
|
+
value: null
|
|
503
|
+
};
|
|
504
|
+
const match = TYPED.exec(plain);
|
|
505
|
+
if (!match) return {
|
|
506
|
+
ok: false
|
|
507
|
+
};
|
|
508
|
+
const [, sign, whole, fraction] = match;
|
|
509
|
+
if (whole === '' && (fraction ?? '') === '') return {
|
|
510
|
+
ok: false
|
|
511
|
+
};
|
|
512
|
+
const integer = whole.replace(/^0+(?=\d)/u, '') || '0';
|
|
513
|
+
const digits = fraction ?? '';
|
|
514
|
+
const zero = /^0*$/u.test(integer + digits);
|
|
515
|
+
return {
|
|
516
|
+
ok: true,
|
|
517
|
+
value: `${sign === '-' && !zero ? '-' : ''}${integer}${digits ? `.${digits}` : ''}`
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
/** How many digits a canonical decimal string has after its point. */
|
|
521
|
+
|
|
522
|
+
function fractionDigits(value) {
|
|
523
|
+
const at = String(value ?? '').indexOf('.');
|
|
524
|
+
return at === -1 ? 0 : String(value).length - at - 1;
|
|
525
|
+
} // A float a host sent anyway is shown, not refused: a cell is not the place to
|
|
526
|
+
// argue with a stored value. Only what reads as a decimal is formatted.
|
|
527
|
+
|
|
528
|
+
function decimalOf(value) {
|
|
529
|
+
if (typeof value === 'number') return Number.isFinite(value) ? String(value) : null;
|
|
530
|
+
const read = readDecimal(value);
|
|
531
|
+
return read.ok ? read.value : null;
|
|
532
|
+
}
|
|
533
|
+
/** A decimal string in the locale's digits, with every digit it has: «1 500,5». */
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
function formatDecimal(value, locale) {
|
|
537
|
+
const decimal = decimalOf(value);
|
|
538
|
+
if (decimal === null) return '';
|
|
539
|
+
const digits = Math.min(20, fractionDigits(decimal));
|
|
540
|
+
return (0,_core_js_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('NumberFormat', locale, {
|
|
541
|
+
minimumFractionDigits: digits,
|
|
542
|
+
maximumFractionDigits: digits
|
|
543
|
+
}).format(decimal);
|
|
544
|
+
}
|
|
545
|
+
/** A money value as {amount, currency}; a field that fixes the currency takes a bare amount. */
|
|
546
|
+
|
|
547
|
+
function moneyParts(value, fixed) {
|
|
548
|
+
const currency = typeof fixed === 'string' && fixed ? fixed : null;
|
|
549
|
+
|
|
550
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
551
|
+
return {
|
|
552
|
+
amount: value.amount ?? null,
|
|
553
|
+
currency: currency || (value.currency ?? null)
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
if (value === null || typeof value === 'undefined' || value === '') return {
|
|
558
|
+
amount: null,
|
|
559
|
+
currency
|
|
560
|
+
};
|
|
561
|
+
return {
|
|
562
|
+
amount: value,
|
|
563
|
+
currency
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* An amount with its currency, as a person reads it: «1 500,50 ₽», «$1,500.50».
|
|
568
|
+
* The digits after the point are at least the currency's minor units (ISO
|
|
569
|
+
* 4217) and every digit the amount has. Without a currency, the amount alone.
|
|
570
|
+
*/
|
|
571
|
+
|
|
572
|
+
function formatMoney(value, field = {}, locale = 'en') {
|
|
573
|
+
const {
|
|
574
|
+
amount,
|
|
575
|
+
currency
|
|
576
|
+
} = moneyParts(value, field.currency);
|
|
577
|
+
const decimal = decimalOf(amount);
|
|
578
|
+
if (decimal === null) return '';
|
|
579
|
+
if (!currency) return formatDecimal(decimal, locale);
|
|
580
|
+
const minor = (0,_core_js_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('NumberFormat', locale, {
|
|
581
|
+
style: 'currency',
|
|
582
|
+
currency
|
|
583
|
+
}).resolvedOptions().maximumFractionDigits ?? 2;
|
|
584
|
+
const digits = Math.min(20, Math.max(minor, fractionDigits(decimal)));
|
|
585
|
+
return (0,_core_js_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('NumberFormat', locale, {
|
|
586
|
+
style: 'currency',
|
|
587
|
+
currency,
|
|
588
|
+
currencyDisplay: 'narrowSymbol',
|
|
589
|
+
minimumFractionDigits: digits,
|
|
590
|
+
maximumFractionDigits: digits
|
|
591
|
+
}).format(decimal);
|
|
592
|
+
}
|
|
593
|
+
/** A percent, «12,5 %» or «12.5%»: the value is the percent ("20" is 20 %), never the share. */
|
|
594
|
+
|
|
595
|
+
function formatPercent(value, locale = 'en') {
|
|
596
|
+
const decimal = decimalOf(value);
|
|
597
|
+
if (decimal === null) return '';
|
|
598
|
+
const digits = Math.min(20, fractionDigits(decimal));
|
|
599
|
+
return (0,_core_js_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('NumberFormat', locale, {
|
|
600
|
+
style: 'unit',
|
|
601
|
+
unit: 'percent',
|
|
602
|
+
minimumFractionDigits: digits,
|
|
603
|
+
maximumFractionDigits: digits
|
|
604
|
+
}).format(decimal);
|
|
605
|
+
}
|
|
606
|
+
__webpack_async_result__();
|
|
607
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
608
|
+
|
|
609
|
+
/***/ },
|
|
610
|
+
|
|
444
611
|
/***/ "01ae054f01b4"
|
|
445
612
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
446
613
|
|
|
@@ -507,8 +674,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
507
674
|
/* harmony import */ var _datetime_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("9ce1a42b2a85");
|
|
508
675
|
/* harmony import */ var _mask_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("dd6973f77245");
|
|
509
676
|
/* harmony import */ var _html_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("01ae054f01b4");
|
|
510
|
-
var
|
|
511
|
-
([lit__WEBPACK_IMPORTED_MODULE_0__, lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_3__]
|
|
677
|
+
/* harmony import */ var _decimal_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("ab3947ea3647");
|
|
678
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([lit__WEBPACK_IMPORTED_MODULE_0__, lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_3__, _decimal_js__WEBPACK_IMPORTED_MODULE_8__]);
|
|
679
|
+
([lit__WEBPACK_IMPORTED_MODULE_0__, lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_3__, _decimal_js__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
512
680
|
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lit__WEBPACK_IMPORTED_MODULE_0__);
|
|
513
681
|
/* harmony import */ var lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
514
682
|
/* harmony import */ var _core_js_page_language__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_core_js_page_language__WEBPACK_IMPORTED_MODULE_3__);
|
|
@@ -519,6 +687,7 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([lit_
|
|
|
519
687
|
|
|
520
688
|
|
|
521
689
|
|
|
690
|
+
|
|
522
691
|
// The Framework's field renderers, addressed by a property type and a template
|
|
523
692
|
// rather than by a control name.
|
|
524
693
|
//
|
|
@@ -878,7 +1047,13 @@ const FILTER_RENDERERS = {
|
|
|
878
1047
|
relation: renderEntityMultiSelectFilterControl,
|
|
879
1048
|
lookup: renderEntityMultiSelectFilterControl,
|
|
880
1049
|
file: renderFileFilterControl,
|
|
881
|
-
color: renderColorFilterControl
|
|
1050
|
+
color: renderColorFilterControl,
|
|
1051
|
+
// The types a component set draws (property-view port 1.18.0): a money
|
|
1052
|
+
// amount and a percent are filtered as numbers (the host compares the
|
|
1053
|
+
// amount, as a decimal), and an items field by its number of rows.
|
|
1054
|
+
money: renderNumberFilterControl,
|
|
1055
|
+
percent: renderNumberFilterControl,
|
|
1056
|
+
items: renderNumberFilterControl
|
|
882
1057
|
}; // What a field asks to be filtered by: its own declared control if it has one,
|
|
883
1058
|
// otherwise its property type, otherwise text.
|
|
884
1059
|
|
|
@@ -1132,7 +1307,10 @@ const CELL_RENDERERS = {
|
|
|
1132
1307
|
record: renderReferenceCell,
|
|
1133
1308
|
relation: renderReferenceCell,
|
|
1134
1309
|
lookup: renderLookupCell,
|
|
1135
|
-
html: renderHtmlCell
|
|
1310
|
+
html: renderHtmlCell,
|
|
1311
|
+
money: renderMoneyCell,
|
|
1312
|
+
percent: renderPercentCell,
|
|
1313
|
+
items: renderItemsCell
|
|
1136
1314
|
}; // A consumer found this on their stand: the words were written into the set, so
|
|
1137
1315
|
// an English admin saw «Да». The set must not decide what a value is called in
|
|
1138
1316
|
// anyone's language. They come from the field, which is where the rest of the
|
|
@@ -1192,6 +1370,41 @@ function renderChoiceCell(field, value) {
|
|
|
1192
1370
|
function renderHostFormattedCell(field, value, host) {
|
|
1193
1371
|
const formatted = host?.formatFieldValue?.(field, value);
|
|
1194
1372
|
return typeof formatted === 'string' && formatted !== '' ? formatted : null;
|
|
1373
|
+
} // The types a component set draws (property-view port 1.18.0) have their
|
|
1374
|
+
// cells here, so a table shows them wherever the set's editors live. A host's
|
|
1375
|
+
// formatFieldValue wins, as for a date; otherwise the page's language:
|
|
1376
|
+
//
|
|
1377
|
+
// money {amount, currency} or a bare amount under a fixed `currency`;
|
|
1378
|
+
// «1 500,50 ₽», every digit the amount has and at least the
|
|
1379
|
+
// currency's minor units, formatted from the digits, never a float
|
|
1380
|
+
// percent a decimal string of the percent, «12,5 %»
|
|
1381
|
+
// items a list of rows; how many, «3 строки»
|
|
1382
|
+
//
|
|
1383
|
+
// A value that is not one of these shapes falls through to the plain value.
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
function renderMoneyCell(field, value, host) {
|
|
1387
|
+
const formatted = renderHostFormattedCell(field, value, host);
|
|
1388
|
+
if (formatted !== null) return formatted;
|
|
1389
|
+
const text = (0,_decimal_js__WEBPACK_IMPORTED_MODULE_8__.formatMoney)(scalarValue(value), field, (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_3__.pageLocale)(host ?? null));
|
|
1390
|
+
return text || null;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
function renderPercentCell(field, value, host) {
|
|
1394
|
+
const formatted = renderHostFormattedCell(field, value, host);
|
|
1395
|
+
if (formatted !== null) return formatted;
|
|
1396
|
+
const text = (0,_decimal_js__WEBPACK_IMPORTED_MODULE_8__.formatPercent)(scalarValue(value), (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_3__.pageLocale)(host ?? null));
|
|
1397
|
+
return text || null;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
function renderItemsCell(field, value, host) {
|
|
1401
|
+
const formatted = renderHostFormattedCell(field, value, host);
|
|
1402
|
+
if (formatted !== null) return formatted;
|
|
1403
|
+
if (!Array.isArray(value)) return null;
|
|
1404
|
+
return value.length ? (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_3__.pageWord)(SET_TEXT, 'rowCount', host ?? null, {
|
|
1405
|
+
component: SET_NAME,
|
|
1406
|
+
count: value.length
|
|
1407
|
+
}) : '';
|
|
1195
1408
|
}
|
|
1196
1409
|
|
|
1197
1410
|
function renderNumericCell(field, value, host) {
|
|
@@ -1366,10 +1579,14 @@ function renderPhoneEdit(field, value, host) {
|
|
|
1366
1579
|
// Clearing a set password is not offered: an empty field means «keep».
|
|
1367
1580
|
//
|
|
1368
1581
|
// The typed text lives in the input and nowhere else: no `value` attribute on
|
|
1369
|
-
// sf-input, no data-*, no text node, no log.
|
|
1370
|
-
// switches the input's type and says
|
|
1371
|
-
//
|
|
1372
|
-
//
|
|
1582
|
+
// sf-input, no data-*, no text node, no log. «Показать пароль» is an icon button
|
|
1583
|
+
// that switches the input's type and says what it will do next by its name and
|
|
1584
|
+
// icon: «Показать пароль» (visibility) while hidden, «Скрыть пароль»
|
|
1585
|
+
// (visibility_off) while shown. A toggle whose name changes is not a pressed
|
|
1586
|
+
// toggle (rule C12, point 3): it carries no aria-pressed and no pressed look,
|
|
1587
|
+
// or a reader would hear «Скрыть пароль, нажата». It changes the DOM directly,
|
|
1588
|
+
// so a host's re-render (its attributes are static in the template) leaves the
|
|
1589
|
+
// person's choice as it is.
|
|
1373
1590
|
|
|
1374
1591
|
|
|
1375
1592
|
function isPasswordField(field) {
|
|
@@ -1385,13 +1602,13 @@ function passwordState(host, value) {
|
|
|
1385
1602
|
return setText(host, passwordIsSet(value) ? 'passwordSet' : 'passwordUnset');
|
|
1386
1603
|
}
|
|
1387
1604
|
|
|
1388
|
-
function togglePasswordShown(event) {
|
|
1605
|
+
function togglePasswordShown(event, host) {
|
|
1389
1606
|
const button = event.currentTarget;
|
|
1390
1607
|
const input = button?.closest?.('.sf-field-password')?.querySelector?.('sf-input');
|
|
1391
1608
|
if (!input) return;
|
|
1392
|
-
const shown =
|
|
1609
|
+
const shown = input.getAttribute('input-type') !== 'text';
|
|
1393
1610
|
input.setAttribute('input-type', shown ? 'text' : 'password');
|
|
1394
|
-
button.setAttribute('
|
|
1611
|
+
button.setAttribute('aria-label', setText(host, shown ? 'hidePassword' : 'showPassword'));
|
|
1395
1612
|
button.setAttribute('icon', shown ? 'visibility_off' : 'visibility');
|
|
1396
1613
|
}
|
|
1397
1614
|
|
|
@@ -1427,9 +1644,8 @@ function renderPasswordEdit(field, value, host) {
|
|
|
1427
1644
|
appearance="link"
|
|
1428
1645
|
scheme="on-surface"
|
|
1429
1646
|
icon="visibility"
|
|
1430
|
-
pressed="false"
|
|
1431
1647
|
aria-label=${setText(host, 'showPassword')}
|
|
1432
|
-
@click=${togglePasswordShown}
|
|
1648
|
+
@click=${event => togglePasswordShown(event, host)}
|
|
1433
1649
|
></sf-button-icon>
|
|
1434
1650
|
</span>
|
|
1435
1651
|
`;
|
|
@@ -1692,29 +1908,98 @@ function renderStepperEdit(field, value, host) {
|
|
|
1692
1908
|
@change=${write}
|
|
1693
1909
|
></sf-input-quantity>
|
|
1694
1910
|
`;
|
|
1911
|
+
} // A number is a decimal (property-view port 1.18.0: «never a float on the
|
|
1912
|
+
// wire»). What is typed is read with a comma or a point and spaces between
|
|
1913
|
+
// groups. A number field whose value arrives as a string, or that declares
|
|
1914
|
+
// `precision`, is a decimal-string field: it writes the canonical decimal
|
|
1915
|
+
// string («1500.50»), never a float, and refuses more digits after the point
|
|
1916
|
+
// than `precision` allows. Any other number field writes a number, as before;
|
|
1917
|
+
// an integer field is unchanged. Text that is not a number is reported as a
|
|
1918
|
+
// masked string's incomplete entry is: through setFieldError, which holds the
|
|
1919
|
+
// save, and under the field once the person leaves it.
|
|
1920
|
+
|
|
1921
|
+
|
|
1922
|
+
function isDecimalStringField(field, value) {
|
|
1923
|
+
return (field.propertyType || field.type) === 'number' && (typeof value === 'string' || Number.isInteger(field.precision));
|
|
1695
1924
|
}
|
|
1696
1925
|
|
|
1697
1926
|
function renderNumberEdit(field, value, host) {
|
|
1698
1927
|
if (isStepperField(field)) return renderStepperEdit(field, value, host);
|
|
1699
1928
|
const decimal = (field.propertyType || field.type) === 'number';
|
|
1700
1929
|
value = scalarValue(value);
|
|
1930
|
+
|
|
1931
|
+
if (!decimal) {
|
|
1932
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1933
|
+
<sf-input
|
|
1934
|
+
size=${EDIT_SIZE}
|
|
1935
|
+
appearance="bordered"
|
|
1936
|
+
name=${fieldName(field)}
|
|
1937
|
+
value=${value ?? ''}
|
|
1938
|
+
inputmode="numeric"
|
|
1939
|
+
?required=${Boolean(field.required)}
|
|
1940
|
+
aria-label=${field.label || field.key || ''}
|
|
1941
|
+
@input=${event => {
|
|
1942
|
+
const next = event.target?.value ?? '';
|
|
1943
|
+
host.setFieldValue(field, next === '' ? null : Number(next));
|
|
1944
|
+
}}
|
|
1945
|
+
@change=${event => {
|
|
1946
|
+
const next = event.target?.value ?? '';
|
|
1947
|
+
host.setFieldValue(field, next === '' ? null : Number(next));
|
|
1948
|
+
}}
|
|
1949
|
+
></sf-input>
|
|
1950
|
+
`;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
const asString = isDecimalStringField(field, value);
|
|
1954
|
+
|
|
1955
|
+
const write = (event, left) => {
|
|
1956
|
+
const input = event.currentTarget ?? event.target;
|
|
1957
|
+
const text = String(input?.value ?? '');
|
|
1958
|
+
const read = (0,_decimal_js__WEBPACK_IMPORTED_MODULE_8__.readDecimal)(text);
|
|
1959
|
+
let message = null;
|
|
1960
|
+
if (!read.ok) message = setText(host, 'notNumber');else if (read.value !== null && Number.isInteger(field.precision) && (0,_decimal_js__WEBPACK_IMPORTED_MODULE_8__.fractionDigits)(read.value) > field.precision) {
|
|
1961
|
+
message = (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_3__.pageWord)(SET_TEXT, 'precisionMax', host ?? null, {
|
|
1962
|
+
component: SET_NAME,
|
|
1963
|
+
count: field.precision
|
|
1964
|
+
});
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
if (message) {
|
|
1968
|
+
if (left && input) {
|
|
1969
|
+
input.setAttribute('error-message', message);
|
|
1970
|
+
input.toggleAttribute('invalid', true);
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
if (typeof host.setFieldError === 'function') {
|
|
1974
|
+
host.setFieldError(field, message);
|
|
1975
|
+
host.setFieldValue(field, text);
|
|
1976
|
+
} else {
|
|
1977
|
+
host.setFieldValue(field, undefined);
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
if (input?.hasAttribute?.('invalid')) {
|
|
1984
|
+
input.toggleAttribute('invalid', false);
|
|
1985
|
+
input.removeAttribute('error-message');
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
host.setFieldError?.(field, null);
|
|
1989
|
+
if (read.value === null) host.setFieldValue(field, null);else host.setFieldValue(field, asString ? read.value : Number(read.value));
|
|
1990
|
+
};
|
|
1991
|
+
|
|
1701
1992
|
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1702
1993
|
<sf-input
|
|
1703
1994
|
size=${EDIT_SIZE}
|
|
1704
1995
|
appearance="bordered"
|
|
1705
1996
|
name=${fieldName(field)}
|
|
1706
1997
|
value=${value ?? ''}
|
|
1707
|
-
inputmode
|
|
1998
|
+
inputmode="decimal"
|
|
1708
1999
|
?required=${Boolean(field.required)}
|
|
1709
2000
|
aria-label=${field.label || field.key || ''}
|
|
1710
|
-
@input=${event =>
|
|
1711
|
-
|
|
1712
|
-
host.setFieldValue(field, next === '' ? null : Number(next));
|
|
1713
|
-
}}
|
|
1714
|
-
@change=${event => {
|
|
1715
|
-
const next = event.target?.value ?? '';
|
|
1716
|
-
host.setFieldValue(field, next === '' ? null : Number(next));
|
|
1717
|
-
}}
|
|
2001
|
+
@input=${event => write(event, false)}
|
|
2002
|
+
@change=${event => write(event, true)}
|
|
1718
2003
|
></sf-input>
|
|
1719
2004
|
`;
|
|
1720
2005
|
} // A date control has no clock. `sf-input-date` declares a format and a date,
|
|
@@ -2157,7 +2442,14 @@ const SET_TEXT = {
|
|
|
2157
2442
|
passwordUnset: 'Not set',
|
|
2158
2443
|
passwordKeep: 'Set; type a new one to replace it',
|
|
2159
2444
|
showPassword: 'Show password',
|
|
2160
|
-
|
|
2445
|
+
hidePassword: 'Hide password',
|
|
2446
|
+
maskIncomplete: 'Complete the field',
|
|
2447
|
+
notNumber: 'Enter a number',
|
|
2448
|
+
precisionMax: 'At most {n} digits after the point',
|
|
2449
|
+
rowCount: {
|
|
2450
|
+
one: '{n} row',
|
|
2451
|
+
other: '{n} rows'
|
|
2452
|
+
}
|
|
2161
2453
|
},
|
|
2162
2454
|
ru: {
|
|
2163
2455
|
yes: 'Да',
|
|
@@ -2185,7 +2477,16 @@ const SET_TEXT = {
|
|
|
2185
2477
|
passwordUnset: 'Не задан',
|
|
2186
2478
|
passwordKeep: 'Задан; введите новый, чтобы заменить',
|
|
2187
2479
|
showPassword: 'Показать пароль',
|
|
2188
|
-
|
|
2480
|
+
hidePassword: 'Скрыть пароль',
|
|
2481
|
+
maskIncomplete: 'Заполните поле полностью',
|
|
2482
|
+
notNumber: 'Введите число',
|
|
2483
|
+
precisionMax: 'Не больше {n} знаков после запятой',
|
|
2484
|
+
rowCount: {
|
|
2485
|
+
one: '{n} строка',
|
|
2486
|
+
few: '{n} строки',
|
|
2487
|
+
many: '{n} строк',
|
|
2488
|
+
other: '{n} строки'
|
|
2489
|
+
}
|
|
2189
2490
|
}
|
|
2190
2491
|
}; // The host's word wins, as it always did; the set's own fallback now follows
|
|
2191
2492
|
// the page's language instead of being Russian whatever the page is. `host` is
|
|
@@ -2702,10 +3003,13 @@ function renderChoiceView(field, value) {
|
|
|
2702
3003
|
const options = field.options || field.filter?.options || field.constraints?.options;
|
|
2703
3004
|
const option = Array.isArray(options) ? options.find(item => String(item?.value) === String(value)) : null;
|
|
2704
3005
|
if (!option) return lit__WEBPACK_IMPORTED_MODULE_0__.nothing;
|
|
2705
|
-
const badge = (0,_helpers_option_badge_js__WEBPACK_IMPORTED_MODULE_2__.optionBadgeProps)(option);
|
|
3006
|
+
const badge = (0,_helpers_option_badge_js__WEBPACK_IMPORTED_MODULE_2__.optionBadgeProps)(option); // A table cell is a dense place: the badge keeps the tight side room
|
|
3007
|
+
// (sf-badge tight), as it had before sf-badge 1.3.0 widened the default.
|
|
3008
|
+
|
|
2706
3009
|
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
2707
3010
|
<sf-badge
|
|
2708
3011
|
line=${VIEW_LINE}
|
|
3012
|
+
tight
|
|
2709
3013
|
appearance=${field.badgeAppearance ?? CELL_BADGE_APPEARANCE}
|
|
2710
3014
|
scheme=${badge.scheme}
|
|
2711
3015
|
style=${badge.rootStyle || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
@@ -3031,12 +3335,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3031
3335
|
/* harmony export */ modesOf: () => (/* binding */ modesOf)
|
|
3032
3336
|
/* harmony export */ });
|
|
3033
3337
|
// The registry of universal properties (owner, 2026-10-15): every property
|
|
3034
|
-
// type the Framework renders,
|
|
3035
|
-
//
|
|
3036
|
-
//
|
|
3037
|
-
// from the renderers' source. Which
|
|
3038
|
-
// is
|
|
3039
|
-
//
|
|
3338
|
+
// type the Framework renders, or a component set renders beside it (`set`),
|
|
3339
|
+
// its variants and the parameters a field of it reads -- one list a host
|
|
3340
|
+
// (Larena's fields and settings), the property workbench and the documentation
|
|
3341
|
+
// read, instead of each learning the types from the renderers' source. Which
|
|
3342
|
+
// modes a type has is not written here: it is read from the renderer maps
|
|
3343
|
+
// themselves (modesOf), so the registry cannot claim a mode the set does not
|
|
3344
|
+
// draw. A contract keeps the two the same.
|
|
3040
3345
|
//
|
|
3041
3346
|
// `params` are the field keys the type's renderers read -- each one, and no
|
|
3042
3347
|
// other (the probe field-renderer-params calls them with a field that records
|
|
@@ -3291,6 +3596,58 @@ const PROPERTY_TYPES = Object.freeze([{
|
|
|
3291
3596
|
},
|
|
3292
3597
|
variants: [],
|
|
3293
3598
|
params: ['language', 'required', 'readonly']
|
|
3599
|
+
}, // The types a component set draws (property-view port 1.18.0; Larena
|
|
3600
|
+
// property types standard, notes of 2026-11-03): `set` names the set whose
|
|
3601
|
+
// components show and edit them -- the View set's sf-view-properties and
|
|
3602
|
+
// sf-view-flow -- and the Framework draws their table cells and filters
|
|
3603
|
+
// (money and percent as numbers, items by its number of rows). `params` are
|
|
3604
|
+
// the keys the type reads, in the set's renderers and in these. Every
|
|
3605
|
+
// number is a decimal string, never a float.
|
|
3606
|
+
{
|
|
3607
|
+
type: 'money',
|
|
3608
|
+
label: {
|
|
3609
|
+
ru: 'Деньги',
|
|
3610
|
+
en: 'Money'
|
|
3611
|
+
},
|
|
3612
|
+
set: 'view',
|
|
3613
|
+
variants: [],
|
|
3614
|
+
params: ['currency', 'min', 'max', 'required', 'readonly']
|
|
3615
|
+
}, {
|
|
3616
|
+
type: 'percent',
|
|
3617
|
+
label: {
|
|
3618
|
+
ru: 'Процент',
|
|
3619
|
+
en: 'Percent'
|
|
3620
|
+
},
|
|
3621
|
+
set: 'view',
|
|
3622
|
+
variants: [],
|
|
3623
|
+
params: ['min', 'max', 'required', 'readonly']
|
|
3624
|
+
}, {
|
|
3625
|
+
type: 'items',
|
|
3626
|
+
label: {
|
|
3627
|
+
ru: 'Строки',
|
|
3628
|
+
en: 'Rows'
|
|
3629
|
+
},
|
|
3630
|
+
set: 'view',
|
|
3631
|
+
variants: [],
|
|
3632
|
+
params: ['columns', 'minRows', 'maxRows', 'required', 'readonly']
|
|
3633
|
+
}, {
|
|
3634
|
+
type: 'compound',
|
|
3635
|
+
label: {
|
|
3636
|
+
ru: 'Составное',
|
|
3637
|
+
en: 'Compound'
|
|
3638
|
+
},
|
|
3639
|
+
set: 'view',
|
|
3640
|
+
variants: [],
|
|
3641
|
+
params: ['parts', 'required', 'readonly']
|
|
3642
|
+
}, {
|
|
3643
|
+
type: 'ru.requisites',
|
|
3644
|
+
label: {
|
|
3645
|
+
ru: 'Реквизиты',
|
|
3646
|
+
en: 'Requisites (Russia)'
|
|
3647
|
+
},
|
|
3648
|
+
set: 'view',
|
|
3649
|
+
variants: [],
|
|
3650
|
+
params: ['parts', 'required', 'readonly']
|
|
3294
3651
|
}]); // The modes a type has, read from the renderer maps: view and edit (a record),
|
|
3295
3652
|
// cell (a table) and filter -- `own` when the set has a filter control for the
|
|
3296
3653
|
// type, `text` when a filter falls back to a text search.
|
|
@@ -11944,7 +12301,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"$comment":"Dated aliases of sf-view-
|
|
|
11944
12301
|
/***/ "3ea81f4c3c20"
|
|
11945
12302
|
(module) {
|
|
11946
12303
|
|
|
11947
|
-
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.11.
|
|
12304
|
+
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.11.1","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}');
|
|
11948
12305
|
|
|
11949
12306
|
/***/ },
|
|
11950
12307
|
|
|
Binary file
|