@almadar/std 13.0.7 → 13.1.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.
@@ -57,7 +57,6 @@
57
57
  {
58
58
  "ref": "Search.traits.SearchResultSearch",
59
59
  "name": "FilteredItemSearch",
60
- "linkedEntity": "FilteredListItem",
61
60
  "config": {
62
61
  "placeholder": "Search filtered items…",
63
62
  "event": "SEARCH"
@@ -66,21 +65,20 @@
66
65
  {
67
66
  "ref": "Filter.traits.FilterTargetFilter",
68
67
  "name": "FilteredItemFilter",
69
- "linkedEntity": "FilteredListItem",
70
68
  "config": {
71
- "event": "FILTER",
72
69
  "filters": [
73
70
  {
74
71
  "label": "Status",
75
- "filterType": "select",
76
72
  "options": [
77
73
  "active",
78
74
  "inactive",
79
75
  "pending"
80
76
  ],
81
- "field": "status"
77
+ "field": "status",
78
+ "filterType": "select"
82
79
  }
83
- ]
80
+ ],
81
+ "event": "FILTER"
84
82
  }
85
83
  },
86
84
  {
@@ -90,19 +88,19 @@
90
88
  "config": {
91
89
  "fields": [
92
90
  {
93
- "name": "name",
91
+ "variant": "h4",
94
92
  "label": "Name",
95
- "variant": "h4"
93
+ "name": "name"
96
94
  },
97
95
  {
98
- "name": "description",
99
96
  "label": "Description",
100
- "variant": "caption"
97
+ "variant": "caption",
98
+ "name": "description"
101
99
  },
102
100
  {
103
- "name": "status",
104
101
  "label": "Status",
105
- "variant": "badge"
102
+ "variant": "badge",
103
+ "name": "status"
106
104
  }
107
105
  ]
108
106
  },
@@ -136,10 +134,10 @@
136
134
  {
137
135
  "ref": "Pagination.traits.PagedItemPagination",
138
136
  "name": "FilteredItemPagination",
139
- "linkedEntity": "FilteredListItem",
140
137
  "config": {
141
- "event": "PAGE",
142
- "totalPages": 10.0
138
+ "totalPages": 10.0,
139
+ "pageSize": 10.0,
140
+ "event": "PAGE"
143
141
  }
144
142
  },
145
143
  {
@@ -229,43 +227,43 @@
229
227
  "render-ui",
230
228
  "main",
231
229
  {
230
+ "type": "stack",
232
231
  "gap": "md",
233
- "direction": "vertical",
234
232
  "className": "max-w-5xl mx-auto w-full",
235
233
  "children": [
236
234
  {
237
235
  "type": "stack",
236
+ "direction": "horizontal",
237
+ "align": "center",
238
+ "gap": "sm",
238
239
  "children": [
239
240
  {
240
241
  "name": "list",
241
242
  "type": "icon"
242
243
  },
243
244
  {
244
- "content": "Filtered List",
245
+ "variant": "h2",
245
246
  "type": "typography",
246
- "variant": "h2"
247
+ "content": "Filtered List"
247
248
  }
248
- ],
249
- "gap": "sm",
250
- "direction": "horizontal",
251
- "align": "center"
249
+ ]
252
250
  },
253
251
  {
254
252
  "type": "divider"
255
253
  },
256
254
  {
257
- "type": "stack",
258
255
  "direction": "horizontal",
259
256
  "children": [
260
257
  "@trait.FilteredItemSearch",
261
258
  "@trait.FilteredItemFilter"
262
259
  ],
260
+ "type": "stack",
263
261
  "gap": "sm"
264
262
  },
265
263
  "@trait.FilteredItemBrowse",
266
264
  "@trait.FilteredItemPagination"
267
265
  ],
268
- "type": "stack"
266
+ "direction": "vertical"
269
267
  }
270
268
  ]
271
269
  ]
@@ -169,8 +169,8 @@
169
169
  "BrowseItem",
170
170
  {
171
171
  "emit": {
172
- "failure": "BrowseItemLoadFailed",
173
- "success": "BrowseItemLoaded"
172
+ "success": "BrowseItemLoaded",
173
+ "failure": "BrowseItemLoadFailed"
174
174
  }
175
175
  }
176
176
  ],
@@ -193,16 +193,16 @@
193
193
  "render-ui",
194
194
  "main",
