@almadar/std 13.0.5 → 13.0.7

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.
@@ -43,6 +43,16 @@
43
43
  "category": "interaction",
44
44
  "linkedEntity": "SearchResult",
45
45
  "emits": [
46
+ {
47
+ "event": "SEARCH",
48
+ "payloadSchema": [
49
+ {
50
+ "name": "query",
51
+ "type": "string",
52
+ "required": true
53
+ }
54
+ ]
55
+ },
46
56
  {
47
57
  "event": "SearchResultLoaded",
48
58
  "description": "Fired when SearchResult collection finishes loading",
@@ -151,9 +161,9 @@
151
161
  "render-ui",
152
162
  "main",
153
163
  {
154
- "event": "@config.event",
155
164
  "placeholder": "@config.placeholder",
156
- "type": "search-input"
165
+ "type": "search-input",
166
+ "event": "@config.event"
157
167
  }
158
168
  ]
159
169
  ]
@@ -163,13 +173,20 @@
163
173
  "to": "loading",
164
174
  "event": "SEARCH",
165
175
  "effects": [
176
+ [
177
+ "emit",
178
+ "SEARCH",
179
+ {
180
+ "query": "@payload.query"
181
+ }
182
+ ],
166
183
  [
167
184
  "fetch",
168
185
  "SearchResult",
169
186
  {
170
187
  "emit": {
171
- "success": "SearchResultLoaded",
172
- "failure": "SearchResultLoadFailed"
188
+ "failure": "SearchResultLoadFailed",
189
+ "success": "SearchResultLoaded"
173
190
  }
174
191
  }
175
192
  ],
@@ -177,21 +194,21 @@
177
194
  "render-ui",
178
195
  "main",
179
196
  {
197
+ "align": "center",
180
198
  "children": [
181
199
  {
200
+ "placeholder": "@config.placeholder",
182
201
  "type": "search-input",
183
- "event": "@config.event",
184
- "placeholder": "@config.placeholder"
202
+ "event": "@config.event"
185
203
  },
186
204
  {
187
- "size": "sm",
188
- "type": "spinner"
205
+ "type": "spinner",
206
+ "size": "sm"
189
207
  }
190
208
  ],
191
- "type": "stack",
192
- "direction": "horizontal",
193
209
  "gap": "sm",
194
- "align": "center"
210
+ "type": "stack",
211
+ "direction": "horizontal"
195
212
  }
196
213
  ]
197
214
  ]
@@ -205,8 +222,8 @@
205
222
  "render-ui",
206
223
  "main",
207
224
  {
208
- "event": "@config.event",
209
225
  "placeholder": "@config.placeholder",
226
+ "event": "@config.event",
210
227
  "type": "search-input"
211
228
  }
212
229
  ]
@@ -223,20 +240,20 @@
223
240
  {
224
241
  "gap": "xs",
225
242
  "direction": "vertical",
226
- "type": "stack",
227
243
  "children": [
228
244
  {
229
- "event": "@config.event",
230
245
  "placeholder": "@config.placeholder",
246
+ "event": "@config.event",
231
247
  "type": "search-input"
232
248
  },
233
249
  {
234
- "content": "@payload.error",
235
- "type": "typography",
236
250
  "color": "error",
251
+ "type": "typography",
252
+ "content": "@payload.error",
237
253
  "variant": "caption"
238
254
  }
239
- ]
255
+ ],
256
+ "type": "stack"
240
257
  }
241
258
  ]
242
259
  ]
@@ -251,8 +268,8 @@
251
268
  "SearchResult",
252
269
  {
253
270
  "emit": {
254
- "success": "SearchResultLoaded",
255
- "failure": "SearchResultLoadFailed"
271
+ "failure": "SearchResultLoadFailed",
272
+ "success": "SearchResultLoaded"
256
273
  }
257
274
  }
258
275
  ],
@@ -260,21 +277,21 @@
260
277
  "render-ui",
261
278
  "main",
