@ng-doc/app 15.11.3 → 15.13.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 +1 -1
- package/components/navbar/navbar.component.d.ts +9 -1
- package/components/playground/index.d.ts +1 -0
- package/components/playground/playground-properties/playground-properties.component.d.ts +12 -3
- package/components/playground/playground-property/playground-property.component.d.ts +6 -7
- package/components/playground/playground-property-control.d.ts +7 -0
- package/components/playground/playground.module.d.ts +1 -1
- package/components/root/root.component.d.ts +26 -2
- package/components/root/root.module.d.ts +3 -2
- package/esm2020/components/breadcrumb/breadcrumb.component.mjs +2 -2
- package/esm2020/components/navbar/navbar.component.mjs +20 -4
- package/esm2020/components/page/page.component.mjs +2 -2
- package/esm2020/components/playground/index.mjs +2 -1
- package/esm2020/components/playground/playground-properties/playground-properties.component.mjs +76 -7
- package/esm2020/components/playground/playground-property/playground-property.component.mjs +21 -48
- package/esm2020/components/playground/playground-property-control.mjs +2 -0
- package/esm2020/components/playground/playground.module.mjs +10 -4
- package/esm2020/components/root/root.component.mjs +49 -6
- package/esm2020/components/root/root.module.mjs +6 -5
- package/esm2020/components/search/search.component.mjs +3 -3
- package/esm2020/components/theme-toggle/theme-toggle.component.mjs +3 -3
- package/esm2020/constants/store-keys.mjs +2 -2
- package/esm2020/helpers/index.mjs +2 -1
- package/esm2020/helpers/is-dark-os-theme.mjs +7 -0
- package/esm2020/interfaces/application-config.mjs +1 -1
- package/esm2020/interfaces/type-control-provider-options.mjs +1 -1
- package/esm2020/modules/root/ng-doc.module.mjs +6 -2
- package/esm2020/services/sidebar/sidebar.service.mjs +28 -24
- package/esm2020/services/theme/theme.service.mjs +61 -13
- package/esm2020/type-controls/boolean-control/boolean-control.module.mjs +2 -2
- package/esm2020/type-controls/number-control/number-control.module.mjs +2 -2
- package/esm2020/type-controls/string-control/string-control.module.mjs +2 -2
- package/esm2020/type-controls/type-alias-control/type-alias-control.module.mjs +2 -2
- package/fesm2015/ng-doc-app-components-breadcrumb.mjs +2 -2
- package/fesm2015/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-navbar.mjs +19 -3
- package/fesm2015/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-page.mjs +2 -2
- package/fesm2015/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-playground.mjs +111 -60
- package/fesm2015/ng-doc-app-components-playground.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-root.mjs +52 -9
- package/fesm2015/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-search.mjs +2 -2
- package/fesm2015/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-theme-toggle.mjs +2 -2
- package/fesm2015/ng-doc-app-components-theme-toggle.mjs.map +1 -1
- package/fesm2015/ng-doc-app-constants.mjs +1 -1
- package/fesm2015/ng-doc-app-constants.mjs.map +1 -1
- package/fesm2015/ng-doc-app-helpers.mjs +8 -1
- package/fesm2015/ng-doc-app-helpers.mjs.map +1 -1
- package/fesm2015/ng-doc-app-modules-root.mjs +5 -1
- package/fesm2015/ng-doc-app-modules-root.mjs.map +1 -1
- package/fesm2015/ng-doc-app-services-sidebar.mjs +27 -23
- package/fesm2015/ng-doc-app-services-sidebar.mjs.map +1 -1
- package/fesm2015/ng-doc-app-services-theme.mjs +60 -12
- package/fesm2015/ng-doc-app-services-theme.mjs.map +1 -1
- package/fesm2015/ng-doc-app-type-controls-boolean-control.mjs +1 -1
- package/fesm2015/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
- package/fesm2015/ng-doc-app-type-controls-number-control.mjs +1 -1
- package/fesm2015/ng-doc-app-type-controls-number-control.mjs.map +1 -1
- package/fesm2015/ng-doc-app-type-controls-string-control.mjs +1 -1
- package/fesm2015/ng-doc-app-type-controls-string-control.mjs.map +1 -1
- package/fesm2015/ng-doc-app-type-controls-type-alias-control.mjs +1 -1
- package/fesm2015/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-breadcrumb.mjs +2 -2
- package/fesm2020/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-navbar.mjs +19 -3
- package/fesm2020/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-page.mjs +2 -2
- package/fesm2020/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-playground.mjs +109 -60
- package/fesm2020/ng-doc-app-components-playground.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-root.mjs +52 -9
- package/fesm2020/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-search.mjs +2 -2
- package/fesm2020/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-theme-toggle.mjs +2 -2
- package/fesm2020/ng-doc-app-components-theme-toggle.mjs.map +1 -1
- package/fesm2020/ng-doc-app-constants.mjs +1 -1
- package/fesm2020/ng-doc-app-constants.mjs.map +1 -1
- package/fesm2020/ng-doc-app-helpers.mjs +8 -1
- package/fesm2020/ng-doc-app-helpers.mjs.map +1 -1
- package/fesm2020/ng-doc-app-modules-root.mjs +5 -1
- package/fesm2020/ng-doc-app-modules-root.mjs.map +1 -1
- package/fesm2020/ng-doc-app-services-sidebar.mjs +27 -23
- package/fesm2020/ng-doc-app-services-sidebar.mjs.map +1 -1
- package/fesm2020/ng-doc-app-services-theme.mjs +60 -12
- package/fesm2020/ng-doc-app-services-theme.mjs.map +1 -1
- package/fesm2020/ng-doc-app-type-controls-boolean-control.mjs +1 -1
- package/fesm2020/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
- package/fesm2020/ng-doc-app-type-controls-number-control.mjs +1 -1
- package/fesm2020/ng-doc-app-type-controls-number-control.mjs.map +1 -1
- package/fesm2020/ng-doc-app-type-controls-string-control.mjs +1 -1
- package/fesm2020/ng-doc-app-type-controls-string-control.mjs.map +1 -1
- package/fesm2020/ng-doc-app-type-controls-type-alias-control.mjs +1 -1
- package/fesm2020/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/helpers/index.d.ts +1 -0
- package/helpers/is-dark-os-theme.d.ts +4 -0
- package/interfaces/application-config.d.ts +11 -1
- package/interfaces/type-control-provider-options.d.ts +5 -0
- package/package.json +3 -3
- package/services/sidebar/sidebar.service.d.ts +3 -10
- package/services/theme/theme.service.d.ts +23 -3
- package/styles/global.css +11 -2
- package/styles/main.css +6 -2
|
@@ -25,7 +25,7 @@ class NgDocThemeToggleComponent {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
NgDocThemeToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocThemeToggleComponent, deps: [{ token: i1.NgDocThemeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
NgDocThemeToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.4", type: NgDocThemeToggleComponent, selector: "ng-doc-theme-toggle", ngImport: i0, template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" ngDocTooltip=\"Toggle
|
|
28
|
+
NgDocThemeToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.4", type: NgDocThemeToggleComponent, selector: "ng-doc-theme-toggle", ngImport: i0, template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" ngDocTooltip=\"Toggle Theme\">\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"sun\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"!nextTheme?.id\"\n\t></ng-doc-icon>\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"moon\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"nextTheme?.id === themes[0]?.id\"\n\t></ng-doc-icon>\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"circle\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"nextTheme?.id === themes[1]?.id\"\n\t></ng-doc-icon>\n</button>\n", styles: [":host{display:inline-block;height:40px;width:40px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }, { kind: "component", type: i3.NgDocButtonIconComponent, selector: "button[ng-doc-button-icon], a[ng-doc-button-icon]", inputs: ["size", "rounded"] }, { kind: "component", type: i3.NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "size"] }], animations: [
|
|
29
29
|
trigger('switchIcon', [
|
|
30
30
|
transition(':enter', [
|
|
31
31
|
style({ transform: 'translateX({{from}})', position: 'absolute', opacity: 0 }),
|
|
@@ -50,7 +50,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImpor
|
|
|
50
50
|
animate('225ms cubic-bezier(0.4,0.0,0.2,1)', style({ transform: 'translateX({{to}})', position: 'absolute', opacity: 0 })),
|
|
51
51
|
], { params: { to: '-100%' } }),
|
|
52
52
|
]),
|
|
53
|
-
], selector: 'ng-doc-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" ngDocTooltip=\"Toggle
|
|
53
|
+
], selector: 'ng-doc-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" ngDocTooltip=\"Toggle Theme\">\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"sun\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"!nextTheme?.id\"\n\t></ng-doc-icon>\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"moon\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"nextTheme?.id === themes[0]?.id\"\n\t></ng-doc-icon>\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"circle\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"nextTheme?.id === themes[1]?.id\"\n\t></ng-doc-icon>\n</button>\n", styles: [":host{display:inline-block;height:40px;width:40px}\n"] }]
|
|
54
54
|
}], ctorParameters: function () { return [{ type: i1.NgDocThemeService }]; } });
|
|
55
55
|
|
|
56
56
|
class NgDocThemeToggleModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-theme-toggle.mjs","sources":["../../../../libs/app/components/theme-toggle/theme-toggle.component.ts","../../../../libs/app/components/theme-toggle/theme-toggle.component.html","../../../../libs/app/components/theme-toggle/theme-toggle.module.ts","../../../../libs/app/components/theme-toggle/ng-doc-app-components-theme-toggle.ts"],"sourcesContent":["import {animate, style, transition, trigger} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {NG_DOC_DARK_PURPLE_THEME, NG_DOC_NIGHT_THEME} from '@ng-doc/app/constants';\nimport {NgDocTheme} from '@ng-doc/app/interfaces';\nimport {NgDocThemeService} from '@ng-doc/app/services';\n\n@Component({\n\tanimations: [\n\t\ttrigger('switchIcon', [\n\t\t\ttransition(\n\t\t\t\t':enter',\n\t\t\t\t[\n\t\t\t\t\tstyle({transform: 'translateX({{from}})', position: 'absolute', opacity: 0}),\n\t\t\t\t\tanimate(\n\t\t\t\t\t\t'225ms cubic-bezier(0.4,0.0,0.2,1)',\n\t\t\t\t\t\tstyle({transform: 'translateX(0%)', position: 'absolute', opacity: 1}),\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\t{params: {from: '-100%'}},\n\t\t\t),\n\t\t\ttransition(\n\t\t\t\t':leave',\n\t\t\t\t[\n\t\t\t\t\tstyle({transform: 'translateX(0%)', position: 'absolute', opacity: 1}),\n\t\t\t\t\tanimate(\n\t\t\t\t\t\t'225ms cubic-bezier(0.4,0.0,0.2,1)',\n\t\t\t\t\t\tstyle({transform: 'translateX({{to}})', position: 'absolute', opacity: 0}),\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\t{params: {to: '-100%'}},\n\t\t\t),\n\t\t]),\n\t],\n\tselector: 'ng-doc-theme-toggle',\n\ttemplateUrl: './theme-toggle.component.html',\n\tstyleUrls: ['./theme-toggle.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocThemeToggleComponent {\n\tprotected readonly themes: Array<NgDocTheme | undefined> = [\n\t\tNG_DOC_NIGHT_THEME,\n\t\tNG_DOC_DARK_PURPLE_THEME,\n\t\tundefined,\n\t];\n\n\tconstructor(protected readonly themeService: NgDocThemeService) {}\n\n\tget nextTheme(): NgDocTheme | undefined {\n\t\treturn this.themes[(this.themes.indexOf(this.themeService.currentTheme) + 1) % this.themes.length];\n\t}\n\n\ttoggleTheme(): void {\n\t\tthis.themeService.set(this.nextTheme?.id);\n\t}\n}\n","<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" ngDocTooltip=\"Toggle
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-theme-toggle.mjs","sources":["../../../../libs/app/components/theme-toggle/theme-toggle.component.ts","../../../../libs/app/components/theme-toggle/theme-toggle.component.html","../../../../libs/app/components/theme-toggle/theme-toggle.module.ts","../../../../libs/app/components/theme-toggle/ng-doc-app-components-theme-toggle.ts"],"sourcesContent":["import {animate, style, transition, trigger} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {NG_DOC_DARK_PURPLE_THEME, NG_DOC_NIGHT_THEME} from '@ng-doc/app/constants';\nimport {NgDocTheme} from '@ng-doc/app/interfaces';\nimport {NgDocThemeService} from '@ng-doc/app/services';\n\n@Component({\n\tanimations: [\n\t\ttrigger('switchIcon', [\n\t\t\ttransition(\n\t\t\t\t':enter',\n\t\t\t\t[\n\t\t\t\t\tstyle({transform: 'translateX({{from}})', position: 'absolute', opacity: 0}),\n\t\t\t\t\tanimate(\n\t\t\t\t\t\t'225ms cubic-bezier(0.4,0.0,0.2,1)',\n\t\t\t\t\t\tstyle({transform: 'translateX(0%)', position: 'absolute', opacity: 1}),\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\t{params: {from: '-100%'}},\n\t\t\t),\n\t\t\ttransition(\n\t\t\t\t':leave',\n\t\t\t\t[\n\t\t\t\t\tstyle({transform: 'translateX(0%)', position: 'absolute', opacity: 1}),\n\t\t\t\t\tanimate(\n\t\t\t\t\t\t'225ms cubic-bezier(0.4,0.0,0.2,1)',\n\t\t\t\t\t\tstyle({transform: 'translateX({{to}})', position: 'absolute', opacity: 0}),\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\t{params: {to: '-100%'}},\n\t\t\t),\n\t\t]),\n\t],\n\tselector: 'ng-doc-theme-toggle',\n\ttemplateUrl: './theme-toggle.component.html',\n\tstyleUrls: ['./theme-toggle.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocThemeToggleComponent {\n\tprotected readonly themes: Array<NgDocTheme | undefined> = [\n\t\tNG_DOC_NIGHT_THEME,\n\t\tNG_DOC_DARK_PURPLE_THEME,\n\t\tundefined,\n\t];\n\n\tconstructor(protected readonly themeService: NgDocThemeService) {}\n\n\tget nextTheme(): NgDocTheme | undefined {\n\t\treturn this.themes[(this.themes.indexOf(this.themeService.currentTheme) + 1) % this.themes.length];\n\t}\n\n\ttoggleTheme(): void {\n\t\tthis.themeService.set(this.nextTheme?.id);\n\t}\n}\n","<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" ngDocTooltip=\"Toggle Theme\">\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"sun\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"!nextTheme?.id\"\n\t></ng-doc-icon>\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"moon\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"nextTheme?.id === themes[0]?.id\"\n\t></ng-doc-icon>\n\t<ng-doc-icon\n\t\t[@switchIcon]=\"{value: ':enter', params: {from: '-100%', to: '100%'}}\"\n\t\ticon=\"circle\"\n\t\t[size]=\"24\"\n\t\t*ngIf=\"nextTheme?.id === themes[1]?.id\"\n\t></ng-doc-icon>\n</button>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {NgDocButtonIconModule, NgDocIconModule, NgDocTooltipModule} from '@ng-doc/ui-kit';\n\nimport {NgDocThemeToggleComponent} from './theme-toggle.component';\n\n@NgModule({\n\tdeclarations: [NgDocThemeToggleComponent],\n\timports: [CommonModule, NgDocTooltipModule, NgDocButtonIconModule, NgDocIconModule],\n\texports: [NgDocThemeToggleComponent],\n})\nexport class NgDocThemeToggleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAsCa,yBAAyB,CAAA;AAOrC,IAAA,WAAA,CAA+B,YAA+B,EAAA;QAA/B,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAmB;AAN3C,QAAA,IAAA,CAAA,MAAM,GAAkC;YAC1D,kBAAkB;YAClB,wBAAwB;YACxB,SAAS;SACT,CAAC;KAEgE;AAElE,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CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAHxB,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA;2FAGtE,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBALlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,YAAY,EAAE,CAAC,yBAAyB,CAAC;oBACzC,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,CAAC;oBACnF,OAAO,EAAE,CAAC,yBAAyB,CAAC;AACpC,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-constants.mjs","sources":["../../../../libs/app/constants/store-keys.ts","../../../../libs/app/constants/themes.ts","../../../../libs/app/constants/ng-doc-app-constants.ts"],"sourcesContent":["export const NG_DOC_STORE_THEME_KEY: string = 'ng-doc-theme';\n","import {NgDocTheme} from '@ng-doc/app/interfaces';\n\n/**\n * Dark theme. You can set it manually by calling `NgDocThemeService.setTheme` method.\n *\n * ```typescript\n * import {Component} from '@angular/core';\n * import {NgDocThemeService, NG_DOC_NIGHT_THEME} from '@ng-doc/app';\n *\n * @Component()\n * export class AppComponent {\n * \tconstructor(\n * \t private readonly themeService: NgDocThemeService,\n * \t) {\n * \t this.themeService.setTheme(NG_DOC_NIGHT_THEME.id);\n * \t}\n * }\n * ```\n *\n * Or you can set it as default theme in your app module:\n * ```typescript\n * import {NgModule} from '@angular/core';\n * import {NgDocModule, NG_DOC_NIGHT_THEME} from '@ng-doc/app';\n * import {AppComponent} from './app.component';\n *\n * @NgModule({\n * \tdeclarations: [AppComponent],\n * \timports: [NgDocModule.forRoot({defaultTheme: NG_DOC_NIGHT_THEME.id})],\n * \tbootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n */\nexport const NG_DOC_NIGHT_THEME: NgDocTheme = {id: 'ng-doc-night', path: 'assets/ng-doc/app/themes/ng-doc-night.css'};\n\n/**\n * Dark purple theme. You can set it manually by calling `NgDocThemeService.setTheme` method.\n *\n * ```typescript\n * import {Component} from '@angular/core';\n * import {NgDocThemeService, NG_DOC_DARK_PURPLE_THEME} from '@ng-doc/app';\n *\n * @Component()\n * export class AppComponent {\n * \tconstructor(\n * \t private readonly themeService: NgDocThemeService,\n * \t) {\n * \t this.themeService.setTheme(NG_DOC_DARK_PURPLE_THEME.id);\n * \t}\n * }\n * ```\n *\n * Or you can set it as default theme in your app module:\n * ```typescript\n * import {NgModule} from '@angular/core';\n * import {NgDocModule, NG_DOC_DARK_PURPLE_THEME} from '@ng-doc/app';\n * import {AppComponent} from './app.component';\n *\n * @NgModule({\n * \tdeclarations: [AppComponent],\n * \timports: [NgDocModule.forRoot({defaultTheme: NG_DOC_DARK_PURPLE_THEME.id})],\n * \tbootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n */\nexport const NG_DOC_DARK_PURPLE_THEME: NgDocTheme = {\n\tid: 'ng-doc-dark-purple',\n\tpath: 'assets/ng-doc/app/themes/ng-doc-dark-purple.css',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,sBAAsB,GAAW;;ACE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,MAAM,kBAAkB,GAAe,EAAC,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,2CAA2C,GAAE;AAEtH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACU,MAAA,wBAAwB,GAAe;AACnD,IAAA,EAAE,EAAE,oBAAoB;AACxB,IAAA,IAAI,EAAE,iDAAiD;;;ACpExD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-app-constants.mjs","sources":["../../../../libs/app/constants/store-keys.ts","../../../../libs/app/constants/themes.ts","../../../../libs/app/constants/ng-doc-app-constants.ts"],"sourcesContent":["export const NG_DOC_STORE_THEME_KEY: string = 'ng-doc-theme-id';\n","import {NgDocTheme} from '@ng-doc/app/interfaces';\n\n/**\n * Dark theme. You can set it manually by calling `NgDocThemeService.setTheme` method.\n *\n * ```typescript\n * import {Component} from '@angular/core';\n * import {NgDocThemeService, NG_DOC_NIGHT_THEME} from '@ng-doc/app';\n *\n * @Component()\n * export class AppComponent {\n * \tconstructor(\n * \t private readonly themeService: NgDocThemeService,\n * \t) {\n * \t this.themeService.setTheme(NG_DOC_NIGHT_THEME.id);\n * \t}\n * }\n * ```\n *\n * Or you can set it as default theme in your app module:\n * ```typescript\n * import {NgModule} from '@angular/core';\n * import {NgDocModule, NG_DOC_NIGHT_THEME} from '@ng-doc/app';\n * import {AppComponent} from './app.component';\n *\n * @NgModule({\n * \tdeclarations: [AppComponent],\n * \timports: [NgDocModule.forRoot({defaultTheme: NG_DOC_NIGHT_THEME.id})],\n * \tbootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n */\nexport const NG_DOC_NIGHT_THEME: NgDocTheme = {id: 'ng-doc-night', path: 'assets/ng-doc/app/themes/ng-doc-night.css'};\n\n/**\n * Dark purple theme. You can set it manually by calling `NgDocThemeService.setTheme` method.\n *\n * ```typescript\n * import {Component} from '@angular/core';\n * import {NgDocThemeService, NG_DOC_DARK_PURPLE_THEME} from '@ng-doc/app';\n *\n * @Component()\n * export class AppComponent {\n * \tconstructor(\n * \t private readonly themeService: NgDocThemeService,\n * \t) {\n * \t this.themeService.setTheme(NG_DOC_DARK_PURPLE_THEME.id);\n * \t}\n * }\n * ```\n *\n * Or you can set it as default theme in your app module:\n * ```typescript\n * import {NgModule} from '@angular/core';\n * import {NgDocModule, NG_DOC_DARK_PURPLE_THEME} from '@ng-doc/app';\n * import {AppComponent} from './app.component';\n *\n * @NgModule({\n * \tdeclarations: [AppComponent],\n * \timports: [NgDocModule.forRoot({defaultTheme: NG_DOC_DARK_PURPLE_THEME.id})],\n * \tbootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n */\nexport const NG_DOC_DARK_PURPLE_THEME: NgDocTheme = {\n\tid: 'ng-doc-dark-purple',\n\tpath: 'assets/ng-doc/app/themes/ng-doc-dark-purple.css',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,sBAAsB,GAAW;;ACE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,MAAM,kBAAkB,GAAe,EAAC,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,2CAA2C,GAAE;AAEtH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACU,MAAA,wBAAwB,GAAe;AACnD,IAAA,EAAE,EAAE,oBAAoB;AACxB,IAAA,IAAI,EAAE,iDAAiD;;;ACpExD;;AAEG;;;;"}
|
|
@@ -46,6 +46,13 @@ function levelFromTagName(heading) {
|
|
|
46
46
|
return Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Check if the OS theme is dark
|
|
51
|
+
*/
|
|
52
|
+
function isDarkOsTheme() {
|
|
53
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
/**
|
|
50
57
|
*
|
|
51
58
|
* @param url
|
|
@@ -139,5 +146,5 @@ function getTokenForType(type) {
|
|
|
139
146
|
* Generated bundle index. Do not edit.
|
|
140
147
|
*/
|
|
141
148
|
|
|
142
|
-
export { asBoolean, generateToc, getPlaygroundDemoToken, getTokenForType, isExternalLink, isPlaygroundProperty, providePlaygroundDemo, provideSearchEngine, provideTypeControl };
|
|
149
|
+
export { asBoolean, generateToc, getPlaygroundDemoToken, getTokenForType, isDarkOsTheme, isExternalLink, isPlaygroundProperty, providePlaygroundDemo, provideSearchEngine, provideTypeControl };
|
|
143
150
|
//# sourceMappingURL=ng-doc-app-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-helpers.mjs","sources":["../../../../libs/app/helpers/as-boolean.ts","../../../../libs/app/helpers/generate-toc.ts","../../../../libs/app/helpers/is-external-link.ts","../../../../libs/app/helpers/is-playground-property.ts","../../../../libs/app/helpers/provide-playground-demo.ts","../../../../libs/app/helpers/provide-search-engine.ts","../../../../libs/app/helpers/provide-type-control.ts","../../../../libs/app/helpers/ng-doc-app-helpers.ts"],"sourcesContent":["/**\n *\n * @param value\n */\nexport function asBoolean(value: unknown): boolean {\n\tif (typeof value === 'string') {\n\t\treturn value.toLowerCase() === 'true' ? true : value.toLowerCase() === 'false' ? false : !!value;\n\t}\n\treturn !!value;\n}\n","import {NgDocTocItem} from '@ng-doc/app/interfaces';\nimport {asArray} from '@ng-doc/core/helpers/as-array';\nimport {NgDocHeading} from '@ng-doc/core/types';\n\n/**\n * Generate table of contents, only for headings with id\n *\n * @param container\n * @param headings\n */\nexport function generateToc(container: HTMLElement): NgDocTocItem[] {\n\tconst headings: NgDocHeading[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n\tconst headingElements: HTMLHeadingElement[] = Array.from(\n\t\tcontainer.querySelectorAll<HTMLHeadingElement>(headings.join(', ')),\n\t).filter((heading: HTMLHeadingElement) => heading.id);\n\n\tconst levels: number[] = asArray(new Set(headingElements.map(levelFromTagName).sort()));\n\n\treturn headingElements.reduce((map: NgDocTocItem[], heading: HTMLHeadingElement) => {\n\t\tconst headingLevel: number = levelFromTagName(heading);\n\t\tconst anchor: HTMLAnchorElement | null = heading.querySelector<HTMLAnchorElement>('a.ng-doc-header-link');\n\n\t\tif (anchor) {\n\t\t\tmap.push({\n\t\t\t\ttitle: heading.textContent?.trim() ?? '',\n\t\t\t\telement: heading,\n\t\t\t\tpath: anchor.pathname + anchor.hash,\n\t\t\t\tlevel: levels.indexOf(headingLevel) + 1,\n\t\t\t});\n\t\t}\n\n\t\treturn map;\n\t}, []);\n}\n\n/**\n *\n * @param heading\n */\nfunction levelFromTagName(heading: HTMLHeadingElement): number {\n\treturn Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);\n}\n","/**\n *\n * @param url\n */\nexport function isExternalLink(url: string): boolean {\n\tconst anchorElement: HTMLAnchorElement = document.createElement('a');\n\n\tanchorElement.href = url;\n\n\treturn anchorElement.host !== window.location.host;\n}\n","import {objectKeys} from '@ng-doc/core/helpers/object-keys';\nimport {NgDocPlaygroundProperty} from '@ng-doc/core/interfaces';\n\n/**\n *\n * @param obj\n */\nexport function isPlaygroundProperty(obj: Record<string, any>): obj is NgDocPlaygroundProperty {\n\treturn objectKeys(obj).includes('type');\n}\n","import {InjectionToken, Provider} from '@angular/core';\nimport {Constructor} from '@ng-doc/core/types';\n\nconst tokenStore: Map<string, InjectionToken<unknown>> = new Map<string, InjectionToken<unknown>>();\n\n/**\n *\n * @param type\n * @param control\n * @param options\n * @param playgroundId\n * @param selector\n * @param component\n */\nexport function providePlaygroundDemo(playgroundId: string, component: Constructor<unknown>): Provider {\n\tconst token: InjectionToken<unknown> =\n\t\ttokenStore.get(playgroundId) ?? new InjectionToken<unknown>(`NG_DOC_PLAYGROUND_DEMO_${playgroundId}`);\n\n\ttokenStore.set(playgroundId, token);\n\n\treturn {\n\t\tprovide: token,\n\t\tuseValue: component,\n\t\tmulti: true,\n\t};\n}\n\n/**\n * Returns the token for the given playground id.\n *\n * @param playgroundId\n */\nexport function getPlaygroundDemoToken<T>(playgroundId: string): InjectionToken<T[]> | undefined {\n\treturn tokenStore.get(playgroundId) as InjectionToken<T[]> | undefined;\n}\n","import {Provider} from '@angular/core';\nimport {NgDocSearchEngine} from '@ng-doc/app/classes/search-engine';\nimport {Constructor} from '@ng-doc/core';\n\n/**\n * Provides the `NgDocSearchEngine` to enable search in the documentation.\n *\n * You can create and provide your own `NgDocSearchEngine` if you want to handle the search yourself.\n *\n * @param engine - The search engine class.\n * @param args - The arguments for the search engine class.\n * @returns The provider for the search engine.\n */\nexport function provideSearchEngine<E extends Constructor<NgDocSearchEngine>>(\n\tengine: E,\n\t...args: ConstructorParameters<E>\n): Provider {\n\treturn {\n\t\tprovide: NgDocSearchEngine,\n\t\tuseValue: new engine(...args),\n\t};\n}\n","import {InjectionToken, Provider} from '@angular/core';\nimport {NgDocProvidedTypeControl, NgDocTypeControl, NgDocTypeControlProviderOptions} from '@ng-doc/app/interfaces';\nimport {Constructor} from '@ng-doc/core/types/constructor';\n\nconst tokenStore: Map<string, InjectionToken<NgDocProvidedTypeControl>> = new Map<\n\tstring,\n\tInjectionToken<NgDocProvidedTypeControl>\n>();\n\n/**\n *\n * @param type\n * @param control\n * @param options\n */\nexport function provideTypeControl(\n\ttype: string,\n\tcontrol: Constructor<NgDocTypeControl>,\n\toptions?: NgDocTypeControlProviderOptions,\n): Provider {\n\tconst token: InjectionToken<NgDocProvidedTypeControl> = new InjectionToken<NgDocProvidedTypeControl>(\n\t\t`NG_DOC_TYPE_CONTROL_${type}`,\n\t);\n\ttokenStore.set(type, token);\n\n\treturn {\n\t\tprovide: token,\n\t\tuseValue: {\n\t\t\tcontrol,\n\t\t\toptions,\n\t\t},\n\t};\n}\n\n/**\n * Returns token for type control based on provided type\n *\n * @param type - type for searched control (e.g. `string`)\n */\nexport function getTokenForType(type: string): InjectionToken<NgDocProvidedTypeControl> | undefined {\n\treturn tokenStore.get(type);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["tokenStore"],"mappings":";;;;;AAAA;;;AAGG;AACG,SAAU,SAAS,CAAC,KAAc,EAAA;AACvC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,KAAK,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AACjG,KAAA;IACD,O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AG,IAAI,CAAC;KAC7B,CAAC;AACH;;ACjBA,MAAM,UAAU,GAA0D,IAAI,GAAG,EAG9E,CAAC;AAEJ;;;;;AAKG;SACa,kBAAkB,CACjC,IAAY,EACZ,OAAsC,EACtC,OAAyC,EAAA;IAEzC,MAAM,KAAK,GAA6C,IAAI,cAAc,CACzE,CAAuB,oBAAA,EAAA,IAAI,CAAE,CAAA,CAC7B,CAAC;AACF,IAAA,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE5B,OAAO;AACN,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,QAAQ,EAAE;YACT,OAAO;YACP,OAAO;AACP,SAAA;KACD,CAAC;AACH,CAAC;AAED;;;;AAIG;AACG,SAAU,eAAe,CAAC,IAAY,EAAA;AAC3C,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B;;ACzCA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-app-helpers.mjs","sources":["../../../../libs/app/helpers/as-boolean.ts","../../../../libs/app/helpers/generate-toc.ts","../../../../libs/app/helpers/is-dark-os-theme.ts","../../../../libs/app/helpers/is-external-link.ts","../../../../libs/app/helpers/is-playground-property.ts","../../../../libs/app/helpers/provide-playground-demo.ts","../../../../libs/app/helpers/provide-search-engine.ts","../../../../libs/app/helpers/provide-type-control.ts","../../../../libs/app/helpers/ng-doc-app-helpers.ts"],"sourcesContent":["/**\n *\n * @param value\n */\nexport function asBoolean(value: unknown): boolean {\n\tif (typeof value === 'string') {\n\t\treturn value.toLowerCase() === 'true' ? true : value.toLowerCase() === 'false' ? false : !!value;\n\t}\n\treturn !!value;\n}\n","import {NgDocTocItem} from '@ng-doc/app/interfaces';\nimport {asArray} from '@ng-doc/core/helpers/as-array';\nimport {NgDocHeading} from '@ng-doc/core/types';\n\n/**\n * Generate table of contents, only for headings with id\n *\n * @param container\n * @param headings\n */\nexport function generateToc(container: HTMLElement): NgDocTocItem[] {\n\tconst headings: NgDocHeading[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n\tconst headingElements: HTMLHeadingElement[] = Array.from(\n\t\tcontainer.querySelectorAll<HTMLHeadingElement>(headings.join(', ')),\n\t).filter((heading: HTMLHeadingElement) => heading.id);\n\n\tconst levels: number[] = asArray(new Set(headingElements.map(levelFromTagName).sort()));\n\n\treturn headingElements.reduce((map: NgDocTocItem[], heading: HTMLHeadingElement) => {\n\t\tconst headingLevel: number = levelFromTagName(heading);\n\t\tconst anchor: HTMLAnchorElement | null = heading.querySelector<HTMLAnchorElement>('a.ng-doc-header-link');\n\n\t\tif (anchor) {\n\t\t\tmap.push({\n\t\t\t\ttitle: heading.textContent?.trim() ?? '',\n\t\t\t\telement: heading,\n\t\t\t\tpath: anchor.pathname + anchor.hash,\n\t\t\t\tlevel: levels.indexOf(headingLevel) + 1,\n\t\t\t});\n\t\t}\n\n\t\treturn map;\n\t}, []);\n}\n\n/**\n *\n * @param heading\n */\nfunction levelFromTagName(heading: HTMLHeadingElement): number {\n\treturn Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);\n}\n","/**\n * Check if the OS theme is dark\n */\nexport function isDarkOsTheme(): boolean {\n\treturn window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n","/**\n *\n * @param url\n */\nexport function isExternalLink(url: string): boolean {\n\tconst anchorElement: HTMLAnchorElement = document.createElement('a');\n\n\tanchorElement.href = url;\n\n\treturn anchorElement.host !== window.location.host;\n}\n","import {objectKeys} from '@ng-doc/core/helpers/object-keys';\nimport {NgDocPlaygroundProperty} from '@ng-doc/core/interfaces';\n\n/**\n *\n * @param obj\n */\nexport function isPlaygroundProperty(obj: Record<string, any>): obj is NgDocPlaygroundProperty {\n\treturn objectKeys(obj).includes('type');\n}\n","import {InjectionToken, Provider} from '@angular/core';\nimport {Constructor} from '@ng-doc/core/types';\n\nconst tokenStore: Map<string, InjectionToken<unknown>> = new Map<string, InjectionToken<unknown>>();\n\n/**\n *\n * @param type\n * @param control\n * @param options\n * @param playgroundId\n * @param selector\n * @param component\n */\nexport function providePlaygroundDemo(playgroundId: string, component: Constructor<unknown>): Provider {\n\tconst token: InjectionToken<unknown> =\n\t\ttokenStore.get(playgroundId) ?? new InjectionToken<unknown>(`NG_DOC_PLAYGROUND_DEMO_${playgroundId}`);\n\n\ttokenStore.set(playgroundId, token);\n\n\treturn {\n\t\tprovide: token,\n\t\tuseValue: component,\n\t\tmulti: true,\n\t};\n}\n\n/**\n * Returns the token for the given playground id.\n *\n * @param playgroundId\n */\nexport function getPlaygroundDemoToken<T>(playgroundId: string): InjectionToken<T[]> | undefined {\n\treturn tokenStore.get(playgroundId) as InjectionToken<T[]> | undefined;\n}\n","import {Provider} from '@angular/core';\nimport {NgDocSearchEngine} from '@ng-doc/app/classes/search-engine';\nimport {Constructor} from '@ng-doc/core';\n\n/**\n * Provides the `NgDocSearchEngine` to enable search in the documentation.\n *\n * You can create and provide your own `NgDocSearchEngine` if you want to handle the search yourself.\n *\n * @param engine - The search engine class.\n * @param args - The arguments for the search engine class.\n * @returns The provider for the search engine.\n */\nexport function provideSearchEngine<E extends Constructor<NgDocSearchEngine>>(\n\tengine: E,\n\t...args: ConstructorParameters<E>\n): Provider {\n\treturn {\n\t\tprovide: NgDocSearchEngine,\n\t\tuseValue: new engine(...args),\n\t};\n}\n","import {InjectionToken, Provider} from '@angular/core';\nimport {NgDocProvidedTypeControl, NgDocTypeControl, NgDocTypeControlProviderOptions} from '@ng-doc/app/interfaces';\nimport {Constructor} from '@ng-doc/core/types/constructor';\n\nconst tokenStore: Map<string, InjectionToken<NgDocProvidedTypeControl>> = new Map<\n\tstring,\n\tInjectionToken<NgDocProvidedTypeControl>\n>();\n\n/**\n *\n * @param type\n * @param control\n * @param options\n */\nexport function provideTypeControl(\n\ttype: string,\n\tcontrol: Constructor<NgDocTypeControl>,\n\toptions?: NgDocTypeControlProviderOptions,\n): Provider {\n\tconst token: InjectionToken<NgDocProvidedTypeControl> = new InjectionToken<NgDocProvidedTypeControl>(\n\t\t`NG_DOC_TYPE_CONTROL_${type}`,\n\t);\n\ttokenStore.set(type, token);\n\n\treturn {\n\t\tprovide: token,\n\t\tuseValue: {\n\t\t\tcontrol,\n\t\t\toptions,\n\t\t},\n\t};\n}\n\n/**\n * Returns token for type control based on provided type\n *\n * @param type - type for searched control (e.g. `string`)\n */\nexport function getTokenForType(type: string): InjectionToken<NgDocProvidedTypeControl> | undefined {\n\treturn tokenStore.get(type);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["tokenStore"],"mappings":";;;;;AAAA;;;AAGG;AACG,SAAU,SAAS,CAAC,KAAc,EAAA;AACvC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,KAAK,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AACjG,KAAA;IACD,OAAO,CAAC,CAAC,KAAK,CAAC;AAChB;;ACLA;;;;;AAKG;AACG,SAAU,WAAW,CAAC,SAAsB,EAAA;AACjD,IAAA,MAAM,QAAQ,GAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEtE,IAAA,MAAM,eAAe,GAAyB,KAAK,CAAC,IAAI,CACvD,SAAS,CAAC,gBAAgB,CAAqB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CACnE,CAAC,MAAM,CAAC,CAAC,OAA2B,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC;AAEtD,IAAA,MAAM,MAAM,GAAa,OAAO,CAAC,IAAI,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAExF,OAAO,eAAe,CAAC,MAAM,CAAC,CA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,CAAC,IAAY,EAAA;AAC3C,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B;;ACzCA;;AAEG;;;;"}
|
|
@@ -4,6 +4,7 @@ import * as i0 from '@angular/core';
|
|
|
4
4
|
import { APP_INITIALIZER, Optional, NgModule } from '@angular/core';
|
|
5
5
|
import { NgDocRootModule } from '@ng-doc/app/components/root';
|
|
6
6
|
import { NG_DOC_NIGHT_THEME, NG_DOC_DARK_PURPLE_THEME, NG_DOC_STORE_THEME_KEY } from '@ng-doc/app/constants';
|
|
7
|
+
import { isDarkOsTheme } from '@ng-doc/app/helpers';
|
|
7
8
|
import { NgDocStoreService } from '@ng-doc/app/services/store';
|
|
8
9
|
import { NgDocThemeService } from '@ng-doc/app/services/theme';
|
|
9
10
|
import { NG_DOC_THEME, NG_DOC_DEFAULT_THEME_ID } from '@ng-doc/app/tokens';
|
|
@@ -32,7 +33,10 @@ class NgDocModule {
|
|
|
32
33
|
useFactory: (themeService, store, defaultThemeId) => {
|
|
33
34
|
return () => {
|
|
34
35
|
const themeId = store.get(NG_DOC_STORE_THEME_KEY);
|
|
35
|
-
|
|
36
|
+
if (defaultThemeId === 'auto' && !themeId) {
|
|
37
|
+
return themeService.set(isDarkOsTheme() ? NG_DOC_NIGHT_THEME.id : undefined, false);
|
|
38
|
+
}
|
|
39
|
+
return themeService.set(themeId ?? defaultThemeId, false);
|
|
36
40
|
};
|
|
37
41
|
},
|
|
38
42
|
multi: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-modules-root.mjs","sources":["../../../../libs/app/modules/root/ng-doc.module.ts","../../../../libs/app/modules/root/ng-doc-app-modules-root.ts"],"sourcesContent":["import {OverlayModule} from '@angular/cdk/overlay';\nimport {HttpClientModule} from '@angular/common/http';\nimport {APP_INITIALIZER, ModuleWithProviders, NgModule, Optional} from '@angular/core';\nimport {NgDocRootModule} from '@ng-doc/app/components/root';\nimport {NG_DOC_DARK_PURPLE_THEME, NG_DOC_NIGHT_THEME, NG_DOC_STORE_THEME_KEY} from '@ng-doc/app/constants';\nimport {NgDocApplicationConfig, NgDocTheme} from '@ng-doc/app/interfaces';\nimport {NgDocStoreService} from '@ng-doc/app/services/store';\nimport {NgDocThemeService} from '@ng-doc/app/services/theme';\nimport {NG_DOC_DEFAULT_THEME_ID, NG_DOC_THEME} from '@ng-doc/app/tokens';\nimport {asArray} from '@ng-doc/core/helpers/as-array';\nimport {NgDocUiKitRootModule} from '@ng-doc/ui-kit/modules/root';\n\n@NgModule({\n\timports: [HttpClientModule, OverlayModule, NgDocUiKitRootModule.forRoot()],\n\texports: [NgDocRootModule, NgDocUiKitRootModule],\n})\nexport class NgDocModule {\n\tstatic forRoot(config?: NgDocApplicationConfig): ModuleWithProviders<NgDocModule> {\n\t\treturn {\n\t\t\tngModule: NgDocModule,\n\t\t\tproviders: [\n\t\t\t\t{provide: NG_DOC_THEME, useValue: NG_DOC_NIGHT_THEME, multi: true},\n\t\t\t\t{provide: NG_DOC_THEME, useValue: NG_DOC_DARK_PURPLE_THEME, multi: true},\n\t\t\t\t...asArray(config?.themes).map((theme: NgDocTheme) => ({\n\t\t\t\t\tprovide: NG_DOC_THEME,\n\t\t\t\t\tuseValue: theme,\n\t\t\t\t\tmulti: true,\n\t\t\t\t})),\n\t\t\t\t...asArray(config?.defaultThemeId).map((themeId: string) => ({\n\t\t\t\t\tprovide: NG_DOC_DEFAULT_THEME_ID,\n\t\t\t\t\tuseValue: themeId,\n\t\t\t\t})),\n\t\t\t\t{\n\t\t\t\t\tprovide: APP_INITIALIZER,\n\t\t\t\t\tuseFactory: (themeService: NgDocThemeService, store: NgDocStoreService, defaultThemeId: string) => {\n\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\tconst themeId: string | null = store.get(NG_DOC_STORE_THEME_KEY);\n\n\t\t\t\t\t\t\treturn themeService.set(themeId ?? defaultThemeId);\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t\tmulti: true,\n\t\t\t\t\tdeps: [NgDocThemeService, NgDocStoreService, [new Optional(), NG_DOC_DEFAULT_THEME_ID]],\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ng-doc-app-modules-root.mjs","sources":["../../../../libs/app/modules/root/ng-doc.module.ts","../../../../libs/app/modules/root/ng-doc-app-modules-root.ts"],"sourcesContent":["import {OverlayModule} from '@angular/cdk/overlay';\nimport {HttpClientModule} from '@angular/common/http';\nimport {APP_INITIALIZER, ModuleWithProviders, NgModule, Optional} from '@angular/core';\nimport {NgDocRootModule} from '@ng-doc/app/components/root';\nimport {NG_DOC_DARK_PURPLE_THEME, NG_DOC_NIGHT_THEME, NG_DOC_STORE_THEME_KEY} from '@ng-doc/app/constants';\nimport {isDarkOsTheme} from '@ng-doc/app/helpers';\nimport {NgDocApplicationConfig, NgDocTheme} from '@ng-doc/app/interfaces';\nimport {NgDocStoreService} from '@ng-doc/app/services/store';\nimport {NgDocThemeService} from '@ng-doc/app/services/theme';\nimport {NG_DOC_DEFAULT_THEME_ID, NG_DOC_THEME} from '@ng-doc/app/tokens';\nimport {asArray} from '@ng-doc/core/helpers/as-array';\nimport {NgDocUiKitRootModule} from '@ng-doc/ui-kit/modules/root';\n\n@NgModule({\n\timports: [HttpClientModule, OverlayModule, NgDocUiKitRootModule.forRoot()],\n\texports: [NgDocRootModule, NgDocUiKitRootModule],\n})\nexport class NgDocModule {\n\tstatic forRoot(config?: NgDocApplicationConfig): ModuleWithProviders<NgDocModule> {\n\t\treturn {\n\t\t\tngModule: NgDocModule,\n\t\t\tproviders: [\n\t\t\t\t{provide: NG_DOC_THEME, useValue: NG_DOC_NIGHT_THEME, multi: true},\n\t\t\t\t{provide: NG_DOC_THEME, useValue: NG_DOC_DARK_PURPLE_THEME, multi: true},\n\t\t\t\t...asArray(config?.themes).map((theme: NgDocTheme) => ({\n\t\t\t\t\tprovide: NG_DOC_THEME,\n\t\t\t\t\tuseValue: theme,\n\t\t\t\t\tmulti: true,\n\t\t\t\t})),\n\t\t\t\t...asArray(config?.defaultThemeId).map((themeId: string) => ({\n\t\t\t\t\tprovide: NG_DOC_DEFAULT_THEME_ID,\n\t\t\t\t\tuseValue: themeId,\n\t\t\t\t})),\n\t\t\t\t{\n\t\t\t\t\tprovide: APP_INITIALIZER,\n\t\t\t\t\tuseFactory: (themeService: NgDocThemeService, store: NgDocStoreService, defaultThemeId: string | 'auto') => {\n\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\tconst themeId: string | null = store.get(NG_DOC_STORE_THEME_KEY);\n\n\t\t\t\t\t\t\tif (defaultThemeId === 'auto' && !themeId) {\n\t\t\t\t\t\t\t\treturn themeService.set(isDarkOsTheme() ? NG_DOC_NIGHT_THEME.id : undefined, false);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn themeService.set(themeId ?? defaultThemeId, false);\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t\tmulti: true,\n\t\t\t\t\tdeps: [NgDocThemeService, NgDocStoreService, [new Optional(), NG_DOC_DEFAULT_THEME_ID]],\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAiBa,WAAW,CAAA;IACvB,OAAO,OAAO,CAAC,MAA+B,EAAA;QAC7C,OAAO;AACN,YAAA,QAAQ,EAAE,WAAW;AACrB,YAAA,SAAS,EAAE;gBACV,EAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAC;gBAClE,EAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,KAAK,EAAE,IAAI,EAAC;AACxE,gBAAA,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC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EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,YAHb,gBAAgB,EAAE,aAAa,EAC/B,EAAA,CAAA,oBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAe,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAEnC,WAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,EAHb,OAAA,EAAA,CAAA,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,CAAC,OAAO,EAAE,EAC/D,eAAe,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA;2FAEnC,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,CAAC,OAAO,EAAE,CAAC;AAC1E,oBAAA,OAAO,EAAE,CAAC,eAAe,EAAE,oBAAoB,CAAC;AAChD,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -9,8 +9,8 @@ import { NavigationEnd, Router } from '@angular/router';
|
|
|
9
9
|
import * as i3 from '@ng-doc/ui-kit/services/scroll';
|
|
10
10
|
import { NgDocScrollService } from '@ng-doc/ui-kit/services/scroll';
|
|
11
11
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
|
12
|
-
import { BehaviorSubject,
|
|
13
|
-
import { pluck,
|
|
12
|
+
import { BehaviorSubject, combineLatest } from 'rxjs';
|
|
13
|
+
import { pluck, distinctUntilChanged, filter, debounceTime } from 'rxjs/operators';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Service for sidebar, it can be used to hide/show sidebar or to check if sidebar is collapsable.
|
|
@@ -22,39 +22,43 @@ let NgDocSidebarService = class NgDocSidebarService {
|
|
|
22
22
|
this.router = router;
|
|
23
23
|
this.scroll = scroll;
|
|
24
24
|
this.breakpoints = [Breakpoints.XSmall, Breakpoints.Small];
|
|
25
|
-
this.
|
|
26
|
-
this.observer = this.breakpointObserver
|
|
27
|
-
|
|
28
|
-
.pipe(
|
|
25
|
+
this.expanded = new BehaviorSubject(true);
|
|
26
|
+
this.observer = this.breakpointObserver
|
|
27
|
+
.observe(this.breakpoints)
|
|
28
|
+
.pipe(pluck('matches'), distinctUntilChanged(), untilDestroyed(this));
|
|
29
|
+
combineLatest([this.router.events, this.isMobileMode()])
|
|
30
|
+
.pipe(filter(([event, isMobileMode]) => event instanceof NavigationEnd && this.expanded.value && isMobileMode), debounceTime(10))
|
|
29
31
|
.subscribe(() => this.hide());
|
|
32
|
+
this.isMobileMode()
|
|
33
|
+
.pipe(untilDestroyed(this))
|
|
34
|
+
.subscribe((isMobileMode) => {
|
|
35
|
+
if (isMobileMode) {
|
|
36
|
+
this.hide();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.show();
|
|
40
|
+
this.scroll.unblock();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
30
43
|
}
|
|
31
44
|
/**
|
|
32
|
-
* Indicates if sidebar
|
|
33
|
-
* You can use it to start showing a button in the navbar to show/hide sidebar.
|
|
34
|
-
* This method uses media queries to check if sidebar is collapsable based on the current screen size.
|
|
45
|
+
* Indicates if sidebar is collapsable, based on the screen size.
|
|
35
46
|
*/
|
|
36
|
-
|
|
47
|
+
isMobileMode() {
|
|
37
48
|
return this.observer;
|
|
38
49
|
}
|
|
39
50
|
/**
|
|
40
51
|
* Indicates if sidebar is visible, based on the show/hide methods.
|
|
41
52
|
*/
|
|
42
|
-
visibilityChanges() {
|
|
43
|
-
return this.visible.asObservable();
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Indicates if sidebar is expanded, based on the show/hide methods and if sidebar is collapsable.
|
|
47
|
-
* This method can be used to display backdrop when sidebar is expanded.
|
|
48
|
-
*/
|
|
49
53
|
isExpanded() {
|
|
50
|
-
return this.
|
|
54
|
+
return this.expanded.asObservable();
|
|
51
55
|
}
|
|
52
56
|
/**
|
|
53
57
|
* Show sidebar, and block scrolling.
|
|
54
58
|
*/
|
|
55
59
|
show() {
|
|
56
|
-
if (!this.
|
|
57
|
-
this.
|
|
60
|
+
if (!this.expanded.value) {
|
|
61
|
+
this.expanded.next(true);
|
|
58
62
|
this.scroll.block();
|
|
59
63
|
}
|
|
60
64
|
}
|
|
@@ -62,8 +66,8 @@ let NgDocSidebarService = class NgDocSidebarService {
|
|
|
62
66
|
* Hide sidebar, and unblock scrolling.
|
|
63
67
|
*/
|
|
64
68
|
hide() {
|
|
65
|
-
if (this.
|
|
66
|
-
this.
|
|
69
|
+
if (this.expanded.value) {
|
|
70
|
+
this.expanded.next(false);
|
|
67
71
|
this.scroll.unblock();
|
|
68
72
|
}
|
|
69
73
|
}
|
|
@@ -71,7 +75,7 @@ let NgDocSidebarService = class NgDocSidebarService {
|
|
|
71
75
|
* Toggle sidebar visibility.
|
|
72
76
|
*/
|
|
73
77
|
toggle() {
|
|
74
|
-
this.
|
|
78
|
+
this.expanded.value ? this.hide() : this.show();
|
|
75
79
|
}
|
|
76
80
|
};
|
|
77
81
|
NgDocSidebarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocSidebarService, deps: [{ token: DOCUMENT }, { token: i1.BreakpointObserver }, { token: i2.Router }, { token: i3.NgDocScrollService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-services-sidebar.mjs","sources":["../../../../libs/app/services/sidebar/sidebar.service.ts","../../../../libs/app/services/sidebar/ng-doc-app-services-sidebar.ts"],"sourcesContent":["import {BreakpointObserver, Breakpoints} from '@angular/cdk/layout';\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {Event, NavigationEnd, Router} from '@angular/router';\nimport {NgDocScrollService} from '@ng-doc/ui-kit/services/scroll';\nimport {UntilDestroy, untilDestroyed} from '@ngneat/until-destroy';\nimport {BehaviorSubject, Observable, of} from 'rxjs';\nimport {filter, pluck, startWith, switchMap} from 'rxjs/operators';\n\n/**\n * Service for sidebar, it can be used to hide/show sidebar or to check if sidebar is collapsable.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\n@UntilDestroy()\nexport class NgDocSidebarService {\n\treadonly breakpoints: string[] = [Breakpoints.XSmall, Breakpoints.Small];\n\tprotected readonly observer: Observable<boolean>;\n\tprotected readonly
|
|
1
|
+
{"version":3,"file":"ng-doc-app-services-sidebar.mjs","sources":["../../../../libs/app/services/sidebar/sidebar.service.ts","../../../../libs/app/services/sidebar/ng-doc-app-services-sidebar.ts"],"sourcesContent":["import {BreakpointObserver, Breakpoints} from '@angular/cdk/layout';\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {Event, NavigationEnd, Router} from '@angular/router';\nimport {NgDocScrollService} from '@ng-doc/ui-kit/services/scroll';\nimport {UntilDestroy, untilDestroyed} from '@ngneat/until-destroy';\nimport {BehaviorSubject, combineLatest, Observable, of} from 'rxjs';\nimport {debounceTime, distinctUntilChanged, filter, pluck, share, startWith, switchMap, tap} from 'rxjs/operators';\n\n/**\n * Service for sidebar, it can be used to hide/show sidebar or to check if sidebar is collapsable.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\n@UntilDestroy()\nexport class NgDocSidebarService {\n\treadonly breakpoints: string[] = [Breakpoints.XSmall, Breakpoints.Small];\n\tprotected readonly observer: Observable<boolean>;\n\tprotected readonly expanded: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);\n\n\tconstructor(\n\t\t@Inject(DOCUMENT)\n\t\tprotected readonly document: Document,\n\t\tprotected readonly breakpointObserver: BreakpointObserver,\n\t\tprotected readonly router: Router,\n\t\tprotected readonly scroll: NgDocScrollService,\n\t) {\n\t\tthis.observer = this.breakpointObserver\n\t\t\t.observe(this.breakpoints)\n\t\t\t.pipe(pluck('matches'), distinctUntilChanged(), untilDestroyed(this));\n\n\t\tcombineLatest([this.router.events, this.isMobileMode()])\n\t\t\t.pipe(\n\t\t\t\tfilter(\n\t\t\t\t\t([event, isMobileMode]: [Event, boolean]) =>\n\t\t\t\t\t\tevent instanceof NavigationEnd && this.expanded.value && isMobileMode,\n\t\t\t\t),\n\t\t\t\tdebounceTime(10),\n\t\t\t)\n\t\t\t.subscribe(() => this.hide());\n\n\t\tthis.isMobileMode()\n\t\t\t.pipe(untilDestroyed(this))\n\t\t\t.subscribe((isMobileMode: boolean) => {\n\t\t\t\tif (isMobileMode) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t\tthis.scroll.unblock();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Indicates if sidebar is collapsable, based on the screen size.\n\t */\n\tisMobileMode(): Observable<boolean> {\n\t\treturn this.observer;\n\t}\n\n\t/**\n\t * Indicates if sidebar is visible, based on the show/hide methods.\n\t */\n\tisExpanded(): Observable<boolean> {\n\t\treturn this.expanded.asObservable();\n\t}\n\n\t/**\n\t * Show sidebar, and block scrolling.\n\t */\n\tshow(): void {\n\t\tif (!this.expanded.value) {\n\t\t\tthis.expanded.next(true);\n\t\t\tthis.scroll.block();\n\t\t}\n\t}\n\n\t/**\n\t * Hide sidebar, and unblock scrolling.\n\t */\n\thide(): void {\n\t\tif (this.expanded.value) {\n\t\t\tthis.expanded.next(false);\n\t\t\tthis.scroll.unblock();\n\t\t}\n\t}\n\n\t/**\n\t * Toggle sidebar visibility.\n\t */\n\ttoggle(): void {\n\t\tthis.expanded.value ? this.hide() : this.show();\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AASA;;AAEG;AAKU,IAAA,mBAAmB,GAAzB,MAAM,mBAAmB,CAAA;AAK/B,IAAA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AA,UAAA,EAAA,CAAA,CAAA;AANL,mBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAHnB,MAAM,EAAA,CAAA,CAAA;AAGN,mBAAmB,GAAA,UAAA,CAAA;AAD/B,IAAA,YAAY,EAAE;qCAQgB,QAAQ;QACE,kBAAkB;QAC9B,MAAM;QACN,kBAAkB,CAAA,CAAA;AAVlC,CAAA,EAAA,mBAAmB,CA8E/B,CAAA;2FA9EY,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACX,oBAAA,UAAU,EAAE,MAAM;AAClB,iBAAA,CAAA;;0BAQE,MAAM;2BAAC,QAAQ,CAAA;;;ACtBlB;;AAEG;;;;"}
|
|
@@ -1,22 +1,51 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
1
2
|
import { DOCUMENT } from '@angular/common';
|
|
2
3
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable, Inject } from '@angular/core';
|
|
4
|
-
import { NG_DOC_STORE_THEME_KEY } from '@ng-doc/app/constants';
|
|
4
|
+
import { Injectable, Inject, Optional } from '@angular/core';
|
|
5
|
+
import { NG_DOC_NIGHT_THEME, NG_DOC_STORE_THEME_KEY } from '@ng-doc/app/constants';
|
|
5
6
|
import * as i1 from '@ng-doc/app/services/store';
|
|
6
|
-
import {
|
|
7
|
+
import { NgDocStoreService } from '@ng-doc/app/services/store';
|
|
8
|
+
import { NG_DOC_THEME, NG_DOC_DEFAULT_THEME_ID } from '@ng-doc/app/tokens';
|
|
9
|
+
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
|
10
|
+
import { Subject, fromEvent } from 'rxjs';
|
|
11
|
+
import { takeUntil } from 'rxjs/operators';
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Service for managing themes.
|
|
15
|
+
*/
|
|
16
|
+
let NgDocThemeService = class NgDocThemeService {
|
|
17
|
+
constructor(document, themes, store, defaultThemeId) {
|
|
10
18
|
this.document = document;
|
|
11
19
|
this.themes = themes;
|
|
12
20
|
this.store = store;
|
|
21
|
+
this.defaultThemeId = defaultThemeId;
|
|
13
22
|
this.theme = undefined;
|
|
23
|
+
this.theme$ = new Subject();
|
|
24
|
+
this.disableAutoTheme$ = new Subject();
|
|
25
|
+
if (defaultThemeId === 'auto') {
|
|
26
|
+
fromEvent(window.matchMedia('(prefers-color-scheme: dark)'), 'change')
|
|
27
|
+
.pipe(takeUntil(this.disableAutoTheme$), untilDestroyed(this))
|
|
28
|
+
.subscribe((event) => this.set(event.matches ? NG_DOC_NIGHT_THEME.id : undefined, false));
|
|
29
|
+
}
|
|
14
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns the current theme.
|
|
33
|
+
*/
|
|
15
34
|
get currentTheme() {
|
|
16
35
|
return this.theme;
|
|
17
36
|
}
|
|
18
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Sets the theme by id.
|
|
39
|
+
*
|
|
40
|
+
* @param id Theme id.
|
|
41
|
+
* @param save Whether to save the theme in the store to restore it when the page is reloaded. (`true` by default)
|
|
42
|
+
*/
|
|
43
|
+
set(id, save = true) {
|
|
19
44
|
this.removeLink();
|
|
45
|
+
if (id === 'auto') {
|
|
46
|
+
return Promise.resolve();
|
|
47
|
+
}
|
|
48
|
+
save && this.disableAutoTheme$.next();
|
|
20
49
|
if (id !== 'day' && id) {
|
|
21
50
|
const theme = this.themes.find((theme) => theme.id === id);
|
|
22
51
|
if (!theme) {
|
|
@@ -26,19 +55,29 @@ class NgDocThemeService {
|
|
|
26
55
|
this.createLinkIfNoExists();
|
|
27
56
|
if (this.linkElement) {
|
|
28
57
|
this.linkElement.href = theme.path;
|
|
29
|
-
this.store.set(NG_DOC_STORE_THEME_KEY, theme.id);
|
|
58
|
+
save && this.store.set(NG_DOC_STORE_THEME_KEY, theme.id);
|
|
30
59
|
this.theme = theme;
|
|
31
60
|
return new Promise((resolve, reject) => {
|
|
32
61
|
if (this.linkElement) {
|
|
33
|
-
this.linkElement.onload =
|
|
62
|
+
this.linkElement.onload = () => {
|
|
63
|
+
this.theme$.next(theme);
|
|
64
|
+
resolve();
|
|
65
|
+
};
|
|
34
66
|
this.linkElement.onerror = reject;
|
|
35
67
|
}
|
|
36
68
|
});
|
|
37
69
|
}
|
|
38
70
|
}
|
|
39
|
-
this.store.set(NG_DOC_STORE_THEME_KEY, 'day');
|
|
71
|
+
save && this.store.set(NG_DOC_STORE_THEME_KEY, 'day');
|
|
72
|
+
this.theme$.next(undefined);
|
|
40
73
|
return Promise.resolve();
|
|
41
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Returns an observable that emits when the theme changes.
|
|
77
|
+
*/
|
|
78
|
+
themeChanges() {
|
|
79
|
+
return this.theme$.asObservable();
|
|
80
|
+
}
|
|
42
81
|
removeLink() {
|
|
43
82
|
this.theme = undefined;
|
|
44
83
|
this.linkElement?.remove();
|
|
@@ -52,9 +91,13 @@ class NgDocThemeService {
|
|
|
52
91
|
this.document.getElementsByTagName('head')[0].appendChild(this.linkElement);
|
|
53
92
|
}
|
|
54
93
|
}
|
|
55
|
-
}
|
|
56
|
-
NgDocThemeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocThemeService, deps: [{ token: DOCUMENT }, { token: NG_DOC_THEME }, { token: i1.NgDocStoreService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
94
|
+
};
|
|
95
|
+
NgDocThemeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocThemeService, deps: [{ token: DOCUMENT }, { token: NG_DOC_THEME }, { token: i1.NgDocStoreService }, { token: NG_DOC_DEFAULT_THEME_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
57
96
|
NgDocThemeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocThemeService, providedIn: 'root' });
|
|
97
|
+
NgDocThemeService = __decorate([
|
|
98
|
+
UntilDestroy(),
|
|
99
|
+
__metadata("design:paramtypes", [Document, Array, NgDocStoreService, String])
|
|
100
|
+
], NgDocThemeService);
|
|
58
101
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocThemeService, decorators: [{
|
|
59
102
|
type: Injectable,
|
|
60
103
|
args: [{
|
|
@@ -66,7 +109,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImpor
|
|
|
66
109
|
}] }, { type: undefined, decorators: [{
|
|
67
110
|
type: Inject,
|
|
68
111
|
args: [NG_DOC_THEME]
|
|
69
|
-
}] }, { type: i1.NgDocStoreService }
|
|
112
|
+
}] }, { type: i1.NgDocStoreService }, { type: undefined, decorators: [{
|
|
113
|
+
type: Inject,
|
|
114
|
+
args: [NG_DOC_DEFAULT_THEME_ID]
|
|
115
|
+
}, {
|
|
116
|
+
type: Optional
|
|
117
|
+
}] }]; } });
|
|
70
118
|
|
|
71
119
|
/**
|
|
72
120
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-services-theme.mjs","sources":["../../../../libs/app/services/theme/theme.service.ts","../../../../libs/app/services/theme/ng-doc-app-services-theme.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {NG_DOC_STORE_THEME_KEY} from '@ng-doc/app/constants';\nimport {NgDocTheme} from '@ng-doc/app/interfaces';\nimport {NgDocStoreService} from '@ng-doc/app/services/store';\nimport {NG_DOC_THEME} from '@ng-doc/app/tokens';\n\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class NgDocThemeService {\n\tprivate linkElement?: HTMLLinkElement;\n\tprivate theme: NgDocTheme | undefined = undefined;\n\n\tconstructor(\n\t\t@Inject(DOCUMENT)\n\t\tprivate readonly document: Document,\n\t\t@Inject(NG_DOC_THEME)\n\t\tprivate readonly themes: NgDocTheme[],\n\t\tprivate readonly store: NgDocStoreService,\n\t) {}\n\n\tget currentTheme(): NgDocTheme | undefined {\n\t\treturn this.theme;\n\t}\n\n\tset(id?: string): Promise<void> {\n\t\tthis.removeLink();\n\n\t\tif (id !== 'day' && id) {\n\t\t\tconst theme: NgDocTheme | undefined = this.themes.find((theme: NgDocTheme) => theme.id === id);\n\n\t\t\tif (!theme) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Theme with id \"${id}\" is not registered. Make sure that you registered it in the root of your application.`,\n\t\t\t\t);\n\n\t\t\t\treturn Promise.resolve();\n\t\t\t}\n\n\t\t\tthis.createLinkIfNoExists();\n\n\t\t\tif (this.linkElement) {\n\t\t\t\tthis.linkElement.href = theme.path;\n\t\t\t\
|
|
1
|
+
{"version":3,"file":"ng-doc-app-services-theme.mjs","sources":["../../../../libs/app/services/theme/theme.service.ts","../../../../libs/app/services/theme/ng-doc-app-services-theme.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, Optional} from '@angular/core';\nimport {NG_DOC_NIGHT_THEME, NG_DOC_STORE_THEME_KEY} from '@ng-doc/app/constants';\nimport {NgDocTheme} from '@ng-doc/app/interfaces';\nimport {NgDocStoreService} from '@ng-doc/app/services/store';\nimport {NG_DOC_DEFAULT_THEME_ID, NG_DOC_THEME} from '@ng-doc/app/tokens';\nimport {UntilDestroy, untilDestroyed} from '@ngneat/until-destroy';\nimport {from, fromEvent, Observable, Subject} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Service for managing themes.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\n@UntilDestroy()\nexport class NgDocThemeService {\n\tprivate linkElement?: HTMLLinkElement;\n\tprivate theme: NgDocTheme | undefined = undefined;\n\tprivate readonly theme$: Subject<NgDocTheme | undefined> = new Subject<NgDocTheme | undefined>();\n\tprivate readonly disableAutoTheme$: Subject<void> = new Subject<void>();\n\n\tconstructor(\n\t\t@Inject(DOCUMENT)\n\t\tprivate readonly document: Document,\n\t\t@Inject(NG_DOC_THEME)\n\t\tprivate readonly themes: NgDocTheme[],\n\t\tprivate readonly store: NgDocStoreService,\n\t\t@Inject(NG_DOC_DEFAULT_THEME_ID)\n\t\t@Optional()\n\t\tprivate readonly defaultThemeId?: string | 'auto',\n\t) {\n\t\tif (defaultThemeId === 'auto') {\n\t\t\tfromEvent<MediaQueryList>(window.matchMedia('(prefers-color-scheme: dark)'), 'change')\n\t\t\t\t.pipe(takeUntil(this.disableAutoTheme$), untilDestroyed(this))\n\t\t\t\t.subscribe((event: MediaQueryList) => this.set(event.matches ? NG_DOC_NIGHT_THEME.id : undefined, false))\n\t\t}\n\t}\n\n\t/**\n\t * Returns the current theme.\n\t */\n\tget currentTheme(): NgDocTheme | undefined {\n\t\treturn this.theme;\n\t}\n\n\t/**\n\t * Sets the theme by id.\n\t *\n\t * @param id Theme id.\n\t * @param save Whether to save the theme in the store to restore it when the page is reloaded. (`true` by default)\n\t */\n\tset(id?: string | 'auto', save: boolean = true): Promise<void> {\n\t\tthis.removeLink();\n\n\t\tif (id === 'auto') {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tsave && this.disableAutoTheme$.next();\n\n\t\tif (id !== 'day' && id) {\n\t\t\tconst theme: NgDocTheme | undefined = this.themes.find((theme: NgDocTheme) => theme.id === id);\n\n\t\t\tif (!theme) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Theme with id \"${id}\" is not registered. Make sure that you registered it in the root of your application.`,\n\t\t\t\t);\n\n\t\t\t\treturn Promise.resolve();\n\t\t\t}\n\n\t\t\tthis.createLinkIfNoExists();\n\n\t\t\tif (this.linkElement) {\n\t\t\t\tthis.linkElement.href = theme.path;\n\t\t\t\tsave && this.store.set(NG_DOC_STORE_THEME_KEY, theme.id);\n\t\t\t\tthis.theme = theme;\n\n\t\t\t\treturn new Promise<void>((resolve: () => void, reject: (err: Event | string) => void) => {\n\t\t\t\t\tif (this.linkElement) {\n\t\t\t\t\t\tthis.linkElement.onload = () => {\n\t\t\t\t\t\t\tthis.theme$.next(theme);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.linkElement.onerror = reject;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tsave && this.store.set(NG_DOC_STORE_THEME_KEY, 'day');\n\n\t\tthis.theme$.next(undefined);\n\n\t\treturn Promise.resolve();\n\t}\n\n\t/**\n\t * Returns an observable that emits when the theme changes.\n\t */\n\tthemeChanges(): Observable<NgDocTheme | undefined> {\n\t\treturn this.theme$.asObservable();\n\t}\n\n\tprivate removeLink(): void {\n\t\tthis.theme = undefined;\n\t\tthis.linkElement?.remove();\n\t\tthis.linkElement = undefined;\n\t}\n\tprivate createLinkIfNoExists(): void {\n\t\tif (!this.linkElement) {\n\t\t\tthis.linkElement = this.document.createElement('link');\n\t\t\tthis.linkElement.setAttribute('rel', 'stylesheet');\n\t\t\tthis.linkElement.setAttribute('type', 'text/css');\n\t\t\tthis.document.getElementsByTagName('head')[0].appendChild(this.linkElement);\n\t\t}\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAUA;;AAEG;AAKU,IAAA,iBAAiB,GAAvB,MAAM,iBAAiB,CAAA;AAM7B,IAAA,WAAA,CAEkB,QAAkB,EAElB,MAAoB,EACpB,KAAwB,EAGxB,cAAgC,EAAA;QANhC,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;QAElB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAc;QACpB,IAAK,CAAA,KAAA,GAAL,KAAK,CAAmB;QAGxB,IAAc,CAAA,cAA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J7B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACX,oBAAA,UAAU,EAAE,MAAM;AAClB,iBAAA,CAAA;;0BASE,MAAM;2BAAC,QAAQ,CAAA;;0BAEf,MAAM;2BAAC,YAAY,CAAA;;0BAGnB,MAAM;2BAAC,uBAAuB,CAAA;;0BAC9B,QAAQ;;;AC9BX;;AAEG;;;;"}
|
|
@@ -21,7 +21,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImpor
|
|
|
21
21
|
args: [{ selector: 'ng-doc-boolean-control', providers: [provideControlHost(NgDocBooleanControlComponent)], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-doc-checkbox [ngDocTooltip]=\"description\" [canOpen]=\"!!description\">{{ name }}</ng-doc-checkbox>\n", styles: [":host{display:inline-flex;width:100%}\n"] }]
|
|
22
22
|
}], ctorParameters: function () { return []; } });
|
|
23
23
|
|
|
24
|
-
const provider = provideTypeControl('boolean', NgDocBooleanControlComponent, { hideLabel: true });
|
|
24
|
+
const provider = provideTypeControl('boolean', NgDocBooleanControlComponent, { hideLabel: true, order: 40 });
|
|
25
25
|
class NgDocBooleanControlModule {
|
|
26
26
|
}
|
|
27
27
|
NgDocBooleanControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocBooleanControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-type-controls-boolean-control.mjs","sources":["../../../../libs/app/type-controls/boolean-control/boolean-control.component.ts","../../../../libs/app/type-controls/boolean-control/boolean-control.component.html","../../../../libs/app/type-controls/boolean-control/boolean-control.module.ts","../../../../libs/app/type-controls/boolean-control/ng-doc-app-type-controls-boolean-control.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {NgDocTypeControl} from '@ng-doc/app/interfaces';\nimport {FlControlHost, provideControlHost} from 'flex-controls';\n\n@Component({\n\tselector: 'ng-doc-boolean-control',\n\ttemplateUrl: './boolean-control.component.html',\n\tstyleUrls: ['./boolean-control.component.scss'],\n\tproviders: [provideControlHost(NgDocBooleanControlComponent)],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocBooleanControlComponent extends FlControlHost<string | undefined> implements NgDocTypeControl {\n\tname: string = '';\n\tdescription: string = '';\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.controlChange.subscribe(() => this.onTouched());\n\t}\n}\n","<ng-doc-checkbox [ngDocTooltip]=\"description\" [canOpen]=\"!!description\">{{ name }}</ng-doc-checkbox>\n","import {CommonModule} from '@angular/common';\nimport {NgModule, Provider} from '@angular/core';\nimport {provideTypeControl} from '@ng-doc/app/helpers';\nimport {NgDocCheckboxModule, NgDocTooltipModule} from '@ng-doc/ui-kit';\n\nimport {NgDocBooleanControlComponent} from './boolean-control.component';\n\nconst provider: Provider = provideTypeControl('boolean', NgDocBooleanControlComponent, {hideLabel: true});\n\n@NgModule({\n\tdeclarations: [NgDocBooleanControlComponent],\n\timports: [CommonModule, NgDocCheckboxModule, NgDocTooltipModule],\n\tproviders: [provider],\n\texports: [NgDocBooleanControlComponent],\n})\nexport class NgDocBooleanControlModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAWM,MAAO,4BAA6B,SAAQ,aAAiC,CAAA;AAIlF,IAAA,WAAA,GAAA;AACC,QAAA,KAAK,EAAE,CAAC;QAJT,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QAClB,IAAW,CAAA,WAAA,GAAW,EAAE,CAAC;AAKxB,QAAA,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;KACrD;;yHARW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA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../../../libs/app/type-controls/boolean-control/boolean-control.component.html","../../../../libs/app/type-controls/boolean-control/boolean-control.module.ts","../../../../libs/app/type-controls/boolean-control/ng-doc-app-type-controls-boolean-control.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {NgDocTypeControl} from '@ng-doc/app/interfaces';\nimport {FlControlHost, provideControlHost} from 'flex-controls';\n\n@Component({\n\tselector: 'ng-doc-boolean-control',\n\ttemplateUrl: './boolean-control.component.html',\n\tstyleUrls: ['./boolean-control.component.scss'],\n\tproviders: [provideControlHost(NgDocBooleanControlComponent)],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocBooleanControlComponent extends FlControlHost<string | undefined> implements NgDocTypeControl {\n\tname: string = '';\n\tdescription: string = '';\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.controlChange.subscribe(() => this.onTouched());\n\t}\n}\n","<ng-doc-checkbox [ngDocTooltip]=\"description\" [canOpen]=\"!!description\">{{ name }}</ng-doc-checkbox>\n","import {CommonModule} from '@angular/common';\nimport {NgModule, Provider} from '@angular/core';\nimport {provideTypeControl} from '@ng-doc/app/helpers';\nimport {NgDocCheckboxModule, NgDocTooltipModule} from '@ng-doc/ui-kit';\n\nimport {NgDocBooleanControlComponent} from './boolean-control.component';\n\nconst provider: Provider = provideTypeControl('boolean', NgDocBooleanControlComponent, {hideLabel: true, order: 40});\n\n@NgModule({\n\tdeclarations: [NgDocBooleanControlComponent],\n\timports: [CommonModule, NgDocCheckboxModule, NgDocTooltipModule],\n\tproviders: [provider],\n\texports: [NgDocBooleanControlComponent],\n})\nexport class NgDocBooleanControlModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAWM,MAAO,4BAA6B,SAAQ,aAAiC,CAAA;AAIlF,IAAA,WAAA,GAAA;AACC,QAAA,KAAK,EAAE,CAAC;QAJT,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QACl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A,CAAA,EAAA,CAAA;;;AEFhD,MAAM,QAAQ,GAAa,kBAAkB,CAAC,SAAS,EAAE,4BAA4B,EAAE,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC;MAQxG,yBAAyB,CAAA;;sHAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;uHAAzB,yBAAyB,EAAA,YAAA,EAAA,CALtB,4BAA4B,CACjC,EAAA,OAAA,EAAA,CAAA,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,CAAA,EAAA,OAAA,EAAA,CAErD,4BAA4B,CAAA,EAAA,CAAA,CAAA;uHAE1B,yBAAyB,EAAA,SAAA,EAH1B,CAAC,QAAQ,CAAC,YADX,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,CAAA,EAAA,CAAA,CAAA;2FAInD,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBANrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,YAAY,EAAE,CAAC,4BAA4B,CAAC;AAC5C,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,CAAC;oBAChE,SAAS,EAAE,CAAC,QAAQ,CAAC;oBACrB,OAAO,EAAE,CAAC,4BAA4B,CAAC;AACvC,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -29,7 +29,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImpor
|
|
|
29
29
|
args: [{ selector: 'ng-doc-number-control', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-doc-input-wrapper flControlSilencer [rightContent]=\"rightContent\">\n\t<input ngDocInputNumber type=\"number\" [ngModel]=\"model\" (ngModelChange)=\"changeModel($event)\">\n\t<ng-template #rightContent>\n\t\t<button\n\t\t\tng-doc-button-icon\n\t\t\tsize=\"large\"\n\t\t\t[ngDocFocusable]=\"false\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[rounded]=\"false\"\n\t\t\t(click)=\"updateModel(defaultValue)\"\n\t\t\t(focusout)=\"onTouched()\"\n\t\t\t*ngIf=\"model && model !== defaultValue\"\n\t\t>\n\t\t\t<ng-doc-icon icon=\"x\"></ng-doc-icon>\n\t\t</button>\n\t</ng-template>\n</ng-doc-input-wrapper>\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
30
30
|
}], ctorParameters: function () { return []; } });
|
|
31
31
|
|
|
32
|
-
const provider = provideTypeControl('number', NgDocNumberControlComponent);
|
|
32
|
+
const provider = provideTypeControl('number', NgDocNumberControlComponent, { order: 30 });
|
|
33
33
|
class NgDocNumberControlModule {
|
|
34
34
|
}
|
|
35
35
|
NgDocNumberControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocNumberControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-type-controls-number-control.mjs","sources":["../../../../libs/app/type-controls/number-control/number-control.component.ts","../../../../libs/app/type-controls/number-control/number-control.component.html","../../../../libs/app/type-controls/number-control/number-control.module.ts","../../../../libs/app/type-controls/number-control/ng-doc-app-type-controls-number-control.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {NgDocTypeControl} from '@ng-doc/app/interfaces';\nimport {extractValue} from '@ng-doc/core/helpers/extract-value';\nimport {FlControl} from 'flex-controls';\n\n@Component({\n\tselector: 'ng-doc-number-control',\n\ttemplateUrl: './number-control.component.html',\n\tstyleUrls: ['./number-control.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocNumberControlComponent extends FlControl<number> implements NgDocTypeControl {\n\tdefault: string | undefined;\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tget defaultValue(): number | null {\n\t\treturn this.default ? (extractValue(this.default) as number) : null;\n\t}\n\n\tchangeModel(value: number | null): void {\n\t\tthis.updateModel(value === null && this.default ? this.defaultValue : value);\n\t}\n}\n","<ng-doc-input-wrapper flControlSilencer [rightContent]=\"rightContent\">\n\t<input ngDocInputNumber type=\"number\" [ngModel]=\"model\" (ngModelChange)=\"changeModel($event)\">\n\t<ng-template #rightContent>\n\t\t<button\n\t\t\tng-doc-button-icon\n\t\t\tsize=\"large\"\n\t\t\t[ngDocFocusable]=\"false\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[rounded]=\"false\"\n\t\t\t(click)=\"updateModel(defaultValue)\"\n\t\t\t(focusout)=\"onTouched()\"\n\t\t\t*ngIf=\"model && model !== defaultValue\"\n\t\t>\n\t\t\t<ng-doc-icon icon=\"x\"></ng-doc-icon>\n\t\t</button>\n\t</ng-template>\n</ng-doc-input-wrapper>\n","import {CommonModule} from '@angular/common';\nimport {NgModule, Provider} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {provideTypeControl} from '@ng-doc/app/helpers';\nimport {\n\tNgDocButtonIconModule,\n\tNgDocClearControlModule,\n\tNgDocFocusableModule,\n\tNgDocIconModule,\n\tNgDocInputNumberModule,\n\tNgDocInputWrapperModule,\n} from '@ng-doc/ui-kit';\nimport {FlControlSilencerModule} from 'flex-controls';\n\nimport {NgDocNumberControlComponent} from './number-control.component';\n\nconst provider: Provider = provideTypeControl('number', NgDocNumberControlComponent);\n\n@NgModule({\n\tdeclarations: [NgDocNumberControlComponent],\n\timports: [\n\t\tCommonModule,\n\t\tNgDocInputWrapperModule,\n\t\tNgDocInputNumberModule,\n\t\tNgDocClearControlModule,\n\t\tFormsModule,\n\t\tFlControlSilencerModule,\n\t\tNgDocButtonIconModule,\n\t\tNgDocFocusableModule,\n\t\tNgDocIconModule,\n\t],\n\tproviders: [provider],\n\texports: [NgDocNumberControlComponent],\n})\nexport class NgDocNumberControlModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';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A,QAAA,EAAA,2lBAAA,EAAA,MAAA,EAAA,CAAA,mCAAA,CAAA,EAAA,CAAA;;;AEOhD,MAAM,QAAQ,GAAa,kBAAkB,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ng-doc-app-type-controls-number-control.mjs","sources":["../../../../libs/app/type-controls/number-control/number-control.component.ts","../../../../libs/app/type-controls/number-control/number-control.component.html","../../../../libs/app/type-controls/number-control/number-control.module.ts","../../../../libs/app/type-controls/number-control/ng-doc-app-type-controls-number-control.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {NgDocTypeControl} from '@ng-doc/app/interfaces';\nimport {extractValue} from '@ng-doc/core/helpers/extract-value';\nimport {FlControl} from 'flex-controls';\n\n@Component({\n\tselector: 'ng-doc-number-control',\n\ttemplateUrl: './number-control.component.html',\n\tstyleUrls: ['./number-control.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocNumberControlComponent extends FlControl<number> implements NgDocTypeControl {\n\tdefault: string | undefined;\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tget defaultValue(): number | null {\n\t\treturn this.default ? (extractValue(this.default) as number) : null;\n\t}\n\n\tchangeModel(value: number | null): void {\n\t\tthis.updateModel(value === null && this.default ? this.defaultValue : value);\n\t}\n}\n","<ng-doc-input-wrapper flControlSilencer [rightContent]=\"rightContent\">\n\t<input ngDocInputNumber type=\"number\" [ngModel]=\"model\" (ngModelChange)=\"changeModel($event)\">\n\t<ng-template #rightContent>\n\t\t<button\n\t\t\tng-doc-button-icon\n\t\t\tsize=\"large\"\n\t\t\t[ngDocFocusable]=\"false\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[rounded]=\"false\"\n\t\t\t(click)=\"updateModel(defaultValue)\"\n\t\t\t(focusout)=\"onTouched()\"\n\t\t\t*ngIf=\"model && model !== defaultValue\"\n\t\t>\n\t\t\t<ng-doc-icon icon=\"x\"></ng-doc-icon>\n\t\t</button>\n\t</ng-template>\n</ng-doc-input-wrapper>\n","import {CommonModule} from '@angular/common';\nimport {NgModule, Provider} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {provideTypeControl} from '@ng-doc/app/helpers';\nimport {\n\tNgDocButtonIconModule,\n\tNgDocClearControlModule,\n\tNgDocFocusableModule,\n\tNgDocIconModule,\n\tNgDocInputNumberModule,\n\tNgDocInputWrapperModule,\n} from '@ng-doc/ui-kit';\nimport {FlControlSilencerModule} from 'flex-controls';\n\nimport {NgDocNumberControlComponent} from './number-control.component';\n\nconst provider: Provider = provideTypeControl('number', NgDocNumberControlComponent, {order: 30});\n\n@NgModule({\n\tdeclarations: [NgDocNumberControlComponent],\n\timports: [\n\t\tCommonModule,\n\t\tNgDocInputWrapperModule,\n\t\tNgDocInputNumberModule,\n\t\tNgDocClearControlModule,\n\t\tFormsModule,\n\t\tFlControlSilencerModule,\n\t\tNgDocButtonIconModule,\n\t\tNgDocFocusableModule,\n\t\tNgDocIconModule,\n\t],\n\tproviders: [provider],\n\texports: [NgDocNumberControlComponent],\n})\nexport class NgDocNumberControlModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAWM,MAAO,2BAA4B,SAAQ,SAAiB,CAAA;AAGjE,IAAA,WAAA,GAAA;AACC,QAAA,KAAK,EAAE,CAAC;KACR;AAED,IAAA,IAAI,YAAY,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,OAAO,GAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAY,GAAG,IAAI,CAAC;KACpE;AAED,IAAA,WAAW,CAAC,KAAoB,EAAA;QAC/B,IAAI,CAAC,WAAW,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC;KAC7E;;wHAbW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAA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qB;QACrB,oBAAoB;AACpB,QAAA,eAAe,aAGN,2BAA2B,CAAA,EAAA,CAAA,CAAA;AAEzB,wBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,EAHzB,SAAA,EAAA,CAAC,QAAQ,CAAC,YAVpB,YAAY;QACZ,uBAAuB;QACvB,sBAAsB;QACtB,uBAAuB;QACvB,WAAW;QACX,uBAAuB;QACvB,qBAAqB;QACrB,oBAAoB;QACpB,eAAe,CAAA,EAAA,CAAA,CAAA;2FAKJ,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAhBpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,YAAY,EAAE,CAAC,2BAA2B,CAAC;AAC3C,oBAAA,OAAO,EAAE;wBACR,YAAY;wBACZ,uBAAuB;wBACvB,sBAAsB;wBACtB,uBAAuB;wBACvB,WAAW;wBACX,uBAAuB;wBACvB,qBAAqB;wBACrB,oBAAoB;wBACpB,eAAe;AACf,qBAAA;oBACD,SAAS,EAAE,CAAC,QAAQ,CAAC;oBACrB,OAAO,EAAE,CAAC,2BAA2B,CAAC;AACtC,iBAAA,CAAA;;;ACjCD;;AAEG;;;;"}
|
|
@@ -30,7 +30,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImpor
|
|
|
30
30
|
args: [{ selector: 'ng-doc-string-control', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-doc-input-wrapper [rightContent]=\"rightContent\" flControlSilencer>\n\t<input ngDocInputString [ngModel]=\"model\" (ngModelChange)=\"changeModel($event)\">\n\t<ng-template #rightContent>\n\t\t<button\n\t\t\tng-doc-button-icon\n\t\t\tsize=\"large\"\n\t\t\t[ngDocFocusable]=\"false\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[rounded]=\"false\"\n\t\t\t(click)=\"updateModel(defaultValue)\"\n\t\t\t(focusout)=\"onTouched()\"\n\t\t\t*ngIf=\"model && model !== defaultValue\"\n\t\t>\n\t\t\t<ng-doc-icon icon=\"x\"></ng-doc-icon>\n\t\t</button>\n\t</ng-template>\n</ng-doc-input-wrapper>\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
31
31
|
}], ctorParameters: function () { return []; } });
|
|
32
32
|
|
|
33
|
-
const provider = provideTypeControl('string', NgDocStringControlComponent);
|
|
33
|
+
const provider = provideTypeControl('string', NgDocStringControlComponent, { order: 20 });
|
|
34
34
|
class NgDocStringControlModule {
|
|
35
35
|
}
|
|
36
36
|
NgDocStringControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: NgDocStringControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|