ember-native 1.2.1 → 2.0.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/declarations/components/InspectorSupport.d.ts +0 -1
- package/declarations/components/ListView.d.ts +0 -1
- package/declarations/components/RadListView.d.ts +1 -1
- package/declarations/components/index.d.ts +0 -1
- package/declarations/dom/element-registry.d.ts +0 -1
- package/declarations/dom/native/FrameElement.d.ts +0 -1
- package/declarations/dom/native/NativeElementNode.d.ts +8 -1
- package/declarations/dom/native/PageElement.d.ts +0 -1
- package/declarations/dom/native-elements-tag-name-map.d.ts +31 -6
- package/declarations/dom/nodes/CommentNode.d.ts +0 -1
- package/declarations/dom/nodes/DocumentNode.d.ts +6 -3
- package/declarations/dom/nodes/ElementNode.d.ts +6 -2
- package/declarations/dom/nodes/PropertyNode.d.ts +2 -4
- package/declarations/dom/nodes/TextNode.d.ts +0 -1
- package/declarations/dom/nodes/ViewNode.d.ts +1 -1
- package/declarations/dom/setup-registry.d.ts +0 -1
- package/declarations/index.d.ts +1 -2
- package/declarations/instance-initializers/history.d.ts +0 -1
- package/declarations/instance-initializers/webpack-hot-reload.d.ts +6 -0
- package/declarations/services/history.d.ts +3 -1
- package/declarations/services/native-router.d.ts +0 -1
- package/declarations/services/webpack-hot-reload.d.ts +13 -0
- package/declarations/setup-inspector-support.d.ts +0 -1
- package/declarations/setup.d.ts +0 -1
- package/declarations/types/glint.d.ts +22 -2
- package/declarations/types/globals.d.ts +28 -31
- package/dist/_app_/instance-initializers/ember-native/webpack-hot-reload.js +1 -0
- package/dist/_app_/services/ember-native/webpack-hot-reload.js +1 -0
- package/dist/{_rollupPluginBabelHelpers-DZQzmiRH.js → _rollupPluginBabelHelpers-apNPIsxw.js} +6 -6
- package/dist/_rollupPluginBabelHelpers-apNPIsxw.js.map +1 -0
- package/dist/components/InspectorSupport.js +1 -5
- package/dist/components/InspectorSupport.js.map +1 -1
- package/dist/components/ListView.js +4 -3
- package/dist/components/ListView.js.map +1 -1
- package/dist/components/RadListView.js +17 -3
- package/dist/components/RadListView.js.map +1 -1
- package/dist/dom/native/FrameElement.js +1 -1
- package/dist/dom/native/FrameElement.js.map +1 -1
- package/dist/dom/native/NativeElementNode.js +18 -3
- package/dist/dom/native/NativeElementNode.js.map +1 -1
- package/dist/dom/nodes/CommentNode.js +1 -1
- package/dist/dom/nodes/CommentNode.js.map +1 -1
- package/dist/dom/nodes/DocumentNode.js +18 -6
- package/dist/dom/nodes/DocumentNode.js.map +1 -1
- package/dist/dom/nodes/ElementNode.js +22 -6
- package/dist/dom/nodes/ElementNode.js.map +1 -1
- package/dist/dom/nodes/PropertyNode.js +7 -10
- package/dist/dom/nodes/PropertyNode.js.map +1 -1
- package/dist/dom/nodes/TextNode.js +1 -1
- package/dist/dom/nodes/TextNode.js.map +1 -1
- package/dist/dom/nodes/ViewNode.js +9 -2
- package/dist/dom/nodes/ViewNode.js.map +1 -1
- package/dist/dom/setup-registry.js +1 -2
- package/dist/dom/setup-registry.js.map +1 -1
- package/dist/instance-initializers/webpack-hot-reload.js +18 -0
- package/dist/instance-initializers/webpack-hot-reload.js.map +1 -0
- package/dist/services/history.js +9 -6
- package/dist/services/history.js.map +1 -1
- package/dist/services/native-router.js +1 -1
- package/dist/services/webpack-hot-reload.js +192 -0
- package/dist/services/webpack-hot-reload.js.map +1 -0
- package/dist/setup-inspector-support.js +1 -1
- package/dist/setup-inspector-support.js.map +1 -1
- package/dist/setup.js +38 -0
- package/dist/setup.js.map +1 -1
- package/dist/utils/babel-plugin.js +207 -0
- package/dist/utils/babel-plugin.ts +293 -0
- package/dist/utils/content-tag-loader.js +1 -1
- package/dist/utils/ember-native.js +2 -0
- package/dist/utils/eslint/ember-native.js +2 -0
- package/dist/utils/hmr-loader.js +53 -0
- package/dist/utils/tsconfig.json +15 -0
- package/dist/utils/webpack.config.js +0 -1
- package/package.json +49 -41
- package/declarations/components/InspectorSupport.d.ts.map +0 -1
- package/declarations/components/ListView.d.ts.map +0 -1
- package/declarations/components/RadListView.d.ts.map +0 -1
- package/declarations/components/index.d.ts.map +0 -1
- package/declarations/dom/element-registry.d.ts.map +0 -1
- package/declarations/dom/native/FrameElement.d.ts.map +0 -1
- package/declarations/dom/native/NativeElementNode.d.ts.map +0 -1
- package/declarations/dom/native/PageElement.d.ts.map +0 -1
- package/declarations/dom/native-elements-tag-name-map.d.ts.map +0 -1
- package/declarations/dom/nodes/CommentNode.d.ts.map +0 -1
- package/declarations/dom/nodes/DocumentNode.d.ts.map +0 -1
- package/declarations/dom/nodes/ElementNode.d.ts.map +0 -1
- package/declarations/dom/nodes/PropertyNode.d.ts.map +0 -1
- package/declarations/dom/nodes/TextNode.d.ts.map +0 -1
- package/declarations/dom/nodes/ViewNode.d.ts.map +0 -1
- package/declarations/dom/setup-registry.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/instance-initializers/history.d.ts.map +0 -1
- package/declarations/services/history.d.ts.map +0 -1
- package/declarations/services/native-router.d.ts.map +0 -1
- package/declarations/setup-inspector-support.d.ts.map +0 -1
- package/declarations/setup.d.ts.map +0 -1
- package/declarations/types/glint.d.ts.map +0 -1
- package/declarations/types/globals.d.ts.map +0 -1
- package/dist/_rollupPluginBabelHelpers-DZQzmiRH.js.map +0 -1
- package/dist/utils/fix-glimmer-content-owner.js +0 -13
|
@@ -23,6 +23,7 @@ export default class RadListView<T = any> extends Component<RadListViewInterface
|
|
|
23
23
|
private listView;
|
|
24
24
|
private headerElement;
|
|
25
25
|
private footerElement;
|
|
26
|
+
cleanup(listView: NativeElementNode<NativeRadListView>): void;
|
|
26
27
|
get items(): {
|
|
27
28
|
item: any;
|
|
28
29
|
element: any;
|
|
@@ -38,4 +39,3 @@ export default class RadListView<T = any> extends Component<RadListViewInterface
|
|
|
38
39
|
setupFooter: () => void;
|
|
39
40
|
}
|
|
40
41
|
export {};
|
|
41
|
-
//# sourceMappingURL=RadListView.d.ts.map
|
|
@@ -13,4 +13,3 @@ export declare function getViewMeta(elementName: string): {
|
|
|
13
13
|
};
|
|
14
14
|
export declare function isKnownView(elementName: string): any;
|
|
15
15
|
export declare function createElement<T extends keyof NativeElementsTagNameMap>(elementName: T): NativeElementsTagNameMap[T];
|
|
16
|
-
//# sourceMappingURL=element-registry.d.ts.map
|
|
@@ -33,9 +33,16 @@ export default class NativeElementNode<T extends ViewBase | null = ViewBase> ext
|
|
|
33
33
|
getBoundingClientRect(): {
|
|
34
34
|
left: number;
|
|
35
35
|
top: number;
|
|
36
|
+
right: number;
|
|
36
37
|
bottom: number;
|
|
37
38
|
width: number;
|
|
38
39
|
height: number;
|
|
40
|
+
} | {
|
|
41
|
+
left: number;
|
|
42
|
+
top: number;
|
|
43
|
+
bottom: number;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
right?: undefined;
|
|
39
47
|
} | null;
|
|
40
48
|
}
|
|
41
|
-
//# sourceMappingURL=NativeElementNode.d.ts.map
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
import type NativeElementNode from './native/NativeElementNode.ts';
|
|
2
|
-
import type { ListView, StackLayout } from '@nativescript/core';
|
|
3
|
-
import type PageElement from './native/PageElement.ts';
|
|
4
2
|
export interface NativeElementsTagNameMap {
|
|
5
|
-
|
|
6
|
-
'stack-layout': NativeElementNode<StackLayout>;
|
|
7
|
-
page: PageElement;
|
|
3
|
+
property: NativeElementNode<null>;
|
|
8
4
|
fragment: NativeElementNode<null>;
|
|
5
|
+
'rad-list-view': NativeElementNode<import('nativescript-ui-listview').RadListView>;
|
|
6
|
+
'list-view': NativeElementNode<import('@nativescript/core').ListView>;
|
|
7
|
+
'html-view': NativeElementNode<import('@nativescript/core').HtmlView>;
|
|
8
|
+
'scroll-view': NativeElementNode<import('@nativescript/core').ScrollView>;
|
|
9
|
+
'text-field': NativeElementNode<import('@nativescript/core').TextField>;
|
|
10
|
+
'text-view': NativeElementNode<import('@nativescript/core').TextView>;
|
|
11
|
+
'web-view': NativeElementNode<import('@nativescript/core').WebView>;
|
|
12
|
+
'content-view': NativeElementNode<import('@nativescript/core').ContentView>;
|
|
13
|
+
'tab-view': NativeElementNode<import('@nativescript/core').TabView>;
|
|
14
|
+
'tab-view-item': NativeElementNode<import('@nativescript/core').TabViewItem>;
|
|
15
|
+
switch: NativeElementNode<import('@nativescript/core').Switch>;
|
|
16
|
+
'formatted-string': NativeElementNode<import('@nativescript/core').FormattedString>;
|
|
17
|
+
frame: import('../dom/native/FrameElement.ts').default;
|
|
18
|
+
page: import('../dom/native/PageElement.ts').default;
|
|
19
|
+
span: NativeElementNode<import('@nativescript/core').Span>;
|
|
20
|
+
'action-bar': NativeElementNode<import('@nativescript/core').ActionBar>;
|
|
21
|
+
'action-item': NativeElementNode<import('@nativescript/core').ActionItem>;
|
|
22
|
+
comment: NativeElementNode<import('@nativescript/core').Placeholder>;
|
|
23
|
+
button: NativeElementNode<import('@nativescript/core').Button>;
|
|
24
|
+
'navigation-button': NativeElementNode<import('@nativescript/core').NavigationButton>;
|
|
25
|
+
image: NativeElementNode<import('@nativescript/core').Image>;
|
|
26
|
+
label: NativeElementNode<import('@nativescript/core').Label>;
|
|
27
|
+
'list-picker': NativeElementNode<import('@nativescript/core').ListPicker>;
|
|
28
|
+
'date-picker': NativeElementNode<import('@nativescript/core').DatePicker>;
|
|
29
|
+
'dock-layout': NativeElementNode<import('@nativescript/core').DockLayout>;
|
|
30
|
+
'wrap-layout': NativeElementNode<import('@nativescript/core').WrapLayout>;
|
|
31
|
+
'stack-layout': NativeElementNode<import('@nativescript/core').StackLayout>;
|
|
32
|
+
'grid-layout': NativeElementNode<import('@nativescript/core').GridLayout>;
|
|
33
|
+
'flexbox-layout': NativeElementNode<import('@nativescript/core').FlexboxLayout>;
|
|
34
|
+
'absolute-layout': NativeElementNode<import('@nativescript/core').AbsoluteLayout>;
|
|
9
35
|
}
|
|
10
|
-
//# sourceMappingURL=native-elements-tag-name-map.d.ts.map
|
|
@@ -17,11 +17,15 @@ export default class DocumentNode extends ViewNode {
|
|
|
17
17
|
};
|
|
18
18
|
static getInstance(): DocumentNode;
|
|
19
19
|
constructor();
|
|
20
|
+
createEvent(eventInterface: string): {
|
|
21
|
+
eventInterface: string;
|
|
22
|
+
initEvent(type: string, bubbles: boolean, cancelable: boolean): void;
|
|
23
|
+
};
|
|
20
24
|
createComment(text: string): CommentNode;
|
|
21
|
-
static createPropertyNode(tagName: string
|
|
25
|
+
static createPropertyNode(tagName: string): PropertyNode;
|
|
22
26
|
createElement(name: string): any;
|
|
23
27
|
static createElement<T extends keyof NativeElementsTagNameMap>(tagName: T): NativeElementsTagNameMap[T];
|
|
24
|
-
createElementNS(_namespace: any, tagName: keyof NativeElementsTagNameMap): PageElement | NativeElementNode<import("@nativescript/core").ListView> | NativeElementNode<import("@nativescript/core").StackLayout> | NativeElementNode<
|
|
28
|
+
createElementNS(_namespace: any, tagName: keyof NativeElementsTagNameMap): PageElement | NativeElementNode<import("@nativescript/core").Placeholder> | NativeElementNode<null> | NativeElementNode<import("nativescript-ui-listview").RadListView> | NativeElementNode<import("@nativescript/core").ListView> | NativeElementNode<import("@nativescript/core").HtmlView> | NativeElementNode<import("@nativescript/core").ScrollView> | NativeElementNode<import("@nativescript/core").TextField> | NativeElementNode<import("@nativescript/core").TextView> | NativeElementNode<import("@nativescript/core").WebView> | NativeElementNode<import("@nativescript/core").ContentView> | NativeElementNode<import("@nativescript/core").TabView> | NativeElementNode<import("@nativescript/core").TabViewItem> | NativeElementNode<import("@nativescript/core").Switch> | NativeElementNode<import("@nativescript/core").FormattedString> | import("../native/FrameElement.ts").default | NativeElementNode<import("@nativescript/core").Span> | NativeElementNode<import("@nativescript/core").ActionBar> | NativeElementNode<import("@nativescript/core").ActionItem> | NativeElementNode<import("@nativescript/core").Button> | NativeElementNode<import("@nativescript/core").NavigationButton> | NativeElementNode<import("@nativescript/core").Image> | NativeElementNode<import("@nativescript/core").Label> | NativeElementNode<import("@nativescript/core").ListPicker> | NativeElementNode<import("@nativescript/core").DatePicker> | NativeElementNode<import("@nativescript/core").DockLayout> | NativeElementNode<import("@nativescript/core").WrapLayout> | NativeElementNode<import("@nativescript/core").StackLayout> | NativeElementNode<import("@nativescript/core").GridLayout> | NativeElementNode<import("@nativescript/core").FlexboxLayout> | NativeElementNode<import("@nativescript/core").AbsoluteLayout>;
|
|
25
29
|
createTextNode(text: string): TextNode;
|
|
26
30
|
addEventListener(event: string, callback: EventListener): void;
|
|
27
31
|
removeEventListener(event: string, handler: EventListener): void;
|
|
@@ -44,4 +48,3 @@ export default class DocumentNode extends ViewNode {
|
|
|
44
48
|
getAttribute(): string;
|
|
45
49
|
} | undefined;
|
|
46
50
|
}
|
|
47
|
-
//# sourceMappingURL=DocumentNode.d.ts.map
|
|
@@ -7,12 +7,16 @@ export interface IClassList {
|
|
|
7
7
|
}
|
|
8
8
|
export default class ElementNode extends ViewNode {
|
|
9
9
|
_classList: IClassList;
|
|
10
|
+
_id: string;
|
|
11
|
+
static ELEMENT_NODE: number;
|
|
12
|
+
static ATTRIBUTE_NODE: number;
|
|
13
|
+
static TEXT_NODE: number;
|
|
14
|
+
static DOCUMENT_NODE: number;
|
|
10
15
|
constructor(tagName: string);
|
|
11
16
|
get id(): string;
|
|
12
|
-
set id(
|
|
17
|
+
set id(v: string);
|
|
13
18
|
get classList(): IClassList;
|
|
14
19
|
appendChild(childNode: ViewNode): void;
|
|
15
20
|
insertBefore(childNode: ViewNode, referenceNode: ViewNode): void;
|
|
16
21
|
removeChild(childNode: ViewNode): void;
|
|
17
22
|
}
|
|
18
|
-
//# sourceMappingURL=ElementNode.d.ts.map
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import ElementNode from './ElementNode.ts';
|
|
2
2
|
import ViewNode from './ViewNode.ts';
|
|
3
3
|
export default class PropertyNode extends ElementNode {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(tagName: string, propertyName: string);
|
|
4
|
+
constructor(tagName: string);
|
|
5
|
+
get propertyName(): string;
|
|
7
6
|
onInsertedChild(): void;
|
|
8
7
|
onRemovedChild(): void;
|
|
9
8
|
toString(): string;
|
|
10
9
|
setOnNode(parent: ViewNode | null): void;
|
|
11
10
|
clearOnNode(parent: ViewNode): void;
|
|
12
11
|
}
|
|
13
|
-
//# sourceMappingURL=PropertyNode.d.ts.map
|
|
@@ -12,6 +12,7 @@ export default class ViewNode {
|
|
|
12
12
|
nextSibling: ViewNode | null;
|
|
13
13
|
_ownerDocument: any;
|
|
14
14
|
_meta: any;
|
|
15
|
+
get textContent(): string;
|
|
15
16
|
getElementById(id: string): any;
|
|
16
17
|
getElementByClass(klass: string): any;
|
|
17
18
|
getElementByTagName(tagName: string): any;
|
|
@@ -46,4 +47,3 @@ export default class ViewNode {
|
|
|
46
47
|
height: number;
|
|
47
48
|
} | null;
|
|
48
49
|
}
|
|
49
|
-
//# sourceMappingURL=ViewNode.d.ts.map
|
|
@@ -2,4 +2,3 @@ import { View } from '@nativescript/core';
|
|
|
2
2
|
import { type ComponentMeta } from './native/NativeElementNode.ts';
|
|
3
3
|
export declare function registerNativeElement(elementName: string, resolver: () => typeof View, meta?: ComponentMeta | null): void;
|
|
4
4
|
export declare function registerElements(): void;
|
|
5
|
-
//# sourceMappingURL=setup-registry.d.ts.map
|
package/declarations/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Service from '@ember/service';
|
|
2
|
+
import RouterService from '@ember/routing/router-service';
|
|
3
|
+
export default class WebpackHotReload extends Service {
|
|
4
|
+
container: any;
|
|
5
|
+
router: RouterService;
|
|
6
|
+
constructor(...args: any);
|
|
7
|
+
getLatestChange(obj: any): any;
|
|
8
|
+
}
|
|
9
|
+
declare module '@ember/service' {
|
|
10
|
+
interface Registry {
|
|
11
|
+
'hot-reload': WebpackHotReload;
|
|
12
|
+
}
|
|
13
|
+
}
|
package/declarations/setup.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import NativeElementNode from '../dom/native/NativeElementNode';
|
|
2
2
|
import '@glint/environment-ember-template-imports/globals';
|
|
3
3
|
import '@glint/template/-private/dsl/emit';
|
|
4
|
-
import type { ComponentLike } from '@glint/template';
|
|
4
|
+
import type { ComponentLike, ModifierLike } from '@glint/template';
|
|
5
5
|
import type { ViewBase } from '@nativescript/core';
|
|
6
6
|
import 'ember-modifier';
|
|
7
7
|
import type { EmptyObject, NamedArgs, PositionalArgs } from 'ember-modifier/-private/signature';
|
|
8
8
|
import type { FunctionBasedModifier, Teardown } from 'ember-modifier/-private/function-based/modifier';
|
|
9
|
+
import type { NativeElementsTagNameMap } from '../dom/native-elements-tag-name-map.ts';
|
|
9
10
|
declare module 'ember-modifier' {
|
|
10
11
|
type ViewNode<T extends ViewBase> = import('../dom/native/NativeElementNode').default<T>;
|
|
11
12
|
function modifier<E extends ViewNode<T>, P extends unknown[] = [], N = EmptyObject, T extends ViewBase = ViewBase>(fn: (element: E, positional: P, named: N) => void | Teardown): FunctionBasedModifier<{
|
|
@@ -41,7 +42,26 @@ declare module '@glint/environment-ember-template-imports/globals' {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
declare module '@glint/template/-private/dsl/emit' {
|
|
45
|
+
function emitElement<Name extends string>(name: Name): {
|
|
46
|
+
element: Name extends keyof NativeElementsTagNameMap ? NativeElementsTagNameMap[Name] : NativeElementNode<null>;
|
|
47
|
+
};
|
|
48
|
+
function applySplattributes<SourceElement extends NativeElementNode<any>, TargetElement extends SourceElement>(source: SourceElement, target: TargetElement): void;
|
|
44
49
|
function applyAttributes<T extends ViewBase>(element: NativeElementNode<T>, attrs: Record<string, any>): void;
|
|
45
50
|
function applySplattributes<T extends ViewBase, SourceElement extends NativeElementNode<T>, TargetElement extends SourceElement>(source: SourceElement, target: TargetElement): void;
|
|
46
51
|
}
|
|
47
|
-
|
|
52
|
+
declare module '@ember/modifier' {
|
|
53
|
+
interface OnModifierArgs {
|
|
54
|
+
capture?: boolean;
|
|
55
|
+
once?: boolean;
|
|
56
|
+
passive?: boolean;
|
|
57
|
+
}
|
|
58
|
+
type OnModifierType = abstract new <Name extends string>() => InstanceType<ModifierLike<{
|
|
59
|
+
Element: NativeElementNode<ViewBase>;
|
|
60
|
+
Args: {
|
|
61
|
+
Named: OnModifierArgs;
|
|
62
|
+
Positional: [name: Name, callback: (event: any) => void];
|
|
63
|
+
};
|
|
64
|
+
}>>;
|
|
65
|
+
interface OnModifier extends OnModifierType {
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -22,38 +22,35 @@ declare module 'loader.js' {
|
|
|
22
22
|
const require: AnyFunction;
|
|
23
23
|
const define: AnyFunction;
|
|
24
24
|
}
|
|
25
|
-
type ViewBase = import('@nativescript/core').ViewBase;
|
|
26
|
-
type NativeElementNode<T extends ViewBase> = import('../dom/native/NativeElementNode').default<T>;
|
|
27
25
|
interface HTMLElementTagNameMap {
|
|
28
|
-
'rad-list-view': NativeElementNode<import('nativescript-ui-listview').RadListView>;
|
|
29
|
-
'list-view': NativeElementNode<import('@nativescript/core').ListView>;
|
|
30
|
-
'html-view': NativeElementNode<import('@nativescript/core').HtmlView>;
|
|
31
|
-
'scroll-view': NativeElementNode<import('@nativescript/core').ScrollView>;
|
|
32
|
-
'text-field': NativeElementNode<import('@nativescript/core').TextField>;
|
|
33
|
-
'text-view': NativeElementNode<import('@nativescript/core').TextView>;
|
|
34
|
-
'web-view': NativeElementNode<import('@nativescript/core').WebView>;
|
|
35
|
-
'content-view': NativeElementNode<import('@nativescript/core').ContentView>;
|
|
36
|
-
'tab-view': NativeElementNode<import('@nativescript/core').TabView>;
|
|
37
|
-
'tab-view-item': NativeElementNode<import('@nativescript/core').TabViewItem>;
|
|
38
|
-
switch: NativeElementNode<import('@nativescript/core').Switch>;
|
|
39
|
-
'formatted-string': NativeElementNode<import('@nativescript/core').FormattedString>;
|
|
26
|
+
'rad-list-view': import('../dom/native/NativeElementNode').default<import('nativescript-ui-listview').RadListView>;
|
|
27
|
+
'list-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ListView>;
|
|
28
|
+
'html-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').HtmlView>;
|
|
29
|
+
'scroll-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ScrollView>;
|
|
30
|
+
'text-field': import('../dom/native/NativeElementNode').default<import('@nativescript/core').TextField>;
|
|
31
|
+
'text-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').TextView>;
|
|
32
|
+
'web-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').WebView>;
|
|
33
|
+
'content-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ContentView>;
|
|
34
|
+
'tab-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').TabView>;
|
|
35
|
+
'tab-view-item': import('../dom/native/NativeElementNode').default<import('@nativescript/core').TabViewItem>;
|
|
36
|
+
switch: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Switch>;
|
|
37
|
+
'formatted-string': import('../dom/native/NativeElementNode').default<import('@nativescript/core').FormattedString>;
|
|
40
38
|
frame: import('../dom/native/FrameElement.ts').default;
|
|
41
39
|
page: import('../dom/native/PageElement.ts').default;
|
|
42
|
-
span: NativeElementNode<import('@nativescript/core').Span>;
|
|
43
|
-
'action-bar': NativeElementNode<import('@nativescript/core').ActionBar>;
|
|
44
|
-
'action-item': NativeElementNode<import('@nativescript/core').ActionItem>;
|
|
45
|
-
comment: NativeElementNode<import('@nativescript/core').Placeholder>;
|
|
46
|
-
button: NativeElementNode<import('@nativescript/core').Button>;
|
|
47
|
-
'navigation-button': NativeElementNode<import('@nativescript/core').NavigationButton>;
|
|
48
|
-
image: NativeElementNode<import('@nativescript/core').Image>;
|
|
49
|
-
label: NativeElementNode<import('@nativescript/core').Label>;
|
|
50
|
-
'list-picker': NativeElementNode<import('@nativescript/core').ListPicker>;
|
|
51
|
-
'date-picker': NativeElementNode<import('@nativescript/core').DatePicker>;
|
|
52
|
-
'dock-layout': NativeElementNode<import('@nativescript/core').DockLayout>;
|
|
53
|
-
'wrap-layout': NativeElementNode<import('@nativescript/core').WrapLayout>;
|
|
54
|
-
'stack-layout': NativeElementNode<import('@nativescript/core').StackLayout>;
|
|
55
|
-
'grid-layout': NativeElementNode<import('@nativescript/core').GridLayout>;
|
|
56
|
-
'flexbox-layout': NativeElementNode<import('@nativescript/core').FlexboxLayout>;
|
|
57
|
-
'absolute-layout': NativeElementNode<import('@nativescript/core').AbsoluteLayout>;
|
|
40
|
+
span: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Span>;
|
|
41
|
+
'action-bar': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ActionBar>;
|
|
42
|
+
'action-item': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ActionItem>;
|
|
43
|
+
comment: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Placeholder>;
|
|
44
|
+
button: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Button>;
|
|
45
|
+
'navigation-button': import('../dom/native/NativeElementNode').default<import('@nativescript/core').NavigationButton>;
|
|
46
|
+
image: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Image>;
|
|
47
|
+
label: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Label>;
|
|
48
|
+
'list-picker': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ListPicker>;
|
|
49
|
+
'date-picker': import('../dom/native/NativeElementNode').default<import('@nativescript/core').DatePicker>;
|
|
50
|
+
'dock-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').DockLayout>;
|
|
51
|
+
'wrap-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').WrapLayout>;
|
|
52
|
+
'stack-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').StackLayout>;
|
|
53
|
+
'grid-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').GridLayout>;
|
|
54
|
+
'flexbox-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').FlexboxLayout>;
|
|
55
|
+
'absolute-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').AbsoluteLayout>;
|
|
58
56
|
}
|
|
59
|
-
//# sourceMappingURL=globals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "ember-native/instance-initializers/webpack-hot-reload";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "ember-native/services/webpack-hot-reload";
|
package/dist/{_rollupPluginBabelHelpers-DZQzmiRH.js → _rollupPluginBabelHelpers-apNPIsxw.js}
RENAMED
|
@@ -2,16 +2,16 @@ function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
|
2
2
|
var a = {};
|
|
3
3
|
return Object.keys(n).forEach(function (i) {
|
|
4
4
|
a[i] = n[i];
|
|
5
|
-
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable =
|
|
5
|
+
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = true), a = r.slice().reverse().reduce(function (r, n) {
|
|
6
6
|
return n(i, e, r) || r;
|
|
7
7
|
}, a), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
8
8
|
}
|
|
9
9
|
function _defineProperty(e, r, t) {
|
|
10
10
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
11
11
|
value: t,
|
|
12
|
-
enumerable:
|
|
13
|
-
configurable:
|
|
14
|
-
writable:
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true
|
|
15
15
|
}) : e[r] = t, e;
|
|
16
16
|
}
|
|
17
17
|
function _initializerDefineProperty(e, i, r, l) {
|
|
@@ -26,7 +26,7 @@ function _toPrimitive(t, r) {
|
|
|
26
26
|
if ("object" != typeof t || !t) return t;
|
|
27
27
|
var e = t[Symbol.toPrimitive];
|
|
28
28
|
if (void 0 !== e) {
|
|
29
|
-
var i = e.call(t, r
|
|
29
|
+
var i = e.call(t, r);
|
|
30
30
|
if ("object" != typeof i) return i;
|
|
31
31
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
32
32
|
}
|
|
@@ -38,4 +38,4 @@ function _toPropertyKey(t) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export { _defineProperty as _, _applyDecoratedDescriptor as a, _initializerDefineProperty as b };
|
|
41
|
-
//# sourceMappingURL=_rollupPluginBabelHelpers-
|
|
41
|
+
//# sourceMappingURL=_rollupPluginBabelHelpers-apNPIsxw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_rollupPluginBabelHelpers-apNPIsxw.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _defineProperty } from '../_rollupPluginBabelHelpers-apNPIsxw.js';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { modifier } from 'ember-modifier';
|
|
4
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
@@ -12,10 +12,6 @@ const ref = modifier(function setRef(element, [context, key]) {
|
|
|
12
12
|
class InspectorSupport extends Component {
|
|
13
13
|
constructor(...args) {
|
|
14
14
|
super(...args);
|
|
15
|
-
_defineProperty(this, "highlight", void 0);
|
|
16
|
-
_defineProperty(this, "tooltip", void 0);
|
|
17
|
-
_defineProperty(this, "page", void 0);
|
|
18
|
-
_defineProperty(this, "ownerDocument", void 0);
|
|
19
15
|
_defineProperty(this, "setupInspector", () => {
|
|
20
16
|
let i = setInterval(() => {
|
|
21
17
|
const viewInspection = globalThis.EmberInspector?.viewDebug?.viewInspection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InspectorSupport.js","sources":["../../src/components/InspectorSupport.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { modifier } from 'ember-modifier';\nimport ViewNode from '../dom/nodes/ViewNode.ts';\nimport NativeElementNode from '../dom/native/NativeElementNode.ts';\nimport DocumentNode from '../dom/nodes/DocumentNode.ts';\nimport type PageElement from '../dom/native/PageElement.ts';\n\nconst ref = modifier(function setRef(element: any, [context, key]: any) {\n // console.log('ref', element, context, key);\n context[key] = element;\n});\n\ninterface InspectorSupportInterface {\n Blocks: {\n default: [];\n };\n}\n\nexport default class InspectorSupport extends Component<InspectorSupportInterface> {\n declare highlight: NativeElementNode;\n declare tooltip: NativeElementNode;\n declare page: PageElement;\n declare ownerDocument: DocumentNode;\n setupInspector = () => {\n let i = setInterval(() => {\n const viewInspection =\n globalThis.EmberInspector?.viewDebug?.viewInspection;\n if (viewInspection && this.tooltip) {\n this.tooltip.querySelector = () => {\n return {\n style: {},\n };\n };\n viewInspection._showTooltip = () => {};\n const _showHighlight = viewInspection._showHighlight;\n viewInspection._hideHighlight = () => {\n this.highlight.setAttribute('visibility', 'collapse');\n };\n viewInspection._showHighlight = (node: ViewNode, rect: any) => {\n _showHighlight.call(this, node, rect);\n this.highlight.setAttribute('visibility', 'visible');\n const style = this.highlight.style as any;\n style.width = (style.width as any).value;\n style.height = (style.height as any).value;\n const pos = this.page.nativeView.getLocationInWindow() || {\n x: 0,\n y: 0,\n };\n this.highlight.setAttribute(\n 'left',\n Number(style.left!.replace('px', '')) - pos.x,\n );\n this.highlight.setAttribute(\n 'top',\n Number(style.top!.replace('px', '')) - pos.y,\n );\n };\n viewInspection.highlight = this.highlight;\n viewInspection.tooltip = this.tooltip;\n const id = viewInspection.id;\n\n viewInspection.highlight.id = `ember-inspector-highlight-${id}`;\n viewInspection.tooltip.id = `ember-inspector-tooltip-${id}`;\n clearInterval(i);\n }\n }, 1000);\n };\n\n setupHighlight = modifier(\n function setupHighlight(\n this: InspectorSupport,\n element: NativeElementNode,\n ) {\n this.highlight = element;\n this.highlight.setAttribute('visibility', 'collapse');\n this.ownerDocument = element.ownerDocument!;\n }.bind(this),\n );\n setupTooltip = modifier(\n function setupTooltip(this: InspectorSupport, element: NativeElementNode) {\n this.tooltip = element;\n this.tooltip.setAttribute('visibility', 'collapse');\n }.bind(this),\n );\n <template>\n <absolute-layout {{ref this 'page'}}>\n <html-view {{this.setupHighlight}} />\n <html-view {{this.setupTooltip}} zIndex='99' />\n {{(this.setupInspector)}}\n <content-view left='0' top='0' width='100%' height='100%'>\n <frame>\n {{yield}}\n </frame>\n </content-view>\n </absolute-layout>\n </template>\n}\n"],"names":["ref","modifier","setRef","element","context","key","InspectorSupport","Component","constructor","args","_defineProperty","setupInspector","i","setInterval","viewInspection","globalThis","EmberInspector","viewDebug","tooltip","querySelector","style","_showTooltip","_showHighlight","_hideHighlight","highlight","setAttribute","node","rect","call","width","value","height","pos","page","nativeView","getLocationInWindow","x","y","Number","left","replace","top","id","clearInterval","setupHighlight","ownerDocument","bind","setupTooltip","_InspectorSupport","
|
|
1
|
+
{"version":3,"file":"InspectorSupport.js","sources":["../../src/components/InspectorSupport.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { modifier } from 'ember-modifier';\nimport ViewNode from '../dom/nodes/ViewNode.ts';\nimport NativeElementNode from '../dom/native/NativeElementNode.ts';\nimport DocumentNode from '../dom/nodes/DocumentNode.ts';\nimport type PageElement from '../dom/native/PageElement.ts';\n\nconst ref = modifier(function setRef(element: any, [context, key]: any) {\n // console.log('ref', element, context, key);\n context[key] = element;\n});\n\ninterface InspectorSupportInterface {\n Blocks: {\n default: [];\n };\n}\n\nexport default class InspectorSupport extends Component<InspectorSupportInterface> {\n declare highlight: NativeElementNode;\n declare tooltip: NativeElementNode;\n declare page: PageElement;\n declare ownerDocument: DocumentNode;\n setupInspector = () => {\n let i = setInterval(() => {\n const viewInspection =\n globalThis.EmberInspector?.viewDebug?.viewInspection;\n if (viewInspection && this.tooltip) {\n this.tooltip.querySelector = () => {\n return {\n style: {},\n };\n };\n viewInspection._showTooltip = () => {};\n const _showHighlight = viewInspection._showHighlight;\n viewInspection._hideHighlight = () => {\n this.highlight.setAttribute('visibility', 'collapse');\n };\n viewInspection._showHighlight = (node: ViewNode, rect: any) => {\n _showHighlight.call(this, node, rect);\n this.highlight.setAttribute('visibility', 'visible');\n const style = this.highlight.style as any;\n style.width = (style.width as any).value;\n style.height = (style.height as any).value;\n const pos = this.page.nativeView.getLocationInWindow() || {\n x: 0,\n y: 0,\n };\n this.highlight.setAttribute(\n 'left',\n Number(style.left!.replace('px', '')) - pos.x,\n );\n this.highlight.setAttribute(\n 'top',\n Number(style.top!.replace('px', '')) - pos.y,\n );\n };\n viewInspection.highlight = this.highlight;\n viewInspection.tooltip = this.tooltip;\n const id = viewInspection.id;\n\n viewInspection.highlight.id = `ember-inspector-highlight-${id}`;\n viewInspection.tooltip.id = `ember-inspector-tooltip-${id}`;\n clearInterval(i);\n }\n }, 1000);\n };\n\n setupHighlight = modifier(\n function setupHighlight(\n this: InspectorSupport,\n element: NativeElementNode,\n ) {\n this.highlight = element;\n this.highlight.setAttribute('visibility', 'collapse');\n this.ownerDocument = element.ownerDocument!;\n }.bind(this),\n );\n setupTooltip = modifier(\n function setupTooltip(this: InspectorSupport, element: NativeElementNode) {\n this.tooltip = element;\n this.tooltip.setAttribute('visibility', 'collapse');\n }.bind(this),\n );\n <template>\n <absolute-layout {{ref this 'page'}}>\n <html-view {{this.setupHighlight}} />\n <html-view {{this.setupTooltip}} zIndex='99' />\n {{(this.setupInspector)}}\n <content-view left='0' top='0' width='100%' height='100%'>\n <frame>\n {{yield}}\n </frame>\n </content-view>\n </absolute-layout>\n </template>\n}\n"],"names":["ref","modifier","setRef","element","context","key","InspectorSupport","Component","constructor","args","_defineProperty","setupInspector","i","setInterval","viewInspection","globalThis","EmberInspector","viewDebug","tooltip","querySelector","style","_showTooltip","_showHighlight","_hideHighlight","highlight","setAttribute","node","rect","call","width","value","height","pos","page","nativeView","getLocationInWindow","x","y","Number","left","replace","top","id","clearInterval","setupHighlight","ownerDocument","bind","setupTooltip","_InspectorSupport","template_fd9b2463e5f141cfb5666b64daa1f11a","strictMode","scope"],"mappings":";;;;;;;AAOA,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YAAAA,CAAqC5C,OAA0B,EAAA;MACtE,IAAI,CAACe,OAAO,GAAGf,OAAA;MACf,IAAI,CAACe,OAAO,CAACO,YAAY,CAAC,YAAc,EAAA,UAAA,CAAA;AAC1C,KAAE,CAAAqB,IAAI,CAAC,IAAI,CACX,CAAA,CAAA;AAAA;AAaJ;AAAAE,iBAAA,GA9EqB1C;AAkEnB2C,oBAAAA,CAAAA,kBAAAA,CAWA,2WAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAnD,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAgD,iBAAA,CAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as _defineProperty, a as _applyDecoratedDescriptor, b as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-apNPIsxw.js';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { modifier } from 'ember-modifier';
|
|
4
4
|
import { tracked } from '@glimmer/tracking';
|
|
@@ -16,6 +16,7 @@ let ListView = (_class = (_ListView = class ListView extends Component {
|
|
|
16
16
|
function _getDefaultItemContent(index) {
|
|
17
17
|
listViewComponent.cleanup(listView);
|
|
18
18
|
const sl = DocumentNode.createElement('stack-layout');
|
|
19
|
+
listView.appendChild(sl);
|
|
19
20
|
listViewComponent.elementRefs.push({
|
|
20
21
|
element: sl,
|
|
21
22
|
item: null,
|
|
@@ -33,7 +34,7 @@ let ListView = (_class = (_ListView = class ListView extends Component {
|
|
|
33
34
|
}.bind(this)));
|
|
34
35
|
}
|
|
35
36
|
get items() {
|
|
36
|
-
return this.elementRefs.map(({
|
|
37
|
+
return this.elementRefs.filter(x => x.index < this.args.items.length).map(({
|
|
37
38
|
element,
|
|
38
39
|
index
|
|
39
40
|
}) => {
|
|
@@ -48,7 +49,7 @@ let ListView = (_class = (_ListView = class ListView extends Component {
|
|
|
48
49
|
for (const elementRef of this.elementRefs) {
|
|
49
50
|
const n = elementRef.element.nativeView.nativeViewProtected;
|
|
50
51
|
if (!n || !n.getWindowToken()) {
|
|
51
|
-
elementRef.element.parentNode
|
|
52
|
+
elementRef.element.parentNode?.removeChild(elementRef.element);
|
|
52
53
|
listView.nativeView._realizedItems.delete(elementRef.element.nativeView);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.js","sources":["../../src/components/ListView.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { modifier } from 'ember-modifier';\nimport type {\n ListView as NativeListView,\n StackLayout,\n} from '@nativescript/core';\nimport { tracked } from '@glimmer/tracking';\nimport NativeElementNode from '../dom/native/NativeElementNode.ts';\nimport DocumentNode from '../dom/nodes/DocumentNode.ts';\n\ninterface ListViewInterface<T> {\n Element: NativeElementNode<NativeListView>;\n Args: {\n items: T[];\n };\n Blocks: {\n item: [T | null];\n };\n}\n\ntype Ref<T> = {\n index: number;\n item: T | null;\n element: NativeElementNode<any>;\n};\n\nexport default class ListView<T> extends Component<ListViewInterface<T>> {\n @tracked elementRefs: Ref<T>[] = [];\n\n get items(): Ref<T>[] {\n return this.elementRefs.map(({ element, index }) => {\n
|
|
1
|
+
{"version":3,"file":"ListView.js","sources":["../../src/components/ListView.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { modifier } from 'ember-modifier';\nimport type {\n ListView as NativeListView,\n StackLayout,\n} from '@nativescript/core';\nimport { tracked } from '@glimmer/tracking';\nimport NativeElementNode from '../dom/native/NativeElementNode.ts';\nimport DocumentNode from '../dom/nodes/DocumentNode.ts';\n\ninterface ListViewInterface<T> {\n Element: NativeElementNode<NativeListView>;\n Args: {\n items: T[];\n };\n Blocks: {\n item: [T | null];\n };\n}\n\ntype Ref<T> = {\n index: number;\n item: T | null;\n element: NativeElementNode<any>;\n};\n\nexport default class ListView<T> extends Component<ListViewInterface<T>> {\n @tracked elementRefs: Ref<T>[] = [];\n\n get items(): Ref<T>[] {\n return this.elementRefs\n .filter((x) => x.index < this.args.items.length)\n .map(({ element, index }) => {\n return {\n index,\n item: this.args.items[index] || null,\n element,\n };\n });\n }\n\n cleanup(listView: NativeElementNode<NativeListView>) {\n for (const elementRef of this.elementRefs) {\n const n = elementRef.element.nativeView.nativeViewProtected;\n if (!n || !n.getWindowToken()) {\n elementRef.element.parentNode?.removeChild(elementRef.element);\n ((listView.nativeView as any)._realizedItems as any).delete(\n elementRef.element.nativeView,\n );\n }\n }\n this.elementRefs = this.elementRefs.filter(\n (e) => !!e.element.nativeView.nativeViewProtected?.getWindowToken(),\n ) as Ref<T>[];\n }\n\n setupListView = modifier(\n function setupListView(\n this: ListView<T>,\n listView: NativeElementNode<NativeListView>,\n ) {\n const listViewComponent = this;\n function _getDefaultItemContent(index: number) {\n listViewComponent.cleanup(listView);\n const sl = DocumentNode.createElement('stack-layout');\n listView.appendChild(sl);\n listViewComponent.elementRefs.push({\n element: sl,\n item: null,\n index,\n });\n listViewComponent.elementRefs = [...listViewComponent.elementRefs];\n return sl.nativeView;\n }\n (listView.nativeView as any)._getDefaultItemContent =\n _getDefaultItemContent;\n (listView.nativeView as any)._prepareItem = (\n stackLayout: StackLayout,\n index: number,\n ) => {\n const ref = listViewComponent.elementRefs.find(\n (e) => e.element.nativeView === stackLayout,\n )!;\n ref.index = index;\n listViewComponent.elementRefs = [...listViewComponent.elementRefs];\n };\n }.bind(this),\n );\n\n <template>\n <list-view {{this.setupListView}} items={{@items}} ...attributes />\n {{#each this.items as |item|}}\n {{#in-element item.element}}\n {{yield item.item to='item'}}\n {{/in-element}}\n {{/each}}\n </template>\n}\n"],"names":["ListView","_class","_ListView","Component","constructor","args","_initializerDefineProperty","_descriptor","_defineProperty","modifier","setupListView","listView","listViewComponent","_getDefaultItemContent","index","cleanup","sl","DocumentNode","createElement","appendChild","elementRefs","push","element","item","nativeView","_prepareItem","stackLayout","ref","find","e","bind","items","filter","x","length","map","elementRef","n","nativeViewProtected","getWindowToken","parentNode","removeChild","_realizedItems","delete","setComponentTemplate","template_fd9b2463e5f141cfb5666b64daa1f11a","strictMode","_applyDecoratedDescriptor","prototype","tracked"],"mappings":";;;;;;;;;AA0BqBA,IAAAA,QAAA,IAAAC,MAAA,IAAAC,SAAA,GAAN,MAAMF,QAAA,SAAoBG,SAAA,CAA4B;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA;AAAAC,IAAAA,0BAAA,sBAAAC,WAAA,EAAA,IAAA,CAAA;AAAAC,IAAAA,eAAA,wBA8BnDC,QAAA,CACd,SAASC,aACPA,CACAC,QAA2C,EAAA;MAE3C,MAAMC,oBAAoB,IAAI;MAC9B,SAASC,sBAAAA,CAAuBC,KAAa,EAAA;AAC3CF,QAAAA,iBAAA,CAAkBG,OAAO,CAACJ,QAAA,CAAA;AAC1B,QAAA,MAAMK,EAAA,GAAKC,YAAa,CAAAC,aAAa,CAAC,cAAA,CAAA;AACtCP,QAAAA,QAAA,CAASQ,WAAW,CAACH,EAAA,CAAA;AACrBJ,QAAAA,iBAAkB,CAAAQ,WAAW,CAACC,IAAI,CAAC;AACjCC,UAAAA,OAAS,EAAAN,EAAA;AACTO,UAAAA,IAAM,EAAA,IAAA;AACNT,UAAAA;AACF,SAAA,CAAA;QACAF,iBAAA,CAAkBQ,WAAW,GAAG,CAAI,GAAAR,iBAAA,CAAkBQ,WAAW,CAAC;QAClE,OAAOJ,GAAGQ,UAAU;AACtB;AACCb,MAAAA,SAASa,UAAU,CAASX,sBAAsB,GACjDA,sBAAA;MACDF,QAAA,CAASa,UAAU,CAASC,YAAY,GAAG,CAC1CC,WACA,EAAAZ,KAAa,KAAA;AAEb,QAAA,MAAMa,GAAM,GAAAf,iBAAA,CAAkBQ,WAAW,CAACQ,IAAI,CAC3CC,CAAA,IAAMA,CAAE,CAAAP,OAAO,CAACE,UAAU,KAAKE,WAAA,CAAA;QAElCC,GAAA,CAAIb,KAAK,GAAGA,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,CAAA,EAAAA,SAAA,CAAAK,EAAAA,WAAA,GAAAwC,yBAAA,CAAA9C,MAAA,CAAA+C,SAAA,kBArETC,OAAAA,CAAAA,EAAAA;EAAAA,YAAAA,EAAAA,IAAAA;EAAAA,UAAAA,EAAAA,IAAAA;EAAAA,QAAAA,EAAAA,IAAAA;AAAAA,EAAAA,WAAAA,cAAAA;AAAAA,IAAAA,OAAgC,EAAE;AAAA;AAAA,CAAA,CAAA,EAAAhD,MAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as _applyDecoratedDescriptor,
|
|
1
|
+
import { a as _applyDecoratedDescriptor, _ as _defineProperty, b as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-apNPIsxw.js';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { modifier } from 'ember-modifier';
|
|
4
4
|
import { tracked } from '@glimmer/tracking';
|
|
@@ -39,13 +39,15 @@ let RadListView = (_class2 = (_RadListView = class RadListView extends Component
|
|
|
39
39
|
super(...args);
|
|
40
40
|
_defineProperty(this, "elementRefs", new TrackedMap());
|
|
41
41
|
_initializerDefineProperty(this, "listView", _descriptor2, this);
|
|
42
|
-
_defineProperty(this, "headerElement", void 0);
|
|
43
|
-
_defineProperty(this, "footerElement", void 0);
|
|
44
42
|
_defineProperty(this, "setupListView", modifier(function setupListView(listView) {
|
|
45
43
|
this.listView = listView;
|
|
44
|
+
listView.nativeView.on('itemRecyclingInternal', () => {
|
|
45
|
+
this.cleanup(listView);
|
|
46
|
+
});
|
|
46
47
|
const listViewComponent = this;
|
|
47
48
|
function _getDefaultItemContent() {
|
|
48
49
|
const sl = DocumentNode.createElement('stack-layout');
|
|
50
|
+
listView.appendChild(sl);
|
|
49
51
|
Object.defineProperty(sl.nativeView, 'parent', {
|
|
50
52
|
get() {
|
|
51
53
|
return this._parent;
|
|
@@ -83,6 +85,18 @@ let RadListView = (_class2 = (_RadListView = class RadListView extends Component
|
|
|
83
85
|
this.footerElement = DocumentNode.createElement('stack-layout');
|
|
84
86
|
});
|
|
85
87
|
}
|
|
88
|
+
cleanup(listView) {
|
|
89
|
+
for (const [element] of [...this.elementRefs.entries()]) {
|
|
90
|
+
const n = element.nativeView.nativeViewProtected;
|
|
91
|
+
if (!n || !n.getWindowToken()) {
|
|
92
|
+
this.elementRefs.delete(element);
|
|
93
|
+
const idx = listView.childNodes.findIndex(c => c === element);
|
|
94
|
+
if (idx >= 0) {
|
|
95
|
+
listView.childNodes.splice(idx, 1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
86
100
|
get items() {
|
|
87
101
|
return [...this.elementRefs.entries()].map(([element, item]) => {
|
|
88
102
|
return {
|