@itrocks/list 0.13.3 → 0.13.6
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 +28 -14
- package/cjs/access.d.ts +2 -0
- package/cjs/access.js.map +1 -1
- package/cjs/list.html +1 -1
- package/cjs/list.js +14 -7
- package/cjs/list.js.map +1 -1
- package/cjs/multiple-output.js +1 -3
- package/cjs/multiple-output.js.map +1 -1
- package/cjs/projection.d.ts +1 -0
- package/cjs/projection.js +17 -6
- package/cjs/projection.js.map +1 -1
- package/cjs/selector-state.d.ts +4 -0
- package/cjs/selector-state.js +10 -0
- package/cjs/selector-state.js.map +1 -1
- package/list.css +1 -1
- package/package.json +2 -1
- package/property-select.d.ts +3 -1
- package/property-select.js +76 -44
- package/selector-state.d.ts +6 -1
- package/selector-state.js +10 -1
package/README.md
CHANGED
|
@@ -152,11 +152,12 @@ missing representative fields fail explicitly. Plural paths through a relationsh
|
|
|
152
152
|
are refused before SQL.
|
|
153
153
|
|
|
154
154
|
Direct collections display representative values separated by commas. A collection decorated with
|
|
155
|
-
[`@Component()`](https://github.com/itrocks-ts/composition)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
[`@Component()`](https://github.com/itrocks-ts/composition) displays up to eight representative values separated by
|
|
156
|
+
commas. From nine values, it displays the count followed by the translated plural name of the destination type.
|
|
157
|
+
Component collections never render a nested table in a list cell. The optional
|
|
158
|
+
`@MultipleOutput('commas' | 'lines')` property decorator from `@itrocks/list/multiple-output` controls ordinary
|
|
159
|
+
collections; `'lines'` displays them as a list.
|
|
160
|
+
`multipleOutputOf(type, property)` returns the effective mode and inherits explicit property metadata. For example:
|
|
160
161
|
|
|
161
162
|
```ts
|
|
162
163
|
import { MultipleOutput } from '@itrocks/list/multiple-output'
|
|
@@ -190,10 +191,12 @@ The browser entry `@itrocks/list/property-select.js` exports `ListPropertySelect
|
|
|
190
191
|
addition, column persistence and narrow pane ports. The framework mounts it only on compatible lists and disposes it on
|
|
191
192
|
navigation. It reserves pending paths, confirms accepted additions, reveals/highlights duplicates without moving focus,
|
|
192
193
|
and checks row identity before insertion. Failed selection leaves the context intact. It loads only currently visible
|
|
193
|
-
row ids; changing the row view while loading rejects the obsolete response with a
|
|
194
|
-
|
|
195
|
-
table
|
|
196
|
-
|
|
194
|
+
row ids through the current feed position; changing the row view while loading rejects the obsolete response with a
|
|
195
|
+
retry message. Clicks and desktop drags create empty columns and immediately load values asynchronously through the
|
|
196
|
+
public table transaction. A new dragged column stays hidden until the pointer first enters the table, so its values can
|
|
197
|
+
arrive before it appears. Drag admission waits for drop.
|
|
198
|
+
Existing-column moves and removals only save the column configuration. The header contains each label and its filter
|
|
199
|
+
together, so it uses the table addition plugin's single-header contract.
|
|
197
200
|
|
|
198
201
|
`npm test` runs the server contracts; `test/property-select.test.mjs` covers projection, representation, scope, path
|
|
199
202
|
configuration, filters and ordering. Real framework/browser proof is tracked by the property-select L2-LIST delivery.
|
|
@@ -212,15 +215,21 @@ do not affect it. The rendered article supplies this opaque key to the browser.
|
|
|
212
215
|
Writes echo the opaque `X-Property-Select-Session` token returned by a read. It cannot identify or authenticate a user;
|
|
213
216
|
it prevents a mounted selector from writing its old state into a new session.
|
|
214
217
|
|
|
218
|
+
The initial HTML response carries the configured selector bootstrap, including metadata, template, state revision
|
|
219
|
+
and session generation. Mounting consumes this snapshot without application requests or state writes. Metadata is
|
|
220
|
+
shared by navigation, suggestions and selection; unchanged column paths do not rebuild suggestions.
|
|
221
|
+
|
|
215
222
|
The public browser `@itrocks/list/selector-state.js` exports `HttpStateStore`, using same-origin credentials and
|
|
216
|
-
no-store requests. `
|
|
217
|
-
|
|
223
|
+
no-store requests. Its optional third constructor argument `{ generation, key, record }` supplies the initial read;
|
|
224
|
+
subsequent reads, including conflict recovery, use the server. `ListSelectorOptions.advice` supplies configured
|
|
225
|
+
destinations. List column changes refresh used paths; only a confirmed new addition feeds the selector's recents.
|
|
226
|
+
The browser displays recoverable persistence errors.
|
|
218
227
|
|
|
219
228
|
## External column transport
|
|
220
229
|
|
|
221
|
-
The list consumer supplies immediate cells, authorises admission and loads
|
|
222
|
-
projection/rendering route used for click additions. `validate=1` on a `column` request checks representation
|
|
223
|
-
permission without selecting records; it prevents unsupported object and nested plural paths from being confirmed
|
|
230
|
+
The list consumer supplies immediate empty cells, authorises admission and loads all currently loaded row ids through
|
|
231
|
+
the same projection/rendering route used for click additions. `validate=1` on a `column` request checks representation
|
|
232
|
+
and permission without selecting records; it prevents unsupported object and nested plural paths from being confirmed
|
|
224
233
|
on drop.
|
|
225
234
|
Admission is independent of the optional values request. A slow or failed values request leaves valid drops accepted;
|
|
226
235
|
failed cells expose `Retry values` without another addition or recent entry.
|
|
@@ -234,3 +243,8 @@ The consumer requests `pane.suspend({ mobileOnly: true })` only when a source ge
|
|
|
234
243
|
host owns its responsive breakpoint. The token is restored after acceptance and column persistence, or after
|
|
235
244
|
cancellation/rejection; it never focuses the search field. View disposal removes the registration and invalidates late
|
|
236
245
|
restoration. Custom pane adapters may implement the same optional suspension argument without importing `home`.
|
|
246
|
+
|
|
247
|
+
`node test/browser-requests.mjs` checks request counts and real mouse gestures in Chromium with synthetic HTTP data.
|
|
248
|
+
It covers initial mount, click placeholders, hidden drag preloading, reveal on table entry, values for 80 loaded rows,
|
|
249
|
+
outside cancellation, duplicates, reordering and removal.
|
|
250
|
+
Set `PS_PLAYWRIGHT_MODULE` to an installed Playwright module when using a different runtime.
|
package/cjs/access.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Request } from '@itrocks/action-request';
|
|
2
|
+
import type { StateRecord } from '@itrocks/property-select';
|
|
2
3
|
export type ListAccess = {
|
|
3
4
|
authorise(path: string): Promise<void>;
|
|
5
|
+
bootstrap?(paths: string[], state: StateRecord): Promise<object>;
|
|
4
6
|
root?: string;
|
|
5
7
|
};
|
|
6
8
|
export type ListDependencies = {
|
package/cjs/access.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.js","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"access.js","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":";;AAYA,sCAGC;AAED,gCAGC;AAVD,MAAM,YAAY,GAAqB,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE,CAAC,EAAE,CAAA;AAE9F,SAAgB,aAAa,CAAC,SAAoC;IAEjE,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;AACvC,CAAC;AAED,SAAgB,UAAU,CAAC,OAAgB;IAE1C,OAAO,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACpC,CAAC"}
|
package/cjs/list.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<!--#main-->
|
|
17
17
|
<article data-action="list" data-class="{type.name}" data-route="{type.@route}" data-property-root="{?root}"
|
|
18
|
-
data-selector-key="{?selectorKey}">
|
|
18
|
+
data-selector-key="{?selectorKey}" data-selector-bootstrap="{?selectorBootstrap}">
|
|
19
19
|
<header>
|
|
20
20
|
<h2>{type.@output.ucFirst} list</h2>
|
|
21
21
|
<button class="add-column" hidden type="button" aria-label="Add column">+</button>
|
package/cjs/list.js
CHANGED
|
@@ -52,11 +52,12 @@ const persist_1 = require("./persist");
|
|
|
52
52
|
const persist_2 = require("./persist");
|
|
53
53
|
const projection_1 = require("./projection");
|
|
54
54
|
const selector_state_1 = require("./selector-state");
|
|
55
|
+
const selector_state_2 = require("./selector-state");
|
|
55
56
|
const sort_1 = require("./sort");
|
|
56
57
|
var access_2 = require("./access");
|
|
57
58
|
Object.defineProperty(exports, "listDependsOn", { enumerable: true, get: function () { return access_2.listDependsOn; } });
|
|
58
59
|
let List = (() => {
|
|
59
|
-
let _classDecorators = [(0,
|
|
60
|
+
let _classDecorators = [(0, action_2.Need)('Store', 'new'), (0, route_1.Route)('/list')];
|
|
60
61
|
let _classDescriptor;
|
|
61
62
|
let _classExtraInitializers = [];
|
|
62
63
|
let _classThis;
|
|
@@ -116,7 +117,7 @@ let List = (() => {
|
|
|
116
117
|
const ids = request.request.data.rowIds;
|
|
117
118
|
if (typeof ids !== 'string')
|
|
118
119
|
throw new Error('Visible row identities are required');
|
|
119
|
-
const result = await (0, columns_2.projectColumns)(type, [column], search, [new
|
|
120
|
+
const result = await (0, columns_2.projectColumns)(type, [column], search, [new storage_1.Identifiers(ids ? ids.split(',') : [])]);
|
|
120
121
|
return this.jsonResponse({
|
|
121
122
|
label: column.label, path, sortable: column.sortable,
|
|
122
123
|
rows: await Promise.all(result.rows.map(async (row) => ({
|
|
@@ -125,7 +126,7 @@ let List = (() => {
|
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
catch (error) {
|
|
128
|
-
const message = error instanceof
|
|
129
|
+
const message = error instanceof storage_2.SelectionError && error.code === 'multiple-values'
|
|
129
130
|
? 'This path has multiple values and cannot be displayed as a column.'
|
|
130
131
|
: error instanceof Error ? error.message : 'Column unavailable';
|
|
131
132
|
return this.jsonResponse({ error: message }, 400);
|
|
@@ -135,19 +136,25 @@ let List = (() => {
|
|
|
135
136
|
if (feed.offset) {
|
|
136
137
|
return this.htmlTemplateResponse({ objects, type }, request, feed.template);
|
|
137
138
|
}
|
|
138
|
-
const count = await (0,
|
|
139
|
+
const count = await (0, storage_3.dataSource)().count(type, search);
|
|
139
140
|
const route = (0, route_2.routeOf)(this);
|
|
140
141
|
const generalActions = [];
|
|
141
142
|
const selectionActions = [];
|
|
142
|
-
for (const action of (0,
|
|
143
|
+
for (const action of (0, action_3.getActions)(type, route.slice(route.lastIndexOf('/') + 1))) {
|
|
143
144
|
const actions = (action.need === 'object') ? selectionActions : generalActions;
|
|
144
145
|
actions.push(action);
|
|
145
146
|
}
|
|
147
|
+
let selectorBootstrap;
|
|
148
|
+
if (access.bootstrap) {
|
|
149
|
+
const state = await (0, selector_state_1.selectorStateBootstrap)(request);
|
|
150
|
+
const metadata = await access.bootstrap([...columns].map(column => column.name), state.record);
|
|
151
|
+
selectorBootstrap = encodeURIComponent(JSON.stringify({ ...state, ...metadata }));
|
|
152
|
+
}
|
|
146
153
|
return this.htmlTemplateResponse({ columns, count, generalActions, objects, root: access.root, search: filter.search,
|
|
147
|
-
selectionActions, selectorKey: (0,
|
|
154
|
+
selectionActions, selectorBootstrap, selectorKey: (0, selector_state_2.selectorStateKey)(request), type }, request, __dirname + '/list.html');
|
|
148
155
|
}
|
|
149
156
|
async json(request, scope) {
|
|
150
|
-
const objects = await (0,
|
|
157
|
+
const objects = await (0, storage_3.dataSource)().search(request.type, scope);
|
|
151
158
|
return this.jsonResponse(objects);
|
|
152
159
|
}
|
|
153
160
|
};
|
package/cjs/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAwD;AAExD,4CAAwD;AACxD,4CAAwD;AAExD,0CAAuD;AACvD,0CAAuD;AACvD,8CAAyD;AAEzD,8CAAyD;AACzD,8CAAyD;AACzD,qCAAiD;AACjD,uCAAkD;AAClD,uCAAkD;AAClD,iCAA+C;AAC/C,qCAAiD;AACjD,uCAAkD;AAClD,uCAAkD;AAClD,6CAAqD;AACrD,qDAAyD;AACzD,qDAAyD;AACzD,iCAA+C;AAE/C,mCAAwC;AAA/B,uGAAA,aAAa,OAAA;IAKT,IAAI;4BAFhB,IAAA,aAAI,EAAC,OAAO,EAAE,KAAK,CAAC,EACpB,IAAA,aAAK,EAAC,OAAO,CAAC;;;;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utput;
|
|
4
4
|
exports.multipleOutputOf = multipleOutputOf;
|
|
5
|
-
const composition_1 = require("@itrocks/composition");
|
|
6
5
|
const property_1 = require("@itrocks/decorator/property");
|
|
7
6
|
const property_2 = require("@itrocks/decorator/property");
|
|
8
7
|
const MULTIPLE_OUTPUT = Symbol('multiple-output');
|
|
@@ -10,7 +9,6 @@ function MultipleOutput(mode) {
|
|
|
10
9
|
return (0, property_1.decorate)(MULTIPLE_OUTPUT, mode);
|
|
11
10
|
}
|
|
12
11
|
function multipleOutputOf(target, property) {
|
|
13
|
-
return (0, property_2.decoratorOf)(target, property, MULTIPLE_OUTPUT)
|
|
14
|
-
?? ((0, composition_1.componentOf)(target, property) ? 'lines' : 'commas');
|
|
12
|
+
return (0, property_2.decoratorOf)(target, property, MULTIPLE_OUTPUT) ?? 'commas';
|
|
15
13
|
}
|
|
16
14
|
//# sourceMappingURL=multiple-output.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiple-output.js","sourceRoot":"","sources":["../src/multiple-output.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"multiple-output.js","sourceRoot":"","sources":["../src/multiple-output.ts"],"names":[],"mappings":";;AAQA,wCAGC;AAED,4CAGC;AAfD,0DAA0D;AAC1D,0DAA0D;AAI1D,MAAM,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;AAEjD,SAAgB,cAAc,CAAmB,IAAwB;IAExE,OAAO,IAAA,mBAAQ,EAAI,eAAe,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC;AAED,SAAgB,gBAAgB,CAAmB,MAAuB,EAAE,QAAiB;IAE5F,OAAO,IAAA,sBAAW,EAAoC,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,QAAQ,CAAA;AACrG,CAAC"}
|
package/cjs/projection.d.ts
CHANGED
package/cjs/projection.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.listRepresentationDependsOn = listRepresentationDependsOn;
|
|
|
5
5
|
exports.representationFields = representationFields;
|
|
6
6
|
const class_view_1 = require("@itrocks/class-view");
|
|
7
7
|
const class_view_2 = require("@itrocks/class-view");
|
|
8
|
+
const class_view_3 = require("@itrocks/class-view");
|
|
8
9
|
const composition_1 = require("@itrocks/composition");
|
|
9
10
|
const core_transformers_1 = require("@itrocks/core-transformers");
|
|
10
11
|
const core_transformers_2 = require("@itrocks/core-transformers");
|
|
@@ -12,6 +13,7 @@ const property_view_1 = require("@itrocks/property-view");
|
|
|
12
13
|
const reflect_path_1 = require("@itrocks/reflect-path");
|
|
13
14
|
const reflect_path_2 = require("@itrocks/reflect-path");
|
|
14
15
|
const storage_1 = require("@itrocks/storage");
|
|
16
|
+
const translate_1 = require("@itrocks/translate");
|
|
15
17
|
const transformer_1 = require("@itrocks/transformer");
|
|
16
18
|
const transformer_2 = require("@itrocks/transformer");
|
|
17
19
|
const transformer_3 = require("@itrocks/transformer");
|
|
@@ -28,7 +30,7 @@ function representationFields(type, ancestors = [], property) {
|
|
|
28
30
|
const fields = dependencies.fields?.(type, branch, property);
|
|
29
31
|
if (!fields && property && (0, transformer_4.resolveTransformer)(property.class.type, property.name, transformer_2.HTML, transformer_3.OUTPUT) !== core_transformers_2.storeOutput)
|
|
30
32
|
throw new storage_1.SelectionError('unsupported-selection', 'Undeclared custom object representation');
|
|
31
|
-
return (fields ?? (0,
|
|
33
|
+
return (fields ?? (0, class_view_2.representativeOf)(type).map(String)).flatMap(path => {
|
|
32
34
|
const resolved = (0, reflect_path_2.resolvePropertyPath)(type, path);
|
|
33
35
|
if (resolved.targetMultiplicity !== 'one')
|
|
34
36
|
throw new storage_1.SelectionError('unsupported-selection', path);
|
|
@@ -45,6 +47,7 @@ class ListColumn {
|
|
|
45
47
|
multiple;
|
|
46
48
|
property;
|
|
47
49
|
sortable;
|
|
50
|
+
target;
|
|
48
51
|
reverse = false;
|
|
49
52
|
search = '';
|
|
50
53
|
sort;
|
|
@@ -59,7 +62,8 @@ class ListColumn {
|
|
|
59
62
|
throw new storage_1.SelectionError(resolved.targetMultiplicity === 'many' ? 'multiple-values' : 'unsupported-selection', name);
|
|
60
63
|
}
|
|
61
64
|
this.property = new reflect_path_1.ReflectPropertyPath(root, name);
|
|
62
|
-
this.
|
|
65
|
+
this.target = resolved.target;
|
|
66
|
+
this.label = resolved.segments.map(property => (0, translate_1.tr)((0, property_view_1.displayOf)(property.class.type, property.name))).join('.');
|
|
63
67
|
if (resolved.target && !this.multiple)
|
|
64
68
|
this.fields = representationFields(resolved.target, [], resolved.property);
|
|
65
69
|
}
|
|
@@ -70,11 +74,18 @@ class ListColumn {
|
|
|
70
74
|
return '<span class="unavailable">Unavailable</span>';
|
|
71
75
|
if (this.fields && this.fields.some(field => !cell.loadedFields?.includes(field)))
|
|
72
76
|
throw new storage_1.SelectionError('unsupported-selection', this.name);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
if (this.multiple && (0, composition_1.componentOf)(this.property.class.type, this.property.name)) {
|
|
78
|
+
const values = cell.value;
|
|
79
|
+
if (values.length >= 9) {
|
|
80
|
+
const name = this.target
|
|
81
|
+
? (0, class_view_1.displayOf)(this.target)
|
|
82
|
+
: (0, property_view_1.displayOf)(this.property.class.type, this.property.name);
|
|
83
|
+
const plural = name.endsWith('y') ? name.slice(0, -1) + 'ies' : name + 's';
|
|
84
|
+
return `${values.length} ${(0, translate_1.tr)(plural)}`;
|
|
85
|
+
}
|
|
86
|
+
return (await Promise.all(values.map(class_view_3.representativeValueOf))).sort().join(', ');
|
|
77
87
|
}
|
|
88
|
+
const mode = this.multiple ? (0, multiple_output_1.multipleOutputOf)(this.property.class.type, this.property.name) : undefined;
|
|
78
89
|
const lines = this.multiple && (mode === 'lines');
|
|
79
90
|
return await (0, transformer_1.applyTransformer)(cell.value, this.property.class.type, this.property.name, transformer_2.HTML, transformer_3.OUTPUT, new core_transformers_1.HtmlContainer(false, !this.multiple || lines));
|
|
80
91
|
}
|
package/cjs/projection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":";;;AA4BA,kEAGC;AAED,oDAgBC;AAhDD,oDAAiE;AACjE,oDAAiE;AACjE,oDAAiE;AACjE,sDAAkE;AAClE,kEAAwE;AACxE,kEAAwE;AACxE,0DAAoE;AACpE,wDAAmE;AACnE,wDAAmE;AAGnE,8CAA8D;AAC9D,kDAAgE;AAChE,sDAAkE;AAClE,sDAAkE;AAClE,sDAAkE;AAClE,sDAAkE;AAClE,uDAA+D;AAQ/D,MAAM,YAAY,GAA+B,EAAE,CAAA;AAEnD,SAAgB,2BAA2B,CAAC,SAA8C;IAEzF,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;AACvC,CAAC;AAED,SAAgB,oBAAoB,CACnC,IAAU,EAAE,YAA6B,EAAE,EAAE,QAAiC;IAG9E,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,wBAAc,CAAC,uBAAuB,EAAE,8BAA8B,CAAC,CAAA;IAC/G,MAAM,MAAM,GAAG,CAAC,GAAG,SAAS,EAAE,IAAI,CAAC,CAAA;IACnC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC5D,IAAI,CAAC,MAAM,IAAI,QAAQ,IAAI,IAAA,gCAAkB,EAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,kBAAI,EAAE,oBAAM,CAAC,KAAK,+BAAW;QAC9G,MAAM,IAAI,wBAAc,CAAC,uBAAuB,EAAE,yCAAyC,CAAC,CAAA;IAC7F,OAAO,CAAC,MAAM,IAAI,IAAA,6BAAgB,EAAC,IAAI,CAAC,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AO,CAAC,CAAA;QACjD,OAAO,MAAM,IAAA,8BAAgB,EAC5B,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAI,EAAE,oBAAM,EACtE,IAAI,iCAAa,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,CACjD,CAAA;IACF,CAAC;IAED,SAAS;QAER,IAAI,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,wBAAc,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QACzE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAA;IAChF,CAAC;IAED,SAAS;QAER,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrG,CAAC;CAED;AArED,gCAqEC"}
|
package/cjs/selector-state.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export declare function listStateDependsOn(dependencies: {
|
|
|
8
8
|
}): void;
|
|
9
9
|
/** Keep all router-resolved identity segments; format and query are presentation parameters. */
|
|
10
10
|
export declare function selectorStateKey(request: Request): string;
|
|
11
|
+
export declare function selectorStateBootstrap(request: Request): Promise<{
|
|
12
|
+
generation: string;
|
|
13
|
+
record: StateRecord;
|
|
14
|
+
}>;
|
|
11
15
|
export declare class SessionStateStore {
|
|
12
16
|
private readonly session;
|
|
13
17
|
private readonly run;
|
package/cjs/selector-state.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SelectorStateAction = exports.SessionStateStore = void 0;
|
|
4
4
|
exports.listStateDependsOn = listStateDependsOn;
|
|
5
5
|
exports.selectorStateKey = selectorStateKey;
|
|
6
|
+
exports.selectorStateBootstrap = selectorStateBootstrap;
|
|
6
7
|
const action_1 = require("@itrocks/action");
|
|
7
8
|
const action_request_1 = require("@itrocks/action-request");
|
|
8
9
|
const property_select_1 = require("@itrocks/property-select");
|
|
@@ -18,6 +19,15 @@ function listStateDependsOn(dependencies) {
|
|
|
18
19
|
function selectorStateKey(request) {
|
|
19
20
|
return request.route + (request.ids.length ? '/' + request.ids.join(',') : '') + '/' + request.action;
|
|
20
21
|
}
|
|
22
|
+
function selectorStateBootstrap(request) {
|
|
23
|
+
return transaction(request.request.session, data => {
|
|
24
|
+
data.propertySelectGeneration ??= (0, node_crypto_1.randomUUID)();
|
|
25
|
+
return {
|
|
26
|
+
generation: data.propertySelectGeneration,
|
|
27
|
+
record: structuredClone(data.propertySelect?.[selectorStateKey(request)] ?? { revision: 0 })
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
}
|
|
21
31
|
class SessionStateStore {
|
|
22
32
|
session;
|
|
23
33
|
run;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selector-state.js","sourceRoot":"","sources":["../src/selector-state.ts"],"names":[],"mappings":";;;AAgBA,gDAGC;AAGD,4CAGC;
|
|
1
|
+
{"version":3,"file":"selector-state.js","sourceRoot":"","sources":["../src/selector-state.ts"],"names":[],"mappings":";;;AAgBA,gDAGC;AAGD,4CAGC;AAED,wDASC;AApCD,4CAA0D;AAC1D,4DAAkE;AAElE,8DAAmE;AAEnE,8DAAmE;AACnE,gEAAoE;AACpE,6CAAsD;AACtD,qCAAmD;AAMnD,IAAI,WAAW,GAAuB,KAAK,IAAI,EAAE,GAAG,MAAM,IAAI,KAA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AI,MAAM,CAAC,MAAM,KAAK,KAAK;gBAAE,MAAM,IAAI,SAAS,CAAC,yBAAyB,CAAC,CAAA;YAC3E,MAAM,KAAK,GAAG,IAAA,uCAAqB,EAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YAChD,IAAI,CAAC,KAAK;gBAAE,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAA;YACzD,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QACtE,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACd,IAAI,KAAK,YAAY,oCAAkB;gBAAE,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;YACtG,IAAK,KAA2B,CAAC,IAAI,KAAK,eAAe;gBACxD,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;YACnE,IAAI,KAAK,YAAY,SAAS;gBAAE,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;YAChG,MAAM,KAAK,CAAA;QACZ,CAAC;IACF,CAAC;CAED;AA9CD,kDA8CC"}
|
package/list.css
CHANGED
|
@@ -41,7 +41,7 @@ table.objects tr td, table.objects tr th {
|
|
|
41
41
|
padding: 0.6em;
|
|
42
42
|
white-space: nowrap;
|
|
43
43
|
}
|
|
44
|
-
table.objects tr td:last-child, table.objects tr th:last-child {
|
|
44
|
+
table.objects tr td:nth-last-child(1 of :not([hidden])), table.objects tr th:nth-last-child(1 of :not([hidden])) {
|
|
45
45
|
border-right: 1px solid #d8d8d8;
|
|
46
46
|
}
|
|
47
47
|
table.objects tr.properties > .select > input[name=select] {
|
package/package.json
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"@itrocks/sort": "latest",
|
|
24
24
|
"@itrocks/storage": "latest",
|
|
25
25
|
"@itrocks/table": "latest",
|
|
26
|
+
"@itrocks/translate": "latest",
|
|
26
27
|
"@itrocks/transformer": "latest",
|
|
27
28
|
"@itrocks/xtarget": "latest"
|
|
28
29
|
},
|
|
@@ -92,5 +93,5 @@
|
|
|
92
93
|
"build:front": "tsc -p src/front/tsconfig.json",
|
|
93
94
|
"test": "npm run build:cjs && node --test \"test/**/*.test.mjs\""
|
|
94
95
|
},
|
|
95
|
-
"version": "0.13.
|
|
96
|
+
"version": "0.13.6"
|
|
96
97
|
}
|
package/property-select.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PropertySelectView } from '@itrocks/property-select/front/property-select.js';
|
|
2
2
|
import type { ConsumerPort } from '@itrocks/property-select/property-select.js';
|
|
3
3
|
import type { MetadataProvider } from '@itrocks/property-select/property-select.js';
|
|
4
|
-
import type { PointerSample } from '@itrocks/property-select/property-select.js';
|
|
5
4
|
import type { Outcome } from '@itrocks/property-select/property-select.js';
|
|
5
|
+
import type { PointerSample } from '@itrocks/property-select/property-select.js';
|
|
6
6
|
import type { SelectionIntent } from '@itrocks/property-select/property-select.js';
|
|
7
7
|
import { TableColumnAdd } from '@itrocks/table/column-add.js';
|
|
8
8
|
export type PaneHandle = {
|
|
@@ -43,6 +43,8 @@ export declare class ListPropertySelect implements ConsumerPort {
|
|
|
43
43
|
private loadColumn;
|
|
44
44
|
private add;
|
|
45
45
|
begin(intent: SelectionIntent, sample: PointerSample): void;
|
|
46
|
+
private columnSource;
|
|
47
|
+
private validateColumn;
|
|
46
48
|
cancel(id: string): void;
|
|
47
49
|
private previewError;
|
|
48
50
|
dispose(): void;
|
package/property-select.js
CHANGED
|
@@ -18,11 +18,15 @@ export class ListPropertySelect {
|
|
|
18
18
|
const content = document.createElement('div');
|
|
19
19
|
this.button = article.querySelector('.add-column');
|
|
20
20
|
this.pane = options.mountSelector(content, 'Add columns');
|
|
21
|
+
const initial = article.dataset.selectorBootstrap
|
|
22
|
+
? JSON.parse(decodeURIComponent(article.dataset.selectorBootstrap)) : undefined;
|
|
21
23
|
this.view = new PropertySelectView(content, {
|
|
22
24
|
consumer: this, metadata: options.metadata, root: article.dataset.propertyRoot,
|
|
23
25
|
advice: options.advice, stateKey: article.dataset.selectorKey, stateMode: 'session',
|
|
24
|
-
stateStore: new HttpStateStore(
|
|
25
|
-
|
|
26
|
+
stateStore: new HttpStateStore(undefined, undefined, initial && {
|
|
27
|
+
...initial, key: article.dataset.selectorKey
|
|
28
|
+
}), usedPaths: this.paths()
|
|
29
|
+
}, { template: initial?.template, templateUrl: options.templateUrl });
|
|
26
30
|
this.observer = new MutationObserver(records => {
|
|
27
31
|
if (this.drag && records.some(record => record.target.tagName === 'TBODY'))
|
|
28
32
|
this.view.selector.cancel(this.drag.intent.id, 'row view changed');
|
|
@@ -69,11 +73,22 @@ export class ListPropertySelect {
|
|
|
69
73
|
return { cells, header };
|
|
70
74
|
}
|
|
71
75
|
async add(path, signal) {
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
const source = this.columnSource(path);
|
|
77
|
+
const operation = this.options.addition.begin(source);
|
|
78
|
+
try {
|
|
79
|
+
await this.validateColumn(path, signal);
|
|
80
|
+
signal.throwIfAborted();
|
|
81
|
+
if (this.disposed)
|
|
82
|
+
throw new Error('List disposed');
|
|
83
|
+
const outcome = operation.commit();
|
|
84
|
+
await this.options.saveColumns();
|
|
85
|
+
this.view.selector.setConfiguration({ usedPaths: this.paths() });
|
|
86
|
+
return outcome;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
operation.cancel();
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
77
92
|
}
|
|
78
93
|
begin(intent, sample) {
|
|
79
94
|
if (this.disposed || this.drag || this.pending.size)
|
|
@@ -82,48 +97,63 @@ export class ListPropertySelect {
|
|
|
82
97
|
const paths = this.paths();
|
|
83
98
|
const suspension = this.pane.suspend({ mobileOnly: true });
|
|
84
99
|
try {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
create: () => {
|
|
98
|
-
const header = document.createElement('th');
|
|
99
|
-
header.dataset.property = path;
|
|
100
|
-
header.dataset.sortable = 'false';
|
|
101
|
-
header.textContent = path;
|
|
102
|
-
const cells = [...this.article.querySelectorAll('table.objects tbody tr')].map(() => {
|
|
103
|
-
const cell = document.createElement('td');
|
|
104
|
-
cell.textContent = 'Loading…';
|
|
105
|
-
return cell;
|
|
106
|
-
});
|
|
107
|
-
return { cells, header };
|
|
108
|
-
},
|
|
109
|
-
load: async (signal) => {
|
|
110
|
-
try {
|
|
111
|
-
return await this.loadColumn(path, signal);
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
if (!this.disposed && !signal.aborted)
|
|
115
|
-
this.previewError(path);
|
|
116
|
-
throw error;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}, sample);
|
|
120
|
-
this.drag = { intent, operation, paths, restore: () => suspension.restore() };
|
|
100
|
+
let drop;
|
|
101
|
+
const dropped = new Promise(resolve => { drop = resolve; });
|
|
102
|
+
const source = this.columnSource(path);
|
|
103
|
+
// Existing columns already have their metadata and cells. Only new drops need admission.
|
|
104
|
+
if (!paths.includes(path))
|
|
105
|
+
source.accept = async (signal) => {
|
|
106
|
+
await dropped;
|
|
107
|
+
signal.throwIfAborted();
|
|
108
|
+
await this.validateColumn(path, signal);
|
|
109
|
+
};
|
|
110
|
+
const operation = this.options.addition.beginExternal(source, sample);
|
|
111
|
+
this.drag = { drop, intent, operation, paths, restore: () => suspension.restore() };
|
|
121
112
|
}
|
|
122
113
|
catch (error) {
|
|
123
114
|
suspension.restore();
|
|
124
115
|
throw error;
|
|
125
116
|
}
|
|
126
117
|
}
|
|
118
|
+
columnSource(path) {
|
|
119
|
+
const result = this.view.selector.search.results.find(result => result.property.path === path);
|
|
120
|
+
const property = result?.property || this.view.selector.context?.properties.find(property => property.path === path);
|
|
121
|
+
const label = result ? [...result.segments.map(segment => segment.label), result.property.label].join('.')
|
|
122
|
+
: property?.label || path;
|
|
123
|
+
return {
|
|
124
|
+
id: path,
|
|
125
|
+
create: () => {
|
|
126
|
+
const header = document.createElement('th');
|
|
127
|
+
header.dataset.property = path;
|
|
128
|
+
header.dataset.sortable = 'false';
|
|
129
|
+
header.textContent = label;
|
|
130
|
+
const cells = [...this.article.querySelectorAll('table.objects tbody tr')]
|
|
131
|
+
.map(() => document.createElement('td'));
|
|
132
|
+
return { cells, header };
|
|
133
|
+
},
|
|
134
|
+
load: async (signal) => {
|
|
135
|
+
signal.throwIfAborted();
|
|
136
|
+
try {
|
|
137
|
+
return await this.loadColumn(path, signal);
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
if (!this.disposed && !signal.aborted)
|
|
141
|
+
this.previewError(path);
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
async validateColumn(path, signal) {
|
|
148
|
+
const form = this.article.querySelector('form');
|
|
149
|
+
const query = new URLSearchParams({ column: path, validate: '1' });
|
|
150
|
+
const response = await fetch(`${form.action}?${query}`, {
|
|
151
|
+
signal: AbortSignal.any([signal, this.abort.signal])
|
|
152
|
+
});
|
|
153
|
+
const result = await response.json();
|
|
154
|
+
if (!response.ok || result.path !== path)
|
|
155
|
+
throw new Error(result.error ?? 'Column unavailable');
|
|
156
|
+
}
|
|
127
157
|
cancel(id) {
|
|
128
158
|
if (this.drag?.intent.id !== id)
|
|
129
159
|
return;
|
|
@@ -171,7 +201,9 @@ export class ListPropertySelect {
|
|
|
171
201
|
if (!drag || drag.intent.id !== id)
|
|
172
202
|
throw new Error('Unknown column transport');
|
|
173
203
|
try {
|
|
174
|
-
const
|
|
204
|
+
const finished = drag.operation.finish(sample);
|
|
205
|
+
drag.drop();
|
|
206
|
+
const status = await finished;
|
|
175
207
|
if (status !== 'cancelled')
|
|
176
208
|
await this.options.saveColumns();
|
|
177
209
|
if (this.disposed)
|
package/selector-state.d.ts
CHANGED
|
@@ -5,8 +5,13 @@ import type { StateStore } from '@itrocks/property-select/property-select.js';
|
|
|
5
5
|
export declare class HttpStateStore implements StateStore {
|
|
6
6
|
private readonly endpoint;
|
|
7
7
|
private readonly fetcher;
|
|
8
|
+
private initial?;
|
|
8
9
|
private generation?;
|
|
9
|
-
constructor(endpoint?: string, fetcher?: typeof fetch
|
|
10
|
+
constructor(endpoint?: string, fetcher?: typeof fetch, initial?: {
|
|
11
|
+
generation: string;
|
|
12
|
+
key: string;
|
|
13
|
+
record: StateRecord;
|
|
14
|
+
} | undefined);
|
|
10
15
|
read(key: string, signal?: AbortSignal): Promise<StateRecord>;
|
|
11
16
|
remove(key: string, revision: number): Promise<StateRecord>;
|
|
12
17
|
write(key: string, state: SelectorState, revision: number): Promise<StateRecord>;
|
package/selector-state.js
CHANGED
|
@@ -3,12 +3,21 @@ import { StateConflictError } from '@itrocks/property-select/property-select.js'
|
|
|
3
3
|
export class HttpStateStore {
|
|
4
4
|
endpoint;
|
|
5
5
|
fetcher;
|
|
6
|
+
initial;
|
|
6
7
|
generation;
|
|
7
|
-
constructor(endpoint = '/property-select/state/json', fetcher = globalThis.fetch.bind(globalThis)) {
|
|
8
|
+
constructor(endpoint = '/property-select/state/json', fetcher = globalThis.fetch.bind(globalThis), initial) {
|
|
8
9
|
this.endpoint = endpoint;
|
|
9
10
|
this.fetcher = fetcher;
|
|
11
|
+
this.initial = initial;
|
|
10
12
|
}
|
|
11
13
|
read(key, signal) {
|
|
14
|
+
if (this.initial?.key === key) {
|
|
15
|
+
signal?.throwIfAborted();
|
|
16
|
+
const initial = this.initial;
|
|
17
|
+
this.initial = undefined;
|
|
18
|
+
this.generation = initial.generation;
|
|
19
|
+
return Promise.resolve(structuredClone(initial.record));
|
|
20
|
+
}
|
|
12
21
|
return this.request('GET', key, undefined, undefined, signal);
|
|
13
22
|
}
|
|
14
23
|
remove(key, revision) {
|