195
195
  {
196
- "direction": "vertical",
196
+ "type": "stack",
197
197
  "children": [
198
198
  {
199
- "pageSize": "@config.pageSize",
200
199
  "fields": "@config.fields",
201
- "type": "data-grid",
202
- "entity": "@payload.data"
200
+ "entity": "@payload.data",
201
+ "pageSize": "@config.pageSize",
202
+ "type": "data-grid"
203
203
  }
204
204
  ],
205
- "type": "stack"
205
+ "direction": "vertical"
206
206
  }
207
207
  ]
208
208
  ]
@@ -216,9 +216,9 @@
216
216
  "render-ui",
217
217
  "main",
218
218
  {
219
- "color": "error",
220
219
  "type": "typography",
221
220
  "content": "@payload.error",
221
+ "color": "error",
222
222
  "variant": "caption"
223
223
  }
224
224
  ]
@@ -234,8 +234,8 @@
234
234
  "BrowseItem",
235
235
  {
236
236
  "emit": {
237
- "failure": "BrowseItemLoadFailed",
238
- "success": "BrowseItemLoaded"
237
+ "success": "BrowseItemLoaded",
238
+ "failure": "BrowseItemLoadFailed"
239
239
  }
240
240
  }
241
241
  ],
@@ -243,8 +243,8 @@
243
243
  "render-ui",
244
244
  "main",
245
245
  {
246
- "type": "spinner",
247
- "size": "sm"
246
+ "size": "sm",
247
+ "type": "spinner"
248
248
  }
249
249
  ]
250
250
  ]
@@ -258,10 +258,6 @@
258
258
  "fetch",
259
259
  "BrowseItem",
260
260
  {
261
- "emit": {
262
- "failure": "BrowseItemLoadFailed",
263
- "success": "BrowseItemLoaded"
264
- },
265
261
  "filter": [
266
262
  "str/includes",
267
263
  [
@@ -270,7 +266,11 @@
270
266
  "name"
271
267
  ],
272
268
  "@payload.query"
273
- ]
269
+ ],
270
+ "emit": {
271
+ "success": "BrowseItemLoaded",
272
+ "failure": "BrowseItemLoadFailed"
273
+ }
274
274
  }
275
275
  ],
276
276
  [
@@ -292,10 +292,6 @@
292
292
  "fetch",
293
293
  "BrowseItem",
294
294
  {
295
- "emit": {
296
- "success": "BrowseItemLoaded",
297
- "failure": "BrowseItemLoadFailed"
298
- },
299
295
  "filter": [
300
296
  "=",
301
297
  [
@@ -304,15 +300,19 @@
304
300
  "@payload.field"
305
301
  ],
306
302
  "@payload.value"
307
- ]
303
+ ],
304
+ "emit": {
305
+ "success": "BrowseItemLoaded",
306
+ "failure": "BrowseItemLoadFailed"
307
+ }
308
308
  }
309
309
  ],
310
310
  [
311
311
  "render-ui",
312
312
  "main",
313
313
  {
314
- "type": "spinner",
315
- "size": "sm"
314
+ "size": "sm",
315
+ "type": "spinner"
316
316
  }
317
317
  ]
318
318
  ]
@@ -327,8 +327,8 @@
327
327
  "BrowseItem",
328
328
  {
329
329
  "emit": {
330
- "failure": "BrowseItemLoadFailed",
331
- "success": "BrowseItemLoaded"
330
+ "success": "BrowseItemLoaded",
331
+ "failure": "BrowseItemLoadFailed"
332
332
  }
333
333
  }
334
334
  ],
@@ -352,8 +352,8 @@
352
352
  "BrowseItem",
353
353
  {
354
354
  "emit": {
355
- "success": "BrowseItemLoaded",
356
- "failure": "BrowseItemLoadFailed"
355
+ "failure": "BrowseItemLoadFailed",
356
+ "success": "BrowseItemLoaded"
357
357
  }
358
358
  }
359
359
  ],
@@ -361,8 +361,8 @@
361
361
  "render-ui",
362
362
  "main",
363
363
  {
364
- "type": "spinner",
365
- "size": "sm"
364
+ "size": "sm",
365
+ "type": "spinner"
366
366
  }
367
367
  ]
368
368
  ]
@@ -370,13 +370,13 @@
370
370
  ]
371
371
  },
372
372
  "config": {
373
- "fields": {
374
- "type": "[object]",
375
- "default": []
376
- },
377
373
  "pageSize": {
378
374
  "type": "number",
379
375
  "default": 0.0
376
+ },
377
+ "fields": {
378
+ "type": "[object]",
379
+ "default": []
380
380
  }
381
381
  },
382
382
  "scope": "collection"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-filter",
