@mdbase-dev/ui 0.2.1 → 0.2.3

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.
Files changed (67) hide show
  1. package/README.md +119 -0
  2. package/css/controls.css +37 -0
  3. package/css/date-picker.css +176 -0
  4. package/css/filter-builder.css +336 -0
  5. package/css/properties.css +398 -0
  6. package/dist/AnchoredPopover.d.ts +20 -0
  7. package/dist/AnchoredPopover.js +100 -0
  8. package/dist/Combo.d.ts +41 -0
  9. package/dist/Combo.js +82 -0
  10. package/dist/DatePicker.d.ts +69 -0
  11. package/dist/DatePicker.js +317 -0
  12. package/dist/Menu.d.ts +3 -1
  13. package/dist/Menu.js +3 -2
  14. package/dist/QuickCreate.js +1 -16
  15. package/dist/date-picker-model.d.ts +31 -0
  16. package/dist/date-picker-model.js +97 -0
  17. package/dist/filter-builder/AddFilter.d.ts +13 -0
  18. package/dist/filter-builder/AddFilter.js +295 -0
  19. package/dist/filter-builder/FilterBuilder.d.ts +36 -0
  20. package/dist/filter-builder/FilterBuilder.js +225 -0
  21. package/dist/filter-builder/FilterPill.d.ts +17 -0
  22. package/dist/filter-builder/FilterPill.js +494 -0
  23. package/dist/filter-builder/context.d.ts +40 -0
  24. package/dist/filter-builder/context.js +67 -0
  25. package/dist/filter-builder/editors.d.ts +31 -0
  26. package/dist/filter-builder/editors.js +294 -0
  27. package/dist/filter-builder/filter-ast.d.ts +13 -0
  28. package/dist/filter-builder/filter-ast.js +382 -0
  29. package/dist/filter-builder/labels.d.ts +99 -0
  30. package/dist/filter-builder/labels.js +555 -0
  31. package/dist/filter-builder/menu.d.ts +21 -0
  32. package/dist/filter-builder/menu.js +60 -0
  33. package/dist/filter-builder/operators.d.ts +30 -0
  34. package/dist/filter-builder/operators.js +192 -0
  35. package/dist/filter-builder/tree.d.ts +12 -0
  36. package/dist/filter-builder/tree.js +61 -0
  37. package/dist/filter-builder/types.d.ts +69 -0
  38. package/dist/filter-builder/types.js +48 -0
  39. package/dist/filter-builder.d.ts +13 -0
  40. package/dist/filter-builder.js +10 -0
  41. package/dist/glyphs.d.ts +32 -0
  42. package/dist/glyphs.js +143 -0
  43. package/dist/locales/de/messages.json +1 -1
  44. package/dist/locales/en/messages.json +1 -1
  45. package/dist/locales/es/messages.json +1 -1
  46. package/dist/locales/fr/messages.json +1 -1
  47. package/dist/locales/it/messages.json +1 -1
  48. package/dist/locales/ja/messages.json +1 -1
  49. package/dist/locales/ko/messages.json +1 -1
  50. package/dist/locales/pt/messages.json +1 -1
  51. package/dist/locales/ru/messages.json +1 -1
  52. package/dist/locales/zh/messages.json +1 -1
  53. package/dist/popover.d.ts +5 -0
  54. package/dist/popover.js +15 -0
  55. package/dist/properties/PropertyList.d.ts +31 -0
  56. package/dist/properties/PropertyList.js +233 -0
  57. package/dist/properties/PropertyValue.d.ts +42 -0
  58. package/dist/properties/PropertyValue.js +304 -0
  59. package/dist/properties/fields.d.ts +20 -0
  60. package/dist/properties/fields.js +81 -0
  61. package/dist/properties/labels.d.ts +29 -0
  62. package/dist/properties/labels.js +127 -0
  63. package/dist/properties/model.d.ts +52 -0
  64. package/dist/properties/model.js +195 -0
  65. package/dist/properties.d.ts +13 -0
  66. package/dist/properties.js +9 -0
  67. package/package.json +26 -3
