@mintplayer/ng-bootstrap 17.2.0 → 17.4.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/code-snippet/src/code-snippet.component.d.ts +8 -2
- package/esm2022/code-snippet/src/code-snippet.component.mjs +17 -5
- package/esm2022/shell/index.mjs +5 -0
- package/esm2022/shell/mintplayer-ng-bootstrap-shell.mjs +5 -0
- package/esm2022/shell/src/shell/shell.component.mjs +41 -0
- package/esm2022/shell/src/shell-sidebar/shell-sidebar.directive.mjs +20 -0
- package/esm2022/shell/src/shell-state.mjs +2 -0
- package/esm2022/shell/src/shell.module.mjs +19 -0
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +16 -4
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +79 -0
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -0
- package/package.json +7 -1
- package/shell/index.d.ts +4 -0
- package/shell/src/shell/shell.component.d.ts +19 -0
- package/shell/src/shell-sidebar/shell-sidebar.directive.d.ts +10 -0
- package/shell/src/shell-state.d.ts +1 -0
- package/shell/src/shell.module.d.ts +9 -0
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
1
|
+
import { EventEmitter, TemplateRef } from '@angular/core';
|
|
2
|
+
import { HighlightAutoResult } from 'ngx-highlightjs';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
4
|
import * as i0 from "@angular/core";
|
|
3
5
|
export declare class BsCodeSnippetComponent {
|
|
6
|
+
constructor();
|
|
4
7
|
offcanvasVisible: boolean;
|
|
5
8
|
codeToCopy: string;
|
|
6
9
|
languages: string[] | null;
|
|
7
10
|
lineNumbers: boolean;
|
|
8
11
|
copiedTemplate: TemplateRef<any>;
|
|
12
|
+
detectedLanguage: EventEmitter<string>;
|
|
13
|
+
language$: BehaviorSubject<string>;
|
|
9
14
|
copiedHtml(): void;
|
|
15
|
+
onHighlighted(result: HighlightAutoResult): void;
|
|
10
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<BsCodeSnippetComponent, never>;
|
|
11
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BsCodeSnippetComponent, "bs-code-snippet", never, { "codeToCopy": { "alias": "codeToCopy"; "required": false; }; "languages": { "alias": "languages"; "required": false; }; "lineNumbers": { "alias": "lineNumbers"; "required": false; }; }, {}, never, never, true, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BsCodeSnippetComponent, "bs-code-snippet", never, { "codeToCopy": { "alias": "codeToCopy"; "required": false; }; "languages": { "alias": "languages"; "required": false; }; "lineNumbers": { "alias": "lineNumbers"; "required": false; }; }, { "detectedLanguage": "detectedLanguage"; }, never, never, true, never>;
|
|
12
18
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AsyncPipe } from '@angular/common';
|
|
2
|
+
import { Component, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
2
4
|
import { BsCopyDirective } from '@mintplayer/ng-bootstrap/copy';
|
|
3
5
|
import { BsOffcanvasModule } from '@mintplayer/ng-bootstrap/offcanvas';
|
|
4
6
|
import { HighlightModule } from 'ngx-highlightjs';
|
|
7
|
+
import { BehaviorSubject } from 'rxjs';
|
|
5
8
|
import * as i0 from "@angular/core";
|
|
6
9
|
import * as i1 from "@mintplayer/ng-bootstrap/offcanvas";
|
|
7
10
|
import * as i2 from "ngx-highlightjs";
|
|
@@ -11,18 +14,25 @@ export class BsCodeSnippetComponent {
|
|
|
11
14
|
this.codeToCopy = '';
|
|
12
15
|
this.languages = null;
|
|
13
16
|
this.lineNumbers = false;
|
|
17
|
+
this.detectedLanguage = new EventEmitter();
|
|
18
|
+
this.language$ = new BehaviorSubject('code');
|
|
19
|
+
this.language$.pipe(takeUntilDestroyed())
|
|
20
|
+
.subscribe((language) => this.detectedLanguage.emit(language));
|
|
14
21
|
}
|
|
15
22
|
copiedHtml() {
|
|
16
23
|
this.offcanvasVisible = true;
|
|
17
24
|
setTimeout(() => this.offcanvasVisible = false, 3000);
|
|
18
25
|
}
|
|
26
|
+
onHighlighted(result) {
|
|
27
|
+
this.language$.next(result.language ?? 'code');
|
|
28
|
+
}
|
|
19
29
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsCodeSnippetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
20
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: BsCodeSnippetComponent, isStandalone: true, selector: "bs-code-snippet", inputs: { codeToCopy: "codeToCopy", languages: "languages", lineNumbers: "lineNumbers" }, viewQueries: [{ propertyName: "copiedTemplate", first: true, predicate: ["copiedTemplate"], descendants: true }], ngImport: i0, template: "<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy
|
|
30
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: BsCodeSnippetComponent, isStandalone: true, selector: "bs-code-snippet", inputs: { codeToCopy: "codeToCopy", languages: "languages", lineNumbers: "lineNumbers" }, outputs: { detectedLanguage: "detectedLanguage" }, viewQueries: [{ propertyName: "copiedTemplate", first: true, predicate: ["copiedTemplate"], descendants: true }], ngImport: i0, template: "<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy {{ language$ | async }}\n </button>\n <pre class=\"white-space-normal\">\n <code class=\"d-block white-space-pre\" [highlight]=\"codeToCopy\" [lineNumbers]=\"lineNumbers\" [languages]=\"languages ?? undefined!\" (highlighted)=\"onHighlighted($event)\"></code>\n </pre>\n <bs-offcanvas [(isVisible)]=\"offcanvasVisible\" [position]=\"'bottom'\">\n <div *bsOffcanvasContent class=\"p-3 bg-dark text-light\">Copied!</div>\n </bs-offcanvas>\n</div>", styles: [".copy-btn{right:0}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: BsCopyDirective, selector: "[bsCopy]", inputs: ["bsCopy"], outputs: ["bsCopied"] }, { kind: "ngmodule", type: BsOffcanvasModule }, { kind: "directive", type: i1.BsOffcanvasContentDirective, selector: "[bsOffcanvasContent]" }, { kind: "component", type: i1.BsOffcanvasHostComponent, selector: "bs-offcanvas", inputs: ["isVisible", "position", "size", "hasBackdrop"], outputs: ["backdropClick", "isVisibleChange"] }, { kind: "ngmodule", type: HighlightModule }, { kind: "directive", type: i2.Highlight, selector: "[highlight]", inputs: ["highlight", "languages", "lineNumbers"], outputs: ["highlighted"] }] }); }
|
|
21
31
|
}
|
|
22
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsCodeSnippetComponent, decorators: [{
|
|
23
33
|
type: Component,
|
|
24
|
-
args: [{ selector: 'bs-code-snippet', standalone: true, imports: [BsCopyDirective, BsOffcanvasModule, HighlightModule], template: "<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy
|
|
25
|
-
}], propDecorators: { codeToCopy: [{
|
|
34
|
+
args: [{ selector: 'bs-code-snippet', standalone: true, imports: [AsyncPipe, BsCopyDirective, BsOffcanvasModule, HighlightModule], template: "<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy {{ language$ | async }}\n </button>\n <pre class=\"white-space-normal\">\n <code class=\"d-block white-space-pre\" [highlight]=\"codeToCopy\" [lineNumbers]=\"lineNumbers\" [languages]=\"languages ?? undefined!\" (highlighted)=\"onHighlighted($event)\"></code>\n </pre>\n <bs-offcanvas [(isVisible)]=\"offcanvasVisible\" [position]=\"'bottom'\">\n <div *bsOffcanvasContent class=\"p-3 bg-dark text-light\">Copied!</div>\n </bs-offcanvas>\n</div>", styles: [".copy-btn{right:0}\n"] }]
|
|
35
|
+
}], ctorParameters: () => [], propDecorators: { codeToCopy: [{
|
|
26
36
|
type: Input
|
|
27
37
|
}], languages: [{
|
|
28
38
|
type: Input
|
|
@@ -31,5 +41,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
31
41
|
}], copiedTemplate: [{
|
|
32
42
|
type: ViewChild,
|
|
33
43
|
args: ['copiedTemplate']
|
|
44
|
+
}], detectedLanguage: [{
|
|
45
|
+
type: Output
|
|
34
46
|
}] } });
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29kZS1zbmlwcGV0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvbWludHBsYXllci1uZy1ib290c3RyYXAvY29kZS1zbmlwcGV0L3NyYy9jb2RlLXNuaXBwZXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9taW50cGxheWVyLW5nLWJvb3RzdHJhcC9jb2RlLXNuaXBwZXQvc3JjL2NvZGUtc25pcHBldC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDNUMsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUs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L2NvZGU+XG4gICAgPC9wcmU+XG4gICAgPGJzLW9mZmNhbnZhcyBbKGlzVmlzaWJsZSldPVwib2ZmY2FudmFzVmlzaWJsZVwiIFtwb3NpdGlvbl09XCInYm90dG9tJ1wiPlxuICAgICAgICA8ZGl2ICpic09mZmNhbnZhc0NvbnRlbnQgY2xhc3M9XCJwLTMgYmctZGFyayB0ZXh0LWxpZ2h0XCI+Q29waWVkITwvZGl2PlxuICAgIDwvYnMtb2ZmY2FudmFzPlxuPC9kaXY+Il19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './src/shell.module';
|
|
2
|
+
export * from './src/shell/shell.component';
|
|
3
|
+
export * from './src/shell-sidebar/shell-sidebar.directive';
|
|
4
|
+
export * from './src/shell-state';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL21pbnRwbGF5ZXItbmctYm9vdHN0cmFwL3NoZWxsL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLDZDQUE2QyxDQUFDO0FBQzVELGNBQWMsbUJBQW1CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3NyYy9zaGVsbC5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvc2hlbGwvc2hlbGwuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL3NoZWxsLXNpZGViYXIvc2hlbGwtc2lkZWJhci5kaXJlY3RpdmUnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvc2hlbGwtc3RhdGUnOyJdfQ==
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWludHBsYXllci1uZy1ib290c3RyYXAtc2hlbGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL21pbnRwbGF5ZXItbmctYm9vdHN0cmFwL3NoZWxsL21pbnRwbGF5ZXItbmctYm9vdHN0cmFwLXNoZWxsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, ElementRef, Input, ViewChild } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, map } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
export class BsShellComponent {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.sidebarTemplate = null;
|
|
8
|
+
this.state$ = new BehaviorSubject('auto');
|
|
9
|
+
this.breakpoint$ = new BehaviorSubject('md');
|
|
10
|
+
this.stateClass$ = this.state$.pipe(map((state) => {
|
|
11
|
+
if (state === 'auto')
|
|
12
|
+
return null;
|
|
13
|
+
else
|
|
14
|
+
return state;
|
|
15
|
+
}));
|
|
16
|
+
this.breakpointClass$ = this.breakpoint$.pipe(map(breakpoint => `shell-${breakpoint}`));
|
|
17
|
+
}
|
|
18
|
+
set state(value) {
|
|
19
|
+
this.state$.next(value);
|
|
20
|
+
}
|
|
21
|
+
set breakpoint(value) {
|
|
22
|
+
this.breakpoint$.next(value);
|
|
23
|
+
}
|
|
24
|
+
setSize(size) {
|
|
25
|
+
this.rootElement.nativeElement.style.setProperty('--size', size);
|
|
26
|
+
}
|
|
27
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: BsShellComponent, selector: "bs-shell", inputs: { state: "state", breakpoint: "breakpoint" }, viewQueries: [{ propertyName: "rootElement", first: true, predicate: ["root"], descendants: true }], ngImport: i0, template: "<div class=\"sidebar-root\" [class]=\"[stateClass$ | async, breakpointClass$ | async]\" #root>\n <div class=\"sidebar position-fixed\">\n <div class=\"sidebar-body d-flex flex-column\">\n <ng-container *ngTemplateOutlet=\"sidebarTemplate\"></ng-container>\n </div>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".sidebar-root{--size: 15rem;transition:margin-left .3s ease-in-out}.sidebar-root .sidebar{top:0;bottom:0;left:0;width:var(--size);z-index:500;transition:margin-left .3s,width .3s}.sidebar-root .sidebar .sidebar-body{margin-top:59px;background:#333;height:calc(100% - 59px)}.sidebar-root .content{padding-left:var(--size)}.sidebar-root.shell-xs.show{margin-left:0;margin-left:var(--size)}.sidebar-root.shell-xs.show .sidebar{width:100%;margin-left:0}.sidebar-root.shell-xs.show .sidebar{width:var(--size);margin-left:0}.sidebar-root.shell-xs.hide{margin-left:0}.sidebar-root.shell-xs.hide .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}.sidebar-root.shell-xs:not(.show):not(.hide){margin-left:0;margin-left:var(--size)}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}@media (max-width: 575.98px){.sidebar-root.shell-sm.show{margin-left:0}.sidebar-root.shell-sm.show .sidebar{width:100%;margin-left:0}}@media (min-width: 576px){.sidebar-root.shell-sm.show{margin-left:var(--size)}.sidebar-root.shell-sm.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 575.98px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 576px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 575.98px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 576px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 767.98px){.sidebar-root.shell-md.show{margin-left:0}.sidebar-root.shell-md.show .sidebar{width:100%;margin-left:0}}@media (min-width: 768px){.sidebar-root.shell-md.show{margin-left:var(--size)}.sidebar-root.shell-md.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 767.98px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 768px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 767.98px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 768px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 991.98px){.sidebar-root.shell-lg.show{margin-left:0}.sidebar-root.shell-lg.show .sidebar{width:100%;margin-left:0}}@media (min-width: 992px){.sidebar-root.shell-lg.show{margin-left:var(--size)}.sidebar-root.shell-lg.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 991.98px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 992px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 991.98px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 992px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1199.98px){.sidebar-root.shell-xl.show{margin-left:0}.sidebar-root.shell-xl.show .sidebar{width:100%;margin-left:0}}@media (min-width: 1200px){.sidebar-root.shell-xl.show{margin-left:var(--size)}.sidebar-root.shell-xl.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1199.98px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1200px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 1199.98px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1200px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl.show{margin-left:0}.sidebar-root.shell-xxl.show .sidebar{width:100%;margin-left:0}}@media (min-width: 1400px){.sidebar-root.shell-xxl.show{margin-left:var(--size)}.sidebar-root.shell-xxl.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1400px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1400px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
|
|
29
|
+
}
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellComponent, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{ selector: 'bs-shell', template: "<div class=\"sidebar-root\" [class]=\"[stateClass$ | async, breakpointClass$ | async]\" #root>\n <div class=\"sidebar position-fixed\">\n <div class=\"sidebar-body d-flex flex-column\">\n <ng-container *ngTemplateOutlet=\"sidebarTemplate\"></ng-container>\n </div>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".sidebar-root{--size: 15rem;transition:margin-left .3s ease-in-out}.sidebar-root .sidebar{top:0;bottom:0;left:0;width:var(--size);z-index:500;transition:margin-left .3s,width .3s}.sidebar-root .sidebar .sidebar-body{margin-top:59px;background:#333;height:calc(100% - 59px)}.sidebar-root .content{padding-left:var(--size)}.sidebar-root.shell-xs.show{margin-left:0;margin-left:var(--size)}.sidebar-root.shell-xs.show .sidebar{width:100%;margin-left:0}.sidebar-root.shell-xs.show .sidebar{width:var(--size);margin-left:0}.sidebar-root.shell-xs.hide{margin-left:0}.sidebar-root.shell-xs.hide .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}.sidebar-root.shell-xs:not(.show):not(.hide){margin-left:0;margin-left:var(--size)}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}@media (max-width: 575.98px){.sidebar-root.shell-sm.show{margin-left:0}.sidebar-root.shell-sm.show .sidebar{width:100%;margin-left:0}}@media (min-width: 576px){.sidebar-root.shell-sm.show{margin-left:var(--size)}.sidebar-root.shell-sm.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 575.98px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 576px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 575.98px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 576px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 767.98px){.sidebar-root.shell-md.show{margin-left:0}.sidebar-root.shell-md.show .sidebar{width:100%;margin-left:0}}@media (min-width: 768px){.sidebar-root.shell-md.show{margin-left:var(--size)}.sidebar-root.shell-md.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 767.98px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 768px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 767.98px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 768px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 991.98px){.sidebar-root.shell-lg.show{margin-left:0}.sidebar-root.shell-lg.show .sidebar{width:100%;margin-left:0}}@media (min-width: 992px){.sidebar-root.shell-lg.show{margin-left:var(--size)}.sidebar-root.shell-lg.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 991.98px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 992px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 991.98px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 992px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1199.98px){.sidebar-root.shell-xl.show{margin-left:0}.sidebar-root.shell-xl.show .sidebar{width:100%;margin-left:0}}@media (min-width: 1200px){.sidebar-root.shell-xl.show{margin-left:var(--size)}.sidebar-root.shell-xl.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1199.98px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1200px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 1199.98px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1200px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl.show{margin-left:0}.sidebar-root.shell-xxl.show .sidebar{width:100%;margin-left:0}}@media (min-width: 1400px){.sidebar-root.shell-xxl.show{margin-left:var(--size)}.sidebar-root.shell-xxl.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1400px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1400px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}\n"] }]
|
|
33
|
+
}], ctorParameters: () => [], propDecorators: { rootElement: [{
|
|
34
|
+
type: ViewChild,
|
|
35
|
+
args: ['root']
|
|
36
|
+
}], state: [{
|
|
37
|
+
type: Input
|
|
38
|
+
}], breakpoint: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}] } });
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hlbGwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9taW50cGxheWVyLW5nLWJvb3RzdHJhcC9zaG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5yb290RWxlbWVudC5uYXRpdmVFbGVtZW50LnN0eWxlLnNldFByb3BlcnR5KCctLXNpemUnLCBzaXplKTtcbiAgfVxufVxuIiwiPGRpdiBjbGFzcz1cInNpZGViYXItcm9vdFwiIFtjbGFzc109XCJbc3RhdGVDbGFzcyQgfCBhc3luYywgYnJlYWtwb2ludENsYXNzJCB8IGFzeW5jXVwiICNyb290PlxuICAgIDxkaXYgY2xhc3M9XCJzaWRlYmFyIHBvc2l0aW9uLWZpeGVkXCI+XG4gICAgICAgIDxkaXYgY2xhc3M9XCJzaWRlYmFyLWJvZHkgZC1mbGV4IGZsZXgtY29sdW1uXCI+XG4gICAgICAgICAgICA8bmctY29udGFpbmVyICpuZ1RlbXBsYXRlT3V0bGV0PVwic2lkZWJhclRlbXBsYXRlXCI+PC9uZy1jb250YWluZXI+XG4gICAgICAgIDwvZGl2PlxuICAgIDwvZGl2PlxuICAgIDxkaXYgY2xhc3M9XCJjb250ZW50XCI+XG4gICAgICAgIDxuZy1jb250ZW50PjwvbmctY29udGVudD5cbiAgICA8L2Rpdj5cbjwvZGl2PiJdfQ==
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Directive, TemplateRef } from '@angular/core';
|
|
2
|
+
import { BsShellComponent } from '../shell/shell.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../shell/shell.component";
|
|
5
|
+
export class BsShellSidebarDirective {
|
|
6
|
+
constructor(shell, template) {
|
|
7
|
+
this.shell = shell;
|
|
8
|
+
this.template = template;
|
|
9
|
+
shell.sidebarTemplate = template;
|
|
10
|
+
}
|
|
11
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellSidebarDirective, deps: [{ token: i1.BsShellComponent }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
12
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.1", type: BsShellSidebarDirective, selector: "[bsShellSidebar]", ngImport: i0 }); }
|
|
13
|
+
}
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellSidebarDirective, decorators: [{
|
|
15
|
+
type: Directive,
|
|
16
|
+
args: [{
|
|
17
|
+
selector: '[bsShellSidebar]',
|
|
18
|
+
}]
|
|
19
|
+
}], ctorParameters: () => [{ type: i1.BsShellComponent }, { type: i0.TemplateRef }] });
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hlbGwtc2lkZWJhci5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL21pbnRwbGF5ZXItbmctYm9vdHN0cmFwL3NoZWxsL3NyYy9zaGVsbC1zaWRlYmFyL3NoZWxsLXNpZGViYXIuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBaUIsU0FBUyxFQUFFLFdBQVcsRUFBb0IsTUFBTSxlQUFlLENBQUM7QUFDeEYsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7OztBQU81RCxNQUFNLE9BQU8sdUJBQXVCO0lBRWxDLFlBQW9CLEtBQXVCLEVBQVUsUUFBMEI7UUFBM0QsVUFBSyxHQUFMLEtBQUssQ0FBa0I7UUFBVSxhQUFRLEdBQVIsUUFBUSxDQUFrQjtRQUM3RSxLQUFLLENBQUMsZUFBZSxHQUFHLFFBQVEsQ0FBQztJQUNuQyxDQUFDOzhHQUpVLHVCQUF1QjtrR0FBdkIsdUJBQXVCOzsyRkFBdkIsdUJBQXVCO2tCQUhuQyxTQUFTO21CQUFDO29CQUNULFFBQVEsRUFBRSxrQkFBa0I7aUJBQzdCIiwic291cmNlc0NvbnRlbnQiOlsiaW1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@@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { BsShellComponent } from './shell/shell.component';
|
|
4
|
+
import { BsShellSidebarDirective } from './shell-sidebar/shell-sidebar.directive';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class BsShellModule {
|
|
7
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
8
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: BsShellModule, declarations: [BsShellComponent, BsShellSidebarDirective], imports: [CommonModule], exports: [BsShellComponent, BsShellSidebarDirective] }); }
|
|
9
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellModule, imports: [CommonModule] }); }
|
|
10
|
+
}
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellModule, decorators: [{
|
|
12
|
+
type: NgModule,
|
|
13
|
+
args: [{
|
|
14
|
+
declarations: [BsShellComponent, BsShellSidebarDirective],
|
|
15
|
+
imports: [CommonModule],
|
|
16
|
+
exports: [BsShellComponent, BsShellSidebarDirective]
|
|
17
|
+
}]
|
|
18
|
+
}] });
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hlbGwubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9taW50cGxheWVyLW5nLWJvb3RzdHJhcC9zaGVsbC9zcmMvc2hlbGwubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVB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0sXG4gIGV4cG9ydHM6IFtCc1NoZWxsQ29tcG9uZW50LCBCc1NoZWxsU2lkZWJhckRpcmVjdGl2ZV1cbn0pXG5leHBvcnQgY2xhc3MgQnNTaGVsbE1vZHVsZSB7IH1cbiJdfQ==
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { AsyncPipe } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, ViewChild } from '@angular/core';
|
|
3
|
+
import { EventEmitter, Component, Input, ViewChild, Output } from '@angular/core';
|
|
4
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
5
|
import { BsCopyDirective } from '@mintplayer/ng-bootstrap/copy';
|
|
4
6
|
import * as i1 from '@mintplayer/ng-bootstrap/offcanvas';
|
|
5
7
|
import { BsOffcanvasModule } from '@mintplayer/ng-bootstrap/offcanvas';
|
|
6
8
|
import * as i2 from 'ngx-highlightjs';
|
|
7
9
|
import { HighlightModule } from 'ngx-highlightjs';
|
|
10
|
+
import { BehaviorSubject } from 'rxjs';
|
|
8
11
|
|
|
9
12
|
class BsCodeSnippetComponent {
|
|
10
13
|
constructor() {
|
|
@@ -12,18 +15,25 @@ class BsCodeSnippetComponent {
|
|
|
12
15
|
this.codeToCopy = '';
|
|
13
16
|
this.languages = null;
|
|
14
17
|
this.lineNumbers = false;
|
|
18
|
+
this.detectedLanguage = new EventEmitter();
|
|
19
|
+
this.language$ = new BehaviorSubject('code');
|
|
20
|
+
this.language$.pipe(takeUntilDestroyed())
|
|
21
|
+
.subscribe((language) => this.detectedLanguage.emit(language));
|
|
15
22
|
}
|
|
16
23
|
copiedHtml() {
|
|
17
24
|
this.offcanvasVisible = true;
|
|
18
25
|
setTimeout(() => this.offcanvasVisible = false, 3000);
|
|
19
26
|
}
|
|
27
|
+
onHighlighted(result) {
|
|
28
|
+
this.language$.next(result.language ?? 'code');
|
|
29
|
+
}
|
|
20
30
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsCodeSnippetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: BsCodeSnippetComponent, isStandalone: true, selector: "bs-code-snippet", inputs: { codeToCopy: "codeToCopy", languages: "languages", lineNumbers: "lineNumbers" }, viewQueries: [{ propertyName: "copiedTemplate", first: true, predicate: ["copiedTemplate"], descendants: true }], ngImport: i0, template: "<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy
|
|
31
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: BsCodeSnippetComponent, isStandalone: true, selector: "bs-code-snippet", inputs: { codeToCopy: "codeToCopy", languages: "languages", lineNumbers: "lineNumbers" }, outputs: { detectedLanguage: "detectedLanguage" }, viewQueries: [{ propertyName: "copiedTemplate", first: true, predicate: ["copiedTemplate"], descendants: true }], ngImport: i0, template: "<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy {{ language$ | async }}\n </button>\n <pre class=\"white-space-normal\">\n <code class=\"d-block white-space-pre\" [highlight]=\"codeToCopy\" [lineNumbers]=\"lineNumbers\" [languages]=\"languages ?? undefined!\" (highlighted)=\"onHighlighted($event)\"></code>\n </pre>\n <bs-offcanvas [(isVisible)]=\"offcanvasVisible\" [position]=\"'bottom'\">\n <div *bsOffcanvasContent class=\"p-3 bg-dark text-light\">Copied!</div>\n </bs-offcanvas>\n</div>", styles: [".copy-btn{right:0}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: BsCopyDirective, selector: "[bsCopy]", inputs: ["bsCopy"], outputs: ["bsCopied"] }, { kind: "ngmodule", type: BsOffcanvasModule }, { kind: "directive", type: i1.BsOffcanvasContentDirective, selector: "[bsOffcanvasContent]" }, { kind: "component", type: i1.BsOffcanvasHostComponent, selector: "bs-offcanvas", inputs: ["isVisible", "position", "size", "hasBackdrop"], outputs: ["backdropClick", "isVisibleChange"] }, { kind: "ngmodule", type: HighlightModule }, { kind: "directive", type: i2.Highlight, selector: "[highlight]", inputs: ["highlight", "languages", "lineNumbers"], outputs: ["highlighted"] }] }); }
|
|
22
32
|
}
|
|
23
33
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsCodeSnippetComponent, decorators: [{
|
|
24
34
|
type: Component,
|
|
25
|
-
args: [{ selector: 'bs-code-snippet', standalone: true, imports: [BsCopyDirective, BsOffcanvasModule, HighlightModule], template: "<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy
|
|
26
|
-
}], propDecorators: { codeToCopy: [{
|
|
35
|
+
args: [{ selector: 'bs-code-snippet', standalone: true, imports: [AsyncPipe, BsCopyDirective, BsOffcanvasModule, HighlightModule], template: "<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy {{ language$ | async }}\n </button>\n <pre class=\"white-space-normal\">\n <code class=\"d-block white-space-pre\" [highlight]=\"codeToCopy\" [lineNumbers]=\"lineNumbers\" [languages]=\"languages ?? undefined!\" (highlighted)=\"onHighlighted($event)\"></code>\n </pre>\n <bs-offcanvas [(isVisible)]=\"offcanvasVisible\" [position]=\"'bottom'\">\n <div *bsOffcanvasContent class=\"p-3 bg-dark text-light\">Copied!</div>\n </bs-offcanvas>\n</div>", styles: [".copy-btn{right:0}\n"] }]
|
|
36
|
+
}], ctorParameters: () => [], propDecorators: { codeToCopy: [{
|
|
27
37
|
type: Input
|
|
28
38
|
}], languages: [{
|
|
29
39
|
type: Input
|
|
@@ -32,6 +42,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
32
42
|
}], copiedTemplate: [{
|
|
33
43
|
type: ViewChild,
|
|
34
44
|
args: ['copiedTemplate']
|
|
45
|
+
}], detectedLanguage: [{
|
|
46
|
+
type: Output
|
|
35
47
|
}] } });
|
|
36
48
|
|
|
37
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-code-snippet.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/code-snippet/src/code-snippet.component.ts","../../../../libs/mintplayer-ng-bootstrap/code-snippet/src/code-snippet.component.html","../../../../libs/mintplayer-ng-bootstrap/code-snippet/mintplayer-ng-bootstrap-code-snippet.ts"],"sourcesContent":["import { Component, Input, TemplateRef, ViewChild } from '@angular/core';\nimport { BsCopyDirective } from '@mintplayer/ng-bootstrap/copy';\nimport { BsOffcanvasModule } from '@mintplayer/ng-bootstrap/offcanvas';\nimport { HighlightModule } from 'ngx-highlightjs';\n\n@Component({\n selector: 'bs-code-snippet',\n templateUrl: './code-snippet.component.html',\n styleUrls: ['./code-snippet.component.scss'],\n standalone: true,\n imports: [BsCopyDirective, BsOffcanvasModule, HighlightModule]\n})\nexport class BsCodeSnippetComponent {\n\n offcanvasVisible = false;\n @Input() public codeToCopy = '';\n @Input() public languages: string[] | null = null;\n @Input() public lineNumbers = false;\n @ViewChild('copiedTemplate') copiedTemplate!: TemplateRef<any>;\n\n copiedHtml() {\n this.offcanvasVisible = true;\n setTimeout(() => this.offcanvasVisible = false, 3000);\n }\n\n}\n","<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-code-snippet.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/code-snippet/src/code-snippet.component.ts","../../../../libs/mintplayer-ng-bootstrap/code-snippet/src/code-snippet.component.html","../../../../libs/mintplayer-ng-bootstrap/code-snippet/mintplayer-ng-bootstrap-code-snippet.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { Component, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { BsCopyDirective } from '@mintplayer/ng-bootstrap/copy';\nimport { BsOffcanvasModule } from '@mintplayer/ng-bootstrap/offcanvas';\nimport { HighlightAutoResult, HighlightModule } from 'ngx-highlightjs';\nimport { BehaviorSubject } from 'rxjs';\n\n@Component({\n selector: 'bs-code-snippet',\n templateUrl: './code-snippet.component.html',\n styleUrls: ['./code-snippet.component.scss'],\n standalone: true,\n imports: [AsyncPipe, BsCopyDirective, BsOffcanvasModule, HighlightModule]\n})\nexport class BsCodeSnippetComponent {\n\n constructor() {\n this.language$.pipe(takeUntilDestroyed())\n .subscribe((language) => this.detectedLanguage.emit(language));\n }\n\n offcanvasVisible = false;\n @Input() public codeToCopy = '';\n @Input() public languages: string[] | null = null;\n @Input() public lineNumbers = false;\n @ViewChild('copiedTemplate') copiedTemplate!: TemplateRef<any>;\n @Output() public detectedLanguage = new EventEmitter<string>();\n\n language$ = new BehaviorSubject<string>('code');\n\n copiedHtml() {\n this.offcanvasVisible = true;\n setTimeout(() => this.offcanvasVisible = false, 3000);\n }\n\n onHighlighted(result: HighlightAutoResult) {\n this.language$.next(result.language ?? 'code');\n }\n\n}\n","<div class=\"position-relative\">\n <button #copyBtn [bsCopy]=\"codeToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n Copy {{ language$ | async }}\n </button>\n <pre class=\"white-space-normal\">\n <code class=\"d-block white-space-pre\" [highlight]=\"codeToCopy\" [lineNumbers]=\"lineNumbers\" [languages]=\"languages ?? undefined!\" (highlighted)=\"onHighlighted($event)\"></code>\n </pre>\n <bs-offcanvas [(isVisible)]=\"offcanvasVisible\" [position]=\"'bottom'\">\n <div *bsOffcanvasContent class=\"p-3 bg-dark text-light\">Copied!</div>\n </bs-offcanvas>\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAea,sBAAsB,CAAA;AAEjC,IAAA,WAAA,GAAA;QAKA,IAAgB,CAAA,gBAAA,GAAG,KAAK,CAAC;QACT,IAAU,CAAA,UAAA,GAAG,EAAE,CAAC;QAChB,IAAS,CAAA,SAAA,GAAoB,IAAI,CAAC;QAClC,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AAEnB,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,YAAY,EAAU,CAAC;AAE/D,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,eAAe,CAAS,MAAM,CAAC,CAAC;AAX9C,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;AACtC,aAAA,SAAS,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;KAClE;IAWD,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;AAC7B,QAAA,UAAU,CAAC,MAAM,IAAI,CAAC,gBAAgB,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC;KACvD;AAED,IAAA,aAAa,CAAC,MAA2B,EAAA;QACvC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;KAChD;8GAvBU,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAtB,sBAAsB,EAAA,YAAA,EAAA,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A,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAE7D,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;+BACE,iBAAiB,EAAA,UAAA,EAGf,IAAI,EAAA,OAAA,EACP,CAAC,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,6pBAAA,EAAA,MAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,CAAA;wDAUzD,UAAU,EAAA,CAAA;sBAAzB,KAAK;gBACU,SAAS,EAAA,CAAA;sBAAxB,KAAK;gBACU,WAAW,EAAA,CAAA;sBAA1B,KAAK;gBACuB,cAAc,EAAA,CAAA;sBAA1C,SAAS;uBAAC,gBAAgB,CAAA;gBACV,gBAAgB,EAAA,CAAA;sBAAhC,MAAM;;;AE3BT;;AAEG;;;;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ViewChild, Input, Directive, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { BehaviorSubject, map } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
class BsShellComponent {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.sidebarTemplate = null;
|
|
10
|
+
this.state$ = new BehaviorSubject('auto');
|
|
11
|
+
this.breakpoint$ = new BehaviorSubject('md');
|
|
12
|
+
this.stateClass$ = this.state$.pipe(map((state) => {
|
|
13
|
+
if (state === 'auto')
|
|
14
|
+
return null;
|
|
15
|
+
else
|
|
16
|
+
return state;
|
|
17
|
+
}));
|
|
18
|
+
this.breakpointClass$ = this.breakpoint$.pipe(map(breakpoint => `shell-${breakpoint}`));
|
|
19
|
+
}
|
|
20
|
+
set state(value) {
|
|
21
|
+
this.state$.next(value);
|
|
22
|
+
}
|
|
23
|
+
set breakpoint(value) {
|
|
24
|
+
this.breakpoint$.next(value);
|
|
25
|
+
}
|
|
26
|
+
setSize(size) {
|
|
27
|
+
this.rootElement.nativeElement.style.setProperty('--size', size);
|
|
28
|
+
}
|
|
29
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
30
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: BsShellComponent, selector: "bs-shell", inputs: { state: "state", breakpoint: "breakpoint" }, viewQueries: [{ propertyName: "rootElement", first: true, predicate: ["root"], descendants: true }], ngImport: i0, template: "<div class=\"sidebar-root\" [class]=\"[stateClass$ | async, breakpointClass$ | async]\" #root>\n <div class=\"sidebar position-fixed\">\n <div class=\"sidebar-body d-flex flex-column\">\n <ng-container *ngTemplateOutlet=\"sidebarTemplate\"></ng-container>\n </div>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".sidebar-root{--size: 15rem;transition:margin-left .3s ease-in-out}.sidebar-root .sidebar{top:0;bottom:0;left:0;width:var(--size);z-index:500;transition:margin-left .3s,width .3s}.sidebar-root .sidebar .sidebar-body{margin-top:59px;background:#333;height:calc(100% - 59px)}.sidebar-root .content{padding-left:var(--size)}.sidebar-root.shell-xs.show{margin-left:0;margin-left:var(--size)}.sidebar-root.shell-xs.show .sidebar{width:100%;margin-left:0}.sidebar-root.shell-xs.show .sidebar{width:var(--size);margin-left:0}.sidebar-root.shell-xs.hide{margin-left:0}.sidebar-root.shell-xs.hide .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}.sidebar-root.shell-xs:not(.show):not(.hide){margin-left:0;margin-left:var(--size)}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}@media (max-width: 575.98px){.sidebar-root.shell-sm.show{margin-left:0}.sidebar-root.shell-sm.show .sidebar{width:100%;margin-left:0}}@media (min-width: 576px){.sidebar-root.shell-sm.show{margin-left:var(--size)}.sidebar-root.shell-sm.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 575.98px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 576px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 575.98px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 576px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 767.98px){.sidebar-root.shell-md.show{margin-left:0}.sidebar-root.shell-md.show .sidebar{width:100%;margin-left:0}}@media (min-width: 768px){.sidebar-root.shell-md.show{margin-left:var(--size)}.sidebar-root.shell-md.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 767.98px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 768px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 767.98px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 768px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 991.98px){.sidebar-root.shell-lg.show{margin-left:0}.sidebar-root.shell-lg.show .sidebar{width:100%;margin-left:0}}@media (min-width: 992px){.sidebar-root.shell-lg.show{margin-left:var(--size)}.sidebar-root.shell-lg.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 991.98px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 992px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 991.98px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 992px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1199.98px){.sidebar-root.shell-xl.show{margin-left:0}.sidebar-root.shell-xl.show .sidebar{width:100%;margin-left:0}}@media (min-width: 1200px){.sidebar-root.shell-xl.show{margin-left:var(--size)}.sidebar-root.shell-xl.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1199.98px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1200px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 1199.98px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1200px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl.show{margin-left:0}.sidebar-root.shell-xxl.show .sidebar{width:100%;margin-left:0}}@media (min-width: 1400px){.sidebar-root.shell-xxl.show{margin-left:var(--size)}.sidebar-root.shell-xxl.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1400px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1400px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellComponent, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{ selector: 'bs-shell', template: "<div class=\"sidebar-root\" [class]=\"[stateClass$ | async, breakpointClass$ | async]\" #root>\n <div class=\"sidebar position-fixed\">\n <div class=\"sidebar-body d-flex flex-column\">\n <ng-container *ngTemplateOutlet=\"sidebarTemplate\"></ng-container>\n </div>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>", styles: [".sidebar-root{--size: 15rem;transition:margin-left .3s ease-in-out}.sidebar-root .sidebar{top:0;bottom:0;left:0;width:var(--size);z-index:500;transition:margin-left .3s,width .3s}.sidebar-root .sidebar .sidebar-body{margin-top:59px;background:#333;height:calc(100% - 59px)}.sidebar-root .content{padding-left:var(--size)}.sidebar-root.shell-xs.show{margin-left:0;margin-left:var(--size)}.sidebar-root.shell-xs.show .sidebar{width:100%;margin-left:0}.sidebar-root.shell-xs.show .sidebar{width:var(--size);margin-left:0}.sidebar-root.shell-xs.hide{margin-left:0}.sidebar-root.shell-xs.hide .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}.sidebar-root.shell-xs:not(.show):not(.hide){margin-left:0;margin-left:var(--size)}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}.sidebar-root.shell-xs:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}@media (max-width: 575.98px){.sidebar-root.shell-sm.show{margin-left:0}.sidebar-root.shell-sm.show .sidebar{width:100%;margin-left:0}}@media (min-width: 576px){.sidebar-root.shell-sm.show{margin-left:var(--size)}.sidebar-root.shell-sm.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 575.98px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 576px){.sidebar-root.shell-sm.hide{margin-left:0}.sidebar-root.shell-sm.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 575.98px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 576px){.sidebar-root.shell-sm:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-sm:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 767.98px){.sidebar-root.shell-md.show{margin-left:0}.sidebar-root.shell-md.show .sidebar{width:100%;margin-left:0}}@media (min-width: 768px){.sidebar-root.shell-md.show{margin-left:var(--size)}.sidebar-root.shell-md.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 767.98px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 768px){.sidebar-root.shell-md.hide{margin-left:0}.sidebar-root.shell-md.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 767.98px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 768px){.sidebar-root.shell-md:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-md:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 991.98px){.sidebar-root.shell-lg.show{margin-left:0}.sidebar-root.shell-lg.show .sidebar{width:100%;margin-left:0}}@media (min-width: 992px){.sidebar-root.shell-lg.show{margin-left:var(--size)}.sidebar-root.shell-lg.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 991.98px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 992px){.sidebar-root.shell-lg.hide{margin-left:0}.sidebar-root.shell-lg.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 991.98px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 992px){.sidebar-root.shell-lg:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-lg:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1199.98px){.sidebar-root.shell-xl.show{margin-left:0}.sidebar-root.shell-xl.show .sidebar{width:100%;margin-left:0}}@media (min-width: 1200px){.sidebar-root.shell-xl.show{margin-left:var(--size)}.sidebar-root.shell-xl.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1199.98px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1200px){.sidebar-root.shell-xl.hide{margin-left:0}.sidebar-root.shell-xl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 1199.98px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1200px){.sidebar-root.shell-xl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl.show{margin-left:0}.sidebar-root.shell-xxl.show .sidebar{width:100%;margin-left:0}}@media (min-width: 1400px){.sidebar-root.shell-xxl.show{margin-left:var(--size)}.sidebar-root.shell-xxl.show .sidebar{width:var(--size);margin-left:0}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1400px){.sidebar-root.shell-xxl.hide{margin-left:0}.sidebar-root.shell-xxl.hide .sidebar{width:var(--size);margin-left:calc(-1 * var(--size))}}@media (max-width: 1399.98px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:0}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:100%;margin-left:-100%}}@media (min-width: 1400px){.sidebar-root.shell-xxl:not(.show):not(.hide){margin-left:var(--size)}.sidebar-root.shell-xxl:not(.show):not(.hide) .sidebar{width:var(--size);margin-left:0}}\n"] }]
|
|
35
|
+
}], ctorParameters: () => [], propDecorators: { rootElement: [{
|
|
36
|
+
type: ViewChild,
|
|
37
|
+
args: ['root']
|
|
38
|
+
}], state: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}], breakpoint: [{
|
|
41
|
+
type: Input
|
|
42
|
+
}] } });
|
|
43
|
+
|
|
44
|
+
class BsShellSidebarDirective {
|
|
45
|
+
constructor(shell, template) {
|
|
46
|
+
this.shell = shell;
|
|
47
|
+
this.template = template;
|
|
48
|
+
shell.sidebarTemplate = template;
|
|
49
|
+
}
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellSidebarDirective, deps: [{ token: BsShellComponent }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
51
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.1", type: BsShellSidebarDirective, selector: "[bsShellSidebar]", ngImport: i0 }); }
|
|
52
|
+
}
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellSidebarDirective, decorators: [{
|
|
54
|
+
type: Directive,
|
|
55
|
+
args: [{
|
|
56
|
+
selector: '[bsShellSidebar]',
|
|
57
|
+
}]
|
|
58
|
+
}], ctorParameters: () => [{ type: BsShellComponent }, { type: i0.TemplateRef }] });
|
|
59
|
+
|
|
60
|
+
class BsShellModule {
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
62
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: BsShellModule, declarations: [BsShellComponent, BsShellSidebarDirective], imports: [CommonModule], exports: [BsShellComponent, BsShellSidebarDirective] }); }
|
|
63
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellModule, imports: [CommonModule] }); }
|
|
64
|
+
}
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: BsShellModule, decorators: [{
|
|
66
|
+
type: NgModule,
|
|
67
|
+
args: [{
|
|
68
|
+
declarations: [BsShellComponent, BsShellSidebarDirective],
|
|
69
|
+
imports: [CommonModule],
|
|
70
|
+
exports: [BsShellComponent, BsShellSidebarDirective]
|
|
71
|
+
}]
|
|
72
|
+
}] });
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Generated bundle index. Do not edit.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
export { BsShellComponent, BsShellModule, BsShellSidebarDirective };
|
|
79
|
+
//# sourceMappingURL=mintplayer-ng-bootstrap-shell.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-shell.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.ts","../../../../libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.html","../../../../libs/mintplayer-ng-bootstrap/shell/src/shell-sidebar/shell-sidebar.directive.ts","../../../../libs/mintplayer-ng-bootstrap/shell/src/shell.module.ts","../../../../libs/mintplayer-ng-bootstrap/shell/mintplayer-ng-bootstrap-shell.ts"],"sourcesContent":["import { Component, ElementRef, Input, TemplateRef, ViewChild } from '@angular/core';\nimport { BehaviorSubject, Observable, map } from 'rxjs';\nimport { BsShellState } from '../shell-state';\nimport { Breakpoint } from '@mintplayer/ng-bootstrap';\n\n@Component({\n selector: 'bs-shell',\n templateUrl: './shell.component.html',\n styleUrl: './shell.component.scss'\n})\nexport class BsShellComponent {\n constructor() {\n this.stateClass$ = this.state$.pipe(map((state) => {\n if (state === 'auto') return null;\n else return state;\n }));\n this.breakpointClass$ = this.breakpoint$.pipe(map(breakpoint => `shell-${breakpoint}`));\n }\n\n sidebarTemplate: TemplateRef<any> | null = null;\n @ViewChild('root') rootElement!: ElementRef<HTMLDivElement>;\n\n @Input() set state(value: BsShellState) {\n this.state$.next(value);\n }\n\n @Input() set breakpoint(value: Breakpoint) {\n this.breakpoint$.next(value);\n }\n\n state$ = new BehaviorSubject<BsShellState>('auto');\n breakpoint$ = new BehaviorSubject<Breakpoint>('md');\n stateClass$: Observable<string | null>;\n breakpointClass$: Observable<string>;\n\n public setSize(size: string) {\n this.rootElement.nativeElement.style.setProperty('--size', size);\n }\n}\n","<div class=\"sidebar-root\" [class]=\"[stateClass$ | async, breakpointClass$ | async]\" #root>\n <div class=\"sidebar position-fixed\">\n <div class=\"sidebar-body d-flex flex-column\">\n <ng-container *ngTemplateOutlet=\"sidebarTemplate\"></ng-container>\n </div>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>","import { AfterViewInit, Directive, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { BsShellComponent } from '../shell/shell.component';\nimport { Overlay } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\n\n@Directive({\n selector: '[bsShellSidebar]',\n})\nexport class BsShellSidebarDirective {\n\n constructor(private shell: BsShellComponent, private template: TemplateRef<any>) {\n shell.sidebarTemplate = template;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { BsShellComponent } from './shell/shell.component';\nimport { BsShellSidebarDirective } from './shell-sidebar/shell-sidebar.directive';\n\n\n\n@NgModule({\n declarations: [BsShellComponent, BsShellSidebarDirective],\n imports: [CommonModule],\n exports: [BsShellComponent, BsShellSidebarDirective]\n})\nexport class BsShellModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.BsShellComponent"],"mappings":";;;;;;MAUa,gBAAgB,CAAA;AAC3B,IAAA,WAAA,GAAA;QAQA,IAAe,CAAA,eAAA,GAA4B,IAAI,CAAC;AAWhD,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,CAAe,MAAM,CAAC,CAAC;AACnD,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,eAAe,CAAa,IAAI,CAAC,CAAC;AAnBlD,QAAA,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;YAChD,IAAI,KAAK,KAAK,MAAM;AAAE,gBAAA,OAAO,IAAI,CAAC;;AAC7B,gBAAA,OAAO,KAAK,CAAC;SACnB,CAAC,CAAC,CAAC;QACJ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAA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AAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGX,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;oBACzD,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;AACrD,iBAAA,CAAA;;;ACXD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/ng-bootstrap",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "17.
|
|
4
|
+
"version": "17.4.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/MintPlayer/mintplayer-ng-bootstrap",
|
|
@@ -396,6 +396,12 @@
|
|
|
396
396
|
"esm": "./esm2022/select2/mintplayer-ng-bootstrap-select2.mjs",
|
|
397
397
|
"default": "./fesm2022/mintplayer-ng-bootstrap-select2.mjs"
|
|
398
398
|
},
|
|
399
|
+
"./shell": {
|
|
400
|
+
"types": "./shell/index.d.ts",
|
|
401
|
+
"esm2022": "./esm2022/shell/mintplayer-ng-bootstrap-shell.mjs",
|
|
402
|
+
"esm": "./esm2022/shell/mintplayer-ng-bootstrap-shell.mjs",
|
|
403
|
+
"default": "./fesm2022/mintplayer-ng-bootstrap-shell.mjs"
|
|
404
|
+
},
|
|
399
405
|
"./signature-pad": {
|
|
400
406
|
"types": "./signature-pad/index.d.ts",
|
|
401
407
|
"esm2022": "./esm2022/signature-pad/mintplayer-ng-bootstrap-signature-pad.mjs",
|
package/shell/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ElementRef, TemplateRef } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
|
+
import { BsShellState } from '../shell-state';
|
|
4
|
+
import { Breakpoint } from '@mintplayer/ng-bootstrap';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class BsShellComponent {
|
|
7
|
+
constructor();
|
|
8
|
+
sidebarTemplate: TemplateRef<any> | null;
|
|
9
|
+
rootElement: ElementRef<HTMLDivElement>;
|
|
10
|
+
set state(value: BsShellState);
|
|
11
|
+
set breakpoint(value: Breakpoint);
|
|
12
|
+
state$: BehaviorSubject<BsShellState>;
|
|
13
|
+
breakpoint$: BehaviorSubject<Breakpoint>;
|
|
14
|
+
stateClass$: Observable<string | null>;
|
|
15
|
+
breakpointClass$: Observable<string>;
|
|
16
|
+
setSize(size: string): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BsShellComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BsShellComponent, "bs-shell", never, { "state": { "alias": "state"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { BsShellComponent } from '../shell/shell.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class BsShellSidebarDirective {
|
|
5
|
+
private shell;
|
|
6
|
+
private template;
|
|
7
|
+
constructor(shell: BsShellComponent, template: TemplateRef<any>);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BsShellSidebarDirective, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BsShellSidebarDirective, "[bsShellSidebar]", never, {}, {}, never, never, false, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type BsShellState = 'auto' | 'show' | 'hide';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./shell/shell.component";
|
|
3
|
+
import * as i2 from "./shell-sidebar/shell-sidebar.directive";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
export declare class BsShellModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BsShellModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<BsShellModule, [typeof i1.BsShellComponent, typeof i2.BsShellSidebarDirective], [typeof i3.CommonModule], [typeof i1.BsShellComponent, typeof i2.BsShellSidebarDirective]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<BsShellModule>;
|
|
9
|
+
}
|