@dotglitch/ngx-common 1.1.42 → 1.1.44
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/components/lazy-loader/lazy-loader.component.d.ts +2 -0
- package/components/react-magic-wrapper/react-magic-wrapper.component.d.ts +5 -4
- package/esm2022/components/lazy-loader/lazy-loader.component.mjs +12 -2
- package/esm2022/components/lazy-loader/lazy-loader.service.mjs +4 -4
- package/esm2022/components/react-magic-wrapper/react-magic-wrapper.component.mjs +28 -21
- package/esm2022/components/tabulator/tabulator.component.mjs +4 -3
- package/fesm2022/dotglitch-ngx-common.mjs +45 -27
- package/fesm2022/dotglitch-ngx-common.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1690,11 +1690,11 @@ class LazyLoaderService {
|
|
|
1690
1690
|
return t[$id] == _id;
|
|
1691
1691
|
// Matcher is regex
|
|
1692
1692
|
if (t.matcher instanceof RegExp)
|
|
1693
|
-
return t.matcher.test(
|
|
1693
|
+
return t.matcher.test(value) || t.matcher.test(_id);
|
|
1694
1694
|
// Matcher is string => regex
|
|
1695
1695
|
if (typeof t.matcher == 'string') {
|
|
1696
1696
|
const rx = new RegExp(t.matcher, 'ui');
|
|
1697
|
-
return rx.test(
|
|
1697
|
+
return rx.test(value) || rx.test(_id);
|
|
1698
1698
|
}
|
|
1699
1699
|
// Matcher is array
|
|
1700
1700
|
if (Array.isArray(t.matcher)) {
|
|
@@ -1713,7 +1713,7 @@ class LazyLoaderService {
|
|
|
1713
1713
|
}
|
|
1714
1714
|
const out = items[0];
|
|
1715
1715
|
if (out.matcher instanceof RegExp) {
|
|
1716
|
-
const result =
|
|
1716
|
+
const result = value.match(out.matcher) || _id.match(out.matcher);
|
|
1717
1717
|
return {
|
|
1718
1718
|
entry: out,
|
|
1719
1719
|
matchGroups: result?.groups
|
|
@@ -1798,6 +1798,7 @@ class LazyLoaderComponent {
|
|
|
1798
1798
|
* The id of the component that will be lazy loaded
|
|
1799
1799
|
*/
|
|
1800
1800
|
set id(data) {
|
|
1801
|
+
this.originalId = data;
|
|
1801
1802
|
const id = stringToSlug(data);
|
|
1802
1803
|
// Check if there is a change to the loaded component's id
|
|
1803
1804
|
// if it's updated, we destroy and rehydrate the entire container
|
|
@@ -1811,6 +1812,7 @@ class LazyLoaderComponent {
|
|
|
1811
1812
|
}
|
|
1812
1813
|
;
|
|
1813
1814
|
set group(data) {
|
|
1815
|
+
this.originalGroup = data;
|
|
1814
1816
|
const group = stringToSlug(data);
|
|
1815
1817
|
if (typeof group != "string" || !group)
|
|
1816
1818
|
return;
|
|
@@ -1947,7 +1949,7 @@ class LazyLoaderComponent {
|
|
|
1947
1949
|
return this.loadDefault();
|
|
1948
1950
|
}
|
|
1949
1951
|
try {
|
|
1950
|
-
const _entry = this.service.resolveRegistrationEntry(this.
|
|
1952
|
+
const _entry = this.service.resolveRegistrationEntry(this.originalId, this.originalGroup);
|
|
1951
1953
|
if (!_entry || !_entry.entry) {
|
|
1952
1954
|
this.err(`Failed to find Component '${this._id}' in group '${this._group}' in registry!`);
|
|
1953
1955
|
return this.loadDefault();
|
|
@@ -1984,6 +1986,14 @@ class LazyLoaderComponent {
|
|
|
1984
1986
|
this.err(`Component '${this._id}' is invalid or corrupted!`);
|
|
1985
1987
|
return this.loadError();
|
|
1986
1988
|
}
|
|
1989
|
+
// const componentRef = this.targetComponentContainerRef = createComponent(component as any, {
|
|
1990
|
+
// environmentInjector: this.appRef.injector,
|
|
1991
|
+
// elementInjector: this.injector,
|
|
1992
|
+
// hostElement: this.viewContainerRef.element.nativeElement,
|
|
1993
|
+
// // projectableNodes:
|
|
1994
|
+
// });
|
|
1995
|
+
// // this.targetRef = this.targetContainer.insert(this.targetComponentContainerRef.hostView);
|
|
1996
|
+
// this.appRef.attachView(componentRef.hostView);
|
|
1987
1997
|
// Bootstrap the component into the container
|
|
1988
1998
|
const componentRef = this.targetComponentContainerRef = this.targetContainer.createComponent(component);
|
|
1989
1999
|
this.targetRef = this.targetContainer.insert(this.targetComponentContainerRef.hostView);
|
|
@@ -9334,8 +9344,9 @@ class TabulatorComponent {
|
|
|
9334
9344
|
});
|
|
9335
9345
|
})();
|
|
9336
9346
|
}
|
|
9337
|
-
else
|
|
9347
|
+
else {
|
|
9338
9348
|
this.table?.setData(this.dataSource);
|
|
9349
|
+
}
|
|
9339
9350
|
}
|
|
9340
9351
|
;
|
|
9341
9352
|
get dataSource() { return this._dataSource; }
|
|
@@ -9370,7 +9381,7 @@ class TabulatorComponent {
|
|
|
9370
9381
|
table.on("rowClick", (e, row) => this.rowClick.next({ event: e, row, data: row.getData() }));
|
|
9371
9382
|
table.on("rowContext", (e, row) => this.rowContext.next({ event: e, row, data: row.getData() }));
|
|
9372
9383
|
table.on("rowDblClick", (e, row) => this.rowDblClick.next({ event: e, row, data: row.getData() }));
|
|
9373
|
-
table.on("
|
|
9384
|
+
table.on("tableBuilt", () => {
|
|
9374
9385
|
table.redraw();
|
|
9375
9386
|
});
|
|
9376
9387
|
}
|
|
@@ -11654,11 +11665,16 @@ class ReactMagicWrapperComponent {
|
|
|
11654
11665
|
};
|
|
11655
11666
|
component.changeDetectorRef.detectChanges();
|
|
11656
11667
|
}, []);
|
|
11668
|
+
// Create a container for the wrapped element and
|
|
11669
|
+
// all of the siblings we will inject into it's container.
|
|
11670
|
+
// The double wrapper is necessary for React's mechanisms to properly
|
|
11671
|
+
// associate things together.
|
|
11657
11672
|
return React.createElement('div', {}, React.createElement("div", { id }), ...additionalChildren);
|
|
11658
11673
|
}); }
|
|
11659
|
-
constructor(ngContainer, ngTheme) {
|
|
11674
|
+
constructor(ngContainer, ngTheme, ngZone) {
|
|
11660
11675
|
this.ngContainer = ngContainer;
|
|
11661
11676
|
this.ngTheme = ngTheme;
|
|
11677
|
+
this.ngZone = ngZone;
|
|
11662
11678
|
this.ngSubscriptions = [
|
|
11663
11679
|
this.ngTheme.subscribe(t => {
|
|
11664
11680
|
this.theme = t;
|
|
@@ -11683,25 +11699,27 @@ class ReactMagicWrapperComponent {
|
|
|
11683
11699
|
_render() {
|
|
11684
11700
|
if (!this.ngReactComponent)
|
|
11685
11701
|
return;
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11702
|
+
this.ngZone.runOutsideAngular(() => {
|
|
11703
|
+
if (!this._root) {
|
|
11704
|
+
this._root = createRoot(this.ngContainer.element.nativeElement);
|
|
11705
|
+
}
|
|
11706
|
+
// List all keys that do not start with `_` nor `ng`
|
|
11707
|
+
const keys = Object.keys(this).filter(k => !/^(?:_|ng)/.test(k));
|
|
11708
|
+
// Get all property keys from the class
|
|
11709
|
+
const propKeys = keys.filter(k => !k.startsWith("on"));
|
|
11710
|
+
// Get all event handler keys from the class
|
|
11711
|
+
const evtKeys = keys.filter(k => k.startsWith("on"));
|
|
11712
|
+
const props = {};
|
|
11713
|
+
// Project all key properties onto `props`
|
|
11714
|
+
propKeys.forEach(k => props[k] = this[k]);
|
|
11715
|
+
// Bind all event handlers.
|
|
11716
|
+
// ! important Angular uses EventEmitter, React uses
|
|
11717
|
+
// a different method of event binding
|
|
11718
|
+
evtKeys.forEach(k => props[k] = (...args) => this[k].next(args));
|
|
11719
|
+
this._root.render(React.createElement(this.ngReactComponent, { props: props }));
|
|
11720
|
+
});
|
|
11721
|
+
}
|
|
11722
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: ReactMagicWrapperComponent, deps: [{ token: i0.ViewContainerRef }, { token: ThemeService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11705
11723
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: ReactMagicWrapperComponent, isStandalone: true, selector: "app-react-magic-wrapper", usesOnChanges: true, ngImport: i0, template: ``, isInline: true }); }
|
|
11706
11724
|
}
|
|
11707
11725
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: ReactMagicWrapperComponent, decorators: [{
|
|
@@ -11711,7 +11729,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
11711
11729
|
template: ``,
|
|
11712
11730
|
standalone: true
|
|
11713
11731
|
}]
|
|
11714
|
-
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: ThemeService }] });
|
|
11732
|
+
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: ThemeService }, { type: i0.NgZone }] });
|
|
11715
11733
|
|
|
11716
11734
|
/*
|
|
11717
11735
|
* Public API Surface of package
|