@k2b/ui 0.32.0 → 0.33.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/browser/actions/Dropdown.js +159 -99
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/FilterChip.js +113 -56
- package/dist/browser/actions/FilterChip.js.map +1 -1
- package/dist/browser/actions/filter-messages.js +26 -2
- package/dist/browser/actions/filter-messages.js.map +1 -1
- package/dist/browser/actions/menu-rows.js +23 -3
- package/dist/browser/actions/menu-rows.js.map +1 -1
- package/dist/browser/actions/menu-sheet.js +2 -7
- package/dist/browser/actions/menu-sheet.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +480 -403
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/chat-messages.js +14 -0
- package/dist/browser/chat/chat-messages.js.map +1 -1
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/content/Calendar.js +39 -29
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +159 -165
- package/dist/browser/content/CalendarDayView.js.map +1 -1
- package/dist/browser/content/MessageRow.js +607 -343
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/ReactionBar.js +17 -0
- package/dist/browser/content/ReactionBar.js.map +1 -1
- package/dist/browser/content/index.js +1 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +6 -0
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +4 -1
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/intl/shortcut-messages.js +4 -0
- package/dist/browser/intl/shortcut-messages.js.map +1 -1
- package/dist/browser/intl/shortcut.js +4 -0
- package/dist/browser/intl/shortcut.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +529 -512
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/MobileShell.js +213 -38
- package/dist/browser/layout/MobileShell.js.map +1 -1
- package/dist/browser/layout/index.js +1 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/scroll-fade.js +32 -5
- package/dist/browser/layout/scroll-fade.js.map +1 -1
- package/dist/browser/surfaces/NoticeCard.js +46 -30
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/browser/surfaces/resource-messages.js +2 -2
- package/dist/browser/surfaces/resource-messages.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +51 -27
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/FilterChip.js +67 -16
- package/dist/ssr/actions/FilterChip.js.map +1 -1
- package/dist/ssr/actions/filter-messages.js +26 -2
- package/dist/ssr/actions/filter-messages.js.map +1 -1
- package/dist/ssr/actions/menu-rows.js +23 -3
- package/dist/ssr/actions/menu-rows.js.map +1 -1
- package/dist/ssr/actions/menu-sheet.js +2 -7
- package/dist/ssr/actions/menu-sheet.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +96 -67
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/chat-messages.js +14 -0
- package/dist/ssr/chat/chat-messages.js.map +1 -1
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/content/Calendar.js +40 -31
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +40 -48
- package/dist/ssr/content/CalendarDayView.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +264 -91
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/ReactionBar.js +17 -0
- package/dist/ssr/content/ReactionBar.js.map +1 -1
- package/dist/ssr/content/index.js +1 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +6 -0
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js +4 -1
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/intl/shortcut-messages.js +4 -0
- package/dist/ssr/intl/shortcut-messages.js.map +1 -1
- package/dist/ssr/intl/shortcut.js +4 -0
- package/dist/ssr/intl/shortcut.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +134 -122
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/MobileShell.js +100 -20
- package/dist/ssr/layout/MobileShell.js.map +1 -1
- package/dist/ssr/layout/index.js +1 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/scroll-fade.js +32 -5
- package/dist/ssr/layout/scroll-fade.js.map +1 -1
- package/dist/ssr/surfaces/NoticeCard.js +21 -12
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/surfaces/resource-messages.js +2 -2
- package/dist/ssr/surfaces/resource-messages.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/Dropdown.d.ts +14 -0
- package/dist/types/actions/FilterChip.d.ts +11 -0
- package/dist/types/actions/filter-messages.d.ts +12 -0
- package/dist/types/actions/menu-rows.d.ts +7 -2
- package/dist/types/chat/ChatComposer.d.ts +13 -0
- package/dist/types/chat/chat-messages.d.ts +7 -0
- package/dist/types/chat/index.d.ts +1 -1
- package/dist/types/content/Calendar.d.ts +7 -0
- package/dist/types/content/MessageRow.d.ts +64 -2
- package/dist/types/content/index.d.ts +2 -2
- package/dist/types/feedback/dialog-core.d.ts +3 -0
- package/dist/types/intl/shortcut-messages.d.ts +2 -0
- package/dist/types/layout/AppWorkspace.d.ts +2 -0
- package/dist/types/layout/MobileShell.d.ts +52 -5
- package/dist/types/layout/index.d.ts +2 -1
- package/dist/types/layout/scroll-fade.d.ts +5 -0
- package/dist/types/surfaces/NoticeCard.d.ts +3 -0
- package/package.json +2 -2
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
|
|
2
|
-
import { createComponent as _$createComponent } from "solid-js/web";
|
|
3
|
-
import { ssr as _$ssr } from "solid-js/web";
|
|
4
2
|
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
3
|
+
import { ssr as _$ssr } from "solid-js/web";
|
|
5
4
|
import { escape as _$escape } from "solid-js/web";
|
|
5
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
6
6
|
import { memo as _$memo } from "solid-js/web";
|
|
7
|
-
var _tmpl$ = ["<
|
|
7
|
+
var _tmpl$ = ["<span class=\"k2b-filter-chip__swatches\" aria-hidden=\"true\">", "</span>"],
|
|
8
8
|
_tmpl$2 = ["<span class=\"k2b-filter-chip__label\">", "", "</span>"],
|
|
9
9
|
_tmpl$3 = "<i class=\"ti ti-chevron-down k2b-filter-chip__chevron\" aria-hidden=\"true\"></i>",
|
|
10
|
-
_tmpl$4 = ["<
|
|
11
|
-
_tmpl$5 = ["<span class=\"k2b-filter-chip__dot\" style=\"", "\"
|
|
12
|
-
_tmpl$6 = ["<span class=\"k2b-filter-
|
|
13
|
-
_tmpl$7 = ["<
|
|
14
|
-
_tmpl$8 = ["<
|
|
15
|
-
|
|
10
|
+
_tmpl$4 = ["<i", " aria-hidden=\"true\"></i>"],
|
|
11
|
+
_tmpl$5 = ["<span class=\"k2b-filter-chip__dot\" style=\"", "\"></span>"],
|
|
12
|
+
_tmpl$6 = ["<span class=\"k2b-filter-chip__value\">: ", "", "", "</span>"],
|
|
13
|
+
_tmpl$7 = ["<span class=\"k2b-filter-chip__dot\" style=\"", "\" aria-hidden=\"true\"></span>"],
|
|
14
|
+
_tmpl$8 = ["<span class=\"k2b-filter-chip__label\">", "</span>"],
|
|
15
|
+
_tmpl$9 = ["<a", ">", "</a>"],
|
|
16
|
+
_tmpl$0 = ["<button type=\"button\"", "", ">", "</button>"];
|
|
17
|
+
import { createMemo, For, Show } from "solid-js";
|
|
16
18
|
import { useUiMessages } from "../intl/messages";
|
|
17
19
|
import Dropdown from "./Dropdown";
|
|
18
20
|
import { useFilterMessages } from "./filter-messages";
|
|
@@ -61,6 +63,17 @@ export function FilterChip(props) {
|
|
|
61
63
|
};
|
|
62
64
|
const reset = () => emit(props.defaultValue ? [...props.defaultValue] : []);
|
|
63
65
|
const showReset = () => hasDefault() && !atDefault() || !hasDefault() && props.value.length > 0;
|
|
66
|
+
const swatches = createMemo(() => props.swatches && !props.iconOnly ? selectedOptions().flatMap(option => option.color ? [option.color] : []).slice(0, 4) : []);
|
|
67
|
+
const onlyValue = value => {
|
|
68
|
+
const kept = props.value.filter(entry => !sectionByValue().get(entry)?.multiple);
|
|
69
|
+
emit([...kept, value]);
|
|
70
|
+
};
|
|
71
|
+
const toggleSection = section => {
|
|
72
|
+
const values = section.options.map(option => option.value);
|
|
73
|
+
const all = values.every(value => selected(value));
|
|
74
|
+
const others = props.value.filter(entry => !values.includes(entry));
|
|
75
|
+
emit(all ? others : [...others, ...values]);
|
|
76
|
+
};
|
|
64
77
|
const optionItems = createMemo(() => {
|
|
65
78
|
const result = [];
|
|
66
79
|
for (const section of props.options) {
|
|
@@ -72,11 +85,34 @@ export function FilterChip(props) {
|
|
|
72
85
|
closeOnSelect: false,
|
|
73
86
|
color: option.color,
|
|
74
87
|
icon: !section.multiple ? option.icon : undefined,
|
|
75
|
-
label: option.label
|
|
88
|
+
label: option.label,
|
|
89
|
+
trailing: option.trailing,
|
|
90
|
+
secondary: props.only && section.multiple ? {
|
|
91
|
+
label: filterMessages().only,
|
|
92
|
+
ariaLabel: filterMessages().onlyOption({
|
|
93
|
+
label: option.label
|
|
94
|
+
}),
|
|
95
|
+
action: () => onlyValue(option.value)
|
|
96
|
+
} : undefined
|
|
76
97
|
}));
|
|
98
|
+
// Read when the row renders, so a change of the choice updates the label without rebuilding the rows.
|
|
99
|
+
const all = () => section.options.every(option => selected(option.value));
|
|
100
|
+
const sectionLabel = section.label;
|
|
101
|
+
const labelAction = section.toggleAll && section.multiple && sectionLabel && section.options.length > 0 ? {
|
|
102
|
+
get label() {
|
|
103
|
+
return all() ? filterMessages().none : filterMessages().all;
|
|
104
|
+
},
|
|
105
|
+
get ariaLabel() {
|
|
106
|
+
return (all() ? filterMessages().noneOf : filterMessages().allOf)({
|
|
107
|
+
label: sectionLabel
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
action: () => toggleSection(section)
|
|
111
|
+
} : undefined;
|
|
77
112
|
if (section.label || section.layout) result.push({
|
|
78
113
|
sectionLabel: section.label,
|
|
79
114
|
layout: section.layout,
|
|
115
|
+
labelAction,
|
|
80
116
|
items
|
|
81
117
|
});else result.push(...items);
|
|
82
118
|
}
|
|
@@ -135,7 +171,22 @@ export function FilterChip(props) {
|
|
|
135
171
|
return triggerLabel();
|
|
136
172
|
},
|
|
137
173
|
get children() {
|
|
138
|
-
return [_$
|
|
174
|
+
return [_$createComponent(Show, {
|
|
175
|
+
get when() {
|
|
176
|
+
return swatches().length > 0;
|
|
177
|
+
},
|
|
178
|
+
get fallback() {
|
|
179
|
+
return _$ssr(_tmpl$4, _$ssrAttribute("class", _$escape(props.icon, true), false));
|
|
180
|
+
},
|
|
181
|
+
get children() {
|
|
182
|
+
return _$ssr(_tmpl$, _$escape(_$createComponent(For, {
|
|
183
|
+
get each() {
|
|
184
|
+
return swatches();
|
|
185
|
+
},
|
|
186
|
+
children: color => _$ssr(_tmpl$5, _$ssrStyleProperty("--k2b-filter-color:", _$escape(color, true)))
|
|
187
|
+
})));
|
|
188
|
+
}
|
|
189
|
+
}), _$createComponent(Show, {
|
|
139
190
|
get when() {
|
|
140
191
|
return !props.iconOnly;
|
|
141
192
|
},
|
|
@@ -154,11 +205,11 @@ export function FilterChip(props) {
|
|
|
154
205
|
}
|
|
155
206
|
});
|
|
156
207
|
},
|
|
157
|
-
children: first => _$ssr(_tmpl$
|
|
208
|
+
children: first => _$ssr(_tmpl$6, _$escape(_$createComponent(Show, {
|
|
158
209
|
get when() {
|
|
159
210
|
return first().color;
|
|
160
211
|
},
|
|
161
|
-
children: color => _$ssr(_tmpl$
|
|
212
|
+
children: color => _$ssr(_tmpl$7, _$ssrStyleProperty("--k2b-filter-color:", _$escape(color(), true)))
|
|
162
213
|
})), _$escape(first().label), _$escape(_$createComponent(Show, {
|
|
163
214
|
get when() {
|
|
164
215
|
return props.value.length > 1;
|
|
@@ -181,17 +232,17 @@ export default FilterChip;
|
|
|
181
232
|
* `aria-pressed`. Selection changes only colour and background, so neighbouring chips never move.
|
|
182
233
|
*/
|
|
183
234
|
export function FilterToggle(props) {
|
|
184
|
-
const content = () => [_$ssr(_tmpl
|
|
235
|
+
const content = () => [_$ssr(_tmpl$4, _$ssrAttribute("class", _$escape(props.icon, true), false)), _$ssr(_tmpl$8, _$escape(props.label))];
|
|
185
236
|
const className = () => `k2b-filter-chip ${props.class ?? ""}`;
|
|
186
237
|
return _$createComponent(Show, {
|
|
187
238
|
get when() {
|
|
188
239
|
return _$memo(() => props.href !== undefined)() && !props.disabled;
|
|
189
240
|
},
|
|
190
241
|
get fallback() {
|
|
191
|
-
return _$ssr(_tmpl$
|
|
242
|
+
return _$ssr(_tmpl$0, _$ssrAttribute("class", _$escape(className(), true), false) + _$ssrAttribute("data-active", props.active ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-pressed", _$escape(props.active, true), false) + _$ssrAttribute("title", _$escape(props.title, true), false), _$ssrAttribute("disabled", props.disabled, true), _$escape(content()));
|
|
192
243
|
},
|
|
193
244
|
get children() {
|
|
194
|
-
return _$ssr(_tmpl$
|
|
245
|
+
return _$ssr(_tmpl$9, _$ssrAttribute("class", _$escape(className(), true), false) + _$ssrAttribute("href", _$escape(props.href, true), false) + _$ssrAttribute("data-active", props.active ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-current", props.active ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("title", _$escape(props.title, true), false), _$escape(content()));
|
|
195
246
|
}
|
|
196
247
|
});
|
|
197
248
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["actions/FilterChip.tsx"],"sourcesContent":["import { createMemo, type JSX, Show } from \"solid-js\";\nimport { useUiMessages } from \"../intl/messages\";\nimport type { ButtonVariant } from \"./Button\";\nimport Dropdown, { type DropdownItem } from \"./Dropdown\";\nimport { useFilterMessages } from \"./filter-messages\";\n\nexport type FilterChipOption = {\n value: string;\n label: string;\n icon?: string;\n color?: string;\n};\n\nexport type FilterChipSection = {\n label?: string;\n options: readonly FilterChipOption[];\n multiple?: boolean;\n /**\n * `row` sets a few short single-select options side by side as one segmented row under its `label`. Selecting the\n * chosen option again keeps it; give the row a value in `defaultValue` so Reset keeps a choice too.\n */\n layout?: \"row\";\n};\n\nexport type FilterChipProps = {\n label: string;\n icon: string;\n options: readonly FilterChipSection[];\n value: readonly string[];\n onValueChange: (value: string[]) => void;\n isActive?: boolean;\n position?: \"bottom-left\" | \"bottom-right\";\n defaultValue?: readonly string[];\n iconOnly?: boolean;\n /** Use a standard button appearance instead of the default filter field. */\n variant?: ButtonVariant;\n /**\n * An active chip names its first value instead of a count: \"Tags: Customer\", \"Tags: Customer +2\". Use it for the\n * chips of `AppWorkspace.Head`; pass only the filter's name as `label`. The chip then grows with its value.\n */\n showValue?: boolean;\n disabled?: boolean;\n class?: string;\n};\n\n/** Section-aware controlled filter with immediate single- and multi-select commits. */\nexport function FilterChip(props: FilterChipProps): JSX.Element {\n const messages = useUiMessages();\n const filterMessages = useFilterMessages();\n const selectedValues = createMemo(() => new Set(props.value));\n const selectedOptions = createMemo(() =>\n props.options.flatMap((section) => section.options).filter((option) => selectedValues().has(option.value)),\n );\n const defaultValues = createMemo(() => new Set(props.defaultValue ?? []));\n const sectionByValue = createMemo(() => {\n const sections = new Map<string, FilterChipSection>();\n for (const section of props.options) {\n for (const option of section.options) sections.set(option.value, section);\n }\n return sections;\n });\n const hasDefault = () => (props.defaultValue?.length ?? 0) > 0;\n const selected = (value: string) => selectedValues().has(value);\n const active = () => props.isActive ?? props.value.length > 0;\n const namedValue = () => (props.showValue && !props.iconOnly && active() ? selectedOptions()[0] : undefined);\n const triggerLabel = () => {\n const first = namedValue();\n if (!first) return props.label;\n return `${props.label}: ${first.label}${props.value.length > 1 ? ` +${props.value.length - 1}` : \"\"}`;\n };\n const atDefault = () => {\n if (!props.defaultValue) return false;\n const current = props.value;\n return current.length === props.defaultValue.length && current.every((value) => defaultValues().has(value));\n };\n const emit = (value: string[]) => props.onValueChange(value);\n const toggle = (value: string) => {\n const section = sectionByValue().get(value);\n if (!section) return;\n const current = props.value;\n if (section.multiple) {\n emit(selected(value) ? current.filter((entry) => entry !== value) : [...current, value]);\n return;\n }\n // A segmented row always keeps one choice, like a SegmentedControl.\n if (section.layout === \"row\" && selected(value)) return;\n const sectionValues = new Set(section.options.map((option) => option.value));\n const otherValues = current.filter((entry) => !sectionValues.has(entry));\n emit(selected(value) ? otherValues : [...otherValues, value]);\n };\n const reset = () => emit(props.defaultValue ? [...props.defaultValue] : []);\n const showReset = () => (hasDefault() && !atDefault()) || (!hasDefault() && props.value.length > 0);\n const optionItems = createMemo<DropdownItem[]>(() => {\n const result: DropdownItem[] = [];\n for (const section of props.options) {\n const items = section.options.map((option) => ({\n action: () => toggle(option.value),\n checked: () => props.value.includes(option.value),\n choice: section.multiple ? (\"checkbox\" as const) : (\"radio\" as const),\n class: \"k2b-filter-chip__option\",\n closeOnSelect: false,\n color: option.color,\n icon: !section.multiple ? option.icon : undefined,\n label: option.label,\n }));\n if (section.label || section.layout) result.push({ sectionLabel: section.label, layout: section.layout, items });\n else result.push(...items);\n }\n return result;\n });\n const items = createMemo<DropdownItem[]>(() => {\n if (!showReset()) return optionItems();\n return [\n ...optionItems(),\n {\n sectionLabel: filterMessages().filterActions,\n items: [\n {\n action: reset,\n icon: hasDefault() ? \"ti ti-refresh\" : \"ti ti-x\",\n label: hasDefault() ? messages().reset : messages().clear,\n variant: \"danger\",\n },\n ],\n },\n ];\n });\n\n return (\n <Dropdown.Root\n disabled={props.disabled}\n items={items()}\n position={props.position ?? \"bottom-left\"}\n menuClass=\"k2b-filter-chip__menu\"\n label={props.label}\n >\n <Dropdown.Trigger\n appearance={props.variant ? \"button\" : \"plain\"}\n variant={props.variant}\n iconOnly={props.iconOnly}\n class={props.variant ? props.class : `k2b-filter-chip ${props.class ?? \"\"}`}\n data-state={active() ? \"active\" : \"idle\"}\n data-active={active() ? \"true\" : undefined}\n data-icon-only={props.iconOnly ? \"true\" : undefined}\n label={triggerLabel()}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n <Show when={!props.iconOnly}>\n <span class=\"k2b-filter-chip__label\">\n {props.label}\n <Show when={namedValue()} fallback={<Show when={!hasDefault() && props.value.length > 0}>{` (${props.value.length})`}</Show>}>\n {(first) => (\n <span class=\"k2b-filter-chip__value\">\n :{\" \"}\n <Show when={first().color}>\n {(color) => <span class=\"k2b-filter-chip__dot\" style={{ \"--k2b-filter-color\": color() }} aria-hidden=\"true\" />}\n </Show>\n {first().label}\n <Show when={props.value.length > 1}>{` +${props.value.length - 1}`}</Show>\n </span>\n )}\n </Show>\n </span>\n <i class=\"ti ti-chevron-down k2b-filter-chip__chevron\" aria-hidden=\"true\" />\n </Show>\n </Dropdown.Trigger>\n </Dropdown.Root>\n );\n}\n\nexport default FilterChip;\n\nexport type FilterToggleProps = {\n label: JSX.Element;\n icon: string;\n /** Whether the filter is on. An active toggle carries the same tint as an active `FilterChip`. */\n active: boolean;\n /** Link to the URL with the filter switched. The link keeps working without JavaScript. */\n href?: string;\n onClick?: (event: MouseEvent) => void;\n title?: string;\n disabled?: boolean;\n class?: string;\n};\n\n/**\n * One on/off filter in the chip look: a link marked `aria-current=\"true\"` while active, or a button with\n * `aria-pressed`. Selection changes only colour and background, so neighbouring chips never move.\n */\nexport function FilterToggle(props: FilterToggleProps): JSX.Element {\n const content = () => (\n <>\n <i class={props.icon} aria-hidden=\"true\" />\n <span class=\"k2b-filter-chip__label\">{props.label}</span>\n </>\n );\n const className = () => `k2b-filter-chip ${props.class ?? \"\"}`;\n return (\n <Show\n when={props.href !== undefined && !props.disabled}\n fallback={\n <button\n type=\"button\"\n class={className()}\n data-active={props.active ? \"true\" : undefined}\n aria-pressed={props.active}\n title={props.title}\n disabled={props.disabled}\n onClick={(event) => props.onClick?.(event)}\n >\n {content()}\n </button>\n }\n >\n <a\n class={className()}\n href={props.href}\n data-active={props.active ? \"true\" : undefined}\n aria-current={props.active ? \"true\" : undefined}\n title={props.title}\n onClick={(event) => props.onClick?.(event)}\n >\n {content()}\n </a>\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,UAAU,EAAY,IAAI,QAAQ,UAAU;AACrD,SAAS,aAAa,QAAQ,kBAAkB;AAEhD,OAAO,QAAQ,MAA6B,YAAY;AACxD,SAAS,iBAAiB,QAAQ,mBAAmB;AAyCrD;AACA,OAAO,SAAS,UAAU,CAAC,KAAsB,EAAe;EAC9D,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC;EAChC,MAAM,cAAc,GAAG,iBAAiB,CAAC,CAAC;EAC1C,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;EAC7D,MAAM,eAAe,GAAG,UAAU,CAAC,MACjC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAE,OAAO,IAAK,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAE,MAAM,IAAK,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAC3G,CAAC;EACD,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;EACzE,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM;IACtC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAA4B,CAAC;IACrD,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;MACnC,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;IA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,KAAK,0BAGjB,OAAO,CAAC,CAAC;IAAA;EAAA;AAIlB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/FilterChip.tsx"],"sourcesContent":["import { createMemo, For, type JSX, Show } from \"solid-js\";\nimport { useUiMessages } from \"../intl/messages\";\nimport type { ButtonVariant } from \"./Button\";\nimport Dropdown, { type DropdownItem } from \"./Dropdown\";\nimport { useFilterMessages } from \"./filter-messages\";\n\nexport type FilterChipOption = {\n value: string;\n label: string;\n icon?: string;\n color?: string;\n /** Quiet trailing information about the option, such as a short note or a loading or warning icon with its own label. */\n trailing?: JSX.Element;\n};\n\nexport type FilterChipSection = {\n label?: string;\n options: readonly FilterChipOption[];\n multiple?: boolean;\n /**\n * `row` sets a few short single-select options side by side as one segmented row under its `label`. Selecting the\n * chosen option again keeps it; give the row a value in `defaultValue` so Reset keeps a choice too.\n */\n layout?: \"row\";\n /** A labelled `multiple` section offers \"All\" or, once all its options are chosen, \"None\" beside its label. */\n toggleAll?: boolean;\n};\n\nexport type FilterChipProps = {\n label: string;\n icon: string;\n options: readonly FilterChipSection[];\n value: readonly string[];\n onValueChange: (value: string[]) => void;\n isActive?: boolean;\n position?: \"bottom-left\" | \"bottom-right\";\n defaultValue?: readonly string[];\n iconOnly?: boolean;\n /** Use a standard button appearance instead of the default filter field. */\n variant?: ButtonVariant;\n /**\n * An active chip names its first value instead of a count: \"Tags: Customer\", \"Tags: Customer +2\". Use it for the\n * chips of `AppWorkspace.Head`; pass only the filter's name as `label`. The chip then grows with its value.\n */\n showValue?: boolean;\n /**\n * Each option of a `multiple` section offers \"Only\" at the end of its row: it chooses that option alone among the\n * `multiple` sections and keeps the choices of single-select sections.\n */\n only?: boolean;\n /** The trigger shows the colors of the first four chosen options before its label, as a quiet hint of what is in view. */\n swatches?: boolean;\n disabled?: boolean;\n class?: string;\n};\n\n/** Section-aware controlled filter with immediate single- and multi-select commits. */\nexport function FilterChip(props: FilterChipProps): JSX.Element {\n const messages = useUiMessages();\n const filterMessages = useFilterMessages();\n const selectedValues = createMemo(() => new Set(props.value));\n const selectedOptions = createMemo(() =>\n props.options.flatMap((section) => section.options).filter((option) => selectedValues().has(option.value)),\n );\n const defaultValues = createMemo(() => new Set(props.defaultValue ?? []));\n const sectionByValue = createMemo(() => {\n const sections = new Map<string, FilterChipSection>();\n for (const section of props.options) {\n for (const option of section.options) sections.set(option.value, section);\n }\n return sections;\n });\n const hasDefault = () => (props.defaultValue?.length ?? 0) > 0;\n const selected = (value: string) => selectedValues().has(value);\n const active = () => props.isActive ?? props.value.length > 0;\n const namedValue = () => (props.showValue && !props.iconOnly && active() ? selectedOptions()[0] : undefined);\n const triggerLabel = () => {\n const first = namedValue();\n if (!first) return props.label;\n return `${props.label}: ${first.label}${props.value.length > 1 ? ` +${props.value.length - 1}` : \"\"}`;\n };\n const atDefault = () => {\n if (!props.defaultValue) return false;\n const current = props.value;\n return current.length === props.defaultValue.length && current.every((value) => defaultValues().has(value));\n };\n const emit = (value: string[]) => props.onValueChange(value);\n const toggle = (value: string) => {\n const section = sectionByValue().get(value);\n if (!section) return;\n const current = props.value;\n if (section.multiple) {\n emit(selected(value) ? current.filter((entry) => entry !== value) : [...current, value]);\n return;\n }\n // A segmented row always keeps one choice, like a SegmentedControl.\n if (section.layout === \"row\" && selected(value)) return;\n const sectionValues = new Set(section.options.map((option) => option.value));\n const otherValues = current.filter((entry) => !sectionValues.has(entry));\n emit(selected(value) ? otherValues : [...otherValues, value]);\n };\n const reset = () => emit(props.defaultValue ? [...props.defaultValue] : []);\n const showReset = () => (hasDefault() && !atDefault()) || (!hasDefault() && props.value.length > 0);\n const swatches = createMemo(() =>\n props.swatches && !props.iconOnly\n ? selectedOptions()\n .flatMap((option) => (option.color ? [option.color] : []))\n .slice(0, 4)\n : [],\n );\n const onlyValue = (value: string) => {\n const kept = props.value.filter((entry) => !sectionByValue().get(entry)?.multiple);\n emit([...kept, value]);\n };\n const toggleSection = (section: FilterChipSection) => {\n const values = section.options.map((option) => option.value);\n const all = values.every((value) => selected(value));\n const others = props.value.filter((entry) => !values.includes(entry));\n emit(all ? others : [...others, ...values]);\n };\n const optionItems = createMemo<DropdownItem[]>(() => {\n const result: DropdownItem[] = [];\n for (const section of props.options) {\n const items = section.options.map((option) => ({\n action: () => toggle(option.value),\n checked: () => props.value.includes(option.value),\n choice: section.multiple ? (\"checkbox\" as const) : (\"radio\" as const),\n class: \"k2b-filter-chip__option\",\n closeOnSelect: false,\n color: option.color,\n icon: !section.multiple ? option.icon : undefined,\n label: option.label,\n trailing: option.trailing,\n secondary:\n props.only && section.multiple\n ? {\n label: filterMessages().only,\n ariaLabel: filterMessages().onlyOption({ label: option.label }),\n action: () => onlyValue(option.value),\n }\n : undefined,\n }));\n // Read when the row renders, so a change of the choice updates the label without rebuilding the rows.\n const all = () => section.options.every((option) => selected(option.value));\n const sectionLabel = section.label;\n const labelAction =\n section.toggleAll && section.multiple && sectionLabel && section.options.length > 0\n ? {\n get label() {\n return all() ? filterMessages().none : filterMessages().all;\n },\n get ariaLabel() {\n return (all() ? filterMessages().noneOf : filterMessages().allOf)({ label: sectionLabel });\n },\n action: () => toggleSection(section),\n }\n : undefined;\n if (section.label || section.layout) result.push({ sectionLabel: section.label, layout: section.layout, labelAction, items });\n else result.push(...items);\n }\n return result;\n });\n const items = createMemo<DropdownItem[]>(() => {\n if (!showReset()) return optionItems();\n return [\n ...optionItems(),\n {\n sectionLabel: filterMessages().filterActions,\n items: [\n {\n action: reset,\n icon: hasDefault() ? \"ti ti-refresh\" : \"ti ti-x\",\n label: hasDefault() ? messages().reset : messages().clear,\n variant: \"danger\",\n },\n ],\n },\n ];\n });\n\n return (\n <Dropdown.Root\n disabled={props.disabled}\n items={items()}\n position={props.position ?? \"bottom-left\"}\n menuClass=\"k2b-filter-chip__menu\"\n label={props.label}\n >\n <Dropdown.Trigger\n appearance={props.variant ? \"button\" : \"plain\"}\n variant={props.variant}\n iconOnly={props.iconOnly}\n class={props.variant ? props.class : `k2b-filter-chip ${props.class ?? \"\"}`}\n data-state={active() ? \"active\" : \"idle\"}\n data-active={active() ? \"true\" : undefined}\n data-icon-only={props.iconOnly ? \"true\" : undefined}\n label={triggerLabel()}\n >\n <Show when={swatches().length > 0} fallback={<i class={props.icon} aria-hidden=\"true\" />}>\n <span class=\"k2b-filter-chip__swatches\" aria-hidden=\"true\">\n <For each={swatches()}>{(color) => <span class=\"k2b-filter-chip__dot\" style={{ \"--k2b-filter-color\": color }} />}</For>\n </span>\n </Show>\n <Show when={!props.iconOnly}>\n <span class=\"k2b-filter-chip__label\">\n {props.label}\n <Show when={namedValue()} fallback={<Show when={!hasDefault() && props.value.length > 0}>{` (${props.value.length})`}</Show>}>\n {(first) => (\n <span class=\"k2b-filter-chip__value\">\n :{\" \"}\n <Show when={first().color}>\n {(color) => <span class=\"k2b-filter-chip__dot\" style={{ \"--k2b-filter-color\": color() }} aria-hidden=\"true\" />}\n </Show>\n {first().label}\n <Show when={props.value.length > 1}>{` +${props.value.length - 1}`}</Show>\n </span>\n )}\n </Show>\n </span>\n <i class=\"ti ti-chevron-down k2b-filter-chip__chevron\" aria-hidden=\"true\" />\n </Show>\n </Dropdown.Trigger>\n </Dropdown.Root>\n );\n}\n\nexport default FilterChip;\n\nexport type FilterToggleProps = {\n label: JSX.Element;\n icon: string;\n /** Whether the filter is on. An active toggle carries the same tint as an active `FilterChip`. */\n active: boolean;\n /** Link to the URL with the filter switched. The link keeps working without JavaScript. */\n href?: string;\n onClick?: (event: MouseEvent) => void;\n title?: string;\n disabled?: boolean;\n class?: string;\n};\n\n/**\n * One on/off filter in the chip look: a link marked `aria-current=\"true\"` while active, or a button with\n * `aria-pressed`. Selection changes only colour and background, so neighbouring chips never move.\n */\nexport function FilterToggle(props: FilterToggleProps): JSX.Element {\n const content = () => (\n <>\n <i class={props.icon} aria-hidden=\"true\" />\n <span class=\"k2b-filter-chip__label\">{props.label}</span>\n </>\n );\n const className = () => `k2b-filter-chip ${props.class ?? \"\"}`;\n return (\n <Show\n when={props.href !== undefined && !props.disabled}\n fallback={\n <button\n type=\"button\"\n class={className()}\n data-active={props.active ? \"true\" : undefined}\n aria-pressed={props.active}\n title={props.title}\n disabled={props.disabled}\n onClick={(event) => props.onClick?.(event)}\n >\n {content()}\n </button>\n }\n >\n <a\n class={className()}\n href={props.href}\n data-active={props.active ? \"true\" : undefined}\n aria-current={props.active ? \"true\" : undefined}\n title={props.title}\n onClick={(event) => props.onClick?.(event)}\n >\n {content()}\n </a>\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,UAAU,EAAE,GAAG,EAAY,IAAI,QAAQ,UAAU;AAC1D,SAAS,aAAa,QAAQ,kBAAkB;AAEhD,OAAO,QAAQ,MAA6B,YAAY;AACxD,SAAS,iBAAiB,QAAQ,mBAAmB;AAoDrD;AACA,OAAO,SAAS,UAAU,CAAC,KAAsB,EAAe;EAC9D,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC;EAChC,MAAM,cAAc,GAAG,iBAAiB,CAAC,CAAC;EAC1C,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;EAC7D,MAAM,eAAe,GAAG,UAAU,CAAC,MACjC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAE,OAAO,IAAK,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAE,MAAM,IAAK,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAC3G,CAAC;EACD,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;EACzE,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM;IACtC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAA4B,CAAC;IACrD,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;MACnC,KAAK,MAAM,MAAM,IAAI,OAA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({
|
|
|
6
6
|
en: {
|
|
7
7
|
filterActions: "Filter actions",
|
|
8
8
|
filters: "Filters",
|
|
9
|
-
reset: "Reset"
|
|
9
|
+
reset: "Reset",
|
|
10
|
+
all: "All",
|
|
11
|
+
none: "None",
|
|
12
|
+
allOf: ({
|
|
13
|
+
label
|
|
14
|
+
}) => `Choose all of ${label}`,
|
|
15
|
+
noneOf: ({
|
|
16
|
+
label
|
|
17
|
+
}) => `Choose none of ${label}`,
|
|
18
|
+
only: "Only",
|
|
19
|
+
onlyOption: ({
|
|
20
|
+
label
|
|
21
|
+
}) => `Only ${label}`
|
|
10
22
|
},
|
|
11
23
|
de: {
|
|
12
24
|
filterActions: "Filteraktionen",
|
|
13
25
|
filters: "Filter",
|
|
14
|
-
reset: "Zurücksetzen"
|
|
26
|
+
reset: "Zurücksetzen",
|
|
27
|
+
all: "Alle",
|
|
28
|
+
none: "Keine",
|
|
29
|
+
allOf: ({
|
|
30
|
+
label
|
|
31
|
+
}) => `Alle aus ${label} wählen`,
|
|
32
|
+
noneOf: ({
|
|
33
|
+
label
|
|
34
|
+
}) => `Keine aus ${label} wählen`,
|
|
35
|
+
only: "Nur diese",
|
|
36
|
+
onlyOption: ({
|
|
37
|
+
label
|
|
38
|
+
}) => `Nur ${label}`
|
|
15
39
|
}
|
|
16
40
|
}
|
|
17
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["actions/filter-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst filterMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n filterActions: \"Filter actions\",\n filters: \"Filters\",\n reset: \"Reset\",\n },\n de: {\n filterActions: \"Filteraktionen\",\n filters: \"Filter\",\n reset: \"Zurücksetzen\",\n },\n },\n});\n\nexport type FilterMessages = ReturnType<(typeof filterMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useFilterMessages = (): (() => FilterMessages) => {\n const locale = useLocale();\n return () => filterMessages.resolve([locale()]).t;\n};\n\nexport const checkFilterMessages = () => filterMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;EACjC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,aAAa,EAAE,gBAAgB;MAC/B,OAAO,EAAE,SAAS;MAClB,KAAK,EAAE;
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/filter-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst filterMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n filterActions: \"Filter actions\",\n filters: \"Filters\",\n reset: \"Reset\",\n all: \"All\",\n none: \"None\",\n allOf: ({ label }: { label: string }) => `Choose all of ${label}`,\n noneOf: ({ label }: { label: string }) => `Choose none of ${label}`,\n only: \"Only\",\n onlyOption: ({ label }: { label: string }) => `Only ${label}`,\n },\n de: {\n filterActions: \"Filteraktionen\",\n filters: \"Filter\",\n reset: \"Zurücksetzen\",\n all: \"Alle\",\n none: \"Keine\",\n allOf: ({ label }) => `Alle aus ${label} wählen`,\n noneOf: ({ label }) => `Keine aus ${label} wählen`,\n only: \"Nur diese\",\n onlyOption: ({ label }) => `Nur ${label}`,\n },\n },\n});\n\nexport type FilterMessages = ReturnType<(typeof filterMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useFilterMessages = (): (() => FilterMessages) => {\n const locale = useLocale();\n return () => filterMessages.resolve([locale()]).t;\n};\n\nexport const checkFilterMessages = () => filterMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;EACjC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,aAAa,EAAE,gBAAgB;MAC/B,OAAO,EAAE,SAAS;MAClB,KAAK,EAAE,OAAO;MACd,GAAG,EAAE,KAAK;MACV,IAAI,EAAE,MAAM;MACZ,KAAK,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,iBAAiB,KAAK,EAAE;MACjE,MAAM,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,kBAAkB,KAAK,EAAE;MACnE,IAAI,EAAE,MAAM;MACZ,UAAU,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,QAAQ,KAAK;IAC7D,CAAC;IACD,EAAE,EAAE;MACF,aAAa,EAAE,gBAAgB;MAC/B,OAAO,EAAE,QAAQ;MACjB,KAAK,EAAE,cAAc;MACrB,GAAG,EAAE,MAAM;MACX,IAAI,EAAE,OAAO;MACb,KAAK,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,YAAY,KAAK,SAAS;MAChD,MAAM,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,aAAa,KAAK,SAAS;MAClD,IAAI,EAAE,WAAW;MACjB,UAAU,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,OAAO,KAAK;IACzC;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,iBAAiB,GAAG,MAA8B;EAC7D,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,OAAO,MAAM,mBAAmB,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Left and Right cycle through the segments of a row section
|
|
3
|
-
* the key moved focus.
|
|
2
|
+
* Left and Right cycle through the segments of a row section, or between a row and its secondary action; Up and Down
|
|
3
|
+
* leave it like any item. Returns whether the key moved focus.
|
|
4
4
|
*/
|
|
5
5
|
export const focusRowSegment = (items, key) => {
|
|
6
6
|
if (key !== "ArrowLeft" && key !== "ArrowRight") return false;
|
|
7
7
|
const active = document.activeElement;
|
|
8
|
-
const row = active?.closest(".k2b-dropdown__row");
|
|
8
|
+
const row = active?.closest(".k2b-dropdown__row, .k2b-dropdown__pair");
|
|
9
9
|
if (!active || !row) return false;
|
|
10
10
|
const segments = items.filter(item => row.contains(item));
|
|
11
11
|
const next = segments.indexOf(active) + (key === "ArrowRight" ? 1 : -1);
|
|
12
12
|
segments[(next + segments.length) % segments.length]?.focus();
|
|
13
13
|
return true;
|
|
14
14
|
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Moves Up, Down, Home, or End through the rows; a row's secondary action is no stop of its own there, so Down from
|
|
18
|
+
* it goes to the next row. Returns whether the key moved focus.
|
|
19
|
+
*/
|
|
20
|
+
export const focusMenuRow = (items, key) => {
|
|
21
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(key)) return false;
|
|
22
|
+
const rows = items.filter(item => !item.classList.contains("k2b-dropdown__secondary"));
|
|
23
|
+
if (rows.length === 0) return true;
|
|
24
|
+
if (key === "Home" || key === "End") {
|
|
25
|
+
rows[key === "Home" ? 0 : rows.length - 1]?.focus();
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
const active = document.activeElement;
|
|
29
|
+
const own = active?.classList.contains("k2b-dropdown__secondary") ? active.closest(".k2b-dropdown__pair")?.querySelector("[role^='menuitem']") : active;
|
|
30
|
+
const current = own ? rows.indexOf(own) : -1;
|
|
31
|
+
const next = current === -1 ? key === "ArrowDown" ? 0 : rows.length - 1 : current + (key === "ArrowDown" ? 1 : -1);
|
|
32
|
+
rows[(next + rows.length) % rows.length]?.focus();
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
15
35
|
//# sourceMappingURL=menu-rows.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["actions/menu-rows.ts"],"sourcesContent":["/**\n * Left and Right cycle through the segments of a row section; Up and Down leave it like any item. Returns whether
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/menu-rows.ts"],"sourcesContent":["/**\n * Left and Right cycle through the segments of a row section, or between a row and its secondary action; Up and Down\n * leave it like any item. Returns whether the key moved focus.\n */\nexport const focusRowSegment = (items: HTMLElement[], key: string): boolean => {\n if (key !== \"ArrowLeft\" && key !== \"ArrowRight\") return false;\n const active = document.activeElement as HTMLElement | null;\n const row = active?.closest(\".k2b-dropdown__row, .k2b-dropdown__pair\");\n if (!active || !row) return false;\n const segments = items.filter((item) => row.contains(item));\n const next = segments.indexOf(active) + (key === \"ArrowRight\" ? 1 : -1);\n segments[(next + segments.length) % segments.length]?.focus();\n return true;\n};\n\n/**\n * Moves Up, Down, Home, or End through the rows; a row's secondary action is no stop of its own there, so Down from\n * it goes to the next row. Returns whether the key moved focus.\n */\nexport const focusMenuRow = (items: HTMLElement[], key: string): boolean => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"].includes(key)) return false;\n const rows = items.filter((item) => !item.classList.contains(\"k2b-dropdown__secondary\"));\n if (rows.length === 0) return true;\n if (key === \"Home\" || key === \"End\") {\n rows[key === \"Home\" ? 0 : rows.length - 1]?.focus();\n return true;\n }\n const active = document.activeElement as HTMLElement | null;\n const own = active?.classList.contains(\"k2b-dropdown__secondary\")\n ? active.closest(\".k2b-dropdown__pair\")?.querySelector<HTMLElement>(\"[role^='menuitem']\")\n : active;\n const current = own ? rows.indexOf(own) : -1;\n const next = current === -1 ? (key === \"ArrowDown\" ? 0 : rows.length - 1) : current + (key === \"ArrowDown\" ? 1 : -1);\n rows[(next + rows.length) % rows.length]?.focus();\n return true;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,MAAM,eAAe,GAAG,CAAC,KAAoB,EAAE,GAAW,KAAc;EAC7E,IAAI,GAAG,KAAK,WAAW,IA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MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,yBAAyB,CAAC,GAC7D,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,aAAa,CAAc,oBAAoB,CAAC,GACvF,MAAM;EACV,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;EAC5C,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,CAAC,GAAI,GAAG,KAAK,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,GAAI,OAAO,IAAI,GAAG,KAAK,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;EACpH,IAAI,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;EACjD,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ import { onCleanup, onMount } from "solid-js";
|
|
|
7
7
|
import { dialogCore } from "../feedback/dialog-core";
|
|
8
8
|
import { LocaleProvider } from "../intl/locale";
|
|
9
9
|
import BottomSheet, { bottomSheetOptions } from "../layout/BottomSheet";
|
|
10
|
-
import { focusRowSegment } from "./menu-rows";
|
|
10
|
+
import { focusMenuRow, focusRowSegment } from "./menu-rows";
|
|
11
11
|
|
|
12
12
|
/** Phones, where a menu opens as a bottom sheet instead of beside its trigger. */
|
|
13
13
|
export const PHONE_SHEET_QUERY = "(max-width: 47.999rem)";
|
|
@@ -65,14 +65,9 @@ const menuItems = menu => Array.from(menu.querySelectorAll("[role^='menuitem']:n
|
|
|
65
65
|
*/
|
|
66
66
|
function SheetMenu(props) {
|
|
67
67
|
let menu;
|
|
68
|
-
const focus = index => {
|
|
69
|
-
const items = menuItems(menu);
|
|
70
|
-
items[(index + items.length) % items.length]?.focus();
|
|
71
|
-
};
|
|
72
68
|
const onKeyDown = event => {
|
|
73
69
|
const items = menuItems(menu);
|
|
74
|
-
|
|
75
|
-
if (event.key === "ArrowDown") focus(current + 1);else if (event.key === "ArrowUp") focus(current < 0 ? -1 : current - 1);else if (event.key === "Home" || event.key === "End") focus(event.key === "Home" ? 0 : -1);else if (!focusRowSegment(items, event.key)) return;
|
|
70
|
+
if (!focusMenuRow(items, event.key) && !focusRowSegment(items, event.key)) return;
|
|
76
71
|
event.preventDefault();
|
|
77
72
|
};
|
|
78
73
|
// Keys pressed on the sheet itself, while it is the top level of the shared dialog.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["actions/menu-sheet.tsx"],"sourcesContent":["import { type JSX, onCleanup, onMount } from \"solid-js\";\nimport { dialogCore } from \"../feedback/dialog-core\";\nimport { LocaleProvider } from \"../intl/locale\";\nimport BottomSheet, { bottomSheetOptions } from \"../layout/BottomSheet\";\nimport type { DropdownAction, DropdownChoice, DropdownItem } from \"./Dropdown\";\nimport { focusRowSegment } from \"./menu-rows\";\n\n/** Phones, where a menu opens as a bottom sheet instead of beside its trigger. */\nexport const PHONE_SHEET_QUERY = \"(max-width: 47.999rem)\";\n\nexport const prefersMenuSheet = (): boolean => typeof matchMedia === \"function\" && matchMedia(PHONE_SHEET_QUERY).matches;\n\ntype SheetEntry = DropdownAction | DropdownChoice;\ntype SheetItem = SheetEntry | { items: readonly SheetEntry[] };\n\n/**\n * Follows a link the way a click on it would, so a page's own link handling, such as progressive navigation, still\n * applies; it runs only after the sheet has left the history.\n */\nconst followLink = (href: string) => {\n const link = document.createElement(\"a\");\n link.href = href;\n link.hidden = true;\n document.body.append(link);\n link.click();\n link.remove();\n};\n\n/**\n * The sheet's items hand their action to `run` instead of running it while the sheet closes: `dialogCore` settles the\n * sheet after it left the history, and only then may an action navigate or open the next dialog.\n * A choice or action that keeps the menu open, or an `immediate` action, runs at once.\n */\nconst afterClose = <T extends DropdownItem>(items: readonly T[], run: (action: () => void) => void): T[] => {\n const entry = (item: SheetEntry): SheetEntry => {\n // A plain link would navigate while the sheet's history entry is still being removed, and that Back could\n // undo the navigation; a plain click instead follows it once the sheet is gone. Modified clicks and external\n // links keep the browser's own behavior.\n if (!item.action && \"href\" in item && item.href && !(\"external\" in item && item.external)) {\n const href = item.href;\n return { ...item, action: () => run(() => followLink(href)) } as SheetEntry;\n }\n const action = item.action;\n if (!action || (\"closeOnSelect\" in item && item.closeOnSelect === false) || (\"immediate\" in item && item.immediate)) return item;\n return { ...item, action: () => run(action) } as SheetEntry;\n };\n return items.map((item) => {\n const sheetItem = item as SheetItem;\n return (\"items\" in sheetItem ? { ...sheetItem, items: sheetItem.items.map(entry) } : entry(sheetItem)) as T;\n });\n};\n\nconst menuItems = (menu: HTMLElement): HTMLElement[] =>\n Array.from(menu.querySelectorAll<HTMLElement>(\"[role^='menuitem']:not([aria-disabled='true'])\"));\n\n/**\n * The menu inside the sheet: the same items, at touch size, with arrow keys for a connected keyboard. Focus starts on\n * the sheet itself, which shows no ring on a phone; the first arrow key moves it into the menu.\n */\nfunction SheetMenu(props: {\n Items: MenuSheetOptions[\"Items\"];\n items: readonly DropdownItem[];\n label: string;\n close: () => void;\n dialog: HTMLDialogElement;\n}): JSX.Element {\n let menu!: HTMLDivElement;\n const
|
|
1
|
+
{"version":3,"names":[],"sources":["actions/menu-sheet.tsx"],"sourcesContent":["import { type JSX, onCleanup, onMount } from \"solid-js\";\nimport { dialogCore } from \"../feedback/dialog-core\";\nimport { LocaleProvider } from \"../intl/locale\";\nimport BottomSheet, { bottomSheetOptions } from \"../layout/BottomSheet\";\nimport type { DropdownAction, DropdownChoice, DropdownItem } from \"./Dropdown\";\nimport { focusMenuRow, focusRowSegment } from \"./menu-rows\";\n\n/** Phones, where a menu opens as a bottom sheet instead of beside its trigger. */\nexport const PHONE_SHEET_QUERY = \"(max-width: 47.999rem)\";\n\nexport const prefersMenuSheet = (): boolean => typeof matchMedia === \"function\" && matchMedia(PHONE_SHEET_QUERY).matches;\n\ntype SheetEntry = DropdownAction | DropdownChoice;\ntype SheetItem = SheetEntry | { items: readonly SheetEntry[] };\n\n/**\n * Follows a link the way a click on it would, so a page's own link handling, such as progressive navigation, still\n * applies; it runs only after the sheet has left the history.\n */\nconst followLink = (href: string) => {\n const link = document.createElement(\"a\");\n link.href = href;\n link.hidden = true;\n document.body.append(link);\n link.click();\n link.remove();\n};\n\n/**\n * The sheet's items hand their action to `run` instead of running it while the sheet closes: `dialogCore` settles the\n * sheet after it left the history, and only then may an action navigate or open the next dialog.\n * A choice or action that keeps the menu open, or an `immediate` action, runs at once.\n */\nconst afterClose = <T extends DropdownItem>(items: readonly T[], run: (action: () => void) => void): T[] => {\n const entry = (item: SheetEntry): SheetEntry => {\n // A plain link would navigate while the sheet's history entry is still being removed, and that Back could\n // undo the navigation; a plain click instead follows it once the sheet is gone. Modified clicks and external\n // links keep the browser's own behavior.\n if (!item.action && \"href\" in item && item.href && !(\"external\" in item && item.external)) {\n const href = item.href;\n return { ...item, action: () => run(() => followLink(href)) } as SheetEntry;\n }\n const action = item.action;\n if (!action || (\"closeOnSelect\" in item && item.closeOnSelect === false) || (\"immediate\" in item && item.immediate)) return item;\n return { ...item, action: () => run(action) } as SheetEntry;\n };\n return items.map((item) => {\n const sheetItem = item as SheetItem;\n return (\"items\" in sheetItem ? { ...sheetItem, items: sheetItem.items.map(entry) } : entry(sheetItem)) as T;\n });\n};\n\nconst menuItems = (menu: HTMLElement): HTMLElement[] =>\n Array.from(menu.querySelectorAll<HTMLElement>(\"[role^='menuitem']:not([aria-disabled='true'])\"));\n\n/**\n * The menu inside the sheet: the same items, at touch size, with arrow keys for a connected keyboard. Focus starts on\n * the sheet itself, which shows no ring on a phone; the first arrow key moves it into the menu.\n */\nfunction SheetMenu(props: {\n Items: MenuSheetOptions[\"Items\"];\n items: readonly DropdownItem[];\n label: string;\n close: () => void;\n dialog: HTMLDialogElement;\n}): JSX.Element {\n let menu!: HTMLDivElement;\n const onKeyDown = (event: KeyboardEvent) => {\n const items = menuItems(menu);\n if (!focusMenuRow(items, event.key) && !focusRowSegment(items, event.key)) return;\n event.preventDefault();\n };\n // Keys pressed on the sheet itself, while it is the top level of the shared dialog.\n const onSheetKeyDown = (event: KeyboardEvent) => {\n if (event.target === props.dialog && props.dialog.lastElementChild?.contains(menu)) onKeyDown(event);\n };\n onMount(() => {\n props.dialog.addEventListener(\"keydown\", onSheetKeyDown);\n onCleanup(() => props.dialog.removeEventListener(\"keydown\", onSheetKeyDown));\n });\n return (\n <div ref={menu} class=\"k2b-gesture-menu__sheet-menu\" role=\"menu\" aria-label={props.label} onKeyDown={onKeyDown}>\n <props.Items items={props.items} close={() => props.close()} />\n </div>\n );\n}\n\nexport type MenuSheetOptions = {\n /** Renders the rows: the dropdown's own `DropdownItems`, passed in so this module does not import it back. */\n Items: (props: { items: readonly DropdownItem[]; close: (restoreFocus?: boolean) => void }) => JSX.Element;\n items: readonly DropdownItem[];\n /** Names the sheet and its menu. */\n label: string;\n /** The render locale of the opener; the sheet renders outside its tree. */\n locale: string;\n /** Shown above the menu, for example a row of quick reactions. `close` closes the sheet. */\n top?: (close: () => void) => JSX.Element;\n signal?: AbortSignal;\n};\n\n/** Opens menu items as a bottom sheet; resolves after the sheet closed and the chosen action ran. */\nexport const openMenuSheet = (options: MenuSheetOptions): Promise<void> => {\n let chosen: (() => void) | undefined;\n const choose = (action: () => void) => {\n chosen = action;\n };\n return dialogCore\n .open<void>(\n (close, context) => (\n <LocaleProvider locale={options.locale}>\n <BottomSheet onDismiss={context.requestDismiss}>\n <BottomSheet.Body>\n {options.top?.(() => close())}\n <SheetMenu\n Items={options.Items}\n items={afterClose(options.items, choose)}\n label={options.label}\n close={() => close()}\n dialog={context.dialog}\n />\n </BottomSheet.Body>\n </BottomSheet>\n </LocaleProvider>\n ),\n { ...bottomSheetOptions, ariaLabel: options.label, history: true, signal: options.signal },\n )\n .then(() => chosen?.());\n};\n"],"mappings":";;;;;AAAA,SAAmB,SAAS,EAAE,OAAO,QAAQ,UAAU;AACvD,SAAS,UAAU,QAAQ,yBAAyB;AACp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