@spartan-native/helm 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +90 -0
- package/LICENSE +21 -0
- package/README.md +102 -2
- package/fesm2022/spartan-native-helm.mjs +691 -0
- package/fesm2022/spartan-native-helm.mjs.map +1 -0
- package/package.json +53 -3
- package/styles/_dialog-buttons.scss +50 -0
- package/styles/_selectable.scss +101 -0
- package/styles/spartan-native-helm.scss +14 -0
- package/types/spartan-native-helm.d.ts +234 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spartan-native-helm.mjs","names":[],"sources":["../../../packages/helm/src/lib/selection/selection-model.ts","../../../packages/helm/src/lib/selection/selectable.ts","../../../packages/helm/src/lib/actions/dialog-actions.ts"],"sourcesContent":["/**\n * The desktop selection model, as pure functions.\n *\n * It follows how Explorer, Finder and Nautilus behave:\n * - click selects one item and sets the anchor\n * - Ctrl-click (⌘-click on macOS) toggles one item and moves the anchor\n * - Shift-click selects the range from the anchor; with Ctrl/⌘ it adds the range\n * - arrows / Home / End move the active item and select it; with Shift they extend\n * the range from the anchor; with Ctrl they move the focus without selecting\n * - Ctrl/⌘+A selects all, Esc clears\n *\n * No Angular and no DOM here: the directives in selectable.ts feed events in.\n */\n\n/** How many items Page Up and Page Down move the active item by. */\nexport const SELECTION_PAGE_SIZE = 10;\n\n/** How long type-ahead keeps adding typed characters to one search before it starts over, in ms. */\nexport const TYPEAHEAD_RESET_MS = 600;\n\nexport interface SelectionState<K> {\n /** Selected keys, always in item order. */\n readonly selected: readonly K[];\n /** Where a Shift range starts. */\n readonly anchor: K | null;\n /** The keyboard cursor (focused row). */\n readonly active: K | null;\n}\n\nexport interface SelectionModifiers {\n /** Shift is held. */\n readonly range?: boolean;\n /** Ctrl (Windows, Linux) or ⌘ (macOS) is held. */\n readonly toggle?: boolean;\n}\n\nexport const EMPTY_SELECTION: SelectionState<never> = { selected: [], anchor: null, active: null };\n\n/** Keep only keys that still exist, in item order. */\nfunction ordered<K>(keys: readonly K[], selected: Iterable<K>): K[] {\n const set = new Set(selected);\n return keys.filter((k) => set.has(k));\n}\n\nfunction range<K>(keys: readonly K[], from: K | null, to: K): K[] {\n const a = from === null ? -1 : keys.indexOf(from);\n const b = keys.indexOf(to);\n if (a < 0) return [to];\n return keys.slice(Math.min(a, b), Math.max(a, b) + 1);\n}\n\n/** The state after a pointer click on `key`. */\nexport function selectionClick<K>(\n state: SelectionState<K>,\n keys: readonly K[],\n key: K,\n mods: SelectionModifiers = {},\n multiple = true,\n): SelectionState<K> {\n if (!keys.includes(key)) return state;\n if (!multiple) return { selected: [key], anchor: key, active: key };\n\n if (mods.range) {\n const span = range(keys, state.anchor, key);\n const selected = mods.toggle ? ordered(keys, [...state.selected, ...span]) : span;\n return { selected, anchor: state.anchor ?? key, active: key };\n }\n if (mods.toggle) {\n const isOn = state.selected.includes(key);\n const selected = isOn ? state.selected.filter((k) => k !== key) : ordered(keys, [...state.selected, key]);\n return { selected, anchor: key, active: key };\n }\n return { selected: [key], anchor: key, active: key };\n}\n\n/** The state after the keyboard moves the active item to `index` (clamped). */\nexport function selectionMoveTo<K>(\n state: SelectionState<K>,\n keys: readonly K[],\n index: number,\n mods: SelectionModifiers = {},\n multiple = true,\n): SelectionState<K> {\n if (keys.length === 0) return state;\n const target = keys[Math.max(0, Math.min(keys.length - 1, index))];\n\n if (!multiple) return { selected: [target], anchor: target, active: target };\n if (mods.range) {\n const span = range(keys, state.anchor ?? state.active, target);\n const selected = mods.toggle ? ordered(keys, [...state.selected, ...span]) : span;\n return { selected, anchor: state.anchor ?? state.active ?? target, active: target };\n }\n // Ctrl + arrow: move the focus only\n if (mods.toggle) return { ...state, active: target };\n return { selected: [target], anchor: target, active: target };\n}\n\n/** Move the active item by `delta` rows. With nothing active, Down starts at the top and Up at the bottom. */\nexport function selectionMoveBy<K>(\n state: SelectionState<K>,\n keys: readonly K[],\n delta: number,\n mods: SelectionModifiers = {},\n multiple = true,\n): SelectionState<K> {\n const current = state.active === null ? -1 : keys.indexOf(state.active);\n const start = current < 0 ? (delta > 0 ? -1 : keys.length) : current;\n return selectionMoveTo(state, keys, start + delta, mods, multiple);\n}\n\n/** Space: select the active item, or toggle it with Ctrl/⌘. */\nexport function selectionToggleActive<K>(\n state: SelectionState<K>,\n keys: readonly K[],\n mods: SelectionModifiers = {},\n multiple = true,\n): SelectionState<K> {\n if (state.active === null) return state;\n return selectionClick(state, keys, state.active, { toggle: mods.toggle }, multiple);\n}\n\nexport function selectionAll<K>(state: SelectionState<K>, keys: readonly K[], multiple = true): SelectionState<K> {\n if (!multiple) return state;\n return { selected: [...keys], anchor: keys[0] ?? null, active: state.active ?? keys[0] ?? null };\n}\n\nexport function selectionClear<K>(state: SelectionState<K>): SelectionState<K> {\n return { ...state, selected: [] };\n}\n\n/** Drop keys that no longer exist (items removed), keeping order. */\nexport function selectionSync<K>(state: SelectionState<K>, keys: readonly K[]): SelectionState<K> {\n const has = (k: K | null) => k !== null && keys.includes(k);\n return {\n selected: ordered(keys, state.selected),\n anchor: has(state.anchor) ? state.anchor : null,\n active: has(state.active) ? state.active : null,\n };\n}\n\n/**\n * Type-ahead: the index of the next item whose label starts with `query`.\n * A repeated single letter cycles through matches, like Explorer and Finder.\n */\nexport function typeaheadIndex(labels: readonly string[], query: string, fromIndex: number): number {\n if (!query || labels.length === 0) return -1;\n const q = query.toLocaleLowerCase();\n const cycling = [...q].every((c) => c === q[0]);\n const needle = cycling ? q[0] : q;\n const start = cycling ? fromIndex + 1 : Math.max(0, fromIndex);\n for (let i = 0; i < labels.length; i++) {\n const idx = (start + i) % labels.length;\n if (labels[idx].toLocaleLowerCase().startsWith(needle)) return idx;\n }\n return -1;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n forwardRef,\n inject,\n InjectionToken,\n input,\n model,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { injectSkin } from '@spartan-native/theme';\nimport {\n selectionAll,\n selectionClear,\n selectionClick,\n selectionMoveBy,\n selectionMoveTo,\n selectionSync,\n selectionToggleActive,\n type SelectionModifiers,\n type SelectionState,\n typeaheadIndex,\n SELECTION_PAGE_SIZE,\n TYPEAHEAD_RESET_MS,\n} from './selection-model';\n\n/** listbox: a list of options · grid: table rows */\nexport type SelectableRole = 'listbox' | 'grid';\n\nlet nextId = 0;\n\ninterface SelectableParent<K> {\n readonly role: () => SelectableRole;\n isSelected(key: K): boolean;\n isActive(key: K): boolean;\n click(key: K, event: MouseEvent): void;\n activate(key: K): void;\n}\n\nconst SN_SELECTABLE = new InjectionToken<SelectableParent<unknown>>('SN_SELECTABLE');\n\n/**\n * One selectable row: an option in a list, or a `<tr>` in a table.\n *\n * ```html\n * <div snSelectableItem [value]=\"file.id\">{{ file.name }}</div>\n * ```\n */\n@Directive({\n selector: '[snSelectableItem]',\n exportAs: 'snSelectableItem',\n host: {\n 'data-slot': 'sn-selectable-item',\n '[id]': 'id',\n '[attr.role]': \"parent.role() === 'grid' ? 'row' : 'option'\",\n '[attr.aria-selected]': 'selected()',\n '[attr.data-selected]': \"selected() ? '' : null\",\n '[attr.data-active]': \"active() ? '' : null\",\n '(mousedown)': 'onMouseDown($event)',\n '(click)': 'parent.click(value(), $event)',\n '(dblclick)': 'parent.activate(value())',\n },\n})\nexport class SnSelectableItem<K = unknown> {\n protected readonly parent = inject(SN_SELECTABLE) as SelectableParent<K>;\n readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * The key this row stands for (required in practice). Declared optional because the\n * list reads its rows while Angular is still binding them.\n */\n readonly value = input<K>(undefined as K);\n /** Text used for type-ahead; defaults to the row's text. */\n // eslint-disable-next-line @angular-eslint/no-input-rename -- `label` alone would clash with other directives on the row\n readonly label = input<string | undefined>(undefined, { alias: 'snSelectableLabel' });\n\n readonly id = `sn-selectable-item-${nextId++}`;\n readonly selected = computed(() => this.parent.isSelected(this.value()));\n readonly active = computed(() => this.parent.isActive(this.value()));\n\n typeaheadLabel(): string {\n return (this.label() ?? this.element.textContent ?? '').trim();\n }\n\n protected onMouseDown(event: MouseEvent): void {\n // Shift-click must extend the selection, not select text\n if (event.shiftKey) event.preventDefault();\n }\n}\n\n/**\n * A list or table with the desktop selection model.\n *\n * ```html\n * <div snSelectable [(selection)]=\"selected\" (activated)=\"open($event)\">\n * @for (f of files; track f.id) {\n * <div snSelectableItem [value]=\"f.id\">{{ f.name }}</div>\n * }\n * </div>\n *\n * <table hlmTable snSelectable=\"grid\" [(selection)]=\"selected\">…<tr hlmTr snSelectableItem [value]=\"row.id\">…</table>\n * ```\n *\n * Mouse: click, Ctrl/⌘-click, Shift-click, double-click to activate.\n * Keyboard: ↑ ↓ Home End PageUp PageDown (Shift extends, Ctrl moves focus only),\n * Space (Ctrl+Space toggles), Ctrl/⌘+A, Esc clears, Enter activates, type-ahead.\n * On macOS ⌘ replaces Ctrl, and ⌘↑ / ⌘↓ jump to the first / last row.\n */\n@Directive({\n selector: '[snSelectable]',\n exportAs: 'snSelectable',\n providers: [{ provide: SN_SELECTABLE, useExisting: forwardRef(() => SnSelectable) }],\n host: {\n 'data-slot': 'sn-selectable',\n tabindex: '0',\n '[attr.role]': 'role()',\n '[attr.aria-multiselectable]': 'multiple()',\n '[attr.aria-activedescendant]': 'activeId()',\n '(keydown)': 'onKeydown($event)',\n '(focus)': 'onFocus()',\n },\n})\nexport class SnSelectable<K = unknown> implements SelectableParent<K> {\n private readonly doc = inject(DOCUMENT);\n private readonly skin = injectSkin();\n\n /** `snSelectable` or `snSelectable=\"listbox\"` for lists, `snSelectable=\"grid\"` for tables. */\n readonly role = input<SelectableRole, SelectableRole | ''>('listbox', {\n alias: 'snSelectable',\n transform: (v) => (v === 'grid' ? 'grid' : 'listbox'),\n });\n /** Allow more than one selected row. */\n readonly multiple = input(true);\n /** The selected keys, in row order. Two-way bindable. */\n readonly selection = model<readonly K[]>([]);\n /** Enter or double-click on a row. */\n readonly activated = output<K>();\n\n private readonly items = contentChildren<SnSelectableItem<K>>(SnSelectableItem, { descendants: true });\n private readonly keys = computed(() => this.items().map((i) => i.value()));\n private readonly cursor = signal<Omit<SelectionState<K>, 'selected'>>({ anchor: null, active: null });\n private readonly selectedSet = computed(() => new Set(this.selection()));\n\n protected readonly activeId = computed(() => {\n const active = this.cursor().active;\n return this.items().find((i) => i.value() === active)?.id ?? null;\n });\n\n private typeahead = '';\n private typeaheadTimer: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n // Rows removed: drop them from the selection and the cursor.\n // Not while a row's value isn't bound yet: on first render the rows exist before their `value`\n // inputs are set (keys read [null, null, …]), and syncing then would wipe an initial selection\n // such as `[selection]=\"['f1']\"`.\n effect(() => {\n const keys = this.keys();\n if (keys.some((k) => k == null)) return;\n untracked(() => {\n const synced = selectionSync(this.state(), keys);\n if (synced.selected.length !== this.selection().length) this.selection.set(synced.selected);\n this.cursor.set({ anchor: synced.anchor, active: synced.active });\n });\n });\n // Keep the active row in view\n effect(() => {\n const id = this.activeId();\n if (id) untracked(() => this.doc.getElementById(id)?.scrollIntoView?.({ block: 'nearest' }));\n });\n }\n\n // --- SelectableParent ------------------------------------------------------\n isSelected(key: K): boolean {\n return this.selectedSet().has(key);\n }\n\n isActive(key: K): boolean {\n return this.cursor().active === key;\n }\n\n click(key: K, event: MouseEvent): void {\n this.apply(selectionClick(this.state(), this.keys(), key, this.modifiers(event), this.multiple()));\n }\n\n activate(key: K): void {\n this.activated.emit(key);\n }\n\n // --- Keyboard --------------------------------------------------------------\n protected onFocus(): void {\n if (this.cursor().active === null) {\n const first = this.selection()[0] ?? this.keys()[0] ?? null;\n this.cursor.update((c) => ({ ...c, active: first }));\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n // Keys typed into an input, textarea, select or contenteditable inside a row belong to that field\n if (isEditable(event.target, event.currentTarget)) return;\n const keys = this.keys();\n const mods = this.modifiers(event);\n const multiple = this.multiple();\n const state = this.state();\n const mac = this.isMac();\n let next: SelectionState<K> | null;\n\n switch (event.key) {\n case 'ArrowDown':\n next =\n mac && event.metaKey\n ? selectionMoveTo(state, keys, keys.length - 1, { range: mods.range }, multiple)\n : selectionMoveBy(state, keys, 1, mods, multiple);\n break;\n case 'ArrowUp':\n next =\n mac && event.metaKey\n ? selectionMoveTo(state, keys, 0, { range: mods.range }, multiple)\n : selectionMoveBy(state, keys, -1, mods, multiple);\n break;\n case 'Home':\n next = selectionMoveTo(state, keys, 0, mods, multiple);\n break;\n case 'End':\n next = selectionMoveTo(state, keys, keys.length - 1, mods, multiple);\n break;\n case 'PageDown':\n next = selectionMoveBy(state, keys, SELECTION_PAGE_SIZE, mods, multiple);\n break;\n case 'PageUp':\n next = selectionMoveBy(state, keys, -SELECTION_PAGE_SIZE, mods, multiple);\n break;\n case ' ':\n if (this.typeahead) return this.onTypeahead(event); // a space inside a type-ahead word\n next = selectionToggleActive(state, keys, mods, multiple);\n break;\n case 'Enter':\n if (state.active !== null) {\n event.preventDefault();\n this.activated.emit(state.active);\n }\n return;\n case 'Escape':\n if (state.selected.length === 0) return; // let dialogs handle it\n next = selectionClear(state);\n break;\n default:\n if (mods.toggle && event.key.toLowerCase() === 'a') {\n next = selectionAll(state, keys, multiple);\n break;\n }\n return this.onTypeahead(event);\n }\n event.preventDefault();\n this.apply(next);\n }\n\n private onTypeahead(event: KeyboardEvent): void {\n if (event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey) return;\n event.preventDefault();\n clearTimeout(this.typeaheadTimer);\n this.typeahead += event.key;\n this.typeaheadTimer = setTimeout(() => (this.typeahead = ''), TYPEAHEAD_RESET_MS);\n\n const items = this.items();\n const current = items.findIndex((i) => i.value() === this.cursor().active);\n const index = typeaheadIndex(\n items.map((i) => i.typeaheadLabel()),\n this.typeahead,\n current,\n );\n if (index >= 0) this.apply(selectionMoveTo(this.state(), this.keys(), index, {}, this.multiple()));\n }\n\n // --- Helpers ---------------------------------------------------------------\n private state(): SelectionState<K> {\n return { selected: this.selection(), ...this.cursor() };\n }\n\n private apply(next: SelectionState<K>): void {\n this.cursor.set({ anchor: next.anchor, active: next.active });\n const prev = this.selection();\n if (prev.length !== next.selected.length || prev.some((k, i) => k !== next.selected[i])) {\n this.selection.set(next.selected);\n }\n }\n\n /** ⌘ toggles on macOS, Ctrl everywhere else (Ctrl-click is the context menu on macOS). */\n private modifiers(event: MouseEvent | KeyboardEvent): SelectionModifiers {\n return { range: event.shiftKey, toggle: this.isMac() ? event.metaKey : event.ctrlKey };\n }\n\n private isMac(): boolean {\n const skin = this.skin();\n return skin === 'mac' || skin === 'macc';\n }\n}\n\n/** True when `target` is an input, textarea, select or contenteditable other than the list itself. */\nfunction isEditable(target: EventTarget | null, host: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement) || target === host) return false;\n return (\n target.isContentEditable ||\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement\n );\n}\n\nexport const SnSelectableImports = [SnSelectable, SnSelectableItem] as const;\n","import { DestroyRef, Directive, ElementRef, afterNextRender, inject } from '@angular/core';\n\n/** Where Enter / Esc are listened for: the closest dialog, form, or [snActionScope]. */\nconst SCOPE = '[snActionScope], [role=\"dialog\"], [role=\"alertdialog\"], form';\n\n/** Elements that use Enter themselves, so it must not trigger the default button there. */\nconst OWNS_ENTER =\n 'textarea, button, a[href], select, [contenteditable=\"\"], [contenteditable=\"true\"], [role=\"listbox\"], [role=\"grid\"], [role=\"menu\"], [role=\"tree\"]';\n\n/**\n * Marks a custom area for snDefaultAction / snCancelAction (dialogs and forms are scopes already).\n *\n * ```html\n * <section snActionScope>…</section>\n * ```\n */\n@Directive({ selector: '[snActionScope]', host: { 'data-slot': 'sn-action-scope' } })\nexport class SnActionScope {}\n\nfunction listenInScope(key: string, onKey: (event: KeyboardEvent) => void): void {\n const element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const scope: HTMLElement | Document = element.closest<HTMLElement>(SCOPE) ?? element.ownerDocument;\n const listener = (event: Event) => {\n const e = event as KeyboardEvent;\n if (e.key !== key || e.defaultPrevented || e.isComposing) return;\n onKey(e);\n };\n scope.addEventListener('keydown', listener);\n destroyRef.onDestroy(() => scope.removeEventListener('keydown', listener));\n });\n}\n\n/**\n * The default button: Enter anywhere in its dialog or form presses it,\n * the way every desktop OS behaves. Fields that use Enter themselves\n * (multi-line text, other buttons, lists) keep it.\n *\n * ```html\n * <button hlmBtn snDefaultAction (click)=\"save()\">Save</button>\n * ```\n */\n@Directive({ selector: 'button[snDefaultAction]', host: { 'data-sn-default-action': '' } })\nexport class SnDefaultAction {\n private readonly button = inject<ElementRef<HTMLButtonElement>>(ElementRef).nativeElement;\n\n constructor() {\n listenInScope('Enter', (event) => {\n const target = event.target as HTMLElement | null;\n if (this.button.disabled || target?.closest(OWNS_ENTER)) return;\n event.preventDefault();\n this.button.click();\n });\n }\n}\n\n/**\n * The cancel button: Esc anywhere in its dialog or form presses it.\n *\n * ```html\n * <button hlmBtn variant=\"outline\" snCancelAction (click)=\"close()\">Cancel</button>\n * ```\n */\n@Directive({ selector: 'button[snCancelAction]', host: { 'data-sn-cancel-action': '' } })\nexport class SnCancelAction {\n private readonly button = inject<ElementRef<HTMLButtonElement>>(ElementRef).nativeElement;\n\n constructor() {\n listenInScope('Escape', (event) => {\n if (this.button.disabled) return;\n event.preventDefault();\n this.button.click();\n });\n }\n}\n\n/**\n * A row of dialog buttons, put in the order of the current OS: the\n * snDefaultAction, the snCancelAction and every other button. Write them in any order;\n * the skin decides where each goes. spartan's hlm-dialog-footer and hlm-alert-dialog-footer\n * get the same treatment without this directive. It sets an attribute, not `data-slot`, so it\n * can sit on another component's host (`<div hlmCardFooter snDialogButtons>`).\n *\n * | Skin | Order |\n * | --- | --- |\n * | Windows, KDE | default · other · cancel |\n * | macOS | other ‹gap› cancel · default |\n * | GNOME | cancel · other · default |\n * | ChromeOS, web | other · cancel · default |\n *\n * ```html\n * <div snDialogButtons>\n * <button hlmBtn snDefaultAction>Save</button>\n * <button hlmBtn variant=\"outline\">Don't save</button>\n * <button hlmBtn variant=\"outline\" snCancelAction>Cancel</button>\n * </div>\n * ```\n */\n@Directive({ selector: '[snDialogButtons]', host: { 'data-sn-dialog-buttons': '' } })\nexport class SnDialogButtons {}\n\nexport const SnDialogActionsImports = [SnActionScope, SnDefaultAction, SnCancelAction, SnDialogButtons] as const;\n"],"mappings":";;;;AAeA,MAAa,sBAAsB;AAGnC,MAAa,qBAAqB;AAkBlC,MAAa,kBAAyC;CAAE,UAAU,CAAA;CAAI,QAAQ;CAAM,QAAQ;AAAI;AAGhG,SAAS,QAAW,MAAoB,UAAqB;CAC3D,MAAM,MAAM,IAAI,IAAI,QAAQ;CAC5B,OAAO,KAAK,QAAQ,MAAM,IAAI,IAAI,CAAC,CAAC;AACtC;AAEA,SAAS,MAAS,MAAoB,MAAgB,IAAK;CACzD,MAAM,IAAI,SAAS,OAAO,KAAK,KAAK,QAAQ,IAAI;CAChD,MAAM,IAAI,KAAK,QAAQ,EAAE;CACzB,IAAI,IAAI,GAAG,OAAO,CAAC,EAAE;CACrB,OAAO,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC;AACtD;AAGA,SAAgB,eACd,OACA,MACA,KACA,OAA2B,CAAA,GAC3B,WAAW,MAAI;CAEf,IAAI,CAAC,KAAK,SAAS,GAAG,GAAG,OAAO;CAChC,IAAI,CAAC,UAAU,OAAO;EAAE,UAAU,CAAC,GAAG;EAAG,QAAQ;EAAK,QAAQ;CAAG;CAEjE,IAAI,KAAK,OAAO;EACd,MAAM,OAAO,MAAM,MAAM,MAAM,QAAQ,GAAG;EAE1C,OAAO;GAAE,UADQ,KAAK,SAAS,QAAQ,MAAM,CAAC,GAAG,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI;GAC1D,QAAQ,MAAM,UAAU;GAAK,QAAQ;EA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A,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAD3B,MAAA;EAAU,MAAA,CAAA;GAAE,UAAU;GAAqB,MAAM,EAAE,0BAA0B,GAAE;EAAE,CAAE;;;AAGpF,MAAa,yBAAyB;CAAC;CAAe;CAAiB;CAAgB;AAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spartan-native/helm",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Desktop behaviors for spartan/ui: the desktop selection model for lists and tables, default (Enter) / cancel (Esc) buttons, and dialog buttons in each OS's order.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Roland Molnár",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Spartan-Native/spartan-native.git",
|
|
10
|
+
"directory": "packages/helm"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/Spartan-Native/spartan-native/tree/main/packages/helm#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Spartan-Native/spartan-native/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"angular",
|
|
18
|
+
"spartan-ng",
|
|
19
|
+
"native",
|
|
20
|
+
"desktop",
|
|
21
|
+
"theme"
|
|
22
|
+
],
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@angular/common": "^22.2.0",
|
|
25
|
+
"@angular/core": "^22.2.0",
|
|
26
|
+
"@spartan-ng/brain": "^1.9.0",
|
|
27
|
+
"@angular/cdk": "^22.2.0",
|
|
28
|
+
"@angular/forms": "^22.2.0",
|
|
29
|
+
"@spartan-native/theme": "0.2.1"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"tslib": "^2.3.0"
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": [
|
|
35
|
+
"*.scss"
|
|
36
|
+
],
|
|
37
|
+
"exports": {
|
|
38
|
+
"./styles/*": {
|
|
39
|
+
"sass": "./styles/*.scss",
|
|
40
|
+
"default": "./styles/*"
|
|
41
|
+
},
|
|
42
|
+
"./package.json": {
|
|
43
|
+
"default": "./package.json"
|
|
44
|
+
},
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./types/spartan-native-helm.d.ts",
|
|
47
|
+
"default": "./fesm2022/spartan-native-helm.mjs"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"module": "fesm2022/spartan-native-helm.mjs",
|
|
54
|
+
"typings": "types/spartan-native-helm.d.ts",
|
|
55
|
+
"type": "module"
|
|
6
56
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// snDialogButtons, hlm-dialog-footer, hlm-alert-dialog-footer: button order per OS
|
|
3
|
+
//
|
|
4
|
+
// Hooks: [data-sn-dialog-buttons], [data-slot="dialog-footer"],
|
|
5
|
+
// [data-slot="alert-dialog-footer"]
|
|
6
|
+
// > [data-sn-default-action] Enter (snDefaultAction)
|
|
7
|
+
// > [data-sn-cancel-action] Esc (snCancelAction)
|
|
8
|
+
// > anything else "other" (e.g. Don't save)
|
|
9
|
+
//
|
|
10
|
+
// Tokens (set per skin by the theme):
|
|
11
|
+
// --sn-dialog-order-default / -cancel / -other flex `order` of each kind
|
|
12
|
+
// --sn-dialog-other-push margin after the last other button
|
|
13
|
+
// (`auto` on macOS: it moves to the far left)
|
|
14
|
+
//
|
|
15
|
+
// A row without a default or cancel button keeps its source order.
|
|
16
|
+
// ============================================================================
|
|
17
|
+
|
|
18
|
+
$row: ':is([data-sn-dialog-buttons], [data-slot="dialog-footer"], [data-slot="alert-dialog-footer"])';
|
|
19
|
+
$default: '[data-sn-default-action]';
|
|
20
|
+
$cancel: '[data-sn-cancel-action]';
|
|
21
|
+
$other: ':not(#{$default}, #{$cancel})';
|
|
22
|
+
|
|
23
|
+
@layer spartan-native.helm {
|
|
24
|
+
[data-sn-dialog-buttons] {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--sn-dialog-buttons-gap, 8px);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#{$row}:has(> :is(#{$default}, #{$cancel})) {
|
|
33
|
+
> #{$default} {
|
|
34
|
+
order: var(--sn-dialog-order-default, 3);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
> #{$cancel} {
|
|
38
|
+
order: var(--sn-dialog-order-cancel, 2);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
> #{$other} {
|
|
42
|
+
order: var(--sn-dialog-order-other, 1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// The last "other" button (in source order) holds the gap
|
|
46
|
+
> #{$other}:not(:has(~ #{$other})) {
|
|
47
|
+
margin-inline-end: var(--sn-dialog-other-push, 0);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// snSelectable / snSelectableItem: lists and tables with the desktop selection model
|
|
3
|
+
//
|
|
4
|
+
// Hooks: [data-slot="sn-selectable"] the list or table (focusable)
|
|
5
|
+
// [data-slot="sn-selectable-item"] a row; [data-selected], [data-active]
|
|
6
|
+
//
|
|
7
|
+
// Tokens (set per skin by the theme):
|
|
8
|
+
// --sn-row-height, --sn-list-item-radius
|
|
9
|
+
// --sn-row-selected-bg / -fg selection while the list has focus
|
|
10
|
+
// --sn-row-selected-bg-unfocused / -fg selection when it doesn't (grey on macOS)
|
|
11
|
+
// --sn-row-selected-indicator the Windows 11 accent pill
|
|
12
|
+
// --sn-row-focus-ring the keyboard cursor
|
|
13
|
+
// ============================================================================
|
|
14
|
+
|
|
15
|
+
$list: '[data-slot="sn-selectable"]';
|
|
16
|
+
$item: '[data-slot="sn-selectable-item"]';
|
|
17
|
+
|
|
18
|
+
@layer spartan-native.helm {
|
|
19
|
+
#{$list} {
|
|
20
|
+
outline: none;
|
|
21
|
+
cursor: default;
|
|
22
|
+
-webkit-user-select: none;
|
|
23
|
+
user-select: none;
|
|
24
|
+
|
|
25
|
+
// Focused by keyboard with no row yet: ring the whole list
|
|
26
|
+
&:focus-visible:not(:has([data-active])) {
|
|
27
|
+
outline: var(--sn-row-focus-ring);
|
|
28
|
+
outline-offset: 2px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// --- List rows (role="option") ---------------------------------------------
|
|
33
|
+
#{$list}[role='listbox'] #{$item} {
|
|
34
|
+
position: relative;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 0.6em;
|
|
38
|
+
min-height: var(--sn-row-height);
|
|
39
|
+
padding-inline: 0.75em;
|
|
40
|
+
border-radius: var(--sn-list-item-radius);
|
|
41
|
+
color: var(--sn-color-fg);
|
|
42
|
+
|
|
43
|
+
&:hover:not([data-selected]) {
|
|
44
|
+
background: color-mix(in srgb, var(--sn-color-fg) 5%, transparent);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// The Windows 11 selection pill (transparent on other skins)
|
|
48
|
+
&[data-selected]::before {
|
|
49
|
+
content: '';
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset-inline-start: 0;
|
|
52
|
+
top: 50%;
|
|
53
|
+
width: 3px;
|
|
54
|
+
height: 1em;
|
|
55
|
+
translate: 0 -50%;
|
|
56
|
+
border-radius: 2px;
|
|
57
|
+
background: var(--sn-row-selected-indicator);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --- Table rows (role="row") -------------------------------------------------
|
|
62
|
+
#{$list}[role='grid'] #{$item} {
|
|
63
|
+
// A selectable <tr hlmTr> carries this data-slot instead of "table-row", so the theme's
|
|
64
|
+
// table skin no longer reaches it: give it the neutral hairline instead of the stock --border.
|
|
65
|
+
border-color: color-mix(in srgb, var(--sn-color-fg) 10%, transparent);
|
|
66
|
+
|
|
67
|
+
&:hover:not([data-selected]) {
|
|
68
|
+
background: color-mix(in srgb, var(--sn-color-fg) 4%, transparent);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
> :first-child {
|
|
72
|
+
box-shadow: inset 3px 0 0 transparent;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&[data-selected] > :first-child {
|
|
76
|
+
box-shadow: inset 3px 0 0 var(--sn-row-selected-indicator);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// --- Selected: accent-driven while focused, muted when not -------------------
|
|
81
|
+
#{$list} #{$item}[data-selected] {
|
|
82
|
+
background: var(--sn-row-selected-bg-unfocused);
|
|
83
|
+
color: var(--sn-row-selected-fg-unfocused);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#{$list}:focus-within #{$item}[data-selected] {
|
|
87
|
+
background: var(--sn-row-selected-bg);
|
|
88
|
+
color: var(--sn-row-selected-fg);
|
|
89
|
+
|
|
90
|
+
// secondary text follows the selection color (e.g. white on the macOS accent)
|
|
91
|
+
* {
|
|
92
|
+
color: inherit;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// --- The keyboard cursor, only when focus came from the keyboard --------------
|
|
97
|
+
#{$list}:focus-visible #{$item}[data-active] {
|
|
98
|
+
outline: var(--sn-row-focus-ring);
|
|
99
|
+
outline-offset: -2px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// @spartan-native/helm: styles for the desktop behaviors
|
|
3
|
+
//
|
|
4
|
+
// Load after the theme:
|
|
5
|
+
// @use '@spartan-native/theme/styles/spartan-native';
|
|
6
|
+
// @use '@spartan-native/helm/styles/spartan-native-helm';
|
|
7
|
+
//
|
|
8
|
+
// No per-OS selectors here: everything reads the theme's tokens
|
|
9
|
+
// (--sn-row-*, --sn-list-item-*), so each skin decides the look.
|
|
10
|
+
// ============================================================================
|
|
11
|
+
|
|
12
|
+
// Everything sits in the `spartan-native.helm` layer, after the theme's layers.
|
|
13
|
+
@use 'selectable';
|
|
14
|
+
@use 'dialog-buttons';
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* The desktop selection model, as pure functions.
|
|
4
|
+
*
|
|
5
|
+
* It follows how Explorer, Finder and Nautilus behave:
|
|
6
|
+
* - click selects one item and sets the anchor
|
|
7
|
+
* - Ctrl-click (⌘-click on macOS) toggles one item and moves the anchor
|
|
8
|
+
* - Shift-click selects the range from the anchor; with Ctrl/⌘ it adds the range
|
|
9
|
+
* - arrows / Home / End move the active item and select it; with Shift they extend
|
|
10
|
+
* the range from the anchor; with Ctrl they move the focus without selecting
|
|
11
|
+
* - Ctrl/⌘+A selects all, Esc clears
|
|
12
|
+
*
|
|
13
|
+
* No Angular and no DOM here: the directives in selectable.ts feed events in.
|
|
14
|
+
*/
|
|
15
|
+
/** How many items Page Up and Page Down move the active item by. */
|
|
16
|
+
export declare const SELECTION_PAGE_SIZE = 10;
|
|
17
|
+
/** How long type-ahead keeps adding typed characters to one search before it starts over, in ms. */
|
|
18
|
+
export declare const TYPEAHEAD_RESET_MS = 600;
|
|
19
|
+
interface SelectionState<K> {
|
|
20
|
+
/** Selected keys, always in item order. */
|
|
21
|
+
readonly selected: readonly K[];
|
|
22
|
+
/** Where a Shift range starts. */
|
|
23
|
+
readonly anchor: K | null;
|
|
24
|
+
/** The keyboard cursor (focused row). */
|
|
25
|
+
readonly active: K | null;
|
|
26
|
+
}
|
|
27
|
+
interface SelectionModifiers {
|
|
28
|
+
/** Shift is held. */
|
|
29
|
+
readonly range?: boolean;
|
|
30
|
+
/** Ctrl (Windows, Linux) or ⌘ (macOS) is held. */
|
|
31
|
+
readonly toggle?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const EMPTY_SELECTION: SelectionState<never>;
|
|
34
|
+
/** The state after a pointer click on `key`. */
|
|
35
|
+
export declare function selectionClick<K>(state: SelectionState<K>, keys: readonly K[], key: K, mods?: SelectionModifiers, multiple?: boolean): SelectionState<K>;
|
|
36
|
+
/** The state after the keyboard moves the active item to `index` (clamped). */
|
|
37
|
+
export declare function selectionMoveTo<K>(state: SelectionState<K>, keys: readonly K[], index: number, mods?: SelectionModifiers, multiple?: boolean): SelectionState<K>;
|
|
38
|
+
/** Move the active item by `delta` rows. With nothing active, Down starts at the top and Up at the bottom. */
|
|
39
|
+
export declare function selectionMoveBy<K>(state: SelectionState<K>, keys: readonly K[], delta: number, mods?: SelectionModifiers, multiple?: boolean): SelectionState<K>;
|
|
40
|
+
/** Space: select the active item, or toggle it with Ctrl/⌘. */
|
|
41
|
+
export declare function selectionToggleActive<K>(state: SelectionState<K>, keys: readonly K[], mods?: SelectionModifiers, multiple?: boolean): SelectionState<K>;
|
|
42
|
+
export declare function selectionAll<K>(state: SelectionState<K>, keys: readonly K[], multiple?: boolean): SelectionState<K>;
|
|
43
|
+
export declare function selectionClear<K>(state: SelectionState<K>): SelectionState<K>;
|
|
44
|
+
/** Drop keys that no longer exist (items removed), keeping order. */
|
|
45
|
+
export declare function selectionSync<K>(state: SelectionState<K>, keys: readonly K[]): SelectionState<K>;
|
|
46
|
+
/**
|
|
47
|
+
* Type-ahead: the index of the next item whose label starts with `query`.
|
|
48
|
+
* A repeated single letter cycles through matches, like Explorer and Finder.
|
|
49
|
+
*/
|
|
50
|
+
export declare function typeaheadIndex(labels: readonly string[], query: string, fromIndex: number): number;
|
|
51
|
+
/** listbox: a list of options · grid: table rows */
|
|
52
|
+
type SelectableRole = 'listbox' | 'grid';
|
|
53
|
+
interface SelectableParent<K> {
|
|
54
|
+
readonly role: () => SelectableRole;
|
|
55
|
+
isSelected(key: K): boolean;
|
|
56
|
+
isActive(key: K): boolean;
|
|
57
|
+
click(key: K, event: MouseEvent): void;
|
|
58
|
+
activate(key: K): void;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* One selectable row: an option in a list, or a `<tr>` in a table.
|
|
62
|
+
*
|
|
63
|
+
* ```html
|
|
64
|
+
* <div snSelectableItem [value]="file.id">{{ file.name }}</div>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare class SnSelectableItem<K = unknown> {
|
|
68
|
+
protected readonly parent: SelectableParent<K>;
|
|
69
|
+
readonly element: HTMLElement;
|
|
70
|
+
/**
|
|
71
|
+
* The key this row stands for (required in practice). Declared optional because the
|
|
72
|
+
* list reads its rows while Angular is still binding them.
|
|
73
|
+
*/
|
|
74
|
+
readonly value: import("@angular/core").InputSignal<K>;
|
|
75
|
+
/** Text used for type-ahead; defaults to the row's text. */
|
|
76
|
+
readonly label: import("@angular/core").InputSignal<string | undefined>;
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly selected: import("@angular/core").Signal<boolean>;
|
|
79
|
+
readonly active: import("@angular/core").Signal<boolean>;
|
|
80
|
+
typeaheadLabel(): string;
|
|
81
|
+
protected onMouseDown(event: MouseEvent): void;
|
|
82
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSelectableItem<any>, never>;
|
|
83
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnSelectableItem<any>, "[snSelectableItem]", ["snSelectableItem"], {
|
|
84
|
+
"value": {
|
|
85
|
+
"alias": "value";
|
|
86
|
+
"required": false;
|
|
87
|
+
"isSignal": true;
|
|
88
|
+
};
|
|
89
|
+
"label": {
|
|
90
|
+
"alias": "snSelectableLabel";
|
|
91
|
+
"required": false;
|
|
92
|
+
"isSignal": true;
|
|
93
|
+
};
|
|
94
|
+
}, {}, never, never, true, never>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A list or table with the desktop selection model.
|
|
98
|
+
*
|
|
99
|
+
* ```html
|
|
100
|
+
* <div snSelectable [(selection)]="selected" (activated)="open($event)">
|
|
101
|
+
* @for (f of files; track f.id) {
|
|
102
|
+
* <div snSelectableItem [value]="f.id">{{ f.name }}</div>
|
|
103
|
+
* }
|
|
104
|
+
* </div>
|
|
105
|
+
*
|
|
106
|
+
* <table hlmTable snSelectable="grid" [(selection)]="selected">…<tr hlmTr snSelectableItem [value]="row.id">…</table>
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* Mouse: click, Ctrl/⌘-click, Shift-click, double-click to activate.
|
|
110
|
+
* Keyboard: ↑ ↓ Home End PageUp PageDown (Shift extends, Ctrl moves focus only),
|
|
111
|
+
* Space (Ctrl+Space toggles), Ctrl/⌘+A, Esc clears, Enter activates, type-ahead.
|
|
112
|
+
* On macOS ⌘ replaces Ctrl, and ⌘↑ / ⌘↓ jump to the first / last row.
|
|
113
|
+
*/
|
|
114
|
+
export declare class SnSelectable<K = unknown> implements SelectableParent<K> {
|
|
115
|
+
private readonly doc;
|
|
116
|
+
private readonly skin;
|
|
117
|
+
/** `snSelectable` or `snSelectable="listbox"` for lists, `snSelectable="grid"` for tables. */
|
|
118
|
+
readonly role: import("@angular/core").InputSignalWithTransform<SelectableRole, "" | SelectableRole>;
|
|
119
|
+
/** Allow more than one selected row. */
|
|
120
|
+
readonly multiple: import("@angular/core").InputSignal<boolean>;
|
|
121
|
+
/** The selected keys, in row order. Two-way bindable. */
|
|
122
|
+
readonly selection: import("@angular/core").ModelSignal<readonly K[]>;
|
|
123
|
+
/** Enter or double-click on a row. */
|
|
124
|
+
readonly activated: import("@angular/core").OutputEmitterRef<K>;
|
|
125
|
+
private readonly items;
|
|
126
|
+
private readonly keys;
|
|
127
|
+
private readonly cursor;
|
|
128
|
+
private readonly selectedSet;
|
|
129
|
+
protected readonly activeId: import("@angular/core").Signal<string | null>;
|
|
130
|
+
private typeahead;
|
|
131
|
+
private typeaheadTimer;
|
|
132
|
+
constructor();
|
|
133
|
+
isSelected(key: K): boolean;
|
|
134
|
+
isActive(key: K): boolean;
|
|
135
|
+
click(key: K, event: MouseEvent): void;
|
|
136
|
+
activate(key: K): void;
|
|
137
|
+
protected onFocus(): void;
|
|
138
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
139
|
+
private onTypeahead;
|
|
140
|
+
private state;
|
|
141
|
+
private apply;
|
|
142
|
+
/** ⌘ toggles on macOS, Ctrl everywhere else (Ctrl-click is the context menu on macOS). */
|
|
143
|
+
private modifiers;
|
|
144
|
+
private isMac;
|
|
145
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSelectable<any>, never>;
|
|
146
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnSelectable<any>, "[snSelectable]", ["snSelectable"], {
|
|
147
|
+
"role": {
|
|
148
|
+
"alias": "snSelectable";
|
|
149
|
+
"required": false;
|
|
150
|
+
"isSignal": true;
|
|
151
|
+
};
|
|
152
|
+
"multiple": {
|
|
153
|
+
"alias": "multiple";
|
|
154
|
+
"required": false;
|
|
155
|
+
"isSignal": true;
|
|
156
|
+
};
|
|
157
|
+
"selection": {
|
|
158
|
+
"alias": "selection";
|
|
159
|
+
"required": false;
|
|
160
|
+
"isSignal": true;
|
|
161
|
+
};
|
|
162
|
+
}, {
|
|
163
|
+
"selection": "selectionChange";
|
|
164
|
+
"activated": "activated";
|
|
165
|
+
}, ["items"], never, true, never>;
|
|
166
|
+
}
|
|
167
|
+
export declare const SnSelectableImports: readonly [typeof SnSelectable, typeof SnSelectableItem];
|
|
168
|
+
/**
|
|
169
|
+
* Marks a custom area for snDefaultAction / snCancelAction (dialogs and forms are scopes already).
|
|
170
|
+
*
|
|
171
|
+
* ```html
|
|
172
|
+
* <section snActionScope>…</section>
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
export declare class SnActionScope {
|
|
176
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnActionScope, never>;
|
|
177
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnActionScope, "[snActionScope]", never, {}, {}, never, never, true, never>;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The default button: Enter anywhere in its dialog or form presses it,
|
|
181
|
+
* the way every desktop OS behaves. Fields that use Enter themselves
|
|
182
|
+
* (multi-line text, other buttons, lists) keep it.
|
|
183
|
+
*
|
|
184
|
+
* ```html
|
|
185
|
+
* <button hlmBtn snDefaultAction (click)="save()">Save</button>
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
export declare class SnDefaultAction {
|
|
189
|
+
private readonly button;
|
|
190
|
+
constructor();
|
|
191
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnDefaultAction, never>;
|
|
192
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnDefaultAction, "button[snDefaultAction]", never, {}, {}, never, never, true, never>;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The cancel button: Esc anywhere in its dialog or form presses it.
|
|
196
|
+
*
|
|
197
|
+
* ```html
|
|
198
|
+
* <button hlmBtn variant="outline" snCancelAction (click)="close()">Cancel</button>
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
export declare class SnCancelAction {
|
|
202
|
+
private readonly button;
|
|
203
|
+
constructor();
|
|
204
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnCancelAction, never>;
|
|
205
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnCancelAction, "button[snCancelAction]", never, {}, {}, never, never, true, never>;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* A row of dialog buttons, put in the order of the current OS: the
|
|
209
|
+
* snDefaultAction, the snCancelAction and every other button. Write them in any order;
|
|
210
|
+
* the skin decides where each goes. spartan's hlm-dialog-footer and hlm-alert-dialog-footer
|
|
211
|
+
* get the same treatment without this directive. It sets an attribute, not `data-slot`, so it
|
|
212
|
+
* can sit on another component's host (`<div hlmCardFooter snDialogButtons>`).
|
|
213
|
+
*
|
|
214
|
+
* | Skin | Order |
|
|
215
|
+
* | --- | --- |
|
|
216
|
+
* | Windows, KDE | default · other · cancel |
|
|
217
|
+
* | macOS | other ‹gap› cancel · default |
|
|
218
|
+
* | GNOME | cancel · other · default |
|
|
219
|
+
* | ChromeOS, web | other · cancel · default |
|
|
220
|
+
*
|
|
221
|
+
* ```html
|
|
222
|
+
* <div snDialogButtons>
|
|
223
|
+
* <button hlmBtn snDefaultAction>Save</button>
|
|
224
|
+
* <button hlmBtn variant="outline">Don't save</button>
|
|
225
|
+
* <button hlmBtn variant="outline" snCancelAction>Cancel</button>
|
|
226
|
+
* </div>
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
export declare class SnDialogButtons {
|
|
230
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnDialogButtons, never>;
|
|
231
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnDialogButtons, "[snDialogButtons]", never, {}, {}, never, never, true, never>;
|
|
232
|
+
}
|
|
233
|
+
export declare const SnDialogActionsImports: readonly [typeof SnActionScope, typeof SnDefaultAction, typeof SnCancelAction, typeof SnDialogButtons];
|
|
234
|
+
export type { SelectableRole, SelectionModifiers, SelectionState };
|