@ace-grid/angular 1.0.7

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/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @ace-grid/angular
2
+
3
+ Ace Grid Angular provides Angular bindings for Ace Grid Core, Pro, and Enterprise runtimes. The wrapper keeps Angular templates and lifecycle integration separate from the selected Ace Grid feature tier.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @ace-grid/angular @ace-grid/core react react-dom
9
+ ```
10
+
11
+ For paid tiers, install the runtime you use:
12
+
13
+ ```bash
14
+ npm install @ace-grid/angular @ace-grid/pro react react-dom
15
+ npm install @ace-grid/angular @ace-grid/enterprise react react-dom
16
+ ```
17
+
18
+ ## Quick start
19
+
20
+ ```ts
21
+ import { AceGridComponent } from "@ace-grid/angular/core";
22
+ ```
23
+
24
+ Use the tier-specific entry point that matches your runtime:
25
+
26
+ - `@ace-grid/angular/core`
27
+ - `@ace-grid/angular/pro`
28
+ - `@ace-grid/angular/enterprise`
29
+
30
+ ## Package boundaries
31
+
32
+ This package contains the Angular wrapper only. Grid capabilities come from the runtime package you install: `@ace-grid/core`, `@ace-grid/pro`, or `@ace-grid/enterprise`.
33
+
34
+ ## Production notes
35
+
36
+ - Keep the wrapper version aligned with the Ace Grid runtime version used by your app.
37
+ - Install only one runtime tier in each application bundle unless you intentionally support tier switching.
38
+ - Pro and Enterprise runtimes require a valid commercial license.
39
+
40
+ ## License
41
+
42
+ MIT. Runtime packages may have separate license terms.
@@ -0,0 +1,5 @@
1
+ export * from "./angular";
2
+ export * from "@ace-grid/core";
3
+ export declare function defineAceGridElement(...args: unknown[]): unknown;
4
+ export declare function defineAceGridUseGridElement(...args: unknown[]): unknown;
5
+ export interface AceGridUseGridElement extends HTMLElement {}
@@ -0,0 +1,17 @@
1
+ import { Grid as e, useGrid as r } from "@ace-grid/core";
2
+ export * from "@ace-grid/core";
3
+ import { r as A } from "./angularTier-OrCtSQfy.mjs";
4
+ import { d as m, a as t } from "./angularTier-OrCtSQfy.mjs";
5
+ import { ACE_GRID_ANGULAR_COMMON_EVENTS as f, ACE_GRID_ANGULAR_DEFAULT_TAG_NAME as n, ACE_GRID_ANGULAR_EVENT_PREFIX as N, AceGridComponent as R } from "./angular.js";
6
+ A(
7
+ e,
8
+ r
9
+ );
10
+ export {
11
+ f as ACE_GRID_ANGULAR_COMMON_EVENTS,
12
+ n as ACE_GRID_ANGULAR_DEFAULT_TAG_NAME,
13
+ N as ACE_GRID_ANGULAR_EVENT_PREFIX,
14
+ R as AceGridComponent,
15
+ m as defineAceGridElement,
16
+ t as defineAceGridUseGridElement
17
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./angular";
2
+ export * from "@ace-grid/enterprise";
3
+ export declare function defineAceGridElement(...args: unknown[]): unknown;
4
+ export declare function defineAceGridUseGridElement(...args: unknown[]): unknown;
5
+ export interface AceGridUseGridElement extends HTMLElement {}
@@ -0,0 +1,17 @@
1
+ import { Grid as e, useGrid as r } from "@ace-grid/enterprise";
2
+ export * from "@ace-grid/enterprise";
3
+ import { r as A } from "./angularTier-OrCtSQfy.mjs";
4
+ import { d as m, a as t } from "./angularTier-OrCtSQfy.mjs";
5
+ import { ACE_GRID_ANGULAR_COMMON_EVENTS as f, ACE_GRID_ANGULAR_DEFAULT_TAG_NAME as n, ACE_GRID_ANGULAR_EVENT_PREFIX as N, AceGridComponent as R } from "./angular.js";
6
+ A(
7
+ e,
8
+ r
9
+ );
10
+ export {
11
+ f as ACE_GRID_ANGULAR_COMMON_EVENTS,
12
+ n as ACE_GRID_ANGULAR_DEFAULT_TAG_NAME,
13
+ N as ACE_GRID_ANGULAR_EVENT_PREFIX,
14
+ R as AceGridComponent,
15
+ m as defineAceGridElement,
16
+ t as defineAceGridUseGridElement
17
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./angular";
2
+ export * from "@ace-grid/pro";
3
+ export declare function defineAceGridElement(...args: unknown[]): unknown;
4
+ export declare function defineAceGridUseGridElement(...args: unknown[]): unknown;
5
+ export interface AceGridUseGridElement extends HTMLElement {}
@@ -0,0 +1,17 @@
1
+ import { Grid as e, useGrid as r } from "@ace-grid/pro";
2
+ export * from "@ace-grid/pro";
3
+ import { r as A } from "./angularTier-OrCtSQfy.mjs";
4
+ import { d as m, a as t } from "./angularTier-OrCtSQfy.mjs";
5
+ import { ACE_GRID_ANGULAR_COMMON_EVENTS as f, ACE_GRID_ANGULAR_DEFAULT_TAG_NAME as n, ACE_GRID_ANGULAR_EVENT_PREFIX as N, AceGridComponent as R } from "./angular.js";
6
+ A(
7
+ e,
8
+ r
9
+ );
10
+ export {
11
+ f as ACE_GRID_ANGULAR_COMMON_EVENTS,
12
+ n as ACE_GRID_ANGULAR_DEFAULT_TAG_NAME,
13
+ N as ACE_GRID_ANGULAR_EVENT_PREFIX,
14
+ R as AceGridComponent,
15
+ m as defineAceGridElement,
16
+ t as defineAceGridUseGridElement
17
+ };
@@ -0,0 +1,18 @@
1
+ export interface AceGridAngularReadyEvent {
2
+ element: HTMLElement;
3
+ }
4
+ export interface AceGridAngularComponentInputs {
5
+ props?: unknown;
6
+ hookOptions?: unknown;
7
+ templates?: Record<string, unknown> | null;
8
+ iconTemplates?: Record<string, unknown> | null;
9
+ }
10
+ export declare class AceGridComponent {
11
+ props?: unknown;
12
+ hookOptions?: unknown;
13
+ templates?: Record<string, unknown> | null;
14
+ iconTemplates?: Record<string, unknown> | null;
15
+ }
16
+ export declare const ACE_GRID_ANGULAR_COMMON_EVENTS: Record<string, string>;
17
+ export declare const ACE_GRID_ANGULAR_DEFAULT_TAG_NAME: string;
18
+ export declare const ACE_GRID_ANGULAR_EVENT_PREFIX: string;
@@ -0,0 +1,242 @@
1
+ import { ViewChild as w, Input as m, Output as l, Component as y, ChangeDetectionStrategy as f, EventEmitter as r, inject as g, NgZone as O, ApplicationRef as R, EnvironmentInjector as T, createComponent as v } from "@angular/core";
2
+ var A = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, i = (e, t, s, a) => {
3
+ for (var o = a > 1 ? void 0 : a ? _(t, s) : t, p = e.length - 1, h; p >= 0; p--)
4
+ (h = e[p]) && (o = (a ? h(t, s, o) : h(o)) || o);
5
+ return a && o && A(t, s, o), o;
6
+ };
7
+ const u = "ace-grid", D = "ace-grid-", c = {
8
+ cellChange: "ace-grid-cell-change",
9
+ rowAdd: "ace-grid-row-add",
10
+ rowDelete: "ace-grid-row-delete",
11
+ selectionChange: "ace-grid-selection-change",
12
+ selectionRangeChange: "ace-grid-selection-range-change",
13
+ sortChange: "ace-grid-sort-change",
14
+ sortModelChange: "ace-grid-sort-model-change",
15
+ filterChange: "ace-grid-filter-change"
16
+ };
17
+ let n = class {
18
+ constructor() {
19
+ this.customTagName = u, this.props = {}, this.hookOptions = null, this.templates = null, this.iconTemplates = null, this.elementClassName = "", this.ready = new r(), this.customEvent = new r(), this.cellChange = new r(), this.rowAdd = new r(), this.rowDelete = new r(), this.selectionChange = new r(), this.selectionRangeChange = new r(), this.sortChange = new r(), this.sortModelChange = new r(), this.filterChange = new r(), this.zone = g(O), this.appRef = g(R), this.environmentInjector = g(T), this.element = null, this.unpatchDispatchEvent = null, this.getElement = () => this.element, this.rerender = () => {
20
+ this.element?.rerender();
21
+ }, this.setProps = (e) => {
22
+ this.element?.setProps?.(e);
23
+ }, this.getProps = () => this.element?.getProps?.() ?? null, this.setTemplates = (e) => {
24
+ this.element?.setTemplates?.(e);
25
+ }, this.getTemplates = () => this.element?.getTemplates?.() ?? null, this.setIconTemplates = (e) => {
26
+ this.iconTemplates = {
27
+ ...this.iconTemplates ?? {},
28
+ ...e
29
+ }, this.applyInputs(
30
+ this.props,
31
+ this.hookOptions,
32
+ this.templates,
33
+ this.iconTemplates
34
+ );
35
+ }, this.getIconTemplates = () => this.iconTemplates ?? null, this.setHookOptions = (e) => {
36
+ const t = this.element;
37
+ t?.setHookOptions && t.setHookOptions(e);
38
+ }, this.getHookOptions = () => {
39
+ const e = this.element;
40
+ return e?.getHookOptions ? e.getHookOptions() : null;
41
+ }, this.getRows = () => this.element?.getRows?.() ?? null, this.getActions = () => this.element?.getActions?.() ?? null, this.getApi = () => this.element?.getApi?.() ?? null;
42
+ }
43
+ ngAfterViewInit() {
44
+ const e = (this.customTagName ?? "").trim() || u, t = this.containerRef.nativeElement;
45
+ this.ensureElement(t, e, this.elementClassName), this.applyInputs(
46
+ this.props,
47
+ this.hookOptions,
48
+ this.templates,
49
+ this.iconTemplates
50
+ );
51
+ }
52
+ ngOnChanges(e) {
53
+ if (!this.containerRef) return;
54
+ const t = this.containerRef.nativeElement, s = (this.customTagName ?? "").trim() || u;
55
+ (e.customTagName || e.elementClassName) && this.ensureElement(t, s, this.elementClassName), (e.props || e.hookOptions || e.templates || e.iconTemplates) && this.applyInputs(
56
+ this.props,
57
+ this.hookOptions,
58
+ this.templates,
59
+ this.iconTemplates
60
+ );
61
+ }
62
+ ngOnDestroy() {
63
+ this.teardownElement();
64
+ }
65
+ ensureElement(e, t, s) {
66
+ const a = this.element?.tagName.toLowerCase();
67
+ if (!this.element || a !== t.toLowerCase()) {
68
+ this.teardownElement();
69
+ const o = document.createElement(
70
+ t
71
+ );
72
+ o.style.display = "block", o.style.width = "100%", o.className = s, e.replaceChildren(o), this.element = o, this.unpatchDispatchEvent = this.patchDispatchEvent(o), this.ready.emit({ element: o });
73
+ return;
74
+ }
75
+ this.element.className = s;
76
+ }
77
+ applyInputs(e, t, s, a) {
78
+ this.element && (this.element.props = e ?? {}, this.element.templates = this.mergeTemplateRegistries(
79
+ s,
80
+ this.buildAngularIconTemplateRegistry(a)
81
+ ) ?? {}, "hookOptions" in this.element && (this.element.hookOptions = t ?? {}));
82
+ }
83
+ patchDispatchEvent(e) {
84
+ const t = e.dispatchEvent.bind(e);
85
+ return e.dispatchEvent = ((s) => (s.type.startsWith(D) && this.zone.run(() => {
86
+ this.emitCustomEvent(s);
87
+ }), t(s))), () => {
88
+ e.dispatchEvent = t;
89
+ };
90
+ }
91
+ emitCustomEvent(e) {
92
+ this.customEvent.emit(e);
93
+ const t = e.detail;
94
+ switch (e.type) {
95
+ case c.cellChange:
96
+ this.cellChange.emit(t);
97
+ break;
98
+ case c.rowAdd:
99
+ this.rowAdd.emit(t);
100
+ break;
101
+ case c.rowDelete:
102
+ this.rowDelete.emit(t);
103
+ break;
104
+ case c.selectionChange:
105
+ this.selectionChange.emit(t);
106
+ break;
107
+ case c.selectionRangeChange:
108
+ this.selectionRangeChange.emit(t);
109
+ break;
110
+ case c.sortChange:
111
+ this.sortChange.emit(t);
112
+ break;
113
+ case c.sortModelChange:
114
+ this.sortModelChange.emit(t);
115
+ break;
116
+ case c.filterChange:
117
+ this.filterChange.emit(t);
118
+ break;
119
+ }
120
+ }
121
+ teardownElement() {
122
+ this.unpatchDispatchEvent?.(), this.unpatchDispatchEvent = null, this.element?.remove(), this.element = null;
123
+ }
124
+ buildAngularIconTemplateRegistry(e) {
125
+ if (!e || Object.keys(e).length === 0)
126
+ return null;
127
+ const t = Object.entries(e).filter((s) => !!s[1]).map(([s, a]) => [
128
+ s,
129
+ ({ props: o }) => {
130
+ const p = document.createElement("span");
131
+ p.style.display = "contents";
132
+ const h = v(a, {
133
+ environmentInjector: this.environmentInjector,
134
+ hostElement: p
135
+ }), d = new Set(
136
+ Object.keys(a.ɵcmp?.inputs ?? {})
137
+ );
138
+ return this.appRef.attachView(h.hostView), Object.entries(o).forEach(([C, E]) => {
139
+ (d.size === 0 || d.has(C)) && h.setInput(C, E);
140
+ }), h.changeDetectorRef.detectChanges(), {
141
+ node: p,
142
+ cleanup: () => {
143
+ this.appRef.detachView(h.hostView), h.destroy();
144
+ }
145
+ };
146
+ }
147
+ ]);
148
+ return {
149
+ icons: Object.fromEntries(t)
150
+ };
151
+ }
152
+ mergeTemplateRegistries(e, t) {
153
+ return !e && !t ? null : {
154
+ ...e ?? {},
155
+ ...t ?? {},
156
+ icons: {
157
+ ...e?.icons ?? {},
158
+ ...t?.icons ?? {}
159
+ }
160
+ };
161
+ }
162
+ };
163
+ i([
164
+ w("container")
165
+ ], n.prototype, "containerRef", 2);
166
+ i([
167
+ m()
168
+ ], n.prototype, "customTagName", 2);
169
+ i([
170
+ m()
171
+ ], n.prototype, "props", 2);
172
+ i([
173
+ m()
174
+ ], n.prototype, "hookOptions", 2);
175
+ i([
176
+ m()
177
+ ], n.prototype, "templates", 2);
178
+ i([
179
+ m()
180
+ ], n.prototype, "iconTemplates", 2);
181
+ i([
182
+ m()
183
+ ], n.prototype, "elementClassName", 2);
184
+ i([
185
+ l()
186
+ ], n.prototype, "ready", 2);
187
+ i([
188
+ l()
189
+ ], n.prototype, "customEvent", 2);
190
+ i([
191
+ l()
192
+ ], n.prototype, "cellChange", 2);
193
+ i([
194
+ l()
195
+ ], n.prototype, "rowAdd", 2);
196
+ i([
197
+ l()
198
+ ], n.prototype, "rowDelete", 2);
199
+ i([
200
+ l()
201
+ ], n.prototype, "selectionChange", 2);
202
+ i([
203
+ l()
204
+ ], n.prototype, "selectionRangeChange", 2);
205
+ i([
206
+ l()
207
+ ], n.prototype, "sortChange", 2);
208
+ i([
209
+ l()
210
+ ], n.prototype, "sortModelChange", 2);
211
+ i([
212
+ l()
213
+ ], n.prototype, "filterChange", 2);
214
+ n = i([
215
+ y({
216
+ standalone: !0,
217
+ selector: "ace-grid-angular",
218
+ template: '<div #container class="ace-grid-angular__container"></div>',
219
+ styles: [
220
+ `
221
+ :host {
222
+ display: block;
223
+ width: 100%;
224
+ height: 100%;
225
+ }
226
+
227
+ .ace-grid-angular__container {
228
+ display: block;
229
+ width: 100%;
230
+ height: 100%;
231
+ }
232
+ `
233
+ ],
234
+ changeDetection: f.OnPush
235
+ })
236
+ ], n);
237
+ export {
238
+ c as ACE_GRID_ANGULAR_COMMON_EVENTS,
239
+ u as ACE_GRID_ANGULAR_DEFAULT_TAG_NAME,
240
+ D as ACE_GRID_ANGULAR_EVENT_PREFIX,
241
+ n as AceGridComponent
242
+ };