3
3
  "version": "1.0.0",
4
- "description": "std-filter as a Function — single primitive: filter-group",
4
+ "description": "std-filter as a Function — single primitive: filter-group. The atom's\nown FilterTarget entity is the UI-state container — every FILTER\ntransition persists field/value into the entity. Visual reflection of\nthe persisted value (filter-group `value` prop) is a follow-up that\nneeds the pattern registry + UI component to accept a `value` prop;\nthe persistence side is done.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "FilterTargetOrbital",
@@ -15,26 +15,11 @@
15
15
  "required": true
16
16
  },
17
17
  {
18
- "name": "name",
19
- "type": "string",
20
- "required": true
21
- },
22
- {
23
- "name": "description",
18
+ "name": "field",
24
19
  "type": "string"
25
20
  },
26
21
  {
27
- "name": "status",
28
- "type": "string",
29
- "default": "active",
30
- "values": [
31
- "active",
32
- "inactive",
33
- "pending"
34
- ]
35
- },
36
- {
37
- "name": "createdAt",
22
+ "name": "value",
38
23
  "type": "string"
39
24
  }
40
25
  ]
@@ -61,43 +46,14 @@
61
46
  ]
62
47
  },
63
48
  {
64
- "event": "FilterTargetLoaded",
65
- "description": "Fired when FilterTarget finishes loading; payload.data holds the filtered list",
66
- "scope": "internal",
67
- "payloadSchema": [
68
- {
69
- "name": "data",
70
- "type": "[FilterTarget]"
71
- }
72
- ]
73
- },
74
- {
75
- "event": "FilterTargetLoadFailed",
76
- "description": "Fired when FilterTarget fails to load",
77
- "scope": "internal",
78
- "payloadSchema": [
79
- {
80
- "name": "error",
81
- "type": "string"
82
- },
83
- {
84
- "name": "code",
85
- "type": "string"
86
- }
87
- ]
49
+ "event": "CLEAR_FILTERS"
88
50
  }
89
51
  ],
