@almadar/std 13.0.6 → 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.
@@ -115,28 +115,45 @@
115
115
  ]
116
116
  },
117
117
  {
118
- "key": "REFETCH",
119
- "name": "Refetch",
118
+ "key": "REFETCH_QUERY",
119
+ "name": "Refetch Query",
120
120
  "payloadSchema": [
121
121
  {
122
122
  "name": "query",
123
- "type": "string"
124
- },
123
+ "type": "string",
124
+ "required": true
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "key": "REFETCH_FILTER",
130
+ "name": "Refetch Filter",
131
+ "payloadSchema": [
125
132
  {
126
133
  "name": "field",
127
- "type": "string"
134
+ "type": "string",
135
+ "required": true
128
136
  },
129
137
  {
130
138
  "name": "value",
131
- "type": "string"
132
- },
139
+ "type": "string",
140
+ "required": true
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "key": "REFETCH_PAGE",
146
+ "name": "Refetch Page",
147
+ "payloadSchema": [
133
148
  {
134
149
  "name": "page",
135
- "type": "number"
150
+ "type": "number",
151
+ "required": true
136
152
  },
137
153
  {
138
154
  "name": "pageSize",
139
- "type": "number"
155
+ "type": "number",
156
+ "required": true
140
157
  }
141
158
  ]
142
159
  }
@@ -161,8 +178,8 @@
161
178
  "render-ui",
162
179
  "main",
163
180
  {
164
- "size": "sm",
165
- "type": "spinner"
181
+ "type": "spinner",
182
+ "size": "sm"
166
183
  }
167
184
  ]
168
185
  ]
@@ -176,16 +193,16 @@
176
193
  "render-ui",
177
194
  "main",
178
195
  {
196
+ "direction": "vertical",
179
197
  "children": [
180
198
  {
181
- "entity": "@payload.data",
199
+ "pageSize": "@config.pageSize",
182
200
  "fields": "@config.fields",
183
201
  "type": "data-grid",
184
- "pageSize": "@config.pageSize"
202
+ "entity": "@payload.data"
185
203
  }
186
204
  ],
187
- "type": "stack",
188
- "direction": "vertical"
205
+ "type": "stack"
189
206
  }
190
207
  ]
191
208
  ]
@@ -199,10 +216,10 @@
199
216
  "render-ui",
200
217
  "main",
201
218
  {
202
- "variant": "caption",
203
- "content": "@payload.error",
219
+ "color": "error",
204
220
  "type": "typography",
205
- "color": "error"
221
+ "content": "@payload.error",
222
+ "variant": "caption"
206
223
  }
207
224
  ]
208
225
  ]
@@ -235,7 +252,7 @@
235
252
  {
236
253
  "from": "browsing",
237
254
  "to": "loading",
238
- "event": "REFETCH",
255
+ "event": "REFETCH_QUERY",
239
256
  "effects": [
240
257
  [
241
258
  "fetch",
@@ -244,7 +261,16 @@
244
261
  "emit": {
245
262
  "failure": "BrowseItemLoadFailed",
246
263
  "success": "BrowseItemLoaded"
247
- }
264
+ },
265
+ "filter": [
266
+ "str/includes",
267
+ [
268
+ "object/get",
269
+ "@entity",
270
+ "name"
271
+ ],
272
+ "@payload.query"
273
+ ]
248
274
  }
249
275
  ],
250
276
  [
@@ -257,6 +283,65 @@
257
283
  ]
258
284
  ]
259
285
  },
286
+ {
287
+ "from": "browsing",
288
+ "to": "loading",
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",
324
+ "effects": [
325
+ [
326
+ "fetch",
327
+ "BrowseItem",
328
+ {
329
+ "emit": {
330
+ "failure": "BrowseItemLoadFailed",
331
+ "success": "BrowseItemLoaded"
332
+ }
333
+ }
334
+ ],
335
+ [
336
+ "render-ui",
337
+ "main",
338
+ {
339
+ "type": "spinner",
340
+ "size": "sm"
341
+ }
342
+ ]
343
+ ]
344
+ },
260
345
  {
261
346
  "from": "error",
262
347
  "to": "loading",
@@ -285,13 +370,13 @@
285
370
  ]
