@ng-desktop/platform 0.4.1 → 0.6.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/fesm2022/bridge.js +1 -0
- package/fesm2022/css-style-parser.d.ts +11 -3
- package/fesm2022/css-style-parser.js +534 -104
- package/fesm2022/index.d.ts +3 -1
- package/fesm2022/index.js +3 -1
- package/fesm2022/native-directives.d.ts +5 -2
- package/fesm2022/native-directives.js +17 -2
- package/fesm2022/native-element.d.ts +2 -0
- package/fesm2022/native-element.js +2 -0
- package/fesm2022/native-renderer.d.ts +3 -1
- package/fesm2022/native-renderer.js +48 -3
- package/fesm2022/virtual-grid.component.d.ts +64 -0
- package/fesm2022/virtual-grid.component.js +301 -0
- package/fesm2022/virtual-layout.d.ts +71 -0
- package/fesm2022/virtual-layout.js +279 -0
- package/fesm2022/virtual-list.component.d.ts +19 -13
- package/fesm2022/virtual-list.component.js +82 -38
- package/package.json +1 -1
package/fesm2022/index.js
CHANGED
|
@@ -9,4 +9,6 @@ export { NATIVE_WINDOW_NODE_ID, NativeTitleService, provideNativeTitle } from '.
|
|
|
9
9
|
export { bootstrapNativeApplication, provideNativePlatform, } from './platform.js';
|
|
10
10
|
export { matchesKeyboardEvent, NativeKeyEventsPlugin, NativeSystemErrorHandler, provideNativeErrorHandler, provideNativeKeyEvents, provideSystemLocale, } from './system-providers.js';
|
|
11
11
|
export { NativeViewportScroller, provideNativeViewportScroller } from './viewport-scroller.js';
|
|
12
|
-
export { computeVirtualSliceRange,
|
|
12
|
+
export { computeVariableVirtualSliceRange, computeVirtualGridSliceRange, computeVirtualSliceRange, FenwickOffsetTree, } from './virtual-layout.js';
|
|
13
|
+
export { NativeVirtualGridComponent, } from './virtual-grid.component.js';
|
|
14
|
+
export { NativeVirtualListComponent, } from './virtual-list.component.js';
|
|
@@ -28,8 +28,10 @@ export declare class NativeElementDirective {
|
|
|
28
28
|
set tooltip(val: NativeAttrInput);
|
|
29
29
|
set eventMask(val: NativeAttrInput);
|
|
30
30
|
set dropTarget(val: NativeBoolInput);
|
|
31
|
+
set col(val: NativeNumberInput);
|
|
32
|
+
set row(val: NativeNumberInput);
|
|
31
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<NativeElementDirective, never>;
|
|
32
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NativeElementDirective, "ng-window,adw-window,ng-dialog,gtk-dialog,adw-dialog,ng-header-bar,adw-header-bar,gtk-header-bar,ng-scroll,gtk-scrolled-window,ng-box,gtk-box,ng-grid,gtk-grid,ng-separator,gtk-separator,ng-button,gtk-button,ng-label,gtk-label,ng-entry,gtk-entry,ng-switch,gtk-switch,ng-checkbox,ng-check,ng-check-button,gtk-check-button,ng-slider,ng-scale,gtk-scale,ng-select,ng-dropdown,gtk-dropdown,gtk-drop-down,ng-image,adw-image,gtk-picture,ng-picture,ng-level-bar,gtk-level-bar,ng-flow,ng-flow-box,gtk-flow-box,ng-spinner,gtk-spinner,ng-progress-bar,gtk-progress-bar,ng-paned,gtk-paned,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-text-view,gtk-text-view,ng-password-entry,gtk-password-entry,ng-spin-button,gtk-spin-button,ng-search-entry,gtk-search-entry,ng-clamp,adw-clamp,ng-list,ng-table,gtk-list-box,gtk-list-view,ng-popover,gtk-popover,ng-menu,adw-entry-row,adw-password-entry-row,adw-switch-row,adw-combo-row,adw-spin-row", never, { "hexpand": { "alias": "hexpand"; "required": false; }; "vexpand": { "alias": "vexpand"; "required": false; }; "halign": { "alias": "halign"; "required": false; }; "valign": { "alias": "valign"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "minWidth": { "alias": "min-width"; "required": false; }; "minHeight": { "alias": "min-height"; "required": false; }; "margin": { "alias": "margin"; "required": false; }; "marginTop": { "alias": "margin-top"; "required": false; }; "marginBottom": { "alias": "margin-bottom"; "required": false; }; "marginStart": { "alias": "margin-start"; "required": false; }; "marginEnd": { "alias": "margin-end"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "sensitive": { "alias": "sensitive"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "eventMask": { "alias": "event-mask"; "required": false; }; "dropTarget": { "alias": "drop-target"; "required": false; }; }, {}, never, never, true, never>;
|
|
34
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NativeElementDirective, "ng-window,adw-window,ng-dialog,gtk-dialog,adw-dialog,ng-header-bar,adw-header-bar,gtk-header-bar,ng-scroll,gtk-scrolled-window,ng-box,gtk-box,ng-grid,gtk-grid,ng-separator,gtk-separator,ng-button,gtk-button,ng-label,gtk-label,ng-entry,gtk-entry,ng-switch,gtk-switch,ng-checkbox,ng-check,ng-check-button,gtk-check-button,ng-slider,ng-scale,gtk-scale,ng-select,ng-dropdown,gtk-dropdown,gtk-drop-down,ng-image,adw-image,gtk-picture,ng-picture,ng-level-bar,gtk-level-bar,ng-flow,ng-flow-box,gtk-flow-box,ng-spinner,gtk-spinner,ng-progress-bar,gtk-progress-bar,ng-paned,gtk-paned,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-text-view,gtk-text-view,ng-password-entry,gtk-password-entry,ng-spin-button,gtk-spin-button,ng-search-entry,gtk-search-entry,ng-clamp,adw-clamp,ng-list,ng-table,gtk-list-box,gtk-list-view,ng-popover,gtk-popover,ng-menu,adw-entry-row,adw-password-entry-row,adw-switch-row,adw-combo-row,adw-spin-row", never, { "hexpand": { "alias": "hexpand"; "required": false; }; "vexpand": { "alias": "vexpand"; "required": false; }; "halign": { "alias": "halign"; "required": false; }; "valign": { "alias": "valign"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "minWidth": { "alias": "min-width"; "required": false; }; "minHeight": { "alias": "min-height"; "required": false; }; "margin": { "alias": "margin"; "required": false; }; "marginTop": { "alias": "margin-top"; "required": false; }; "marginBottom": { "alias": "margin-bottom"; "required": false; }; "marginStart": { "alias": "margin-start"; "required": false; }; "marginEnd": { "alias": "margin-end"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "sensitive": { "alias": "sensitive"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "eventMask": { "alias": "event-mask"; "required": false; }; "dropTarget": { "alias": "drop-target"; "required": false; }; "col": { "alias": "col"; "required": false; }; "row": { "alias": "row"; "required": false; }; }, {}, never, never, true, never>;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Typed directive for top-level native windows, dialogs, and header bars (`<ng-window>`,
|
|
@@ -68,6 +70,7 @@ export declare class NativeContainerDirective {
|
|
|
68
70
|
set maxChildren(val: NativeNumberInput);
|
|
69
71
|
set minPerRow(val: NativeNumberInput);
|
|
70
72
|
set maxPerRow(val: NativeNumberInput);
|
|
73
|
+
set columns(val: NativeNumberInput);
|
|
71
74
|
set homogeneous(val: NativeBoolInput);
|
|
72
75
|
set position(val: NativeNumberInput);
|
|
73
76
|
set visibleChild(val: NativeAttrInput);
|
|
@@ -83,7 +86,7 @@ export declare class NativeContainerDirective {
|
|
|
83
86
|
set scrollTo(val: NativeAttrInput);
|
|
84
87
|
set scrollAnchor(val: NativeAttrInput);
|
|
85
88
|
static ɵfac: i0.ɵɵFactoryDeclaration<NativeContainerDirective, never>;
|
|
86
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NativeContainerDirective, "ng-box,gtk-box,ng-grid,gtk-grid,ng-flow,ng-flow-box,gtk-flow-box,ng-paned,gtk-paned,ng-scroll,gtk-scrolled-window,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-clamp,adw-clamp,ng-separator,gtk-separator", never, { "orientation": { "alias": "orientation"; "required": false; }; "spacing": { "alias": "spacing"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "rowSpacing": { "alias": "row-spacing"; "required": false; }; "columnSpacing": { "alias": "column-spacing"; "required": false; }; "minChildren": { "alias": "min-children"; "required": false; }; "maxChildren": { "alias": "max-children"; "required": false; }; "minPerRow": { "alias": "min-per-row"; "required": false; }; "maxPerRow": { "alias": "max-per-row"; "required": false; }; "homogeneous": { "alias": "homogeneous"; "required": false; }; "position": { "alias": "position"; "required": false; }; "visibleChild": { "alias": "visible-child"; "required": false; }; "activePage": { "alias": "active-page"; "required": false; }; "transition": { "alias": "transition"; "required": false; }; "transitionType": { "alias": "transition-type"; "required": false; }; "label": { "alias": "label"; "required": false; }; "title": { "alias": "title"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "open": { "alias": "open"; "required": false; }; "maxSize": { "alias": "max-size"; "required": false; }; "maximumSize": { "alias": "maximum-size"; "required": false; }; "scrollTo": { "alias": "scroll-to"; "required": false; }; "scrollAnchor": { "alias": "scroll-anchor"; "required": false; }; }, {}, never, never, true, never>;
|
|
89
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NativeContainerDirective, "ng-box,gtk-box,ng-grid,gtk-grid,ng-flow,ng-flow-box,gtk-flow-box,ng-paned,gtk-paned,ng-scroll,gtk-scrolled-window,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-clamp,adw-clamp,ng-separator,gtk-separator", never, { "orientation": { "alias": "orientation"; "required": false; }; "spacing": { "alias": "spacing"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "rowSpacing": { "alias": "row-spacing"; "required": false; }; "columnSpacing": { "alias": "column-spacing"; "required": false; }; "minChildren": { "alias": "min-children"; "required": false; }; "maxChildren": { "alias": "max-children"; "required": false; }; "minPerRow": { "alias": "min-per-row"; "required": false; }; "maxPerRow": { "alias": "max-per-row"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "homogeneous": { "alias": "homogeneous"; "required": false; }; "position": { "alias": "position"; "required": false; }; "visibleChild": { "alias": "visible-child"; "required": false; }; "activePage": { "alias": "active-page"; "required": false; }; "transition": { "alias": "transition"; "required": false; }; "transitionType": { "alias": "transition-type"; "required": false; }; "label": { "alias": "label"; "required": false; }; "title": { "alias": "title"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "open": { "alias": "open"; "required": false; }; "maxSize": { "alias": "max-size"; "required": false; }; "maximumSize": { "alias": "maximum-size"; "required": false; }; "scrollTo": { "alias": "scroll-to"; "required": false; }; "scrollAnchor": { "alias": "scroll-anchor"; "required": false; }; }, {}, never, never, true, never>;
|
|
87
90
|
}
|
|
88
91
|
/**
|
|
89
92
|
* Typed directive for native labels and action buttons (`<ng-label>`, `<ng-button>`).
|
|
@@ -143,8 +143,14 @@ export class NativeElementDirective {
|
|
|
143
143
|
set dropTarget(val) {
|
|
144
144
|
syncNativeAttr(this.renderer, this.el, 'drop-target', val);
|
|
145
145
|
}
|
|
146
|
+
set col(val) {
|
|
147
|
+
syncNativeAttr(this.renderer, this.el, 'col', val);
|
|
148
|
+
}
|
|
149
|
+
set row(val) {
|
|
150
|
+
syncNativeAttr(this.renderer, this.el, 'row', val);
|
|
151
|
+
}
|
|
146
152
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
147
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.3.0", type: NativeElementDirective, isStandalone: true, selector: "ng-window,adw-window,ng-dialog,gtk-dialog,adw-dialog,ng-header-bar,adw-header-bar,gtk-header-bar,ng-scroll,gtk-scrolled-window,ng-box,gtk-box,ng-grid,gtk-grid,ng-separator,gtk-separator,ng-button,gtk-button,ng-label,gtk-label,ng-entry,gtk-entry,ng-switch,gtk-switch,ng-checkbox,ng-check,ng-check-button,gtk-check-button,ng-slider,ng-scale,gtk-scale,ng-select,ng-dropdown,gtk-dropdown,gtk-drop-down,ng-image,adw-image,gtk-picture,ng-picture,ng-level-bar,gtk-level-bar,ng-flow,ng-flow-box,gtk-flow-box,ng-spinner,gtk-spinner,ng-progress-bar,gtk-progress-bar,ng-paned,gtk-paned,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-text-view,gtk-text-view,ng-password-entry,gtk-password-entry,ng-spin-button,gtk-spin-button,ng-search-entry,gtk-search-entry,ng-clamp,adw-clamp,ng-list,ng-table,gtk-list-box,gtk-list-view,ng-popover,gtk-popover,ng-menu,adw-entry-row,adw-password-entry-row,adw-switch-row,adw-combo-row,adw-spin-row", inputs: { hexpand: "hexpand", vexpand: "vexpand", halign: "halign", valign: "valign", width: "width", height: "height", minWidth: ["min-width", "minWidth"], minHeight: ["min-height", "minHeight"], margin: "margin", marginTop: ["margin-top", "marginTop"], marginBottom: ["margin-bottom", "marginBottom"], marginStart: ["margin-start", "marginStart"], marginEnd: ["margin-end", "marginEnd"], visible: "visible", sensitive: "sensitive", disabled: "disabled", tooltip: "tooltip", eventMask: ["event-mask", "eventMask"], dropTarget: ["drop-target", "dropTarget"] }, ngImport: i0 });
|
|
153
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.3.0", type: NativeElementDirective, isStandalone: true, selector: "ng-window,adw-window,ng-dialog,gtk-dialog,adw-dialog,ng-header-bar,adw-header-bar,gtk-header-bar,ng-scroll,gtk-scrolled-window,ng-box,gtk-box,ng-grid,gtk-grid,ng-separator,gtk-separator,ng-button,gtk-button,ng-label,gtk-label,ng-entry,gtk-entry,ng-switch,gtk-switch,ng-checkbox,ng-check,ng-check-button,gtk-check-button,ng-slider,ng-scale,gtk-scale,ng-select,ng-dropdown,gtk-dropdown,gtk-drop-down,ng-image,adw-image,gtk-picture,ng-picture,ng-level-bar,gtk-level-bar,ng-flow,ng-flow-box,gtk-flow-box,ng-spinner,gtk-spinner,ng-progress-bar,gtk-progress-bar,ng-paned,gtk-paned,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-text-view,gtk-text-view,ng-password-entry,gtk-password-entry,ng-spin-button,gtk-spin-button,ng-search-entry,gtk-search-entry,ng-clamp,adw-clamp,ng-list,ng-table,gtk-list-box,gtk-list-view,ng-popover,gtk-popover,ng-menu,adw-entry-row,adw-password-entry-row,adw-switch-row,adw-combo-row,adw-spin-row", inputs: { hexpand: "hexpand", vexpand: "vexpand", halign: "halign", valign: "valign", width: "width", height: "height", minWidth: ["min-width", "minWidth"], minHeight: ["min-height", "minHeight"], margin: "margin", marginTop: ["margin-top", "marginTop"], marginBottom: ["margin-bottom", "marginBottom"], marginStart: ["margin-start", "marginStart"], marginEnd: ["margin-end", "marginEnd"], visible: "visible", sensitive: "sensitive", disabled: "disabled", tooltip: "tooltip", eventMask: ["event-mask", "eventMask"], dropTarget: ["drop-target", "dropTarget"], col: "col", row: "row" }, ngImport: i0 });
|
|
148
154
|
}
|
|
149
155
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeElementDirective, decorators: [{
|
|
150
156
|
type: Directive,
|
|
@@ -198,6 +204,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImpor
|
|
|
198
204
|
}], dropTarget: [{
|
|
199
205
|
type: Input,
|
|
200
206
|
args: ['drop-target']
|
|
207
|
+
}], col: [{
|
|
208
|
+
type: Input
|
|
209
|
+
}], row: [{
|
|
210
|
+
type: Input
|
|
201
211
|
}] } });
|
|
202
212
|
/**
|
|
203
213
|
* Typed directive for top-level native windows, dialogs, and header bars (`<ng-window>`,
|
|
@@ -308,6 +318,9 @@ export class NativeContainerDirective {
|
|
|
308
318
|
set maxPerRow(val) {
|
|
309
319
|
syncNativeAttr(this.renderer, this.el, 'max-per-row', val);
|
|
310
320
|
}
|
|
321
|
+
set columns(val) {
|
|
322
|
+
syncNativeAttr(this.renderer, this.el, 'columns', val);
|
|
323
|
+
}
|
|
311
324
|
set homogeneous(val) {
|
|
312
325
|
syncNativeAttr(this.renderer, this.el, 'homogeneous', val);
|
|
313
326
|
}
|
|
@@ -351,7 +364,7 @@ export class NativeContainerDirective {
|
|
|
351
364
|
syncNativeAttr(this.renderer, this.el, 'scroll-anchor', val);
|
|
352
365
|
}
|
|
353
366
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
354
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.3.0", type: NativeContainerDirective, isStandalone: true, selector: "ng-box,gtk-box,ng-grid,gtk-grid,ng-flow,ng-flow-box,gtk-flow-box,ng-paned,gtk-paned,ng-scroll,gtk-scrolled-window,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-clamp,adw-clamp,ng-separator,gtk-separator", inputs: { orientation: "orientation", spacing: "spacing", gap: "gap", rowSpacing: ["row-spacing", "rowSpacing"], columnSpacing: ["column-spacing", "columnSpacing"], minChildren: ["min-children", "minChildren"], maxChildren: ["max-children", "maxChildren"], minPerRow: ["min-per-row", "minPerRow"], maxPerRow: ["max-per-row", "maxPerRow"], homogeneous: "homogeneous", position: "position", visibleChild: ["visible-child", "visibleChild"], activePage: ["active-page", "activePage"], transition: "transition", transitionType: ["transition-type", "transitionType"], label: "label", title: "title", expanded: "expanded", open: "open", maxSize: ["max-size", "maxSize"], maximumSize: ["maximum-size", "maximumSize"], scrollTo: ["scroll-to", "scrollTo"], scrollAnchor: ["scroll-anchor", "scrollAnchor"] }, ngImport: i0 });
|
|
367
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.3.0", type: NativeContainerDirective, isStandalone: true, selector: "ng-box,gtk-box,ng-grid,gtk-grid,ng-flow,ng-flow-box,gtk-flow-box,ng-paned,gtk-paned,ng-scroll,gtk-scrolled-window,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-clamp,adw-clamp,ng-separator,gtk-separator", inputs: { orientation: "orientation", spacing: "spacing", gap: "gap", rowSpacing: ["row-spacing", "rowSpacing"], columnSpacing: ["column-spacing", "columnSpacing"], minChildren: ["min-children", "minChildren"], maxChildren: ["max-children", "maxChildren"], minPerRow: ["min-per-row", "minPerRow"], maxPerRow: ["max-per-row", "maxPerRow"], columns: "columns", homogeneous: "homogeneous", position: "position", visibleChild: ["visible-child", "visibleChild"], activePage: ["active-page", "activePage"], transition: "transition", transitionType: ["transition-type", "transitionType"], label: "label", title: "title", expanded: "expanded", open: "open", maxSize: ["max-size", "maxSize"], maximumSize: ["maximum-size", "maximumSize"], scrollTo: ["scroll-to", "scrollTo"], scrollAnchor: ["scroll-anchor", "scrollAnchor"] }, ngImport: i0 });
|
|
355
368
|
}
|
|
356
369
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeContainerDirective, decorators: [{
|
|
357
370
|
type: Directive,
|
|
@@ -383,6 +396,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImpor
|
|
|
383
396
|
}], maxPerRow: [{
|
|
384
397
|
type: Input,
|
|
385
398
|
args: ['max-per-row']
|
|
399
|
+
}], columns: [{
|
|
400
|
+
type: Input
|
|
386
401
|
}], homogeneous: [{
|
|
387
402
|
type: Input
|
|
388
403
|
}], position: [{
|
|
@@ -36,6 +36,8 @@ export declare class NativeElementNode {
|
|
|
36
36
|
readonly styles: Map<string, string>;
|
|
37
37
|
private readonly listeners;
|
|
38
38
|
textContent: string;
|
|
39
|
+
encapsulationScope: string | null;
|
|
40
|
+
hostEncapsulationScope: string | null;
|
|
39
41
|
readonly classList: {
|
|
40
42
|
add: (...tokens: string[]) => void;
|
|
41
43
|
remove: (...tokens: string[]) => void;
|
|
@@ -25,6 +25,8 @@ export class NativeElementNode {
|
|
|
25
25
|
styles = new Map();
|
|
26
26
|
listeners = new Map();
|
|
27
27
|
textContent = '';
|
|
28
|
+
encapsulationScope = null;
|
|
29
|
+
hostEncapsulationScope = null;
|
|
28
30
|
classList;
|
|
29
31
|
constructor(id, tag, isComment = false, isVirtual = false, isText = false) {
|
|
30
32
|
this.id = id;
|
|
@@ -31,12 +31,13 @@ export declare class NativeRenderer2 extends Renderer2 {
|
|
|
31
31
|
private readonly bridge;
|
|
32
32
|
private readonly nodesById;
|
|
33
33
|
private readonly nextId;
|
|
34
|
+
private readonly scopedClassesByScope;
|
|
34
35
|
private readonly hooks?;
|
|
35
36
|
private readonly materializedTextLabels;
|
|
36
37
|
private readonly imageLoadSeq;
|
|
37
38
|
private readonly enabledEventTokens;
|
|
38
39
|
private readonly pendingVirtualListeners;
|
|
39
|
-
constructor(bridge: NgNativeBridge, nodesById: Map<string, NativeElementNode>, nextId: () => string, hooks?: NativeRendererHooks);
|
|
40
|
+
constructor(bridge: NgNativeBridge, nodesById: Map<string, NativeElementNode>, nextId: () => string, hooks?: NativeRendererHooks, scopedClassesByScope?: Map<string, Set<string>>);
|
|
40
41
|
private destroySubtreeNodes;
|
|
41
42
|
destroy(): void;
|
|
42
43
|
createElement(name: string, _namespace?: string | null): NativeElementNode;
|
|
@@ -77,6 +78,7 @@ export declare class NativeRendererFactory2 implements RendererFactory2 {
|
|
|
77
78
|
private readonly nodesById;
|
|
78
79
|
private readonly defaultRenderer;
|
|
79
80
|
private readonly registeredTypeIds;
|
|
81
|
+
private readonly scopedClassesByScope;
|
|
80
82
|
private nodeCounter;
|
|
81
83
|
private primaryWindowId;
|
|
82
84
|
private primaryScrollId;
|
|
@@ -9,6 +9,7 @@ const VIRTUAL_ANGULAR_TAGS = new Set([
|
|
|
9
9
|
'ng-content',
|
|
10
10
|
'ng-component',
|
|
11
11
|
'ng-virtual-list',
|
|
12
|
+
'ng-virtual-grid',
|
|
12
13
|
]);
|
|
13
14
|
const TEXT_BEARING_TAGS = new Set([
|
|
14
15
|
'ng-label',
|
|
@@ -318,17 +319,19 @@ export class NativeRenderer2 extends Renderer2 {
|
|
|
318
319
|
bridge;
|
|
319
320
|
nodesById;
|
|
320
321
|
nextId;
|
|
322
|
+
scopedClassesByScope;
|
|
321
323
|
hooks;
|
|
322
324
|
materializedTextLabels = new Map();
|
|
323
325
|
imageLoadSeq = new WeakMap();
|
|
324
326
|
enabledEventTokens = new Map();
|
|
325
327
|
pendingVirtualListeners = new WeakMap();
|
|
326
|
-
constructor(bridge, nodesById, nextId, hooks) {
|
|
328
|
+
constructor(bridge, nodesById, nextId, hooks, scopedClassesByScope = new Map()) {
|
|
327
329
|
super();
|
|
328
330
|
this.bridge = bridge;
|
|
329
331
|
this.nodesById = nodesById;
|
|
330
332
|
this.nextId = nextId;
|
|
331
333
|
this.hooks = hooks;
|
|
334
|
+
this.scopedClassesByScope = scopedClassesByScope;
|
|
332
335
|
this.destroyNode = (node) => {
|
|
333
336
|
if (node instanceof NativeElementNode) {
|
|
334
337
|
this.destroySubtreeNodes(node, true);
|
|
@@ -500,6 +503,33 @@ export class NativeRenderer2 extends Renderer2 {
|
|
|
500
503
|
return node.nextSibling;
|
|
501
504
|
}
|
|
502
505
|
setAttribute(el, name, value, _namespace) {
|
|
506
|
+
if (name.startsWith('_ngcontent-')) {
|
|
507
|
+
const scopeToken = name.slice('_ngcontent-'.length);
|
|
508
|
+
if (scopeToken && el.encapsulationScope !== scopeToken) {
|
|
509
|
+
el.encapsulationScope = scopeToken;
|
|
510
|
+
if (!el.isVirtual) {
|
|
511
|
+
const scopedSet = this.scopedClassesByScope.get(scopeToken);
|
|
512
|
+
if (scopedSet) {
|
|
513
|
+
for (const existing of el.classes) {
|
|
514
|
+
if (scopedSet.has(existing)) {
|
|
515
|
+
this.bridge.addClass(el.id, `${existing}__${scopeToken}`);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
if (name.startsWith('_nghost-')) {
|
|
524
|
+
const hostToken = name.slice('_nghost-'.length);
|
|
525
|
+
if (hostToken && el.hostEncapsulationScope !== hostToken) {
|
|
526
|
+
el.hostEncapsulationScope = hostToken;
|
|
527
|
+
if (!el.isVirtual && this.scopedClassesByScope.get(hostToken)?.has('__host')) {
|
|
528
|
+
this.bridge.addClass(el.id, `__host__${hostToken}`);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
503
533
|
if (isInternalAngularAttr(name)) {
|
|
504
534
|
return;
|
|
505
535
|
}
|
|
@@ -561,12 +591,20 @@ export class NativeRenderer2 extends Renderer2 {
|
|
|
561
591
|
el.classes.add(name);
|
|
562
592
|
if (!el.isVirtual) {
|
|
563
593
|
this.bridge.addClass(el.id, name);
|
|
594
|
+
if (el.encapsulationScope &&
|
|
595
|
+
this.scopedClassesByScope.get(el.encapsulationScope)?.has(name)) {
|
|
596
|
+
this.bridge.addClass(el.id, `${name}__${el.encapsulationScope}`);
|
|
597
|
+
}
|
|
564
598
|
}
|
|
565
599
|
}
|
|
566
600
|
removeClass(el, name) {
|
|
567
601
|
el.classes.delete(name);
|
|
568
602
|
if (!el.isVirtual) {
|
|
569
603
|
this.bridge.removeClass(el.id, name);
|
|
604
|
+
if (el.encapsulationScope &&
|
|
605
|
+
this.scopedClassesByScope.get(el.encapsulationScope)?.has(name)) {
|
|
606
|
+
this.bridge.removeClass(el.id, `${name}__${el.encapsulationScope}`);
|
|
607
|
+
}
|
|
570
608
|
}
|
|
571
609
|
}
|
|
572
610
|
setStyle(el, style, value, _flags) {
|
|
@@ -760,6 +798,12 @@ export class NativeRenderer2 extends Renderer2 {
|
|
|
760
798
|
};
|
|
761
799
|
}
|
|
762
800
|
if (target.isVirtual) {
|
|
801
|
+
// Built-in virtual containers own their internal <ng-scroll> and expose scrollBottom as an Angular output;
|
|
802
|
+
// forwarding the host DOM listener to <ng-scroll> would fire every scrollBottom binding twice.
|
|
803
|
+
if ((target.tag === 'ng-virtual-list' || target.tag === 'ng-virtual-grid') &&
|
|
804
|
+
(eventName === 'scrollBottom' || eventName === 'scroll-bottom')) {
|
|
805
|
+
return () => { };
|
|
806
|
+
}
|
|
763
807
|
const reg = {
|
|
764
808
|
nativeEvents,
|
|
765
809
|
eventName,
|
|
@@ -1031,6 +1075,7 @@ export class NativeRendererFactory2 {
|
|
|
1031
1075
|
nodesById = new Map();
|
|
1032
1076
|
defaultRenderer;
|
|
1033
1077
|
registeredTypeIds = new Set();
|
|
1078
|
+
scopedClassesByScope = new Map();
|
|
1034
1079
|
nodeCounter = 1;
|
|
1035
1080
|
primaryWindowId = null;
|
|
1036
1081
|
primaryScrollId = null;
|
|
@@ -1050,14 +1095,14 @@ export class NativeRendererFactory2 {
|
|
|
1050
1095
|
}
|
|
1051
1096
|
},
|
|
1052
1097
|
getPrimaryWindowId: () => this.getPrimaryWindowId(),
|
|
1053
|
-
});
|
|
1098
|
+
}, this.scopedClassesByScope);
|
|
1054
1099
|
}
|
|
1055
1100
|
createRenderer(_hostElement, type) {
|
|
1056
1101
|
if (type?.styles?.length) {
|
|
1057
1102
|
const typeKey = type.id || '__anonymous__';
|
|
1058
1103
|
if (!this.registeredTypeIds.has(typeKey)) {
|
|
1059
1104
|
this.registeredTypeIds.add(typeKey);
|
|
1060
|
-
registerParsedStyles(this.bridge, type.styles);
|
|
1105
|
+
registerParsedStyles(this.bridge, type.styles, this.scopedClassesByScope);
|
|
1061
1106
|
}
|
|
1062
1107
|
}
|
|
1063
1108
|
return this.defaultRenderer;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { type VirtualGridSliceRange } from './virtual-layout';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** Template context provided to each rendered cell inside `<ng-virtual-grid>`. */
|
|
5
|
+
export interface NativeVirtualGridItemContext<T> {
|
|
6
|
+
$implicit: T;
|
|
7
|
+
index: number;
|
|
8
|
+
row: number;
|
|
9
|
+
col: number;
|
|
10
|
+
}
|
|
11
|
+
/** Internal materialized 2D cell entry with row/column placement and tracking key. */
|
|
12
|
+
export interface NativeVirtualGridEntry<T> {
|
|
13
|
+
item: T;
|
|
14
|
+
index: number;
|
|
15
|
+
row: number;
|
|
16
|
+
col: number;
|
|
17
|
+
key: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 2D virtualized native grid rendering only visible rows + overscan inside `<ng-scroll>` + `<ng-grid>`.
|
|
21
|
+
* Supports responsive column sizing from viewport width as well as variable row heights via `FenwickOffsetTree`.
|
|
22
|
+
*/
|
|
23
|
+
export declare class NativeVirtualGridComponent<T = unknown> {
|
|
24
|
+
readonly items: import("@angular/core").InputSignal<readonly T[]>;
|
|
25
|
+
readonly rowHeight: import("@angular/core").InputSignal<number>;
|
|
26
|
+
readonly minColumnWidth: import("@angular/core").InputSignal<number>;
|
|
27
|
+
readonly columns: import("@angular/core").InputSignal<number | null>;
|
|
28
|
+
readonly viewportHeight: import("@angular/core").InputSignal<number>;
|
|
29
|
+
readonly viewportWidth: import("@angular/core").InputSignal<number>;
|
|
30
|
+
readonly rowGap: import("@angular/core").InputSignal<number>;
|
|
31
|
+
readonly columnGap: import("@angular/core").InputSignal<number>;
|
|
32
|
+
readonly overscanRows: import("@angular/core").InputSignal<number>;
|
|
33
|
+
readonly gridClass: import("@angular/core").InputSignal<string>;
|
|
34
|
+
readonly gridId: import("@angular/core").InputSignal<string>;
|
|
35
|
+
readonly rowHeightResolver: import("@angular/core").InputSignal<((rowIndex: number) => number) | null>;
|
|
36
|
+
readonly trackBy: import("@angular/core").InputSignal<(index: number, item: T) => unknown>;
|
|
37
|
+
readonly itemTemplateInput: import("@angular/core").InputSignal<TemplateRef<NativeVirtualGridItemContext<T>> | null>;
|
|
38
|
+
readonly projectedTemplate: import("@angular/core").Signal<TemplateRef<NativeVirtualGridItemContext<T>> | undefined>;
|
|
39
|
+
readonly rangeChange: import("@angular/core").OutputEmitterRef<VirtualGridSliceRange>;
|
|
40
|
+
readonly scrollBottom: import("@angular/core").OutputEmitterRef<void>;
|
|
41
|
+
readonly scrollTop: import("@angular/core").WritableSignal<number>;
|
|
42
|
+
readonly measuredWidth: import("@angular/core").WritableSignal<number | null>;
|
|
43
|
+
readonly measuredHeight: import("@angular/core").WritableSignal<number | null>;
|
|
44
|
+
readonly scrollToAttr: import("@angular/core").WritableSignal<string | undefined>;
|
|
45
|
+
private readonly rowTree;
|
|
46
|
+
private readonly rowOverrides;
|
|
47
|
+
private readonly measureRevision;
|
|
48
|
+
readonly resolvedTemplate: import("@angular/core").Signal<TemplateRef<NativeVirtualGridItemContext<T>> | null>;
|
|
49
|
+
readonly effectiveWidth: import("@angular/core").Signal<number>;
|
|
50
|
+
readonly effectiveHeight: import("@angular/core").Signal<number>;
|
|
51
|
+
readonly range: import("@angular/core").Signal<VirtualGridSliceRange>;
|
|
52
|
+
readonly visibleEntries: import("@angular/core").Signal<readonly NativeVirtualGridEntry<T>[]>;
|
|
53
|
+
private lastEmittedRangeKey;
|
|
54
|
+
constructor();
|
|
55
|
+
/** Overrides the height of grid row `rowIndex` in O(log R). */
|
|
56
|
+
measureRowHeight(rowIndex: number, height: number): void;
|
|
57
|
+
/** Clears all dynamically measured row height overrides. */
|
|
58
|
+
resetMeasuredRows(): void;
|
|
59
|
+
/** Scrolls the native grid viewport to bring item `index` into view. */
|
|
60
|
+
scrollToIndex(index: number): void;
|
|
61
|
+
onNativeScroll(event: unknown): void;
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NativeVirtualGridComponent<any>, never>;
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NativeVirtualGridComponent<any>, "ng-virtual-grid", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": false; "isSignal": true; }; "minColumnWidth": { "alias": "minColumnWidth"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "viewportHeight": { "alias": "viewportHeight"; "required": false; "isSignal": true; }; "viewportWidth": { "alias": "viewportWidth"; "required": false; "isSignal": true; }; "rowGap": { "alias": "rowGap"; "required": false; "isSignal": true; }; "columnGap": { "alias": "columnGap"; "required": false; "isSignal": true; }; "overscanRows": { "alias": "overscanRows"; "required": false; "isSignal": true; }; "gridClass": { "alias": "gridClass"; "required": false; "isSignal": true; }; "gridId": { "alias": "gridId"; "required": false; "isSignal": true; }; "rowHeightResolver": { "alias": "rowHeightResolver"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": false; "isSignal": true; }; "itemTemplateInput": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "rangeChange": "rangeChange"; "scrollBottom": "scrollBottom"; }, ["projectedTemplate"], ["[ngVirtualEmpty]"], true, never>;
|
|
64
|
+
}
|