90
52
  "stateMachine": {
91
53
  "states": [
92
54
  {
93
- "name": "loading",
55
+ "name": "idle",
94
56
  "isInitial": true
95
- },
96
- {
97
- "name": "browsing"
98
- },
99
- {
100
- "name": "error"
101
57
  }
102
58
  ],
103
59
  "events": [
@@ -105,30 +61,6 @@
105
61
  "key": "INIT",
106
62
  "name": "Initialize"
107
63
  },
108
- {
109
- "key": "FilterTargetLoaded",
110
- "name": "FilterTarget loaded",
111
- "payloadSchema": [
112
- {
113
- "name": "data",
114
- "type": "[FilterTarget]"
115
- }
116
- ]
117
- },
118
- {
119
- "key": "FilterTargetLoadFailed",
120
- "name": "FilterTarget load failed",
121
- "payloadSchema": [
122
- {
123
- "name": "error",
124
- "type": "string"
125
- },
126
- {
127
- "name": "code",
128
- "type": "string"
129
- }
130
- ]
131
- },
132
64
  {
133
65
  "key": "FILTER",
134
66
  "name": "Filter",
@@ -152,189 +84,74 @@
152
84
  ],
153
85
  "transitions": [
154
86
  {
155
- "from": "loading",
156
- "to": "loading",
87
+ "from": "idle",
88
+ "to": "idle",
157
89
  "event": "INIT",
158
90
  "effects": [
159
91
  [
160
92
  "fetch",
161
93
  "FilterTarget",
162
- {
163
- "emit": {
164
- "failure": "FilterTargetLoadFailed",
165
- "success": "FilterTargetLoaded"
166
- }
167
- }
94
+ {}
168
95
  ],
169
96
  [
170
97
  "render-ui",
171
98
  "main",
172
99
  {
173
- "size": "sm",
174
- "type": "spinner"
175
- }
176
- ]
177
- ]
178
- },
179
- {
180
- "from": "loading",
181
- "to": "browsing",
182
- "event": "FilterTargetLoaded",
183
- "effects": [
184
- [
185
- "render-ui",
186
- "main",
187
- {
188
- "type": "filter-group",
100
+ "filters": "@config.filters",
189
101
  "entity": "FilterTarget",
190
- "filters": "@config.filters"
102
+ "type": "filter-group"
191
103
  }
192
104
  ]
193
105
  ]
194
106
  },
195
107
  {
196
- "from": "loading",
197
- "to": "error",
198
- "event": "FilterTargetLoadFailed",
199
- "effects": [
200
- [
201
- "render-ui",
202
- "main",
203
- {
204
- "type": "stack",
205
- "direction": "vertical",
206
- "children": [
207
- {
208
- "filters": "@config.filters",
209
- "type": "filter-group",
210
- "entity": "FilterTarget"
211
- },
212
- {
213
- "content": "@payload.error",
214
- "type": "typography",
215
- "color": "error",
216
- "variant": "caption"
217
- }
218
- ],
219
- "gap": "xs"
220
- }
221
- ]
222
- ]
223
- },
224
- {
225
- "from": "browsing",
226
- "to": "loading",
108
+ "from": "idle",
109
+ "to": "idle",
227
110
  "event": "FILTER",
228
111
  "effects": [
229
112
  [
230
- "emit",
231
- "FILTER",
232
- {
233
- "value": "@payload.value",
234
- "field": "@payload.field"
235
- }
113
+ "set",
114
+ "@entity.field",
115
+ "@payload.field"
236
116
  ],
237
117
  [
238
- "fetch",
239
- "FilterTarget",
240
- {
241
- "emit": {
242
- "failure": "FilterTargetLoadFailed",
243
- "success": "FilterTargetLoaded"
244
- },
245
- "filter": [
246
- "=",
247
- [
248
- "object/get",
249
- "@entity",
250
- "@payload.field"
251
- ],
252
- "@payload.value"
253
- ]
254
- }
118
+ "set",
119
+ "@entity.value",
120
+ "@payload.value"
255
121
  ],
256
122
  [
257
123
  "render-ui",
258
124
  "main",
259
125
  {
260
- "type": "stack",
261
- "direction": "horizontal",
262
- "gap": "sm",
263
- "align": "center",
264
- "children": [
265
- {
266
- "type": "filter-group",
267
- "filters": "@config.filters",
268
- "entity": "FilterTarget"
269
- },
270
- {
271
- "type": "spinner",
272
- "size": "sm"
273
- }
274
- ]
126
+ "entity": "FilterTarget",
127
+ "filters": "@config.filters",
128
+ "type": "filter-group"
275
129
  }
276
130
  ]
277
131
  ]
278
132
  },
279
133
  {
280
- "from": "browsing",
281
- "to": "loading",
134
+ "from": "idle",
135
+ "to": "idle",
282
136
  "event": "CLEAR_FILTERS",
283
137
  "effects": [
284
138
  [
285
- "fetch",
286
- "FilterTarget",
287
- {
288
- "emit": {
289
- "failure": "FilterTargetLoadFailed",
290
- "success": "FilterTargetLoaded"
291
- }
292
- }
139
+ "set",
140
+ "@entity.field",
141
+ ""
293
142
  ],
294
143
  [
295
- "render-ui",
296
- "main",
297
- {
298
- "children": [
299
- {
300
- "filters": "@config.filters",
301
- "type": "filter-group",
302
- "entity": "FilterTarget"
303
- },
304
- {
305
- "size": "sm",
306
- "type": "spinner"
307
- }
308
- ],
309
- "gap": "sm",
310
- "type": "stack",
311
- "direction": "horizontal",
312
- "align": "center"
313
- }
314
- ]
315
- ]
316
- },
317
- {
318
- "from": "error",
319
- "to": "loading",
320
- "event": "INIT",
321
- "effects": [
322
- [
323
- "fetch",
324
- "FilterTarget",
325
- {
326
- "emit": {
327
- "success": "FilterTargetLoaded",
328
- "failure": "FilterTargetLoadFailed"
329
- }
330
- }
144
+ "set",
145
+ "@entity.value",
146
+ ""
331
147
  ],
332
148
  [
333
149
  "render-ui",
334
150
  "main",
335
151
  {
336
- "type": "spinner",
337
- "size": "sm"
152
+ "entity": "FilterTarget",
153
+ "type": "filter-group",
154
+ "filters": "@config.filters"
338
155
  }
339
156
  ]
340
157
  ]
@@ -342,16 +159,16 @@
342
159
  ]
343
160
  },
344
161
  "config": {
345
- "filters": {
346
- "type": "[object]",
347
- "default": []
348
- },
349
162
  "event": {
350
163
  "type": "string",
351
164
  "default": "FILTER"
165
+ },
166
+ "filters": {
167
+ "type": "[object]",
168
+ "default": []
352
169
  }
353
170
  },
354
- "scope": "collection"
171
+ "scope": "instance"
355
172
  }
356
173
  ],
357
174
  "pages": [