286
371
  },
287
372
  "config": {
288
- "pageSize": {
289
- "type": "number",
290
- "default": 0.0
291
- },
292
373
  "fields": {
293
374
  "type": "[object]",
294
375
  "default": []
376
+ },
377
+ "pageSize": {
378
+ "type": "number",
379
+ "default": 0.0
295
380
  }
296
381
  },
297
382
  "scope": "collection"
@@ -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",
73
75
  "filterType": "select",
74
76
  "options": [
75
77
  "active",
76
78
  "inactive",
77
79
  "pending"
78
80
  ],
79
- "field": "status",
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
- "label": "Name",
94
93
  "name": "name",
94
+ "label": "Name",
95
95
  "variant": "h4"
96
96
  },
97
97
  {
98
- "variant": "caption",
98
+ "name": "description",
99
99
  "label": "Description",
100
- "name": "description"
100
+ "variant": "caption"
101
101
  },
102
102
  {
103
103
  "name": "status",
@@ -109,7 +109,7 @@
109
109
  "listens": [
110
110
  {
111
111
  "event": "SEARCH",
112
- "triggers": "REFETCH",
112
+ "triggers": "REFETCH_QUERY",
113
113
  "source": {
114
114
  "kind": "trait",
115
115
  "trait": "FilteredItemSearch"
@@ -117,7 +117,7 @@
117
117
  },
118
118
  {
119
119
  "event": "FILTER",
120
- "triggers": "REFETCH",
120
+ "triggers": "REFETCH_FILTER",
121
121
  "source": {
122
122
  "kind": "trait",
123
123
  "trait": "FilteredItemFilter"
@@ -125,7 +125,7 @@
125
125
  },
126
126
  {
127
127
  "event": "PAGE",
128
- "triggers": "REFETCH",
128
+ "triggers": "REFETCH_PAGE",
129
129
  "source": {
130
130
  "kind": "trait",
131
131
  "trait": "FilteredItemPagination"
@@ -220,8 +220,8 @@
220
220
  "FilteredListItem",
221
221
  {
222
222
  "emit": {
223
- "failure": "FilteredListItemLoadFailed",
224
- "success": "FilteredListItemLoaded"
223
+ "success": "FilteredListItemLoaded",
224
+ "failure": "FilteredListItemLoadFailed"
225
225
  }
226
226
  }
227
227
  ],
@@ -230,41 +230,41 @@
230
230
  "main",
231
231
  {
232
232
  "gap": "md",
233
+ "direction": "vertical",
234
+ "className": "max-w-5xl mx-auto w-full",
233
235
  "children": [
234
236
  {
235
237
  "type": "stack",
236
- "align": "center",
237
- "gap": "sm",
238
- "direction": "horizontal",
239
238
  "children": [
240
239
  {
241
240
  "name": "list",
242
241
  "type": "icon"
243
242
  },
244
243
  {
245
- "type": "typography",
246
244
  "content": "Filtered List",
245
+ "type": "typography",
247
246
  "variant": "h2"
248
247
  }
249
- ]
248
+ ],
249
+ "gap": "sm",
250
+ "direction": "horizontal",
251
+ "align": "center"
250
252
  },
251
253
  {
252
254
  "type": "divider"
253
255
  },
254
256
  {
257
+ "type": "stack",
258
+ "direction": "horizontal",
255
259
  "children": [
256
260
  "@trait.FilteredItemSearch",
257
261
  "@trait.FilteredItemFilter"
258
262
  ],
259
- "direction": "horizontal",
260
- "gap": "sm",
261
- "type": "stack"
263
+ "gap": "sm"
262
264
  },
263
265
  "@trait.FilteredItemBrowse",
264
266
  "@trait.FilteredItemPagination"
265
267
  ],
266
- "direction": "vertical",
267
- "className": "max-w-5xl mx-auto w-full",
268
268
  "type": "stack"
269
269
  }
270
270
  ]
@@ -115,28 +115,45 @@
115
115
  ]
116
116
  },
117
117
  {
118
- "key": "REFETCH",
119
- "name": "Refetch",
118
+ "key": "REFETCH_QUERY",
119
+ "name": "Refetch Query",
120
120
  "payloadSchema": [
121
121
  {
122
122
  "name": "query",
123
- "type": "string"
124
- },
123
+ "type": "string",
124
+ "required": true
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "key": "REFETCH_FILTER",
130
+ "name": "Refetch Filter",
131
+ "payloadSchema": [
125
132
  {
126
133
  "name": "field",
127
- "type": "string"
134
+ "type": "string",
135
+ "required": true
128
136
  },
129
137
  {
130
138
  "name": "value",
131
- "type": "string"
132
- },
139
+ "type": "string",
140
+ "required": true
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "key": "REFETCH_PAGE",
146
+ "name": "Refetch Page",
147
+ "payloadSchema": [
133
148
  {
134
149
  "name": "page",
135
- "type": "number"
150
+ "type": "number",
151
+ "required": true
136
152
  },
137
153
  {
138
154
  "name": "pageSize",
139
- "type": "number"
155
+ "type": "number",
156
+ "required": true
140
157
  }
141
158
  ]
142
159
  }
@@ -161,8 +178,8 @@
161
178
  "render-ui",
162
179
  "main",
163
180
  {
164
- "size": "sm",
165
- "type": "spinner"
181
+ "type": "spinner",
182
+ "size": "sm"
166
183
  }
167
184
  ]
168
185
  ]
@@ -176,16 +193,16 @@
176
193
  "render-ui",
177
194
  "main",
178
195
  {
196
+ "direction": "vertical",
179
197
  "children": [
180
198
  {
181
- "entity": "@payload.data",
199
+ "pageSize": "@config.pageSize",
182
200
  "fields": "@config.fields",
183
201
  "type": "data-grid",
184
- "pageSize": "@config.pageSize"
202
+ "entity": "@payload.data"
185
203
  }
186
204
  ],
187
- "type": "stack",
188
- "direction": "vertical"
205
+ "type": "stack"
189
206
  }
190
207
  ]
