@voidable/ui 0.11.0 → 0.12.1

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 (152) hide show
  1. package/README.md +1 -1
  2. package/dist/angular/index.d.ts +2 -2
  3. package/dist/angular/index.js +2 -1
  4. package/dist/chunks/activation-B8aBarKd.js +4 -0
  5. package/dist/chunks/carousel-C9u0bg5l.js +10 -0
  6. package/dist/chunks/choice-BTrsi7OW.js +16 -0
  7. package/dist/chunks/data-Baycjoo4.js +96 -0
  8. package/dist/chunks/fields-MEqz-olE.js +21 -0
  9. package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
  10. package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
  11. package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
  12. package/dist/chunks/menu-CxRRgkJI.js +21 -0
  13. package/dist/chunks/{modal-DWGkNdNG.js → modal-Cz2-Ov76.js} +23 -15
  14. package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
  15. package/dist/chunks/{overlay-CH7L4N-h.js → overlay-BuV-4Yvt.js} +75 -68
  16. package/dist/chunks/overlay-K1ilWC1p.js +4 -0
  17. package/dist/chunks/pickers-CjlFgNke.js +36 -0
  18. package/dist/chunks/table-BBpqwWEi.js +4 -0
  19. package/dist/chunks/tabs-Buf3EBWq.js +10 -0
  20. package/dist/components/accordion.d.ts +7 -0
  21. package/dist/components/accordion.js +22 -14
  22. package/dist/components/action-input.d.ts +2 -1
  23. package/dist/components/action-input.js +59 -55
  24. package/dist/components/bar-chart.js +41 -40
  25. package/dist/components/breadcrumbs.d.ts +2 -0
  26. package/dist/components/breadcrumbs.js +15 -11
  27. package/dist/components/button.d.ts +7 -0
  28. package/dist/components/button.js +23 -16
  29. package/dist/components/calendar.d.ts +45 -10
  30. package/dist/components/calendar.js +183 -129
  31. package/dist/components/carousel.d.ts +22 -0
  32. package/dist/components/carousel.js +64 -35
  33. package/dist/components/charts/data.d.ts +2 -2
  34. package/dist/components/checkbox-group.js +22 -21
  35. package/dist/components/checkbox.d.ts +7 -0
  36. package/dist/components/checkbox.js +29 -24
  37. package/dist/components/collapsible.d.ts +7 -0
  38. package/dist/components/collapsible.js +19 -11
  39. package/dist/components/color-picker.js +28 -27
  40. package/dist/components/combobox.d.ts +13 -1
  41. package/dist/components/combobox.js +54 -41
  42. package/dist/components/compose-input.d.ts +9 -1
  43. package/dist/components/compose-input.js +28 -16
  44. package/dist/components/dialog.js +1 -1
  45. package/dist/components/donut-chart.js +57 -56
  46. package/dist/components/drawer.js +1 -1
  47. package/dist/components/dropdown-menu.d.ts +22 -0
  48. package/dist/components/dropdown-menu.js +54 -39
  49. package/dist/components/editable.d.ts +11 -1
  50. package/dist/components/editable.js +35 -22
  51. package/dist/components/error-fallback.d.ts +4 -2
  52. package/dist/components/error-fallback.js +34 -28
  53. package/dist/components/file-upload.d.ts +9 -0
  54. package/dist/components/file-upload.js +54 -28
  55. package/dist/components/gauge.js +108 -107
  56. package/dist/components/hamburger.d.ts +7 -0
  57. package/dist/components/hamburger.js +28 -19
  58. package/dist/components/hover-card.d.ts +7 -0
  59. package/dist/components/hover-card.js +22 -14
  60. package/dist/components/indicator.js +15 -14
  61. package/dist/components/input.js +1 -1
  62. package/dist/components/line-chart.js +43 -42
  63. package/dist/components/menu.d.ts +25 -0
  64. package/dist/components/menu.js +55 -33
  65. package/dist/components/multiselect.d.ts +17 -1
  66. package/dist/components/multiselect.js +96 -74
  67. package/dist/components/nav-menu.d.ts +9 -0
  68. package/dist/components/nav-menu.js +30 -23
  69. package/dist/components/number-input.d.ts +15 -1
  70. package/dist/components/number-input.js +71 -37
  71. package/dist/components/pagination.js +25 -24
  72. package/dist/components/pin-input.d.ts +11 -0
  73. package/dist/components/pin-input.js +46 -32
  74. package/dist/components/popover.d.ts +7 -0
  75. package/dist/components/popover.js +21 -13
  76. package/dist/components/radio-group.js +1 -1
  77. package/dist/components/radio.d.ts +10 -1
  78. package/dist/components/radio.js +37 -32
  79. package/dist/components/segmented-control.d.ts +14 -0
  80. package/dist/components/segmented-control.js +40 -28
  81. package/dist/components/sidebar.d.ts +1 -0
  82. package/dist/components/sidebar.js +14 -10
  83. package/dist/components/slider.js +1 -1
  84. package/dist/components/spinner.d.ts +5 -3
  85. package/dist/components/spinner.js +21 -14
  86. package/dist/components/stat.js +1 -1
  87. package/dist/components/status-dot.d.ts +2 -2
  88. package/dist/components/status-dot.js +12 -14
  89. package/dist/components/stepper.d.ts +2 -0
  90. package/dist/components/stepper.js +20 -13
  91. package/dist/components/switch.d.ts +7 -0
  92. package/dist/components/switch.js +24 -16
  93. package/dist/components/table.d.ts +77 -1
  94. package/dist/components/table.js +562 -73
  95. package/dist/components/tabs.d.ts +11 -0
  96. package/dist/components/tabs.js +42 -33
  97. package/dist/components/tag.js +12 -11
  98. package/dist/components/tags-input.d.ts +10 -1
  99. package/dist/components/tags-input.js +42 -30
  100. package/dist/components/textarea.js +1 -1
  101. package/dist/components/toast.d.ts +2 -0
  102. package/dist/components/toast.js +35 -28
  103. package/dist/components/toggle-group.d.ts +8 -0
  104. package/dist/components/toggle-group.js +24 -17
  105. package/dist/components/toggle.d.ts +7 -0
  106. package/dist/components/toggle.js +23 -15
  107. package/dist/components/tooltip.d.ts +7 -0
  108. package/dist/components/tooltip.js +20 -12
  109. package/dist/components.json +96 -74
  110. package/dist/custom-elements.json +4213 -131
  111. package/dist/dev/rules.d.ts +0 -1
  112. package/dist/dev/types.d.ts +3 -1
  113. package/dist/dev.js +244 -113
  114. package/dist/index.d.ts +4 -0
  115. package/dist/index.js +68 -66
  116. package/dist/keyboard-activation.d.ts +9 -9
  117. package/dist/keyboard.d.ts +2 -10
  118. package/dist/keymaps/activation.d.ts +8 -0
  119. package/dist/keymaps/carousel.d.ts +9 -0
  120. package/dist/keymaps/choice.d.ts +21 -0
  121. package/dist/keymaps/fields.d.ts +31 -0
  122. package/dist/keymaps/index.d.ts +2 -0
  123. package/dist/keymaps/menu.d.ts +36 -0
  124. package/dist/keymaps/nav-menu.d.ts +11 -0
  125. package/dist/keymaps/overlay.d.ts +4 -0
  126. package/dist/keymaps/pickers.d.ts +36 -0
  127. package/dist/keymaps/table.d.ts +8 -0
  128. package/dist/keymaps/tabs.d.ts +7 -0
  129. package/dist/keymaps.js +51 -0
  130. package/dist/keys.d.ts +46 -0
  131. package/dist/keys.js +57 -0
  132. package/dist/llms.txt +11 -3
  133. package/dist/messages/ar.d.ts +1 -0
  134. package/dist/messages/ar.js +130 -0
  135. package/dist/messages/fr.d.ts +1 -0
  136. package/dist/messages/fr.js +109 -0
  137. package/dist/messages.d.ts +213 -0
  138. package/dist/messages.js +190 -0
  139. package/dist/modal.d.ts +7 -0
  140. package/dist/reference.md +817 -17
  141. package/dist/testing/index.d.ts +46 -0
  142. package/dist/testing.js +79 -0
  143. package/dist/types/elements.d.ts +89 -73
  144. package/dist/types/react.d.ts +5 -1
  145. package/dist/types/solid.d.ts +5 -1
  146. package/dist/types/solid2.d.ts +4 -0
  147. package/dist/types/svelte.d.ts +5 -1
  148. package/dist/types/vue.d.ts +5 -1
  149. package/dist/vscode.html-custom-data.json +384 -18
  150. package/dist/web-types.json +830 -69
  151. package/package.json +22 -2
  152. package/dist/chunks/data-BpiiNapL.js +0 -95
