@gjsify/adwaita-nativescript 0.35.0 → 0.37.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/lib/types/widgets/adw-action-row.d.ts +27 -43
- package/lib/types/widgets/adw-data-grid.d.ts +4 -10
- package/lib/types/widgets/adw-entry-row.d.ts +20 -29
- package/lib/types/widgets/button-content.d.ts +12 -21
- package/lib/types/widgets/carousel-state.d.ts +15 -18
- package/lib/types/widgets/chrome.d.ts +22 -47
- package/lib/types/widgets/data-grid-model.d.ts +25 -36
- package/lib/types/widgets/navigation-stack.d.ts +2 -13
- package/lib/types/widgets/preferences-group-state.d.ts +7 -13
- package/lib/types/widgets/preferences-search.d.ts +5 -5
- package/lib/types/widgets/row-state.d.ts +17 -33
- package/lib/types/widgets/sidebar-model.d.ts +5 -7
- package/lib/types/widgets/split-button.d.ts +17 -34
- package/lib/types/widgets/split-view-base.d.ts +17 -24
- package/lib/types/widgets/split-view-state.d.ts +48 -76
- package/lib/types/widgets/split-view-width.d.ts +21 -32
- package/lib/types/widgets/status-page-content.d.ts +9 -14
- package/lib/types/widgets/tab-view-state.d.ts +18 -34
- package/lib/types/widgets/view-switcher-base.d.ts +11 -30
- package/lib/types/widgets/view-switcher-model.d.ts +17 -34
- package/lib/types/widgets/wrap-box-layout.d.ts +22 -37
- package/package.json +7 -7
|
@@ -4,64 +4,49 @@ import { ActionRowState } from './row-state.js';
|
|
|
4
4
|
export declare const ACTIVATED = "activated";
|
|
5
5
|
export declare class AdwActionRow extends GridLayout {
|
|
6
6
|
/**
|
|
7
|
-
* Whether libadwaita would answer `ADW_IS_ACTION_ROW` for this row
|
|
8
|
-
*
|
|
9
|
-
* (`filter_search_results`, adw-preferences-dialog.c:140-146).
|
|
7
|
+
* Whether libadwaita would answer `ADW_IS_ACTION_ROW` for this row, which decides
|
|
8
|
+
* whether the preferences SEARCH consults its subtitle.
|
|
10
9
|
*
|
|
11
|
-
* A declared property, not an `instanceof` test, because this port's class
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* override this to `false`, so the search behaves as GTK does.
|
|
10
|
+
* A declared property, not an `instanceof` test, because this port's class tree
|
|
11
|
+
* deliberately does NOT match the GObject one: `AdwEntryRow`, `AdwExpanderRow`
|
|
12
|
+
* and `AdwButtonRow` extend this class to reuse the row chrome, while in C all
|
|
13
|
+
* three derive from `AdwPreferencesRow`. They override this to `false`, so the
|
|
14
|
+
* search behaves as GTK does.
|
|
17
15
|
*/
|
|
18
16
|
readonly isActionRow: boolean;
|
|
19
17
|
/** The text/value column (column 1). */
|
|
20
18
|
protected readonly _textStack: StackLayout;
|
|
21
|
-
/** The title label. */
|
|
22
19
|
protected readonly _titleLabel: Label;
|
|
23
|
-
/** The subtitle label. */
|
|
24
20
|
protected readonly _subtitleLabel: Label;
|
|
25
21
|
/** The headless labels + activatable-widget coupling (ADR 0004). */
|
|
26
22
|
protected readonly _rowState: ActionRowState<View>;
|
|
27
|
-
/** The currently-installed prefix view (column 0), if any. */
|
|
28
23
|
private _prefix;
|
|
29
|
-
/** The currently-installed suffix view (column 2), if any. */
|
|
30
24
|
private _suffix;
|
|
31
25
|
constructor();
|
|
32
|
-
/**
|
|
33
|
-
* Install a prefix widget in column 0 (e.g. an `AdwIcon` symbolic icon).
|
|
34
|
-
* Replaces any previously-installed prefix. Pass `null` to clear it.
|
|
35
|
-
*/
|
|
26
|
+
/** Install a prefix widget in column 0. Replaces any previous one; `null` clears. */
|
|
36
27
|
setPrefix(view: View | null): void;
|
|
37
|
-
/** The currently-installed prefix view, or `null`. */
|
|
38
28
|
get prefix(): View | null;
|
|
39
29
|
/** The row title (column 1, top line). */
|
|
40
30
|
get title(): string;
|
|
41
31
|
set title(value: string);
|
|
42
32
|
/**
|
|
43
|
-
* The row subtitle (column 1, dim second line).
|
|
44
|
-
*
|
|
45
|
-
* the title now follows.
|
|
33
|
+
* The row subtitle (column 1, dim second line). Empty collapses its label so it
|
|
34
|
+
* leaves no blank gap — `string_is_not_empty`, the rule the title follows too.
|
|
46
35
|
*/
|
|
47
36
|
get subtitle(): string;
|
|
48
37
|
set subtitle(value: string);
|
|
49
|
-
/**
|
|
50
|
-
* Install a suffix widget in column 2 (e.g. a `Switch`, `Button`, or icon).
|
|
51
|
-
* Replaces any previously-installed suffix. Pass `null` to clear it.
|
|
52
|
-
*/
|
|
38
|
+
/** Install a suffix widget in column 2. Replaces any previous one; `null` clears. */
|
|
53
39
|
setSuffix(view: View | null): void;
|
|
54
|
-
/** The currently-installed suffix view, or `null`. */
|
|
55
40
|
get suffix(): View | null;
|
|
56
41
|
/** `Adw.ActionRow:activatable-widget` — the widget this row activates. */
|
|
57
42
|
get activatableWidget(): View | null;
|
|
58
43
|
/**
|
|
59
|
-
* Set the activatable widget. Its sensitivity is copied into `activatable
|
|
60
|
-
*
|
|
61
|
-
*
|
|
44
|
+
* Set the activatable widget. Its sensitivity is copied into `activatable`;
|
|
45
|
+
* clearing it LEAVES the row activatable. Call
|
|
46
|
+
* {@link syncActivatableWidgetSensitivity} when the widget's
|
|
62
47
|
* `isUserInteractionEnabled` changes — NativeScript has no property-change
|
|
63
|
-
* notification a plain `View` write goes through, so the live half of the
|
|
64
|
-
*
|
|
48
|
+
* notification a plain `View` write goes through, so the live half of the binding
|
|
49
|
+
* has to be driven, not observed.
|
|
65
50
|
*/
|
|
66
51
|
set activatableWidget(widget: View | null);
|
|
67
52
|
/** Re-read the activatable widget's sensitivity — the live half of the binding. */
|
|
@@ -70,24 +55,23 @@ export declare class AdwActionRow extends GridLayout {
|
|
|
70
55
|
get activatable(): boolean;
|
|
71
56
|
set activatable(value: boolean);
|
|
72
57
|
/**
|
|
73
|
-
* `adw_action_row_activate
|
|
74
|
-
*
|
|
75
|
-
*
|
|
58
|
+
* `adw_action_row_activate`: forward to the activatable widget, then emit
|
|
59
|
+
* `activated`. A no-op while unactivatable, because a tap on a non-activatable
|
|
60
|
+
* `GtkListBoxRow` never reaches here.
|
|
76
61
|
*
|
|
77
|
-
* FORWARDING IS SUBCLASS BUSINESS
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
62
|
+
* FORWARDING IS SUBCLASS BUSINESS here: GTK sends `mnemonic-activate` and every
|
|
63
|
+
* widget knows what that means for itself, while NativeScript has no such
|
|
64
|
+
* primitive on `View` — so `AdwSwitchRow` overrides this to toggle its slider and
|
|
65
|
+
* a plain action row only emits.
|
|
81
66
|
*/
|
|
82
67
|
activate(): void;
|
|
83
68
|
/**
|
|
84
69
|
* Whether this row's own title visibility follows `string_is_not_empty`.
|
|
85
70
|
*
|
|
86
|
-
* `AdwEntryRow` sets it `false`: its two titles are the endpoints of
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* the small floating label on top of the large placeholder.
|
|
71
|
+
* `AdwEntryRow` sets it `false`: its two titles are the endpoints of libadwaita's
|
|
72
|
+
* empty↔filled CROSS-FADE, so which shows is decided by `emptyTarget`, not by
|
|
73
|
+
* whether the string is empty. Without the opt-out, setting a title on an entry
|
|
74
|
+
* row reveals the small floating label on top of the large placeholder.
|
|
91
75
|
*/
|
|
92
76
|
protected _managesTitleVisibility: boolean;
|
|
93
77
|
/** Push the derived label text + visibility onto the two `Label`s. */
|
|
@@ -6,7 +6,6 @@ export declare const ROW_ACTIVATED = "row-activated";
|
|
|
6
6
|
export interface RowActivatedEventData extends EventData {
|
|
7
7
|
/** The row's index in the `rows` array. */
|
|
8
8
|
index: number;
|
|
9
|
-
/** The row object that was activated. */
|
|
10
9
|
row: AdwDataGridRow;
|
|
11
10
|
}
|
|
12
11
|
export declare class AdwDataGrid extends GridLayout {
|
|
@@ -42,18 +41,13 @@ export declare class AdwDataGrid extends GridLayout {
|
|
|
42
41
|
* (Re)declare the column tracks from the descriptors.
|
|
43
42
|
*
|
|
44
43
|
* Guarded on the derived tracks rather than run on every render: re-declaring
|
|
45
|
-
* invalidates the layout, and a data change must not move the columns.
|
|
46
|
-
* precedent is `AdwViewSwitcherBar`, which rebuilds only when the page count
|
|
47
|
-
* moves; the key generalises that, because a column list can change without
|
|
48
|
-
* changing length (`data-grid-model.ts` says why).
|
|
44
|
+
* invalidates the layout, and a data change must not move the columns.
|
|
49
45
|
*/
|
|
50
46
|
private _syncColumns;
|
|
51
47
|
/**
|
|
52
|
-
* Rebuild the cell views when the grid's SHAPE moves, and only then
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* every data update is what the view-switcher bar's count guard exists to
|
|
56
|
-
* avoid, and here it would also drop the press state mid-touch.
|
|
48
|
+
* Rebuild the cell views when the grid's SHAPE moves, and only then — replacing
|
|
49
|
+
* the row under the user's finger on every data update would drop the press
|
|
50
|
+
* state mid-touch.
|
|
57
51
|
*/
|
|
58
52
|
private _syncNodes;
|
|
59
53
|
/** Build one row: the spanning background first, then a cell per column. */
|
|
@@ -7,15 +7,14 @@ export { EntryRowState } from '@gjsify/adwaita-core';
|
|
|
7
7
|
export type { EntryRowRenderState, EntryRowActivation } from '@gjsify/adwaita-core';
|
|
8
8
|
/** Event name emitted when {@link AdwEntryRow.text} changes. Mirrors GObject `notify::text`. */
|
|
9
9
|
export declare const NOTIFY_TEXT = "notify::text";
|
|
10
|
-
/** Event name emitted when the character count changes
|
|
10
|
+
/** Event name emitted when the character count changes. */
|
|
11
11
|
export declare const NOTIFY_TEXT_LENGTH = "notify::text-length";
|
|
12
|
-
/**
|
|
12
|
+
/** `AdwEntryRow::apply` — the apply button, or the return key while it shows. */
|
|
13
13
|
export declare const SIGNAL_APPLY = "apply";
|
|
14
|
-
/**
|
|
14
|
+
/** `AdwEntryRow::entry-activated` — the return key when there is nothing to apply. */
|
|
15
15
|
export declare const SIGNAL_ENTRY_ACTIVATED = "entry-activated";
|
|
16
16
|
/** Payload of the `notify::text` event. */
|
|
17
17
|
export interface NotifyTextEventData extends EventData {
|
|
18
|
-
/** The new text value. */
|
|
19
18
|
text: string;
|
|
20
19
|
}
|
|
21
20
|
/** Payload of the `notify::text-length` event. */
|
|
@@ -26,15 +25,15 @@ export interface NotifyTextLengthEventData extends EventData {
|
|
|
26
25
|
/** Payload of the `entry-activated` event. */
|
|
27
26
|
export interface EntryActivatedEventData extends EventData {
|
|
28
27
|
/**
|
|
29
|
-
* Whether the host must activate its default action FIRST —
|
|
30
|
-
* `gtk_widget_activate_default`
|
|
31
|
-
*
|
|
28
|
+
* Whether the host must activate its default action FIRST — C calls
|
|
29
|
+
* `gtk_widget_activate_default` before emitting, and NS has no default-widget
|
|
30
|
+
* concept, so the ordering becomes the host's.
|
|
32
31
|
*/
|
|
33
32
|
activateDefault: boolean;
|
|
34
33
|
}
|
|
35
34
|
export declare class AdwEntryRow extends AdwActionRow {
|
|
36
|
-
/** `AdwEntryRow` derives from `AdwPreferencesRow` in C
|
|
37
|
-
*
|
|
35
|
+
/** `AdwEntryRow` derives from `AdwPreferencesRow` in C, so the preferences search
|
|
36
|
+
* must NOT read the text typed into it. */
|
|
38
37
|
readonly isActionRow: boolean;
|
|
39
38
|
/** The headless `update_empty` derivation + apply latch (ADR 0004). */
|
|
40
39
|
protected readonly _state: EntryRowState;
|
|
@@ -48,7 +47,6 @@ export declare class AdwEntryRow extends AdwActionRow {
|
|
|
48
47
|
protected readonly _editIcon: AdwIcon;
|
|
49
48
|
/** The caps-lock warning slot (`indicator`). */
|
|
50
49
|
protected readonly _indicator: AdwIcon;
|
|
51
|
-
/** The apply button. */
|
|
52
50
|
protected readonly _applyButton: AdwImageButton;
|
|
53
51
|
/** The suffix installed through the inherited single-slot {@link setSuffix}. */
|
|
54
52
|
private _slotSuffix;
|
|
@@ -74,36 +72,29 @@ export declare class AdwEntryRow extends AdwActionRow {
|
|
|
74
72
|
set activatesDefault(value: boolean);
|
|
75
73
|
/** Whether the field currently has focus. */
|
|
76
74
|
get editing(): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Append a suffix — `adw_entry_row_add_suffix` (adw-entry-row.c:885-899),
|
|
79
|
-
* which appends into a BOX so suffixes COEXIST.
|
|
80
|
-
*/
|
|
75
|
+
/** Append a suffix — `adw_entry_row_add_suffix` appends into a BOX, so suffixes COEXIST. */
|
|
81
76
|
addSuffix(view: View): void;
|
|
82
77
|
/**
|
|
83
|
-
* The inherited single-slot API,
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* `
|
|
87
|
-
*
|
|
88
|
-
* while `_peekButton` kept pointing at the detached view, so the row could
|
|
89
|
-
* never be revealed again. Upstream has no such conflict because there is no
|
|
90
|
-
* single slot: `add_suffix` appends.
|
|
78
|
+
* The inherited single-slot API, narrowed to replace only the suffix a previous
|
|
79
|
+
* `setSuffix` installed. `AdwActionRow.setSuffix` removes whatever sits in the
|
|
80
|
+
* slot, which would detach the password row's own peek toggle — leaving
|
|
81
|
+
* `_peekButton` pointing at a detached view, so the row could never be revealed
|
|
82
|
+
* again. Upstream has no such conflict: `add_suffix` appends.
|
|
91
83
|
*/
|
|
92
84
|
setSuffix(view: View | null): void;
|
|
93
85
|
/** The suffix installed through {@link setSuffix}, or `null`. */
|
|
94
86
|
get suffix(): View | null;
|
|
95
87
|
/**
|
|
96
|
-
* Drive the trailing indicator — `adw_entry_row_set_show_indicator
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* into a private header.
|
|
88
|
+
* Drive the trailing indicator — `adw_entry_row_set_show_indicator`. Private to
|
|
89
|
+
* the library upstream, public here because `AdwPasswordEntryRow` composes rather
|
|
90
|
+
* than reaching into a private header.
|
|
100
91
|
*/
|
|
101
92
|
setShowIndicator(show: boolean): void;
|
|
102
|
-
/** `adw_entry_row_set_indicator_icon_name
|
|
93
|
+
/** `adw_entry_row_set_indicator_icon_name`, as an Adwaita symbolic SVG. */
|
|
103
94
|
setIndicatorIcon(svg: string): void;
|
|
104
|
-
/** Apply the pending edit — the apply button tap
|
|
95
|
+
/** Apply the pending edit — the apply button tap. */
|
|
105
96
|
apply(): void;
|
|
106
|
-
/** `text_activated_cb`
|
|
97
|
+
/** `text_activated_cb` — exactly one of the two signals. */
|
|
107
98
|
private _activate;
|
|
108
99
|
/** Paint one render snapshot through the shared (spec-driven) painter. */
|
|
109
100
|
protected _render(state: EntryRowRenderState): void;
|
|
@@ -6,38 +6,29 @@ export type { ButtonContentEllipsize };
|
|
|
6
6
|
export declare const BUTTON_CONTENT_CAN_SHRINK_CLASS = "can-shrink";
|
|
7
7
|
/**
|
|
8
8
|
* The SVG the icon view is given: the app's, or the `image-missing` asset for an
|
|
9
|
-
* empty slot
|
|
9
|
+
* empty slot — the fallback `init` applies too, while `icon_name` is still `""`.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* (
|
|
15
|
-
* swaps its source, which is the same shape as the C. The doc comments at :228
|
|
16
|
-
* and :343 claim the icon is hidden instead; the code disagrees with them and
|
|
17
|
-
* this follows the code (see the conformance vector's `rule`).
|
|
11
|
+
* The C NEVER hides the image, only the label, so this port keeps the icon view
|
|
12
|
+
* parented at all times and swaps its source. Upstream's own doc comments claim the
|
|
13
|
+
* icon is hidden instead; the code disagrees with them and this follows the code
|
|
14
|
+
* (see the conformance vector's `rule`).
|
|
18
15
|
*/
|
|
19
16
|
export declare function buttonContentIconSvg(svg: string): string;
|
|
20
17
|
/** Whether the icon shown is the empty-slot fallback rather than an app asset. */
|
|
21
18
|
export declare function buttonContentIconIsFallback(svg: string): boolean;
|
|
22
19
|
/**
|
|
23
|
-
* The parent button's `className` with `image-text-button` added — the root-time
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* Adds rather than rewrites, so the `adw-button suggested-action pill` a caller
|
|
27
|
-
* composed survives; and it is idempotent, so a re-parent cannot double the
|
|
28
|
-
* token.
|
|
20
|
+
* The parent button's `className` with `image-text-button` added — the root-time half
|
|
21
|
+
* of `adw_button_content_root`. Adds rather than rewrites, so a caller's composed
|
|
22
|
+
* classes survive, and is idempotent, so a re-parent cannot double the token.
|
|
29
23
|
*/
|
|
30
24
|
export declare function buttonContentRootedParentClassName(current: string): string;
|
|
31
25
|
/**
|
|
32
|
-
* The parent button's `className` with `image-text-button` removed — the unroot
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* The C removes it on unroot rather than leaving it behind, so a button that
|
|
36
|
-
* loses its content goes back to plain-button padding. A port that only ever
|
|
37
|
-
* added the class would leave the 9px on a button that is now text-only.
|
|
26
|
+
* The parent button's `className` with `image-text-button` removed — the unroot half.
|
|
27
|
+
* A button that loses its content must go back to plain-button padding, or the 9px
|
|
28
|
+
* stays on a now text-only button.
|
|
38
29
|
*/
|
|
39
30
|
export declare function buttonContentUnrootedParentClassName(current: string): string;
|
|
40
|
-
/** The label view's `visibility` — NS's spelling of `gtk_widget_set_visible
|
|
31
|
+
/** The label view's `visibility` — NS's spelling of `gtk_widget_set_visible`. */
|
|
41
32
|
export declare function buttonContentLabelVisibility(label: string): 'visible' | 'collapse';
|
|
42
33
|
/** The content's own `className` for a `can-shrink` value, other tokens untouched. */
|
|
43
34
|
export declare function buttonContentClassName(current: string, canShrink: boolean): string;
|
|
@@ -2,10 +2,9 @@ import type { Label } from '@nativescript/core';
|
|
|
2
2
|
import { CarouselState } from '@gjsify/adwaita-core';
|
|
3
3
|
import type { CarouselScrollRequest, CarouselStateChange } from '@gjsify/adwaita-core';
|
|
4
4
|
/**
|
|
5
|
-
* Default page width (DIPs)
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* default keeps the offsets sane until the consumer supplies the real one.
|
|
5
|
+
* Default page width (DIPs) for the offset math until the consumer sets `pageWidth`.
|
|
6
|
+
* libadwaita MEASURES its pages; NS gives a widget no size before its first layout
|
|
7
|
+
* pass, so a plausible phone width keeps the offsets sane until then.
|
|
9
8
|
*/
|
|
10
9
|
export declare const DEFAULT_CAROUSEL_PAGE_WIDTH = 320;
|
|
11
10
|
/** Construction seams an `AdwCarousel` hands to its state machine. */
|
|
@@ -18,31 +17,29 @@ export interface NsCarouselStateOptions {
|
|
|
18
17
|
/**
|
|
19
18
|
* The state machine an `AdwCarousel` delegates to.
|
|
20
19
|
*
|
|
21
|
-
* `animateScroll` is FALSE: the `ScrollView` animates the pixels
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* {@link CarouselScrollSync} is what keeps the two from fighting.
|
|
20
|
+
* `animateScroll` is FALSE: the `ScrollView` animates the pixels but reports nothing
|
|
21
|
+
* until it has, and on an untested platform it may report nothing at all. Keeping the
|
|
22
|
+
* model authoritative makes a `scrollToPage` correct the instant it is called;
|
|
23
|
+
* {@link CarouselScrollSync} keeps the two from fighting.
|
|
26
24
|
*/
|
|
27
25
|
export declare function createCarouselState(options?: NsCarouselStateOptions): CarouselState;
|
|
28
26
|
/** A page width that can be divided by — anything else falls back to the default. */
|
|
29
27
|
export declare function normalizeCarouselPageWidth(value: number): number;
|
|
30
|
-
/** The horizontal scroll offset in DIPs for a position — `distance * position
|
|
28
|
+
/** The horizontal scroll offset in DIPs for a position — `distance * position`. */
|
|
31
29
|
export declare function carouselScrollOffset(position: number, distance: number): number;
|
|
32
30
|
/** The inverse: the position a `ScrollView` at `offset` is showing. */
|
|
33
31
|
export declare function carouselPositionAtOffset(offset: number, distance: number): number;
|
|
34
32
|
/**
|
|
35
33
|
* Keeps the model in step with a `ScrollView` that animates its own scrolls.
|
|
36
34
|
*
|
|
37
|
-
* Without this the two fight: the widget moves the model the moment
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
35
|
+
* Without this the two fight: the widget moves the model the moment `scrollToPage`
|
|
36
|
+
* is called, then the animation replays every intermediate offset back at it, so the
|
|
37
|
+
* dots run backwards to where the scroll STARTED and crawl forward again, emitting a
|
|
38
|
+
* second `page-changed` on arrival.
|
|
41
39
|
*
|
|
42
|
-
* So a programmatic scroll declares its destination with {@link expect}
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* fractional position at all, something the port had no way to observe.
|
|
40
|
+
* So a programmatic scroll declares its destination with {@link expect} and every
|
|
41
|
+
* offset before it is ignored. A scroll nobody declared is a user swipe and drives the
|
|
42
|
+
* model directly — which is how a free flick gets a fractional position.
|
|
46
43
|
*/
|
|
47
44
|
export declare class CarouselScrollSync {
|
|
48
45
|
/** Position a programmatic scroll is animating towards, `null` while idle. */
|
|
@@ -17,10 +17,8 @@ export declare function defaultClampProps(): ClampProps;
|
|
|
17
17
|
/**
|
|
18
18
|
* Normalise one clamp property, keeping a nonsense value out of the layout.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* default), a non-numeric value (never reaches the layout, so the DEFAULT
|
|
23
|
-
* applies), and a negative (clamped to the range floor).
|
|
20
|
+
* The three inputs worth knowing: `0` is valid and NOT the default, a non-numeric
|
|
21
|
+
* value falls back to the DEFAULT, a negative is clamped to the range floor.
|
|
24
22
|
*/
|
|
25
23
|
export declare function normalizeClampProp(value: number | string | null | undefined, fallback: number): number;
|
|
26
24
|
/** What one clamp layout pass tells the widget to do with its child. */
|
|
@@ -37,55 +35,41 @@ export interface ClampAllocationForWidth {
|
|
|
37
35
|
/**
|
|
38
36
|
* The child width and size class for a clamp `availableWidth` DIPs wide.
|
|
39
37
|
*
|
|
40
|
-
* `availableWidth <= 0` means NativeScript has not laid the view out yet
|
|
41
|
-
* reports a zero size before the first pass
|
|
42
|
-
*
|
|
43
|
-
* Anything else runs libadwaita's curve, so a narrow container yields a narrow
|
|
44
|
-
* child rather than the maximum.
|
|
38
|
+
* `availableWidth <= 0` means NativeScript has not laid the view out yet (it
|
|
39
|
+
* reports a zero size before the first pass), and the honest answer there is "do
|
|
40
|
+
* not constrain" — the same shape `sidebarWidthFor` uses for the same reason.
|
|
45
41
|
*
|
|
46
42
|
* `childMin`/`childNat` are 0: NativeScript does not expose a child's measured
|
|
47
43
|
* minimum before layout, and `lower = MAX (…, child_min)` only ever RAISES the
|
|
48
|
-
* child's width — an NS child
|
|
49
|
-
*
|
|
44
|
+
* child's width — an NS child wider than the clamp already overflows rather than
|
|
45
|
+
* being cut, so nothing is lost by leaving it out.
|
|
50
46
|
*/
|
|
51
47
|
export declare function clampAllocationFor(availableWidth: number, props: ClampProps): ClampAllocationForWidth;
|
|
52
|
-
/**
|
|
53
|
-
* Default spinner diameter in DIPs — `Adw.Spinner`'s measured natural size,
|
|
54
|
-
* which equals its minimum (adw-spinner.c:78-81).
|
|
55
|
-
*
|
|
56
|
-
* Replaces an invented 32: nothing in libadwaita produces that number.
|
|
57
|
-
*/
|
|
48
|
+
/** Default spinner diameter in DIPs — `Adw.Spinner`'s natural size, which equals its minimum. */
|
|
58
49
|
export declare const DEFAULT_SPINNER_SIZE = 16;
|
|
59
50
|
/**
|
|
60
51
|
* The RING diameter for a requested BOX size — floored at the measured minimum
|
|
61
52
|
* 16 and capped at Adwaita's 64, with the odd-size flooring (`31` draws a 30 DIP
|
|
62
53
|
* ring) coming from the paintable rather than from here.
|
|
63
54
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
55
|
+
* Box and ring are deliberately different numbers: `AdwSpinner` sizes its BOX to
|
|
56
|
+
* the request and its `ActivityIndicator` to this, so `size = 200` occupies 200
|
|
57
|
+
* DIPs of layout around a 64 DIP ring.
|
|
67
58
|
*/
|
|
68
59
|
export declare function spinnerDiameter(value: number | string | null | undefined): number;
|
|
69
60
|
/** The four toolbar-view properties the style classes are derived from. */
|
|
70
61
|
export interface ToolbarViewProps {
|
|
71
|
-
/** `top-bar-style`. */
|
|
72
62
|
topBarStyle: AdwToolbarStyle;
|
|
73
|
-
/** `bottom-bar-style`. */
|
|
74
63
|
bottomBarStyle: AdwToolbarStyle;
|
|
75
|
-
/** `extend-content-to-top-edge`. */
|
|
76
64
|
extendContentToTopEdge: boolean;
|
|
77
|
-
/** `extend-content-to-bottom-edge`. */
|
|
78
65
|
extendContentToBottomEdge: boolean;
|
|
79
66
|
}
|
|
80
67
|
/** The property defaults a fresh toolbar view starts with. */
|
|
81
68
|
export declare function defaultToolbarViewProps(): ToolbarViewProps;
|
|
82
69
|
/** The three `className` strings a toolbar view distributes over its own node and its two bar boxes. */
|
|
83
70
|
export interface ToolbarViewClassNames {
|
|
84
|
-
/** `className` for the view. */
|
|
85
71
|
view: string;
|
|
86
|
-
/** `className` for the top-bar box. */
|
|
87
72
|
topBar: string;
|
|
88
|
-
/** `className` for the bottom-bar box. */
|
|
89
73
|
bottomBar: string;
|
|
90
74
|
}
|
|
91
75
|
/**
|
|
@@ -105,42 +89,33 @@ export declare function clampChildClassName(current: string, sizeClass: AdwClamp
|
|
|
105
89
|
export type BannerProps = AdwBannerProps;
|
|
106
90
|
/**
|
|
107
91
|
* The property defaults a fresh banner starts with — libadwaita's, not this
|
|
108
|
-
* port's.
|
|
109
|
-
*
|
|
110
|
-
* This is the whole reason the banner is here. `AdwBanner` used to initialise
|
|
111
|
-
* `_revealed = true` AND never write `visibility` in its constructor, so a
|
|
112
|
-
* banner put itself on screen on a device while the same markup stayed hidden in
|
|
113
|
-
* the browser. `Adw.Banner:revealed` defaults to FALSE (adw-banner.c:456-459) —
|
|
114
|
-
* "Banners are hidden by default" (:47) — and `use-markup` to TRUE (:422-425),
|
|
115
|
-
* which the port had backwards as well.
|
|
92
|
+
* port's. The two easy ones to get backwards: `Adw.Banner:revealed` defaults to
|
|
93
|
+
* FALSE (banners are hidden until revealed) and `use-markup` to TRUE.
|
|
116
94
|
*/
|
|
117
95
|
export declare function defaultBannerProps(): BannerProps;
|
|
118
96
|
/**
|
|
119
97
|
* The text the NS title `Label` is given.
|
|
120
98
|
*
|
|
121
|
-
* `Adw.Banner`'s title is Pango markup by default
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* Unparseable markup keeps the raw string, reproducing the C fallback that
|
|
126
|
-
* {@link stripMarkup} already models.
|
|
99
|
+
* `Adw.Banner`'s title is Pango markup by default and the NS CSS subset has no
|
|
100
|
+
* inline-markup layer, so the honest reduction is the markup's PLAIN TEXT:
|
|
101
|
+
* `<b>Metered</b>` reads `Metered`, where the raw string would paint the tags.
|
|
102
|
+
* Unparseable markup keeps the raw string, reproducing the C fallback.
|
|
127
103
|
*/
|
|
128
104
|
export declare function bannerTitleText(title: string, useMarkup: boolean): string;
|
|
129
105
|
/**
|
|
130
106
|
* The NS `visibility` for a `revealed` value.
|
|
131
107
|
*
|
|
132
|
-
* `Adw.Banner` reveals through a `GtkRevealer
|
|
133
|
-
*
|
|
134
|
-
*
|
|
108
|
+
* `Adw.Banner` reveals through a `GtkRevealer`; the NS subset has none, so
|
|
109
|
+
* `collapse` — which takes the view out of layout entirely — is the closest thing
|
|
110
|
+
* to a fully retracted one.
|
|
135
111
|
*/
|
|
136
112
|
export declare function bannerVisibility(revealed: boolean): 'visible' | 'collapse';
|
|
137
113
|
/**
|
|
138
114
|
* The `className` for the banner button — the managed `button-style` class
|
|
139
115
|
* swapped in, every other token left alone.
|
|
140
116
|
*
|
|
141
|
-
* `adw_banner_set_button_style` only ever adds or removes `suggested-action
|
|
142
|
-
*
|
|
143
|
-
* this.
|
|
117
|
+
* `adw_banner_set_button_style` only ever adds or removes `suggested-action`; it
|
|
118
|
+
* never rewrites the button's class list, and neither does this.
|
|
144
119
|
*/
|
|
145
120
|
export declare function bannerButtonClassName(current: string, style: AdwBannerButtonStyle): string;
|
|
146
121
|
/**
|
|
@@ -2,9 +2,8 @@ import type { AdwDataGridRowVariant, DataGridTrack } from '@gjsify/adwaita-core'
|
|
|
2
2
|
import type { GridUnitType } from '@nativescript/core';
|
|
3
3
|
/** The two numbers a NativeScript `ItemSpec` is constructed from. */
|
|
4
4
|
export interface DataGridItemSpec {
|
|
5
|
-
/**
|
|
5
|
+
/** A star weight, a pixel length, or 1 for `auto`. */
|
|
6
6
|
value: number;
|
|
7
|
-
/** The `GridUnitType` — `'star'`, `'pixel'` or `'auto'`. */
|
|
8
7
|
type: GridUnitType;
|
|
9
8
|
}
|
|
10
9
|
/** The class the header row's background carries. */
|
|
@@ -20,18 +19,15 @@ export declare const DATA_GRID_HEADER_CELL_CLASS = "header-cell";
|
|
|
20
19
|
* `DataGridTrack`'s `fixed` kind carries the author's `width` string verbatim,
|
|
21
20
|
* because only a CSS engine can resolve every unit CSS has. NativeScript has
|
|
22
21
|
* exactly one length unit — the DIP — and its own stylesheet subset writes it as
|
|
23
|
-
* a bare number (`min-height: 34
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* a bare number (`min-height: 34`), so BOTH `'80px'` and `'80'` are read as 80
|
|
23
|
+
* here and everything else (`6rem`, `50%`, `calc(...)`) falls back to a
|
|
24
|
+
* content-sized track.
|
|
26
25
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* A negative or non-finite length is rejected rather than clamped: `ItemSpec`
|
|
34
|
-
* refuses one, and a column silently pinned to 0 reads as a missing column.
|
|
26
|
+
* Accepting a bare number diverges from the browser deliberately, where `width:
|
|
27
|
+
* '80'` is not a valid CSS length and takes the whole `grid-template-columns`
|
|
28
|
+
* declaration down with it; falling back to `auto` for one column is the smaller
|
|
29
|
+
* failure. A negative or non-finite length is rejected rather than clamped:
|
|
30
|
+
* `ItemSpec` refuses one, and a column silently pinned to 0 reads as missing.
|
|
35
31
|
*/
|
|
36
32
|
export declare function parseDataGridWidth(css: string): number | null;
|
|
37
33
|
/**
|
|
@@ -54,14 +50,11 @@ export declare function dataGridItemSpec(track: DataGridTrack): DataGridItemSpec
|
|
|
54
50
|
/**
|
|
55
51
|
* A stable key for a track list — what the widget re-declares its columns on.
|
|
56
52
|
*
|
|
57
|
-
* The
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* keep painting against the old tracks. So the guard is the tracks themselves,
|
|
63
|
-
* which is a strict superset: whenever the count moves the key moves too, and a
|
|
64
|
-
* repaint (new rows, a toggled `interactive`) never touches the columns.
|
|
53
|
+
* The guard is the tracks themselves, not their COUNT: a column list can change
|
|
54
|
+
* without changing length (pinning a column's `width` on a narrow screen does
|
|
55
|
+
* exactly that) and a count guard would keep painting against the old tracks.
|
|
56
|
+
* Whenever the count moves the key moves too, and a repaint (new rows, a toggled
|
|
57
|
+
* `interactive`) never touches the columns.
|
|
65
58
|
*/
|
|
66
59
|
export declare function dataGridTracksKey(tracks: ReadonlyArray<DataGridTrack>): string;
|
|
67
60
|
/**
|
|
@@ -76,12 +69,12 @@ export declare function dataGridShapeKey(columnCount: number, rowCount: number):
|
|
|
76
69
|
/**
|
|
77
70
|
* The classes a data row's background carries.
|
|
78
71
|
*
|
|
79
|
-
* The row background is a NativeScript-only node
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
72
|
+
* The row background is a NativeScript-only node: the browser paints the fill, the
|
|
73
|
+
* hairline rules and the hover affordance on the row ELEMENT, which is a real
|
|
74
|
+
* element there because it is a subgrid. Here the cells are direct children of the
|
|
75
|
+
* one grid, so a full-width `StackLayout` placed first at the same row — below the
|
|
76
|
+
* cells, spanning every column — carries them plus the tap target and press
|
|
77
|
+
* feedback.
|
|
85
78
|
*
|
|
86
79
|
* `interactive` is a class rather than a widget flag so the press-darken keys off
|
|
87
80
|
* it: `attachRowPressFeedback` is wired on EVERY data row, and a non-interactive
|
|
@@ -91,14 +84,10 @@ export declare function dataGridRowClass(variant: AdwDataGridRowVariant, interac
|
|
|
91
84
|
/**
|
|
92
85
|
* The classes a body cell carries: its column's own, plus the row's variant.
|
|
93
86
|
*
|
|
94
|
-
* The variant is repeated onto the CELL because
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* `normal` adds nothing: it is every row in a statement but the handful that
|
|
101
|
-
* carry emphasis, and a class the stylesheet has no rule for is only noise in
|
|
102
|
-
* the one place a reader looks when the emphasis is wrong.
|
|
87
|
+
* The variant is repeated onto the CELL because the browser bolds a subtotal's
|
|
88
|
+
* figures with a DESCENDANT selector (`.variant-subtotal .adw-data-grid-cell`)
|
|
89
|
+
* while here cell and row background are SIBLINGS in one grid — the row class
|
|
90
|
+
* cannot reach the cells. `normal` adds nothing, since the stylesheet has no rule
|
|
91
|
+
* for it.
|
|
103
92
|
*/
|
|
104
93
|
export declare function dataGridCellClass(columnClasses: ReadonlyArray<string>, variant: AdwDataGridRowVariant): string;
|