@fusion.dev/helix-headless 0.0.0-dev
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/LICENSE +21 -0
- package/custom-elements.json +75202 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +2 -0
- package/dist/accordion/item/accordion-item.d.ts +141 -0
- package/dist/accordion/item/accordion-item.js +214 -0
- package/dist/accordion/root/accordion-root.d.ts +57 -0
- package/dist/accordion/root/accordion-root.js +96 -0
- package/dist/announcement/index.d.ts +1 -0
- package/dist/announcement/index.js +1 -0
- package/dist/announcement/root/announcement-root.d.ts +106 -0
- package/dist/announcement/root/announcement-root.js +144 -0
- package/dist/app-header/index.d.ts +1 -0
- package/dist/app-header/index.js +1 -0
- package/dist/app-header/root/app-header-root.d.ts +113 -0
- package/dist/app-header/root/app-header-root.js +147 -0
- package/dist/avatar/group/avatar-group.d.ts +116 -0
- package/dist/avatar/group/avatar-group.js +136 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/root/avatar-root.d.ts +71 -0
- package/dist/avatar/root/avatar-root.js +147 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +1 -0
- package/dist/badge/root/badge-root.d.ts +61 -0
- package/dist/badge/root/badge-root.js +121 -0
- package/dist/bar-chart/index.d.ts +1 -0
- package/dist/bar-chart/index.js +1 -0
- package/dist/bar-chart/root/bar-chart-root.d.ts +266 -0
- package/dist/bar-chart/root/bar-chart-root.js +515 -0
- package/dist/blockquote/index.d.ts +1 -0
- package/dist/blockquote/index.js +1 -0
- package/dist/blockquote/root/blockquote-root.d.ts +51 -0
- package/dist/blockquote/root/blockquote-root.js +84 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +104 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +137 -0
- package/dist/breadcrumbs/index.d.ts +2 -0
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +77 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.js +94 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +1 -0
- package/dist/button/root/button-root.d.ts +251 -0
- package/dist/button/root/button-root.js +401 -0
- package/dist/button-group/index.d.ts +1 -0
- package/dist/button-group/index.js +1 -0
- package/dist/button-group/root/button-group-root.d.ts +62 -0
- package/dist/button-group/root/button-group-root.js +62 -0
- package/dist/callout/index.d.ts +1 -0
- package/dist/callout/index.js +1 -0
- package/dist/callout/root/callout-root.d.ts +72 -0
- package/dist/callout/root/callout-root.js +90 -0
- package/dist/card/index.d.ts +1 -0
- package/dist/card/index.js +1 -0
- package/dist/card/root/card-root.d.ts +54 -0
- package/dist/card/root/card-root.js +71 -0
- package/dist/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +1 -0
- package/dist/carousel/root/carousel-root.d.ts +399 -0
- package/dist/carousel/root/carousel-root.js +723 -0
- package/dist/chat/composer/chat-composer.d.ts +160 -0
- package/dist/chat/composer/chat-composer.js +273 -0
- package/dist/chat/index.d.ts +3 -0
- package/dist/chat/index.js +3 -0
- package/dist/chat/message/chat-message.d.ts +170 -0
- package/dist/chat/message/chat-message.js +271 -0
- package/dist/chat/root/chat-root.d.ts +216 -0
- package/dist/chat/root/chat-root.js +389 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/checkbox/root/checkbox-root.d.ts +108 -0
- package/dist/checkbox/root/checkbox-root.js +207 -0
- package/dist/checkbox-group/index.d.ts +1 -0
- package/dist/checkbox-group/index.js +1 -0
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +155 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +293 -0
- package/dist/code/index.d.ts +1 -0
- package/dist/code/index.js +1 -0
- package/dist/code/root/code-root.d.ts +36 -0
- package/dist/code/root/code-root.js +43 -0
- package/dist/code-block/index.d.ts +1 -0
- package/dist/code-block/index.js +1 -0
- package/dist/code-block/root/code-block-root.d.ts +112 -0
- package/dist/code-block/root/code-block-root.js +155 -0
- package/dist/color-input/index.d.ts +1 -0
- package/dist/color-input/index.js +1 -0
- package/dist/color-input/root/color-input-root.d.ts +227 -0
- package/dist/color-input/root/color-input-root.js +456 -0
- package/dist/color-picker/color.d.ts +74 -0
- package/dist/color-picker/color.js +238 -0
- package/dist/color-picker/index.d.ts +2 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/color-picker/root/color-picker-root.d.ts +303 -0
- package/dist/color-picker/root/color-picker-root.js +576 -0
- package/dist/combobox/index.d.ts +1 -0
- package/dist/combobox/index.js +1 -0
- package/dist/combobox/root/combobox-root.d.ts +396 -0
- package/dist/combobox/root/combobox-root.js +808 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +1 -0
- package/dist/command/root/command-root.d.ts +166 -0
- package/dist/command/root/command-root.js +353 -0
- package/dist/copy-button/index.d.ts +1 -0
- package/dist/copy-button/index.js +1 -0
- package/dist/copy-button/root/copy-button-root.d.ts +154 -0
- package/dist/copy-button/root/copy-button-root.js +225 -0
- package/dist/data-table/index.d.ts +2 -0
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/root/data-table-root.d.ts +392 -0
- package/dist/data-table/root/data-table-root.js +729 -0
- package/dist/data-table/root/order.d.ts +116 -0
- package/dist/data-table/root/order.js +175 -0
- package/dist/date-input/index.d.ts +1 -0
- package/dist/date-input/index.js +1 -0
- package/dist/date-input/root/date-input-root.d.ts +361 -0
- package/dist/date-input/root/date-input-root.js +791 -0
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/index.js +1 -0
- package/dist/date-picker/root/date-picker-root.d.ts +361 -0
- package/dist/date-picker/root/date-picker-root.js +837 -0
- package/dist/dialog/index.d.ts +1 -0
- package/dist/dialog/index.js +1 -0
- package/dist/dialog/root/dialog-root.d.ts +185 -0
- package/dist/dialog/root/dialog-root.js +319 -0
- package/dist/divider/index.d.ts +1 -0
- package/dist/divider/index.js +1 -0
- package/dist/divider/root/divider-root.d.ts +68 -0
- package/dist/divider/root/divider-root.js +116 -0
- package/dist/donut-chart/index.d.ts +1 -0
- package/dist/donut-chart/index.js +1 -0
- package/dist/donut-chart/root/donut-chart-root.d.ts +209 -0
- package/dist/donut-chart/root/donut-chart-root.js +395 -0
- package/dist/drawer/index.d.ts +1 -0
- package/dist/drawer/index.js +1 -0
- package/dist/drawer/root/drawer-root.d.ts +144 -0
- package/dist/drawer/root/drawer-root.js +222 -0
- package/dist/drilldown/index.d.ts +2 -0
- package/dist/drilldown/index.js +2 -0
- package/dist/drilldown/item/drilldown-item.d.ts +87 -0
- package/dist/drilldown/item/drilldown-item.js +152 -0
- package/dist/drilldown/root/drilldown-root.d.ts +115 -0
- package/dist/drilldown/root/drilldown-root.js +263 -0
- package/dist/element-events.generated.d.ts +1 -0
- package/dist/element-events.generated.js +125 -0
- package/dist/empty/index.d.ts +1 -0
- package/dist/empty/index.js +1 -0
- package/dist/empty/root/empty-root.d.ts +47 -0
- package/dist/empty/root/empty-root.js +68 -0
- package/dist/file-input/index.d.ts +1 -0
- package/dist/file-input/index.js +1 -0
- package/dist/file-input/root/file-input-root.d.ts +196 -0
- package/dist/file-input/root/file-input-root.js +488 -0
- package/dist/format-date/index.d.ts +1 -0
- package/dist/format-date/index.js +1 -0
- package/dist/format-date/root/format-date-root.d.ts +151 -0
- package/dist/format-date/root/format-date-root.js +266 -0
- package/dist/heatmap/index.d.ts +2 -0
- package/dist/heatmap/index.js +2 -0
- package/dist/heatmap/root/buckets.d.ts +62 -0
- package/dist/heatmap/root/buckets.js +85 -0
- package/dist/heatmap/root/heatmap-root.d.ts +330 -0
- package/dist/heatmap/root/heatmap-root.js +526 -0
- package/dist/icon/index.d.ts +1 -0
- package/dist/icon/index.js +1 -0
- package/dist/icon/root/icon-root.d.ts +53 -0
- package/dist/icon/root/icon-root.js +93 -0
- package/dist/icon-button/index.d.ts +1 -0
- package/dist/icon-button/index.js +1 -0
- package/dist/icon-button/root/icon-button-root.d.ts +40 -0
- package/dist/icon-button/root/icon-button-root.js +46 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +1 -0
- package/dist/image/root/image-root.d.ts +213 -0
- package/dist/image/root/image-root.js +335 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.js +99 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +1 -0
- package/dist/input/root/input-root.d.ts +281 -0
- package/dist/input/root/input-root.js +472 -0
- package/dist/kbd/index.d.ts +1 -0
- package/dist/kbd/index.js +1 -0
- package/dist/kbd/root/kbd-root.d.ts +98 -0
- package/dist/kbd/root/kbd-root.js +230 -0
- package/dist/legend/index.d.ts +1 -0
- package/dist/legend/index.js +1 -0
- package/dist/legend/root/legend-root.d.ts +83 -0
- package/dist/legend/root/legend-root.js +125 -0
- package/dist/line-chart/index.d.ts +1 -0
- package/dist/line-chart/index.js +1 -0
- package/dist/line-chart/root/line-chart-root.d.ts +238 -0
- package/dist/line-chart/root/line-chart-root.js +365 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +2 -0
- package/dist/list/item/list-item.d.ts +95 -0
- package/dist/list/item/list-item.js +148 -0
- package/dist/list/root/list-root.d.ts +72 -0
- package/dist/list/root/list-root.js +61 -0
- package/dist/listbox/index.d.ts +1 -0
- package/dist/listbox/index.js +1 -0
- package/dist/listbox/root/listbox-root.d.ts +357 -0
- package/dist/listbox/root/listbox-root.js +890 -0
- package/dist/loader/index.d.ts +1 -0
- package/dist/loader/index.js +1 -0
- package/dist/loader/root/loader-root.d.ts +52 -0
- package/dist/loader/root/loader-root.js +74 -0
- package/dist/megamenu/index.d.ts +1 -0
- package/dist/megamenu/index.js +1 -0
- package/dist/megamenu/root/megamenu-root.d.ts +254 -0
- package/dist/megamenu/root/megamenu-root.js +526 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/item/menu-item.d.ts +231 -0
- package/dist/menu/item/menu-item.js +405 -0
- package/dist/menu/root/menu-root.d.ts +158 -0
- package/dist/menu/root/menu-root.js +422 -0
- package/dist/meter/index.d.ts +1 -0
- package/dist/meter/index.js +1 -0
- package/dist/meter/root/meter-root.d.ts +234 -0
- package/dist/meter/root/meter-root.js +316 -0
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/root/navigation-root.d.ts +55 -0
- package/dist/navigation/root/navigation-root.js +130 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/notification/notification.d.ts +181 -0
- package/dist/notifications/notification/notification.js +305 -0
- package/dist/notifications/root/notifications-root.d.ts +168 -0
- package/dist/notifications/root/notifications-root.js +291 -0
- package/dist/number-input/index.d.ts +1 -0
- package/dist/number-input/index.js +1 -0
- package/dist/number-input/root/number-input-root.d.ts +282 -0
- package/dist/number-input/root/number-input-root.js +592 -0
- package/dist/option/group/option-group.d.ts +38 -0
- package/dist/option/group/option-group.js +58 -0
- package/dist/option/index.d.ts +2 -0
- package/dist/option/index.js +2 -0
- package/dist/option/root/option-root.d.ts +194 -0
- package/dist/option/root/option-root.js +247 -0
- package/dist/outline/index.d.ts +1 -0
- package/dist/outline/index.js +1 -0
- package/dist/outline/root/outline-root.d.ts +237 -0
- package/dist/outline/root/outline-root.js +519 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.js +3 -0
- package/dist/pagination/root/pagination-root.d.ts +390 -0
- package/dist/pagination/root/pagination-root.js +695 -0
- package/dist/pagination/size/pagination-size.d.ts +127 -0
- package/dist/pagination/size/pagination-size.js +232 -0
- package/dist/pagination/summary/pagination-summary.d.ts +90 -0
- package/dist/pagination/summary/pagination-summary.js +145 -0
- package/dist/pin-input/index.d.ts +1 -0
- package/dist/pin-input/index.js +1 -0
- package/dist/pin-input/root/pin-input-root.d.ts +292 -0
- package/dist/pin-input/root/pin-input-root.js +553 -0
- package/dist/popover/index.d.ts +1 -0
- package/dist/popover/index.js +1 -0
- package/dist/popover/root/popover-root.d.ts +108 -0
- package/dist/popover/root/popover-root.js +231 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +1 -0
- package/dist/progress/root/progress-root.d.ts +125 -0
- package/dist/progress/root/progress-root.js +212 -0
- package/dist/qr-code/index.d.ts +1 -0
- package/dist/qr-code/index.js +1 -0
- package/dist/qr-code/root/qr-code-root.d.ts +93 -0
- package/dist/qr-code/root/qr-code-root.js +233 -0
- package/dist/quote/index.d.ts +1 -0
- package/dist/quote/index.js +1 -0
- package/dist/quote/root/quote-root.d.ts +36 -0
- package/dist/quote/root/quote-root.js +50 -0
- package/dist/radio/group/radio-group.d.ts +84 -0
- package/dist/radio/group/radio-group.js +170 -0
- package/dist/radio/index.d.ts +2 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/root/radio-root.d.ts +102 -0
- package/dist/radio/root/radio-root.js +151 -0
- package/dist/rating/index.d.ts +1 -0
- package/dist/rating/index.js +1 -0
- package/dist/rating/root/rating-root.d.ts +242 -0
- package/dist/rating/root/rating-root.js +484 -0
- package/dist/scroll-area/index.d.ts +1 -0
- package/dist/scroll-area/index.js +1 -0
- package/dist/scroll-area/root/scroll-area-root.d.ts +96 -0
- package/dist/scroll-area/root/scroll-area-root.js +215 -0
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +1 -0
- package/dist/select/root/select-root.d.ts +170 -0
- package/dist/select/root/select-root.js +419 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton/root/skeleton-root.d.ts +31 -0
- package/dist/skeleton/root/skeleton-root.js +42 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider/root/slider-root.d.ts +235 -0
- package/dist/slider/root/slider-root.js +488 -0
- package/dist/sparkline/index.d.ts +1 -0
- package/dist/sparkline/index.js +1 -0
- package/dist/sparkline/root/sparkline-root.d.ts +147 -0
- package/dist/sparkline/root/sparkline-root.js +278 -0
- package/dist/speed-dial/index.d.ts +2 -0
- package/dist/speed-dial/index.js +2 -0
- package/dist/speed-dial/item/speed-dial-item.d.ts +71 -0
- package/dist/speed-dial/item/speed-dial-item.js +113 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +122 -0
- package/dist/speed-dial/root/speed-dial-root.js +251 -0
- package/dist/splitter/index.d.ts +1 -0
- package/dist/splitter/index.js +1 -0
- package/dist/splitter/root/splitter-root.d.ts +491 -0
- package/dist/splitter/root/splitter-root.js +1030 -0
- package/dist/stat/group/stat-group.d.ts +30 -0
- package/dist/stat/group/stat-group.js +47 -0
- package/dist/stat/index.d.ts +2 -0
- package/dist/stat/index.js +2 -0
- package/dist/stat/root/stat-root.d.ts +62 -0
- package/dist/stat/root/stat-root.js +51 -0
- package/dist/steps/index.d.ts +2 -0
- package/dist/steps/index.js +2 -0
- package/dist/steps/root/steps-root.d.ts +110 -0
- package/dist/steps/root/steps-root.js +130 -0
- package/dist/steps/step/step.d.ts +139 -0
- package/dist/steps/step/step.js +215 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/root/switch-root.d.ts +74 -0
- package/dist/switch/root/switch-root.js +153 -0
- package/dist/table/cell/table-cell.d.ts +34 -0
- package/dist/table/cell/table-cell.js +52 -0
- package/dist/table/column/table-column.d.ts +165 -0
- package/dist/table/column/table-column.js +222 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.js +4 -0
- package/dist/table/root/table-root.d.ts +98 -0
- package/dist/table/root/table-root.js +161 -0
- package/dist/table/row/table-row.d.ts +27 -0
- package/dist/table/row/table-row.js +42 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/index.js +3 -0
- package/dist/tabs/panel/tab-panel.d.ts +67 -0
- package/dist/tabs/panel/tab-panel.js +98 -0
- package/dist/tabs/root/tabs-root.d.ts +123 -0
- package/dist/tabs/root/tabs-root.js +217 -0
- package/dist/tabs/tab/tab.d.ts +64 -0
- package/dist/tabs/tab/tab.js +116 -0
- package/dist/tag/index.d.ts +1 -0
- package/dist/tag/index.js +1 -0
- package/dist/tag/root/tag-root.d.ts +41 -0
- package/dist/tag/root/tag-root.js +67 -0
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +1 -0
- package/dist/textarea/root/textarea-root.d.ts +215 -0
- package/dist/textarea/root/textarea-root.js +380 -0
- package/dist/time-input/index.d.ts +1 -0
- package/dist/time-input/index.js +1 -0
- package/dist/time-input/root/time-input-root.d.ts +322 -0
- package/dist/time-input/root/time-input-root.js +661 -0
- package/dist/time-picker/index.d.ts +1 -0
- package/dist/time-picker/index.js +1 -0
- package/dist/time-picker/root/time-picker-root.d.ts +380 -0
- package/dist/time-picker/root/time-picker-root.js +669 -0
- package/dist/timeline/index.d.ts +2 -0
- package/dist/timeline/index.js +2 -0
- package/dist/timeline/item/timeline-item.d.ts +81 -0
- package/dist/timeline/item/timeline-item.js +128 -0
- package/dist/timeline/root/timeline-root.d.ts +52 -0
- package/dist/timeline/root/timeline-root.js +72 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/item/toast-item.d.ts +183 -0
- package/dist/toast/item/toast-item.js +345 -0
- package/dist/toast/root/toast-root.d.ts +72 -0
- package/dist/toast/root/toast-root.js +87 -0
- package/dist/toggle/group/toggle-group.d.ts +140 -0
- package/dist/toggle/group/toggle-group.js +278 -0
- package/dist/toggle/index.d.ts +2 -0
- package/dist/toggle/index.js +2 -0
- package/dist/toggle/root/toggle-root.d.ts +99 -0
- package/dist/toggle/root/toggle-root.js +146 -0
- package/dist/toolbar/index.d.ts +1 -0
- package/dist/toolbar/index.js +1 -0
- package/dist/toolbar/root/toolbar-root.d.ts +105 -0
- package/dist/toolbar/root/toolbar-root.js +260 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/tooltip/root/tooltip-root.d.ts +388 -0
- package/dist/tooltip/root/tooltip-root.js +707 -0
- package/dist/tour/index.d.ts +2 -0
- package/dist/tour/index.js +2 -0
- package/dist/tour/root/tour-root.d.ts +161 -0
- package/dist/tour/root/tour-root.js +351 -0
- package/dist/tour/stop/tour-stop.d.ts +131 -0
- package/dist/tour/stop/tour-stop.js +249 -0
- package/dist/tree/index.d.ts +2 -0
- package/dist/tree/index.js +2 -0
- package/dist/tree/item/tree-item.d.ts +208 -0
- package/dist/tree/item/tree-item.js +381 -0
- package/dist/tree/root/tree-root.d.ts +88 -0
- package/dist/tree/root/tree-root.js +287 -0
- package/dist/trend/index.d.ts +1 -0
- package/dist/trend/index.js +1 -0
- package/dist/trend/root/trend-root.d.ts +67 -0
- package/dist/trend/root/trend-root.js +106 -0
- package/dist/video/index.d.ts +1 -0
- package/dist/video/index.js +1 -0
- package/dist/video/root/video-root.d.ts +711 -0
- package/dist/video/root/video-root.js +1821 -0
- package/dist/video-playlist/index.d.ts +3 -0
- package/dist/video-playlist/index.js +3 -0
- package/dist/video-playlist/item/video-playlist-item.d.ts +101 -0
- package/dist/video-playlist/item/video-playlist-item.js +162 -0
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +121 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +237 -0
- package/dist/video-playlist/root/video-playlist-root.d.ts +108 -0
- package/dist/video-playlist/root/video-playlist-root.js +218 -0
- package/dist/virtual-list/index.d.ts +1 -0
- package/dist/virtual-list/index.js +1 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +121 -0
- package/dist/virtual-list/root/virtual-list-root.js +221 -0
- package/jsx.d.ts +49767 -0
- package/package.json +77 -0
- package/svelte.d.ts +129 -0
- package/vue.d.ts +9242 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelixHeadlessCommand } from './root/command-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelixHeadlessCommand } from './root/command-root.js';
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import type { PropertyValues, TemplateResult } from 'lit';
|
|
3
|
+
import '../../dialog/index.js';
|
|
4
|
+
import '../../listbox/index.js';
|
|
5
|
+
declare const HelixHeadlessCommand_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & typeof HelixElement;
|
|
6
|
+
/**
|
|
7
|
+
* @summary A list of commands, opened from anywhere and filtered by typing.
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* **The list is `helix-listbox`, filtering and all.** Listbox already owns
|
|
11
|
+
* narrowing, the empty state, the highlight over what matched,
|
|
12
|
+
* `aria-activedescendant`, scrolling an option into view and the keyboard that
|
|
13
|
+
* moves between them. Its own note says a command palette is that list again
|
|
14
|
+
* with something different opening it, and this is that something: a dialog,
|
|
15
|
+
* and a key that summons it.
|
|
16
|
+
*
|
|
17
|
+
* **The value is not kept.** A palette runs a command and forgets it: nothing
|
|
18
|
+
* here is a form control and nothing is submitted, so what it reports is that
|
|
19
|
+
* an option was chosen, once, with `helix-select`. A consumer that wants the
|
|
20
|
+
* last command remembered is a consumer with somewhere better to keep it.
|
|
21
|
+
*
|
|
22
|
+
* **The hotkey is global and the element does not have to be open to hear it.**
|
|
23
|
+
* The listener is on the document, because the point of a palette is that it
|
|
24
|
+
* answers from wherever the reader is, including from inside another control's
|
|
25
|
+
* text field. `mod` is Command on a Mac and Control elsewhere, resolved here so
|
|
26
|
+
* a consumer writes one thing.
|
|
27
|
+
*
|
|
28
|
+
* The filter is emptied as the palette closes, for the reason Combobox and
|
|
29
|
+
* Select both record: a control reopened still narrowed by the last visit's
|
|
30
|
+
* search is one whose second use starts from the first one's leftovers, and a
|
|
31
|
+
* palette is used far more often than either.
|
|
32
|
+
*
|
|
33
|
+
* @since 0.1.0
|
|
34
|
+
* @status stable
|
|
35
|
+
* @category navigation
|
|
36
|
+
* @aliases Command palette, Quick open, Spotlight
|
|
37
|
+
* @documentation https://helix.fusion.dev/components/command
|
|
38
|
+
*
|
|
39
|
+
* @slot - The commands, which are `helix-option` elements and their groups.
|
|
40
|
+
* @slot footer - Under the list, for the keys a reader can press.
|
|
41
|
+
*
|
|
42
|
+
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before it closes. Cancelable: refusing it takes the decision and nothing moves.
|
|
43
|
+
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the palette opens. Cancelable: refusing it takes the decision and nothing moves.
|
|
44
|
+
* @event {HelixSelectEvent} helix-select - Fired when a command is chosen. Cancelable: refusing it takes the decision and nothing moves.
|
|
45
|
+
* @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
|
|
46
|
+
*
|
|
47
|
+
* @csspart dialog - The overlay's own box, forwarded from the dialog.
|
|
48
|
+
* @csspart footer - The row under the list.
|
|
49
|
+
* @csspart listbox - The list inside it.
|
|
50
|
+
* @csspart listbox-empty - Shown when a filter has hidden everything.
|
|
51
|
+
* @csspart listbox-feedback - What is wrong with it.
|
|
52
|
+
* @csspart listbox-filter-icon - The mark beside that field.
|
|
53
|
+
* @csspart listbox-filter-mark - The glyph beside the filter field, where none is slotted.
|
|
54
|
+
* @csspart listbox-hint - Help under the list.
|
|
55
|
+
* @csspart listbox-items - The list itself.
|
|
56
|
+
* @csspart listbox-label - The question, over the list.
|
|
57
|
+
* @csspart listbox-loading - Shown while the options are still on their way.
|
|
58
|
+
* @csspart listbox-search - The region holding the field that narrows the list.
|
|
59
|
+
* @csspart listbox-search-field - The field itself.
|
|
60
|
+
*/
|
|
61
|
+
export declare class HelixHeadlessCommand extends HelixHeadlessCommand_base {
|
|
62
|
+
/**
|
|
63
|
+
* Accessible name for the overlay, which has no visible heading.
|
|
64
|
+
*/
|
|
65
|
+
label: string;
|
|
66
|
+
/**
|
|
67
|
+
* Shown in the field before anything is typed.
|
|
68
|
+
*/
|
|
69
|
+
placeholder: string;
|
|
70
|
+
/**
|
|
71
|
+
* Words shown where the filter has matched nothing.
|
|
72
|
+
*/
|
|
73
|
+
emptyText: string;
|
|
74
|
+
/**
|
|
75
|
+
* The key that opens it, as `mod+k` or `shift+p` or plain `k`.
|
|
76
|
+
*
|
|
77
|
+
* Empty turns it off, for a consumer who opens the palette from a button or
|
|
78
|
+
* from their own shortcut handler. There is no list of defaults to fight
|
|
79
|
+
* with: one key, said once.
|
|
80
|
+
*/
|
|
81
|
+
hotkey: string;
|
|
82
|
+
/**
|
|
83
|
+
* Whether the consumer put anything under the list.
|
|
84
|
+
*
|
|
85
|
+
* Asked of the slot rather than of CSS. A wrapper holding a slot always has a
|
|
86
|
+
* child element, which is the slot, so `:not(:has(*))` on it is never true
|
|
87
|
+
* and an empty footer would draw its rule and its padding over nothing. Steps
|
|
88
|
+
* was caught by the same thing.
|
|
89
|
+
*/
|
|
90
|
+
private footed;
|
|
91
|
+
private get listbox();
|
|
92
|
+
/**
|
|
93
|
+
* Answers the hotkey from wherever the reader is.
|
|
94
|
+
*
|
|
95
|
+
* On the document rather than on this element, which is never the thing with
|
|
96
|
+
* focus: a palette that only answered when it already had focus would be a
|
|
97
|
+
* palette nobody could open.
|
|
98
|
+
*
|
|
99
|
+
* `preventDefault` because every key worth using is already the browser's.
|
|
100
|
+
* Command-K focuses the address bar in some browsers and opens a search in
|
|
101
|
+
* others, and a palette that opened underneath one of those would be a
|
|
102
|
+
* palette the reader never sees.
|
|
103
|
+
*/
|
|
104
|
+
private readonly handleHotkey;
|
|
105
|
+
/**
|
|
106
|
+
* Takes what the list announced and says it under this element's name.
|
|
107
|
+
*
|
|
108
|
+
* The listbox says `helix-before-change`, which is the right word for a control that
|
|
109
|
+
* holds a value and the wrong one for a palette: nothing here changed, a
|
|
110
|
+
* command ran. It is stopped and re-announced rather than relayed, so a
|
|
111
|
+
* consumer hears one event naming the element they put on the page.
|
|
112
|
+
*/
|
|
113
|
+
private readonly handleChange;
|
|
114
|
+
/**
|
|
115
|
+
* The row under the keyboard, read from the attribute the listbox writes.
|
|
116
|
+
*
|
|
117
|
+
* `data-active` rather than a reference the listbox hands over, because the
|
|
118
|
+
* options are this element's own light DOM children and the attribute is
|
|
119
|
+
* already published: asking the listbox would mean a second channel saying
|
|
120
|
+
* what the markup says.
|
|
121
|
+
*/
|
|
122
|
+
private get activeOption();
|
|
123
|
+
/**
|
|
124
|
+
* Takes the row's second destination, where the reader asked for it.
|
|
125
|
+
*
|
|
126
|
+
* **Command intercepts rather than Listbox reporting, and that is the whole
|
|
127
|
+
* design.** Enter belongs to the listbox: it owns the active row, it decides
|
|
128
|
+
* what choosing means, and it announces `helix-before-change`. Teaching it about a
|
|
129
|
+
* modifier would put a palette's idea of a second destination inside a
|
|
130
|
+
* control that is also a select and a combobox, neither of which has one.
|
|
131
|
+
*
|
|
132
|
+
* So this listens in the capture phase, before the listbox sees the key, and
|
|
133
|
+
* only for the one combination that means something here. Anything else falls
|
|
134
|
+
* straight through and the listbox behaves exactly as it always did.
|
|
135
|
+
*
|
|
136
|
+
* `mod` is Command on a Mac and Control elsewhere, which is what `hotkey`
|
|
137
|
+
* already means by it two methods up.
|
|
138
|
+
*
|
|
139
|
+
* The pointer takes the same path for the same reason: a modifier-click on a
|
|
140
|
+
* row is the same intent as a modifier-Enter on it, and both have to be
|
|
141
|
+
* stopped before the row announces its ordinary selection.
|
|
142
|
+
*/
|
|
143
|
+
private readonly handleAlternate;
|
|
144
|
+
private readonly swallowOptionSelect;
|
|
145
|
+
connectedCallback(): void;
|
|
146
|
+
disconnectedCallback(): void;
|
|
147
|
+
protected updated(changed: PropertyValues): void;
|
|
148
|
+
/**
|
|
149
|
+
* The surface the palette opens in, behind a seam the styled tier can move.
|
|
150
|
+
*
|
|
151
|
+
* A method rather than a fragment inline, so a tier above can render its own,
|
|
152
|
+
* wrap this one, pass it a property the base does not know about, or leave it
|
|
153
|
+
* out, without reimplementing the whole template to do any of them. The tag is
|
|
154
|
+
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
155
|
+
* headless element, and a styled subclass that sets `tier` renders the styled one
|
|
156
|
+
* from the same template.
|
|
157
|
+
*/
|
|
158
|
+
protected renderDialog(): TemplateResult;
|
|
159
|
+
protected render(): TemplateResult;
|
|
160
|
+
}
|
|
161
|
+
declare global {
|
|
162
|
+
interface HTMLElementTagNameMap {
|
|
163
|
+
'helix-headless-command': HelixHeadlessCommand;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
export {};
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, HelixElement, HelixSelectEvent, MixinControllerOpen, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { html } from 'lit/static-html.js';
|
|
10
|
+
/* Side-effect imports, because this renders both in its own shadow root and a
|
|
11
|
+
custom element registers on import. The paths are relative, so this registers
|
|
12
|
+
the base pair and the styled file's identical imports register the styled
|
|
13
|
+
pair; `tier` picks which names the template asks for. */
|
|
14
|
+
import '../../dialog/index.js';
|
|
15
|
+
import '../../listbox/index.js';
|
|
16
|
+
/**
|
|
17
|
+
* A hotkey, as the pieces a `keydown` can be compared against.
|
|
18
|
+
*
|
|
19
|
+
* `mod` is the platform's own: Command on a Mac and Control everywhere else,
|
|
20
|
+
* which is what every application means by it and what a consumer would
|
|
21
|
+
* otherwise have to detect and write twice.
|
|
22
|
+
*/
|
|
23
|
+
const parse = (hotkey) => {
|
|
24
|
+
const parts = hotkey.toLowerCase().split('+');
|
|
25
|
+
return {
|
|
26
|
+
alt: parts.includes('alt'),
|
|
27
|
+
key: parts.at(-1) ?? '',
|
|
28
|
+
mod: parts.includes('mod'),
|
|
29
|
+
shift: parts.includes('shift'),
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @summary A list of commands, opened from anywhere and filtered by typing.
|
|
34
|
+
*
|
|
35
|
+
* @description
|
|
36
|
+
* **The list is `helix-listbox`, filtering and all.** Listbox already owns
|
|
37
|
+
* narrowing, the empty state, the highlight over what matched,
|
|
38
|
+
* `aria-activedescendant`, scrolling an option into view and the keyboard that
|
|
39
|
+
* moves between them. Its own note says a command palette is that list again
|
|
40
|
+
* with something different opening it, and this is that something: a dialog,
|
|
41
|
+
* and a key that summons it.
|
|
42
|
+
*
|
|
43
|
+
* **The value is not kept.** A palette runs a command and forgets it: nothing
|
|
44
|
+
* here is a form control and nothing is submitted, so what it reports is that
|
|
45
|
+
* an option was chosen, once, with `helix-select`. A consumer that wants the
|
|
46
|
+
* last command remembered is a consumer with somewhere better to keep it.
|
|
47
|
+
*
|
|
48
|
+
* **The hotkey is global and the element does not have to be open to hear it.**
|
|
49
|
+
* The listener is on the document, because the point of a palette is that it
|
|
50
|
+
* answers from wherever the reader is, including from inside another control's
|
|
51
|
+
* text field. `mod` is Command on a Mac and Control elsewhere, resolved here so
|
|
52
|
+
* a consumer writes one thing.
|
|
53
|
+
*
|
|
54
|
+
* The filter is emptied as the palette closes, for the reason Combobox and
|
|
55
|
+
* Select both record: a control reopened still narrowed by the last visit's
|
|
56
|
+
* search is one whose second use starts from the first one's leftovers, and a
|
|
57
|
+
* palette is used far more often than either.
|
|
58
|
+
*
|
|
59
|
+
* @since 0.1.0
|
|
60
|
+
* @status stable
|
|
61
|
+
* @category navigation
|
|
62
|
+
* @aliases Command palette, Quick open, Spotlight
|
|
63
|
+
* @documentation https://helix.fusion.dev/components/command
|
|
64
|
+
*
|
|
65
|
+
* @slot - The commands, which are `helix-option` elements and their groups.
|
|
66
|
+
* @slot footer - Under the list, for the keys a reader can press.
|
|
67
|
+
*
|
|
68
|
+
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before it closes. Cancelable: refusing it takes the decision and nothing moves.
|
|
69
|
+
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the palette opens. Cancelable: refusing it takes the decision and nothing moves.
|
|
70
|
+
* @event {HelixSelectEvent} helix-select - Fired when a command is chosen. Cancelable: refusing it takes the decision and nothing moves.
|
|
71
|
+
* @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
|
|
72
|
+
*
|
|
73
|
+
* @csspart dialog - The overlay's own box, forwarded from the dialog.
|
|
74
|
+
* @csspart footer - The row under the list.
|
|
75
|
+
* @csspart listbox - The list inside it.
|
|
76
|
+
* @csspart listbox-empty - Shown when a filter has hidden everything.
|
|
77
|
+
* @csspart listbox-feedback - What is wrong with it.
|
|
78
|
+
* @csspart listbox-filter-icon - The mark beside that field.
|
|
79
|
+
* @csspart listbox-filter-mark - The glyph beside the filter field, where none is slotted.
|
|
80
|
+
* @csspart listbox-hint - Help under the list.
|
|
81
|
+
* @csspart listbox-items - The list itself.
|
|
82
|
+
* @csspart listbox-label - The question, over the list.
|
|
83
|
+
* @csspart listbox-loading - Shown while the options are still on their way.
|
|
84
|
+
* @csspart listbox-search - The region holding the field that narrows the list.
|
|
85
|
+
* @csspart listbox-search-field - The field itself.
|
|
86
|
+
*/
|
|
87
|
+
let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpen(HelixElement) {
|
|
88
|
+
constructor() {
|
|
89
|
+
super(...arguments);
|
|
90
|
+
/**
|
|
91
|
+
* Accessible name for the overlay, which has no visible heading.
|
|
92
|
+
*/
|
|
93
|
+
this.label = 'Commands';
|
|
94
|
+
/**
|
|
95
|
+
* Shown in the field before anything is typed.
|
|
96
|
+
*/
|
|
97
|
+
this.placeholder = 'Search commands';
|
|
98
|
+
/**
|
|
99
|
+
* Words shown where the filter has matched nothing.
|
|
100
|
+
*/
|
|
101
|
+
this.emptyText = 'No commands';
|
|
102
|
+
/**
|
|
103
|
+
* The key that opens it, as `mod+k` or `shift+p` or plain `k`.
|
|
104
|
+
*
|
|
105
|
+
* Empty turns it off, for a consumer who opens the palette from a button or
|
|
106
|
+
* from their own shortcut handler. There is no list of defaults to fight
|
|
107
|
+
* with: one key, said once.
|
|
108
|
+
*/
|
|
109
|
+
this.hotkey = 'mod+k';
|
|
110
|
+
/**
|
|
111
|
+
* Whether the consumer put anything under the list.
|
|
112
|
+
*
|
|
113
|
+
* Asked of the slot rather than of CSS. A wrapper holding a slot always has a
|
|
114
|
+
* child element, which is the slot, so `:not(:has(*))` on it is never true
|
|
115
|
+
* and an empty footer would draw its rule and its padding over nothing. Steps
|
|
116
|
+
* was caught by the same thing.
|
|
117
|
+
*/
|
|
118
|
+
this.footed = false;
|
|
119
|
+
/**
|
|
120
|
+
* Answers the hotkey from wherever the reader is.
|
|
121
|
+
*
|
|
122
|
+
* On the document rather than on this element, which is never the thing with
|
|
123
|
+
* focus: a palette that only answered when it already had focus would be a
|
|
124
|
+
* palette nobody could open.
|
|
125
|
+
*
|
|
126
|
+
* `preventDefault` because every key worth using is already the browser's.
|
|
127
|
+
* Command-K focuses the address bar in some browsers and opens a search in
|
|
128
|
+
* others, and a palette that opened underneath one of those would be a
|
|
129
|
+
* palette the reader never sees.
|
|
130
|
+
*/
|
|
131
|
+
this.handleHotkey = (event) => {
|
|
132
|
+
if (this.hotkey === '') {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const wanted = parse(this.hotkey);
|
|
136
|
+
const mod = event.metaKey || event.ctrlKey;
|
|
137
|
+
if (event.key.toLowerCase() !== wanted.key ||
|
|
138
|
+
mod !== wanted.mod ||
|
|
139
|
+
event.shiftKey !== wanted.shift ||
|
|
140
|
+
event.altKey !== wanted.alt) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
this.requestOpen(!this.open);
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Takes what the list announced and says it under this element's name.
|
|
148
|
+
*
|
|
149
|
+
* The listbox says `helix-before-change`, which is the right word for a control that
|
|
150
|
+
* holds a value and the wrong one for a palette: nothing here changed, a
|
|
151
|
+
* command ran. It is stopped and re-announced rather than relayed, so a
|
|
152
|
+
* consumer hears one event naming the element they put on the page.
|
|
153
|
+
*/
|
|
154
|
+
this.handleChange = (event) => {
|
|
155
|
+
event.stopPropagation();
|
|
156
|
+
const { value } = event.detail;
|
|
157
|
+
if (!this.dispatchEvent(new HelixSelectEvent({ value }))) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.requestOpen(false);
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Takes the row's second destination, where the reader asked for it.
|
|
164
|
+
*
|
|
165
|
+
* **Command intercepts rather than Listbox reporting, and that is the whole
|
|
166
|
+
* design.** Enter belongs to the listbox: it owns the active row, it decides
|
|
167
|
+
* what choosing means, and it announces `helix-before-change`. Teaching it about a
|
|
168
|
+
* modifier would put a palette's idea of a second destination inside a
|
|
169
|
+
* control that is also a select and a combobox, neither of which has one.
|
|
170
|
+
*
|
|
171
|
+
* So this listens in the capture phase, before the listbox sees the key, and
|
|
172
|
+
* only for the one combination that means something here. Anything else falls
|
|
173
|
+
* straight through and the listbox behaves exactly as it always did.
|
|
174
|
+
*
|
|
175
|
+
* `mod` is Command on a Mac and Control elsewhere, which is what `hotkey`
|
|
176
|
+
* already means by it two methods up.
|
|
177
|
+
*
|
|
178
|
+
* The pointer takes the same path for the same reason: a modifier-click on a
|
|
179
|
+
* row is the same intent as a modifier-Enter on it, and both have to be
|
|
180
|
+
* stopped before the row announces its ordinary selection.
|
|
181
|
+
*/
|
|
182
|
+
this.handleAlternate = (event) => {
|
|
183
|
+
if (!(event.metaKey || event.ctrlKey) || !this.open) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
if (event instanceof KeyboardEvent && event.key !== 'Enter') {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const row = event instanceof KeyboardEvent
|
|
190
|
+
? this.activeOption
|
|
191
|
+
: event.target?.closest?.('[data-active], helix-option, helix-headless-option');
|
|
192
|
+
const alternate = row?.alternate;
|
|
193
|
+
if (row === null || row === undefined || !alternate) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
event.stopImmediatePropagation();
|
|
198
|
+
if (this.dispatchEvent(new HelixSelectEvent({ alternate: true, value: alternate }))) {
|
|
199
|
+
this.requestOpen(false);
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
this.swallowOptionSelect = (event) => {
|
|
203
|
+
if (event.target !== this) {
|
|
204
|
+
event.stopImmediatePropagation();
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
get listbox() {
|
|
209
|
+
return this.renderRoot?.querySelector('[part="listbox"]') ?? null;
|
|
210
|
+
}
|
|
211
|
+
/*
|
|
212
|
+
* Keeps an option's own announcement inside the palette.
|
|
213
|
+
*
|
|
214
|
+
* Every option says `helix-select` when it is chosen, which is how the list
|
|
215
|
+
* hears it, and the list does not stop it: the options are light DOM children
|
|
216
|
+
* of this element, so it carried straight on out to the consumer. They then
|
|
217
|
+
* heard two selections for one command, an option's and the palette's, under
|
|
218
|
+
* one event name and distinguishable only by looking at the target.
|
|
219
|
+
*
|
|
220
|
+
* The one this element dispatches has itself as the target and is let past.
|
|
221
|
+
* Combobox stops the listbox's `helix-before-change` for the same reason.
|
|
222
|
+
*
|
|
223
|
+
* `stopImmediatePropagation`, not `stopPropagation`. The consumer's listener
|
|
224
|
+
* is on this same element, and stopping propagation only keeps an event off
|
|
225
|
+
* the *next* node: every other listener already bound here still runs, so the
|
|
226
|
+
* option's selection reached the consumer anyway. The listbox hears it well
|
|
227
|
+
* before this, from inside the shadow root, so nothing this element needs is
|
|
228
|
+
* lost by ending it here.
|
|
229
|
+
*/
|
|
230
|
+
/**
|
|
231
|
+
* The row under the keyboard, read from the attribute the listbox writes.
|
|
232
|
+
*
|
|
233
|
+
* `data-active` rather than a reference the listbox hands over, because the
|
|
234
|
+
* options are this element's own light DOM children and the attribute is
|
|
235
|
+
* already published: asking the listbox would mean a second channel saying
|
|
236
|
+
* what the markup says.
|
|
237
|
+
*/
|
|
238
|
+
get activeOption() {
|
|
239
|
+
return this.querySelector('[data-active]');
|
|
240
|
+
}
|
|
241
|
+
connectedCallback() {
|
|
242
|
+
super.connectedCallback();
|
|
243
|
+
this.addEventListener('helix-select', this.swallowOptionSelect);
|
|
244
|
+
/* Capture, so both reach this before the listbox and the row do. */
|
|
245
|
+
this.addEventListener('keydown', this.handleAlternate, { capture: true });
|
|
246
|
+
this.addEventListener('click', this.handleAlternate, { capture: true });
|
|
247
|
+
document.addEventListener('keydown', this.handleHotkey);
|
|
248
|
+
}
|
|
249
|
+
disconnectedCallback() {
|
|
250
|
+
super.disconnectedCallback();
|
|
251
|
+
this.removeEventListener('helix-select', this.swallowOptionSelect);
|
|
252
|
+
this.removeEventListener('keydown', this.handleAlternate, { capture: true });
|
|
253
|
+
this.removeEventListener('click', this.handleAlternate, { capture: true });
|
|
254
|
+
document.removeEventListener('keydown', this.handleHotkey);
|
|
255
|
+
}
|
|
256
|
+
updated(changed) {
|
|
257
|
+
super.updated?.(changed);
|
|
258
|
+
/* On the change rather than on every update. Both of these reach into the
|
|
259
|
+
listbox, and asking it to filter on a render it did not cause is how a
|
|
260
|
+
render becomes a loop: the list updates, something it owns comes back
|
|
261
|
+
through this element, and the next update asks again. Only the moment the
|
|
262
|
+
palette opens or shuts is either of them true. */
|
|
263
|
+
if (!changed.has('open')) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (this.open) {
|
|
267
|
+
/* The field takes focus as the palette arrives. A reader who pressed a
|
|
268
|
+
key to summon a search expects to be typing in it, and the dialog would
|
|
269
|
+
otherwise put focus on itself. */
|
|
270
|
+
this.renderRoot
|
|
271
|
+
.querySelector('[part="listbox"]')
|
|
272
|
+
?.renderRoot?.querySelector('[part="search-field"]')
|
|
273
|
+
?.focus();
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
this.listbox?.requestFilter('');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* The surface the palette opens in, behind a seam the styled tier can move.
|
|
281
|
+
*
|
|
282
|
+
* A method rather than a fragment inline, so a tier above can render its own,
|
|
283
|
+
* wrap this one, pass it a property the base does not know about, or leave it
|
|
284
|
+
* out, without reimplementing the whole template to do any of them. The tag is
|
|
285
|
+
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
286
|
+
* headless element, and a styled subclass that sets `tier` renders the styled one
|
|
287
|
+
* from the same template.
|
|
288
|
+
*/
|
|
289
|
+
renderDialog() {
|
|
290
|
+
return html `<${this.tag('dialog')}
|
|
291
|
+
exportparts="dialog"
|
|
292
|
+
label=${this.label}
|
|
293
|
+
.open=${this.open}
|
|
294
|
+
@helix-before-close=${() => {
|
|
295
|
+
if (this.open) {
|
|
296
|
+
this.requestOpen(false);
|
|
297
|
+
}
|
|
298
|
+
}}
|
|
299
|
+
>
|
|
300
|
+
<${this.tag('listbox')}
|
|
301
|
+
part="listbox"
|
|
302
|
+
exportparts="empty: listbox-empty, feedback: listbox-feedback, filter-icon: listbox-filter-icon,
|
|
303
|
+
filter-mark: listbox-filter-mark, hint: listbox-hint, items: listbox-items,
|
|
304
|
+
label: listbox-label, loading: listbox-loading, search: listbox-search,
|
|
305
|
+
search-field: listbox-search-field"
|
|
306
|
+
aria-label=${this.label}
|
|
307
|
+
empty-text=${this.emptyText}
|
|
308
|
+
filter-label=${this.placeholder}
|
|
309
|
+
filterable
|
|
310
|
+
@helix-before-change=${this.handleChange}
|
|
311
|
+
@change=${this.stopInner}
|
|
312
|
+
@input=${this.stopInner}
|
|
313
|
+
>
|
|
314
|
+
<slot></slot>
|
|
315
|
+
</${this.tag('listbox')}>
|
|
316
|
+
<div ?hidden=${!this.footed} part="footer" slot="footer">
|
|
317
|
+
<slot
|
|
318
|
+
name="footer"
|
|
319
|
+
@slotchange=${(event) => {
|
|
320
|
+
this.footed = event.target.assignedNodes().length > 0;
|
|
321
|
+
}}
|
|
322
|
+
></slot>
|
|
323
|
+
</div>
|
|
324
|
+
</${this.tag('dialog')}>`;
|
|
325
|
+
}
|
|
326
|
+
render() {
|
|
327
|
+
/* No part of its own on the host, and the dialog's own box forwarded under
|
|
328
|
+
its own name: `::part(dialog)` then reaches the thing with the shadow and
|
|
329
|
+
the padding, rather than a host that is only a wrapper. `align` is not set
|
|
330
|
+
here either, being a styled-tier property: where the panel sits is
|
|
331
|
+
presentation, and this tier renders no CSS. */
|
|
332
|
+
return html `${this.renderDialog()}`;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
__decorate([
|
|
336
|
+
property()
|
|
337
|
+
], HelixHeadlessCommand.prototype, "label", void 0);
|
|
338
|
+
__decorate([
|
|
339
|
+
property()
|
|
340
|
+
], HelixHeadlessCommand.prototype, "placeholder", void 0);
|
|
341
|
+
__decorate([
|
|
342
|
+
property({ attribute: 'empty-text' })
|
|
343
|
+
], HelixHeadlessCommand.prototype, "emptyText", void 0);
|
|
344
|
+
__decorate([
|
|
345
|
+
property()
|
|
346
|
+
], HelixHeadlessCommand.prototype, "hotkey", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
state()
|
|
349
|
+
], HelixHeadlessCommand.prototype, "footed", void 0);
|
|
350
|
+
HelixHeadlessCommand = __decorate([
|
|
351
|
+
customElement('helix-headless-command')
|
|
352
|
+
], HelixHeadlessCommand);
|
|
353
|
+
export { HelixHeadlessCommand };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/copy-button-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/copy-button-root.js';
|