262
279
  {
280
+ "type": "stack",
281
+ "direction": "horizontal",
282
+ "align": "center",
283
+ "gap": "sm",
263
284
  "children": [
264
285
  {
265
- "placeholder": "@config.placeholder",
266
286
  "type": "search-input",
287
+ "placeholder": "@config.placeholder",
267
288
  "event": "@config.event"
268
289
  },
269
290
  {
270
291
  "type": "spinner",
271
292
  "size": "sm"
272
293
  }
273
- ],
274
- "type": "stack",
275
- "gap": "sm",
276
- "align": "center",
277
- "direction": "horizontal"
294
+ ]
278
295
  }
279
296
  ]
280
297
  ]
@@ -289,8 +306,8 @@
289
306
  "SearchResult",
290
307
  {
291
308
  "emit": {
292
- "success": "SearchResultLoaded",
293
- "failure": "SearchResultLoadFailed"
309
+ "failure": "SearchResultLoadFailed",
310
+ "success": "SearchResultLoaded"
294
311
  }
295
312
  }
296
313
  ],
@@ -310,9 +327,9 @@
310
327
  }
311
328
  ],
312
329
  "direction": "horizontal",
313
- "gap": "sm",
314
330
  "type": "stack",
315
- "align": "center"
331
+ "align": "center",
332
+ "gap": "sm"
316
333
  }
317
334
  ]
318
335
  ]
@@ -343,8 +360,8 @@
343
360
  "SearchResult",
344
361
  {
345
362
  "emit": {
346
- "success": "SearchResultLoaded",
347
- "failure": "SearchResultLoadFailed"
363
+ "failure": "SearchResultLoadFailed",
364
+ "success": "SearchResultLoaded"
348
365
  }
349
366
  }
350
367
  ],
@@ -352,21 +369,21 @@
352
369
  "render-ui",
353
370
  "main",
354
371
  {
372
+ "type": "stack",
373
+ "gap": "sm",
355
374
  "direction": "horizontal",
375
+ "align": "center",
356
376
  "children": [
357
377
  {
358
378
  "placeholder": "@config.placeholder",
359
- "event": "@config.event",
360
- "type": "search-input"
379
+ "type": "search-input",
380
+ "event": "@config.event"
361
381
  },
362
382
  {
363
383
  "type": "spinner",
364
384
  "size": "sm"
365
385
  }
366
- ],
367
- "gap": "sm",
368
- "align": "center",
369
- "type": "stack"
386
+ ]
370
387
  }
371
388
  ]
372
389
  ]
@@ -59,8 +59,8 @@
59
59
  "name": "FilteredItemSearch",
60
60
  "linkedEntity": "FilteredListItem",
61
61
  "config": {
62
- "event": "SEARCH",
63
- "placeholder": "Search filtered items…"
62
+ "placeholder": "Search filtered items…",
63
+ "event": "SEARCH"
64
64
  }
65
65
  },
66
66
  {
@@ -68,19 +68,19 @@
68
68
  "name": "FilteredItemFilter",
69
69
  "linkedEntity": "FilteredListItem",
70
70
  "config": {
71
+ "event": "FILTER",
71
72
  "filters": [
72
73
  {
74
+ "label": "Status",
75
+ "filterType": "select",
73
76
  "options": [
74
77
  "active",
75
78
  "inactive",
76
79
  "pending"
77
80
  ],
78
- "field": "status",
79
- "filterType": "select",
80
- "label": "Status"
81
+ "field": "status"
81
82
  }
82
- ],
83
- "event": "FILTER"
83
+ ]
84
84
  }
85
85
  },