@@ -1,5 +1,8 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { VoidElement } from '../base.js';
3
+ import { FormSubmission, FormValidityResult } from '../form-control.js';
4
+ import { KeyOverrides } from '../keys.js';
5
+ declare const VoidTable_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
3
6
  /**
4
7
  * Data table around a native `<table>`: sets how it looks (`striped`, `hoverable`, `compact`,
5
8
  * `bordered`, `inset`), how it behaves when the container is narrow (`stack`) and when it is wider
@@ -25,9 +28,35 @@ import { VoidElement } from '../base.js';
25
28
  * scroll vertically too, which is what `sticky-header` needs; without it a sticky header sticks to
26
29
  * the page.
27
30
  *
31
+ * **Sorting.** `data-sort` on a header cell (`data-sort="number"` or `"date"`; text by default) makes the column
32
+ * sortable: the component wraps the header's content in a `<button>`, writes `aria-sort` and, on activation,
33
+ * cycles ascending, descending, none. A cell's `data-sort-value` is the value compared (ISO dates, raw numbers).
34
+ * Text uses `Intl.Collator` for the closest `lang` with numeric collation; empty cells sort last in both
35
+ * directions. One column at a time. `sort` is the column's `data-key` (else its index) and `sort-direction` its direction.
36
+ *
37
+ * **Filtering.** `filter` hides (with `hidden`) the body rows that do not contain every word, ignoring case and accents,
38
+ * in all columns or in the `data-key`s of `filter-columns`. An author-written `<void-table-filter>` holding a search
39
+ * input is wired to it (typing is debounced). A visually hidden live region says "N of M rows" and a
40
+ * `<void-table-empty>` part shows while nothing matches.
41
+ *
42
+ * **Selection.** `selectable` (or `selectable="single"`) wires the checkboxes the author wrote in the rows (a
43
+ * `void-checkbox` or a native one, in the `data-stack="select"` column) and in the header (select all, which acts
44
+ * on the rows shown). Rows are identified by `data-value` (else their position). `value` is the selected row
45
+ * values as a JSON array, submitted with the form when `name` is set. `<void-table-selection>` is shown while
46
+ * anything is selected and `<void-table-select-all>` offers "all N rows" across server pages (`total-rows`,
47
+ * `all-selected`).
48
+ *
49
+ * **Server mode.** `manual` leaves ordering, visibility and selection markup to the server: the table only
50
+ * updates header state and fires the events.
51
+ *
52
+ * Shortcuts are opt-in: the `selectAll` key action has no default key, and `keys='{"selectAll":["Control+a","Meta+a"]}'` lets Ctrl or Cmd plus A inside the body select every shown row.
53
+ *
28
54
  * @cssprop --void-table-max-height - Height at which a scrollable table starts scrolling vertically.
55
+ * @fires {CustomEvent<{ column: string, direction: 'ascending' | 'descending' | 'none' }>} void-sort - A user activated a sortable header; cancelable.
56
+ * @fires {CustomEvent<{ filter: string, shown: number, total: number }>} void-filter - The user changed the filter.
57
+ * @fires {CustomEvent<{ value: string[], all: boolean }>} void-change - The user changed the selection.
29
58
  */