191
208
  ]
@@ -199,10 +216,10 @@
199
216
  "render-ui",
200
217
  "main",
201
218
  {
202
- "variant": "caption",
203
- "content": "@payload.error",
219
+ "color": "error",
204
220
  "type": "typography",
205
- "color": "error"
221
+ "content": "@payload.error",
222
+ "variant": "caption"
206
223
  }
207
224
  ]
208
225
  ]
@@ -235,7 +252,7 @@
235
252
  {
236
253
  "from": "browsing",
237
254
  "to": "loading",
238
- "event": "REFETCH",
255
+ "event": "REFETCH_QUERY",
239
256
  "effects": [
240
257
  [
241
258
  "fetch",
@@ -244,7 +261,16 @@
244
261
  "emit": {
245
262
  "failure": "BrowseItemLoadFailed",
246
263
  "success": "BrowseItemLoaded"
247
- }
264
+ },
265
+ "filter": [
266
+ "str/includes",
267
+ [
268
+ "object/get",
269
+ "@entity",
270
+ "name"
271
+ ],
272
+ "@payload.query"
273
+ ]
248
274
  }
249
275
  ],
250
276
  [
@@ -257,6 +283,65 @@
257
283
  ]
258
284
  ]
259
285
  },
286
+ {
287
+ "from": "browsing",
288
+ "to": "loading",
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",
324
+ "effects": [
325
+ [
326
+ "fetch",
327
+ "BrowseItem",
328
+ {
329
+ "emit": {
330
+ "failure": "BrowseItemLoadFailed",
331
+ "success": "BrowseItemLoaded"
332
+ }
333
+ }
334
+ ],
335
+ [
336
+ "render-ui",
337
+ "main",
338
+ {
339
+ "type": "spinner",
340
+ "size": "sm"
341
+ }
342
+ ]
343
+ ]
344
+ },
260
345
  {
261
346
  "from": "error",
262
347
  "to": "loading",
@@ -285,13 +370,13 @@
285
370
  ]
