@handsontable/angular-wrapper 18.1.2 → 19.0.0-rc1
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 +36 -17
- package/fesm2022/handsontable-angular-wrapper.mjs +1416 -1508
- package/fesm2022/handsontable-angular-wrapper.mjs.map +1 -1
- package/package.json +1 -1
- package/types/handsontable-angular-wrapper.d.ts +929 -0
- package/index.d.ts +0 -5
- package/lib/editor/base-editor-adapter.d.ts +0 -92
- package/lib/editor/custom-editor-placeholder.component.d.ts +0 -33
- package/lib/editor/editor-factory-adapter.d.ts +0 -13
- package/lib/editor/hot-cell-editor-advanced.component.d.ts +0 -42
- package/lib/editor/hot-cell-editor-base.directive.d.ts +0 -25
- package/lib/editor/hot-cell-editor.component.d.ts +0 -37
- package/lib/editor/models/factory-editor-properties.d.ts +0 -32
- package/lib/editor/models/keyboard-shortcut-config.d.ts +0 -13
- package/lib/hot-table.component.d.ts +0 -63
- package/lib/hot-table.module.d.ts +0 -8
- package/lib/models/column-settings.d.ts +0 -27
- package/lib/models/grid-settings.d.ts +0 -8
- package/lib/renderer/hot-cell-renderer-advanced.component.d.ts +0 -16
- package/lib/renderer/hot-cell-renderer-base.directive.d.ts +0 -23
- package/lib/renderer/hot-cell-renderer.component.d.ts +0 -17
- package/lib/renderer/hot-dynamic-renderer-component.service.d.ts +0 -183
- package/lib/services/hot-global-config.service.d.ts +0 -110
- package/lib/services/hot-settings-resolver.service.d.ts +0 -77
- package/public-api.d.ts +0 -12
|
@@ -1,50 +1,64 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { takeUntilDestroyed } from
|
|
4
|
-
import Handsontable from
|
|
5
|
-
import {
|
|
6
|
-
import { editorFactory } from
|
|
7
|
-
import { baseRenderer,
|
|
8
|
-
import { BehaviorSubject } from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, EventEmitter, HostBinding, Inject, Injectable, InjectionToken, Input, NgModule, Output, PLATFORM_ID, ViewChild, ViewContainerRef, ViewEncapsulation, createComponent, inject } from "@angular/core";
|
|
3
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
4
|
+
import Handsontable from "handsontable/base";
|
|
5
|
+
import { skip, take } from "rxjs/operators";
|
|
6
|
+
import { editorFactory } from "handsontable/editors/factory";
|
|
7
|
+
import { baseRenderer, registerRenderer, rendererFactory } from "handsontable/renderers";
|
|
8
|
+
import { BehaviorSubject } from "rxjs";
|
|
9
|
+
var CustomEditorPlaceholderComponent = class CustomEditorPlaceholderComponent {
|
|
10
|
+
top;
|
|
11
|
+
left;
|
|
12
|
+
height;
|
|
13
|
+
width;
|
|
14
|
+
set isVisible(value) {
|
|
15
|
+
this._isVisible = value;
|
|
16
|
+
}
|
|
17
|
+
placeholderCustomClass = "handsontableInputHolder ht_clone_master";
|
|
18
|
+
set componentRef(hotEditorComponentRef) {
|
|
19
|
+
if (hotEditorComponentRef) this.container.insert(hotEditorComponentRef.hostView);
|
|
20
|
+
}
|
|
21
|
+
container;
|
|
22
|
+
get display() {
|
|
23
|
+
return this._isVisible ? "block" : "none";
|
|
24
|
+
}
|
|
25
|
+
_isVisible = false;
|
|
26
|
+
detachEditor() {
|
|
27
|
+
this.container.detach();
|
|
28
|
+
}
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
30
|
+
minVersion: "12.0.0",
|
|
31
|
+
version: "22.2.2",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: CustomEditorPlaceholderComponent,
|
|
34
|
+
deps: [],
|
|
35
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
36
|
+
});
|
|
37
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
38
|
+
minVersion: "14.0.0",
|
|
39
|
+
version: "22.2.2",
|
|
40
|
+
type: CustomEditorPlaceholderComponent,
|
|
41
|
+
isStandalone: true,
|
|
42
|
+
selector: "ng-component",
|
|
43
|
+
inputs: {
|
|
44
|
+
top: "top",
|
|
45
|
+
left: "left",
|
|
46
|
+
height: "height",
|
|
47
|
+
width: "width",
|
|
48
|
+
isVisible: "isVisible",
|
|
49
|
+
placeholderCustomClass: "placeholderCustomClass",
|
|
50
|
+
componentRef: "componentRef"
|
|
51
|
+
},
|
|
52
|
+
viewQueries: [{
|
|
53
|
+
propertyName: "container",
|
|
54
|
+
first: true,
|
|
55
|
+
predicate: ["inputPlaceholder"],
|
|
56
|
+
descendants: true,
|
|
57
|
+
read: ViewContainerRef,
|
|
58
|
+
static: true
|
|
59
|
+
}],
|
|
60
|
+
ngImport: i0,
|
|
61
|
+
template: ` <div
|
|
48
62
|
[class]="placeholderCustomClass"
|
|
49
63
|
[style.display]="display"
|
|
50
64
|
[style.width.px]="width"
|
|
@@ -55,12 +69,20 @@ class CustomEditorPlaceholderComponent {
|
|
|
55
69
|
[style.left.px]="left"
|
|
56
70
|
>
|
|
57
71
|
<ng-template #inputPlaceholder></ng-template>
|
|
58
|
-
</div>`,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
</div>`,
|
|
73
|
+
isInline: true,
|
|
74
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
78
|
+
minVersion: "12.0.0",
|
|
79
|
+
version: "22.2.2",
|
|
80
|
+
ngImport: i0,
|
|
81
|
+
type: CustomEditorPlaceholderComponent,
|
|
82
|
+
decorators: [{
|
|
83
|
+
type: Component,
|
|
84
|
+
args: [{
|
|
85
|
+
template: ` <div
|
|
64
86
|
[class]="placeholderCustomClass"
|
|
65
87
|
[style.display]="display"
|
|
66
88
|
[style.width.px]="width"
|
|
@@ -72,1484 +94,1370 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
72
94
|
>
|
|
73
95
|
<ng-template #inputPlaceholder></ng-template>
|
|
74
96
|
</div>`,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
tabindex = -1;
|
|
413
|
-
/** The data-hot-input attribute for the editor. */
|
|
414
|
-
dataHotInput = '';
|
|
415
|
-
/** The handsontableInput class for the editor. */
|
|
416
|
-
handsontableInputClass = true;
|
|
417
|
-
/** Event triggered by Handsontable on closing the editor. */
|
|
418
|
-
onClose() { }
|
|
419
|
-
/** Event triggered by Handsontable on opening the editor. */
|
|
420
|
-
onOpen(event) { }
|
|
421
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HotCellEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
422
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: HotCellEditorComponent, isStandalone: true, host: { properties: { "attr.tabindex": "this.tabindex", "attr.data-hot-input": "this.dataHotInput", "class.handsontableInput": "this.handsontableInputClass" } }, usesInheritance: true, ngImport: i0 });
|
|
423
|
-
}
|
|
424
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HotCellEditorComponent, decorators: [{
|
|
425
|
-
type: Directive
|
|
426
|
-
}], propDecorators: { tabindex: [{
|
|
427
|
-
type: HostBinding,
|
|
428
|
-
args: ['attr.tabindex']
|
|
429
|
-
}], dataHotInput: [{
|
|
430
|
-
type: HostBinding,
|
|
431
|
-
args: ['attr.data-hot-input']
|
|
432
|
-
}], handsontableInputClass: [{
|
|
433
|
-
type: HostBinding,
|
|
434
|
-
args: ['class.handsontableInput']
|
|
435
|
-
}] } });
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Factory function to create a custom Handsontable editor adapter for Angular components.
|
|
439
|
-
*
|
|
440
|
-
* This adapter integrates Angular components with Handsontable's editor system using the new
|
|
441
|
-
* editorFactory API, allowing you to use Angular components as custom cell editors while
|
|
442
|
-
* maintaining full Angular lifecycle management and change detection.
|
|
443
|
-
*
|
|
444
|
-
* @returns A custom editor class that can be used in Handsontable column settings.
|
|
445
|
-
*
|
|
446
|
-
*/
|
|
97
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
98
|
+
standalone: true
|
|
99
|
+
}]
|
|
100
|
+
}],
|
|
101
|
+
propDecorators: {
|
|
102
|
+
top: [{ type: Input }],
|
|
103
|
+
left: [{ type: Input }],
|
|
104
|
+
height: [{ type: Input }],
|
|
105
|
+
width: [{ type: Input }],
|
|
106
|
+
isVisible: [{ type: Input }],
|
|
107
|
+
placeholderCustomClass: [{ type: Input }],
|
|
108
|
+
componentRef: [{ type: Input }],
|
|
109
|
+
container: [{
|
|
110
|
+
type: ViewChild,
|
|
111
|
+
args: ["inputPlaceholder", {
|
|
112
|
+
read: ViewContainerRef,
|
|
113
|
+
static: true
|
|
114
|
+
}]
|
|
115
|
+
}]
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
var BaseEditorAdapter = class extends Handsontable.editors.BaseEditor {
|
|
119
|
+
_componentRef;
|
|
120
|
+
_editorPlaceHolderRef;
|
|
121
|
+
_isPlaceholderReady = false;
|
|
122
|
+
_finishEditSubscription;
|
|
123
|
+
_cancelEditSubscription;
|
|
124
|
+
constructor(instance) {
|
|
125
|
+
super(instance);
|
|
126
|
+
this.hot.addHook("afterRowResize", this.onAfterRowResize.bind(this));
|
|
127
|
+
this.hot.addHook("afterColumnResize", this.onAfterColumnResize.bind(this));
|
|
128
|
+
this.hot.addHook("afterDestroy", this.onAfterDestroy.bind(this));
|
|
129
|
+
}
|
|
130
|
+
prepare(row, column, prop, TD, originalValue, cellProperties) {
|
|
131
|
+
if (!this.isOpened()) {
|
|
132
|
+
super.prepare(row, column, prop, TD, originalValue, cellProperties);
|
|
133
|
+
const columnMeta = this.hot.getColumnMeta(column);
|
|
134
|
+
if (!this._isPlaceholderReady) {
|
|
135
|
+
this.createEditorPlaceholder(columnMeta._environmentInjector);
|
|
136
|
+
this._isPlaceholderReady = true;
|
|
137
|
+
}
|
|
138
|
+
this._componentRef = columnMeta._editorComponentReference;
|
|
139
|
+
this.cleanupSubscriptions();
|
|
140
|
+
this._finishEditSubscription = this._componentRef.instance.finishEdit.pipe(take(1)).subscribe(() => {
|
|
141
|
+
this.finishEditing();
|
|
142
|
+
});
|
|
143
|
+
this._cancelEditSubscription = this._componentRef.instance.cancelEdit.pipe(take(1)).subscribe(() => {
|
|
144
|
+
this.cancelChanges();
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
close() {
|
|
149
|
+
if (this.isOpened()) {
|
|
150
|
+
this.resetEditorState();
|
|
151
|
+
this._editorPlaceHolderRef?.changeDetectorRef.detectChanges();
|
|
152
|
+
this._editorPlaceHolderRef?.instance.detachEditor();
|
|
153
|
+
this._componentRef?.instance.onClose();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
focus() {
|
|
157
|
+
this._componentRef?.instance.onFocus();
|
|
158
|
+
}
|
|
159
|
+
getValue() {
|
|
160
|
+
return this._componentRef?.instance?.getValue();
|
|
161
|
+
}
|
|
162
|
+
open(event) {
|
|
163
|
+
this.hot.getShortcutManager().setActiveContextName("editor");
|
|
164
|
+
this.applyPropsToEditor();
|
|
165
|
+
this._componentRef?.instance.onOpen(event);
|
|
166
|
+
}
|
|
167
|
+
setValue(newValue) {
|
|
168
|
+
this._componentRef?.instance?.setValue(newValue);
|
|
169
|
+
this._componentRef?.changeDetectorRef.detectChanges();
|
|
170
|
+
}
|
|
171
|
+
applyPropsToEditor() {
|
|
172
|
+
if (!this._componentRef || !this._editorPlaceHolderRef) return;
|
|
173
|
+
const rect = this.getEditedCellRect();
|
|
174
|
+
if (!this.isInFullEditMode()) this._componentRef.instance.setValue(null);
|
|
175
|
+
this._componentRef.setInput("originalValue", this.originalValue);
|
|
176
|
+
this._componentRef.setInput("row", this.row);
|
|
177
|
+
this._componentRef.setInput("column", this.col);
|
|
178
|
+
this._componentRef.setInput("prop", this.prop);
|
|
179
|
+
this._componentRef.setInput("cellProperties", this.cellProperties);
|
|
180
|
+
this._editorPlaceHolderRef.setInput("top", rect.top);
|
|
181
|
+
this._editorPlaceHolderRef.setInput("left", rect.start);
|
|
182
|
+
this._editorPlaceHolderRef.setInput("height", rect.height);
|
|
183
|
+
this._editorPlaceHolderRef.setInput("width", rect.width);
|
|
184
|
+
this._editorPlaceHolderRef.setInput("isVisible", true);
|
|
185
|
+
this._editorPlaceHolderRef.setInput("componentRef", this._componentRef);
|
|
186
|
+
this._editorPlaceHolderRef.changeDetectorRef.detectChanges();
|
|
187
|
+
}
|
|
188
|
+
createEditorPlaceholder(injector) {
|
|
189
|
+
this._editorPlaceHolderRef = createComponent(CustomEditorPlaceholderComponent, { environmentInjector: injector });
|
|
190
|
+
this.hot.rootElement.appendChild(this._editorPlaceHolderRef.location.nativeElement);
|
|
191
|
+
}
|
|
192
|
+
onAfterColumnResize() {
|
|
193
|
+
if (this.isOpened()) this.applyPropsToEditor();
|
|
194
|
+
}
|
|
195
|
+
onAfterRowResize() {
|
|
196
|
+
if (this.isOpened()) this.applyPropsToEditor();
|
|
197
|
+
}
|
|
198
|
+
onAfterDestroy() {
|
|
199
|
+
this.cleanupSubscriptions();
|
|
200
|
+
this._editorPlaceHolderRef?.destroy();
|
|
201
|
+
}
|
|
202
|
+
cleanupSubscriptions() {
|
|
203
|
+
if (this._finishEditSubscription) {
|
|
204
|
+
this._finishEditSubscription.unsubscribe();
|
|
205
|
+
this._finishEditSubscription = void 0;
|
|
206
|
+
}
|
|
207
|
+
if (this._cancelEditSubscription) {
|
|
208
|
+
this._cancelEditSubscription.unsubscribe();
|
|
209
|
+
this._cancelEditSubscription = void 0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
resetEditorState() {
|
|
213
|
+
if (!this._editorPlaceHolderRef) return;
|
|
214
|
+
this._editorPlaceHolderRef.setInput("top", void 0);
|
|
215
|
+
this._editorPlaceHolderRef.setInput("left", void 0);
|
|
216
|
+
this._editorPlaceHolderRef.setInput("height", void 0);
|
|
217
|
+
this._editorPlaceHolderRef.setInput("width", void 0);
|
|
218
|
+
this._editorPlaceHolderRef.setInput("isVisible", false);
|
|
219
|
+
this._editorPlaceHolderRef.setInput("componentRef", void 0);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
var HotCellRendererBase = class HotCellRendererBase {
|
|
223
|
+
value = "";
|
|
224
|
+
instance;
|
|
225
|
+
td;
|
|
226
|
+
row;
|
|
227
|
+
col;
|
|
228
|
+
prop;
|
|
229
|
+
cellProperties;
|
|
230
|
+
getProps() {
|
|
231
|
+
return this.cellProperties?.rendererProps ?? {};
|
|
232
|
+
}
|
|
233
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
234
|
+
minVersion: "12.0.0",
|
|
235
|
+
version: "22.2.2",
|
|
236
|
+
ngImport: i0,
|
|
237
|
+
type: HotCellRendererBase,
|
|
238
|
+
deps: [],
|
|
239
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
240
|
+
});
|
|
241
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
242
|
+
minVersion: "14.0.0",
|
|
243
|
+
version: "22.2.2",
|
|
244
|
+
type: HotCellRendererBase,
|
|
245
|
+
isStandalone: true,
|
|
246
|
+
inputs: {
|
|
247
|
+
value: "value",
|
|
248
|
+
instance: "instance",
|
|
249
|
+
td: "td",
|
|
250
|
+
row: "row",
|
|
251
|
+
col: "col",
|
|
252
|
+
prop: "prop",
|
|
253
|
+
cellProperties: "cellProperties"
|
|
254
|
+
},
|
|
255
|
+
ngImport: i0
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
259
|
+
minVersion: "12.0.0",
|
|
260
|
+
version: "22.2.2",
|
|
261
|
+
ngImport: i0,
|
|
262
|
+
type: HotCellRendererBase,
|
|
263
|
+
decorators: [{ type: Directive }],
|
|
264
|
+
propDecorators: {
|
|
265
|
+
value: [{ type: Input }],
|
|
266
|
+
instance: [{ type: Input }],
|
|
267
|
+
td: [{ type: Input }],
|
|
268
|
+
row: [{ type: Input }],
|
|
269
|
+
col: [{ type: Input }],
|
|
270
|
+
prop: [{ type: Input }],
|
|
271
|
+
cellProperties: [{ type: Input }]
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
var HotCellRendererComponent = class HotCellRendererComponent extends HotCellRendererBase {
|
|
275
|
+
static RENDERER_MARKER = Symbol("HotCellRendererComponent");
|
|
276
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
277
|
+
minVersion: "12.0.0",
|
|
278
|
+
version: "22.2.2",
|
|
279
|
+
ngImport: i0,
|
|
280
|
+
type: HotCellRendererComponent,
|
|
281
|
+
deps: null,
|
|
282
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
283
|
+
});
|
|
284
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
285
|
+
minVersion: "14.0.0",
|
|
286
|
+
version: "22.2.2",
|
|
287
|
+
type: HotCellRendererComponent,
|
|
288
|
+
isStandalone: true,
|
|
289
|
+
selector: "hot-cell-renderer",
|
|
290
|
+
usesInheritance: true,
|
|
291
|
+
ngImport: i0,
|
|
292
|
+
template: `<!-- This is an abstract component. Extend this component and provide your own template. -->`,
|
|
293
|
+
isInline: true,
|
|
294
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
298
|
+
minVersion: "12.0.0",
|
|
299
|
+
version: "22.2.2",
|
|
300
|
+
ngImport: i0,
|
|
301
|
+
type: HotCellRendererComponent,
|
|
302
|
+
decorators: [{
|
|
303
|
+
type: Component,
|
|
304
|
+
args: [{
|
|
305
|
+
selector: "hot-cell-renderer",
|
|
306
|
+
template: `<!-- This is an abstract component. Extend this component and provide your own template. -->`,
|
|
307
|
+
standalone: true,
|
|
308
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
309
|
+
}]
|
|
310
|
+
}]
|
|
311
|
+
});
|
|
312
|
+
var HotCellEditorBase = class HotCellEditorBase {
|
|
313
|
+
heightFitParentContainer = 100;
|
|
314
|
+
widthFitParentContainer = 100;
|
|
315
|
+
row;
|
|
316
|
+
column;
|
|
317
|
+
prop;
|
|
318
|
+
originalValue;
|
|
319
|
+
cellProperties;
|
|
320
|
+
finishEdit = new EventEmitter();
|
|
321
|
+
cancelEdit = new EventEmitter();
|
|
322
|
+
value;
|
|
323
|
+
getValue() {
|
|
324
|
+
return this.value;
|
|
325
|
+
}
|
|
326
|
+
setValue(value) {
|
|
327
|
+
this.value = value;
|
|
328
|
+
}
|
|
329
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
330
|
+
minVersion: "12.0.0",
|
|
331
|
+
version: "22.2.2",
|
|
332
|
+
ngImport: i0,
|
|
333
|
+
type: HotCellEditorBase,
|
|
334
|
+
deps: [],
|
|
335
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
336
|
+
});
|
|
337
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
338
|
+
minVersion: "14.0.0",
|
|
339
|
+
version: "22.2.2",
|
|
340
|
+
type: HotCellEditorBase,
|
|
341
|
+
isStandalone: true,
|
|
342
|
+
inputs: {
|
|
343
|
+
row: "row",
|
|
344
|
+
column: "column",
|
|
345
|
+
prop: "prop",
|
|
346
|
+
originalValue: "originalValue",
|
|
347
|
+
cellProperties: "cellProperties"
|
|
348
|
+
},
|
|
349
|
+
outputs: {
|
|
350
|
+
finishEdit: "finishEdit",
|
|
351
|
+
cancelEdit: "cancelEdit"
|
|
352
|
+
},
|
|
353
|
+
host: { properties: {
|
|
354
|
+
"style.height.%": "this.heightFitParentContainer",
|
|
355
|
+
"style.width.%": "this.widthFitParentContainer"
|
|
356
|
+
} },
|
|
357
|
+
ngImport: i0
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
361
|
+
minVersion: "12.0.0",
|
|
362
|
+
version: "22.2.2",
|
|
363
|
+
ngImport: i0,
|
|
364
|
+
type: HotCellEditorBase,
|
|
365
|
+
decorators: [{ type: Directive }],
|
|
366
|
+
propDecorators: {
|
|
367
|
+
heightFitParentContainer: [{
|
|
368
|
+
type: HostBinding,
|
|
369
|
+
args: ["style.height.%"]
|
|
370
|
+
}],
|
|
371
|
+
widthFitParentContainer: [{
|
|
372
|
+
type: HostBinding,
|
|
373
|
+
args: ["style.width.%"]
|
|
374
|
+
}],
|
|
375
|
+
row: [{ type: Input }],
|
|
376
|
+
column: [{ type: Input }],
|
|
377
|
+
prop: [{ type: Input }],
|
|
378
|
+
originalValue: [{ type: Input }],
|
|
379
|
+
cellProperties: [{ type: Input }],
|
|
380
|
+
finishEdit: [{ type: Output }],
|
|
381
|
+
cancelEdit: [{ type: Output }]
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
var HotCellEditorComponent = class HotCellEditorComponent extends HotCellEditorBase {
|
|
385
|
+
static EDITOR_MARKER = Symbol("HotCellEditorComponent");
|
|
386
|
+
tabindex = -1;
|
|
387
|
+
dataHotInput = "";
|
|
388
|
+
handsontableInputClass = true;
|
|
389
|
+
onClose() {}
|
|
390
|
+
onOpen(event) {}
|
|
391
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
392
|
+
minVersion: "12.0.0",
|
|
393
|
+
version: "22.2.2",
|
|
394
|
+
ngImport: i0,
|
|
395
|
+
type: HotCellEditorComponent,
|
|
396
|
+
deps: null,
|
|
397
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
398
|
+
});
|
|
399
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
400
|
+
minVersion: "14.0.0",
|
|
401
|
+
version: "22.2.2",
|
|
402
|
+
type: HotCellEditorComponent,
|
|
403
|
+
isStandalone: true,
|
|
404
|
+
host: { properties: {
|
|
405
|
+
"attr.tabindex": "this.tabindex",
|
|
406
|
+
"attr.data-hot-input": "this.dataHotInput",
|
|
407
|
+
"class.handsontableInput": "this.handsontableInputClass"
|
|
408
|
+
} },
|
|
409
|
+
usesInheritance: true,
|
|
410
|
+
ngImport: i0
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
414
|
+
minVersion: "12.0.0",
|
|
415
|
+
version: "22.2.2",
|
|
416
|
+
ngImport: i0,
|
|
417
|
+
type: HotCellEditorComponent,
|
|
418
|
+
decorators: [{ type: Directive }],
|
|
419
|
+
propDecorators: {
|
|
420
|
+
tabindex: [{
|
|
421
|
+
type: HostBinding,
|
|
422
|
+
args: ["attr.tabindex"]
|
|
423
|
+
}],
|
|
424
|
+
dataHotInput: [{
|
|
425
|
+
type: HostBinding,
|
|
426
|
+
args: ["attr.data-hot-input"]
|
|
427
|
+
}],
|
|
428
|
+
handsontableInputClass: [{
|
|
429
|
+
type: HostBinding,
|
|
430
|
+
args: ["class.handsontableInput"]
|
|
431
|
+
}]
|
|
432
|
+
}
|
|
433
|
+
});
|
|
447
434
|
const FactoryEditorAdapter = (componentRef) => editorFactory({
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
getValue: (editor) => editor._componentRef.instance.getValue(),
|
|
503
|
-
setValue: (editor, value) => {
|
|
504
|
-
editor.value = value;
|
|
505
|
-
editor._componentRef.instance.setValue(value);
|
|
506
|
-
editor._componentRef.changeDetectorRef.detectChanges();
|
|
507
|
-
},
|
|
435
|
+
position: componentRef.instance.position,
|
|
436
|
+
shortcuts: componentRef.instance.shortcuts,
|
|
437
|
+
shortcutsGroup: componentRef.instance.shortcutsGroup,
|
|
438
|
+
config: componentRef.instance.config,
|
|
439
|
+
init(editor) {
|
|
440
|
+
editor._componentRef = componentRef;
|
|
441
|
+
editor._editorPlaceHolderRef = void 0;
|
|
442
|
+
editor._finishEditSubscription = void 0;
|
|
443
|
+
editor._cancelEditSubscription = void 0;
|
|
444
|
+
createEditorPlaceholder(editor, editor.hot._angularEnvironmentInjector);
|
|
445
|
+
editor.input = editor._editorPlaceHolderRef?.location.nativeElement ?? document.createElement("div");
|
|
446
|
+
editor._afterRowResizeCallback = () => {
|
|
447
|
+
if (editor.isOpened()) applyPropsToEditor(editor);
|
|
448
|
+
};
|
|
449
|
+
editor._afterColumnResizeCallback = () => {
|
|
450
|
+
if (editor.isOpened()) applyPropsToEditor(editor);
|
|
451
|
+
};
|
|
452
|
+
editor._afterDestroyCallback = () => {
|
|
453
|
+
cleanupSubscriptions(editor);
|
|
454
|
+
if (editor._editorPlaceHolderRef) editor._editorPlaceHolderRef.destroy();
|
|
455
|
+
};
|
|
456
|
+
editor.hot.addHook("afterRowResize", editor._afterRowResizeCallback);
|
|
457
|
+
editor.hot.addHook("afterColumnResize", editor._afterColumnResizeCallback);
|
|
458
|
+
editor.hot.addHook("afterDestroy", editor._afterDestroyCallback);
|
|
459
|
+
},
|
|
460
|
+
afterInit: (editor) => editor._componentRef.instance.afterInit?.(editor),
|
|
461
|
+
beforeOpen: (editor, context) => {
|
|
462
|
+
cleanupSubscriptions(editor);
|
|
463
|
+
applyPropsToEditor(editor);
|
|
464
|
+
editor._finishEditSubscription = editor._componentRef.instance.finishEdit.pipe(take(1)).subscribe(() => {
|
|
465
|
+
editor.finishEditing();
|
|
466
|
+
});
|
|
467
|
+
editor._cancelEditSubscription = editor._componentRef.instance.cancelEdit.pipe(take(1)).subscribe(() => {
|
|
468
|
+
editor.cancelChanges();
|
|
469
|
+
});
|
|
470
|
+
editor._componentRef.instance.beforeOpen?.(editor, context);
|
|
471
|
+
},
|
|
472
|
+
afterOpen: (editor, event) => {
|
|
473
|
+
editor._componentRef.instance.afterOpen?.(editor, event);
|
|
474
|
+
},
|
|
475
|
+
onFocus: (editor) => editor._componentRef.instance.onFocus?.(editor),
|
|
476
|
+
afterClose: (editor) => {
|
|
477
|
+
cleanupSubscriptions(editor);
|
|
478
|
+
resetEditorState(editor);
|
|
479
|
+
editor._editorPlaceHolderRef?.changeDetectorRef.detectChanges();
|
|
480
|
+
editor._editorPlaceHolderRef?.instance.detachEditor();
|
|
481
|
+
editor._componentRef.instance.afterClose?.(editor);
|
|
482
|
+
},
|
|
483
|
+
getValue: (editor) => editor._componentRef.instance.getValue(),
|
|
484
|
+
setValue: (editor, value) => {
|
|
485
|
+
editor.value = value;
|
|
486
|
+
editor._componentRef.instance.setValue(value);
|
|
487
|
+
editor._componentRef.changeDetectorRef.detectChanges();
|
|
488
|
+
}
|
|
508
489
|
});
|
|
509
|
-
/**
|
|
510
|
-
* Creates the editor placeholder component.
|
|
511
|
-
* @param editor The editor instance.
|
|
512
|
-
* @param injector The environment injector from Angular.
|
|
513
|
-
*/
|
|
514
490
|
function createEditorPlaceholder(editor, injector) {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
editor._editorPlaceHolderRef = createComponent(CustomEditorPlaceholderComponent, {
|
|
519
|
-
environmentInjector: injector,
|
|
520
|
-
});
|
|
491
|
+
if (!injector) return;
|
|
492
|
+
editor._editorPlaceHolderRef = createComponent(CustomEditorPlaceholderComponent, { environmentInjector: injector });
|
|
521
493
|
}
|
|
522
|
-
/**
|
|
523
|
-
* Applies properties to the custom Angular editor and editor placeholder.
|
|
524
|
-
* Updates position, size, and cell context information.
|
|
525
|
-
* @param editor The editor instance.
|
|
526
|
-
*/
|
|
527
494
|
function applyPropsToEditor(editor) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
editor._editorPlaceHolderRef.setInput('componentRef', editor._componentRef);
|
|
542
|
-
editor._editorPlaceHolderRef.changeDetectorRef.detectChanges();
|
|
495
|
+
if (!editor._componentRef || !editor._editorPlaceHolderRef) return;
|
|
496
|
+
editor._componentRef.setInput("originalValue", editor.originalValue);
|
|
497
|
+
editor._componentRef.setInput("row", editor.row);
|
|
498
|
+
editor._componentRef.setInput("column", editor.col);
|
|
499
|
+
editor._componentRef.setInput("prop", editor.prop);
|
|
500
|
+
editor._componentRef.setInput("cellProperties", editor.cellProperties);
|
|
501
|
+
const rect = editor.hot.getCell(editor.row, editor.col)?.getBoundingClientRect();
|
|
502
|
+
editor._editorPlaceHolderRef.setInput("placeholderCustomClass", "");
|
|
503
|
+
editor._editorPlaceHolderRef.setInput("height", rect?.height ?? 0);
|
|
504
|
+
editor._editorPlaceHolderRef.setInput("width", rect?.width ?? 0);
|
|
505
|
+
editor._editorPlaceHolderRef.setInput("isVisible", true);
|
|
506
|
+
editor._editorPlaceHolderRef.setInput("componentRef", editor._componentRef);
|
|
507
|
+
editor._editorPlaceHolderRef.changeDetectorRef.detectChanges();
|
|
543
508
|
}
|
|
544
|
-
/**
|
|
545
|
-
* Resets the editor placeholder state.
|
|
546
|
-
* Clears all positioning and visibility settings.
|
|
547
|
-
* @param editor The editor instance.
|
|
548
|
-
*/
|
|
549
509
|
function resetEditorState(editor) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
editor._editorPlaceHolderRef.setInput('isVisible', false);
|
|
558
|
-
editor._editorPlaceHolderRef.setInput('componentRef', undefined);
|
|
510
|
+
if (!editor._editorPlaceHolderRef) return;
|
|
511
|
+
editor._editorPlaceHolderRef.setInput("top", void 0);
|
|
512
|
+
editor._editorPlaceHolderRef.setInput("left", void 0);
|
|
513
|
+
editor._editorPlaceHolderRef.setInput("height", void 0);
|
|
514
|
+
editor._editorPlaceHolderRef.setInput("width", void 0);
|
|
515
|
+
editor._editorPlaceHolderRef.setInput("isVisible", false);
|
|
516
|
+
editor._editorPlaceHolderRef.setInput("componentRef", void 0);
|
|
559
517
|
}
|
|
560
|
-
/**
|
|
561
|
-
* Cleans up existing subscriptions.
|
|
562
|
-
* @param editor The editor instance.
|
|
563
|
-
*/
|
|
564
518
|
function cleanupSubscriptions(editor) {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
* Abstract base component for creating advanced custom cell renderer components for Handsontable.
|
|
577
|
-
*
|
|
578
|
-
* Extend this component and provide your own template to implement a custom renderer.
|
|
579
|
-
* Unlike {@link HotCellRendererComponent}, this variant also accepts object and array values.
|
|
580
|
-
*
|
|
581
|
-
* @template TValue - The type of the component renderer.
|
|
582
|
-
* @template TProps - The type of additional renderer properties.
|
|
583
|
-
*/
|
|
584
|
-
class HotCellRendererAdvancedComponent extends HotCellRendererBase {
|
|
585
|
-
static RENDERER_MARKER = Symbol('HotCellRendererAdvancedComponent');
|
|
586
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HotCellRendererAdvancedComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
587
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: HotCellRendererAdvancedComponent, isStandalone: true, selector: "hot-cell-renderer-advanced", usesInheritance: true, ngImport: i0, template: `<!-- This is an abstract component. Extend this component and provide your own template. -->`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
519
|
+
if (editor._finishEditSubscription) {
|
|
520
|
+
editor._finishEditSubscription.unsubscribe();
|
|
521
|
+
editor._finishEditSubscription = void 0;
|
|
522
|
+
}
|
|
523
|
+
if (editor._cancelEditSubscription) {
|
|
524
|
+
editor._cancelEditSubscription.unsubscribe();
|
|
525
|
+
editor._cancelEditSubscription = void 0;
|
|
526
|
+
}
|
|
588
527
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
528
|
+
var HotCellRendererAdvancedComponent = class HotCellRendererAdvancedComponent extends HotCellRendererBase {
|
|
529
|
+
static RENDERER_MARKER = Symbol("HotCellRendererAdvancedComponent");
|
|
530
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
531
|
+
minVersion: "12.0.0",
|
|
532
|
+
version: "22.2.2",
|
|
533
|
+
ngImport: i0,
|
|
534
|
+
type: HotCellRendererAdvancedComponent,
|
|
535
|
+
deps: null,
|
|
536
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
537
|
+
});
|
|
538
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
539
|
+
minVersion: "14.0.0",
|
|
540
|
+
version: "22.2.2",
|
|
541
|
+
type: HotCellRendererAdvancedComponent,
|
|
542
|
+
isStandalone: true,
|
|
543
|
+
selector: "hot-cell-renderer-advanced",
|
|
544
|
+
usesInheritance: true,
|
|
545
|
+
ngImport: i0,
|
|
546
|
+
template: `<!-- This is an abstract component. Extend this component and provide your own template. -->`,
|
|
547
|
+
isInline: true,
|
|
548
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
549
|
+
});
|
|
550
|
+
};
|
|
551
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
552
|
+
minVersion: "12.0.0",
|
|
553
|
+
version: "22.2.2",
|
|
554
|
+
ngImport: i0,
|
|
555
|
+
type: HotCellRendererAdvancedComponent,
|
|
556
|
+
decorators: [{
|
|
557
|
+
type: Component,
|
|
558
|
+
args: [{
|
|
559
|
+
selector: "hot-cell-renderer-advanced",
|
|
560
|
+
template: `<!-- This is an abstract component. Extend this component and provide your own template. -->`,
|
|
561
|
+
standalone: true,
|
|
562
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
563
|
+
}]
|
|
564
|
+
}]
|
|
565
|
+
});
|
|
566
|
+
var HotCellEditorAdvancedComponent = class HotCellEditorAdvancedComponent extends HotCellEditorBase {
|
|
567
|
+
static EDITOR_MARKER = Symbol("HotCellEditorAdvancedComponent");
|
|
568
|
+
onFocus(editor) {}
|
|
569
|
+
position = "container";
|
|
570
|
+
shortcuts;
|
|
571
|
+
shortcutsGroup;
|
|
572
|
+
config;
|
|
573
|
+
afterOpen(editor, event) {}
|
|
574
|
+
afterClose(editor) {}
|
|
575
|
+
afterInit(editor) {}
|
|
576
|
+
beforeOpen(editor, { row, col, prop, td, originalValue, cellProperties }) {}
|
|
577
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
578
|
+
minVersion: "12.0.0",
|
|
579
|
+
version: "22.2.2",
|
|
580
|
+
ngImport: i0,
|
|
581
|
+
type: HotCellEditorAdvancedComponent,
|
|
582
|
+
deps: null,
|
|
583
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
584
|
+
});
|
|
585
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
586
|
+
minVersion: "14.0.0",
|
|
587
|
+
version: "22.2.2",
|
|
588
|
+
type: HotCellEditorAdvancedComponent,
|
|
589
|
+
isStandalone: true,
|
|
590
|
+
usesInheritance: true,
|
|
591
|
+
ngImport: i0
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
595
|
+
minVersion: "12.0.0",
|
|
596
|
+
version: "22.2.2",
|
|
597
|
+
ngImport: i0,
|
|
598
|
+
type: HotCellEditorAdvancedComponent,
|
|
599
|
+
decorators: [{ type: Directive }]
|
|
600
|
+
});
|
|
601
|
+
const INVALID_RENDERER_WARNING = "The provided renderer component was not recognized as a valid custom renderer. It must either extend HotCellRendererComponent or be a valid TemplateRef. Please ensure that your custom renderer is implemented correctly and imported from the proper source.";
|
|
602
|
+
const INVALID_ADVANCED_RENDERER_WARNING = "The provided renderer component was not recognized as a valid custom renderer. It must either extend HotCellRendererAdvancedComponent. Please ensure that your custom renderer is implemented correctly and imported from the proper source.";
|
|
641
603
|
const RENDERER_INPUT_KEYS = [
|
|
642
|
-
|
|
604
|
+
"instance",
|
|
605
|
+
"td",
|
|
606
|
+
"row",
|
|
607
|
+
"col",
|
|
608
|
+
"prop",
|
|
609
|
+
"value",
|
|
610
|
+
"cellProperties"
|
|
643
611
|
];
|
|
644
|
-
/**
|
|
645
|
-
* Type guard that checks if the given object is a TemplateRef.
|
|
646
|
-
*
|
|
647
|
-
* @param obj - The object to check.
|
|
648
|
-
* @returns True if the object is a TemplateRef; otherwise, false.
|
|
649
|
-
*/
|
|
650
612
|
function isTemplateRef(obj) {
|
|
651
|
-
|
|
613
|
+
return !!obj && typeof obj.createEmbeddedView === "function";
|
|
652
614
|
}
|
|
653
|
-
/**
|
|
654
|
-
* Type guard to check if an object is an instance of HotCellRendererComponent.
|
|
655
|
-
*
|
|
656
|
-
* @param obj - The object to check.
|
|
657
|
-
* @returns True if the object is a HotCellRendererComponent, false otherwise.
|
|
658
|
-
*/
|
|
659
615
|
function isHotCellRendererComponent(obj) {
|
|
660
|
-
|
|
616
|
+
return obj?.RENDERER_MARKER === HotCellRendererComponent.RENDERER_MARKER;
|
|
661
617
|
}
|
|
662
|
-
/**
|
|
663
|
-
* Type guard to check if an object is an instance of HotCellRendererAdvancedComponent.
|
|
664
|
-
*
|
|
665
|
-
* @param obj - The object to check.
|
|
666
|
-
* @returns True if the object is a HotCellRendererAdvancedComponent, false otherwise.
|
|
667
|
-
*/
|
|
668
618
|
function isAdvancedHotCellRendererComponent(obj) {
|
|
669
|
-
|
|
619
|
+
return obj?.RENDERER_MARKER === HotCellRendererAdvancedComponent.RENDERER_MARKER;
|
|
670
620
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* Tracks a component ref both by its TD (for fast replacement) and in the instance registry
|
|
892
|
-
* (for sweeping and full teardown).
|
|
893
|
-
*/
|
|
894
|
-
trackComponentRef(instance, td, ref) {
|
|
895
|
-
this._tdComponentRefs.set(td, ref);
|
|
896
|
-
this.registryFor(this._instanceComponentRefs, instance).add(ref);
|
|
897
|
-
}
|
|
898
|
-
/**
|
|
899
|
-
* Tracks an embedded view both by its TD (for fast replacement) and in the instance registry
|
|
900
|
-
* (for sweeping and full teardown).
|
|
901
|
-
*/
|
|
902
|
-
trackEmbeddedView(instance, td, view) {
|
|
903
|
-
this._tdEmbeddedViews.set(td, view);
|
|
904
|
-
this.registryFor(this._instanceEmbeddedViews, instance).add(view);
|
|
905
|
-
}
|
|
906
|
-
/**
|
|
907
|
-
* Returns the per-instance registry set for the given instance, creating it on first use.
|
|
908
|
-
*/
|
|
909
|
-
registryFor(registry, instance) {
|
|
910
|
-
let set = registry.get(instance);
|
|
911
|
-
if (!set) {
|
|
912
|
-
set = new Set();
|
|
913
|
-
registry.set(instance, set);
|
|
914
|
-
}
|
|
915
|
-
return set;
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* Attaches an embedded view created from a TemplateRef to a given DOM element.
|
|
919
|
-
*
|
|
920
|
-
* @param template - The TemplateRef to create an embedded view from.
|
|
921
|
-
* @param tdEl - The target DOM element (a table cell) to which the view will be appended.
|
|
922
|
-
* @param properties - Context object providing properties to be used within the template.
|
|
923
|
-
* @returns The created EmbeddedViewRef so the caller can track and destroy it later.
|
|
924
|
-
*/
|
|
925
|
-
attachTemplateToElement(template, tdEl, properties) {
|
|
926
|
-
const embeddedView = template.createEmbeddedView({
|
|
927
|
-
$implicit: properties.value,
|
|
928
|
-
...properties,
|
|
929
|
-
});
|
|
930
|
-
embeddedView.detectChanges();
|
|
931
|
-
embeddedView.rootNodes.forEach((node) => {
|
|
932
|
-
tdEl.appendChild(node);
|
|
933
|
-
});
|
|
934
|
-
return embeddedView;
|
|
935
|
-
}
|
|
936
|
-
/**
|
|
937
|
-
* Dynamically creates an Angular component of the given type.
|
|
938
|
-
*
|
|
939
|
-
* @param component - The Angular component type to be created.
|
|
940
|
-
* @param rendererParameters - An object containing input properties to assign to the component instance.
|
|
941
|
-
* @returns The ComponentRef of the dynamically created component.
|
|
942
|
-
*/
|
|
943
|
-
createComponent(component, rendererParameters) {
|
|
944
|
-
const componentRef = createComponent(component, {
|
|
945
|
-
environmentInjector: this.environmentInjector,
|
|
946
|
-
});
|
|
947
|
-
this.applyInputs(componentRef, rendererParameters);
|
|
948
|
-
componentRef.changeDetectorRef.detectChanges();
|
|
949
|
-
this.appRef.attachView(componentRef.hostView);
|
|
950
|
-
return componentRef;
|
|
951
|
-
}
|
|
952
|
-
/**
|
|
953
|
-
* Renders an Angular component into the given cell, recycling the component already attached to
|
|
954
|
-
* the TD when it is of the same type. Handsontable recycles its pool of TD elements heavily while
|
|
955
|
-
* virtualizing rows, so recreating an Angular component on every re-render would cause needless
|
|
956
|
-
* teardown/instantiation churn and GC pressure. When the type matches we only refresh the inputs.
|
|
957
|
-
*
|
|
958
|
-
* @param td - The target table cell.
|
|
959
|
-
* @param component - The renderer component type to render.
|
|
960
|
-
* @param properties - The renderer parameters to feed as component inputs.
|
|
961
|
-
*/
|
|
962
|
-
renderComponent(td, component, properties) {
|
|
963
|
-
const prevRef = this._tdComponentRefs.get(td);
|
|
964
|
-
if (prevRef &&
|
|
965
|
-
prevRef.componentType === component &&
|
|
966
|
-
this.isViewConnected(prevRef.hostView)) {
|
|
967
|
-
this.applyInputs(prevRef, properties);
|
|
968
|
-
prevRef.changeDetectorRef.detectChanges();
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
this.replaceCellContent(properties.instance, td);
|
|
972
|
-
const componentRef = this.createComponent(component, properties);
|
|
973
|
-
this.attachComponentToElement(componentRef, td);
|
|
974
|
-
this.trackComponentRef(properties.instance, td, componentRef);
|
|
975
|
-
}
|
|
976
|
-
/**
|
|
977
|
-
* Assigns every renderer parameter as an input on the given component ref.
|
|
978
|
-
*
|
|
979
|
-
* @param componentRef - The component ref whose inputs should be set.
|
|
980
|
-
* @param rendererParameters - The renderer parameters to assign.
|
|
981
|
-
*/
|
|
982
|
-
applyInputs(componentRef, rendererParameters) {
|
|
983
|
-
RENDERER_INPUT_KEYS.forEach((key) => {
|
|
984
|
-
componentRef.setInput(key, rendererParameters[key]);
|
|
985
|
-
});
|
|
986
|
-
}
|
|
987
|
-
/**
|
|
988
|
-
* Attaches a dynamically created component's view to a specified DOM container element.
|
|
989
|
-
*
|
|
990
|
-
* @param componentRef - The reference to the dynamically created component.
|
|
991
|
-
* @param container - The target DOM element to which the component's root node will be appended.
|
|
992
|
-
*/
|
|
993
|
-
attachComponentToElement(componentRef, container) {
|
|
994
|
-
componentRef.hostView.rootNodes.forEach((node) => {
|
|
995
|
-
container.appendChild(node);
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
|
-
/**
|
|
999
|
-
* Destroys a dynamically created component and detaches its view from the Angular application.
|
|
1000
|
-
*
|
|
1001
|
-
* Idempotent: a TD recycled after `sweepDetachedViews` already destroyed its ref still maps to that
|
|
1002
|
-
* stale ref in `_tdComponentRefs`, so the next render path may reach this with an already-destroyed
|
|
1003
|
-
* ref. Guarding on `destroyed` skips the redundant detach/destroy instead of relying on Angular's
|
|
1004
|
-
* internal no-op behaviour.
|
|
1005
|
-
*
|
|
1006
|
-
* @param componentRef - The reference to the component to be destroyed.
|
|
1007
|
-
*/
|
|
1008
|
-
destroyComponent(componentRef) {
|
|
1009
|
-
const hostView = componentRef.hostView;
|
|
1010
|
-
if (hostView.destroyed) {
|
|
1011
|
-
return;
|
|
1012
|
-
}
|
|
1013
|
-
this.appRef.detachView(hostView);
|
|
1014
|
-
componentRef.destroy();
|
|
1015
|
-
}
|
|
1016
|
-
/**
|
|
1017
|
-
* Destroys an embedded view. Idempotent for the same reason as {@link destroyComponent}: a recycled
|
|
1018
|
-
* TD can still map to an already-destroyed view in `_tdEmbeddedViews`.
|
|
1019
|
-
*
|
|
1020
|
-
* @param view - The embedded view to destroy.
|
|
1021
|
-
*/
|
|
1022
|
-
destroyEmbeddedView(view) {
|
|
1023
|
-
if (view.destroyed) {
|
|
1024
|
-
return;
|
|
1025
|
-
}
|
|
1026
|
-
view.destroy();
|
|
1027
|
-
}
|
|
1028
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DynamicComponentService, deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1029
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DynamicComponentService, providedIn: 'root' });
|
|
1030
|
-
}
|
|
1031
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DynamicComponentService, decorators: [{
|
|
1032
|
-
type: Injectable,
|
|
1033
|
-
args: [{
|
|
1034
|
-
providedIn: 'root',
|
|
1035
|
-
}]
|
|
1036
|
-
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }] });
|
|
1037
|
-
|
|
621
|
+
var DynamicComponentService = class DynamicComponentService {
|
|
622
|
+
appRef;
|
|
623
|
+
environmentInjector;
|
|
624
|
+
_tdComponentRefs = /* @__PURE__ */ new WeakMap();
|
|
625
|
+
_tdEmbeddedViews = /* @__PURE__ */ new WeakMap();
|
|
626
|
+
_instanceComponentRefs = /* @__PURE__ */ new WeakMap();
|
|
627
|
+
_instanceEmbeddedViews = /* @__PURE__ */ new WeakMap();
|
|
628
|
+
_hookedInstances = /* @__PURE__ */ new WeakSet();
|
|
629
|
+
constructor(appRef, environmentInjector) {
|
|
630
|
+
this.appRef = appRef;
|
|
631
|
+
this.environmentInjector = environmentInjector;
|
|
632
|
+
}
|
|
633
|
+
createRendererFromComponent(component, componentProps = {}, register = false) {
|
|
634
|
+
let registered = false;
|
|
635
|
+
return (instance, td, row, col, prop, value, cellProperties) => {
|
|
636
|
+
const properties = {
|
|
637
|
+
value,
|
|
638
|
+
instance,
|
|
639
|
+
td,
|
|
640
|
+
row,
|
|
641
|
+
col,
|
|
642
|
+
prop,
|
|
643
|
+
cellProperties
|
|
644
|
+
};
|
|
645
|
+
cellProperties.rendererProps = componentProps;
|
|
646
|
+
baseRenderer.call(this, instance, td, row, col, prop, value, cellProperties);
|
|
647
|
+
this.registerSweepHook(instance);
|
|
648
|
+
if (isTemplateRef(component)) {
|
|
649
|
+
this.replaceCellContent(instance, td);
|
|
650
|
+
const embeddedView = this.attachTemplateToElement(component, td, properties);
|
|
651
|
+
this.trackEmbeddedView(instance, td, embeddedView);
|
|
652
|
+
} else if (isHotCellRendererComponent(component)) this.renderComponent(td, component, properties);
|
|
653
|
+
else console.warn(INVALID_RENDERER_WARNING);
|
|
654
|
+
if (register && !registered && isHotCellRendererComponent(component)) {
|
|
655
|
+
Handsontable.renderers.registerRenderer(component.name, component);
|
|
656
|
+
registered = true;
|
|
657
|
+
}
|
|
658
|
+
return td;
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
createRendererWithFactory(component, componentProps = {}, register = false) {
|
|
662
|
+
let registered = false;
|
|
663
|
+
return rendererFactory(({ instance, td, row, column, prop, value, cellProperties }) => {
|
|
664
|
+
const properties = {
|
|
665
|
+
value,
|
|
666
|
+
instance,
|
|
667
|
+
td,
|
|
668
|
+
row,
|
|
669
|
+
col: column,
|
|
670
|
+
prop,
|
|
671
|
+
cellProperties
|
|
672
|
+
};
|
|
673
|
+
cellProperties.rendererProps = componentProps;
|
|
674
|
+
baseRenderer.call(this, instance, td, row, column, prop, value, cellProperties);
|
|
675
|
+
this.registerSweepHook(instance);
|
|
676
|
+
if (isAdvancedHotCellRendererComponent(component)) this.renderComponent(td, component, properties);
|
|
677
|
+
else console.warn(INVALID_ADVANCED_RENDERER_WARNING);
|
|
678
|
+
if (register && !registered && isAdvancedHotCellRendererComponent(component)) {
|
|
679
|
+
registerRenderer(component.name, component);
|
|
680
|
+
registered = true;
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
cleanupContainer(container, instance) {
|
|
685
|
+
const compRefs = instance ? this._instanceComponentRefs.get(instance) : void 0;
|
|
686
|
+
const embViews = instance ? this._instanceEmbeddedViews.get(instance) : void 0;
|
|
687
|
+
container.querySelectorAll("td").forEach((td) => {
|
|
688
|
+
const compRef = this._tdComponentRefs.get(td);
|
|
689
|
+
if (compRef) {
|
|
690
|
+
this.destroyComponent(compRef);
|
|
691
|
+
this._tdComponentRefs.delete(td);
|
|
692
|
+
compRefs?.delete(compRef);
|
|
693
|
+
}
|
|
694
|
+
const embView = this._tdEmbeddedViews.get(td);
|
|
695
|
+
if (embView) {
|
|
696
|
+
this.destroyEmbeddedView(embView);
|
|
697
|
+
this._tdEmbeddedViews.delete(td);
|
|
698
|
+
embViews?.delete(embView);
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
compRefs?.forEach((ref) => this.destroyComponent(ref));
|
|
702
|
+
embViews?.forEach((view) => this.destroyEmbeddedView(view));
|
|
703
|
+
if (instance) {
|
|
704
|
+
this._instanceComponentRefs.delete(instance);
|
|
705
|
+
this._instanceEmbeddedViews.delete(instance);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
registerSweepHook(instance) {
|
|
709
|
+
if (this._hookedInstances.has(instance) || typeof instance?.addHook !== "function") return;
|
|
710
|
+
this._hookedInstances.add(instance);
|
|
711
|
+
instance.addHook("afterViewRender", () => this.sweepDetachedViews(instance));
|
|
712
|
+
}
|
|
713
|
+
sweepDetachedViews(instance) {
|
|
714
|
+
const compRefs = this._instanceComponentRefs.get(instance);
|
|
715
|
+
compRefs?.forEach((ref) => {
|
|
716
|
+
if (!this.isViewConnected(ref.hostView)) {
|
|
717
|
+
this.destroyComponent(ref);
|
|
718
|
+
compRefs.delete(ref);
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
const embViews = this._instanceEmbeddedViews.get(instance);
|
|
722
|
+
embViews?.forEach((view) => {
|
|
723
|
+
if (!this.isViewConnected(view)) {
|
|
724
|
+
this.destroyEmbeddedView(view);
|
|
725
|
+
embViews.delete(view);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
isViewConnected(view) {
|
|
730
|
+
return view.rootNodes.some((node) => !!node?.isConnected);
|
|
731
|
+
}
|
|
732
|
+
replaceCellContent(instance, td) {
|
|
733
|
+
const prevRef = this._tdComponentRefs.get(td);
|
|
734
|
+
if (prevRef) {
|
|
735
|
+
this.destroyComponent(prevRef);
|
|
736
|
+
this._tdComponentRefs.delete(td);
|
|
737
|
+
this._instanceComponentRefs.get(instance)?.delete(prevRef);
|
|
738
|
+
}
|
|
739
|
+
const prevView = this._tdEmbeddedViews.get(td);
|
|
740
|
+
if (prevView) {
|
|
741
|
+
this.destroyEmbeddedView(prevView);
|
|
742
|
+
this._tdEmbeddedViews.delete(td);
|
|
743
|
+
this._instanceEmbeddedViews.get(instance)?.delete(prevView);
|
|
744
|
+
}
|
|
745
|
+
td.replaceChildren();
|
|
746
|
+
}
|
|
747
|
+
trackComponentRef(instance, td, ref) {
|
|
748
|
+
this._tdComponentRefs.set(td, ref);
|
|
749
|
+
this.registryFor(this._instanceComponentRefs, instance).add(ref);
|
|
750
|
+
}
|
|
751
|
+
trackEmbeddedView(instance, td, view) {
|
|
752
|
+
this._tdEmbeddedViews.set(td, view);
|
|
753
|
+
this.registryFor(this._instanceEmbeddedViews, instance).add(view);
|
|
754
|
+
}
|
|
755
|
+
registryFor(registry, instance) {
|
|
756
|
+
let set = registry.get(instance);
|
|
757
|
+
if (!set) {
|
|
758
|
+
set = /* @__PURE__ */ new Set();
|
|
759
|
+
registry.set(instance, set);
|
|
760
|
+
}
|
|
761
|
+
return set;
|
|
762
|
+
}
|
|
763
|
+
attachTemplateToElement(template, tdEl, properties) {
|
|
764
|
+
const embeddedView = template.createEmbeddedView({
|
|
765
|
+
$implicit: properties.value,
|
|
766
|
+
...properties
|
|
767
|
+
});
|
|
768
|
+
embeddedView.detectChanges();
|
|
769
|
+
embeddedView.rootNodes.forEach((node) => {
|
|
770
|
+
tdEl.appendChild(node);
|
|
771
|
+
});
|
|
772
|
+
return embeddedView;
|
|
773
|
+
}
|
|
774
|
+
createComponent(component, rendererParameters) {
|
|
775
|
+
const componentRef = createComponent(component, { environmentInjector: this.environmentInjector });
|
|
776
|
+
this.applyInputs(componentRef, rendererParameters);
|
|
777
|
+
componentRef.changeDetectorRef.detectChanges();
|
|
778
|
+
this.appRef.attachView(componentRef.hostView);
|
|
779
|
+
return componentRef;
|
|
780
|
+
}
|
|
781
|
+
renderComponent(td, component, properties) {
|
|
782
|
+
const prevRef = this._tdComponentRefs.get(td);
|
|
783
|
+
if (prevRef && prevRef.componentType === component && this.isViewConnected(prevRef.hostView)) {
|
|
784
|
+
this.applyInputs(prevRef, properties);
|
|
785
|
+
prevRef.changeDetectorRef.detectChanges();
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
this.replaceCellContent(properties.instance, td);
|
|
789
|
+
const componentRef = this.createComponent(component, properties);
|
|
790
|
+
this.attachComponentToElement(componentRef, td);
|
|
791
|
+
this.trackComponentRef(properties.instance, td, componentRef);
|
|
792
|
+
}
|
|
793
|
+
applyInputs(componentRef, rendererParameters) {
|
|
794
|
+
RENDERER_INPUT_KEYS.forEach((key) => {
|
|
795
|
+
componentRef.setInput(key, rendererParameters[key]);
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
attachComponentToElement(componentRef, container) {
|
|
799
|
+
componentRef.hostView.rootNodes.forEach((node) => {
|
|
800
|
+
container.appendChild(node);
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
destroyComponent(componentRef) {
|
|
804
|
+
const hostView = componentRef.hostView;
|
|
805
|
+
if (hostView.destroyed) return;
|
|
806
|
+
this.appRef.detachView(hostView);
|
|
807
|
+
componentRef.destroy();
|
|
808
|
+
}
|
|
809
|
+
destroyEmbeddedView(view) {
|
|
810
|
+
if (view.destroyed) return;
|
|
811
|
+
view.destroy();
|
|
812
|
+
}
|
|
813
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
814
|
+
minVersion: "12.0.0",
|
|
815
|
+
version: "22.2.2",
|
|
816
|
+
ngImport: i0,
|
|
817
|
+
type: DynamicComponentService,
|
|
818
|
+
deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }],
|
|
819
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
820
|
+
});
|
|
821
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
822
|
+
minVersion: "12.0.0",
|
|
823
|
+
version: "22.2.2",
|
|
824
|
+
ngImport: i0,
|
|
825
|
+
type: DynamicComponentService,
|
|
826
|
+
providedIn: "root"
|
|
827
|
+
});
|
|
828
|
+
};
|
|
829
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
830
|
+
minVersion: "12.0.0",
|
|
831
|
+
version: "22.2.2",
|
|
832
|
+
ngImport: i0,
|
|
833
|
+
type: DynamicComponentService,
|
|
834
|
+
decorators: [{
|
|
835
|
+
type: Injectable,
|
|
836
|
+
args: [{ providedIn: "root" }]
|
|
837
|
+
}],
|
|
838
|
+
ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }]
|
|
839
|
+
});
|
|
1038
840
|
const AVAILABLE_HOOKS_SET = new Set(Handsontable.hooks.getRegistered());
|
|
1039
|
-
const HOT_ZONE_WRAPPED = Symbol(
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
841
|
+
const HOT_ZONE_WRAPPED = Symbol("hotZoneWrapped");
|
|
842
|
+
const FORWARDED_HOOK_CALLBACK = Symbol.for("handsontable.forwardedHookCallback");
|
|
843
|
+
var HotSettingsResolver = class HotSettingsResolver {
|
|
844
|
+
dynamicComponentService;
|
|
845
|
+
environmentInjector;
|
|
846
|
+
ngZone;
|
|
847
|
+
appliedColumns = /* @__PURE__ */ new WeakMap();
|
|
848
|
+
appliedEditorRefs = /* @__PURE__ */ new Map();
|
|
849
|
+
zoneWrappers = /* @__PURE__ */ new WeakMap();
|
|
850
|
+
declaredSettings = null;
|
|
851
|
+
constructor(dynamicComponentService, environmentInjector, ngZone) {
|
|
852
|
+
this.dynamicComponentService = dynamicComponentService;
|
|
853
|
+
this.environmentInjector = environmentInjector;
|
|
854
|
+
this.ngZone = ngZone;
|
|
855
|
+
}
|
|
856
|
+
applyCustomSettings(settings, previousColumns) {
|
|
857
|
+
const mergedSettings = { ...settings };
|
|
858
|
+
this.declaredSettings = settings;
|
|
859
|
+
this.createDeclaredSheetEditors(settings);
|
|
860
|
+
if (Array.isArray(mergedSettings.columns)) mergedSettings.columns = mergedSettings.columns.map((column, index) => {
|
|
861
|
+
const resolved = { ...column };
|
|
862
|
+
this.resolveColumnRenderer(resolved);
|
|
863
|
+
this.resolveColumnEditor(resolved, previousColumns?.[index]);
|
|
864
|
+
this.resolveColumnValidator(resolved);
|
|
865
|
+
return resolved;
|
|
866
|
+
});
|
|
867
|
+
this.wrapHooksInNgZone(mergedSettings);
|
|
868
|
+
return mergedSettings;
|
|
869
|
+
}
|
|
870
|
+
resolveAppliedSettings(settings) {
|
|
871
|
+
const columns = settings.columns;
|
|
872
|
+
const resolvedColumns = Array.isArray(columns) ? this.resolveAppliedColumns(columns) : columns;
|
|
873
|
+
const hooks = this.zoneWrappedHooksOf(settings);
|
|
874
|
+
if (resolvedColumns === columns && hooks === null) return settings;
|
|
875
|
+
const resolved = {
|
|
876
|
+
...settings,
|
|
877
|
+
...hooks
|
|
878
|
+
};
|
|
879
|
+
if (resolvedColumns !== columns) resolved.columns = resolvedColumns;
|
|
880
|
+
return resolved;
|
|
881
|
+
}
|
|
882
|
+
destroyAppliedEditors() {
|
|
883
|
+
this.appliedEditorRefs.forEach((byColumn) => byColumn.forEach((ref) => ref.destroy()));
|
|
884
|
+
this.appliedEditorRefs.clear();
|
|
885
|
+
}
|
|
886
|
+
isDeclaredHook(key, callback) {
|
|
887
|
+
const declared = this.declaredSettings;
|
|
888
|
+
if (declared === null) return false;
|
|
889
|
+
return declared[key] === callback || this.declaredSheetSettings(declared).some((own) => own[key] === callback);
|
|
890
|
+
}
|
|
891
|
+
declaredSheetSettings(settings) {
|
|
892
|
+
const sheetsBar = settings.sheetsBar;
|
|
893
|
+
const sheets = typeof sheetsBar === "object" && sheetsBar !== null ? sheetsBar.sheets : void 0;
|
|
894
|
+
if (!Array.isArray(sheets)) return [];
|
|
895
|
+
return sheets.map((sheet) => typeof sheet === "object" && sheet !== null ? sheet.settings : null).filter((own) => typeof own === "object" && own !== null);
|
|
896
|
+
}
|
|
897
|
+
createDeclaredSheetEditors(settings) {
|
|
898
|
+
this.declaredSheetSettings(settings).forEach((own) => {
|
|
899
|
+
const columns = own.columns;
|
|
900
|
+
if (!Array.isArray(columns)) return;
|
|
901
|
+
columns.forEach((column, index) => {
|
|
902
|
+
const editor = typeof column === "object" && column !== null ? column.editor : void 0;
|
|
903
|
+
if (this.isEditorComponentRefType(editor) || this.isAdvancedEditorComponentRefType(editor)) this.appliedEditorRef(editor, this.editorColumnKey(column, index));
|
|
904
|
+
});
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
editorColumnKey(column, index) {
|
|
908
|
+
const data = column.data;
|
|
909
|
+
return typeof data === "string" || typeof data === "number" ? data : index;
|
|
910
|
+
}
|
|
911
|
+
resolveAppliedColumns(columns) {
|
|
912
|
+
const resolved = columns.map((column, index) => this.resolveAppliedColumn(column, index));
|
|
913
|
+
return resolved.every((column, index) => column === columns[index]) ? columns : resolved;
|
|
914
|
+
}
|
|
915
|
+
resolveAppliedColumn(column, index) {
|
|
916
|
+
if (!this.needsResolution(column)) return column;
|
|
917
|
+
const cached = this.appliedColumns.get(column);
|
|
918
|
+
if (cached && this.isShallowEqual(cached.source, column)) return cached.resolved;
|
|
919
|
+
const resolved = { ...column };
|
|
920
|
+
const columnKey = this.editorColumnKey(column, index);
|
|
921
|
+
this.resolveColumnRenderer(resolved);
|
|
922
|
+
this.resolveColumnEditor(resolved, void 0, (editorType) => this.appliedEditorRef(editorType, columnKey));
|
|
923
|
+
this.resolveColumnValidator(resolved);
|
|
924
|
+
this.appliedColumns.set(column, {
|
|
925
|
+
source: { ...column },
|
|
926
|
+
resolved
|
|
927
|
+
});
|
|
928
|
+
return resolved;
|
|
929
|
+
}
|
|
930
|
+
isShallowEqual(a, b) {
|
|
931
|
+
const aKeys = Object.keys(a);
|
|
932
|
+
return aKeys.length === Object.keys(b).length && aKeys.every((key) => a[key] === b[key]);
|
|
933
|
+
}
|
|
934
|
+
appliedEditorRef(editorType, columnKey) {
|
|
935
|
+
const byColumn = this.appliedEditorRefs.get(editorType) ?? /* @__PURE__ */ new Map();
|
|
936
|
+
const known = byColumn.get(columnKey);
|
|
937
|
+
if (known) return known;
|
|
938
|
+
const created = createComponent(editorType, { environmentInjector: this.environmentInjector });
|
|
939
|
+
byColumn.set(columnKey, created);
|
|
940
|
+
this.appliedEditorRefs.set(editorType, byColumn);
|
|
941
|
+
return created;
|
|
942
|
+
}
|
|
943
|
+
needsResolution(column) {
|
|
944
|
+
return typeof column === "object" && column !== null && (this.isCustomRenderer(column.renderer) || this.isEditorComponentRefType(column.editor) || this.isAdvancedEditorComponentRefType(column.editor) || this.isCustomValidatorFn(column.validator));
|
|
945
|
+
}
|
|
946
|
+
zoneWrappedHooksOf(settings) {
|
|
947
|
+
let wrapped = null;
|
|
948
|
+
Object.keys(settings).forEach((key) => {
|
|
949
|
+
const option = settings[key];
|
|
950
|
+
const zoned = AVAILABLE_HOOKS_SET.has(key) ? this.zonedHookValue(option, (callback) => this.isDeclaredHook(key, callback)) : option;
|
|
951
|
+
if (zoned !== option) wrapped = {
|
|
952
|
+
...wrapped,
|
|
953
|
+
[key]: zoned
|
|
954
|
+
};
|
|
955
|
+
});
|
|
956
|
+
return wrapped;
|
|
957
|
+
}
|
|
958
|
+
wrapHooksInNgZone(settings) {
|
|
959
|
+
Object.keys(settings).forEach((key) => {
|
|
960
|
+
if (AVAILABLE_HOOKS_SET.has(key)) settings[key] = this.zonedHookValue(settings[key], () => true);
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
zonedHookValue(option, shouldWrap) {
|
|
964
|
+
return typeof option === "function" && !option[HOT_ZONE_WRAPPED] && shouldWrap(option) ? this.zoneWrapped(option) : option;
|
|
965
|
+
}
|
|
966
|
+
zoneWrapped(callback) {
|
|
967
|
+
const known = this.zoneWrappers.get(callback);
|
|
968
|
+
if (known) return known;
|
|
969
|
+
const ngZone = this.ngZone;
|
|
970
|
+
const wrapped = function(...args) {
|
|
971
|
+
return ngZone.run(() => callback.apply(this, args));
|
|
972
|
+
};
|
|
973
|
+
wrapped[HOT_ZONE_WRAPPED] = true;
|
|
974
|
+
wrapped[FORWARDED_HOOK_CALLBACK] = callback;
|
|
975
|
+
this.zoneWrappers.set(callback, wrapped);
|
|
976
|
+
return wrapped;
|
|
977
|
+
}
|
|
978
|
+
resolveColumnRenderer(cellSettings) {
|
|
979
|
+
const renderer = cellSettings.renderer;
|
|
980
|
+
if (!this.isCustomRenderer(renderer)) return;
|
|
981
|
+
const props = cellSettings.rendererProps ?? {};
|
|
982
|
+
if (this.isAdvancedRendererComponentRefType(renderer)) cellSettings.renderer = this.dynamicComponentService.createRendererWithFactory(renderer, props);
|
|
983
|
+
else cellSettings.renderer = this.dynamicComponentService.createRendererFromComponent(renderer, props);
|
|
984
|
+
}
|
|
985
|
+
resolveColumnEditor(cellSettings, previousColumn, sharedEditorRef) {
|
|
986
|
+
const isAdvanced = this.isAdvancedEditorComponentRefType(cellSettings.editor);
|
|
987
|
+
const isBasic = this.isEditorComponentRefType(cellSettings.editor);
|
|
988
|
+
if (!isAdvanced && !isBasic) return;
|
|
989
|
+
const editorType = cellSettings.editor;
|
|
990
|
+
const reusableRef = this.reusableEditorRef(previousColumn, cellSettings, editorType);
|
|
991
|
+
const internalSettings = cellSettings;
|
|
992
|
+
const component = reusableRef ?? sharedEditorRef?.(editorType) ?? createComponent(editorType, { environmentInjector: this.environmentInjector });
|
|
993
|
+
internalSettings._editorComponentReference = component;
|
|
994
|
+
if (isAdvanced) cellSettings.editor = FactoryEditorAdapter(component);
|
|
995
|
+
else {
|
|
996
|
+
internalSettings._environmentInjector = this.environmentInjector;
|
|
997
|
+
cellSettings.editor = BaseEditorAdapter;
|
|
998
|
+
}
|
|
999
|
+
return internalSettings._editorComponentReference;
|
|
1000
|
+
}
|
|
1001
|
+
reusableEditorRef(previousColumn, currentColumn, editorType) {
|
|
1002
|
+
const previousRef = previousColumn?._editorComponentReference;
|
|
1003
|
+
if (!previousRef || previousRef.componentType !== editorType) return;
|
|
1004
|
+
return previousColumn?.data === currentColumn.data ? previousRef : void 0;
|
|
1005
|
+
}
|
|
1006
|
+
resolveColumnValidator(cellSettings) {
|
|
1007
|
+
const customValidatorFn = cellSettings.validator;
|
|
1008
|
+
if (!this.isCustomValidatorFn(customValidatorFn)) return;
|
|
1009
|
+
cellSettings.validator = (value, callback) => {
|
|
1010
|
+
callback(customValidatorFn(value));
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
isCustomValidatorFn(validator) {
|
|
1014
|
+
return typeof validator === "function" && validator.length === 1;
|
|
1015
|
+
}
|
|
1016
|
+
isEditorComponentRefType(editor) {
|
|
1017
|
+
return typeof editor === "function" && !!editor?.ɵcmp && editor?.EDITOR_MARKER === HotCellEditorComponent.EDITOR_MARKER;
|
|
1018
|
+
}
|
|
1019
|
+
isAdvancedEditorComponentRefType(editor) {
|
|
1020
|
+
return typeof editor === "function" && !!editor?.ɵcmp && editor?.EDITOR_MARKER === HotCellEditorAdvancedComponent.EDITOR_MARKER;
|
|
1021
|
+
}
|
|
1022
|
+
isRendererComponentRefType(renderer) {
|
|
1023
|
+
return typeof renderer === "function" && !!renderer?.ɵcmp && renderer?.RENDERER_MARKER === HotCellRendererComponent.RENDERER_MARKER;
|
|
1024
|
+
}
|
|
1025
|
+
isAdvancedRendererComponentRefType(renderer) {
|
|
1026
|
+
return typeof renderer === "function" && !!renderer?.ɵcmp && renderer?.RENDERER_MARKER === HotCellRendererAdvancedComponent.RENDERER_MARKER;
|
|
1027
|
+
}
|
|
1028
|
+
isTemplateRef(renderer) {
|
|
1029
|
+
return renderer && typeof renderer.createEmbeddedView === "function";
|
|
1030
|
+
}
|
|
1031
|
+
isCustomRenderer(renderer) {
|
|
1032
|
+
return this.isRendererComponentRefType(renderer) || this.isTemplateRef(renderer) || this.isAdvancedRendererComponentRefType(renderer);
|
|
1033
|
+
}
|
|
1034
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1035
|
+
minVersion: "12.0.0",
|
|
1036
|
+
version: "22.2.2",
|
|
1037
|
+
ngImport: i0,
|
|
1038
|
+
type: HotSettingsResolver,
|
|
1039
|
+
deps: [
|
|
1040
|
+
{ token: DynamicComponentService },
|
|
1041
|
+
{ token: i0.EnvironmentInjector },
|
|
1042
|
+
{ token: i0.NgZone }
|
|
1043
|
+
],
|
|
1044
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1045
|
+
});
|
|
1046
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1047
|
+
minVersion: "12.0.0",
|
|
1048
|
+
version: "22.2.2",
|
|
1049
|
+
ngImport: i0,
|
|
1050
|
+
type: HotSettingsResolver
|
|
1051
|
+
});
|
|
1052
|
+
};
|
|
1053
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1054
|
+
minVersion: "12.0.0",
|
|
1055
|
+
version: "22.2.2",
|
|
1056
|
+
ngImport: i0,
|
|
1057
|
+
type: HotSettingsResolver,
|
|
1058
|
+
decorators: [{ type: Injectable }],
|
|
1059
|
+
ctorParameters: () => [
|
|
1060
|
+
{ type: DynamicComponentService },
|
|
1061
|
+
{ type: i0.EnvironmentInjector },
|
|
1062
|
+
{ type: i0.NgZone }
|
|
1063
|
+
]
|
|
1064
|
+
});
|
|
1065
|
+
const NON_COMMERCIAL_LICENSE = "non-commercial-and-evaluation";
|
|
1255
1066
|
var PredefinedTheme;
|
|
1256
|
-
(function
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1067
|
+
(function(PredefinedTheme) {
|
|
1068
|
+
PredefinedTheme["Main"] = "ht-theme-main";
|
|
1069
|
+
PredefinedTheme["MainDark"] = "ht-theme-main-dark";
|
|
1070
|
+
PredefinedTheme["MainDarkAuto"] = "ht-theme-main-dark-auto";
|
|
1071
|
+
PredefinedTheme["Horizon"] = "ht-theme-horizon";
|
|
1072
|
+
PredefinedTheme["HorizonDark"] = "ht-theme-horizon-dark";
|
|
1073
|
+
PredefinedTheme["HorizonDarkAuto"] = "ht-theme-horizon-dark-auto";
|
|
1263
1074
|
})(PredefinedTheme || (PredefinedTheme = {}));
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1075
|
+
const HOT_GLOBAL_CONFIG = new InjectionToken("HOT_GLOBAL_CONFIG", {
|
|
1076
|
+
providedIn: "root",
|
|
1077
|
+
factory: () => ({})
|
|
1078
|
+
});
|
|
1079
|
+
var HotGlobalConfigService = class HotGlobalConfigService {
|
|
1080
|
+
defaultConfig = {};
|
|
1081
|
+
configSubject = new BehaviorSubject(this.defaultConfig);
|
|
1082
|
+
get config$() {
|
|
1083
|
+
return this.configSubject.asObservable();
|
|
1084
|
+
}
|
|
1085
|
+
constructor(globalConfig) {
|
|
1086
|
+
this.defaultConfig = {
|
|
1087
|
+
...this.defaultConfig,
|
|
1088
|
+
...globalConfig
|
|
1089
|
+
};
|
|
1090
|
+
this.configSubject.next(this.defaultConfig);
|
|
1091
|
+
}
|
|
1092
|
+
setConfig(config) {
|
|
1093
|
+
this.configSubject.next({
|
|
1094
|
+
...this.defaultConfig,
|
|
1095
|
+
...config
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
getConfig() {
|
|
1099
|
+
return this.configSubject.value;
|
|
1100
|
+
}
|
|
1101
|
+
resetConfig() {
|
|
1102
|
+
this.configSubject.next({ ...this.defaultConfig });
|
|
1103
|
+
}
|
|
1104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1105
|
+
minVersion: "12.0.0",
|
|
1106
|
+
version: "22.2.2",
|
|
1107
|
+
ngImport: i0,
|
|
1108
|
+
type: HotGlobalConfigService,
|
|
1109
|
+
deps: [{ token: HOT_GLOBAL_CONFIG }],
|
|
1110
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1111
|
+
});
|
|
1112
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1113
|
+
minVersion: "12.0.0",
|
|
1114
|
+
version: "22.2.2",
|
|
1115
|
+
ngImport: i0,
|
|
1116
|
+
type: HotGlobalConfigService,
|
|
1117
|
+
providedIn: "root"
|
|
1118
|
+
});
|
|
1119
|
+
};
|
|
1120
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1121
|
+
minVersion: "12.0.0",
|
|
1122
|
+
version: "22.2.2",
|
|
1123
|
+
ngImport: i0,
|
|
1124
|
+
type: HotGlobalConfigService,
|
|
1125
|
+
decorators: [{
|
|
1126
|
+
type: Injectable,
|
|
1127
|
+
args: [{ providedIn: "root" }]
|
|
1128
|
+
}],
|
|
1129
|
+
ctorParameters: () => [{
|
|
1130
|
+
type: void 0,
|
|
1131
|
+
decorators: [{
|
|
1132
|
+
type: Inject,
|
|
1133
|
+
args: [HOT_GLOBAL_CONFIG]
|
|
1134
|
+
}]
|
|
1135
|
+
}]
|
|
1270
1136
|
});
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
* {@link HOT_GLOBAL_CONFIG} injection token.
|
|
1282
|
-
*
|
|
1283
|
-
* @private
|
|
1284
|
-
* @type {HotGlobalConfig}
|
|
1285
|
-
*/
|
|
1286
|
-
defaultConfig = {};
|
|
1287
|
-
/**
|
|
1288
|
-
* A BehaviorSubject that holds the current Handsontable configuration.
|
|
1289
|
-
*
|
|
1290
|
-
* New configuration values can be emitted by calling next() on this subject.
|
|
1291
|
-
* This allows subscribers to react to configuration changes dynamically.
|
|
1292
|
-
*
|
|
1293
|
-
* @private
|
|
1294
|
-
* @type {BehaviorSubject<HotGlobalConfig>}
|
|
1295
|
-
*/
|
|
1296
|
-
configSubject = new BehaviorSubject(this.defaultConfig);
|
|
1297
|
-
/**
|
|
1298
|
-
* An Observable stream of the current Handsontable configuration.
|
|
1299
|
-
*
|
|
1300
|
-
* Components can subscribe to this observable to receive updates whenever the configuration changes.
|
|
1301
|
-
*
|
|
1302
|
-
* @returns The configuration as an observable stream.
|
|
1303
|
-
*/
|
|
1304
|
-
get config$() {
|
|
1305
|
-
return this.configSubject.asObservable();
|
|
1306
|
-
}
|
|
1307
|
-
constructor(globalConfig) {
|
|
1308
|
-
// Merge global configuration (if provided) into defaultConfig immutably.
|
|
1309
|
-
this.defaultConfig = { ...this.defaultConfig, ...globalConfig };
|
|
1310
|
-
this.configSubject.next(this.defaultConfig);
|
|
1311
|
-
}
|
|
1312
|
-
/**
|
|
1313
|
-
* Sets the global configuration for Handsontable.
|
|
1314
|
-
*
|
|
1315
|
-
* @param config - An object containing configuration options.
|
|
1316
|
-
* Each Handsontable instance can override this configuration by providing its own settings.
|
|
1317
|
-
*/
|
|
1318
|
-
setConfig(config) {
|
|
1319
|
-
this.configSubject.next({ ...this.defaultConfig, ...config });
|
|
1320
|
-
}
|
|
1321
|
-
/**
|
|
1322
|
-
* Retrieves the current Handsontable configuration.
|
|
1323
|
-
*
|
|
1324
|
-
* @returns An object with the current settings.
|
|
1325
|
-
*/
|
|
1326
|
-
getConfig() {
|
|
1327
|
-
return this.configSubject.value;
|
|
1328
|
-
}
|
|
1329
|
-
/**
|
|
1330
|
-
* Resets the configuration to the default settings.
|
|
1331
|
-
* This method updates the configuration BehaviorSubject with the default configuration.
|
|
1332
|
-
*/
|
|
1333
|
-
resetConfig() {
|
|
1334
|
-
this.configSubject.next({ ...this.defaultConfig });
|
|
1335
|
-
}
|
|
1336
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HotGlobalConfigService, deps: [{ token: HOT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1337
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HotGlobalConfigService, providedIn: 'root' });
|
|
1137
|
+
const HOT_DESTROYED_WARNING = "The Handsontable instance bound to this component was destroyed and cannot be used properly.";
|
|
1138
|
+
const SIZE_SETTING_KEYS = /* @__PURE__ */ new Set([
|
|
1139
|
+
"rowHeights",
|
|
1140
|
+
"minRowHeights",
|
|
1141
|
+
"colWidths"
|
|
1142
|
+
]);
|
|
1143
|
+
const DATA_BINDING_SOURCE = "dataBinding";
|
|
1144
|
+
const CLEARED_BY_NULL_SETTINGS = ["height", "width"];
|
|
1145
|
+
function isHookCallback(value) {
|
|
1146
|
+
return typeof value === "function" || Array.isArray(value);
|
|
1338
1147
|
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
}]
|
|
1344
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1345
|
-
type: Inject,
|
|
1346
|
-
args: [HOT_GLOBAL_CONFIG]
|
|
1347
|
-
}] }] });
|
|
1348
|
-
|
|
1349
|
-
const HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' + ' used properly.';
|
|
1350
|
-
class HotTableComponent {
|
|
1351
|
-
_hotSettingsResolver;
|
|
1352
|
-
_hotConfig;
|
|
1353
|
-
ngZone;
|
|
1354
|
-
environmentInjector;
|
|
1355
|
-
_dynamicComponentService;
|
|
1356
|
-
// component inputs
|
|
1357
|
-
/** The data for the Handsontable instance. */
|
|
1358
|
-
data = null;
|
|
1359
|
-
/** The settings for the Handsontable instance. */
|
|
1360
|
-
settings = {};
|
|
1361
|
-
/** The container element for the Handsontable instance. */
|
|
1362
|
-
container;
|
|
1363
|
-
/** The Handsontable instance. */
|
|
1364
|
-
__hotInstance = null;
|
|
1365
|
-
_destroyRef = inject(DestroyRef);
|
|
1366
|
-
constructor(_hotSettingsResolver, _hotConfig, ngZone, environmentInjector, _dynamicComponentService) {
|
|
1367
|
-
this._hotSettingsResolver = _hotSettingsResolver;
|
|
1368
|
-
this._hotConfig = _hotConfig;
|
|
1369
|
-
this.ngZone = ngZone;
|
|
1370
|
-
this.environmentInjector = environmentInjector;
|
|
1371
|
-
this._dynamicComponentService = _dynamicComponentService;
|
|
1372
|
-
}
|
|
1373
|
-
/**
|
|
1374
|
-
* Gets the Handsontable instance.
|
|
1375
|
-
* @returns The Handsontable instance or `null` if it's not yet been created or has been destroyed.
|
|
1376
|
-
*/
|
|
1377
|
-
get hotInstance() {
|
|
1378
|
-
if (!this.__hotInstance || !this.__hotInstance.isDestroyed) {
|
|
1379
|
-
// Will return the Handsontable instance or `null` if it's not yet been created.
|
|
1380
|
-
return this.__hotInstance;
|
|
1381
|
-
}
|
|
1382
|
-
else {
|
|
1383
|
-
console.warn(HOT_DESTROYED_WARNING);
|
|
1384
|
-
return null;
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
/**
|
|
1388
|
-
* Sets the Handsontable instance.
|
|
1389
|
-
* @param hotInstance The Handsontable instance to set.
|
|
1390
|
-
*/
|
|
1391
|
-
set hotInstance(hotInstance) {
|
|
1392
|
-
this.__hotInstance = hotInstance;
|
|
1393
|
-
}
|
|
1394
|
-
/**
|
|
1395
|
-
* Initializes the Handsontable instance after the view has been initialized.
|
|
1396
|
-
* The initial settings of the table are also prepared here
|
|
1397
|
-
*/
|
|
1398
|
-
ngAfterViewInit() {
|
|
1399
|
-
let options = this._hotSettingsResolver.applyCustomSettings(this.settings);
|
|
1400
|
-
const negotiatedSettings = this.getNegotiatedSettings(options);
|
|
1401
|
-
options = { ...options, ...negotiatedSettings, ...(this.data != null ? { data: this.data } : {}) };
|
|
1402
|
-
this.ngZone.runOutsideAngular(() => {
|
|
1403
|
-
this.hotInstance = new Handsontable.Core(this.container.nativeElement, options);
|
|
1404
|
-
this.hotInstance._angularEnvironmentInjector = this.environmentInjector;
|
|
1405
|
-
this.hotInstance.init();
|
|
1406
|
-
});
|
|
1407
|
-
this._hotConfig.config$.pipe(skip(1), takeUntilDestroyed(this._destroyRef)).subscribe((config) => {
|
|
1408
|
-
if (this.hotInstance) {
|
|
1409
|
-
const negotiatedSettings = this.getNegotiatedSettings(this.settings);
|
|
1410
|
-
this.updateHotTable(negotiatedSettings);
|
|
1411
|
-
}
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
ngOnChanges(changes) {
|
|
1415
|
-
if (this.hotInstance === null) {
|
|
1416
|
-
return;
|
|
1417
|
-
}
|
|
1418
|
-
if (changes.settings && !changes.settings.firstChange) {
|
|
1419
|
-
// Capture old editor refs before applying new settings so HOT can close any active editor first.
|
|
1420
|
-
const prevColumns = this.__hotInstance?.getSettings().columns;
|
|
1421
|
-
const prevColumnsArray = Array.isArray(prevColumns) ? prevColumns : undefined;
|
|
1422
|
-
// Pass the previous columns so unchanged editor types recycle their existing component
|
|
1423
|
-
// instead of creating a fresh one on every settings change.
|
|
1424
|
-
const newOptions = this._hotSettingsResolver.applyCustomSettings(changes.settings.currentValue, prevColumnsArray);
|
|
1425
|
-
// updateHotTable closes any active editor via HOT.updateSettings before we destroy old refs.
|
|
1426
|
-
this.updateHotTable(newOptions);
|
|
1427
|
-
// Only destroy old editor refs when new settings actually replace columns.
|
|
1428
|
-
// If newOptions has no columns, HOT keeps the old column objects active — destroying
|
|
1429
|
-
// their refs would crash FactoryEditorAdapter / BaseEditorAdapter on next edit.
|
|
1430
|
-
if (prevColumnsArray && Array.isArray(newOptions.columns)) {
|
|
1431
|
-
// Refs recycled into the new columns must survive — destroy only the ones left behind.
|
|
1432
|
-
const reusedRefs = new Set(newOptions.columns
|
|
1433
|
-
.map((column) => column._editorComponentReference)
|
|
1434
|
-
.filter((ref) => !!ref));
|
|
1435
|
-
prevColumnsArray.forEach((column) => {
|
|
1436
|
-
if (column._editorComponentReference && !reusedRefs.has(column._editorComponentReference)) {
|
|
1437
|
-
column._editorComponentReference.destroy();
|
|
1438
|
-
}
|
|
1439
|
-
});
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
if (changes.data && !changes.data.firstChange) {
|
|
1443
|
-
this.hotInstance?.updateData(changes.data.currentValue);
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
/**
|
|
1447
|
-
* Destroys the Handsontable instance and clears the columns from custom editors.
|
|
1448
|
-
*/
|
|
1449
|
-
ngOnDestroy() {
|
|
1450
|
-
this.ngZone.runOutsideAngular(() => {
|
|
1451
|
-
if (!this.__hotInstance || this.__hotInstance.isDestroyed) {
|
|
1452
|
-
return;
|
|
1453
|
-
}
|
|
1454
|
-
// Destroy renderer Angular components attached to table cells before HOT removes the DOM.
|
|
1455
|
-
if (this.container) {
|
|
1456
|
-
this._dynamicComponentService.cleanupContainer(this.container.nativeElement, this.__hotInstance);
|
|
1457
|
-
}
|
|
1458
|
-
const columns = this.__hotInstance.getSettings().columns;
|
|
1459
|
-
if (columns && Array.isArray(columns)) {
|
|
1460
|
-
columns.forEach((column) => {
|
|
1461
|
-
if (column._editorComponentReference) {
|
|
1462
|
-
column._editorComponentReference.destroy();
|
|
1463
|
-
}
|
|
1464
|
-
});
|
|
1465
|
-
}
|
|
1466
|
-
this.__hotInstance.destroy();
|
|
1467
|
-
});
|
|
1468
|
-
}
|
|
1469
|
-
/**
|
|
1470
|
-
* Updates the Handsontable instance with new settings.
|
|
1471
|
-
* @param newSettings The new settings to apply to the Handsontable instance.
|
|
1472
|
-
*/
|
|
1473
|
-
updateHotTable(newSettings) {
|
|
1474
|
-
if (!this.hotInstance) {
|
|
1475
|
-
return;
|
|
1476
|
-
}
|
|
1477
|
-
const initOnlySettingKeys = new Set(this.hotInstance.getSettings()?._initOnlySettings ?? []);
|
|
1478
|
-
const filteredSettings = {};
|
|
1479
|
-
for (const key of Object.keys(newSettings)) {
|
|
1480
|
-
if (!initOnlySettingKeys.has(key)) {
|
|
1481
|
-
filteredSettings[key] = newSettings[key];
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
this.ngZone.runOutsideAngular(() => {
|
|
1485
|
-
this.hotInstance?.updateSettings(filteredSettings, false);
|
|
1486
|
-
});
|
|
1487
|
-
}
|
|
1488
|
-
/**
|
|
1489
|
-
* Merges the provided Handsontable grid settings with the global configuration.
|
|
1490
|
-
*
|
|
1491
|
-
* This method retrieves the global configuration from the HotGlobalConfigService and negotiates the final
|
|
1492
|
-
* Handsontable settings by giving precedence to the provided settings.
|
|
1493
|
-
* Additionally, the `layoutDirection` is only merged if the Handsontable instance has not yet been initialized.
|
|
1494
|
-
*
|
|
1495
|
-
* @param settings - The grid settings provided by the user or component.
|
|
1496
|
-
* @returns The final negotiated grid settings after merging with global defaults.
|
|
1497
|
-
*/
|
|
1498
|
-
getNegotiatedSettings(settings) {
|
|
1499
|
-
const hotConfig = this._hotConfig.getConfig();
|
|
1500
|
-
const negotiatedSettings = {};
|
|
1501
|
-
negotiatedSettings.licenseKey = settings.licenseKey ?? hotConfig.license;
|
|
1502
|
-
negotiatedSettings.language = settings.language ?? hotConfig.language;
|
|
1503
|
-
const theme = settings.theme ?? hotConfig.theme;
|
|
1504
|
-
const themeName = settings.themeName ?? hotConfig.themeName;
|
|
1505
|
-
if (theme !== undefined) {
|
|
1506
|
-
negotiatedSettings.theme = theme;
|
|
1507
|
-
}
|
|
1508
|
-
else if (themeName) {
|
|
1509
|
-
negotiatedSettings.themeName = themeName;
|
|
1510
|
-
}
|
|
1511
|
-
// settings that can be set only before the Handsontable instance is initialized
|
|
1512
|
-
if (!this.__hotInstance) {
|
|
1513
|
-
negotiatedSettings.layoutDirection = settings.layoutDirection ?? hotConfig.layoutDirection;
|
|
1514
|
-
}
|
|
1515
|
-
return negotiatedSettings;
|
|
1516
|
-
}
|
|
1517
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HotTableComponent, deps: [{ token: HotSettingsResolver }, { token: HotGlobalConfigService }, { token: i0.NgZone }, { token: i0.EnvironmentInjector }, { token: DynamicComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1518
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: HotTableComponent, isStandalone: true, selector: "hot-table", inputs: { data: "data", settings: "settings" }, providers: [HotSettingsResolver], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0, template: '<div #container></div>', isInline: true, styles: [":host{display:block}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
1148
|
+
function isSameSizeSetting(currentValue, newValue) {
|
|
1149
|
+
if (currentValue === newValue) return true;
|
|
1150
|
+
if (Array.isArray(currentValue) && Array.isArray(newValue)) return currentValue.length === newValue.length && currentValue.every((value, index) => value === newValue[index]);
|
|
1151
|
+
return false;
|
|
1519
1152
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HotTableModule });
|
|
1153
|
+
const ALWAYS_FORWARDED_SETTINGS = /* @__PURE__ */ new Set(["data"]);
|
|
1154
|
+
const REFERENCE_COMPARED_SETTINGS = /* @__PURE__ */ new Set(["sheetsBar"]);
|
|
1155
|
+
function isSameSettingValue(forwardedValue, newValue, visited = /* @__PURE__ */ new WeakMap()) {
|
|
1156
|
+
if (forwardedValue === newValue) return true;
|
|
1157
|
+
if (forwardedValue instanceof RegExp && newValue instanceof RegExp) return forwardedValue.source === newValue.source && forwardedValue.flags === newValue.flags;
|
|
1158
|
+
const bothArrays = Array.isArray(forwardedValue) && Array.isArray(newValue);
|
|
1159
|
+
const bothPlainObjects = isPlainObject(forwardedValue) && isPlainObject(newValue);
|
|
1160
|
+
if (!bothArrays && !bothPlainObjects) return false;
|
|
1161
|
+
const forwardedObject = forwardedValue;
|
|
1162
|
+
const newObject = newValue;
|
|
1163
|
+
const comparedWith = visited.get(forwardedObject);
|
|
1164
|
+
if (comparedWith?.has(newObject)) return true;
|
|
1165
|
+
if (comparedWith) comparedWith.add(newObject);
|
|
1166
|
+
else visited.set(forwardedObject, new WeakSet([newObject]));
|
|
1167
|
+
const forwardedKeys = Object.keys(forwardedObject);
|
|
1168
|
+
return forwardedKeys.length === Object.keys(newObject).length && forwardedKeys.every((key) => Object.prototype.hasOwnProperty.call(newObject, key) && isSameSettingValue(forwardedObject[key], newObject[key], visited));
|
|
1537
1169
|
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1170
|
+
function copySettingValue(value, copies = /* @__PURE__ */ new WeakMap()) {
|
|
1171
|
+
if (!Array.isArray(value) && !isPlainObject(value)) return value;
|
|
1172
|
+
if (copies.has(value)) return copies.get(value);
|
|
1173
|
+
if (Array.isArray(value)) {
|
|
1174
|
+
const arrayCopy = [];
|
|
1175
|
+
copies.set(value, arrayCopy);
|
|
1176
|
+
value.forEach((item) => arrayCopy.push(copySettingValue(item, copies)));
|
|
1177
|
+
return arrayCopy;
|
|
1178
|
+
}
|
|
1179
|
+
const objectCopy = {};
|
|
1180
|
+
copies.set(value, objectCopy);
|
|
1181
|
+
Object.keys(value).forEach((key) => {
|
|
1182
|
+
objectCopy[key] = copySettingValue(value[key], copies);
|
|
1183
|
+
});
|
|
1184
|
+
return objectCopy;
|
|
1185
|
+
}
|
|
1186
|
+
function isPlainObject(value) {
|
|
1187
|
+
if (value === null || typeof value !== "object") return false;
|
|
1188
|
+
const prototype = Object.getPrototypeOf(value);
|
|
1189
|
+
return prototype === Object.prototype || prototype === null;
|
|
1190
|
+
}
|
|
1191
|
+
const FILL_HEIGHT_CLASS_NAME = "ht-fill-height";
|
|
1192
|
+
const RELATIVE_HEIGHT_PATTERN = /%|\bvar\(/i;
|
|
1193
|
+
var HotTableComponent = class HotTableComponent {
|
|
1194
|
+
_hotSettingsResolver;
|
|
1195
|
+
_hotConfig;
|
|
1196
|
+
ngZone;
|
|
1197
|
+
environmentInjector;
|
|
1198
|
+
_dynamicComponentService;
|
|
1199
|
+
data = null;
|
|
1200
|
+
settings = {};
|
|
1201
|
+
container;
|
|
1202
|
+
__hotInstance = null;
|
|
1203
|
+
_destroyRef = inject(DestroyRef);
|
|
1204
|
+
_host = inject(ElementRef);
|
|
1205
|
+
isBrowser = inject(PLATFORM_ID) === "browser";
|
|
1206
|
+
_gridColumns;
|
|
1207
|
+
_passedHookKeys = /* @__PURE__ */ new Set();
|
|
1208
|
+
_forwardedSettings = /* @__PURE__ */ new Map();
|
|
1209
|
+
_passedClearedByNullKeys = /* @__PURE__ */ new Set();
|
|
1210
|
+
constructor(_hotSettingsResolver, _hotConfig, ngZone, environmentInjector, _dynamicComponentService) {
|
|
1211
|
+
this._hotSettingsResolver = _hotSettingsResolver;
|
|
1212
|
+
this._hotConfig = _hotConfig;
|
|
1213
|
+
this.ngZone = ngZone;
|
|
1214
|
+
this.environmentInjector = environmentInjector;
|
|
1215
|
+
this._dynamicComponentService = _dynamicComponentService;
|
|
1216
|
+
}
|
|
1217
|
+
get hotInstance() {
|
|
1218
|
+
if (!this.__hotInstance || !this.__hotInstance.isDestroyed) return this.__hotInstance;
|
|
1219
|
+
else {
|
|
1220
|
+
console.warn(HOT_DESTROYED_WARNING);
|
|
1221
|
+
return null;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
set hotInstance(hotInstance) {
|
|
1225
|
+
this.__hotInstance = hotInstance;
|
|
1226
|
+
}
|
|
1227
|
+
ngAfterViewInit() {
|
|
1228
|
+
if (!this.isBrowser) return;
|
|
1229
|
+
let options = this._hotSettingsResolver.applyCustomSettings(this.settings);
|
|
1230
|
+
if (Array.isArray(options.columns)) this._gridColumns = options.columns;
|
|
1231
|
+
this._passedHookKeys = this.collectHookKeys(options);
|
|
1232
|
+
this._passedClearedByNullKeys = this.collectClearedByNullKeys(options);
|
|
1233
|
+
const negotiatedSettings = this.getNegotiatedSettings(options);
|
|
1234
|
+
options = {
|
|
1235
|
+
...options,
|
|
1236
|
+
...negotiatedSettings,
|
|
1237
|
+
...this.data != null ? { data: this.data } : {}
|
|
1238
|
+
};
|
|
1239
|
+
this._forwardedSettings = /* @__PURE__ */ new Map();
|
|
1240
|
+
Object.keys(options).forEach((key) => {
|
|
1241
|
+
this.recordForwarded(key, options[key]);
|
|
1242
|
+
});
|
|
1243
|
+
this.ngZone.runOutsideAngular(() => {
|
|
1244
|
+
this.hotInstance = new Handsontable.Core(this.container.nativeElement, options);
|
|
1245
|
+
this.hotInstance._angularEnvironmentInjector = this.environmentInjector;
|
|
1246
|
+
this.hotInstance._addSettingsFilter?.((settings) => this._hotSettingsResolver.resolveAppliedSettings(settings));
|
|
1247
|
+
this.hotInstance.addHook("beforeHeightChange", (height) => {
|
|
1248
|
+
this.toggleFillHeight(height);
|
|
1249
|
+
return height;
|
|
1250
|
+
});
|
|
1251
|
+
this.hotInstance.init();
|
|
1252
|
+
});
|
|
1253
|
+
this._hotConfig.config$.pipe(skip(1), takeUntilDestroyed(this._destroyRef)).subscribe((config) => {
|
|
1254
|
+
if (this.hotInstance) {
|
|
1255
|
+
const negotiatedSettings = this.getNegotiatedSettings(this.settings);
|
|
1256
|
+
this.updateHotTable(negotiatedSettings);
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
ngOnChanges(changes) {
|
|
1261
|
+
if (this.hotInstance === null) return;
|
|
1262
|
+
if (changes.settings && !changes.settings.firstChange) {
|
|
1263
|
+
const prevColumnsArray = this._gridColumns;
|
|
1264
|
+
const newOptions = this._hotSettingsResolver.applyCustomSettings(changes.settings.currentValue, prevColumnsArray);
|
|
1265
|
+
this.clearRemovedHooks(newOptions);
|
|
1266
|
+
this._passedHookKeys = this.collectHookKeys(newOptions);
|
|
1267
|
+
this.clearUnsetSizes(newOptions);
|
|
1268
|
+
this._passedClearedByNullKeys = this.collectClearedByNullKeys(newOptions, this._passedClearedByNullKeys);
|
|
1269
|
+
const appliedOptions = this.updateHotTable(newOptions);
|
|
1270
|
+
if (prevColumnsArray && Array.isArray(appliedOptions.columns)) {
|
|
1271
|
+
const reusedRefs = new Set(appliedOptions.columns.map((column) => column._editorComponentReference).filter((ref) => !!ref));
|
|
1272
|
+
prevColumnsArray.forEach((column) => {
|
|
1273
|
+
if (column._editorComponentReference && !reusedRefs.has(column._editorComponentReference)) column._editorComponentReference.destroy();
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
if (Array.isArray(appliedOptions.columns)) this._gridColumns = appliedOptions.columns;
|
|
1277
|
+
}
|
|
1278
|
+
if (changes.data && !changes.data.firstChange) this.hotInstance?.updateData(changes.data.currentValue, DATA_BINDING_SOURCE);
|
|
1279
|
+
}
|
|
1280
|
+
ngOnDestroy() {
|
|
1281
|
+
this.ngZone.runOutsideAngular(() => {
|
|
1282
|
+
if (!this.__hotInstance) return;
|
|
1283
|
+
const isLive = !this.__hotInstance.isDestroyed;
|
|
1284
|
+
if (isLive && this.container) this._dynamicComponentService.cleanupContainer(this.container.nativeElement, this.__hotInstance);
|
|
1285
|
+
this._gridColumns?.forEach((column) => {
|
|
1286
|
+
if (column._editorComponentReference) column._editorComponentReference.destroy();
|
|
1287
|
+
});
|
|
1288
|
+
this._gridColumns = void 0;
|
|
1289
|
+
this._hotSettingsResolver.destroyAppliedEditors();
|
|
1290
|
+
if (isLive) this.__hotInstance.destroy();
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
toggleFillHeight(height) {
|
|
1294
|
+
const fillHeight = typeof height === "string" && RELATIVE_HEIGHT_PATTERN.test(height);
|
|
1295
|
+
this.container.nativeElement.classList.toggle(FILL_HEIGHT_CLASS_NAME, fillHeight);
|
|
1296
|
+
this._host.nativeElement.classList.toggle(FILL_HEIGHT_CLASS_NAME, fillHeight);
|
|
1297
|
+
}
|
|
1298
|
+
clearRemovedHooks(newOptions) {
|
|
1299
|
+
this._passedHookKeys.forEach((key) => {
|
|
1300
|
+
if (!isHookCallback(newOptions[key])) newOptions[key] = null;
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
clearUnsetSizes(newOptions) {
|
|
1304
|
+
Object.keys(newOptions).forEach((key) => {
|
|
1305
|
+
if (this._passedClearedByNullKeys.has(key) && newOptions[key] === void 0) newOptions[key] = null;
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
collectClearedByNullKeys(settings, previousKeys = /* @__PURE__ */ new Set()) {
|
|
1309
|
+
const ownKeys = new Set(Object.keys(settings));
|
|
1310
|
+
return new Set(CLEARED_BY_NULL_SETTINGS.filter((key) => ownKeys.has(key) ? settings[key] !== void 0 && settings[key] !== null : previousKeys.has(key)));
|
|
1311
|
+
}
|
|
1312
|
+
collectHookKeys(settings) {
|
|
1313
|
+
return new Set(Object.keys(settings).filter((key) => isHookCallback(settings[key]) && (Handsontable.hooks.isRegistered(key) || Handsontable.hooks.isDeprecated(key))));
|
|
1314
|
+
}
|
|
1315
|
+
isSameAsForwarded(key, value) {
|
|
1316
|
+
if (!this._forwardedSettings.has(key) || ALWAYS_FORWARDED_SETTINGS.has(key)) return false;
|
|
1317
|
+
const forwardedValue = this._forwardedSettings.get(key);
|
|
1318
|
+
return REFERENCE_COMPARED_SETTINGS.has(key) ? forwardedValue === value : isSameSettingValue(forwardedValue, value);
|
|
1319
|
+
}
|
|
1320
|
+
recordForwarded(key, value) {
|
|
1321
|
+
if (ALWAYS_FORWARDED_SETTINGS.has(key)) return;
|
|
1322
|
+
this._forwardedSettings.set(key, REFERENCE_COMPARED_SETTINGS.has(key) ? value : copySettingValue(value));
|
|
1323
|
+
}
|
|
1324
|
+
updateHotTable(newSettings) {
|
|
1325
|
+
if (!this.hotInstance) return {};
|
|
1326
|
+
const currentSettings = this.hotInstance.getSettings();
|
|
1327
|
+
const initOnlySettingKeys = new Set(currentSettings?._initOnlySettings ?? []);
|
|
1328
|
+
const filteredSettings = {};
|
|
1329
|
+
for (const key of Object.keys(newSettings)) {
|
|
1330
|
+
if (initOnlySettingKeys.has(key)) continue;
|
|
1331
|
+
if (SIZE_SETTING_KEYS.has(key) && isSameSizeSetting(currentSettings?.[key], newSettings[key])) continue;
|
|
1332
|
+
if (this.isSameAsForwarded(key, newSettings[key])) continue;
|
|
1333
|
+
filteredSettings[key] = newSettings[key];
|
|
1334
|
+
this.recordForwarded(key, newSettings[key]);
|
|
1335
|
+
}
|
|
1336
|
+
this.ngZone.runOutsideAngular(() => {
|
|
1337
|
+
this.hotInstance?.updateSettings(filteredSettings, false);
|
|
1338
|
+
});
|
|
1339
|
+
return filteredSettings;
|
|
1340
|
+
}
|
|
1341
|
+
getNegotiatedSettings(settings) {
|
|
1342
|
+
const hotConfig = this._hotConfig.getConfig();
|
|
1343
|
+
const negotiatedSettings = {};
|
|
1344
|
+
negotiatedSettings.licenseKey = settings.licenseKey ?? hotConfig.license;
|
|
1345
|
+
negotiatedSettings.language = settings.language ?? hotConfig.language;
|
|
1346
|
+
const theme = settings.theme ?? hotConfig.theme;
|
|
1347
|
+
const themeName = settings.themeName ?? hotConfig.themeName;
|
|
1348
|
+
if (theme !== void 0) negotiatedSettings.theme = theme;
|
|
1349
|
+
else if (themeName) negotiatedSettings.themeName = themeName;
|
|
1350
|
+
if (!this.__hotInstance) negotiatedSettings.layoutDirection = settings.layoutDirection ?? hotConfig.layoutDirection;
|
|
1351
|
+
return negotiatedSettings;
|
|
1352
|
+
}
|
|
1353
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1354
|
+
minVersion: "12.0.0",
|
|
1355
|
+
version: "22.2.2",
|
|
1356
|
+
ngImport: i0,
|
|
1357
|
+
type: HotTableComponent,
|
|
1358
|
+
deps: [
|
|
1359
|
+
{ token: HotSettingsResolver },
|
|
1360
|
+
{ token: HotGlobalConfigService },
|
|
1361
|
+
{ token: i0.NgZone },
|
|
1362
|
+
{ token: i0.EnvironmentInjector },
|
|
1363
|
+
{ token: DynamicComponentService }
|
|
1364
|
+
],
|
|
1365
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1366
|
+
});
|
|
1367
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1368
|
+
minVersion: "14.0.0",
|
|
1369
|
+
version: "22.2.2",
|
|
1370
|
+
type: HotTableComponent,
|
|
1371
|
+
isStandalone: true,
|
|
1372
|
+
selector: "hot-table",
|
|
1373
|
+
inputs: {
|
|
1374
|
+
data: "data",
|
|
1375
|
+
settings: "settings"
|
|
1376
|
+
},
|
|
1377
|
+
providers: [HotSettingsResolver],
|
|
1378
|
+
viewQueries: [{
|
|
1379
|
+
propertyName: "container",
|
|
1380
|
+
first: true,
|
|
1381
|
+
predicate: ["container"],
|
|
1382
|
+
descendants: true
|
|
1383
|
+
}],
|
|
1384
|
+
usesOnChanges: true,
|
|
1385
|
+
ngImport: i0,
|
|
1386
|
+
template: "<div #container></div>",
|
|
1387
|
+
isInline: true,
|
|
1388
|
+
styles: [":host{display:block}:where(hot-table.ht-fill-height,hot-table>div.ht-fill-height){height:100%}\n"],
|
|
1389
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1390
|
+
});
|
|
1391
|
+
};
|
|
1392
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1393
|
+
minVersion: "12.0.0",
|
|
1394
|
+
version: "22.2.2",
|
|
1395
|
+
ngImport: i0,
|
|
1396
|
+
type: HotTableComponent,
|
|
1397
|
+
decorators: [{
|
|
1398
|
+
type: Component,
|
|
1399
|
+
args: [{
|
|
1400
|
+
selector: "hot-table",
|
|
1401
|
+
template: "<div #container></div>",
|
|
1402
|
+
encapsulation: ViewEncapsulation.None,
|
|
1403
|
+
providers: [HotSettingsResolver],
|
|
1404
|
+
styles: [":host{display:block}:where(hot-table.ht-fill-height,hot-table>div.ht-fill-height){height:100%}\n"]
|
|
1405
|
+
}]
|
|
1406
|
+
}],
|
|
1407
|
+
ctorParameters: () => [
|
|
1408
|
+
{ type: HotSettingsResolver },
|
|
1409
|
+
{ type: HotGlobalConfigService },
|
|
1410
|
+
{ type: i0.NgZone },
|
|
1411
|
+
{ type: i0.EnvironmentInjector },
|
|
1412
|
+
{ type: DynamicComponentService }
|
|
1413
|
+
],
|
|
1414
|
+
propDecorators: {
|
|
1415
|
+
data: [{ type: Input }],
|
|
1416
|
+
settings: [{ type: Input }],
|
|
1417
|
+
container: [{
|
|
1418
|
+
type: ViewChild,
|
|
1419
|
+
args: ["container", { static: false }]
|
|
1420
|
+
}]
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
var HotTableModule = class HotTableModule {
|
|
1424
|
+
static version = "19.0.0-rc1";
|
|
1425
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1426
|
+
minVersion: "12.0.0",
|
|
1427
|
+
version: "22.2.2",
|
|
1428
|
+
ngImport: i0,
|
|
1429
|
+
type: HotTableModule,
|
|
1430
|
+
deps: [],
|
|
1431
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
1432
|
+
});
|
|
1433
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1434
|
+
minVersion: "14.0.0",
|
|
1435
|
+
version: "22.2.2",
|
|
1436
|
+
ngImport: i0,
|
|
1437
|
+
type: HotTableModule,
|
|
1438
|
+
imports: [HotTableComponent],
|
|
1439
|
+
exports: [HotTableComponent]
|
|
1440
|
+
});
|
|
1441
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
1442
|
+
minVersion: "12.0.0",
|
|
1443
|
+
version: "22.2.2",
|
|
1444
|
+
ngImport: i0,
|
|
1445
|
+
type: HotTableModule
|
|
1446
|
+
});
|
|
1447
|
+
};
|
|
1448
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1449
|
+
minVersion: "12.0.0",
|
|
1450
|
+
version: "22.2.2",
|
|
1451
|
+
ngImport: i0,
|
|
1452
|
+
type: HotTableModule,
|
|
1453
|
+
decorators: [{
|
|
1454
|
+
type: NgModule,
|
|
1455
|
+
args: [{
|
|
1456
|
+
imports: [HotTableComponent],
|
|
1457
|
+
exports: [HotTableComponent]
|
|
1458
|
+
}]
|
|
1459
|
+
}]
|
|
1460
|
+
});
|
|
1461
|
+
export { DATA_BINDING_SOURCE, DynamicComponentService, HOT_DESTROYED_WARNING, HOT_GLOBAL_CONFIG, HotCellEditorAdvancedComponent, HotCellEditorComponent, HotCellRendererAdvancedComponent, HotCellRendererComponent, HotGlobalConfigService, HotSettingsResolver, HotTableComponent, HotTableModule, INVALID_ADVANCED_RENDERER_WARNING, INVALID_RENDERER_WARNING, NON_COMMERCIAL_LICENSE, PredefinedTheme, isAdvancedHotCellRendererComponent, isHotCellRendererComponent, isTemplateRef };
|
|
1553
1462
|
|
|
1554
|
-
|
|
1555
|
-
//# sourceMappingURL=handsontable-angular-wrapper.mjs.map
|
|
1463
|
+
//# sourceMappingURL=handsontable-angular-wrapper.mjs.map
|