@simai-studio/view 1.1.0 → 1.2.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 +310 -69
- 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 +612 -0
- package/dist/smart/view-flow/component.json.gz +0 -0
- package/dist/smart/view-flow/css/view-flow.css +203 -0
- package/dist/smart/view-flow/css/view-flow.css.gz +0 -0
- package/dist/smart/view-flow/css/view-flow.min.css +2 -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 +5858 -0
- package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
- package/dist/smart/view-flow/js/view-flow.min.js +638 -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 +478 -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 +1 -1
- package/dist/smart/view-properties/component.json.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.js +59 -21
- package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.min.js +8 -6
- package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
- package/dist/smart/view-properties/smart.manifest.json +6 -2
- 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.10.
|
|
4
|
+
"version": "1.10.1",
|
|
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",
|
|
@@ -1545,7 +1545,7 @@
|
|
|
1545
1545
|
},
|
|
1546
1546
|
{
|
|
1547
1547
|
"path": "src/smart/view-properties/js/templates/default.js",
|
|
1548
|
-
"sha256": "
|
|
1548
|
+
"sha256": "f279e28558ccf50841b59c311ac39f8861f78e43bcce333eb4501d38aac6048b"
|
|
1549
1549
|
},
|
|
1550
1550
|
{
|
|
1551
1551
|
"path": "src/smart/view-properties/js/templates/default.css",
|
|
@@ -1555,6 +1555,10 @@
|
|
|
1555
1555
|
"path": "src/smart/view-properties/js/conditions.js",
|
|
1556
1556
|
"sha256": "bf48b0bf4d2affb43433d1142b1a0ca57e22dc26088c5bd0b28e3212fba7134b"
|
|
1557
1557
|
},
|
|
1558
|
+
{
|
|
1559
|
+
"path": "src/smart/view-properties/js/field-value.js",
|
|
1560
|
+
"sha256": "18194d28683ab6dc3f876cd4f39928745017b5e03f2abd310876c079ffe74188"
|
|
1561
|
+
},
|
|
1558
1562
|
{
|
|
1559
1563
|
"path": "src/smart/view-properties/rule.js",
|
|
1560
1564
|
"sha256": "e23c095e11f5f42de3bad05a8d347f668c947dad90018994e3ef334832e1b887"
|
|
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.2.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",
|