@threadlabs/looma 0.6.3 → 0.6.5
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/components/ui-tree-item/ui-tree-item.html +68 -12
- package/components/ui-tree-item/ui-tree-item.js +9 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/styles/ui-affordance-scope.css +1 -1
- package/styles/ui-avatar-group.css +1 -1
- package/styles/ui-avatar.css +1 -1
- package/styles/ui-badge.css +1 -1
- package/styles/ui-button.css +1 -1
- package/styles/ui-callout.css +1 -1
- package/styles/ui-checkbox.css +1 -1
- package/styles/ui-cluster.css +1 -1
- package/styles/ui-combobox.css +1 -1
- package/styles/ui-container.css +1 -1
- package/styles/ui-context-menu.css +1 -1
- package/styles/ui-dialog.css +1 -1
- package/styles/ui-disclosure.css +1 -1
- package/styles/ui-editable.css +1 -1
- package/styles/ui-editor-insert-table-grid.css +1 -1
- package/styles/ui-editor-mention-menu.css +1 -1
- package/styles/ui-editor-slash-menu.css +1 -1
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-editor-table-overlay.css +1 -1
- package/styles/ui-editor-table-toolbar.css +1 -1
- package/styles/ui-editor-toolbar.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +1 -1
- package/styles/ui-grid.css +1 -1
- package/styles/ui-icon-button.css +1 -1
- package/styles/ui-icon.css +1 -1
- package/styles/ui-input.css +1 -1
- package/styles/ui-menu-item.css +1 -1
- package/styles/ui-menu.css +1 -1
- package/styles/ui-popover.css +1 -1
- package/styles/ui-radio-group.css +1 -1
- package/styles/ui-radio.css +1 -1
- package/styles/ui-reel.css +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/styles/ui-search-shell.css +1 -1
- package/styles/ui-select.css +1 -1
- package/styles/ui-separator.css +1 -1
- package/styles/ui-sidebar.css +1 -1
- package/styles/ui-stack.css +1 -1
- package/styles/ui-switch.css +1 -1
- package/styles/ui-switcher.css +1 -1
- package/styles/ui-tabs.css +1 -1
- package/styles/ui-textarea.css +1 -1
- package/styles/ui-toast-region.css +1 -1
- package/styles/ui-tooltip.css +1 -1
- package/styles/ui-top-bar.css +1 -1
- package/styles/ui-tree-item.css +75 -12
- package/styles/ui-tree.css +1 -1
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +1 -1
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +1 -1
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +1 -1
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +1 -1
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +1 -1
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +1 -1
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +1 -1
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +1 -1
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +1 -1
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +1 -1
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +1 -1
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +1 -1
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +1 -1
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +1 -1
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +1 -1
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +1 -1
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +1 -1
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +1 -1
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +1 -1
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +1 -1
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +1 -1
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +1 -1
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +1 -1
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +1 -1
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +1 -1
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +1 -1
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +1 -1
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +1 -1
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +1 -1
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +1 -1
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +1 -1
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +1 -1
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +1 -1
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +1 -1
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +1 -1
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +1 -1
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +1 -1
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +1 -1
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +1 -1
- package/vanilla/UiToastRegion.d.ts +1 -1
- package/vanilla/UiToastRegion.js +1 -1
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +1 -1
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +1 -1
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +1 -1
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +2 -2
- package/vue/UiAffordanceScope.vue +8 -84
- package/vue/UiAvatar.d.ts +1 -1
- package/vue/UiAvatar.vue +9 -106
- package/vue/UiAvatarGroup.vue +9 -96
- package/vue/UiBadge.vue +1 -1
- package/vue/UiButton.vue +1 -1
- package/vue/UiCallout.vue +1 -1
- package/vue/UiCheckbox.vue +22 -123
- package/vue/UiCluster.vue +1 -1
- package/vue/UiCombobox.d.ts +1 -1
- package/vue/UiCombobox.vue +224 -475
- package/vue/UiContainer.vue +1 -1
- package/vue/UiContextMenu.vue +34 -141
- package/vue/UiDialog.vue +25 -126
- package/vue/UiDisclosure.vue +26 -138
- package/vue/UiEditable.vue +46 -158
- package/vue/UiEditorInsertTableGrid.vue +19 -138
- package/vue/UiEditorMentionMenu.vue +17 -124
- package/vue/UiEditorSlashMenu.vue +17 -109
- package/vue/UiEditorTableContextMenu.vue +34 -122
- package/vue/UiEditorTableOverlay.vue +61 -167
- package/vue/UiEditorTableToolbar.vue +34 -142
- package/vue/UiEditorToolbar.vue +1 -1
- package/vue/UiFloatingActionButton.vue +1 -1
- package/vue/UiFormField.vue +7 -79
- package/vue/UiGrid.vue +1 -1
- package/vue/UiIcon.vue +8 -84
- package/vue/UiIconButton.vue +7 -79
- package/vue/UiInput.vue +7 -79
- package/vue/UiMenu.vue +42 -127
- package/vue/UiMenuItem.vue +1 -1
- package/vue/UiPopover.vue +25 -121
- package/vue/UiRadio.vue +22 -123
- package/vue/UiRadioGroup.d.ts +1 -1
- package/vue/UiRadioGroup.vue +32 -119
- package/vue/UiReel.vue +1 -1
- package/vue/UiSearchResultRow.vue +1 -1
- package/vue/UiSearchShell.vue +25 -121
- package/vue/UiSelect.vue +7 -79
- package/vue/UiSeparator.vue +1 -1
- package/vue/UiSidebar.vue +32 -133
- package/vue/UiStack.vue +1 -1
- package/vue/UiSwitch.vue +22 -123
- package/vue/UiSwitcher.vue +1 -1
- package/vue/UiTabs.vue +24 -128
- package/vue/UiTextarea.vue +7 -79
- package/vue/UiToastRegion.vue +37 -126
- package/vue/UiTooltip.vue +25 -124
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.vue +56 -137
- package/vue/UiTreeItem.vue +97 -153
- package/vue/chunks/UiAffordanceScope.js +9 -78
- package/vue/chunks/UiAvatar.js +13 -89
- package/vue/chunks/UiAvatarGroup.js +10 -80
- package/vue/chunks/UiBadge.js +1 -1
- package/vue/chunks/UiButton.js +1 -1
- package/vue/chunks/UiCallout.js +1 -1
- package/vue/chunks/UiCheckbox.js +17 -95
- package/vue/chunks/UiCluster.js +1 -1
- package/vue/chunks/UiCombobox.js +114 -325
- package/vue/chunks/UiContainer.js +1 -1
- package/vue/chunks/UiContextMenu.js +21 -113
- package/vue/chunks/UiDialog.js +20 -99
- package/vue/chunks/UiDisclosure.js +22 -112
- package/vue/chunks/UiEditable.js +32 -128
- package/vue/chunks/UiEditorInsertTableGrid.js +22 -116
- package/vue/chunks/UiEditorMentionMenu.js +18 -116
- package/vue/chunks/UiEditorSlashMenu.js +15 -101
- package/vue/chunks/UiEditorTableContextMenu.js +12 -91
- package/vue/chunks/UiEditorTableOverlay.js +29 -120
- package/vue/chunks/UiEditorTableToolbar.js +16 -111
- package/vue/chunks/UiEditorToolbar.js +1 -1
- package/vue/chunks/UiFloatingActionButton.js +1 -1
- package/vue/chunks/UiFormField.js +8 -73
- package/vue/chunks/UiGrid.js +1 -1
- package/vue/chunks/UiIcon.js +9 -78
- package/vue/chunks/UiIconButton.js +8 -73
- package/vue/chunks/UiInput.js +8 -73
- package/vue/chunks/UiMenu.js +25 -111
- package/vue/chunks/UiMenuItem.js +1 -1
- package/vue/chunks/UiPopover.js +18 -105
- package/vue/chunks/UiRadio.js +17 -95
- package/vue/chunks/UiRadioGroup.js +23 -105
- package/vue/chunks/UiReel.js +1 -1
- package/vue/chunks/UiSearchResultRow.js +1 -1
- package/vue/chunks/UiSearchShell.js +17 -94
- package/vue/chunks/UiSelect.js +8 -73
- package/vue/chunks/UiSeparator.js +1 -1
- package/vue/chunks/UiSidebar.js +23 -108
- package/vue/chunks/UiStack.js +1 -1
- package/vue/chunks/UiSwitch.js +17 -95
- package/vue/chunks/UiSwitcher.js +1 -1
- package/vue/chunks/UiTabs.js +22 -103
- package/vue/chunks/UiTextarea.js +8 -73
- package/vue/chunks/UiToastRegion.js +27 -112
- package/vue/chunks/UiTooltip.js +18 -106
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +31 -109
- package/vue/chunks/UiTreeItem.js +35 -118
- package/vue/chunks/host.js +101 -0
- package/vue/components.css +759 -707
- package/vue/host.ts +154 -0
package/vue/UiCombobox.vue
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
<!-- Generated by HTML Next 1.0.0-alpha.
|
|
1
|
+
<!-- Generated by HTML Next 1.0.0-alpha.3 for Vue 3.5. Do not edit. -->
|
|
2
2
|
<script setup lang="ts">
|
|
3
|
-
import {
|
|
4
|
-
computed,
|
|
5
|
-
onBeforeUnmount,
|
|
6
|
-
onMounted,
|
|
7
|
-
ref,
|
|
8
|
-
shallowRef,
|
|
9
|
-
useTemplateRef,
|
|
10
|
-
watchEffect,
|
|
11
|
-
} from 'vue'
|
|
3
|
+
import { computed, ref, useTemplateRef } from 'vue'
|
|
12
4
|
import * as controllerModule from '../components/ui-combobox/ui-combobox.js'
|
|
5
|
+
import { createDispatch, useComponentHost } from './host'
|
|
13
6
|
import UiBadge from './UiBadge.vue'
|
|
14
7
|
import UiTooltip from './UiTooltip.vue'
|
|
15
8
|
|
|
@@ -239,484 +232,240 @@ const hostState = computed(() =>
|
|
|
239
232
|
].filter(Boolean).join(' ')
|
|
240
233
|
)
|
|
241
234
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
&& typeof (detail as Record<string, unknown>)['
|
|
259
|
-
|
|
260
|
-
&& ((detail as Record<string, unknown>)['
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
)
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
),
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
'
|
|
429
|
-
Array.isArray(detail)
|
|
430
|
-
&& (detail as unknown[]).every((
|
|
431
|
-
item: unknown,
|
|
432
|
-
) => (item !== null && typeof item === 'object' && !Array.isArray(item)
|
|
433
|
-
&& typeof (item as Record<string, unknown>)['id'] === 'string'
|
|
434
|
-
&& typeof (item as Record<string, unknown>)['value'] === 'string'
|
|
435
|
-
&& typeof (item as Record<string, unknown>)['label'] === 'string'
|
|
436
|
-
&& ((item as Record<string, unknown>)['group'] === undefined
|
|
437
|
-
|| typeof (item as Record<string, unknown>)['group'] === 'string')
|
|
438
|
-
&& ((item as Record<string, unknown>)['disabled'] === undefined
|
|
439
|
-
|| typeof (item as Record<string, unknown>)['disabled'] === 'boolean')
|
|
440
|
-
&& Object.keys(item as object).every((key) =>
|
|
441
|
-
['id', 'value', 'label', 'group', 'disabled'].includes(key)
|
|
442
|
-
))
|
|
443
|
-
),
|
|
444
|
-
'add-item': (detail) =>
|
|
445
|
-
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
446
|
-
&& ((detail as Record<string, unknown>)['item'] !== null
|
|
447
|
-
&& typeof (detail as Record<string, unknown>)['item'] === 'object'
|
|
448
|
-
&& !Array.isArray((detail as Record<string, unknown>)['item'])
|
|
449
|
-
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['id']
|
|
450
|
-
=== 'string'
|
|
451
|
-
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['value']
|
|
452
|
-
=== 'string'
|
|
453
|
-
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['label']
|
|
454
|
-
=== 'string'
|
|
455
|
-
&& (((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['group']
|
|
456
|
-
=== undefined
|
|
457
|
-
|| typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)[
|
|
458
|
-
'group'
|
|
459
|
-
] === 'string')
|
|
460
|
-
&& (((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['disabled']
|
|
461
|
-
=== undefined
|
|
462
|
-
|| typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)[
|
|
463
|
-
'disabled'
|
|
464
|
-
] === 'boolean')
|
|
465
|
-
&& Object.keys((detail as Record<string, unknown>)['item'] as object).every((key) =>
|
|
466
|
-
['id', 'value', 'label', 'group', 'disabled'].includes(key)
|
|
467
|
-
))
|
|
468
|
-
&& Number.isInteger((detail as Record<string, unknown>)['index'])
|
|
469
|
-
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
470
|
-
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
471
|
-
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
472
|
-
&& Object.keys(detail as object).every((key) =>
|
|
473
|
-
['item', 'index', 'trigger'].includes(key)
|
|
474
|
-
),
|
|
475
|
-
'remove-item': (detail) =>
|
|
476
|
-
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
477
|
-
&& ((detail as Record<string, unknown>)['item'] !== null
|
|
478
|
-
&& typeof (detail as Record<string, unknown>)['item'] === 'object'
|
|
479
|
-
&& !Array.isArray((detail as Record<string, unknown>)['item'])
|
|
480
|
-
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['id']
|
|
481
|
-
=== 'string'
|
|
482
|
-
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['value']
|
|
483
|
-
=== 'string'
|
|
484
|
-
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['label']
|
|
485
|
-
=== 'string'
|
|
486
|
-
&& (((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['group']
|
|
487
|
-
=== undefined
|
|
488
|
-
|| typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)[
|
|
489
|
-
'group'
|
|
490
|
-
] === 'string')
|
|
491
|
-
&& (((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['disabled']
|
|
492
|
-
=== undefined
|
|
493
|
-
|| typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)[
|
|
494
|
-
'disabled'
|
|
495
|
-
] === 'boolean')
|
|
496
|
-
&& Object.keys((detail as Record<string, unknown>)['item'] as object).every((key) =>
|
|
497
|
-
['id', 'value', 'label', 'group', 'disabled'].includes(key)
|
|
498
|
-
))
|
|
499
|
-
&& Number.isInteger((detail as Record<string, unknown>)['index'])
|
|
500
|
-
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
501
|
-
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
502
|
-
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
503
|
-
&& Object.keys(detail as object).every((key) =>
|
|
504
|
-
['item', 'index', 'trigger'].includes(key)
|
|
505
|
-
),
|
|
506
|
-
'create-item': (detail) =>
|
|
507
|
-
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
508
|
-
&& typeof (detail as Record<string, unknown>)['query'] === 'string'
|
|
509
|
-
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
510
|
-
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
511
|
-
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
512
|
-
&& Object.keys(detail as object).every((key) => ['query', 'trigger'].includes(key)),
|
|
513
|
-
}
|
|
514
|
-
if (detail !== undefined && checks[name] !== undefined && !checks[name]!(detail)) {
|
|
515
|
-
throw new TypeError(`HR002: Event \`${name}\` detail does not satisfy its declared type.`)
|
|
516
|
-
}
|
|
517
|
-
const emitEvent = emit as (name: string, detail: unknown) => void
|
|
518
|
-
emitEvent(name, detail)
|
|
519
|
-
if (detail !== null && typeof detail === 'object' && 'query' in detail) {
|
|
520
|
-
emitEvent('update:query', (detail as Record<string, unknown>)['query'])
|
|
521
|
-
}
|
|
522
|
-
if (detail !== null && typeof detail === 'object' && 'value' in detail) {
|
|
523
|
-
emitEvent('update:value', (detail as Record<string, unknown>)['value'])
|
|
524
|
-
}
|
|
525
|
-
return root.value?.dispatchEvent(
|
|
526
|
-
new CustomEvent(name, { bubbles: true, composed: true, ...declared[name], detail }),
|
|
527
|
-
) ?? true
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
function read(name: string): unknown {
|
|
531
|
-
if (name === 'internalItems') return internalItems.value
|
|
532
|
-
if (name === 'raw') return raw.value
|
|
533
|
-
if (name === 'display') return display.value
|
|
534
|
-
if (name === 'selected') return selected.value
|
|
535
|
-
if (name === 'expanded') return expanded.value
|
|
536
|
-
if (name === 'rows') return rows.value
|
|
537
|
-
if (name === 'active') return active.value
|
|
538
|
-
if (name === 'loading') return loading.value
|
|
539
|
-
if (name === 'helpOpen') return helpOpen.value
|
|
540
|
-
if (name === 'lookupError') return lookupError.value
|
|
541
|
-
if (name === 'validation') return validation.value
|
|
542
|
-
if (name === 'uid') return uid.value
|
|
543
|
-
if (name === 'groups') return groups.value
|
|
544
|
-
if (name === 'creatable') return creatable.value
|
|
545
|
-
if (name === 'createIndex') return createIndex.value
|
|
546
|
-
if (name === 'message') return message.value
|
|
547
|
-
if (name === 'statusText') return statusText.value
|
|
548
|
-
if (name === 'validationStatus') return validationStatus.value
|
|
549
|
-
return (props as Record<string, unknown>)[name]
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
function write(name: string, value: unknown): boolean {
|
|
553
|
-
if (name === 'internalItems') {
|
|
554
|
-
internalItems.value = value as never
|
|
555
|
-
return true
|
|
556
|
-
}
|
|
557
|
-
if (name === 'raw') {
|
|
558
|
-
raw.value = value as never
|
|
559
|
-
return true
|
|
560
|
-
}
|
|
561
|
-
if (name === 'display') {
|
|
562
|
-
display.value = value as never
|
|
563
|
-
return true
|
|
564
|
-
}
|
|
565
|
-
if (name === 'selected') {
|
|
566
|
-
selected.value = value as never
|
|
567
|
-
return true
|
|
568
|
-
}
|
|
569
|
-
if (name === 'expanded') {
|
|
570
|
-
expanded.value = value as never
|
|
571
|
-
return true
|
|
572
|
-
}
|
|
573
|
-
if (name === 'rows') {
|
|
574
|
-
rows.value = value as never
|
|
575
|
-
return true
|
|
576
|
-
}
|
|
577
|
-
if (name === 'active') {
|
|
578
|
-
active.value = value as never
|
|
579
|
-
return true
|
|
580
|
-
}
|
|
581
|
-
if (name === 'loading') {
|
|
582
|
-
loading.value = value as never
|
|
583
|
-
return true
|
|
584
|
-
}
|
|
585
|
-
if (name === 'helpOpen') {
|
|
586
|
-
helpOpen.value = value as never
|
|
587
|
-
return true
|
|
588
|
-
}
|
|
589
|
-
if (name === 'lookupError') {
|
|
590
|
-
lookupError.value = value as never
|
|
591
|
-
return true
|
|
592
|
-
}
|
|
593
|
-
if (name === 'validation') {
|
|
594
|
-
validation.value = value as never
|
|
595
|
-
return true
|
|
596
|
-
}
|
|
597
|
-
if (name === 'uid') {
|
|
598
|
-
uid.value = value as never
|
|
599
|
-
return true
|
|
600
|
-
}
|
|
601
|
-
if (name === 'groups') {
|
|
602
|
-
groups.value = value as never
|
|
603
|
-
return true
|
|
604
|
-
}
|
|
605
|
-
if (name === 'creatable') {
|
|
606
|
-
creatable.value = value as never
|
|
607
|
-
return true
|
|
608
|
-
}
|
|
609
|
-
if (name === 'createIndex') {
|
|
610
|
-
createIndex.value = value as never
|
|
611
|
-
return true
|
|
612
|
-
}
|
|
613
|
-
if (name === 'message') {
|
|
614
|
-
message.value = value as never
|
|
615
|
-
return true
|
|
616
|
-
}
|
|
617
|
-
if (name === 'statusText') {
|
|
618
|
-
statusText.value = value as never
|
|
619
|
-
return true
|
|
620
|
-
}
|
|
621
|
-
if (name === 'validationStatus') {
|
|
622
|
-
validationStatus.value = value as never
|
|
623
|
-
return true
|
|
624
|
-
}
|
|
625
|
-
throw new TypeError(`Only declared state is writable; \`${name}\` is not.`)
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
const stops: Array<() => void> = []
|
|
629
|
-
const host = {
|
|
630
|
-
get element(): Element {
|
|
631
|
-
return root.value as Element
|
|
235
|
+
const isQueryChangeDetail = (detail: unknown): boolean =>
|
|
236
|
+
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
237
|
+
&& typeof (detail as Record<string, unknown>)['query'] === 'string'
|
|
238
|
+
&& typeof (detail as Record<string, unknown>)['display'] === 'string'
|
|
239
|
+
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
240
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
241
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
242
|
+
&& Object.keys(detail as object).every((key) => ['query', 'display', 'trigger'].includes(key))
|
|
243
|
+
const isValueChangeDetail = (detail: unknown): boolean =>
|
|
244
|
+
(detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
245
|
+
&& (typeof (detail as Record<string, unknown>)['value'] === 'string'
|
|
246
|
+
|| (detail as Record<string, unknown>)['value'] === null)
|
|
247
|
+
&& typeof (detail as Record<string, unknown>)['query'] === 'string'
|
|
248
|
+
&& (((detail as Record<string, unknown>)['option'] !== null
|
|
249
|
+
&& typeof (detail as Record<string, unknown>)['option'] === 'object'
|
|
250
|
+
&& !Array.isArray((detail as Record<string, unknown>)['option'])
|
|
251
|
+
&& typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['id']
|
|
252
|
+
=== 'string'
|
|
253
|
+
&& typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['value']
|
|
254
|
+
=== 'string'
|
|
255
|
+
&& typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['label']
|
|
256
|
+
=== 'string'
|
|
257
|
+
&& (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['group']
|
|
258
|
+
=== undefined
|
|
259
|
+
|| typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
|
|
260
|
+
'group'
|
|
261
|
+
] === 'string')
|
|
262
|
+
&& (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['disabled']
|
|
263
|
+
=== undefined
|
|
264
|
+
|| typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
|
|
265
|
+
'disabled'
|
|
266
|
+
] === 'boolean')
|
|
267
|
+
&& Object.keys((detail as Record<string, unknown>)['option'] as object).every((key) =>
|
|
268
|
+
['id', 'value', 'label', 'group', 'disabled'].includes(key)
|
|
269
|
+
)) || (detail as Record<string, unknown>)['option'] === null)
|
|
270
|
+
&& ((detail as Record<string, unknown>)['kind'] === 'selection'
|
|
271
|
+
|| (detail as Record<string, unknown>)['kind'] === 'clear'
|
|
272
|
+
|| (detail as Record<string, unknown>)['kind'] === 'free-entry'
|
|
273
|
+
|| (detail as Record<string, unknown>)['kind'] === 'create')
|
|
274
|
+
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
275
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
276
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
277
|
+
&& Object.keys(detail as object).every((key) =>
|
|
278
|
+
['value', 'query', 'option', 'kind', 'trigger'].includes(key)
|
|
279
|
+
))
|
|
280
|
+
|| (Array.isArray(detail)
|
|
281
|
+
&& (detail as unknown[]).every((
|
|
282
|
+
item: unknown,
|
|
283
|
+
) => (item !== null && typeof item === 'object' && !Array.isArray(item)
|
|
284
|
+
&& typeof (item as Record<string, unknown>)['id'] === 'string'
|
|
285
|
+
&& typeof (item as Record<string, unknown>)['value'] === 'string'
|
|
286
|
+
&& typeof (item as Record<string, unknown>)['label'] === 'string'
|
|
287
|
+
&& ((item as Record<string, unknown>)['group'] === undefined
|
|
288
|
+
|| typeof (item as Record<string, unknown>)['group'] === 'string')
|
|
289
|
+
&& ((item as Record<string, unknown>)['disabled'] === undefined
|
|
290
|
+
|| typeof (item as Record<string, unknown>)['disabled'] === 'boolean')
|
|
291
|
+
&& Object.keys(item as object).every((key) =>
|
|
292
|
+
['id', 'value', 'label', 'group', 'disabled'].includes(key)
|
|
293
|
+
))
|
|
294
|
+
))
|
|
295
|
+
const isFreeEntryDetail = (detail: unknown): boolean =>
|
|
296
|
+
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
297
|
+
&& (typeof (detail as Record<string, unknown>)['value'] === 'string'
|
|
298
|
+
|| (detail as Record<string, unknown>)['value'] === null)
|
|
299
|
+
&& typeof (detail as Record<string, unknown>)['query'] === 'string'
|
|
300
|
+
&& (((detail as Record<string, unknown>)['option'] !== null
|
|
301
|
+
&& typeof (detail as Record<string, unknown>)['option'] === 'object'
|
|
302
|
+
&& !Array.isArray((detail as Record<string, unknown>)['option'])
|
|
303
|
+
&& typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['id']
|
|
304
|
+
=== 'string'
|
|
305
|
+
&& typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['value']
|
|
306
|
+
=== 'string'
|
|
307
|
+
&& typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['label']
|
|
308
|
+
=== 'string'
|
|
309
|
+
&& (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['group']
|
|
310
|
+
=== undefined
|
|
311
|
+
|| typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['group']
|
|
312
|
+
=== 'string')
|
|
313
|
+
&& (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['disabled']
|
|
314
|
+
=== undefined
|
|
315
|
+
|| typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
|
|
316
|
+
'disabled'
|
|
317
|
+
] === 'boolean')
|
|
318
|
+
&& Object.keys((detail as Record<string, unknown>)['option'] as object).every((key) =>
|
|
319
|
+
['id', 'value', 'label', 'group', 'disabled'].includes(key)
|
|
320
|
+
)) || (detail as Record<string, unknown>)['option'] === null)
|
|
321
|
+
&& ((detail as Record<string, unknown>)['kind'] === 'selection'
|
|
322
|
+
|| (detail as Record<string, unknown>)['kind'] === 'clear'
|
|
323
|
+
|| (detail as Record<string, unknown>)['kind'] === 'free-entry'
|
|
324
|
+
|| (detail as Record<string, unknown>)['kind'] === 'create')
|
|
325
|
+
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
326
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
327
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
328
|
+
&& Object.keys(detail as object).every((key) =>
|
|
329
|
+
['value', 'query', 'option', 'kind', 'trigger'].includes(key)
|
|
330
|
+
)
|
|
331
|
+
const isValidationChangeDetail = (detail: unknown): boolean =>
|
|
332
|
+
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
333
|
+
&& ((detail as Record<string, unknown>)['status'] === 'pristine'
|
|
334
|
+
|| (detail as Record<string, unknown>)['status'] === 'pending'
|
|
335
|
+
|| (detail as Record<string, unknown>)['status'] === 'valid'
|
|
336
|
+
|| (detail as Record<string, unknown>)['status'] === 'warning'
|
|
337
|
+
|| (detail as Record<string, unknown>)['status'] === 'error')
|
|
338
|
+
&& typeof (detail as Record<string, unknown>)['touched'] === 'boolean'
|
|
339
|
+
&& typeof (detail as Record<string, unknown>)['dirty'] === 'boolean'
|
|
340
|
+
&& (Array.isArray((detail as Record<string, unknown>)['issues'])
|
|
341
|
+
&& ((detail as Record<string, unknown>)['issues'] as unknown[]).every((
|
|
342
|
+
item: unknown,
|
|
343
|
+
) => (item !== null && typeof item === 'object' && !Array.isArray(item)
|
|
344
|
+
&& typeof (item as Record<string, unknown>)['message'] === 'string'
|
|
345
|
+
&& ((item as Record<string, unknown>)['path'] === undefined
|
|
346
|
+
|| (Array.isArray((item as Record<string, unknown>)['path'])
|
|
347
|
+
&& ((item as Record<string, unknown>)['path'] as unknown[]).every((item: unknown) =>
|
|
348
|
+
true
|
|
349
|
+
)))
|
|
350
|
+
&& ((item as Record<string, unknown>)['severity'] === undefined
|
|
351
|
+
|| ((item as Record<string, unknown>)['severity'] === 'error'
|
|
352
|
+
|| (item as Record<string, unknown>)['severity'] === 'warning'))
|
|
353
|
+
&& Object.keys(item as object).every((key) =>
|
|
354
|
+
['message', 'path', 'severity'].includes(key)
|
|
355
|
+
))
|
|
356
|
+
))
|
|
357
|
+
&& ((detail as Record<string, unknown>)['output'] === undefined || true)
|
|
358
|
+
&& Object.keys(detail as object).every((key) =>
|
|
359
|
+
['status', 'touched', 'dirty', 'issues', 'output'].includes(key)
|
|
360
|
+
)
|
|
361
|
+
const isOptionsChangeDetail = (detail: unknown): boolean =>
|
|
362
|
+
Array.isArray(detail)
|
|
363
|
+
&& (detail as unknown[]).every((
|
|
364
|
+
item: unknown,
|
|
365
|
+
) => (item !== null && typeof item === 'object' && !Array.isArray(item)
|
|
366
|
+
&& typeof (item as Record<string, unknown>)['id'] === 'string'
|
|
367
|
+
&& typeof (item as Record<string, unknown>)['value'] === 'string'
|
|
368
|
+
&& typeof (item as Record<string, unknown>)['label'] === 'string'
|
|
369
|
+
&& ((item as Record<string, unknown>)['group'] === undefined
|
|
370
|
+
|| typeof (item as Record<string, unknown>)['group'] === 'string')
|
|
371
|
+
&& ((item as Record<string, unknown>)['disabled'] === undefined
|
|
372
|
+
|| typeof (item as Record<string, unknown>)['disabled'] === 'boolean')
|
|
373
|
+
&& Object.keys(item as object).every((key) =>
|
|
374
|
+
['id', 'value', 'label', 'group', 'disabled'].includes(key)
|
|
375
|
+
))
|
|
376
|
+
)
|
|
377
|
+
const isAddItemDetail = (detail: unknown): boolean =>
|
|
378
|
+
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
379
|
+
&& ((detail as Record<string, unknown>)['item'] !== null
|
|
380
|
+
&& typeof (detail as Record<string, unknown>)['item'] === 'object'
|
|
381
|
+
&& !Array.isArray((detail as Record<string, unknown>)['item'])
|
|
382
|
+
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['id']
|
|
383
|
+
=== 'string'
|
|
384
|
+
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['value']
|
|
385
|
+
=== 'string'
|
|
386
|
+
&& typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['label']
|
|
387
|
+
=== 'string'
|
|
388
|
+
&& (((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['group']
|
|
389
|
+
=== undefined
|
|
390
|
+
|| typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['group']
|
|
391
|
+
=== 'string')
|
|
392
|
+
&& (((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['disabled']
|
|
393
|
+
=== undefined
|
|
394
|
+
|| typeof ((detail as Record<string, unknown>)['item'] as Record<string, unknown>)['disabled']
|
|
395
|
+
=== 'boolean')
|
|
396
|
+
&& Object.keys((detail as Record<string, unknown>)['item'] as object).every((key) =>
|
|
397
|
+
['id', 'value', 'label', 'group', 'disabled'].includes(key)
|
|
398
|
+
))
|
|
399
|
+
&& Number.isInteger((detail as Record<string, unknown>)['index'])
|
|
400
|
+
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
401
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
402
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
403
|
+
&& Object.keys(detail as object).every((key) => ['item', 'index', 'trigger'].includes(key))
|
|
404
|
+
const isCreateItemDetail = (detail: unknown): boolean =>
|
|
405
|
+
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
406
|
+
&& typeof (detail as Record<string, unknown>)['query'] === 'string'
|
|
407
|
+
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
408
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
409
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
410
|
+
&& Object.keys(detail as object).every((key) => ['query', 'trigger'].includes(key))
|
|
411
|
+
const dispatch = createDispatch(root, emit as (name: string, detail: unknown) => void, {
|
|
412
|
+
checks: {
|
|
413
|
+
'query-change': isQueryChangeDetail,
|
|
414
|
+
'value-change': isValueChangeDetail,
|
|
415
|
+
'free-entry': isFreeEntryDetail,
|
|
416
|
+
'create-entry': isFreeEntryDetail,
|
|
417
|
+
'validation-change': isValidationChangeDetail,
|
|
418
|
+
'options-change': isOptionsChangeDetail,
|
|
419
|
+
'add-item': isAddItemDetail,
|
|
420
|
+
'remove-item': isAddItemDetail,
|
|
421
|
+
'create-item': isCreateItemDetail,
|
|
632
422
|
},
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
423
|
+
modeled: ['query', 'value'],
|
|
424
|
+
})
|
|
425
|
+
|
|
426
|
+
const { host, ready } = useComponentHost(controllerModule.default, {
|
|
427
|
+
root,
|
|
428
|
+
dispatch,
|
|
429
|
+
props,
|
|
637
430
|
refs: {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
},
|
|
644
|
-
get popup(): Element {
|
|
645
|
-
return popupElement.value as Element
|
|
646
|
-
},
|
|
647
|
-
get listbox(): Element {
|
|
648
|
-
return listboxElement.value as Element
|
|
649
|
-
},
|
|
650
|
-
get options(): Element {
|
|
651
|
-
return optionsElement.value as Element
|
|
652
|
-
},
|
|
653
|
-
} as Readonly<Record<string, Element>>,
|
|
654
|
-
elements: new Proxy({} as Record<string, Element | RadioNodeList | undefined>, {
|
|
655
|
-
get: (_target, name) => {
|
|
656
|
-
if (typeof name !== 'string' || root.value === null) return undefined
|
|
657
|
-
const form = root.value instanceof HTMLFormElement
|
|
658
|
-
? root.value
|
|
659
|
-
: root.value.querySelector('form')
|
|
660
|
-
return form?.elements.namedItem(name)
|
|
661
|
-
?? root.value.querySelector(`[name="${CSS.escape(name)}"]`) ?? undefined
|
|
662
|
-
},
|
|
663
|
-
}),
|
|
664
|
-
signal<T>(initialValue: T) {
|
|
665
|
-
const value = shallowRef(initialValue)
|
|
666
|
-
return {
|
|
667
|
-
get: (): T => value.value,
|
|
668
|
-
set: (next: T): void => {
|
|
669
|
-
if (!Object.is(value.value, next)) value.value = next
|
|
670
|
-
},
|
|
671
|
-
update: (next: (current: T) => T): void => {
|
|
672
|
-
const updated = next(value.value)
|
|
673
|
-
if (!Object.is(value.value, updated)) value.value = updated
|
|
674
|
-
},
|
|
675
|
-
}
|
|
676
|
-
},
|
|
677
|
-
computed<T>(compute: () => T) {
|
|
678
|
-
const value = computed(compute)
|
|
679
|
-
return { get: (): T => value.value }
|
|
680
|
-
},
|
|
681
|
-
effect(run: () => void | (() => void)): () => void {
|
|
682
|
-
const stop = watchEffect((onCleanup) => {
|
|
683
|
-
const cleanup = run()
|
|
684
|
-
if (typeof cleanup === 'function') onCleanup(cleanup)
|
|
685
|
-
}, { flush: 'post' })
|
|
686
|
-
stops.push(stop)
|
|
687
|
-
return stop
|
|
431
|
+
field: fieldElement,
|
|
432
|
+
input: inputElement,
|
|
433
|
+
popup: popupElement,
|
|
434
|
+
listbox: listboxElement,
|
|
435
|
+
options: optionsElement,
|
|
688
436
|
},
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
437
|
+
state: {
|
|
438
|
+
internalItems,
|
|
439
|
+
raw,
|
|
440
|
+
display,
|
|
441
|
+
selected,
|
|
442
|
+
expanded,
|
|
443
|
+
rows,
|
|
444
|
+
active,
|
|
445
|
+
loading,
|
|
446
|
+
helpOpen,
|
|
447
|
+
lookupError,
|
|
448
|
+
validation,
|
|
449
|
+
uid,
|
|
450
|
+
groups,
|
|
451
|
+
creatable,
|
|
452
|
+
createIndex,
|
|
453
|
+
message,
|
|
454
|
+
statusText,
|
|
455
|
+
validationStatus,
|
|
695
456
|
},
|
|
696
|
-
dispatch,
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
let cleanup: void | (() => void)
|
|
700
|
-
let ready: Promise<void> | undefined
|
|
701
|
-
onMounted(() => {
|
|
702
|
-
ready = Promise.resolve(controllerModule.default(host as never)).then((result) => {
|
|
703
|
-
cleanup = result
|
|
704
|
-
})
|
|
705
|
-
})
|
|
706
|
-
onBeforeUnmount(() => {
|
|
707
|
-
for (const stop of stops.splice(0)) stop()
|
|
708
|
-
if (typeof cleanup === 'function') cleanup()
|
|
709
457
|
})
|
|
458
|
+
|
|
710
459
|
defineExpose({
|
|
711
460
|
validate: async (...args: unknown[]) => {
|
|
712
|
-
await ready
|
|
461
|
+
await ready()
|
|
713
462
|
return (controllerModule as Record<string, (...values: unknown[]) => unknown>)['validate']!(
|
|
714
463
|
host,
|
|
715
464
|
...args,
|
|
716
465
|
)
|
|
717
466
|
},
|
|
718
467
|
focusInput: async (...args: unknown[]) => {
|
|
719
|
-
await ready
|
|
468
|
+
await ready()
|
|
720
469
|
return (controllerModule as Record<string, (...values: unknown[]) => unknown>)['focusInput']!(
|
|
721
470
|
host,
|
|
722
471
|
...args,
|