@praxisui/settings-panel 8.0.0-beta.99 → 9.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/fesm2022/praxisui-settings-panel.mjs +25 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -61,9 +61,30 @@ last_updated: "2026-04-03"
|
|
|
61
61
|
## Instalacao
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
npm i @praxisui/settings-panel
|
|
64
|
+
npm i @praxisui/settings-panel@beta
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
## Minimal standalone content component
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { Component } from '@angular/core';
|
|
71
|
+
import { SettingsValueProvider } from '@praxisui/settings-panel';
|
|
72
|
+
|
|
73
|
+
@Component({
|
|
74
|
+
selector: 'app-settings-content',
|
|
75
|
+
standalone: true,
|
|
76
|
+
template: `<p>Settings content</p>`,
|
|
77
|
+
})
|
|
78
|
+
export class SettingsContentComponent implements SettingsValueProvider {
|
|
79
|
+
getSettingsValue(): unknown {
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Open this standalone content with `SettingsPanelService.open(...)`; the host
|
|
86
|
+
observes `SettingsPanelRef.applied$` and `saved$` to apply or persist changes.
|
|
87
|
+
|
|
67
88
|
Peer dependencies (Angular v20):
|
|
68
89
|
|
|
69
90
|
- `@angular/core` `^20.0.0`
|
|
@@ -1822,6 +1822,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
1822
1822
|
args: ['contentHost', { read: ViewContainerRef, static: true }]
|
|
1823
1823
|
}] } });
|
|
1824
1824
|
|
|
1825
|
+
function buildSurfaceRuntime(ref) {
|
|
1826
|
+
return {
|
|
1827
|
+
closed$: ref.closed$,
|
|
1828
|
+
result$: ref.result$,
|
|
1829
|
+
close: (result) => ref.close?.(result),
|
|
1830
|
+
emitResult: (result) => ref.emitResult?.(result),
|
|
1831
|
+
updateTitle: (title) => ref.updateTitle?.(title),
|
|
1832
|
+
updateSize: (preset) => ref.updateSize?.(preset),
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
function enrichSurfaceContentInputs(inputs, ref) {
|
|
1836
|
+
const context = inputs?.['context'] && typeof inputs['context'] === 'object'
|
|
1837
|
+
? inputs['context']
|
|
1838
|
+
: {};
|
|
1839
|
+
return {
|
|
1840
|
+
...(inputs || {}),
|
|
1841
|
+
context: {
|
|
1842
|
+
...context,
|
|
1843
|
+
surfaceRuntime: buildSurfaceRuntime(ref),
|
|
1844
|
+
},
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1825
1847
|
function providePraxisSurfaceDrawerBridge() {
|
|
1826
1848
|
return [
|
|
1827
1849
|
providePraxisSettingsPanelI18n(),
|
|
@@ -1860,6 +1882,7 @@ function providePraxisSurfaceDrawerBridge() {
|
|
|
1860
1882
|
},
|
|
1861
1883
|
createRef: (overlayRef) => new BaseSidePanelOverlayRef(overlayRef),
|
|
1862
1884
|
attach: (panelRef, ref) => {
|
|
1885
|
+
const contentInputs = enrichSurfaceContentInputs(opts.content.inputs, ref);
|
|
1863
1886
|
panelRef.instance.title = opts.title;
|
|
1864
1887
|
panelRef.instance.titleIcon = opts.titleIcon;
|
|
1865
1888
|
panelRef.instance.subtitle = opts.subtitle;
|
|
@@ -1871,12 +1894,12 @@ function providePraxisSurfaceDrawerBridge() {
|
|
|
1871
1894
|
ref.bindTitleUpdater((title) => panelRef.instance.setTitle(title));
|
|
1872
1895
|
const contentInjector = Injector.create({
|
|
1873
1896
|
providers: [
|
|
1874
|
-
{ provide: BASE_SIDE_PANEL_DATA, useValue:
|
|
1897
|
+
{ provide: BASE_SIDE_PANEL_DATA, useValue: contentInputs },
|
|
1875
1898
|
{ provide: BASE_SIDE_PANEL_REF, useValue: ref },
|
|
1876
1899
|
],
|
|
1877
1900
|
parent: injector,
|
|
1878
1901
|
});
|
|
1879
|
-
panelRef.instance.attachContent(opts.content.component, contentInjector,
|
|
1902
|
+
panelRef.instance.attachContent(opts.content.component, contentInjector, contentInputs);
|
|
1880
1903
|
panelRef.changeDetectorRef.detectChanges();
|
|
1881
1904
|
},
|
|
1882
1905
|
createCloser: (ref) => (reason = 'close') => ref.close({ type: reason }),
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/settings-panel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-beta.0",
|
|
4
4
|
"description": "Settings panel for Praxis UI libraries: open editors for configuration at runtime and persist settings.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
7
7
|
"@angular/core": "^21.0.0",
|
|
8
8
|
"@angular/cdk": "^21.0.0",
|
|
9
9
|
"@angular/material": "^21.0.0",
|
|
10
|
-
"@praxisui/ai": "^
|
|
11
|
-
"@praxisui/core": "^
|
|
12
|
-
"@praxisui/dynamic-fields": "^
|
|
10
|
+
"@praxisui/ai": "^9.0.0-beta.0",
|
|
11
|
+
"@praxisui/core": "^9.0.0-beta.0",
|
|
12
|
+
"@praxisui/dynamic-fields": "^9.0.0-beta.0",
|
|
13
13
|
"rxjs": "~7.8.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|