@gjsify/adwaita-web 0.36.0 → 0.38.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/adwaita-web.css +504 -34
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/accent.d.ts +28 -0
- package/lib/types/adw-accent.spec.d.ts +2 -0
- package/lib/types/adw-shortcut-label.spec.d.ts +2 -0
- package/lib/types/breakpoints.d.ts +10 -12
- package/lib/types/elements/adw-about-dialog.d.ts +19 -36
- package/lib/types/elements/adw-action-row.d.ts +9 -12
- package/lib/types/elements/adw-alert-dialog.d.ts +0 -12
- package/lib/types/elements/adw-avatar.d.ts +1 -0
- package/lib/types/elements/adw-bottom-sheet.d.ts +7 -12
- package/lib/types/elements/adw-button-content.d.ts +3 -4
- package/lib/types/elements/adw-button-row.d.ts +1 -1
- package/lib/types/elements/adw-carousel.d.ts +28 -49
- package/lib/types/elements/adw-checks.d.ts +2 -8
- package/lib/types/elements/adw-combo-row.d.ts +6 -6
- package/lib/types/elements/adw-data-grid.d.ts +5 -10
- package/lib/types/elements/adw-drop-down.d.ts +3 -11
- package/lib/types/elements/adw-entry-row.d.ts +20 -23
- package/lib/types/elements/adw-icon.d.ts +2 -4
- package/lib/types/elements/adw-inline-view-switcher.d.ts +18 -31
- package/lib/types/elements/adw-navigation-split-view.d.ts +7 -12
- package/lib/types/elements/adw-navigation-view.d.ts +2 -10
- package/lib/types/elements/adw-overlay-split-view.d.ts +28 -52
- package/lib/types/elements/adw-password-entry-row.d.ts +4 -5
- package/lib/types/elements/adw-popover.d.ts +2 -7
- package/lib/types/elements/adw-preferences-dialog.d.ts +21 -34
- package/lib/types/elements/adw-preferences-group.d.ts +12 -14
- package/lib/types/elements/adw-progress-bar.d.ts +3 -4
- package/lib/types/elements/adw-shortcut-label.d.ts +20 -0
- package/lib/types/elements/adw-sidebar.d.ts +5 -10
- package/lib/types/elements/adw-spinner.d.ts +3 -5
- package/lib/types/elements/adw-split-button.d.ts +6 -16
- package/lib/types/elements/adw-switch-row.d.ts +3 -3
- package/lib/types/elements/adw-tab-view.d.ts +16 -26
- package/lib/types/elements/adw-toast-overlay.d.ts +8 -13
- package/lib/types/elements/adw-view-stack.d.ts +7 -17
- package/lib/types/elements/adw-view-switcher-bar.d.ts +4 -8
- package/lib/types/elements/adw-view-switcher.d.ts +18 -38
- package/lib/types/elements/adw-wrap-box.d.ts +7 -17
- package/lib/types/elements/view-switcher-dom.d.ts +10 -13
- package/lib/types/index.d.ts +3 -0
- package/lib/types/source-view/hex.d.ts +7 -13
- package/lib/types/style-classes.spec.d.ts +11 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/package.json +18 -7
- package/scss/_about_dialog.scss +3 -2
- package/scss/_action_row.scss +33 -0
- package/scss/_avatar.scss +12 -0
- package/scss/_button.scss +44 -22
- package/scss/_card.scss +11 -8
- package/scss/_checks.scss +2 -4
- package/scss/_dialog.scss +3 -2
- package/scss/_headerbar.scss +23 -0
- package/scss/_popover.scss +8 -4
- package/scss/_preferences.scss +7 -7
- package/scss/_progress_bar.scss +9 -6
- package/scss/_reset.scss +1 -1
- package/scss/_shortcut_label.scss +80 -0
- package/scss/_sidebar.scss +57 -0
- package/scss/_status_page.scss +20 -0
- package/scss/_style_classes.scss +407 -0
- package/scss/_switch.scss +4 -3
- package/scss/_theme.scss +20 -2
- package/scss/_variables.scss +34 -1
- package/scss/adwaita-skin.scss +12 -0
- package/src/accent.ts +74 -0
- package/src/adw-about-dialog.spec.ts +34 -49
- package/src/adw-accent.spec.ts +105 -0
- package/src/adw-action-rows.spec.ts +25 -33
- package/src/adw-avatar.spec.ts +51 -20
- package/src/adw-banner.spec.ts +5 -8
- package/src/adw-button-content.spec.ts +9 -12
- package/src/adw-button-row.spec.ts +2 -4
- package/src/adw-carousel.spec.ts +40 -53
- package/src/adw-checks.spec.ts +36 -47
- package/src/adw-drop-down.spec.ts +25 -32
- package/src/adw-header-bar.spec.ts +5 -7
- package/src/adw-icon.spec.ts +23 -32
- package/src/adw-progress-bar.spec.ts +10 -12
- package/src/adw-row-state.spec.ts +9 -10
- package/src/adw-shortcut-label.spec.ts +112 -0
- package/src/adw-sidebar.spec.ts +17 -24
- package/src/adw-switch.spec.ts +11 -17
- package/src/adw-tab-view.spec.ts +7 -10
- package/src/adw-toast-overlay.spec.ts +7 -11
- package/src/adw-view-switcher-bar.spec.ts +10 -14
- package/src/adw-wrap-box.spec.ts +25 -36
- package/src/bottom-sheet.spec.ts +30 -36
- package/src/breakpoints.ts +15 -18
- package/src/chrome.spec.ts +13 -21
- package/src/elements/adw-about-dialog.ts +71 -114
- package/src/elements/adw-action-row.ts +22 -37
- package/src/elements/adw-alert-dialog.ts +25 -50
- package/src/elements/adw-avatar.ts +40 -15
- package/src/elements/adw-banner.ts +14 -18
- package/src/elements/adw-bottom-sheet.ts +31 -52
- package/src/elements/adw-button-content.ts +30 -37
- package/src/elements/adw-button-row.ts +14 -24
- package/src/elements/adw-carousel.ts +87 -148
- package/src/elements/adw-checks.ts +43 -56
- package/src/elements/adw-clamp.ts +8 -9
- package/src/elements/adw-combo-row.ts +17 -25
- package/src/elements/adw-data-grid.ts +26 -38
- package/src/elements/adw-dialog.ts +25 -56
- package/src/elements/adw-drop-down.ts +31 -51
- package/src/elements/adw-entry-row.ts +39 -46
- package/src/elements/adw-expander-row.ts +30 -53
- package/src/elements/adw-icon.ts +30 -53
- package/src/elements/adw-inline-view-switcher.ts +38 -67
- package/src/elements/adw-menu-button.ts +28 -58
- package/src/elements/adw-navigation-split-view.ts +35 -47
- package/src/elements/adw-navigation-view.ts +12 -28
- package/src/elements/adw-overlay-split-view.ts +100 -175
- package/src/elements/adw-password-entry-row.ts +18 -28
- package/src/elements/adw-popover.ts +28 -44
- package/src/elements/adw-preferences-dialog.ts +41 -66
- package/src/elements/adw-preferences-group.ts +33 -46
- package/src/elements/adw-progress-bar.ts +27 -47
- package/src/elements/adw-shortcut-label.ts +138 -0
- package/src/elements/adw-sidebar.ts +31 -39
- package/src/elements/adw-spin-row.ts +7 -14
- package/src/elements/adw-spinner.ts +31 -43
- package/src/elements/adw-split-button.ts +45 -75
- package/src/elements/adw-switch-row.ts +29 -46
- package/src/elements/adw-switch.ts +28 -47
- package/src/elements/adw-tab-view.ts +62 -103
- package/src/elements/adw-toast-overlay.ts +28 -35
- package/src/elements/adw-toggle-group.ts +9 -16
- package/src/elements/adw-view-stack.ts +32 -51
- package/src/elements/adw-view-switcher-bar.ts +26 -50
- package/src/elements/adw-view-switcher.ts +60 -110
- package/src/elements/adw-window-title.ts +4 -4
- package/src/elements/adw-wrap-box.ts +33 -59
- package/src/elements/view-switcher-dom.ts +15 -22
- package/src/entry-rows.spec.ts +18 -24
- package/src/index.ts +24 -15
- package/src/navigation-view.spec.ts +7 -10
- package/src/preferences-search.ts +11 -15
- package/src/preferences.spec.ts +13 -15
- package/src/source-view/adw-source-view.ts +6 -19
- package/src/source-view/hex.ts +7 -13
- package/src/split-button.spec.ts +32 -44
- package/src/split-views.spec.ts +83 -149
- package/src/style-classes.spec.ts +181 -0
- package/src/style-isolation.spec.ts +3 -6
- package/src/styles.generated.ts +1 -1
- package/src/tab-view.spec.ts +26 -35
- package/src/test.browser.mts +6 -0
- package/src/view-stack.spec.ts +23 -34
- package/src/view-switcher.spec.ts +56 -84
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type AdwAccentColorName } from '@gjsify/adwaita-core';
|
|
2
|
+
/** The custom property carrying the accent fill. */
|
|
3
|
+
export declare const ACCENT_BG_PROPERTY = "--accent-bg-color";
|
|
4
|
+
/** The custom property carrying the standalone accent, for text on the window. */
|
|
5
|
+
export declare const ACCENT_PROPERTY = "--accent-color";
|
|
6
|
+
/** Where and how to apply the accent. */
|
|
7
|
+
export interface ApplyAccentOptions {
|
|
8
|
+
/** The element to set the properties on. Defaults to `document.documentElement`. */
|
|
9
|
+
readonly target?: HTMLElement;
|
|
10
|
+
/**
|
|
11
|
+
* Which standalone variant to use. Defaults to the target's RESOLVED scheme,
|
|
12
|
+
* because the standalone colour is the one thing about an accent that differs
|
|
13
|
+
* between light and dark — reading it beats assuming light.
|
|
14
|
+
*/
|
|
15
|
+
readonly dark?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Whether `element` is currently rendering dark.
|
|
19
|
+
*
|
|
20
|
+
* `.theme-dark` / `.theme-light` are the stylesheet's manual overrides and win
|
|
21
|
+
* over the media query, so an explicit class is checked first and
|
|
22
|
+
* `prefers-color-scheme` only decides when neither is present.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isAdwaitaDark(element: HTMLElement): boolean;
|
|
25
|
+
/** Set the accent custom properties for `name`. */
|
|
26
|
+
export declare function applyAdwaitaAccent(name: AdwAccentColorName, options?: ApplyAccentOptions): void;
|
|
27
|
+
/** Drop the properties, so the stylesheet's own values apply again. */
|
|
28
|
+
export declare function clearAdwaitaAccent(target?: HTMLElement): void;
|
|
@@ -2,21 +2,19 @@ import { AdwBreakpoint } from '@gjsify/adwaita-core';
|
|
|
2
2
|
/**
|
|
3
3
|
* Drive `breakpoints` from `element`'s own box, and return a dispose function.
|
|
4
4
|
*
|
|
5
|
-
* `ResizeObserver` delivers an initial observation on `observe()`, so the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The size read is the BORDER box in CSS pixels, the browser's counterpart to
|
|
10
|
-
* the `sp`/DIP units an Adwaita condition is written in.
|
|
5
|
+
* `ResizeObserver` delivers an initial observation on `observe()`, so the breakpoints
|
|
6
|
+
* settle on the correct state before first paint — no flash of the wrong layout, no
|
|
7
|
+
* separate seeding pass. The size read is the BORDER box in CSS pixels, the browser's
|
|
8
|
+
* counterpart to the `sp`/DIP units an Adwaita condition is written in.
|
|
11
9
|
*/
|
|
12
10
|
export declare function addBreakpoints(element: Element, breakpoints: readonly AdwBreakpoint[]): () => void;
|
|
13
11
|
/**
|
|
14
|
-
* Wire a `breakpoint="<condition>"` attribute to a boolean setter, the browser
|
|
15
|
-
*
|
|
12
|
+
* Wire a `breakpoint="<condition>"` attribute to a boolean setter, the browser equivalent
|
|
13
|
+
* of an `Adw.Breakpoint` with one `add_setter()` call. Returns a dispose function; call it
|
|
14
|
+
* before re-binding and on disconnect.
|
|
16
15
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* flip state because its condition had a typo.
|
|
16
|
+
* A missing or unparsable condition binds nothing and returns a no-op, leaving whatever
|
|
17
|
+
* the attribute already says untouched — an element must not silently flip state because
|
|
18
|
+
* its condition had a typo.
|
|
21
19
|
*/
|
|
22
20
|
export declare function bindBreakpointSetter(element: Element, condition: string | null, setValue: (active: boolean) => void): () => void;
|
|
@@ -32,7 +32,6 @@ export declare class AdwAboutDialog extends HTMLElement {
|
|
|
32
32
|
set license(value: string);
|
|
33
33
|
get licenseUrl(): string;
|
|
34
34
|
set licenseUrl(value: string);
|
|
35
|
-
/** Whether the dialog is presented. */
|
|
36
35
|
get open(): boolean;
|
|
37
36
|
set open(value: boolean);
|
|
38
37
|
get developers(): string[];
|
|
@@ -54,62 +53,46 @@ export declare class AdwAboutDialog extends HTMLElement {
|
|
|
54
53
|
/** The credit groups the Credits page shows, straight from `update_credits`. */
|
|
55
54
|
private _creditsSections;
|
|
56
55
|
/**
|
|
57
|
-
* Whether the Legal page has anything on it.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* is set, unknown otherwise", which is what `adw_about_dialog_set_license`
|
|
62
|
-
* does to the type anyway (:3472).
|
|
56
|
+
* Whether the Legal page has anything on it. This element's licence model is the
|
|
57
|
+
* simplified one — a name plus an optional URL — so it maps onto `GtkLicense` as
|
|
58
|
+
* "custom text when a licence is set, unknown otherwise", which is what
|
|
59
|
+
* `adw_about_dialog_set_license` does to the type anyway.
|
|
63
60
|
*/
|
|
64
61
|
private _hasLegal;
|
|
65
|
-
/** Rebuild the sheet contents from the current attributes / credit lists. */
|
|
66
62
|
private _render;
|
|
67
63
|
/**
|
|
68
64
|
* A navigation page wrapping a header bar (with the close button) + content.
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* because its page title is the dialog's ("About", .ui:19) while its header
|
|
72
|
-
* shows the application name (.ui:30).
|
|
65
|
+
* `headerTitle` defaults to the page title; the main page overrides it, because its
|
|
66
|
+
* page title is the dialog's ("About") while its header shows the application name.
|
|
73
67
|
*/
|
|
74
68
|
private _buildPage;
|
|
75
|
-
/** The main page: icon, name, developer, version pill, then the three groups. */
|
|
76
69
|
private _buildMainPage;
|
|
77
70
|
/**
|
|
78
|
-
* One `AdwPreferencesGroup` in its spacing wrapper.
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* sections pass `null`, because the template has no id for them: they are
|
|
83
|
-
* built one per section at runtime (:548-549).
|
|
71
|
+
* One `AdwPreferencesGroup` in its spacing wrapper. `data-group` carries the
|
|
72
|
+
* template's widget id so a test — and a reader — can tell the named groups apart;
|
|
73
|
+
* nothing styles off it. The credits sections pass `null`, because the template has
|
|
74
|
+
* no id for them: they are built one per section at runtime.
|
|
84
75
|
*/
|
|
85
76
|
private _buildGroup;
|
|
86
|
-
/** An activatable row that pushes a subpage, with a trailing go-next chevron. */
|
|
87
77
|
private _buildNavRow;
|
|
88
78
|
/**
|
|
89
|
-
* Emit `activate-link` and navigate unless a handler took over.
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* suppresses it — which is what `preventDefault()` on a cancelable event
|
|
95
|
-
* means, and why `dispatchEvent`'s return value is the gate here.
|
|
79
|
+
* Emit `activate-link` and navigate unless a handler took over. The GObject signal
|
|
80
|
+
* is `BOOLEAN__STRING` with `g_signal_accumulator_true_handled` and its default
|
|
81
|
+
* handler returns `GDK_EVENT_PROPAGATE` ("not handled, do the default"); a handler
|
|
82
|
+
* returning TRUE suppresses it, which is what `preventDefault()` on a cancelable
|
|
83
|
+
* event means — hence the gate on `dispatchEvent`'s return value.
|
|
96
84
|
*/
|
|
97
85
|
private _activateLink;
|
|
98
|
-
/** The Details page: comments + the links group (website + future custom links). */
|
|
99
86
|
private _buildDetailsPage;
|
|
100
|
-
/** A link row that opens a URL in a new tab and emits `activate-link`. */
|
|
101
87
|
private _buildLinkRow;
|
|
102
|
-
/** The Credits page: one group per section the core assembled. */
|
|
103
88
|
private _buildCreditsPage;
|
|
104
89
|
/**
|
|
105
|
-
* A credit row — a plain title, or a link row when the entry carries a URI.
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* an
|
|
109
|
-
* pointer, :562) and still produces an `AdwLinkRow`, to `mailto:`.
|
|
90
|
+
* A credit row — a plain title, or a link row when the entry carries a URI. The gate
|
|
91
|
+
* is `link !== null`, not the URI's truthiness: `"Ada <>"` parses to an EMPTY link,
|
|
92
|
+
* which is still a link in the C (`if (link)` tests the pointer) and still produces
|
|
93
|
+
* an `AdwLinkRow`, to `mailto:`.
|
|
110
94
|
*/
|
|
111
95
|
private _buildCreditRow;
|
|
112
|
-
/** The Legal page: copyright + license text. */
|
|
113
96
|
private _buildLegalPage;
|
|
114
97
|
/** Show the header title only once the main page is scrolled (AdwAboutDialog). */
|
|
115
98
|
private _updateHeaderTitle;
|
|
@@ -16,10 +16,9 @@ export declare class AdwActionRow extends HTMLElement {
|
|
|
16
16
|
/** `Adw.ActionRow:activatable-widget` — the widget this row activates. */
|
|
17
17
|
get activatableWidget(): HTMLElement | null;
|
|
18
18
|
/**
|
|
19
|
-
* Set the activatable widget. Its sensitivity is copied into `activatable`
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* that surprises: clearing the widget LEAVES the row activatable (C:709).
|
|
19
|
+
* Set the activatable widget. Its sensitivity is copied into `activatable` right
|
|
20
|
+
* away and then tracked, as libadwaita's `sensitive` → `activatable` binding does —
|
|
21
|
+
* including the surprising part: clearing the widget LEAVES the row activatable.
|
|
23
22
|
*/
|
|
24
23
|
set activatableWidget(widget: HTMLElement | null);
|
|
25
24
|
/** Whether a click activates this row — `GtkListBoxRow:activatable`. */
|
|
@@ -30,15 +29,13 @@ export declare class AdwActionRow extends HTMLElement {
|
|
|
30
29
|
disconnectedCallback(): void;
|
|
31
30
|
attributeChangedCallback(): void;
|
|
32
31
|
/**
|
|
33
|
-
* `adw_action_row_activate_real
|
|
34
|
-
*
|
|
32
|
+
* `adw_action_row_activate_real`: forward the activation to the activatable widget,
|
|
33
|
+
* then emit `activated`.
|
|
35
34
|
*
|
|
36
|
-
* A click that ORIGINATED inside the activatable widget does not activate the
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* suffixes (C:120-137). It is also what keeps the forwarding from looping —
|
|
41
|
-
* the synthetic click dispatched below bubbles straight back into this same
|
|
35
|
+
* A click that ORIGINATED inside the activatable widget does not activate the row at
|
|
36
|
+
* all — no forwarding, no `activated`. That is GTK's answer too: the widget claims
|
|
37
|
+
* the gesture, so `GtkListBox` never emits `row-activated`. It is also what keeps the
|
|
38
|
+
* forwarding from looping — the synthetic click below bubbles back into this same
|
|
42
39
|
* listener, and without the guard one activation emitted `activated` twice.
|
|
43
40
|
*/
|
|
44
41
|
private _onClick;
|
|
@@ -24,13 +24,10 @@ export declare class AdwAlertDialog extends HTMLElement {
|
|
|
24
24
|
private readonly _buttons;
|
|
25
25
|
private _blockCloseResponse;
|
|
26
26
|
static get observedAttributes(): string[];
|
|
27
|
-
/** The heading of the dialog. */
|
|
28
27
|
get heading(): string;
|
|
29
28
|
set heading(value: string);
|
|
30
|
-
/** The body text of the dialog. */
|
|
31
29
|
get body(): string;
|
|
32
30
|
set body(value: string);
|
|
33
|
-
/** Whether the dialog is currently shown. */
|
|
34
31
|
get open(): boolean;
|
|
35
32
|
set open(value: boolean);
|
|
36
33
|
/** Whether to prefer horizontal button layout when the buttons fit. */
|
|
@@ -46,23 +43,15 @@ export declare class AdwAlertDialog extends HTMLElement {
|
|
|
46
43
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
47
44
|
/** Present the dialog. `parent` is accepted for API parity; unused. */
|
|
48
45
|
present(_parent?: unknown): void;
|
|
49
|
-
/** Adds a response button with the given ID and label. */
|
|
50
46
|
addResponse(id: string, label: string): void;
|
|
51
47
|
/** Adds multiple responses at once — id/label pairs (Adw.add_responses parity). */
|
|
52
48
|
addResponses(...idLabelPairs: string[]): void;
|
|
53
|
-
/** Removes a response. */
|
|
54
49
|
removeResponse(id: string): void;
|
|
55
|
-
/** Whether a response with the given ID exists. */
|
|
56
50
|
hasResponse(id: string): boolean;
|
|
57
|
-
/** Gets a response's label. */
|
|
58
51
|
getResponseLabel(id: string): string | null;
|
|
59
|
-
/** Sets a response's label. */
|
|
60
52
|
setResponseLabel(id: string, label: string): void;
|
|
61
|
-
/** Gets a response's appearance. */
|
|
62
53
|
getResponseAppearance(id: string): AdwResponseAppearance | null;
|
|
63
|
-
/** Sets a response's appearance (default / suggested / destructive). */
|
|
64
54
|
setResponseAppearance(id: string, appearance: AdwResponseAppearance): void;
|
|
65
|
-
/** Gets whether a response is enabled. */
|
|
66
55
|
getResponseEnabled(id: string): boolean;
|
|
67
56
|
/** Sets whether a response is enabled (disabled buttons can't be activated). */
|
|
68
57
|
setResponseEnabled(id: string, enabled: boolean): void;
|
|
@@ -70,7 +59,6 @@ export declare class AdwAlertDialog extends HTMLElement {
|
|
|
70
59
|
setDefaultResponse(id: string | null): void;
|
|
71
60
|
/** Sets the close response — emitted on dismissal (Escape / scrim click). */
|
|
72
61
|
setCloseResponse(id: string): void;
|
|
73
|
-
/** A response button was activated: close, then emit `response`. */
|
|
74
62
|
private _activateResponse;
|
|
75
63
|
/** Dismissal (Escape / scrim) — close, then emit the close-response. */
|
|
76
64
|
private _dismiss;
|
|
@@ -16,27 +16,23 @@ export declare class AdwBottomSheet extends HTMLElement {
|
|
|
16
16
|
/** Set while the element writes `open` back, so the write does not re-enter. */
|
|
17
17
|
private _reflecting;
|
|
18
18
|
static get observedAttributes(): string[];
|
|
19
|
-
/** Whether the sheet is revealed. */
|
|
20
19
|
get open(): boolean;
|
|
21
20
|
set open(value: boolean);
|
|
22
|
-
/** Whether the content is dimmed + blocked while the sheet is open. */
|
|
23
21
|
get modal(): boolean;
|
|
24
22
|
set modal(value: boolean);
|
|
25
23
|
/** Whether the user can dismiss the sheet (dimming / Escape / sheet.close). */
|
|
26
24
|
get canClose(): boolean;
|
|
27
25
|
set canClose(value: boolean);
|
|
28
|
-
/** Whether the overlaid drag handle is shown. */
|
|
29
26
|
get showDragHandle(): boolean;
|
|
30
27
|
set showDragHandle(value: boolean);
|
|
31
28
|
/**
|
|
32
|
-
* Route a dismissal affordance through the shared gate and act on the
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
29
|
+
* Route a dismissal affordance through the shared gate and act on the verdict: close,
|
|
30
|
+
* raise `close-attempt`, forward `sheet.close` to an ancestor, or do nothing. Called
|
|
31
|
+
* for the dimming layer and Escape; a close button inside the sheet passes
|
|
32
|
+
* `'close-button'`.
|
|
36
33
|
*
|
|
37
|
-
* The verdict differs
|
|
38
|
-
*
|
|
39
|
-
* `resolveBottomSheetClose` in `@gjsify/adwaita-core`.
|
|
34
|
+
* The verdict differs PER SOURCE — a locked sheet signals a scrim click but swallows
|
|
35
|
+
* a swipe, and the drag handle never closes anything (`resolveBottomSheetClose`).
|
|
40
36
|
*/
|
|
41
37
|
requestClose(source: BottomSheetCloseSource): BottomSheetCloseOutcome;
|
|
42
38
|
connectedCallback(): void;
|
|
@@ -44,7 +40,6 @@ export declare class AdwBottomSheet extends HTMLElement {
|
|
|
44
40
|
/** The programmatic open/close — `AdwBottomSheet:open`, ungated by `can-close`. */
|
|
45
41
|
private _setOpen;
|
|
46
42
|
private _render;
|
|
47
|
-
/** Mirror the state onto the `open` attribute (the CSS + markup hook). */
|
|
48
43
|
private _reflectOpen;
|
|
49
44
|
/** Read a boolean attribute: absent → `fallback`, explicit `="false"` → off. */
|
|
50
45
|
private _boolAttr;
|
|
@@ -55,7 +50,7 @@ export declare class AdwBottomSheet extends HTMLElement {
|
|
|
55
50
|
*
|
|
56
51
|
* The `<adw-bottom-sheet-sheet>` / `<adw-bottom-sheet-content>` wrappers are
|
|
57
52
|
* markup, not widgets — GtkBuilder's `<child type="sheet">` leaves nothing in
|
|
58
|
-
* the tree
|
|
53
|
+
* the tree — so the wrapper itself is claimed
|
|
59
54
|
* too. It used to fall through to `unslotted` and be appended to the content
|
|
60
55
|
* layer, leaving an empty custom element behind after its children were
|
|
61
56
|
* pulled out.
|
|
@@ -10,10 +10,9 @@ export declare class AdwButtonContent extends HTMLElement {
|
|
|
10
10
|
disconnectedCallback(): void;
|
|
11
11
|
attributeChangedCallback(name: string): void;
|
|
12
12
|
/**
|
|
13
|
-
* `adw_button_content_root
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* rule that styles it (_buttons.scss:499-507).
|
|
13
|
+
* `adw_button_content_root`: the nearest button ancestor, unless that button's DIRECT
|
|
14
|
+
* parent is a split button — then the split button takes the class, because
|
|
15
|
+
* `splitbutton.image-text-button > button` is the rule that styles it.
|
|
17
16
|
*/
|
|
18
17
|
private _hostButton;
|
|
19
18
|
private _root;
|
|
@@ -11,7 +11,7 @@ export declare class AdwButtonRow extends HTMLElement {
|
|
|
11
11
|
attributeChangedCallback(): void;
|
|
12
12
|
private _render;
|
|
13
13
|
/**
|
|
14
|
-
* Paint one of the two `image.icon.{start,end}` nodes
|
|
14
|
+
* Paint one of the two `image.icon.{start,end}` nodes.
|
|
15
15
|
*
|
|
16
16
|
* The `start` / `end` position class is set once at construction — it is
|
|
17
17
|
* where the node sits, not what it draws — so only the name changes here.
|
|
@@ -27,25 +27,20 @@ export declare class AdwCarousel extends HTMLElement implements CarouselHost {
|
|
|
27
27
|
private _pendingInteractive;
|
|
28
28
|
static get observedAttributes(): string[];
|
|
29
29
|
constructor();
|
|
30
|
-
/** Number of pages in the carousel. */
|
|
31
30
|
get nPages(): number;
|
|
32
31
|
/** Fractional scroll position (0 = first page, 1 = second, …). */
|
|
33
32
|
get position(): number;
|
|
34
33
|
/**
|
|
35
|
-
* Scroll to the page this position settles on.
|
|
36
|
-
*
|
|
37
|
-
* `
|
|
38
|
-
*
|
|
39
|
-
* `get_page_at_position` rule the carousel uses everywhere else, so setting
|
|
40
|
-
* 0.5 lands on page 0 exactly as scrolling there would.
|
|
34
|
+
* Scroll to the page this position settles on. MODIFICATION: `AdwCarousel:position`
|
|
35
|
+
* is READ-ONLY in C; this setter is a port convenience that resolves through the
|
|
36
|
+
* same `get_page_at_position` rule, so 0.5 lands on page 0 exactly as scrolling
|
|
37
|
+
* there would.
|
|
41
38
|
*/
|
|
42
39
|
set position(value: number);
|
|
43
|
-
/** The page the current position settles on, `-1` when the carousel is empty. */
|
|
44
40
|
get currentPage(): number;
|
|
45
41
|
/** Whether the scroll wheel navigates between pages. Defaults to TRUE, as in libadwaita. */
|
|
46
42
|
get allowScrollWheel(): boolean;
|
|
47
43
|
set allowScrollWheel(value: boolean);
|
|
48
|
-
/** Whether a single flick may cross more than one page. */
|
|
49
44
|
get allowLongSwipes(): boolean;
|
|
50
45
|
set allowLongSwipes(value: boolean);
|
|
51
46
|
/** Whether the carousel can be navigated at all. Defaults to TRUE. */
|
|
@@ -57,87 +52,71 @@ export declare class AdwCarousel extends HTMLElement implements CarouselHost {
|
|
|
57
52
|
connectedCallback(): void;
|
|
58
53
|
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
59
54
|
disconnectedCallback(): void;
|
|
60
|
-
/** One attribute → one state property. Shared by the initial read and later changes. */
|
|
61
55
|
private _applyAttribute;
|
|
62
56
|
/**
|
|
63
|
-
* Scroll to `value`, waiting for the first layout when the track has no
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* `<adw-carousel position="2">` silently stayed on page 0. Deferring to the
|
|
69
|
-
* first non-zero measurement is the only point at which the offset means
|
|
70
|
-
* anything; a later assignment simply replaces the pending one.
|
|
57
|
+
* Scroll to `value`, waiting for the first layout when the track has no width yet:
|
|
58
|
+
* `connectedCallback` runs DURING insertion, so the track is still 0px wide and a
|
|
59
|
+
* scroll offset has nowhere to land. The first non-zero measurement is the earliest
|
|
60
|
+
* point at which the offset means anything; a later assignment replaces the pending
|
|
61
|
+
* one.
|
|
71
62
|
*/
|
|
72
63
|
private _positionWhenMeasurable;
|
|
73
64
|
/**
|
|
74
|
-
* Jump to `value` without the reveal animation
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* to —
|
|
78
|
-
*
|
|
79
|
-
* the `scroll` event that fires from there recomputes the position back to
|
|
80
|
-
* page 0. So the one assignment is made instant and the caller's
|
|
81
|
-
* `scroll-behavior` is put back.
|
|
65
|
+
* Jump to `value` without the reveal animation: a DECLARED position is where the
|
|
66
|
+
* carousel STARTS, not somewhere it travels to. Left smooth, the track is still at
|
|
67
|
+
* offset 0 while the animation runs and the `scroll` event fired from there
|
|
68
|
+
* recomputes the position back to page 0 — so this one assignment is made instant
|
|
69
|
+
* and the caller's `scroll-behavior` restored.
|
|
82
70
|
*/
|
|
83
71
|
private _scrollInstantly;
|
|
84
|
-
/** Drop a pending declared position and stop watching for a layout. */
|
|
85
72
|
private _cancelPendingPosition;
|
|
86
|
-
/** Resolve a fractional position to a page and scroll there; a no-op when there is none. */
|
|
87
73
|
private _scrollToPosition;
|
|
88
74
|
/**
|
|
89
|
-
* Insert `page` at `position` — `adw_carousel_insert
|
|
75
|
+
* Insert `page` at `position` — `adw_carousel_insert`.
|
|
90
76
|
* `-1` or a position past the end appends. Returns whether it was added.
|
|
91
77
|
*/
|
|
92
78
|
insertPage(page: HTMLElement, position?: number): boolean;
|
|
93
|
-
/** `adw_carousel_append
|
|
79
|
+
/** `adw_carousel_append`. */
|
|
94
80
|
appendPage(page: HTMLElement): boolean;
|
|
95
|
-
/** `adw_carousel_prepend
|
|
81
|
+
/** `adw_carousel_prepend`. */
|
|
96
82
|
prependPage(page: HTMLElement): boolean;
|
|
97
|
-
/** Remove `page` — `adw_carousel_remove
|
|
83
|
+
/** Remove `page` — `adw_carousel_remove`. */
|
|
98
84
|
removePage(page: HTMLElement): boolean;
|
|
99
|
-
/** Move `page` — `adw_carousel_reorder
|
|
85
|
+
/** Move `page` — `adw_carousel_reorder`. */
|
|
100
86
|
reorderPage(page: HTMLElement, position: number): boolean;
|
|
101
87
|
/**
|
|
102
88
|
* Scroll to the page at `index`. Out-of-range, fractional and NaN indices are
|
|
103
89
|
* refused rather than clamped, matching `adw_carousel_get_nth_page`'s
|
|
104
|
-
* precondition
|
|
90
|
+
* precondition.
|
|
105
91
|
*/
|
|
106
92
|
scrollToPage(index: number): void;
|
|
107
|
-
/** One keynav step — `navigate_to_direction
|
|
93
|
+
/** One keynav step — `navigate_to_direction`. */
|
|
108
94
|
navigate(direction: 'back' | 'forward'): boolean;
|
|
109
95
|
private _insert;
|
|
110
|
-
/** The state's id for a page element, or `null` when it is not one of ours. */
|
|
111
96
|
private _idOf;
|
|
112
|
-
/** Make the DOM order match the model order, and drop slots whose page is gone. */
|
|
113
97
|
private _syncTrack;
|
|
114
98
|
/**
|
|
115
|
-
* Put the scroll offset back where the model says it is, instantly.
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* and would keep its old offset, showing the newly-inserted page instead. GTK
|
|
121
|
-
* gets this for free because the same allocation that adds the child also
|
|
122
|
-
* lays it out; here it takes one write.
|
|
99
|
+
* Put the scroll offset back where the model says it is, instantly. A page revealed
|
|
100
|
+
* at or before the current one moves the position with it (`shift_position`)
|
|
101
|
+
* precisely so the page on screen does not slide sideways — but a scroll container
|
|
102
|
+
* keeps its old offset and would show the newly-inserted page instead. GTK gets this
|
|
103
|
+
* from the allocation that adds the child; here it takes one write.
|
|
123
104
|
*/
|
|
124
105
|
private _applyScrollFromModel;
|
|
125
106
|
/**
|
|
126
107
|
* `allow-long-swipes` in CSS: `scroll-snap-stop: always` forces the scroll to
|
|
127
108
|
* stop at every page, which is exactly what the property being FALSE means —
|
|
128
|
-
* "each swipe can only move to the adjacent pages"
|
|
109
|
+
* "each swipe can only move to the adjacent pages".
|
|
129
110
|
*/
|
|
130
111
|
private _applySnapStop;
|
|
131
|
-
/** The px pitch between two page origins — `self->distance
|
|
112
|
+
/** The px pitch between two page origins — `self->distance`. */
|
|
132
113
|
private _distance;
|
|
133
|
-
/** Run the scroll the state asked for, in the track's own scroll coordinates. */
|
|
134
114
|
private _performScroll;
|
|
135
115
|
private _onScroll;
|
|
136
116
|
private _onWheel;
|
|
137
117
|
private _updatePositionFromScroll;
|
|
138
118
|
private _onStateChange;
|
|
139
119
|
}
|
|
140
|
-
/** Shared base for the dot / line indicator elements. */
|
|
141
120
|
declare abstract class AdwCarouselIndicator extends HTMLElement {
|
|
142
121
|
protected _carousel: CarouselHost | null;
|
|
143
122
|
protected _initialized: boolean;
|
|
@@ -8,24 +8,19 @@ declare abstract class AdwCheckBase extends HTMLElement {
|
|
|
8
8
|
protected abstract get inputType(): 'checkbox' | 'radio';
|
|
9
9
|
/** What a click / Space / arrow key on the control means for this kind. */
|
|
10
10
|
protected abstract activate(): void;
|
|
11
|
-
/** Whether the control is checked. */
|
|
12
11
|
get checked(): boolean;
|
|
13
12
|
set checked(value: boolean);
|
|
14
13
|
/** Whether the control is in the third, inconsistent state. */
|
|
15
14
|
get indeterminate(): boolean;
|
|
16
15
|
set indeterminate(value: boolean);
|
|
17
|
-
/** Whether the control is inert. */
|
|
18
16
|
get disabled(): boolean;
|
|
19
17
|
set disabled(value: boolean);
|
|
20
|
-
/** The label text beside the indicator. */
|
|
21
18
|
get label(): string;
|
|
22
19
|
set label(value: string);
|
|
23
20
|
connectedCallback(): void;
|
|
24
21
|
disconnectedCallback(): void;
|
|
25
22
|
attributeChangedCallback(name: string): void;
|
|
26
|
-
/** Extra wiring for a subclass on connect. */
|
|
27
23
|
protected onConnected(): void;
|
|
28
|
-
/** Extra teardown for a subclass on disconnect. */
|
|
29
24
|
protected onDisconnected(): void;
|
|
30
25
|
protected render(): void;
|
|
31
26
|
}
|
|
@@ -40,12 +35,11 @@ export declare class AdwRadio extends AdwCheckBase {
|
|
|
40
35
|
private _unsubscribe;
|
|
41
36
|
static get observedAttributes(): string[];
|
|
42
37
|
protected get inputType(): 'radio';
|
|
43
|
-
/** The group this member belongs to. */
|
|
44
38
|
get name(): string;
|
|
45
39
|
set name(value: string);
|
|
46
40
|
/**
|
|
47
|
-
* This member's value. Falls back to the label text so a group authored
|
|
48
|
-
*
|
|
41
|
+
* This member's value. Falls back to the label text so a group authored without
|
|
42
|
+
* values still has members the group state can tell apart.
|
|
49
43
|
*/
|
|
50
44
|
get value(): string;
|
|
51
45
|
set value(value: string);
|
|
@@ -12,13 +12,13 @@ export declare class AdwComboRow extends HTMLElement {
|
|
|
12
12
|
connectedCallback(): void;
|
|
13
13
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
14
14
|
/**
|
|
15
|
-
* `model_changed
|
|
16
|
-
*
|
|
15
|
+
* `model_changed`: one option or none is not a choice, so the arrow goes and the row
|
|
16
|
+
* stops being activatable.
|
|
17
17
|
*
|
|
18
|
-
* Both halves have to be expressed
|
|
19
|
-
* `.adw-row-value::after` mask in the stylesheet, and DISABLING the overlaid
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* Both halves have to be expressed — `data-presents-chooser` gates the
|
|
19
|
+
* `.adw-row-value::after` mask in the stylesheet, and DISABLING the overlaid `<select>`
|
|
20
|
+
* is what makes the row inert. Hiding the arrow alone leaves a row that still opens a
|
|
21
|
+
* one-entry popup on click.
|
|
22
22
|
*/
|
|
23
23
|
private _syncChooser;
|
|
24
24
|
private _renderText;
|
|
@@ -8,16 +8,13 @@ export declare class AdwDataGrid extends HTMLElement {
|
|
|
8
8
|
private _rows;
|
|
9
9
|
private _initialized;
|
|
10
10
|
static get observedAttributes(): string[];
|
|
11
|
-
/** The column descriptors. Setting rebuilds the grid. */
|
|
12
11
|
get columns(): AdwDataGridColumn[];
|
|
13
12
|
set columns(value: ReadonlyArray<AdwDataGridColumn>);
|
|
14
|
-
/** The row objects. Setting rebuilds the body. */
|
|
15
13
|
get rows(): AdwDataGridRow[];
|
|
16
14
|
set rows(value: ReadonlyArray<AdwDataGridRow>);
|
|
17
15
|
/** The optional grid caption/title (reflected to the attribute). */
|
|
18
16
|
get caption(): string;
|
|
19
17
|
set caption(value: string);
|
|
20
|
-
/** Whether every `normal` row is clickable (element-level flag). */
|
|
21
18
|
get interactive(): boolean;
|
|
22
19
|
set interactive(value: boolean);
|
|
23
20
|
connectedCallback(): void;
|
|
@@ -25,13 +22,11 @@ export declare class AdwDataGrid extends HTMLElement {
|
|
|
25
22
|
private _parseJsonAttr;
|
|
26
23
|
private _renderCaption;
|
|
27
24
|
/**
|
|
28
|
-
* The CSS `grid-template-columns` value derived from the column descriptors.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* `0px` must keep its unit to round-trip through the CSSOM — is
|
|
34
|
-
* `dataGridTrackTemplate`.
|
|
25
|
+
* The CSS `grid-template-columns` value derived from the column descriptors. The
|
|
26
|
+
* DERIVATION is core's (`dataGridTracks`), because NativeScript needs the same one for
|
|
27
|
+
* its `ItemSpec`s and can do nothing with a CSS string; the mapping onto CSS text —
|
|
28
|
+
* including the `minmax(0px, 1fr)` slack track whose `0px` must keep its unit to
|
|
29
|
+
* round-trip through the CSSOM — is `dataGridTrackTemplate`.
|
|
35
30
|
*/
|
|
36
31
|
private _trackTemplate;
|
|
37
32
|
private _columnClasses;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import './adw-popover.js';
|
|
2
2
|
import type { AdwComboOption, AdwComboOptionInput } from '@gjsify/adwaita-core';
|
|
3
3
|
/**
|
|
4
|
-
* A dropdown option — `value` is the stable id, `label` the shown text.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* the same selection model behind two chromes, and they had two names for one
|
|
8
|
-
* descriptor. Kept exported so the published type name does not break.
|
|
4
|
+
* A dropdown option — `value` is the stable id, `label` the shown text. An alias of
|
|
5
|
+
* core's {@link AdwComboOption}, since the drop-down and the combo row are the same
|
|
6
|
+
* selection model behind two chromes; still exported so the published name keeps working.
|
|
9
7
|
*/
|
|
10
8
|
export type AdwDropDownOption = AdwComboOption;
|
|
11
9
|
export declare class AdwDropDown extends HTMLElement {
|
|
@@ -24,7 +22,6 @@ export declare class AdwDropDown extends HTMLElement {
|
|
|
24
22
|
/** The options list. Setting it rebuilds the popover and clamps the selection. */
|
|
25
23
|
get options(): AdwDropDownOption[];
|
|
26
24
|
set options(value: ReadonlyArray<AdwComboOptionInput>);
|
|
27
|
-
/** Alias of `options` (Gtk.DropDown's model is often called "items"). */
|
|
28
25
|
get items(): AdwDropDownOption[];
|
|
29
26
|
set items(value: ReadonlyArray<AdwComboOptionInput>);
|
|
30
27
|
/** The selected index. Out-of-range values are ignored (Gtk.DropDown:selected). */
|
|
@@ -33,12 +30,9 @@ export declare class AdwDropDown extends HTMLElement {
|
|
|
33
30
|
/** The selected option's value, or '' when empty (Gtk.DropDown:selected-item). */
|
|
34
31
|
get selectedValue(): string;
|
|
35
32
|
set selectedValue(value: string);
|
|
36
|
-
/** The selected option descriptor, or null when empty. */
|
|
37
33
|
get selectedItem(): AdwDropDownOption | null;
|
|
38
|
-
/** Whether the search entry is shown in the popover. */
|
|
39
34
|
get enableSearch(): boolean;
|
|
40
35
|
set enableSearch(value: boolean);
|
|
41
|
-
/** Whether the popover is currently open. */
|
|
42
36
|
get active(): boolean;
|
|
43
37
|
connectedCallback(): void;
|
|
44
38
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
@@ -48,9 +42,7 @@ export declare class AdwDropDown extends HTMLElement {
|
|
|
48
42
|
private _onButtonKeyDown;
|
|
49
43
|
/** Printable keys inside an OPEN popover, when there is no search entry to type into. */
|
|
50
44
|
private _onPopoverTypeAhead;
|
|
51
|
-
/** Type-ahead: accumulate keys, focus/select the next matching option. */
|
|
52
45
|
private _typeAhead;
|
|
53
|
-
/** Filter the visible items by a search query (case-insensitive substring). */
|
|
54
46
|
private _filter;
|
|
55
47
|
private _visibleItems;
|
|
56
48
|
private _renderAll;
|