30
- export declare class VoidTable extends VoidElement {
59
+ export declare class VoidTable extends VoidTable_base {
31
60
  #private;
32
61
  /** Shade every other body row. */
33
62
  striped: boolean;
@@ -56,8 +85,54 @@ export declare class VoidTable extends VoidElement {
56
85
  maxHeight: string | null;
57
86
  /** Accessible name of the scroll region (default: the table's caption, then `aria-label`). */
58
87
  label: string | null;
88
+ /** The key (`data-key` of the header cell, else its position) of the column the rows are sorted by. */
89
+ sort: string | null;
90
+ /** Direction of the sort. A `sort` without it is ascending. */
91
+ sortDirection: string | null;
92
+ /** Hides the body rows that do not contain every whitespace-separated word, ignoring case and accents. */
93
+ filter: string | null;
94
+ /** The `data-key`s (or positions), separated by spaces or commas, of the columns `filter` looks at. Default: every column. */
95
+ filterColumns: string | null;
96
+ /**
97
+ * Wires the row checkboxes. Present without a value: any number of rows; `single`: one row at a time.
98
+ */
99
+ selectable: string | null;
100
+ /** The server renders order, visibility, `aria-sort` and selection; the table only fires its events and updates header state. */
101
+ manual: boolean;
102
+ /** How many rows there are in all, across the server's pages. Enables `<void-table-select-all>`. */
103
+ totalRows: number | null;
104
+ /** Every row across the server's pages is selected (the user activated the select-all part). The server applies the action to the full set. */
105
+ allSelected: boolean;
106
+ /** Key actions (JSON): `{"selectAll":["Control+a","Meta+a"]}` turns on select-all by keyboard, which has no default key. */
107
+ keys: KeyOverrides | null;
108
+ /** @internal The actions of this element and their default keys. */
109
+ static readonly keyMap: {
110
+ selectAll: never[];
111
+ };
59
112
  connectedCallback(): void;
60
113
  disconnectedCallback(): void;
114
+ /**
115
+ * The values of the selected rows, as a list; the `value` attribute is the same list as a JSON array
116
+ * (`value='["a","b"]'`), kept in step as the selection changes. Setting it selects those rows (it does not fire `void-change`).
117
+ * Values that match no row are dropped when the rows are known.
118
+ * @default []
119
+ */
120
+ get value(): string[];
121
+ set value(values: string[]);
122
+ /**
123
+ * One entry per selected row. A table that is not `selectable` has nothing to submit: it is form-associated
124
+ * (that is fixed per class, so it is listed in `form.elements` either way) but it adds no entry to the form.
125
+ */
126
+ protected formSubmission(): FormSubmission;
127
+ /** `required` means "select at least one row": it has no meaning on a table that is not `selectable`. */
128
+ protected formValidity(): FormValidityResult | null;
129
+ /**
130
+ * A morph may have reset what a row's checkbox shows or whether a row is hidden without any change a
131
+ * mutation observer sees (a property): the component's own state is written again, nothing is read back.
132
+ */
133
+ protected morphedCallback(): void;
134
+ /** The server rendered a new `value` or `selectable`: re-apply it to the rows. */
135
+ protected serverChangedCallback(names: ReadonlySet<string>): void;
61
136
  protected updated(changed: PropertyValues): void;
62
137
  }
63
138
  declare global {
@@ -65,3 +140,4 @@ declare global {
65
140
  'void-table': VoidTable;
66
141
  }
67
142
  }
143
+ export {};