@@ -0,0 +1,99 @@
1
+ import { type DateLabels } from "../DatePicker.js";
2
+ /** Every piece of text the filter builder shows. A host passes the ones it words differently. */
3
+ export interface FilterLabels {
4
+ /** The bar's accessible name, unless `ariaLabel` is given. */
5
+ filters: string;
6
+ filter: string;
7
+ addFilter: string;
8
+ match: string;
9
+ matchAll: string;
10
+ matchAny: string;
11
+ exclude: string;
12
+ howFiltersCombine: string;
13
+ all: string;
14
+ any: string;
15
+ none: string;
16
+ everyFilter: string;
17
+ atLeastOne: string;
18
+ noFilter: string;
19
+ howTheseCombine: string;
20
+ /** A nested group's accessible name, from its combinator's name. */
21
+ group: (name: string) => string;
22
+ addFilterToGroup: string;
23
+ addFilterToGroupHint: string;
24
+ removeGroup: string;
25
+ shared: string;
26
+ sharedHint: string;
27
+ /** A shared filter's accessible name. */
28
+ sharedName: (name: string) => string;
29
+ filterOptions: string;
30
+ editAsExpression: string;
31
+ convertToPill: string;
32
+ wrapInOrGroup: string;
33
+ moveToShared: string;
34
+ moveToSharedHint: string;
35
+ moveToView: string;
36
+ remove: string;
37
+ removeFilter: string;
38
+ /** Why a filter on a field the host owns cannot be removed. */
39
+ lockedField: (field: string) => string;
40
+ operator: string;
41
+ changeOperator: string;
42
+ chooseValue: string;
43
+ editValue: string;
44
+ /** An expression pill's accessible name; `text` is empty for a blank one. */
45
+ expressionName: (text: string) => string;
46
+ expression: string;
47
+ editExpression: string;
48
+ celExpression: string;
49
+ celHint: string;
50
+ apply: string;
51
+ customExpression: string;
52
+ filterGroup: string;
53
+ filterGroupHint: string;
54
+ back: string;
55
+ filterByField: string;
56
+ filterByPlaceholder: string;
57
+ fields: string;
58
+ noMatchingFields: string;
59
+ scope: string;
60
+ thisView: string;
61
+ /** Names the `this.*` values offered beside a typed one. */
62
+ contextValues: string;
63
+ compareWith: (expr: string) => string;
64
+ values: string;
65
+ noValues: string;
66
+ addValue: string;
67
+ addValuePlaceholder: string;
68
+ pickOneOrMore: string;
69
+ selected: (count: number) => string;
70
+ /** Beside the button that takes a typed value. */
71
+ enterHint: string;
72
+ notANumber: string;
73
+ /** The date picker's text. */
74
+ date: DateLabels;
75
+ done: string;
76
+ value: string;
77
+ valuePlaceholder: string;
78
+ numberPlaceholder: string;
79
+ yearPlaceholder: string;
80
+ true: string;
81
+ false: string;
82
+ is: string;
83
+ isNot: string;
84
+ isAnyOf: string;
85
+ isNoneOf: string;
86
+ contains: string;
87
+ doesNotContain: string;
88
+ startsWith: string;
89
+ endsWith: string;
90
+ isEmpty: string;
91
+ isNotEmpty: string;
92
+ after: string;
93
+ onOrAfter: string;
94
+ before: string;
95
+ onOrBefore: string;
96
+ yearIs: string;
97
+ }
98
+ /** The filter builder's text in the current language. */
99
+ export declare function filterLabels(): FilterLabels;
@@ -0,0 +1,555 @@
1
+ import { i18n as _i18n } from "@lingui/core";
2
+ import { dateLabels } from "../DatePicker.js";
3
+ /** The filter builder's text in the current language. */
4
+ export function filterLabels() {
5
+ return {
6
+ filters: _i18n._(
7
+ /** i18n */
8
+ {
9
+ id: "cSev-j",
10
+ message: "Filters"
11
+ }),
12
+ filter: _i18n._(
13
+ /** i18n */
14
+ {
15
+ id: "o7J4JM",
16
+ message: "Filter"
17
+ }),
18
+ addFilter: _i18n._(
19
+ /** i18n */
20
+ {
21
+ id: "vCSBPD",
22
+ message: "Add filter"
23
+ }),
24
+ match: _i18n._(
25
+ /** i18n */
26
+ {
27
+ id: "0IAEaX",
28
+ message: "Match"
29
+ }),
30
+ matchAll: _i18n._(
31
+ /** i18n */
32
+ {
33
+ id: "jVpd_O",
34
+ message: "Match all"
35
+ }),
36
+ matchAny: _i18n._(
37
+ /** i18n */
38
+ {
39
+ id: "lNCOhT",
40
+ message: "Match any"
41
+ }),
42
+ exclude: _i18n._(
43
+ /** i18n */
44
+ {
45
+ id: "cqFv88",
46
+ message: "Exclude"
47
+ }),
48
+ howFiltersCombine: _i18n._(
49
+ /** i18n */
50
+ {
51
+ id: "_S8XHC",
52
+ message: "How the filters combine"
53
+ }),
54
+ all: _i18n._(
55
+ /** i18n */
56
+ {
57
+ id: "_yH63z",
58
+ message: "All",
59
+ context: "Filter group: every filter must match"
60
+ }),
61
+ any: _i18n._(
62
+ /** i18n */
63
+ {
64
+ id: "S-HDOL",
65
+ message: "Any",
66
+ context: "Filter group: at least one filter must match"
67
+ }),
68
+ none: _i18n._(
69
+ /** i18n */
70
+ {
71
+ id: "BwgzzX",
72
+ message: "None",
73
+ context: "Filter group: no filter may match"
74
+ }),
75
+ everyFilter: _i18n._(
76
+ /** i18n */
77
+ {
78
+ id: "p618QS",
79
+ message: "every filter"
80
+ }),
81
+ atLeastOne: _i18n._(
82
+ /** i18n */
83
+ {
84
+ id: "lFe0gX",
85
+ message: "at least one"
86
+ }),
87
+ noFilter: _i18n._(
88
+ /** i18n */
89
+ {
90
+ id: "1NChC7",
91
+ message: "no filter"
92
+ }),
93
+ howTheseCombine: _i18n._(
94
+ /** i18n */
95
+ {
96
+ id: "tHir4x",
97
+ message: "How these filters combine"
98
+ }),
99
+ group: name => _i18n._(
100
+ /** i18n */
101
+ {
102
+ id: "qs99Mf",
103
+ message: "{name} group",
104
+ values: {
105
+ name: name
106
+ }
107
+ }),
108
+ addFilterToGroup: _i18n._(
109
+ /** i18n */
110
+ {
111
+ id: "YV8J2T",
112
+ message: "Add filter to group"
113
+ }),
114
+ addFilterToGroupHint: _i18n._(
115
+ /** i18n */
116
+ {
117
+ id: "lYvXVC",
118
+ message: "Add a filter to this group"
119
+ }),
120
+ removeGroup: _i18n._(
121
+ /** i18n */
122
+ {
123
+ id: "qrXszS",
124
+ message: "Remove group"
125
+ }),
126
+ shared: _i18n._(
127
+ /** i18n */
128
+ {
129
+ id: "Uc2Drn",
130
+ message: "Shared",
131
+ context: "A filter every view applies"
132
+ }),
133
+ sharedHint: _i18n._(
134
+ /** i18n */
135
+ {
136
+ id: "q5kkB1",
137
+ message: "Applies to every view"
138
+ }),
139
+ sharedName: name => _i18n._(
140
+ /** i18n */
141
+ {
142
+ id: "jMLjU7",
143
+ message: "Shared: {name}",
144
+ values: {
145
+ name: name
146
+ }
147
+ }),
148
+ filterOptions: _i18n._(
149
+ /** i18n */
150
+ {
151
+ id: "hOenaK",
152
+ message: "Filter options"
153
+ }),
154
+ editAsExpression: _i18n._(
155
+ /** i18n */
156
+ {
157
+ id: "jgmrgq",
158
+ message: "Edit as expression"
159
+ }),
160
+ convertToPill: _i18n._(
161
+ /** i18n */
162
+ {
163
+ id: "1ppIJ_",
164
+ message: "Convert to filter"
165
+ }),
166
+ wrapInOrGroup: _i18n._(
167
+ /** i18n */
168
+ {
169
+ id: "ivP5jI",
170
+ message: "Wrap in \u201Cany\u201D group"
171
+ }),
172
+ moveToShared: _i18n._(
173
+ /** i18n */
174
+ {
175
+ id: "zJRf1l",
176
+ message: "Move to shared"
177
+ }),
178
+ moveToSharedHint: _i18n._(
179
+ /** i18n */
180
+ {
181
+ id: "OkVTu6",
182
+ message: "All views"
183
+ }),
184
+ moveToView: _i18n._(
185
+ /** i18n */
186
+ {
187
+ id: "2dJENC",
188
+ message: "Move to this view"
189
+ }),
190
+ remove: _i18n._(
191
+ /** i18n */
192
+ {
193
+ id: "t_YqKh",
194
+ message: "Remove"
195
+ }),
196
+ removeFilter: _i18n._(
197
+ /** i18n */
198
+ {
199
+ id: "rn2_2V",
200
+ message: "Remove filter"
201
+ }),
202
+ lockedField: field => _i18n._(
203
+ /** i18n */
204
+ {
205
+ id: "Ho-lCO",
206
+ message: "The filter on {field} cannot be removed here",
207
+ values: {
208
+ field: field
209
+ }
210
+ }),
211
+ operator: _i18n._(
212
+ /** i18n */
213
+ {
214
+ id: "tgPwON",
215
+ message: "Operator"
216
+ }),
217
+ changeOperator: _i18n._(
218
+ /** i18n */
219
+ {
220
+ id: "tr9noh",
221
+ message: "Change operator"
222
+ }),
223
+ chooseValue: _i18n._(
224
+ /** i18n */
225
+ {
226
+ id: "s1J1U0",
227
+ message: "Choose value"
228
+ }),
229
+ editValue: _i18n._(
230
+ /** i18n */
231
+ {
232
+ id: "0ovuTj",
233
+ message: "Edit value"
234
+ }),
235
+ expressionName: text => text ? _i18n._(
236
+ /** i18n */
237
+ {
238
+ id: "U6BlL0",
239
+ message: "Expression {text}",
240
+ values: {
241
+ text: text
242
+ }
243
+ }) : _i18n._(
244
+ /** i18n */
245
+ {
246
+ id: "ID3T1n",
247
+ message: "Empty expression"
248
+ }),
249
+ expression: _i18n._(
250
+ /** i18n */
251
+ {
252
+ id: "f7yZJ3",
253
+ message: "expression"
254
+ }),
255
+ editExpression: _i18n._(
256
+ /** i18n */
257
+ {
258
+ id: "9Fl3Wk",
259
+ message: "Edit expression"
260
+ }),
261
+ celExpression: _i18n._(
262
+ /** i18n */
263
+ {
264
+ id: "j0d5Yl",
265
+ message: "CEL expression"
266
+ }),
267
+ celHint: _i18n._(
268
+ /** i18n */
269
+ {
270
+ id: "BJy0vo",
271
+ message: "CEL \xB7 Shift+Enter for a new line"
272
+ }),
273
+ apply: _i18n._(
274
+ /** i18n */
275
+ {
276
+ id: "DB8zMK",
277
+ message: "Apply"
278
+ }),
279
+ customExpression: _i18n._(
280
+ /** i18n */
281
+ {
282
+ id: "HOp4Gd",
283
+ message: "Custom expression"
284
+ }),
285
+ filterGroup: _i18n._(
286
+ /** i18n */
287
+ {
288
+ id: "fEEnB_",
289
+ message: "Filter group"
290
+ }),
291
+ filterGroupHint: _i18n._(
292
+ /** i18n */
293
+ {
294
+ id: "GayyB1",
295
+ message: "Any / All"
296
+ }),
297
+ back: _i18n._(
298
+ /** i18n */
299
+ {
300
+ id: "iH8pgl",
301
+ message: "Back"
302
+ }),
303
+ filterByField: _i18n._(
304
+ /** i18n */
305
+ {
306
+ id: "Sexy3V",
307
+ message: "Filter by field"
308
+ }),
309
+ filterByPlaceholder: _i18n._(
310
+ /** i18n */
311
+ {
312
+ id: "D04C8o",
313
+ message: "Filter by\u2026"
314
+ }),
315
+ fields: _i18n._(
316
+ /** i18n */
317
+ {
318
+ id: "vF68cg",
319
+ message: "Fields"
320
+ }),
321
+ noMatchingFields: _i18n._(
322
+ /** i18n */
323
+ {
324
+ id: "JZ6d8J",
325
+ message: "No matching fields"
326
+ }),
327
+ scope: _i18n._(
328
+ /** i18n */
329
+ {
330
+ id: "wGCRxh",
331
+ message: "Scope",
332
+ context: "Which views a filter applies to"
333
+ }),
334
+ thisView: _i18n._(
335
+ /** i18n */
336
+ {
337
+ id: "7z4cTe",
338
+ message: "This view"
339
+ }),
340
+ contextValues: _i18n._(
341
+ /** i18n */
342
+ {
343
+ id: "25ABS3",
344
+ message: "Values to compare with"
345
+ }),
346
+ compareWith: expr => _i18n._(
347
+ /** i18n */
348
+ {
349
+ id: "oyuy5Y",
350
+ message: "Compare with {expr}",
351
+ values: {
352
+ expr: expr
353
+ }
354
+ }),
355
+ values: _i18n._(
356
+ /** i18n */
357
+ {
358
+ id: "fXVIZq",
359
+ message: "Values"
360
+ }),
361
+ noValues: _i18n._(
362
+ /** i18n */
363
+ {
364
+ id: "NhyYwC",
365
+ message: "No values to choose from."
366
+ }),
367
+ addValue: _i18n._(
368
+ /** i18n */
369
+ {
370
+ id: "5tcmwY",
371
+ message: "Add value"
372
+ }),
373
+ addValuePlaceholder: _i18n._(
374
+ /** i18n */
375
+ {
376
+ id: "K5OihQ",
377
+ message: "Add value\u2026"
378
+ }),
379
+ pickOneOrMore: _i18n._(
380
+ /** i18n */
381
+ {
382
+ id: "K6Fe-k",
383
+ message: "Pick one or more"
384
+ }),
385
+ selected: count => _i18n._(
386
+ /** i18n */
387
+ {
388
+ id: "eEzKKm",
389
+ message: "{count, plural, one {# selected} other {# selected}}",
390
+ values: {
391
+ count: count
392
+ }
393
+ }),
394
+ enterHint: _i18n._(
395
+ /** i18n */
396
+ {
397
+ id: "uZ-Dsu",
398
+ message: "or press Enter"
399
+ }),
400
+ notANumber: _i18n._(
401
+ /** i18n */
402
+ {
403
+ id: "Zzgo5M",
404
+ message: "Not a number"
405
+ }),
406
+ date: dateLabels(),
407
+ done: _i18n._(
408
+ /** i18n */
409
+ {
410
+ id: "DPfwMq",
411
+ message: "Done"
412
+ }),
413
+ value: _i18n._(
414
+ /** i18n */
415
+ {
416
+ id: "wMHvYH",
417
+ message: "Value"
418
+ }),
419
+ valuePlaceholder: _i18n._(
420
+ /** i18n */
421
+ {
422
+ id: "wMHvYH",
423
+ message: "Value"
424
+ }),
425
+ numberPlaceholder: _i18n._(
426
+ /** i18n */
427
+ {
428
+ id: "HptUxX",
429
+ message: "Number"
430
+ }),
431
+ yearPlaceholder: _i18n._(
432
+ /** i18n */
433
+ {
434
+ id: "aVl-DF",
435
+ message: "Year, e.g. 2026"
436
+ }),
437
+ true: _i18n._(
438
+ /** i18n */
439
+ {
440
+ id: "c-xCSz",
441
+ message: "True"
442
+ }),
443
+ false: _i18n._(
444
+ /** i18n */
445
+ {
446
+ id: "ocUvR-",
447
+ message: "False"
448
+ }),
449
+ is: _i18n._(
450
+ /** i18n */
451
+ {
452
+ id: "YzULWJ",
453
+ message: "is",
454
+ context: "Filter operator"
455
+ }),
456
+ isNot: _i18n._(
457
+ /** i18n */
458
+ {
459
+ id: "Bq2GWj",
460
+ message: "is not",
461
+ context: "Filter operator"
462
+ }),
463
+ isAnyOf: _i18n._(
464
+ /** i18n */
465
+ {
466
+ id: "gg9Ng9",
467
+ message: "is any of",
468
+ context: "Filter operator"
469
+ }),
470
+ isNoneOf: _i18n._(
471
+ /** i18n */
472
+ {
473
+ id: "98THPm",
474
+ message: "is none of",
475
+ context: "Filter operator"
476
+ }),
477
+ contains: _i18n._(
478
+ /** i18n */
479
+ {
480
+ id: "v8-D03",
481
+ message: "contains",
482
+ context: "Filter operator"
483
+ }),
484
+ doesNotContain: _i18n._(
485
+ /** i18n */
486
+ {
487
+ id: "iKnJF4",
488
+ message: "does not contain",
489
+ context: "Filter operator"
490
+ }),
491
+ startsWith: _i18n._(
492
+ /** i18n */
493
+ {
494
+ id: "W1HfMY",
495
+ message: "starts with",
496
+ context: "Filter operator"
497
+ }),
498
+ endsWith: _i18n._(
499
+ /** i18n */
500
+ {
501
+ id: "TXsVkC",
502
+ message: "ends with",
503
+ context: "Filter operator"
504
+ }),
505
+ isEmpty: _i18n._(
506
+ /** i18n */
507
+ {
508
+ id: "LbyZwZ",
509
+ message: "is empty",
510
+ context: "Filter operator"
511
+ }),
512
+ isNotEmpty: _i18n._(
513
+ /** i18n */
514
+ {
515
+ id: "-CEb9L",
516
+ message: "is not empty",
517
+ context: "Filter operator"
518
+ }),
519
+ after: _i18n._(
520
+ /** i18n */
521
+ {
522
+ id: "rOD8RY",
523
+ message: "after",
524
+ context: "Filter operator"
525
+ }),
526
+ onOrAfter: _i18n._(
527
+ /** i18n */
528
+ {
529
+ id: "TuJKx4",
530
+ message: "on or after",
531
+ context: "Filter operator"
532
+ }),
533
+ before: _i18n._(
534
+ /** i18n */
535
+ {
536
+ id: "zjvje9",
537
+ message: "before",
538
+ context: "Filter operator"
539
+ }),
540
+ onOrBefore: _i18n._(
541
+ /** i18n */
542
+ {
543
+ id: "hPKD-9",
544
+ message: "on or before",
545
+ context: "Filter operator"
546
+ }),
547
+ yearIs: _i18n._(
548
+ /** i18n */
549
+ {
550
+ id: "bhznEe",
551
+ message: "year is",
552
+ context: "Filter operator"
553
+ })
554
+ };
555
+ }
@@ -0,0 +1,21 @@
1
+ import { type JSX, type ReactNode, type RefObject } from "react";
2
+ export type FilterMenuItem = {
3
+ label: string;
4
+ hint?: string | undefined;
5
+ icon?: ReactNode;
6
+ checked?: boolean;
7
+ danger?: boolean;
8
+ onSelect: () => void;
9
+ } | "separator";
10
+ /**
11
+ * One of the bar's menus: the shared menu beside the pill segment that opened it. Rows with
12
+ * `checked` set are a single choice; the menu opens on the chosen one.
13
+ */
14
+ export declare function FilterMenu({ open, anchor, label, items, onClose }: {
15
+ open: boolean;
16
+ anchor: RefObject<HTMLElement | null>;
17
+ label: string;
18
+ items: FilterMenuItem[];
19
+ /** `refocus` is true after Escape: the anchor takes the focus back. */
20
+ onClose: (refocus: boolean) => void;
21
+ }): JSX.Element;