@stimulus-plumbers/controllers 0.3.3 → 0.4.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.
package/README.md CHANGED
@@ -31,7 +31,11 @@ import {
31
31
  ComboboxTimeController,
32
32
  ComboboxDropdownController,
33
33
  CalendarMonthController,
34
- CalendarMonthObserverController,
34
+ CalendarMonthSelectorController,
35
+ CalendarYearController,
36
+ CalendarYearSelectorController,
37
+ CalendarDecadeController,
38
+ CalendarDecadeSelectorController,
35
39
  ModalController,
36
40
  PopoverController,
37
41
  DismisserController,
@@ -48,8 +52,12 @@ application.register('input-clearable', InputClearableController)
48
52
  application.register('combobox-date', ComboboxDateController)
49
53
  application.register('combobox-time', ComboboxTimeController)
50
54
  application.register('combobox-dropdown', ComboboxDropdownController)
51
- application.register('calendar-month', CalendarMonthController)
52
- application.register('calendar-month-observer', CalendarMonthObserverController)
55
+ application.register('calendar-month', CalendarMonthController)
56
+ application.register('calendar-month-selector', CalendarMonthSelectorController)
57
+ application.register('calendar-year', CalendarYearController)
58
+ application.register('calendar-year-selector', CalendarYearSelectorController)
59
+ application.register('calendar-decade', CalendarDecadeController)
60
+ application.register('calendar-decade-selector', CalendarDecadeSelectorController)
53
61
  application.register('modal', ModalController)
54
62
  application.register('popover', PopoverController)
55
63
  application.register('dismisser', DismisserController)
@@ -68,14 +76,29 @@ application.register('panner', PannerController)
68
76
  | `combobox-date` | Calendar grid date picker | [docs/component/combobox.md](docs/component/combobox.md#combobox-date) |
69
77
  | `combobox-time` | Drum/scroll-wheel time picker | [docs/component/combobox.md](docs/component/combobox.md#combobox-time) |
70
78
  | `combobox-dropdown` | Listbox with fuzzy filter or server fetch | [docs/component/combobox.md](docs/component/combobox.md#combobox-dropdown) |
71
- | `calendar-month` | Calendar grid renderer | [docs/component/calendar.md](docs/component/calendar.md) |
72
- | `calendar-month-observer` | Click-to-select handler for calendar grids | [docs/component/calendar.md](docs/component/calendar.md#calendar-month-observer) |
79
+ | `calendar-month` | Calendar month grid renders days, handles clicks, dispatches selection events | [docs/component/calendar.md](docs/component/calendar.md) |
80
+ | `calendar-month-selector` | SSR/Turbo thin selector for server-rendered month grids | [docs/component/calendar.md](docs/component/calendar.md#calendar-month-selector) |
81
+ | `calendar-year` | Calendar year grid — renders month buttons, dispatches selection events | [docs/component/calendar.md](docs/component/calendar.md#calendar-year) |
82
+ | `calendar-year-selector` | SSR/Turbo thin selector for server-rendered year grids | [docs/component/calendar.md](docs/component/calendar.md#calendar-year-selector) |
83
+ | `calendar-decade` | Calendar decade grid — renders year buttons, dispatches selection events | [docs/component/calendar.md](docs/component/calendar.md#calendar-decade) |
84
+ | `calendar-decade-selector` | SSR/Turbo thin selector for server-rendered decade grids | [docs/component/calendar.md](docs/component/calendar.md#calendar-decade-selector) |
73
85
  | `modal` | Native `<dialog>` or custom overlay | [docs/component/modal.md](docs/component/modal.md) |
74
86
  | `popover` | Show/hide content with optional remote load | [docs/component/popover.md](docs/component/popover.md) |
75
87
  | `dismisser` | Click-outside dismissal | [docs/component/dismisser.md](docs/component/dismisser.md) |
76
88
  | `flipper` | Floating element positioning | [docs/component/flipper.md](docs/component/flipper.md) |
77
89
  | `clipboard` | Copy-to-clipboard and paste interception | [docs/component/clipboard.md](docs/component/clipboard.md) |
78
- | `panner` | Draggable/pannable content area | |
90
+ | `panner` | Keeps content element within viewport on resize | [docs/component/panner.md](docs/component/panner.md) |
91
+ | `timeline` | Manages expandable timeline event items with keyboard navigation | [docs/component/timeline.md](docs/component/timeline.md) |
92
+
93
+ ## Utilities
94
+
95
+ | Export | Description | Docs |
96
+ |--------|-------------|------|
97
+ | `setExpanded`, `setHidden`, `announce`, `generateId`, `ensureId`, `connectTriggerToTarget` | ARIA state helpers | [docs/utility/accessibility.md](docs/utility/accessibility.md) |
98
+ | `FocusTrap`, `getFocusableElements`, `focusFirst` | Focus management | [docs/utility/accessibility.md](docs/utility/accessibility.md) |
99
+ | `RovingTabIndex`, `ListboxNavigation`, `isActivationKey`, `isArrowKey` | Keyboard interaction | [docs/utility/accessibility.md](docs/utility/accessibility.md) |
100
+ | `Requestor` | Fetch wrapper with lifecycle events | [docs/utility/requestor.md](docs/utility/requestor.md) |
101
+ | `fuzzyMatcher`, `filterOptions` | Option filtering for comboboxes | [docs/utility/researcher.md](docs/utility/researcher.md) |
79
102
 
80
103
  ## Method naming convention
81
104
 
@@ -83,8 +106,8 @@ Controllers follow a consistent naming pattern:
83
106
 
84
107
  | Pattern | Parameter | Role | Example |
85
108
  |---------|-----------|------|---------|
86
- | `x(value)` | raw value | Programmatic API — pure logic, callable directly | `select('us')`, `format('4242…')`, `step(1)`, `filter('query')` |
87
- | `onX(event)` | DOM event | Event adapter — extracts payload, calls programmatic API | `onSelect(event)`, `onChange(event)`, `onPaste(event)`, `onInput(event)`, `onNavigate(event)` |
109
+ | `x(value)` | raw value | Programmatic API — pure logic, callable directly | `select('us')`, `format('4242…')`, `filter('query')` |
110
+ | `onX(event)` | DOM event | Event adapter — extracts payload, calls programmatic API | `onSelect(event)`, `onChange(event)`, `onPaste(event)`, `onInput(event)` |
88
111
  | `past()` | — | Plumber callback — called by plumber after async operation completes | `shown()`, `dismissed()`, `flipped()`, `contentLoaded()` |
89
112
 
90
113
  Wire event adapters via `data-action`; call programmatic APIs directly from other controllers or outlets.
@@ -0,0 +1,386 @@
1
+ {
2
+ "calendar-decade": {
3
+ "identifier": "calendar-decade",
4
+ "targets": [
5
+ "grid"
6
+ ],
7
+ "values": {
8
+ "today": {
9
+ "type": "String",
10
+ "default": ""
11
+ },
12
+ "selected": {
13
+ "type": "String",
14
+ "default": ""
15
+ },
16
+ "since": {
17
+ "type": "String",
18
+ "default": ""
19
+ },
20
+ "till": {
21
+ "type": "String",
22
+ "default": ""
23
+ },
24
+ "current": {
25
+ "type": "Number"
26
+ }
27
+ },
28
+ "outlets": [],
29
+ "classes": []
30
+ },
31
+ "calendar-decade-selector": {
32
+ "identifier": "calendar-decade-selector",
33
+ "targets": [],
34
+ "values": {},
35
+ "outlets": [],
36
+ "classes": []
37
+ },
38
+ "calendar-month": {
39
+ "identifier": "calendar-month",
40
+ "targets": [
41
+ "daysOfWeek",
42
+ "daysOfMonth"
43
+ ],
44
+ "values": {
45
+ "today": {
46
+ "type": "String",
47
+ "default": ""
48
+ },
49
+ "selected": {
50
+ "type": "String",
51
+ "default": ""
52
+ },
53
+ "since": {
54
+ "type": "String",
55
+ "default": ""
56
+ },
57
+ "till": {
58
+ "type": "String",
59
+ "default": ""
60
+ },
61
+ "locales": {
62
+ "type": "Array",
63
+ "default": "['default']"
64
+ },
65
+ "weekdayFormat": {
66
+ "type": "String",
67
+ "default": "short"
68
+ },
69
+ "dayFormat": {
70
+ "type": "String",
71
+ "default": "numeric"
72
+ },
73
+ "daysOfOtherMonth": {
74
+ "type": "Boolean",
75
+ "default": false
76
+ },
77
+ "year": {
78
+ "type": "Number"
79
+ },
80
+ "month": {
81
+ "type": "Number"
82
+ }
83
+ },
84
+ "outlets": [],
85
+ "classes": [
86
+ "dayOfWeek",
87
+ "dayOfMonth",
88
+ "dayOfOtherMonth",
89
+ "row"
90
+ ]
91
+ },
92
+ "calendar-month-selector": {
93
+ "identifier": "calendar-month-selector",
94
+ "targets": [],
95
+ "values": {},
96
+ "outlets": [],
97
+ "classes": []
98
+ },
99
+ "calendar-year": {
100
+ "identifier": "calendar-year",
101
+ "targets": [
102
+ "grid"
103
+ ],
104
+ "values": {
105
+ "today": {
106
+ "type": "String",
107
+ "default": ""
108
+ },
109
+ "selected": {
110
+ "type": "String",
111
+ "default": ""
112
+ },
113
+ "since": {
114
+ "type": "String",
115
+ "default": ""
116
+ },
117
+ "till": {
118
+ "type": "String",
119
+ "default": ""
120
+ },
121
+ "locales": {
122
+ "type": "Array",
123
+ "default": "['default']"
124
+ },
125
+ "monthFormat": {
126
+ "type": "String",
127
+ "default": "short"
128
+ },
129
+ "current": {
130
+ "type": "Number"
131
+ }
132
+ },
133
+ "outlets": [],
134
+ "classes": []
135
+ },
136
+ "calendar-year-selector": {
137
+ "identifier": "calendar-year-selector",
138
+ "targets": [],
139
+ "values": {},
140
+ "outlets": [],
141
+ "classes": []
142
+ },
143
+ "clipboard": {
144
+ "identifier": "clipboard",
145
+ "targets": [
146
+ "source"
147
+ ],
148
+ "values": {
149
+ "contentType": {
150
+ "type": "String",
151
+ "default": "text/plain"
152
+ }
153
+ },
154
+ "outlets": [],
155
+ "classes": []
156
+ },
157
+ "combobox-date": {
158
+ "identifier": "combobox-date",
159
+ "targets": [
160
+ "previous",
161
+ "next",
162
+ "day",
163
+ "month",
164
+ "year",
165
+ "viewTitle"
166
+ ],
167
+ "values": {
168
+ "view": {
169
+ "type": "String",
170
+ "default": "month"
171
+ },
172
+ "locales": {
173
+ "type": "Array",
174
+ "default": "['default']"
175
+ },
176
+ "dayFormat": {
177
+ "type": "String",
178
+ "default": "numeric"
179
+ },
180
+ "monthFormat": {
181
+ "type": "String",
182
+ "default": "long"
183
+ },
184
+ "yearFormat": {
185
+ "type": "String",
186
+ "default": "numeric"
187
+ },
188
+ "date": {
189
+ "type": "String"
190
+ }
191
+ },
192
+ "outlets": [
193
+ "calendar-month",
194
+ "calendar-year",
195
+ "calendar-decade"
196
+ ],
197
+ "classes": []
198
+ },
199
+ "combobox-dropdown": {
200
+ "identifier": "combobox-dropdown",
201
+ "targets": [
202
+ "listbox",
203
+ "loading",
204
+ "empty"
205
+ ],
206
+ "values": {
207
+ "url": {
208
+ "type": "String",
209
+ "default": ""
210
+ },
211
+ "field": {
212
+ "type": "String",
213
+ "default": "q"
214
+ },
215
+ "delay": {
216
+ "type": "Number",
217
+ "default": 300
218
+ }
219
+ },
220
+ "outlets": [],
221
+ "classes": []
222
+ },
223
+ "combobox-time": {
224
+ "identifier": "combobox-time",
225
+ "targets": [
226
+ "hour",
227
+ "minute",
228
+ "period"
229
+ ],
230
+ "values": {},
231
+ "outlets": [],
232
+ "classes": []
233
+ },
234
+ "dismisser": {
235
+ "identifier": "dismisser",
236
+ "targets": [
237
+ "trigger"
238
+ ],
239
+ "values": {},
240
+ "outlets": [],
241
+ "classes": []
242
+ },
243
+ "flipper": {
244
+ "identifier": "flipper",
245
+ "targets": [
246
+ "anchor",
247
+ "reference"
248
+ ],
249
+ "values": {
250
+ "placement": {
251
+ "type": "String",
252
+ "default": "bottom"
253
+ },
254
+ "alignment": {
255
+ "type": "String",
256
+ "default": "start"
257
+ },
258
+ "role": {
259
+ "type": "String",
260
+ "default": "tooltip"
261
+ }
262
+ },
263
+ "outlets": [],
264
+ "classes": []
265
+ },
266
+ "input-clearable": {
267
+ "identifier": "input-clearable",
268
+ "targets": [
269
+ "input",
270
+ "clear"
271
+ ],
272
+ "values": {},
273
+ "outlets": [],
274
+ "classes": []
275
+ },
276
+ "input-combobox": {
277
+ "identifier": "input-combobox",
278
+ "targets": [
279
+ "trigger",
280
+ "input"
281
+ ],
282
+ "values": {
283
+ "minLength": {
284
+ "type": "Number",
285
+ "default": 1
286
+ },
287
+ "value": {
288
+ "type": "String"
289
+ }
290
+ },
291
+ "outlets": [
292
+ "combobox-dropdown"
293
+ ],
294
+ "classes": []
295
+ },
296
+ "input-formatter": {
297
+ "identifier": "input-formatter",
298
+ "targets": [
299
+ "input",
300
+ "toggle"
301
+ ],
302
+ "values": {},
303
+ "outlets": [],
304
+ "classes": []
305
+ },
306
+ "modal": {
307
+ "identifier": "modal",
308
+ "targets": [
309
+ "modal",
310
+ "overlay"
311
+ ],
312
+ "values": {},
313
+ "outlets": [],
314
+ "classes": []
315
+ },
316
+ "panner": {
317
+ "identifier": "panner",
318
+ "targets": [
319
+ "content"
320
+ ],
321
+ "values": {},
322
+ "outlets": [],
323
+ "classes": []
324
+ },
325
+ "popover": {
326
+ "identifier": "popover",
327
+ "targets": [
328
+ "trigger",
329
+ "panel",
330
+ "template",
331
+ "loader"
332
+ ],
333
+ "values": {
334
+ "reload": {
335
+ "type": "String",
336
+ "default": "never"
337
+ },
338
+ "staleAfter": {
339
+ "type": "Number",
340
+ "default": 3600
341
+ },
342
+ "closeOnSelect": {
343
+ "type": "Boolean",
344
+ "default": true
345
+ },
346
+ "announceOpen": {
347
+ "type": "String",
348
+ "default": "Panel opened"
349
+ },
350
+ "announceClose": {
351
+ "type": "String",
352
+ "default": "Panel closed"
353
+ },
354
+ "url": {
355
+ "type": "String"
356
+ },
357
+ "loadedAt": {
358
+ "type": "String"
359
+ }
360
+ },
361
+ "outlets": [],
362
+ "classes": [
363
+ "hidden"
364
+ ]
365
+ },
366
+ "timeline": {
367
+ "identifier": "timeline",
368
+ "targets": [
369
+ "trigger",
370
+ "detail",
371
+ "time"
372
+ ],
373
+ "values": {},
374
+ "outlets": [],
375
+ "classes": []
376
+ },
377
+ "visibility": {
378
+ "identifier": "visibility",
379
+ "targets": [
380
+ "content"
381
+ ],
382
+ "values": {},
383
+ "outlets": [],
384
+ "classes": []
385
+ }
386
+ }