86
86
  {
@@ -90,14 +90,14 @@
90
90
  "config": {
91
91
  "fields": [
92
92
  {
93
+ "name": "name",
93
94
  "label": "Name",
94
- "variant": "h4",
95
- "name": "name"
95
+ "variant": "h4"
96
96
  },
97
97
  {
98
+ "name": "description",
98
99
  "label": "Description",
99
- "variant": "caption",
100
- "name": "description"
100
+ "variant": "caption"
101
101
  },
102
102
  {
103
103
  "name": "status",
@@ -105,7 +105,33 @@
105
105
  "variant": "badge"
106
106
  }
107
107
  ]
108
- }
108
+ },
109
+ "listens": [
110
+ {
111
+ "event": "SEARCH",
112
+ "triggers": "REFETCH_QUERY",
113
+ "source": {
114
+ "kind": "trait",
115
+ "trait": "FilteredItemSearch"
116
+ }
117
+ },
118
+ {
119
+ "event": "FILTER",
120
+ "triggers": "REFETCH_FILTER",
121
+ "source": {
122
+ "kind": "trait",
123
+ "trait": "FilteredItemFilter"
124
+ }
125
+ },
126
+ {
127
+ "event": "PAGE",
128
+ "triggers": "REFETCH_PAGE",
129
+ "source": {
130
+ "kind": "trait",
131
+ "trait": "FilteredItemPagination"
132
+ }
133
+ }
134
+ ]
109
135
  },
110
136
  {
111
137
  "ref": "Pagination.traits.PagedItemPagination",
@@ -203,24 +229,25 @@
203
229
  "render-ui",
204
230
  "main",
205
231
  {
206
- "type": "stack",
232
+ "gap": "md",
207
233
  "direction": "vertical",
234
+ "className": "max-w-5xl mx-auto w-full",
208
235
  "children": [
209
236
  {
237
+ "type": "stack",
210
238
  "children": [
211
239
  {
212
- "type": "icon",
213
- "name": "list"
240
+ "name": "list",
241
+ "type": "icon"
214
242
  },
215
243
  {
216
- "variant": "h2",
217
244
  "content": "Filtered List",
218
- "type": "typography"
245
+ "type": "typography",
246
+ "variant": "h2"
219
247
  }
220
248
  ],
221
249
  "gap": "sm",
222
250
  "direction": "horizontal",
223
- "type": "stack",
224
251
  "align": "center"
225
252
  },
226
253
  {
@@ -228,18 +255,17 @@
228
255
  },
229
256
  {
230
257
  "type": "stack",
231
- "gap": "sm",
258
+ "direction": "horizontal",
232
259
  "children": [
233
260
  "@trait.FilteredItemSearch",
234
261
  "@trait.FilteredItemFilter"
235
262
  ],
236
- "direction": "horizontal"
263
+ "gap": "sm"
237
264
  },
238
265
  "@trait.FilteredItemBrowse",
239
266
  "@trait.FilteredItemPagination"
240
267
  ],
241
- "className": "max-w-5xl mx-auto w-full",
242
- "gap": "md"
268
+ "type": "stack"
243
269
  }
244
270
  ]
245
271
  ]
@@ -113,6 +113,49 @@
113
113
  "type": "string"
114
114
  }
115
115
  ]
116
+ },
117
+ {
118
+ "key": "REFETCH_QUERY",
119
+ "name": "Refetch Query",
120
+ "payloadSchema": [
121
+ {
122
+ "name": "query",
123
+ "type": "string",
124
+ "required": true
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "key": "REFETCH_FILTER",
130
+ "name": "Refetch Filter",
131
+ "payloadSchema": [
132
+ {
133
+ "name": "field",
134
+ "type": "string",
135
+ "required": true
136
+ },
137
+ {
138
+ "name": "value",
139
+ "type": "string",
140
+ "required": true
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "key": "REFETCH_PAGE",
146
+ "name": "Refetch Page",
147
+ "payloadSchema": [
148
+ {
149
+ "name": "page",
150
+ "type": "number",
151
+ "required": true
152
+ },
153
+ {
154
+ "name": "pageSize",
155
+ "type": "number",
156
+ "required": true
157
+ }
158
+ ]
116
159
  }
117
160
  ],
118
161
  "transitions": [
@@ -135,8 +178,8 @@
135
178
  "render-ui",
136
179
  "main",
137
180
  {
138
- "size": "sm",
139
- "type": "spinner"
181
+ "type": "spinner",
182
+ "size": "sm"
140
183
  }
141
184
  ]
142
185
  ]
@@ -150,16 +193,16 @@
150
193
  "render-ui",
151
194
  "main",
152
195
  {
196
+ "direction": "vertical",
153
197
  "children": [
154
198
  {
199
+ "pageSize": "@config.pageSize",
155
200
  "fields": "@config.fields",
156
201
  "type": "data-grid",
157
- "pageSize": "@config.pageSize",
158
202
  "entity": "@payload.data"
159
203
  }
160
204
  ],
161
- "type": "stack",
162
- "direction": "vertical"
205
+ "type": "stack"
163
206
  }
164
207
  ]
165
208
  ]
