@simai-studio/view 1.1.0 → 1.3.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 +5 -5
- package/dist/package-receipt.json +322 -81
- package/dist/set.json +35 -2
- package/dist/smart/rule.js +94 -0
- package/dist/smart/rule.js.gz +0 -0
- package/dist/smart/view/component.json +1 -1
- package/dist/smart/view/component.json.gz +0 -0
- package/dist/smart/view/js/view.js +1 -1
- 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 +1 -1
- 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/component.json +620 -0
- package/dist/smart/view-flow/component.json.gz +0 -0
- package/dist/smart/view-flow/css/view-flow.css +570 -0
- package/dist/smart/view-flow/css/view-flow.css.gz +0 -0
- package/dist/smart/view-flow/css/view-flow.min.css +3 -0
- package/dist/smart/view-flow/css/view-flow.min.css.gz +0 -0
- package/dist/smart/view-flow/examples.json +452 -0
- package/dist/smart/view-flow/examples.json.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.js +7406 -0
- package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.min.js +749 -0
- package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
- package/dist/smart/view-flow/lang/en.json +24 -0
- package/dist/smart/view-flow/lang/en.json.gz +0 -0
- package/dist/smart/view-flow/lang/ru.json +24 -0
- package/dist/smart/view-flow/lang/ru.json.gz +0 -0
- package/dist/smart/view-flow/probe.json +149 -0
- package/dist/smart/view-flow/probe.json.gz +0 -0
- package/dist/smart/view-flow/smart.manifest.json +486 -0
- package/dist/smart/view-flow/smart.manifest.json.gz +0 -0
- package/dist/smart/view-flow/static/default/answered.html +57 -0
- package/dist/smart/view-flow/static/default/answered.html.gz +0 -0
- package/dist/smart/view-flow/static/default/ask.html +146 -0
- package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
- package/dist/smart/view-flow/static/default/expired.html +16 -0
- package/dist/smart/view-flow/static/default/expired.html.gz +0 -0
- package/dist/smart/view-flow/static/default/groups.html +44 -0
- package/dist/smart/view-flow/static/default/groups.html.gz +0 -0
- package/dist/smart/view-flow/static/default/reference.html +72 -0
- package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
- package/dist/smart/view-flow/static/default/untitled.html +41 -0
- package/dist/smart/view-flow/static/default/untitled.html.gz +0 -0
- package/dist/smart/view-flow/static/sheets.json +443 -0
- package/dist/smart/view-flow/static/sheets.json.gz +0 -0
- package/dist/smart/view-flow/template/default.css +180 -0
- package/dist/smart/view-flow/template/default.css.gz +0 -0
- package/dist/smart/view-flow/template/default.js +136 -0
- package/dist/smart/view-flow/template/default.js.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 +367 -0
- package/dist/smart/view-properties/css/view-properties.css.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.min.css +1 -0
- package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.js +1755 -169
- package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.min.js +491 -378
- package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
- package/dist/smart/view-properties/smart.manifest.json +38 -3
- package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
- package/dist/smart/view-properties/template/default.js +1 -77
- package/dist/smart/view-properties/template/default.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.js +2 -0
- package/dist/smart/view-table/js/view-table.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.min.js +2 -0
- package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
- package/package.json +1 -1
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 2,
|
|
3
3
|
"id": "smart.view-properties",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.11.0",
|
|
5
5
|
"title": "Property view",
|
|
6
6
|
"summary": "One object's fields shown as sections, groups and fields, each drawn by the per-type field renderer set, behind a separate host port. A group is edited and saved as one revision by the button, and a reference field is picked from the host's own candidates a page at a time. The pair to the data view: that one is a set of records, this one is a single object.",
|
|
7
7
|
"kind": "composite",
|
|
@@ -1532,6 +1532,13 @@
|
|
|
1532
1532
|
"changes": [
|
|
1533
1533
|
"A datetime or time field is one sf-input-date (mode datetime or time) instead of a day and a masked time field; the value written is the same ISO 8601. Dates the host does not format read in the page's language. A colour palette wraps in a half-width field. A closed panel shows no close button or shadow over the page. An entry put back to the stored value is not written. Nothing to change for a host; a host that read the pair's names («<label>: дата», «<label>: время») finds one control named by the label."
|
|
1534
1534
|
]
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
"from": "1.10.1",
|
|
1538
|
+
"to": "1.11.0",
|
|
1539
|
+
"changes": [
|
|
1540
|
+
"The set draws five property types itself, from Framework controls: money {amount, currency} (an amount with the currency's sign, or a currency choice; minor digits by ISO 4217), percent (a decimal with %), items (rows over the field's columns: typed cells, computed cells worked out live, totals, rows added, removed and moved, min and max rows, a card a row where the field is narrow), compound (a fixed set of parts, one value object) and ru.requisites (ИНН, КПП, ОГРН, БИК, accounts, checked part by part and together). Every number is a decimal string, never a float. An entry that is not a value yet holds both saves, as an incomplete masked string does. The settings they read (currency, columns, minRows, maxRows, parts) are due in simai.property-view-port 1.18.0. Nothing changes for a host that sends none of these types."
|
|
1541
|
+
]
|
|
1535
1542
|
}
|
|
1536
1543
|
]
|
|
1537
1544
|
},
|
|
@@ -1545,7 +1552,7 @@
|
|
|
1545
1552
|
},
|
|
1546
1553
|
{
|
|
1547
1554
|
"path": "src/smart/view-properties/js/templates/default.js",
|
|
1548
|
-
"sha256": "
|
|
1555
|
+
"sha256": "f279e28558ccf50841b59c311ac39f8861f78e43bcce333eb4501d38aac6048b"
|
|
1549
1556
|
},
|
|
1550
1557
|
{
|
|
1551
1558
|
"path": "src/smart/view-properties/js/templates/default.css",
|
|
@@ -1555,6 +1562,34 @@
|
|
|
1555
1562
|
"path": "src/smart/view-properties/js/conditions.js",
|
|
1556
1563
|
"sha256": "bf48b0bf4d2affb43433d1142b1a0ca57e22dc26088c5bd0b28e3212fba7134b"
|
|
1557
1564
|
},
|
|
1565
|
+
{
|
|
1566
|
+
"path": "src/smart/view-properties/js/field-value.js",
|
|
1567
|
+
"sha256": "aa04dbf2f3f8a979966af613c82e2bcffa13020371a5884f88728f50c1145b8e"
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
"path": "src/smart/view-properties/js/requisites.js",
|
|
1571
|
+
"sha256": "66ebd2f8c9428feea6e36a18ec3c2eae62278d5ee8d9e8d4d5a562ab5a819bcf"
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
"path": "src/smart/view-properties/js/decimal.js",
|
|
1575
|
+
"sha256": "02c0ee50c08423cca425834fc3a6b8f717313764af36b3cd890c08d0643e7abc"
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
"path": "src/smart/view-properties/js/rows.js",
|
|
1579
|
+
"sha256": "80eacb056aa8fd40682697fd89f1d8eabe1ae3646dda8ecf164d595ea8abef5c"
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
"path": "src/smart/view-properties/js/money.js",
|
|
1583
|
+
"sha256": "8e7ba7bab391daf9f28e403bee2a3e3f2fd2ad1ec11742421fceff0d18b0c188"
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
"path": "src/smart/view-properties/js/set-fields.css",
|
|
1587
|
+
"sha256": "dc40d576e3fec0d8b0ae598c415149d85b8d5fc000e15aaa578093cae6545bff"
|
|
1588
|
+
},
|
|
1589
|
+
{
|
|
1590
|
+
"path": "src/smart/view-properties/js/set-fields.js",
|
|
1591
|
+
"sha256": "f2b67678f0c498b2355cb5b1233ab903ca8cb089c05244e09c760e049e89c815"
|
|
1592
|
+
},
|
|
1558
1593
|
{
|
|
1559
1594
|
"path": "src/smart/view-properties/rule.js",
|
|
1560
1595
|
"sha256": "e23c095e11f5f42de3bad05a8d347f668c947dad90018994e3ef334832e1b887"
|
|
@@ -1565,7 +1600,7 @@
|
|
|
1565
1600
|
},
|
|
1566
1601
|
{
|
|
1567
1602
|
"path": "src/smart/view-properties/docs.md",
|
|
1568
|
-
"sha256": "
|
|
1603
|
+
"sha256": "e66515f627d9a8515807d01dd7d6d3c172f5da4e7aab6ef0cb53a9b02c51052d"
|
|
1569
1604
|
}
|
|
1570
1605
|
],
|
|
1571
1606
|
"generated_runtime": []
|
|
Binary file
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {html, nothing} from 'lit';
|
|
2
2
|
import "./default.css";
|
|
3
3
|
import {renderViewField, renderEditField} from '../../../field-renderers/index.js';
|
|
4
|
+
import {renderFieldValue} from '../field-value.js';
|
|
4
5
|
|
|
5
6
|
// The arrangement, drawn in the component's own light DOM. Not in a shadow root:
|
|
6
7
|
// the field controls are Smart elements whose stylesheets are document-level, and
|
|
@@ -9,83 +10,6 @@ import {renderViewField, renderEditField} from '../../../field-renderers/index.j
|
|
|
9
10
|
// of this composite built them inside a shadow root and every control came out
|
|
10
11
|
// with its markup and none of its CSS.
|
|
11
12
|
|
|
12
|
-
function renderFieldValue(context, field, editing, {disabled = false} = {}) {
|
|
13
|
-
const key = String(field.key ?? '');
|
|
14
|
-
const editHost = {
|
|
15
|
-
setFieldValue: (target, value) => context.component.changeField(target, value),
|
|
16
|
-
// A control that knows its entry is not a value yet says so here (port
|
|
17
|
-
// 1.16.0: a masked string that does not fill its mask); the view holds
|
|
18
|
-
// both saves until it is completed or cleared.
|
|
19
|
-
setFieldError: (target, message) => context.component.reportFieldError(target, message),
|
|
20
|
-
...(context.canUploadFiles
|
|
21
|
-
? {
|
|
22
|
-
getFieldUploads: (target) => context.component.getFieldUploads(target),
|
|
23
|
-
startFieldUpload: (target, items) => context.component.startFieldUpload(target, items),
|
|
24
|
-
retryFieldUpload: (target, index) => context.component.retryFieldUpload(target, index),
|
|
25
|
-
}
|
|
26
|
-
: {}),
|
|
27
|
-
...(context.canPickRecords
|
|
28
|
-
? {
|
|
29
|
-
getFieldOptionsPage: (target) => context.component.getFieldOptionsPage(target),
|
|
30
|
-
getFieldOptionSearch: (target) => context.component.getFieldOptionSearch(target),
|
|
31
|
-
setFieldOptionSearch: (target, text) => context.component.setFieldOptionSearch(target, text),
|
|
32
|
-
loadFieldOptions: (target, request) => context.component.loadFieldOptions(target, request),
|
|
33
|
-
}
|
|
34
|
-
: {}),
|
|
35
|
-
};
|
|
36
|
-
// A datetime and a time of day are the renderer set's: sf-input-date in
|
|
37
|
-
// mode datetime and time, one control each (SIMAI Framework duplication
|
|
38
|
-
// audit A-14). This view drew its own pair -- the day in a datepicker and
|
|
39
|
-
// the time in a masked field -- which cut the day short in a half-width
|
|
40
|
-
// field and held half-typed entries of its own.
|
|
41
|
-
const content = editing
|
|
42
|
-
? renderEditField(
|
|
43
|
-
field,
|
|
44
|
-
context.changed.has(key) ? context.changed.get(key) : field.value,
|
|
45
|
-
editHost,
|
|
46
|
-
// A field its condition turns off is drawn disabled where the set
|
|
47
|
-
// draws disabled apart from read-only (a choice as buttons).
|
|
48
|
-
{size: context.size, ...(disabled ? {disabled: true} : {})},
|
|
49
|
-
)
|
|
50
|
-
: renderViewField(field, field.value, context.viewHost, {size: context.size});
|
|
51
|
-
|
|
52
|
-
const reference = ['record', 'relation', 'user'].includes(field.propertyType || field.type)
|
|
53
|
-
&& field.value && typeof field.value === 'object';
|
|
54
|
-
if (!editing && reference && content) {
|
|
55
|
-
return html`<span
|
|
56
|
-
class="sf-property-view-reference"
|
|
57
|
-
@click=${(event) => {
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
// And no further: the field in view is a button that opens
|
|
60
|
-
// the group for editing, so a press that reached it put the
|
|
61
|
-
// whole group into edit behind the record that had just
|
|
62
|
-
// opened (owner, 2026-10-08). Following a reference is one
|
|
63
|
-
// intent, not two.
|
|
64
|
-
event.stopPropagation();
|
|
65
|
-
context.component.openReference(field, field.value);
|
|
66
|
-
}}
|
|
67
|
-
>${content}</span>`;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// An edit control the set cannot build is not an empty value. record and
|
|
71
|
-
// relation have no editor until the picker's host methods exist, and the
|
|
72
|
-
// first version showed «не заполнено» over a field that had a value -- a
|
|
73
|
-
// consumer read it as the value having been lost. Fall back to the view, so
|
|
74
|
-
// the value is shown and plainly not editable yet.
|
|
75
|
-
if (editing && (content === null || typeof content === 'undefined' || content === nothing)) {
|
|
76
|
-
const shown = renderViewField(field, field.value, context.viewHost, {size: context.size});
|
|
77
|
-
if (shown !== null && typeof shown !== 'undefined' && shown !== nothing) {
|
|
78
|
-
return html`<span class="sf-property-view-readonly color-on-surface-variant" data-readonly="true">${shown}</span>`;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (content === null || typeof content === 'undefined' || content === nothing) {
|
|
83
|
-
return html`<span class="sf-property-view-empty color-on-surface-variant">${context.emptyText}</span>`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return content;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
13
|
// While the view is being configured every entry is listed, hidden and rare ones
|
|
90
14
|
// included: a hidden field a person cannot see is a field they cannot show again,
|
|
91
15
|
// and «показать редкие поля» is a reading choice rather than part of the
|
|
Binary file
|
|
@@ -2268,6 +2268,7 @@ function renderChoiceEdit(field, value, host) {
|
|
|
2268
2268
|
name=${fieldName(field)}
|
|
2269
2269
|
?required=${Boolean(field.required)}
|
|
2270
2270
|
value=${value ?? ''}
|
|
2271
|
+
placeholder=${field.placeholder || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
2271
2272
|
aria-label=${field.label || field.key || ''}
|
|
2272
2273
|
.options=${editOptions(field, value, false)}
|
|
2273
2274
|
@change=${event => host.setFieldValue(field, event.detail?.value ?? null)}
|
|
@@ -2321,6 +2322,7 @@ function renderChoicesEdit(field, value, host) {
|
|
|
2321
2322
|
search="false"
|
|
2322
2323
|
name=${fieldName(field)}
|
|
2323
2324
|
?required=${Boolean(field.required)}
|
|
2325
|
+
placeholder=${field.placeholder || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
2324
2326
|
aria-label=${field.label || field.key || ''}
|
|
2325
2327
|
.options=${editOptions(field, value, true)}
|
|
2326
2328
|
@change=${event => {
|
|
Binary file
|
|
@@ -380,6 +380,7 @@
|
|
|
380
380
|
name=${J(e)}
|
|
381
381
|
?required=${Boolean(e.required)}
|
|
382
382
|
value=${t??""}
|
|
383
|
+
placeholder=${e.placeholder||i.nothing}
|
|
383
384
|
aria-label=${e.label||e.key||""}
|
|
384
385
|
.options=${ke(e,t,!1)}
|
|
385
386
|
@change=${t=>n.setFieldValue(e,t.detail?.value??null)}
|
|
@@ -402,6 +403,7 @@
|
|
|
402
403
|
search="false"
|
|
403
404
|
name=${J(e)}
|
|
404
405
|
?required=${Boolean(e.required)}
|
|
406
|
+
placeholder=${e.placeholder||i.nothing}
|
|
405
407
|
aria-label=${e.label||e.key||""}
|
|
406
408
|
.options=${ke(e,t,!0)}
|
|
407
409
|
@change=${t=>{const s=t.detail?.values??t.detail?.value;n.setFieldValue(e,Array.isArray(s)?s:s?[s]:[])}}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simai-studio/view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "SIMAI View, the component set view of SIMAI Framework: the data view sf-view, the smart table sf-view-table and the record card sf-view-properties.",
|
|
5
5
|
"license": "PolyForm-Small-Business-1.0.0 OR PolyForm-Noncommercial-1.0.0 OR LicenseRef-SIMAI-Commercial",
|
|
6
6
|
"author": "Rim Zabarov",
|