286
371
  },
287
372
  "config": {
288
- "pageSize": {
289
- "type": "number",
290
- "default": 0.0
291
- },
292
373
  "fields": {
293
374
  "type": "[object]",
294
375
  "default": []
376
+ },
377
+ "pageSize": {
378
+ "type": "number",
379
+ "default": 0.0
295
380
  }
296
381
  },
297
382
  "scope": "collection"
@@ -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",
73
75
  "filterType": "select",
74
76
  "options": [
75
77
  "active",
76
78
  "inactive",
77
79
  "pending"
78
80
  ],
79
- "field": "status",
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
- "label": "Name",
94
93
  "name": "name",
94
+ "label": "Name",
95
95
  "variant": "h4"
96
96
  },
97
97
  {
98
- "variant": "caption",
98
+ "name": "description",
99
99
  "label": "Description",
100
- "name": "description"
100
+ "variant": "caption"
101
101
  },
102
102
  {
103
103
  "name": "status",
@@ -109,7 +109,7 @@
109
109
  "listens": [
110
110
  {
111
111
  "event": "SEARCH",
112
- "triggers": "REFETCH",
112
+ "triggers": "REFETCH_QUERY",
113
113
  "source": {
114
114
  "kind": "trait",
115
115
  "trait": "FilteredItemSearch"
@@ -117,7 +117,7 @@
117
117
  },
118
118
  {
119
119
  "event": "FILTER",
120
- "triggers": "REFETCH",
120
+ "triggers": "REFETCH_FILTER",
121
121
  "source": {
122
122
  "kind": "trait",
123
123
  "trait": "FilteredItemFilter"
@@ -125,7 +125,7 @@
125
125
  },
126
126
  {
127
127
  "event": "PAGE",
128
- "triggers": "REFETCH",
128
+ "triggers": "REFETCH_PAGE",
129
129
  "source": {
130
130
  "kind": "trait",
131
131
  "trait": "FilteredItemPagination"
@@ -220,8 +220,8 @@
220
220
  "FilteredListItem",
221
221
  {
222
222
  "emit": {
223
- "failure": "FilteredListItemLoadFailed",
224
- "success": "FilteredListItemLoaded"
223
+ "success": "FilteredListItemLoaded",
224
+ "failure": "FilteredListItemLoadFailed"
225
225
  }
226
226
  }
227
227
  ],
@@ -230,41 +230,41 @@
230
230
  "main",
231
231
  {
232
232
  "gap": "md",
233
+ "direction": "vertical",
234
+ "className": "max-w-5xl mx-auto w-full",
233
235
  "children": [
234
236
  {
235
237
  "type": "stack",
236
- "align": "center",
237
- "gap": "sm",
238
- "direction": "horizontal",
239
238
  "children": [
240
239
  {
241
240
  "name": "list",
242
241
  "type": "icon"
243
242
  },
244
243
  {
245
- "type": "typography",
246
244
  "content": "Filtered List",
245
+ "type": "typography",
247
246
  "variant": "h2"
248
247
  }
249
- ]
248
+ ],
249
+ "gap": "sm",
250
+ "direction": "horizontal",
251
+ "align": "center"
250
252
  },
251
253
  {
252
254
  "type": "divider"
253
255
  },
254
256
  {
257
+ "type": "stack",
258
+ "direction": "horizontal",
255
259
  "children": [
256
260
  "@trait.FilteredItemSearch",
257
261
  "@trait.FilteredItemFilter"
258
262
  ],
259
- "direction": "horizontal",
260
- "gap": "sm",
261
- "type": "stack"
263
+ "gap": "sm"
262
264
  },
263
265
  "@trait.FilteredItemBrowse",
264
266
  "@trait.FilteredItemPagination"
265
267
  ],
266
- "direction": "vertical",
267
- "className": "max-w-5xl mx-auto w-full",
268
268
  "type": "stack"
269
269
  }
270
270
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/std",
3
- "version": "13.0.6",
3
+ "version": "13.0.7",
4
4
  "description": "Standard library operators for Almadar (math, string, array, etc.)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",