@@ -173,10 +216,10 @@
173
216
  "render-ui",
174
217
  "main",
175
218
  {
176
- "variant": "caption",
177
219
  "color": "error",
220
+ "type": "typography",
178
221
  "content": "@payload.error",
179
- "type": "typography"
222
+ "variant": "caption"
180
223
  }
181
224
  ]
182
225
  ]
@@ -196,6 +239,40 @@
196
239
  }
197
240
  }
198
241
  ],
242
+ [
243
+ "render-ui",
244
+ "main",
245
+ {
246
+ "type": "spinner",
247
+ "size": "sm"
248
+ }
249
+ ]
250
+ ]
251
+ },
252
+ {
253
+ "from": "browsing",
254
+ "to": "loading",
255
+ "event": "REFETCH_QUERY",
256
+ "effects": [
257
+ [
258
+ "fetch",
259
+ "BrowseItem",
260
+ {
261
+ "emit": {
262
+ "failure": "BrowseItemLoadFailed",
263
+ "success": "BrowseItemLoaded"
264
+ },
265
+ "filter": [
266
+ "str/includes",
267
+ [
268
+ "object/get",
269
+ "@entity",
270
+ "name"
271
+ ],
272
+ "@payload.query"
273
+ ]
274
+ }
275
+ ],
199
276
  [
200
277
  "render-ui",
201
278
  "main",
@@ -207,9 +284,43 @@
207
284
  ]
208
285
  },
209
286
  {
210
- "from": "error",
287
+ "from": "browsing",
211
288
  "to": "loading",
212
- "event": "INIT",
289
+ "event": "REFETCH_FILTER",
290
+ "effects": [
291
+ [
292
+ "fetch",
293
+ "BrowseItem",
294
+ {
295
+ "emit": {
296
+ "success": "BrowseItemLoaded",
297
+ "failure": "BrowseItemLoadFailed"
298
+ },
299
+ "filter": [
300
+ "=",
301
+ [
302
+ "object/get",
303
+ "@entity",
304
+ "@payload.field"
305
+ ],
306
+ "@payload.value"
307
+ ]
308
+ }
309
+ ],
310
+ [
311
+ "render-ui",
312
+ "main",
313
+ {
314
+ "type": "spinner",
315
+ "size": "sm"
316
+ }
317
+ ]
318
+ ]
319
+ },
320
+ {
321
+ "from": "browsing",
322
+ "to": "loading",
323
+ "event": "REFETCH_PAGE",
213
324
  "effects": [
214
325
  [
215
326
  "fetch",
@@ -230,17 +341,42 @@
230
341
  }
231
342
  ]
232
343
  ]
344
+ },
345
+ {
346
+ "from": "error",
347
+ "to": "loading",
348
+ "event": "INIT",
349
+ "effects": [
350
+ [
351
+ "fetch",
352
+ "BrowseItem",
353
+ {
354
+ "emit": {
355
+ "success": "BrowseItemLoaded",
356
+ "failure": "BrowseItemLoadFailed"
357
+ }
358
+ }
359
+ ],
360
+ [
361
+ "render-ui",
362
+ "main",
363
+ {
364
+ "type": "spinner",
365
+ "size": "sm"
366
+ }
367
+ ]
368
+ ]
233
369
  }
234
370
  ]
235
371
  },
236
372
  "config": {
237
- "pageSize": {
238
- "type": "number",
239
- "default": 0.0
240
- },
241
373
  "fields": {
242
374
  "type": "[object]",
243
375
  "default": []
376
+ },
377
+ "pageSize": {
378
+ "type": "number",
379
+ "default": 0.0
244
380
  }
245
381
  },
246
382
  "scope": "collection"