@k2b/ui 0.63.0 → 0.64.0
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/dist/base.css +6 -3
- package/dist/browser/actions/ContextMenu.js +3 -1
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/DragAndDrop.js +26 -5
- package/dist/browser/actions/DragAndDrop.js.map +1 -1
- package/dist/browser/actions/DropOverlay.js +76 -0
- package/dist/browser/actions/DropOverlay.js.map +1 -0
- package/dist/browser/actions/Dropdown.js +69 -15
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/SortableList.js +338 -85
- package/dist/browser/actions/SortableList.js.map +1 -1
- package/dist/browser/actions/ViewTabs.js +9 -5
- package/dist/browser/actions/ViewTabs.js.map +1 -1
- package/dist/browser/actions/drag-and-drop-keyboard.js +211 -0
- package/dist/browser/actions/drag-and-drop-keyboard.js.map +1 -0
- package/dist/browser/actions/drag-and-drop-messages.js +21 -25
- package/dist/browser/actions/drag-and-drop-messages.js.map +1 -1
- package/dist/browser/actions/drag-and-drop.js +206 -184
- package/dist/browser/actions/drag-and-drop.js.map +1 -1
- package/dist/browser/actions/drop-overlay-pages.js +54 -0
- package/dist/browser/actions/drop-overlay-pages.js.map +1 -0
- package/dist/browser/actions/drop-overlay-view.js +318 -0
- package/dist/browser/actions/drop-overlay-view.js.map +1 -0
- package/dist/browser/actions/index.js +4 -2
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-sheet-messages.js +26 -0
- package/dist/browser/actions/menu-sheet-messages.js.map +1 -0
- package/dist/browser/actions/menu-sheet.js +80 -18
- package/dist/browser/actions/menu-sheet.js.map +1 -1
- package/dist/browser/actions/menu-submenu-panel.js +392 -0
- package/dist/browser/actions/menu-submenu-panel.js.map +1 -0
- package/dist/browser/actions/preload-when-idle.js +15 -0
- package/dist/browser/actions/preload-when-idle.js.map +1 -0
- package/dist/browser/actions/sortable-board.js +107 -0
- package/dist/browser/actions/sortable-board.js.map +1 -0
- package/dist/browser/actions/sortable-keyboard.js +202 -0
- package/dist/browser/actions/sortable-keyboard.js.map +1 -0
- package/dist/browser/actions/sortable-list-messages.js +23 -11
- package/dist/browser/actions/sortable-list-messages.js.map +1 -1
- package/dist/browser/actions/sortable-place.js +26 -0
- package/dist/browser/actions/sortable-place.js.map +1 -0
- package/dist/browser/chat/ChatDecision.js +499 -463
- package/dist/browser/chat/ChatDecision.js.map +1 -1
- package/dist/browser/chat/ChatDecisionField.js +311 -0
- package/dist/browser/chat/ChatDecisionField.js.map +1 -0
- package/dist/browser/chat/index.js +2 -0
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/chat/types.js.map +1 -1
- package/dist/browser/chat-decision-field.js +6 -0
- package/dist/browser/chat-decision-field.js.map +1 -0
- package/dist/browser/content/DataTable.js +326 -205
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/FileName.js +68 -0
- package/dist/browser/content/FileName.js.map +1 -0
- package/dist/browser/content/ProgressPath.js +30 -25
- package/dist/browser/content/ProgressPath.js.map +1 -1
- package/dist/browser/content/TaskRow.js +129 -0
- package/dist/browser/content/TaskRow.js.map +1 -0
- package/dist/browser/content/index.js +2 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/progress-path-messages.js +22 -0
- package/dist/browser/content/progress-path-messages.js.map +1 -0
- package/dist/browser/feedback/dialog-core.js +68 -11
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/dialog-foot.js +45 -0
- package/dist/browser/feedback/dialog-foot.js.map +1 -0
- package/dist/browser/inputs/DatePicker.js +369 -716
- package/dist/browser/inputs/DatePicker.js.map +1 -1
- package/dist/browser/inputs/FileInputs.js +1 -1
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/NumberInput.js +125 -46
- package/dist/browser/inputs/NumberInput.js.map +1 -1
- package/dist/browser/inputs/PeriodPicker.js +9 -4
- package/dist/browser/inputs/PeriodPicker.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +3 -3
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/inputs/date-picker-panel.js +420 -0
- package/dist/browser/inputs/date-picker-panel.js.map +1 -0
- package/dist/browser/inputs/image-crop.js +1 -1
- package/dist/browser/inputs/image-crop.js.map +1 -1
- package/dist/browser/inputs/image-tools.js +4 -0
- package/dist/browser/inputs/image-tools.js.map +1 -0
- package/dist/browser/inputs/input-messages.js +8 -2
- package/dist/browser/inputs/input-messages.js.map +1 -1
- package/dist/browser/internal/field.js +2 -2
- package/dist/browser/internal/field.js.map +1 -1
- package/dist/browser/internal/renders-something.js +3 -0
- package/dist/browser/internal/renders-something.js.map +1 -0
- package/dist/browser/intl/messages.js +1 -1
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +16 -8
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/Breadcrumbs.js +188 -42
- package/dist/browser/layout/Breadcrumbs.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +209 -205
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/FloatingPill.js +33 -0
- package/dist/browser/layout/FloatingPill.js.map +1 -0
- package/dist/browser/layout/PanelDialog.js +176 -88
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/StatusRow.js +174 -0
- package/dist/browser/layout/StatusRow.js.map +1 -0
- package/dist/browser/layout/app-workspace-controller.js +12 -5
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/app-workspace-state.js +2 -2
- package/dist/browser/layout/app-workspace-state.js.map +1 -1
- package/dist/browser/layout/index.js +2 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/panel-dialog-error.js +44 -0
- package/dist/browser/layout/panel-dialog-error.js.map +1 -0
- package/dist/browser/layout/panel-sheet-handle.js +86 -0
- package/dist/browser/layout/panel-sheet-handle.js.map +1 -0
- package/dist/browser/layout/workspace-messages.js +12 -2
- package/dist/browser/layout/workspace-messages.js.map +1 -1
- package/dist/browser/layout-check.js +232 -0
- package/dist/browser/layout-check.js.map +1 -0
- package/dist/browser/surfaces/Area.js +205 -0
- package/dist/browser/surfaces/Area.js.map +1 -0
- package/dist/browser/surfaces/FactGroup.js +148 -0
- package/dist/browser/surfaces/FactGroup.js.map +1 -0
- package/dist/browser/surfaces/FieldGrid.js +34 -0
- package/dist/browser/surfaces/FieldGrid.js.map +1 -0
- package/dist/browser/surfaces/NoticeCard.js +69 -57
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/browser/surfaces/Placeholder.js +17 -5
- package/dist/browser/surfaces/Placeholder.js.map +1 -1
- package/dist/browser/surfaces/RowGroup.js +82 -0
- package/dist/browser/surfaces/RowGroup.js.map +1 -0
- package/dist/browser/surfaces/Section.js +22 -7
- package/dist/browser/surfaces/Section.js.map +1 -1
- package/dist/browser/surfaces/StatusBadge.js +5 -1
- package/dist/browser/surfaces/StatusBadge.js.map +1 -1
- package/dist/browser/surfaces/flat-block-messages.js +37 -0
- package/dist/browser/surfaces/flat-block-messages.js.map +1 -0
- package/dist/browser/surfaces/index.js +4 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +3 -1
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/DragAndDrop.js +26 -5
- package/dist/ssr/actions/DragAndDrop.js.map +1 -1
- package/dist/ssr/actions/DropOverlay.js +69 -0
- package/dist/ssr/actions/DropOverlay.js.map +1 -0
- package/dist/ssr/actions/Dropdown.js +69 -15
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/SortableList.js +293 -71
- package/dist/ssr/actions/SortableList.js.map +1 -1
- package/dist/ssr/actions/ViewTabs.js +9 -5
- package/dist/ssr/actions/ViewTabs.js.map +1 -1
- package/dist/ssr/actions/drag-and-drop-keyboard.js +211 -0
- package/dist/ssr/actions/drag-and-drop-keyboard.js.map +1 -0
- package/dist/ssr/actions/drag-and-drop-messages.js +21 -25
- package/dist/ssr/actions/drag-and-drop-messages.js.map +1 -1
- package/dist/ssr/actions/drag-and-drop.js +206 -184
- package/dist/ssr/actions/drag-and-drop.js.map +1 -1
- package/dist/ssr/actions/drop-overlay-pages.js +54 -0
- package/dist/ssr/actions/drop-overlay-pages.js.map +1 -0
- package/dist/ssr/actions/drop-overlay-view.js +225 -0
- package/dist/ssr/actions/drop-overlay-view.js.map +1 -0
- package/dist/ssr/actions/index.js +4 -2
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-sheet-messages.js +26 -0
- package/dist/ssr/actions/menu-sheet-messages.js.map +1 -0
- package/dist/ssr/actions/menu-sheet.js +62 -10
- package/dist/ssr/actions/menu-sheet.js.map +1 -1
- package/dist/ssr/actions/menu-submenu-panel.js +295 -0
- package/dist/ssr/actions/menu-submenu-panel.js.map +1 -0
- package/dist/ssr/actions/preload-when-idle.js +15 -0
- package/dist/ssr/actions/preload-when-idle.js.map +1 -0
- package/dist/ssr/actions/sortable-board.js +107 -0
- package/dist/ssr/actions/sortable-board.js.map +1 -0
- package/dist/ssr/actions/sortable-keyboard.js +202 -0
- package/dist/ssr/actions/sortable-keyboard.js.map +1 -0
- package/dist/ssr/actions/sortable-list-messages.js +23 -11
- package/dist/ssr/actions/sortable-list-messages.js.map +1 -1
- package/dist/ssr/actions/sortable-place.js +26 -0
- package/dist/ssr/actions/sortable-place.js.map +1 -0
- package/dist/ssr/chat/ChatDecision.js +256 -228
- package/dist/ssr/chat/ChatDecision.js.map +1 -1
- package/dist/ssr/chat/ChatDecisionField.js +206 -0
- package/dist/ssr/chat/ChatDecisionField.js.map +1 -0
- package/dist/ssr/chat/index.js +2 -0
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/chat/types.js.map +1 -1
- package/dist/ssr/chat-decision-field.js +6 -0
- package/dist/ssr/chat-decision-field.js.map +1 -0
- package/dist/ssr/content/DataTable.js +93 -50
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/FileName.js +46 -0
- package/dist/ssr/content/FileName.js.map +1 -0
- package/dist/ssr/content/ProgressPath.js +14 -8
- package/dist/ssr/content/ProgressPath.js.map +1 -1
- package/dist/ssr/content/TaskRow.js +95 -0
- package/dist/ssr/content/TaskRow.js.map +1 -0
- package/dist/ssr/content/index.js +2 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/progress-path-messages.js +22 -0
- package/dist/ssr/content/progress-path-messages.js.map +1 -0
- package/dist/ssr/feedback/dialog-core.js +68 -11
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/dialog-foot.js +45 -0
- package/dist/ssr/feedback/dialog-foot.js.map +1 -0
- package/dist/ssr/inputs/DatePicker.js +94 -263
- package/dist/ssr/inputs/DatePicker.js.map +1 -1
- package/dist/ssr/inputs/FileInputs.js +1 -1
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/NumberInput.js +114 -44
- package/dist/ssr/inputs/NumberInput.js.map +1 -1
- package/dist/ssr/inputs/PeriodPicker.js +9 -4
- package/dist/ssr/inputs/PeriodPicker.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js +3 -3
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/inputs/date-picker-panel.js +233 -0
- package/dist/ssr/inputs/date-picker-panel.js.map +1 -0
- package/dist/ssr/inputs/image-crop.js +1 -1
- package/dist/ssr/inputs/image-crop.js.map +1 -1
- package/dist/ssr/inputs/image-tools.js +4 -0
- package/dist/ssr/inputs/image-tools.js.map +1 -0
- package/dist/ssr/inputs/input-messages.js +8 -2
- package/dist/ssr/inputs/input-messages.js.map +1 -1
- package/dist/ssr/internal/field.js +2 -2
- package/dist/ssr/internal/field.js.map +1 -1
- package/dist/ssr/internal/renders-something.js +3 -0
- package/dist/ssr/internal/renders-something.js.map +1 -0
- package/dist/ssr/intl/messages.js +1 -1
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +16 -8
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/Breadcrumbs.js +140 -26
- package/dist/ssr/layout/Breadcrumbs.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +70 -68
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/FloatingPill.js +16 -0
- package/dist/ssr/layout/FloatingPill.js.map +1 -0
- package/dist/ssr/layout/PanelDialog.js +82 -8
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/StatusRow.js +93 -0
- package/dist/ssr/layout/StatusRow.js.map +1 -0
- package/dist/ssr/layout/app-workspace-controller.js +12 -5
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/app-workspace-state.js +2 -2
- package/dist/ssr/layout/app-workspace-state.js.map +1 -1
- package/dist/ssr/layout/index.js +2 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/panel-dialog-error.js +28 -0
- package/dist/ssr/layout/panel-dialog-error.js.map +1 -0
- package/dist/ssr/layout/panel-sheet-handle.js +66 -0
- package/dist/ssr/layout/panel-sheet-handle.js.map +1 -0
- package/dist/ssr/layout/workspace-messages.js +12 -2
- package/dist/ssr/layout/workspace-messages.js.map +1 -1
- package/dist/ssr/layout-check.js +232 -0
- package/dist/ssr/layout-check.js.map +1 -0
- package/dist/ssr/surfaces/Area.js +147 -0
- package/dist/ssr/surfaces/Area.js.map +1 -0
- package/dist/ssr/surfaces/FactGroup.js +106 -0
- package/dist/ssr/surfaces/FactGroup.js.map +1 -0
- package/dist/ssr/surfaces/FieldGrid.js +22 -0
- package/dist/ssr/surfaces/FieldGrid.js.map +1 -0
- package/dist/ssr/surfaces/NoticeCard.js +7 -5
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/surfaces/Placeholder.js +15 -4
- package/dist/ssr/surfaces/Placeholder.js.map +1 -1
- package/dist/ssr/surfaces/RowGroup.js +60 -0
- package/dist/ssr/surfaces/RowGroup.js.map +1 -0
- package/dist/ssr/surfaces/Section.js +7 -4
- package/dist/ssr/surfaces/Section.js.map +1 -1
- package/dist/ssr/surfaces/StatusBadge.js +5 -1
- package/dist/ssr/surfaces/StatusBadge.js.map +1 -1
- package/dist/ssr/surfaces/flat-block-messages.js +37 -0
- package/dist/ssr/surfaces/flat-block-messages.js.map +1 -0
- package/dist/ssr/surfaces/index.js +4 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/DragAndDrop.d.ts +17 -2
- package/dist/types/actions/DropOverlay.d.ts +46 -0
- package/dist/types/actions/Dropdown.d.ts +35 -1
- package/dist/types/actions/SortableList.d.ts +36 -6
- package/dist/types/actions/ViewTabs.d.ts +3 -2
- package/dist/types/actions/drag-and-drop-keyboard.d.ts +4 -0
- package/dist/types/actions/drag-and-drop-messages.d.ts +8 -10
- package/dist/types/actions/drag-and-drop.d.ts +62 -4
- package/dist/types/actions/drop-overlay-pages.d.ts +22 -0
- package/dist/types/actions/drop-overlay-view.d.ts +12 -0
- package/dist/types/actions/index.d.ts +9 -5
- package/dist/types/actions/menu-sheet-messages.d.ts +11 -0
- package/dist/types/actions/menu-sheet.d.ts +3 -1
- package/dist/types/actions/menu-submenu-panel.d.ts +27 -0
- package/dist/types/actions/preload-when-idle.d.ts +5 -0
- package/dist/types/actions/sortable-board.d.ts +69 -0
- package/dist/types/actions/sortable-keyboard.d.ts +7 -0
- package/dist/types/actions/sortable-list-messages.d.ts +10 -3
- package/dist/types/actions/sortable-place.d.ts +16 -0
- package/dist/types/chat/ChatDecision.d.ts +28 -4
- package/dist/types/chat/ChatDecisionField.d.ts +45 -0
- package/dist/types/chat/index.d.ts +1 -0
- package/dist/types/chat/types.d.ts +9 -0
- package/dist/types/chat-decision-field.d.ts +5 -0
- package/dist/types/content/DataTable.d.ts +19 -0
- package/dist/types/content/FileName.d.ts +23 -0
- package/dist/types/content/ProgressPath.d.ts +12 -6
- package/dist/types/content/TaskRow.d.ts +33 -0
- package/dist/types/content/index.d.ts +2 -0
- package/dist/types/content/progress-path-messages.d.ts +8 -0
- package/dist/types/feedback/dialog-core.d.ts +5 -0
- package/dist/types/feedback/dialog-foot.d.ts +9 -0
- package/dist/types/inputs/DatePicker.d.ts +3 -21
- package/dist/types/inputs/TextInput.d.ts +2 -0
- package/dist/types/inputs/date-picker-panel.d.ts +29 -0
- package/dist/types/inputs/image-tools.d.ts +1 -0
- package/dist/types/inputs/input-messages.d.ts +4 -1
- package/dist/types/internal/renders-something.d.ts +2 -0
- package/dist/types/layout/AppWorkspace.d.ts +10 -2
- package/dist/types/layout/Breadcrumbs.d.ts +10 -5
- package/dist/types/layout/FloatingPill.d.ts +20 -0
- package/dist/types/layout/PanelDialog.d.ts +19 -0
- package/dist/types/layout/StatusRow.d.ts +54 -0
- package/dist/types/layout/app-workspace-state.d.ts +2 -2
- package/dist/types/layout/index.d.ts +5 -1
- package/dist/types/layout/panel-dialog-error.d.ts +9 -0
- package/dist/types/layout/panel-sheet-handle.d.ts +8 -0
- package/dist/types/layout/workspace-messages.d.ts +5 -0
- package/dist/types/layout-check.d.ts +52 -0
- package/dist/types/surfaces/Area.d.ts +38 -0
- package/dist/types/surfaces/FactGroup.d.ts +33 -0
- package/dist/types/surfaces/FieldGrid.d.ts +14 -0
- package/dist/types/surfaces/NoticeCard.d.ts +6 -4
- package/dist/types/surfaces/Placeholder.d.ts +7 -0
- package/dist/types/surfaces/RowGroup.d.ts +20 -0
- package/dist/types/surfaces/Section.d.ts +8 -2
- package/dist/types/surfaces/StatusBadge.d.ts +2 -1
- package/dist/types/surfaces/flat-block-messages.d.ts +16 -0
- package/dist/types/surfaces/index.d.ts +9 -1
- package/package.json +13 -2
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { template as _$template } from "solid-js/web";
|
|
2
|
+
import { className as _$className } from "solid-js/web";
|
|
3
|
+
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
4
|
+
import { effect as _$effect } from "solid-js/web";
|
|
5
|
+
import { getNextElement as _$getNextElement } from "solid-js/web";
|
|
6
|
+
import { getNextMarker as _$getNextMarker } from "solid-js/web";
|
|
7
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
8
|
+
import { insert as _$insert } from "solid-js/web";
|
|
9
|
+
import { memo as _$memo } from "solid-js/web";
|
|
10
|
+
import { use as _$use } from "solid-js/web";
|
|
11
|
+
var _tmpl$ = /*#__PURE__*/_$template(`<i class="ti ti-chevron-right k2b-drop-overlay__chevron"aria-hidden=true>`),
|
|
12
|
+
_tmpl$2 = /*#__PURE__*/_$template(`<span class=k2b-drop-overlay__ring aria-hidden=true>`),
|
|
13
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<div class=k2b-drop-overlay__tile style=--k2b-drop-dwell:450ms><!$><!/><span class=k2b-drop-overlay__text><span class=k2b-drop-overlay__label></span><!$><!/></span><!$><!/><!$><!/>`),
|
|
14
|
+
_tmpl$4 = /*#__PURE__*/_$template(`<i aria-hidden=true>`),
|
|
15
|
+
_tmpl$5 = /*#__PURE__*/_$template(`<span class=k2b-drop-overlay__description>`),
|
|
16
|
+
_tmpl$6 = /*#__PURE__*/_$template(`<div role=region><div class=k2b-drop-overlay__top><i class="ti ti-hand-grab"aria-hidden=true></i><span class=k2b-drop-overlay__what></span><span class=k2b-drop-overlay__help><!$><!/><!$><!/></span></div><!$><!/><div class=k2b-drop-overlay__grid></div><div class=k2b-drop-overlay__cancel><i class="ti ti-x"aria-hidden=true></i><!$><!/>`),
|
|
17
|
+
_tmpl$7 = /*#__PURE__*/_$template(`<div class=k2b-drop-overlay__title>`);
|
|
18
|
+
import { i18n } from "@k2b/stdlib";
|
|
19
|
+
import { batch, createEffect, createMemo, createSignal, For, onCleanup, onMount, Show, untrack } from "solid-js";
|
|
20
|
+
import { useLocale } from "../intl/locale";
|
|
21
|
+
import { announce, currentPreview, registerDropTarget, setDragStatus } from "./drag-and-drop";
|
|
22
|
+
import { useDragAndDropMessages } from "./drag-and-drop-messages";
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* The overlay of drop targets (S7). It loads on demand: `DropOverlay` fetches it while the page is idle and on every
|
|
26
|
+
* press of a drag source.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** Resting this long on a tile with a level opens it (S7). */
|
|
30
|
+
export const DWELL_MS = 450;
|
|
31
|
+
/** New tiles take nothing for this long, so a tile that appears under the pointer is never hit by accident (S7). */
|
|
32
|
+
export const ARM_MS = 220;
|
|
33
|
+
/** After a level change, resting opens a level only once the pointer has moved this far, so levels never cascade. */
|
|
34
|
+
const REST_SLOP = 6;
|
|
35
|
+
const dropOverlayMessages = /* @__PURE__ */i18n.define({
|
|
36
|
+
baseLocale: "en",
|
|
37
|
+
messages: {
|
|
38
|
+
en: {
|
|
39
|
+
label: "Drop targets",
|
|
40
|
+
help: "Drag onto a target and let go · Esc cancels",
|
|
41
|
+
rest: "Rest here to open",
|
|
42
|
+
back: "Back",
|
|
43
|
+
cancel: "Drop here: nothing happens"
|
|
44
|
+
},
|
|
45
|
+
de: {
|
|
46
|
+
label: "Ziele zum Ablegen",
|
|
47
|
+
help: "Auf ein Ziel ziehen und loslassen · Esc bricht ab",
|
|
48
|
+
rest: "Kurz verweilen",
|
|
49
|
+
back: "Zurück",
|
|
50
|
+
cancel: "Hier loslassen: nichts passiert"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export const checkDropOverlayMessages = () => dropOverlayMessages.check();
|
|
55
|
+
export function DropOverlayView(props) {
|
|
56
|
+
const locale = useLocale();
|
|
57
|
+
const t = () => dropOverlayMessages.resolve([locale()]).t;
|
|
58
|
+
const dragMessages = useDragAndDropMessages();
|
|
59
|
+
/** The levels above the current one, for "Back". */
|
|
60
|
+
const [path, setPath] = createSignal([]);
|
|
61
|
+
const [level, setLevel] = createSignal("root");
|
|
62
|
+
const [armed, setArmed] = createSignal(false);
|
|
63
|
+
let root;
|
|
64
|
+
let cancel;
|
|
65
|
+
let armTimer = 0;
|
|
66
|
+
/** The pointer's last place over the overlay, and where it was when the level opened. */
|
|
67
|
+
let pointer;
|
|
68
|
+
let openedAt;
|
|
69
|
+
const moved = () => !openedAt || !pointer || Math.hypot(pointer.x - openedAt.x, pointer.y - openedAt.y) >= REST_SLOP;
|
|
70
|
+
const arm = () => {
|
|
71
|
+
setArmed(false);
|
|
72
|
+
window.clearTimeout(armTimer);
|
|
73
|
+
armTimer = window.setTimeout(() => setArmed(true), ARM_MS);
|
|
74
|
+
};
|
|
75
|
+
onCleanup(() => window.clearTimeout(armTimer));
|
|
76
|
+
arm();
|
|
77
|
+
const open = (next, back) => {
|
|
78
|
+
openedAt = pointer;
|
|
79
|
+
batch(() => {
|
|
80
|
+
arm();
|
|
81
|
+
if (back) setPath(all => all.slice(0, -1));else setPath(all => [...all, level()]);
|
|
82
|
+
setLevel(next);
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const current = createMemo(() => props.overlay.level(level(), props.payload()));
|
|
86
|
+
/** Keyed by `id`: a tile whose words stay the same keeps its element, also when the host's data updates. */
|
|
87
|
+
const tiles = createMemo(previous => {
|
|
88
|
+
const above = path().at(-1);
|
|
89
|
+
const back = above === undefined ? [] : [{
|
|
90
|
+
id: "k2b-back",
|
|
91
|
+
label: t().back,
|
|
92
|
+
icon: "ti ti-arrow-left",
|
|
93
|
+
opens: above,
|
|
94
|
+
back: true
|
|
95
|
+
}];
|
|
96
|
+
const same = (a, b) => a.label === b.label && a.description === b.description && a.disabled === b.disabled && a.opens === b.opens && a.icon === b.icon;
|
|
97
|
+
return [...back, ...current().tiles].map(tile => previous.find(old => old.id === tile.id && same(old, tile) && old.onDrop === tile.onDrop) ?? tile);
|
|
98
|
+
}, []);
|
|
99
|
+
const status = detail => {
|
|
100
|
+
const messages = dragMessages();
|
|
101
|
+
const payload = props.payload();
|
|
102
|
+
setDragStatus({
|
|
103
|
+
lead: messages.statusLead({
|
|
104
|
+
label: payload.label,
|
|
105
|
+
count: payload.count ?? 1
|
|
106
|
+
}),
|
|
107
|
+
detail
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
// Over the overlay, the item is named in the top line; the preview shrinks to its icon and count.
|
|
111
|
+
onMount(() => {
|
|
112
|
+
const preview = currentPreview();
|
|
113
|
+
preview?.setAttribute("data-compact", "");
|
|
114
|
+
onCleanup(() => preview?.removeAttribute("data-compact"));
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Anywhere on the overlay outside a tile, letting go changes nothing; so does the marked area, which says so.
|
|
118
|
+
onMount(() => {
|
|
119
|
+
for (const element of [root, cancel]) {
|
|
120
|
+
let inside = false;
|
|
121
|
+
const target = registerDropTarget(element, {
|
|
122
|
+
accept: props.overlay.accept,
|
|
123
|
+
label: t().cancel,
|
|
124
|
+
messages: dragMessages(),
|
|
125
|
+
cancels: true,
|
|
126
|
+
drop: () => {},
|
|
127
|
+
hover: point => {
|
|
128
|
+
if (point) pointer = point;
|
|
129
|
+
if (!point) inside = false;else if (!inside) {
|
|
130
|
+
inside = true;
|
|
131
|
+
status(dragMessages().statusIdle);
|
|
132
|
+
if (element === cancel) announce(root, dragMessages().over({
|
|
133
|
+
target: t().cancel
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
onCleanup(() => target.dispose());
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const TileView = tile => {
|
|
143
|
+
let element;
|
|
144
|
+
let dwell = 0;
|
|
145
|
+
let resting = false;
|
|
146
|
+
let inside = false;
|
|
147
|
+
const stop = () => {
|
|
148
|
+
inside = false;
|
|
149
|
+
resting = false;
|
|
150
|
+
window.clearTimeout(dwell);
|
|
151
|
+
delete element.dataset.dwell;
|
|
152
|
+
};
|
|
153
|
+
onCleanup(stop);
|
|
154
|
+
// A tile takes part only once the level is armed; until then the overlay under it takes the pointer.
|
|
155
|
+
createEffect(() => {
|
|
156
|
+
if (!armed()) return;
|
|
157
|
+
const target = untrack(() => registerDropTarget(element, {
|
|
158
|
+
accept: props.overlay.accept,
|
|
159
|
+
label: tile.disabled ? `${tile.label} – ${tile.disabled}` : tile.label,
|
|
160
|
+
messages: dragMessages(),
|
|
161
|
+
disabled: tile.disabled !== undefined,
|
|
162
|
+
cancels: !tile.onDrop,
|
|
163
|
+
drop: payload => tile.onDrop?.(payload),
|
|
164
|
+
hover: point => {
|
|
165
|
+
if (!point) {
|
|
166
|
+
stop();
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
pointer = point;
|
|
170
|
+
if (!inside) {
|
|
171
|
+
inside = true;
|
|
172
|
+
status(tile.onDrop ? dragMessages().statusOver({
|
|
173
|
+
target: tile.label
|
|
174
|
+
}) : dragMessages().statusIdle);
|
|
175
|
+
announce(root, dragMessages().over({
|
|
176
|
+
target: tile.label
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
// Resting opens the level only after the pointer moved since the last change, so a tile that appears
|
|
180
|
+
// under a still pointer never opens by itself.
|
|
181
|
+
if (!resting && tile.opens !== undefined && moved()) {
|
|
182
|
+
resting = true;
|
|
183
|
+
element.dataset.dwell = "";
|
|
184
|
+
const opens = tile.opens;
|
|
185
|
+
dwell = window.setTimeout(() => open(opens, tile.back === true), DWELL_MS);
|
|
186
|
+
}
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
}));
|
|
190
|
+
onCleanup(() => {
|
|
191
|
+
stop();
|
|
192
|
+
target.dispose();
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
const description = () => tile.disabled ?? tile.description ?? (tile.opens !== undefined && !tile.back ? t().rest : undefined);
|
|
196
|
+
return (() => {
|
|
197
|
+
var _el$ = _$getNextElement(_tmpl$3),
|
|
198
|
+
_el$8 = _el$.firstChild,
|
|
199
|
+
[_el$9, _co$2] = _$getNextMarker(_el$8.nextSibling),
|
|
200
|
+
_el$2 = _el$9.nextSibling,
|
|
201
|
+
_el$3 = _el$2.firstChild,
|
|
202
|
+
_el$4 = _el$3.nextSibling,
|
|
203
|
+
[_el$5, _co$] = _$getNextMarker(_el$4.nextSibling),
|
|
204
|
+
_el$0 = _el$2.nextSibling,
|
|
205
|
+
[_el$1, _co$3] = _$getNextMarker(_el$0.nextSibling),
|
|
206
|
+
_el$10 = _el$1.nextSibling,
|
|
207
|
+
[_el$11, _co$4] = _$getNextMarker(_el$10.nextSibling);
|
|
208
|
+
var _ref$ = element;
|
|
209
|
+
typeof _ref$ === "function" ? _$use(_ref$, _el$) : element = _el$;
|
|
210
|
+
_$insert(_el$, () => tile.leading ?? (() => {
|
|
211
|
+
var _el$12 = _$getNextElement(_tmpl$4);
|
|
212
|
+
_$effect(() => _$className(_el$12, `k2b-drop-overlay__icon ${tile.icon ?? "ti ti-circle-dot"}`));
|
|
213
|
+
return _el$12;
|
|
214
|
+
})(), _el$9, _co$2);
|
|
215
|
+
_$insert(_el$3, () => tile.label);
|
|
216
|
+
_$insert(_el$2, _$createComponent(Show, {
|
|
217
|
+
get when() {
|
|
218
|
+
return description();
|
|
219
|
+
},
|
|
220
|
+
children: text => (() => {
|
|
221
|
+
var _el$13 = _$getNextElement(_tmpl$5);
|
|
222
|
+
_$insert(_el$13, text);
|
|
223
|
+
return _el$13;
|
|
224
|
+
})()
|
|
225
|
+
}), _el$5, _co$);
|
|
226
|
+
_$insert(_el$, _$createComponent(Show, {
|
|
227
|
+
get when() {
|
|
228
|
+
return _$memo(() => tile.opens !== undefined)() && !tile.back;
|
|
229
|
+
},
|
|
230
|
+
get children() {
|
|
231
|
+
return _$getNextElement(_tmpl$);
|
|
232
|
+
}
|
|
233
|
+
}), _el$1, _co$3);
|
|
234
|
+
_$insert(_el$, _$createComponent(Show, {
|
|
235
|
+
get when() {
|
|
236
|
+
return tile.opens !== undefined;
|
|
237
|
+
},
|
|
238
|
+
get children() {
|
|
239
|
+
return _$getNextElement(_tmpl$2);
|
|
240
|
+
}
|
|
241
|
+
}), _el$11, _co$4);
|
|
242
|
+
_$effect(_p$ => {
|
|
243
|
+
var _v$ = tile.back ? "" : undefined,
|
|
244
|
+
_v$2 = tile.disabled !== undefined ? "true" : undefined;
|
|
245
|
+
_v$ !== _p$.e && _$setAttribute(_el$, "data-back", _p$.e = _v$);
|
|
246
|
+
_v$2 !== _p$.t && _$setAttribute(_el$, "aria-disabled", _p$.t = _v$2);
|
|
247
|
+
return _p$;
|
|
248
|
+
}, {
|
|
249
|
+
e: undefined,
|
|
250
|
+
t: undefined
|
|
251
|
+
});
|
|
252
|
+
return _el$;
|
|
253
|
+
})();
|
|
254
|
+
};
|
|
255
|
+
return (() => {
|
|
256
|
+
var _el$14 = _$getNextElement(_tmpl$6),
|
|
257
|
+
_el$15 = _el$14.firstChild,
|
|
258
|
+
_el$16 = _el$15.firstChild,
|
|
259
|
+
_el$17 = _el$16.nextSibling,
|
|
260
|
+
_el$18 = _el$17.nextSibling,
|
|
261
|
+
_el$19 = _el$18.firstChild,
|
|
262
|
+
[_el$20, _co$5] = _$getNextMarker(_el$19.nextSibling),
|
|
263
|
+
_el$21 = _el$20.nextSibling,
|
|
264
|
+
[_el$22, _co$6] = _$getNextMarker(_el$21.nextSibling),
|
|
265
|
+
_el$28 = _el$15.nextSibling,
|
|
266
|
+
[_el$29, _co$8] = _$getNextMarker(_el$28.nextSibling),
|
|
267
|
+
_el$23 = _el$29.nextSibling,
|
|
268
|
+
_el$24 = _el$23.nextSibling,
|
|
269
|
+
_el$25 = _el$24.firstChild,
|
|
270
|
+
_el$26 = _el$25.nextSibling,
|
|
271
|
+
[_el$27, _co$7] = _$getNextMarker(_el$26.nextSibling);
|
|
272
|
+
var _ref$2 = root;
|
|
273
|
+
typeof _ref$2 === "function" ? _$use(_ref$2, _el$14) : root = _el$14;
|
|
274
|
+
_$insert(_el$17, () => props.payload().label);
|
|
275
|
+
_$insert(_el$18, () => t().help, _el$20, _co$5);
|
|
276
|
+
_$insert(_el$18, (() => {
|
|
277
|
+
var _c$ = _$memo(() => !!props.overlay.hint);
|
|
278
|
+
return () => _c$() ? ` · ${props.overlay.hint}` : "";
|
|
279
|
+
})(), _el$22, _co$6);
|
|
280
|
+
_$insert(_el$14, _$createComponent(Show, {
|
|
281
|
+
get when() {
|
|
282
|
+
return current().title;
|
|
283
|
+
},
|
|
284
|
+
children: title => (() => {
|
|
285
|
+
var _el$30 = _$getNextElement(_tmpl$7);
|
|
286
|
+
_$insert(_el$30, title);
|
|
287
|
+
return _el$30;
|
|
288
|
+
})()
|
|
289
|
+
}), _el$29, _co$8);
|
|
290
|
+
_$insert(_el$23, _$createComponent(For, {
|
|
291
|
+
get each() {
|
|
292
|
+
return tiles();
|
|
293
|
+
},
|
|
294
|
+
children: tile => TileView(tile)
|
|
295
|
+
}));
|
|
296
|
+
var _ref$3 = cancel;
|
|
297
|
+
typeof _ref$3 === "function" ? _$use(_ref$3, _el$24) : cancel = _el$24;
|
|
298
|
+
_$insert(_el$24, () => t().cancel, _el$27, _co$7);
|
|
299
|
+
_$effect(_p$ => {
|
|
300
|
+
var _v$3 = `k2b-drop-overlay${props.overlay.class ? ` ${props.overlay.class}` : ""}`,
|
|
301
|
+
_v$4 = t().label,
|
|
302
|
+
_v$5 = level() === "root" ? "root" : "inner",
|
|
303
|
+
_v$6 = armed() ? undefined : "";
|
|
304
|
+
_v$3 !== _p$.e && _$className(_el$14, _p$.e = _v$3);
|
|
305
|
+
_v$4 !== _p$.t && _$setAttribute(_el$14, "aria-label", _p$.t = _v$4);
|
|
306
|
+
_v$5 !== _p$.a && _$setAttribute(_el$14, "data-level", _p$.a = _v$5);
|
|
307
|
+
_v$6 !== _p$.o && _$setAttribute(_el$14, "data-arming", _p$.o = _v$6);
|
|
308
|
+
return _p$;
|
|
309
|
+
}, {
|
|
310
|
+
e: undefined,
|
|
311
|
+
t: undefined,
|
|
312
|
+
a: undefined,
|
|
313
|
+
o: undefined
|
|
314
|
+
});
|
|
315
|
+
return _el$14;
|
|
316
|
+
})();
|
|
317
|
+
}
|
|
318
|
+
//# sourceMappingURL=drop-overlay-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/drop-overlay-view.tsx"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { batch, createEffect, createMemo, createSignal, For, type JSX, onCleanup, onMount, Show, untrack } from \"solid-js\";\nimport { useLocale } from \"../intl/locale\";\nimport type { DropOverlayProps, DropOverlayTile } from \"./DropOverlay\";\nimport { announce, currentPreview, type DragPayload, registerDropTarget, setDragStatus } from \"./drag-and-drop\";\nimport { useDragAndDropMessages } from \"./drag-and-drop-messages\";\n\n/*\n * The overlay of drop targets (S7). It loads on demand: `DropOverlay` fetches it while the page is idle and on every\n * press of a drag source.\n */\n\n/** Resting this long on a tile with a level opens it (S7). */\nexport const DWELL_MS = 450;\n/** New tiles take nothing for this long, so a tile that appears under the pointer is never hit by accident (S7). */\nexport const ARM_MS = 220;\n/** After a level change, resting opens a level only once the pointer has moved this far, so levels never cascade. */\nconst REST_SLOP = 6;\n\nconst dropOverlayMessages = /* @__PURE__ */ i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n label: \"Drop targets\",\n help: \"Drag onto a target and let go · Esc cancels\",\n rest: \"Rest here to open\",\n back: \"Back\",\n cancel: \"Drop here: nothing happens\",\n },\n de: {\n label: \"Ziele zum Ablegen\",\n help: \"Auf ein Ziel ziehen und loslassen · Esc bricht ab\",\n rest: \"Kurz verweilen\",\n back: \"Zurück\",\n cancel: \"Hier loslassen: nichts passiert\",\n },\n },\n});\nexport const checkDropOverlayMessages = () => dropOverlayMessages.check();\n\ntype Tile = DropOverlayTile & { back?: boolean };\n\nexport function DropOverlayView(props: { overlay: DropOverlayProps; payload: () => DragPayload }): JSX.Element {\n const locale = useLocale();\n const t = () => dropOverlayMessages.resolve([locale()]).t;\n const dragMessages = useDragAndDropMessages();\n /** The levels above the current one, for \"Back\". */\n const [path, setPath] = createSignal<string[]>([]);\n const [level, setLevel] = createSignal(\"root\");\n const [armed, setArmed] = createSignal(false);\n let root!: HTMLDivElement;\n let cancel!: HTMLDivElement;\n let armTimer = 0;\n /** The pointer's last place over the overlay, and where it was when the level opened. */\n let pointer: { x: number; y: number } | undefined;\n let openedAt: { x: number; y: number } | undefined;\n const moved = () => !openedAt || !pointer || Math.hypot(pointer.x - openedAt.x, pointer.y - openedAt.y) >= REST_SLOP;\n const arm = () => {\n setArmed(false);\n window.clearTimeout(armTimer);\n armTimer = window.setTimeout(() => setArmed(true), ARM_MS);\n };\n onCleanup(() => window.clearTimeout(armTimer));\n arm();\n const open = (next: string, back: boolean) => {\n openedAt = pointer;\n batch(() => {\n arm();\n if (back) setPath((all) => all.slice(0, -1));\n else setPath((all) => [...all, level()]);\n setLevel(next);\n });\n };\n const current = createMemo(() => props.overlay.level(level(), props.payload()));\n /** Keyed by `id`: a tile whose words stay the same keeps its element, also when the host's data updates. */\n const tiles = createMemo<Tile[]>((previous) => {\n const above = path().at(-1);\n const back: Tile[] =\n above === undefined ? [] : [{ id: \"k2b-back\", label: t().back, icon: \"ti ti-arrow-left\", opens: above, back: true }];\n const same = (a: Tile, b: Tile) =>\n a.label === b.label && a.description === b.description && a.disabled === b.disabled && a.opens === b.opens && a.icon === b.icon;\n return [...back, ...current().tiles].map(\n (tile) => previous.find((old) => old.id === tile.id && same(old, tile) && old.onDrop === tile.onDrop) ?? tile,\n );\n }, []);\n const status = (detail: string) => {\n const messages = dragMessages();\n const payload = props.payload();\n setDragStatus({ lead: messages.statusLead({ label: payload.label, count: payload.count ?? 1 }), detail });\n };\n // Over the overlay, the item is named in the top line; the preview shrinks to its icon and count.\n onMount(() => {\n const preview = currentPreview();\n preview?.setAttribute(\"data-compact\", \"\");\n onCleanup(() => preview?.removeAttribute(\"data-compact\"));\n });\n\n // Anywhere on the overlay outside a tile, letting go changes nothing; so does the marked area, which says so.\n onMount(() => {\n for (const element of [root, cancel]) {\n let inside = false;\n const target = registerDropTarget(element, {\n accept: props.overlay.accept,\n label: t().cancel,\n messages: dragMessages(),\n cancels: true,\n drop: () => {},\n hover: (point) => {\n if (point) pointer = point;\n if (!point) inside = false;\n else if (!inside) {\n inside = true;\n status(dragMessages().statusIdle);\n if (element === cancel) announce(root, dragMessages().over({ target: t().cancel }));\n }\n return undefined;\n },\n });\n onCleanup(() => target.dispose());\n }\n });\n\n const TileView = (tile: Tile) => {\n let element!: HTMLDivElement;\n let dwell = 0;\n let resting = false;\n let inside = false;\n const stop = () => {\n inside = false;\n resting = false;\n window.clearTimeout(dwell);\n delete element.dataset.dwell;\n };\n onCleanup(stop);\n // A tile takes part only once the level is armed; until then the overlay under it takes the pointer.\n createEffect(() => {\n if (!armed()) return;\n const target = untrack(() =>\n registerDropTarget(element, {\n accept: props.overlay.accept,\n label: tile.disabled ? `${tile.label} – ${tile.disabled}` : tile.label,\n messages: dragMessages(),\n disabled: tile.disabled !== undefined,\n cancels: !tile.onDrop,\n drop: (payload) => tile.onDrop?.(payload),\n hover: (point) => {\n if (!point) {\n stop();\n return undefined;\n }\n pointer = point;\n if (!inside) {\n inside = true;\n status(tile.onDrop ? dragMessages().statusOver({ target: tile.label }) : dragMessages().statusIdle);\n announce(root, dragMessages().over({ target: tile.label }));\n }\n // Resting opens the level only after the pointer moved since the last change, so a tile that appears\n // under a still pointer never opens by itself.\n if (!resting && tile.opens !== undefined && moved()) {\n resting = true;\n element.dataset.dwell = \"\";\n const opens = tile.opens;\n dwell = window.setTimeout(() => open(opens, tile.back === true), DWELL_MS);\n }\n return undefined;\n },\n }),\n );\n onCleanup(() => {\n stop();\n target.dispose();\n });\n });\n const description = () => tile.disabled ?? tile.description ?? (tile.opens !== undefined && !tile.back ? t().rest : undefined);\n return (\n <div\n ref={element}\n class=\"k2b-drop-overlay__tile\"\n data-back={tile.back ? \"\" : undefined}\n aria-disabled={tile.disabled !== undefined ? \"true\" : undefined}\n style={{ \"--k2b-drop-dwell\": `${DWELL_MS}ms` }}\n >\n {tile.leading ?? <i class={`k2b-drop-overlay__icon ${tile.icon ?? \"ti ti-circle-dot\"}`} aria-hidden=\"true\" />}\n <span class=\"k2b-drop-overlay__text\">\n <span class=\"k2b-drop-overlay__label\">{tile.label}</span>\n <Show when={description()}>{(text) => <span class=\"k2b-drop-overlay__description\">{text()}</span>}</Show>\n </span>\n <Show when={tile.opens !== undefined && !tile.back}>\n <i class=\"ti ti-chevron-right k2b-drop-overlay__chevron\" aria-hidden=\"true\" />\n </Show>\n <Show when={tile.opens !== undefined}>\n <span class=\"k2b-drop-overlay__ring\" aria-hidden=\"true\" />\n </Show>\n </div>\n );\n };\n\n return (\n <div\n ref={root}\n class={`k2b-drop-overlay${props.overlay.class ? ` ${props.overlay.class}` : \"\"}`}\n role=\"region\"\n aria-label={t().label}\n data-level={level() === \"root\" ? \"root\" : \"inner\"}\n data-arming={armed() ? undefined : \"\"}\n >\n <div class=\"k2b-drop-overlay__top\">\n <i class=\"ti ti-hand-grab\" aria-hidden=\"true\" />\n <span class=\"k2b-drop-overlay__what\">{props.payload().label}</span>\n <span class=\"k2b-drop-overlay__help\">\n {t().help}\n {props.overlay.hint ? ` · ${props.overlay.hint}` : \"\"}\n </span>\n </div>\n <Show when={current().title}>{(title) => <div class=\"k2b-drop-overlay__title\">{title()}</div>}</Show>\n <div class=\"k2b-drop-overlay__grid\">\n <For each={tiles()}>{(tile) => TileView(tile)}</For>\n </div>\n <div ref={cancel} class=\"k2b-drop-overlay__cancel\">\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n {t().cancel}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,QAAQ,UAAU;AAC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G,OAAO;QAAA,OACpC,KAAK,CAAC,CAAC,GAAG,SAAS,GAAG,EAAE;MAAA;MAAA;MAAA;MAAA;MAAA;IAAA;MAAA;MAAA;MAAA;MAAA;IAAA;IAAA;EAAA;AAoB3C","ignoreList":[]}
|
|
@@ -3,15 +3,17 @@ export { CommandMenu } from "./CommandMenu";
|
|
|
3
3
|
export { ContextMenu } from "./ContextMenu";
|
|
4
4
|
export { CopyButton } from "./CopyButton";
|
|
5
5
|
export { Disclosure } from "./Disclosure";
|
|
6
|
-
export { activeDrag, DragSource, DropTarget, useKeyboardDrag } from "./DragAndDrop";
|
|
6
|
+
export { activeDrag, DragSource, DropTarget, dragStatus, useKeyboardDrag } from "./DragAndDrop";
|
|
7
7
|
export { Dropdown, DropdownItem, dropdownPosition } from "./Dropdown";
|
|
8
|
+
export { DropOverlay } from "./DropOverlay";
|
|
9
|
+
export { dropOverlayPages } from "./drop-overlay-pages";
|
|
8
10
|
export { FilterChip, FilterToggle } from "./FilterChip";
|
|
9
11
|
export { GestureMenu } from "./GestureMenu";
|
|
10
12
|
export { RemoveButton } from "./RemoveButton";
|
|
11
13
|
export { SegmentedControl } from "./SegmentedControl";
|
|
12
14
|
export { SelectionAction } from "./SelectionAction";
|
|
13
15
|
export { SelectionToolbar } from "./SelectionToolbar";
|
|
14
|
-
export { SortableList } from "./SortableList";
|
|
16
|
+
export { SortableList, useSortableMoveMenu } from "./SortableList";
|
|
15
17
|
export { SplitButton } from "./SplitButton";
|
|
16
18
|
export { openSpotlightSearch, SpotlightButton } from "./SpotlightSearch";
|
|
17
19
|
export { Tabs } from "./Tabs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["actions/index.ts"],"sourcesContent":["export type { ButtonAlign, ButtonLinkProps, ButtonProps, ButtonSize, ButtonVariant, IconButtonLinkProps, IconButtonProps } from \"./Button\";\nexport { Button, ButtonLink, IconButton, IconButtonLink } from \"./Button\";\nexport type { CommandMenuProps } from \"./CommandMenu\";\nexport { CommandMenu } from \"./CommandMenu\";\nexport type { ContextMenuProps } from \"./ContextMenu\";\nexport { ContextMenu } from \"./ContextMenu\";\nexport type { CopyButtonProps, CopyButtonValue } from \"./CopyButton\";\nexport { CopyButton } from \"./CopyButton\";\nexport type { CommandContext, CommandItem, CommandSource, CommandStep } from \"./command-items\";\nexport type { DisclosureProps } from \"./Disclosure\";\nexport { Disclosure } from \"./Disclosure\";\nexport type { DragPayload, DragSourceProps, DropTargetProps } from \"./DragAndDrop\";\nexport { activeDrag, DragSource, DropTarget, useKeyboardDrag } from \"./DragAndDrop\";\nexport type {\n DropdownAction,\n DropdownActionBase,\n DropdownAnchor,\n DropdownChoice,\n DropdownItemProps,\n DropdownPosition,\n DropdownProps,\n DropdownReturnFocus,\n DropdownSearch,\n DropdownSection,\n DropdownTriggerProps,\n} from \"./Dropdown\";\nexport { Dropdown, DropdownItem, dropdownPosition } from \"./Dropdown\";\nexport type { FilterChipOption, FilterChipProps, FilterChipSection, FilterToggleProps } from \"./FilterChip\";\nexport { FilterChip, FilterToggle } from \"./FilterChip\";\nexport type { GestureKind, GestureMenuAction, GestureMenuItem, GestureMenuProps, GestureMenuSection } from \"./GestureMenu\";\nexport { GestureMenu } from \"./GestureMenu\";\nexport type { RemoveButtonProps } from \"./RemoveButton\";\nexport { RemoveButton } from \"./RemoveButton\";\nexport type { SegmentedControlProps, SegmentOption } from \"./SegmentedControl\";\nexport { SegmentedControl } from \"./SegmentedControl\";\nexport type { SelectionActionProps, SelectionActionSelection } from \"./SelectionAction\";\nexport { SelectionAction } from \"./SelectionAction\";\nexport type { SelectionToolbarProps } from \"./SelectionToolbar\";\nexport { SelectionToolbar } from \"./SelectionToolbar\";\nexport type { SortableListProps } from \"./SortableList\";\nexport { SortableList } from \"./SortableList\";\nexport type { SplitButtonProps } from \"./SplitButton\";\nexport { SplitButton } from \"./SplitButton\";\nexport type {\n SpotlightButtonProps,\n SpotlightButtonVariant,\n SpotlightSearchOptions,\n SpotlightSearchResolver,\n} from \"./SpotlightSearch\";\nexport {\n openSpotlightSearch,\n SpotlightButton,\n} from \"./SpotlightSearch\";\nexport type { TabOption, TabsItemProps, TabsProps } from \"./Tabs\";\nexport { Tabs } from \"./Tabs\";\nexport type {\n ToolbarActionProps,\n ToolbarDockProps,\n ToolbarGroupProps,\n ToolbarLabelProps,\n ToolbarProps,\n ToolbarSeparatorProps,\n} from \"./Toolbar\";\nexport { Toolbar, ToolbarDock } from \"./Toolbar\";\nexport type { ViewTab, ViewTabsProps } from \"./ViewTabs\";\nexport { ViewTabs } from \"./ViewTabs\";\n"],"mappings":"AACA,SAAS,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,QAAQ,UAAU;AAEzE,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,UAAU,QAAQ,cAAc;AAGzC,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,QAAQ,eAAe;
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/index.ts"],"sourcesContent":["export type { ButtonAlign, ButtonLinkProps, ButtonProps, ButtonSize, ButtonVariant, IconButtonLinkProps, IconButtonProps } from \"./Button\";\nexport { Button, ButtonLink, IconButton, IconButtonLink } from \"./Button\";\nexport type { CommandMenuProps } from \"./CommandMenu\";\nexport { CommandMenu } from \"./CommandMenu\";\nexport type { ContextMenuProps } from \"./ContextMenu\";\nexport { ContextMenu } from \"./ContextMenu\";\nexport type { CopyButtonProps, CopyButtonValue } from \"./CopyButton\";\nexport { CopyButton } from \"./CopyButton\";\nexport type { CommandContext, CommandItem, CommandSource, CommandStep } from \"./command-items\";\nexport type { DisclosureProps } from \"./Disclosure\";\nexport { Disclosure } from \"./Disclosure\";\nexport type { DragPayload, DragSourceProps, DragStatus, DropTargetProps } from \"./DragAndDrop\";\nexport { activeDrag, DragSource, DropTarget, dragStatus, useKeyboardDrag } from \"./DragAndDrop\";\nexport type {\n DropdownAction,\n DropdownActionBase,\n DropdownAnchor,\n DropdownChoice,\n DropdownItemProps,\n DropdownPosition,\n DropdownProps,\n DropdownReturnFocus,\n DropdownSearch,\n DropdownSection,\n DropdownSubmenu,\n DropdownTriggerProps,\n} from \"./Dropdown\";\nexport { Dropdown, DropdownItem, dropdownPosition } from \"./Dropdown\";\nexport type { DropOverlayLevel, DropOverlayProps, DropOverlayTile } from \"./DropOverlay\";\nexport { DropOverlay } from \"./DropOverlay\";\nexport type { DropOverlayPageLabels } from \"./drop-overlay-pages\";\nexport { dropOverlayPages } from \"./drop-overlay-pages\";\nexport type { FilterChipOption, FilterChipProps, FilterChipSection, FilterToggleProps } from \"./FilterChip\";\nexport { FilterChip, FilterToggle } from \"./FilterChip\";\nexport type { GestureKind, GestureMenuAction, GestureMenuItem, GestureMenuProps, GestureMenuSection } from \"./GestureMenu\";\nexport { GestureMenu } from \"./GestureMenu\";\nexport type { RemoveButtonProps } from \"./RemoveButton\";\nexport { RemoveButton } from \"./RemoveButton\";\nexport type { SegmentedControlProps, SegmentOption } from \"./SegmentedControl\";\nexport { SegmentedControl } from \"./SegmentedControl\";\nexport type { SelectionActionProps, SelectionActionSelection } from \"./SelectionAction\";\nexport { SelectionAction } from \"./SelectionAction\";\nexport type { SelectionToolbarProps } from \"./SelectionToolbar\";\nexport { SelectionToolbar } from \"./SelectionToolbar\";\nexport type { SortableListProps, SortableMove } from \"./SortableList\";\nexport { SortableList, useSortableMoveMenu } from \"./SortableList\";\nexport type { SplitButtonProps } from \"./SplitButton\";\nexport { SplitButton } from \"./SplitButton\";\nexport type {\n SpotlightButtonProps,\n SpotlightButtonVariant,\n SpotlightSearchOptions,\n SpotlightSearchResolver,\n} from \"./SpotlightSearch\";\nexport {\n openSpotlightSearch,\n SpotlightButton,\n} from \"./SpotlightSearch\";\nexport type { TabOption, TabsItemProps, TabsProps } from \"./Tabs\";\nexport { Tabs } from \"./Tabs\";\nexport type {\n ToolbarActionProps,\n ToolbarDockProps,\n ToolbarGroupProps,\n ToolbarLabelProps,\n ToolbarProps,\n ToolbarSeparatorProps,\n} from \"./Toolbar\";\nexport { Toolbar, ToolbarDock } from \"./Toolbar\";\nexport type { ViewTab, ViewTabsProps } from \"./ViewTabs\";\nexport { ViewTabs } from \"./ViewTabs\";\n"],"mappings":"AACA,SAAS,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,QAAQ,UAAU;AAEzE,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,UAAU,QAAQ,cAAc;AAGzC,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,QAAQ,eAAe;AAe/F,SAAS,QAAQ,EAAE,YAAY,EAAE,gBAAgB,QAAQ,YAAY;AAErE,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,gBAAgB,QAAQ,sBAAsB;AAEvD,SAAS,UAAU,EAAE,YAAY,QAAQ,cAAc;AAEvD,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,gBAAgB,QAAQ,oBAAoB;AAErD,SAAS,eAAe,QAAQ,mBAAmB;AAEnD,SAAS,gBAAgB,QAAQ,oBAAoB;AAErD,SAAS,YAAY,EAAE,mBAAmB,QAAQ,gBAAgB;AAElE,SAAS,WAAW,QAAQ,eAAe;AAO3C,SACE,mBAAmB,EACnB,eAAe,QACV,mBAAmB;AAE1B,SAAS,IAAI,QAAQ,QAAQ;AAS7B,SAAS,OAAO,EAAE,WAAW,QAAQ,WAAW;AAEhD,SAAS,QAAQ,QAAQ,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { i18n } from "@k2b/stdlib";
|
|
2
|
+
import { useLocale } from "../intl/locale";
|
|
3
|
+
|
|
4
|
+
/** The phone menu sheet's own words; they load with the sheet, so menus without one do not carry them. */
|
|
5
|
+
const menuSheetMessages = i18n.define({
|
|
6
|
+
baseLocale: "en",
|
|
7
|
+
messages: {
|
|
8
|
+
en: {
|
|
9
|
+
menuBack: ({
|
|
10
|
+
menu
|
|
11
|
+
}) => `Back from ${menu}`
|
|
12
|
+
},
|
|
13
|
+
de: {
|
|
14
|
+
menuBack: ({
|
|
15
|
+
menu
|
|
16
|
+
}) => `Zurück aus ${menu}`
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
/** Resolved from the inherited render locale. */
|
|
21
|
+
export const useMenuSheetMessages = () => {
|
|
22
|
+
const locale = useLocale();
|
|
23
|
+
return () => menuSheetMessages.resolve([locale()]).t;
|
|
24
|
+
};
|
|
25
|
+
export const checkMenuSheetMessages = () => menuSheetMessages.check();
|
|
26
|
+
//# sourceMappingURL=menu-sheet-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/menu-sheet-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** The phone menu sheet's own words; they load with the sheet, so menus without one do not carry them. */\nconst menuSheetMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n menuBack: ({ menu }: { menu: string }) => `Back from ${menu}`,\n },\n de: {\n menuBack: ({ menu }: { menu: string }) => `Zurück aus ${menu}`,\n },\n },\n});\n\nexport type MenuSheetMessages = ReturnType<(typeof menuSheetMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useMenuSheetMessages = (): (() => MenuSheetMessages) => {\n const locale = useLocale();\n return () => menuSheetMessages.resolve([locale()]).t;\n};\n\nexport const checkMenuSheetMessages = () => menuSheetMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC;EACpC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,QAAQ,EAAE,CAAC;QAAE;MAAuB,CAAC,KAAK,aAAa,IAAI;IAC7D,CAAC;IACD,EAAE,EAAE;MACF,QAAQ,EAAE,CAAC;QAAE;MAAuB,CAAC,KAAK,cAAc,IAAI;IAC9D;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,oBAAoB,GAAG,MAAiC;EACnE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,OAAO,MAAM,sBAAsB,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -9,14 +9,16 @@ import { insert as _$insert } from "solid-js/web";
|
|
|
9
9
|
import { createComponent as _$createComponent } from "solid-js/web";
|
|
10
10
|
import { use as _$use } from "solid-js/web";
|
|
11
11
|
var _tmpl$ = /*#__PURE__*/_$template(`<div class=k2b-gesture-menu__sheet-menu role=menu>`),
|
|
12
|
-
_tmpl$2 = /*#__PURE__*/_$template(`<
|
|
13
|
-
_tmpl$3 = /*#__PURE__*/_$template(`<
|
|
12
|
+
_tmpl$2 = /*#__PURE__*/_$template(`<button type=button role=menuitem tabindex=-1 class="k2b-dropdown__item k2b-dropdown__back"><i class="ti ti-chevron-left"aria-hidden=true></i><span class=k2b-dropdown__copy><span>`),
|
|
13
|
+
_tmpl$3 = /*#__PURE__*/_$template(`<div class=k2b-gesture-menu__sheet-menu role=dialog data-search>`),
|
|
14
|
+
_tmpl$4 = /*#__PURE__*/_$template(`<p class=k2b-dropdown__note>`);
|
|
14
15
|
import { createSignal, onCleanup, onMount, Show } from "solid-js";
|
|
15
16
|
import { dialogCore } from "../feedback/dialog-core";
|
|
16
17
|
import { LocaleProvider } from "../intl/locale";
|
|
17
18
|
import BottomSheet, { bottomSheetOptions } from "../layout/BottomSheet";
|
|
18
19
|
import { focusMenuRow, focusRowSegment } from "./menu-rows";
|
|
19
20
|
import { filterDropdownItems, MenuSearch } from "./menu-search";
|
|
21
|
+
import { useMenuSheetMessages } from "./menu-sheet-messages";
|
|
20
22
|
|
|
21
23
|
// Kept apart so a control can check for phones without loading the sheet and its dialog imports.
|
|
22
24
|
export { PHONE_SHEET_QUERY, prefersMenuSheet } from "./phone-sheet";
|
|
@@ -40,6 +42,11 @@ const followLink = href => {
|
|
|
40
42
|
*/
|
|
41
43
|
const afterClose = (items, run) => {
|
|
42
44
|
const entry = item => {
|
|
45
|
+
// A submenu's entries run after the sheet closed as well.
|
|
46
|
+
if ("submenu" in item) return {
|
|
47
|
+
...item,
|
|
48
|
+
submenu: afterClose(item.submenu, run)
|
|
49
|
+
};
|
|
43
50
|
// A plain link would navigate while the sheet's history entry is still being removed, and that Back could
|
|
44
51
|
// undo the navigation; a plain click instead follows it once the sheet is gone. Modified clicks and external
|
|
45
52
|
// links keep the browser's own behavior.
|
|
@@ -73,10 +80,34 @@ const menuItems = menu => Array.from(menu.querySelectorAll("[role^='menuitem']:n
|
|
|
73
80
|
*/
|
|
74
81
|
function SheetMenu(props) {
|
|
75
82
|
let menu;
|
|
83
|
+
const messages = useMenuSheetMessages();
|
|
84
|
+
// K16: on a phone a submenu takes the sheet's place, one level at a time, with Back at its top.
|
|
85
|
+
const [levels, setLevels] = createSignal([]);
|
|
86
|
+
const current = () => levels().at(-1);
|
|
87
|
+
const focusRow = index => queueMicrotask(() => menuItems(menu)[index]?.focus());
|
|
88
|
+
const drill = (item, row) => {
|
|
89
|
+
const index = menuItems(menu).indexOf(row);
|
|
90
|
+
setLevels(stack => [...stack, {
|
|
91
|
+
label: item.label,
|
|
92
|
+
items: item.submenu,
|
|
93
|
+
index
|
|
94
|
+
}]);
|
|
95
|
+
// The back row comes first; the level's first entry takes the focus.
|
|
96
|
+
focusRow(1);
|
|
97
|
+
};
|
|
98
|
+
const back = () => {
|
|
99
|
+
const left = current();
|
|
100
|
+
if (!left) return;
|
|
101
|
+
setLevels(stack => stack.slice(0, -1));
|
|
102
|
+
focusRow(left.index);
|
|
103
|
+
};
|
|
76
104
|
const onKeyDown = event => {
|
|
77
105
|
const items = menuItems(menu);
|
|
78
|
-
if (
|
|
79
|
-
event.
|
|
106
|
+
if (focusMenuRow(items, event.key) || focusRowSegment(items, event.key)) return void event.preventDefault();
|
|
107
|
+
if (current() && (event.key === "ArrowLeft" || event.key === "Backspace")) {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
back();
|
|
110
|
+
}
|
|
80
111
|
};
|
|
81
112
|
// Keys pressed on the sheet itself, while it is the top level of the shared dialog.
|
|
82
113
|
const onSheetKeyDown = event => {
|
|
@@ -91,14 +122,45 @@ function SheetMenu(props) {
|
|
|
91
122
|
_el$.$$keydown = onKeyDown;
|
|
92
123
|
var _ref$ = menu;
|
|
93
124
|
typeof _ref$ === "function" ? _$use(_ref$, _el$) : menu = _el$;
|
|
94
|
-
_$insert(_el$, _$createComponent(
|
|
95
|
-
get
|
|
96
|
-
return
|
|
125
|
+
_$insert(_el$, _$createComponent(Show, {
|
|
126
|
+
get when() {
|
|
127
|
+
return current();
|
|
97
128
|
},
|
|
98
|
-
|
|
129
|
+
keyed: true,
|
|
130
|
+
get fallback() {
|
|
131
|
+
return _$createComponent(props.Items, {
|
|
132
|
+
get items() {
|
|
133
|
+
return props.items;
|
|
134
|
+
},
|
|
135
|
+
close: () => props.close(),
|
|
136
|
+
drill: drill
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
children: level => [(() => {
|
|
140
|
+
var _el$2 = _$getNextElement(_tmpl$2),
|
|
141
|
+
_el$3 = _el$2.firstChild,
|
|
142
|
+
_el$4 = _el$3.nextSibling,
|
|
143
|
+
_el$5 = _el$4.firstChild;
|
|
144
|
+
_el$2.$$click = back;
|
|
145
|
+
_$insert(_el$5, () => level.label);
|
|
146
|
+
_$effect(() => _$setAttribute(_el$2, "aria-label", messages().menuBack({
|
|
147
|
+
menu: level.label
|
|
148
|
+
})));
|
|
149
|
+
_$runHydrationEvents();
|
|
150
|
+
return _el$2;
|
|
151
|
+
})(), _$createComponent(props.Items, {
|
|
152
|
+
get items() {
|
|
153
|
+
return level.items;
|
|
154
|
+
},
|
|
155
|
+
close: () => props.close(),
|
|
156
|
+
drill: drill,
|
|
157
|
+
get depth() {
|
|
158
|
+
return levels().length + 1;
|
|
159
|
+
}
|
|
160
|
+
})]
|
|
99
161
|
}));
|
|
100
162
|
_$effect(_p$ => {
|
|
101
|
-
var _v$ = props.label,
|
|
163
|
+
var _v$ = current()?.label ?? props.label,
|
|
102
164
|
_v$2 = props.icons === "tile" ? "tile" : undefined;
|
|
103
165
|
_v$ !== _p$.e && _$setAttribute(_el$, "aria-label", _p$.e = _v$);
|
|
104
166
|
_v$2 !== _p$.t && _$setAttribute(_el$, "data-icons", _p$.t = _v$2);
|
|
@@ -116,8 +178,8 @@ function SheetSearch(props) {
|
|
|
116
178
|
const [query, setQuery] = createSignal("");
|
|
117
179
|
const filter = props.search.filter;
|
|
118
180
|
return (() => {
|
|
119
|
-
var _el$
|
|
120
|
-
_$insert(_el$
|
|
181
|
+
var _el$6 = _$getNextElement(_tmpl$3);
|
|
182
|
+
_$insert(_el$6, _$createComponent(MenuSearch, {
|
|
121
183
|
get Items() {
|
|
122
184
|
return props.Items;
|
|
123
185
|
},
|
|
@@ -141,14 +203,14 @@ function SheetSearch(props) {
|
|
|
141
203
|
_$effect(_p$ => {
|
|
142
204
|
var _v$3 = props.label,
|
|
143
205
|
_v$4 = props.icons === "tile" ? "tile" : undefined;
|
|
144
|
-
_v$3 !== _p$.e && _$setAttribute(_el$
|
|
145
|
-
_v$4 !== _p$.t && _$setAttribute(_el$
|
|
206
|
+
_v$3 !== _p$.e && _$setAttribute(_el$6, "aria-label", _p$.e = _v$3);
|
|
207
|
+
_v$4 !== _p$.t && _$setAttribute(_el$6, "data-icons", _p$.t = _v$4);
|
|
146
208
|
return _p$;
|
|
147
209
|
}, {
|
|
148
210
|
e: undefined,
|
|
149
211
|
t: undefined
|
|
150
212
|
});
|
|
151
|
-
return _el$
|
|
213
|
+
return _el$6;
|
|
152
214
|
})();
|
|
153
215
|
}
|
|
154
216
|
|
|
@@ -221,9 +283,9 @@ export const openMenuSheet = options => {
|
|
|
221
283
|
return options.note;
|
|
222
284
|
},
|
|
223
285
|
get children() {
|
|
224
|
-
var _el$
|
|
225
|
-
_$insert(_el$
|
|
226
|
-
return _el$
|
|
286
|
+
var _el$7 = _$getNextElement(_tmpl$4);
|
|
287
|
+
_$insert(_el$7, () => options.note);
|
|
288
|
+
return _el$7;
|
|
227
289
|
}
|
|
228
290
|
})];
|
|
229
291
|
}
|
|
@@ -238,5 +300,5 @@ export const openMenuSheet = options => {
|
|
|
238
300
|
signal: options.signal
|
|
239
301
|
}).then(() => chosen?.());
|
|
240
302
|
};
|
|
241
|
-
_$delegateEvents(["keydown"]);
|
|
303
|
+
_$delegateEvents(["keydown", "click"]);
|
|
242
304
|
//# sourceMappingURL=menu-sheet.js.map
|