@bitstack/ng-boundary 14.0.1-alpha.9 → 14.0.2
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/esm2020/lib/bs-boundary.mjs +2 -5
- package/fesm2015/bitstack-ng-boundary.mjs +1 -4
- package/fesm2015/bitstack-ng-boundary.mjs.map +1 -1
- package/fesm2020/bitstack-ng-boundary.mjs +1 -4
- package/fesm2020/bitstack-ng-boundary.mjs.map +1 -1
- package/lib/bs-boundary.d.ts +2 -3
- package/package.json +1 -1
|
@@ -6,7 +6,6 @@ export class BsBoundary {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
this.isFixedCenter = false;
|
|
8
8
|
this.lockOrientation = 'auto';
|
|
9
|
-
this.afterBoundaryInit = new EventEmitter();
|
|
10
9
|
this.orientationChange = new EventEmitter();
|
|
11
10
|
this.breakpointObserver = inject(BreakpointObserver);
|
|
12
11
|
this.destroy$ = new Subject();
|
|
@@ -41,7 +40,7 @@ export class BsBoundary {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
BsBoundary.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BsBoundary, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
-
BsBoundary.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BsBoundary, isStandalone: true, selector: "bs-boundary", inputs: { isFixedCenter: "isFixedCenter", lockOrientation: "lockOrientation", forwardStyle: "forwardStyle" }, outputs: {
|
|
43
|
+
BsBoundary.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BsBoundary, isStandalone: true, selector: "bs-boundary", inputs: { isFixedCenter: "isFixedCenter", lockOrientation: "lockOrientation", forwardStyle: "forwardStyle" }, outputs: { orientationChange: "orientationChange" }, ngImport: i0, template: "<div\n class=\"boundary-wrapper\"\n [class.fixed-center]=\"isFixedCenter\"\n [class.landscape]=\"isLandscape\"\n [style]=\"forwardStyle\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--landscape-ratio: calc(var(--design-width) / var(--design-height));--portrait-ratio: calc(var(--design-height) / var(--design-width))}.boundary-wrapper{width:100%;height:100%;max-width:var(--boundary-width);max-height:var(--boundary-height)}.boundary-wrapper{--boundary-width: min(var(--vw100), var(--boundary-max-width));--boundary-height: min(var(--vh100), var(--boundary-max-height));--px2vw-ratio: calc(var(--boundary-width) / var(--design-base-width));--boundary-max-width: calc(var(--vh100) * var(--landscape-ratio));--boundary-max-height: calc(var(--vw100) * var(--portrait-ratio));--design-base-width: var(--design-width);--design-base-height: var(--design-height)}.boundary-wrapper.landscape{--boundary-max-width: calc(var(--vh100) * var(--portrait-ratio));--boundary-max-height: calc(var(--vw100) * var(--landscape-ratio));--design-base-width: var(--design-height);--design-base-height: var(--design-width)}.fixed-center{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;z-index:99}\n"] });
|
|
45
44
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BsBoundary, decorators: [{
|
|
46
45
|
type: Component,
|
|
47
46
|
args: [{ selector: 'bs-boundary', standalone: true, template: "<div\n class=\"boundary-wrapper\"\n [class.fixed-center]=\"isFixedCenter\"\n [class.landscape]=\"isLandscape\"\n [style]=\"forwardStyle\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--landscape-ratio: calc(var(--design-width) / var(--design-height));--portrait-ratio: calc(var(--design-height) / var(--design-width))}.boundary-wrapper{width:100%;height:100%;max-width:var(--boundary-width);max-height:var(--boundary-height)}.boundary-wrapper{--boundary-width: min(var(--vw100), var(--boundary-max-width));--boundary-height: min(var(--vh100), var(--boundary-max-height));--px2vw-ratio: calc(var(--boundary-width) / var(--design-base-width));--boundary-max-width: calc(var(--vh100) * var(--landscape-ratio));--boundary-max-height: calc(var(--vw100) * var(--portrait-ratio));--design-base-width: var(--design-width);--design-base-height: var(--design-height)}.boundary-wrapper.landscape{--boundary-max-width: calc(var(--vh100) * var(--portrait-ratio));--boundary-max-height: calc(var(--vw100) * var(--landscape-ratio));--design-base-width: var(--design-height);--design-base-height: var(--design-width)}.fixed-center{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;z-index:99}\n"] }]
|
|
@@ -51,9 +50,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
51
50
|
type: Input
|
|
52
51
|
}], forwardStyle: [{
|
|
53
52
|
type: Input
|
|
54
|
-
}], afterBoundaryInit: [{
|
|
55
|
-
type: Output
|
|
56
53
|
}], orientationChange: [{
|
|
57
54
|
type: Output
|
|
58
55
|
}] } });
|
|
59
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnMtYm91bmRhcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9iaXRzdGFjay1uZy1ib3VuZGFyeS9zcmMvbGliL2JzLWJvdW5kYXJ5LnRzIiwiLi4vLi4vLi4vLi4vcHJvamVjdHMvYml0c3RhY2stbmctYm91bmRhcnkvc3JjL2xpYi90ZW1wbGF0ZS5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxTQUFTLEVBQ1QsWUFBWSxFQUNaLE1BQU0sRUFDTixLQUFLLEVBRUwsTUFBTSxHQUNQLE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFBQyxrQkFBa0IsRUFBQyxNQUFNLHFCQUFxQixDQUFDO0FBQ3ZELE9BQU8sRUFBQyxPQUFPLEVBQUUsU0FBUyxFQUFDLE1BQU0sTUFBTSxDQUFDOztBQVF4QyxNQUFNLE9BQU8sVUFBVTtJQU52QjtRQVFhLGtCQUFhLE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AgICAgICAgdGhpcy5icmVha3BvaW50T2JzZXJ2ZXJcbiAgICAgICAgICAgIC5vYnNlcnZlKCcob3JpZW50YXRpb246IGxhbmRzY2FwZSknKVxuICAgICAgICAgICAgLnBpcGUodGFrZVVudGlsKHRoaXMuZGVzdHJveSQpKVxuICAgICAgICAgICAgLnN1YnNjcmliZShyZXN1bHQgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMub3JpZW50YXRpb25DaGFuZ2UuZW1pdChyZXN1bHQubWF0Y2hlcyA/ICdsYW5kc2NhcGUnIDogJ3BvcnRyYWl0Jyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pc0xhbmRzY2FwZSA9IHJlc3VsdC5tYXRjaGVzO1xuICAgICAgICAgICAgfSk7XG4gICAgfVxufVxuIiwiPGRpdlxuICBjbGFzcz1cImJvdW5kYXJ5LXdyYXBwZXJcIlxuICBbY2xhc3MuZml4ZWQtY2VudGVyXT1cImlzRml4ZWRDZW50ZXJcIlxuICBbY2xhc3MubGFuZHNjYXBlXT1cImlzTGFuZHNjYXBlXCJcbiAgW3N0eWxlXT1cImZvcndhcmRTdHlsZVwiXG4+XG4gICA8bmctY29udGVudD48L25nLWNvbnRlbnQ+XG48L2Rpdj5cbiJdfQ==
|
|
@@ -7,7 +7,6 @@ class BsBoundary {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.isFixedCenter = false;
|
|
9
9
|
this.lockOrientation = 'auto';
|
|
10
|
-
this.afterBoundaryInit = new EventEmitter();
|
|
11
10
|
this.orientationChange = new EventEmitter();
|
|
12
11
|
this.breakpointObserver = inject(BreakpointObserver);
|
|
13
12
|
this.destroy$ = new Subject();
|
|
@@ -42,7 +41,7 @@ class BsBoundary {
|
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
BsBoundary.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BsBoundary, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
45
|
-
BsBoundary.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BsBoundary, isStandalone: true, selector: "bs-boundary", inputs: { isFixedCenter: "isFixedCenter", lockOrientation: "lockOrientation", forwardStyle: "forwardStyle" }, outputs: {
|
|
44
|
+
BsBoundary.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BsBoundary, isStandalone: true, selector: "bs-boundary", inputs: { isFixedCenter: "isFixedCenter", lockOrientation: "lockOrientation", forwardStyle: "forwardStyle" }, outputs: { orientationChange: "orientationChange" }, ngImport: i0, template: "<div\n class=\"boundary-wrapper\"\n [class.fixed-center]=\"isFixedCenter\"\n [class.landscape]=\"isLandscape\"\n [style]=\"forwardStyle\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--landscape-ratio: calc(var(--design-width) / var(--design-height));--portrait-ratio: calc(var(--design-height) / var(--design-width))}.boundary-wrapper{width:100%;height:100%;max-width:var(--boundary-width);max-height:var(--boundary-height)}.boundary-wrapper{--boundary-width: min(var(--vw100), var(--boundary-max-width));--boundary-height: min(var(--vh100), var(--boundary-max-height));--px2vw-ratio: calc(var(--boundary-width) / var(--design-base-width));--boundary-max-width: calc(var(--vh100) * var(--landscape-ratio));--boundary-max-height: calc(var(--vw100) * var(--portrait-ratio));--design-base-width: var(--design-width);--design-base-height: var(--design-height)}.boundary-wrapper.landscape{--boundary-max-width: calc(var(--vh100) * var(--portrait-ratio));--boundary-max-height: calc(var(--vw100) * var(--landscape-ratio));--design-base-width: var(--design-height);--design-base-height: var(--design-width)}.fixed-center{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;z-index:99}\n"] });
|
|
46
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BsBoundary, decorators: [{
|
|
47
46
|
type: Component,
|
|
48
47
|
args: [{ selector: 'bs-boundary', standalone: true, template: "<div\n class=\"boundary-wrapper\"\n [class.fixed-center]=\"isFixedCenter\"\n [class.landscape]=\"isLandscape\"\n [style]=\"forwardStyle\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--landscape-ratio: calc(var(--design-width) / var(--design-height));--portrait-ratio: calc(var(--design-height) / var(--design-width))}.boundary-wrapper{width:100%;height:100%;max-width:var(--boundary-width);max-height:var(--boundary-height)}.boundary-wrapper{--boundary-width: min(var(--vw100), var(--boundary-max-width));--boundary-height: min(var(--vh100), var(--boundary-max-height));--px2vw-ratio: calc(var(--boundary-width) / var(--design-base-width));--boundary-max-width: calc(var(--vh100) * var(--landscape-ratio));--boundary-max-height: calc(var(--vw100) * var(--portrait-ratio));--design-base-width: var(--design-width);--design-base-height: var(--design-height)}.boundary-wrapper.landscape{--boundary-max-width: calc(var(--vh100) * var(--portrait-ratio));--boundary-max-height: calc(var(--vw100) * var(--landscape-ratio));--design-base-width: var(--design-height);--design-base-height: var(--design-width)}.fixed-center{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;z-index:99}\n"] }]
|
|
@@ -52,8 +51,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
52
51
|
type: Input
|
|
53
52
|
}], forwardStyle: [{
|
|
54
53
|
type: Input
|
|
55
|
-
}], afterBoundaryInit: [{
|
|
56
|
-
type: Output
|
|
57
54
|
}], orientationChange: [{
|
|
58
55
|
type: Output
|
|
59
56
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitstack-ng-boundary.mjs","sources":["../../../projects/bitstack-ng-boundary/src/lib/bs-boundary.ts","../../../projects/bitstack-ng-boundary/src/lib/template.html","../../../projects/bitstack-ng-boundary/src/public-api.ts","../../../projects/bitstack-ng-boundary/src/bitstack-ng-boundary.ts"],"sourcesContent":["import {\n Component,\n
|
|
1
|
+
{"version":3,"file":"bitstack-ng-boundary.mjs","sources":["../../../projects/bitstack-ng-boundary/src/lib/bs-boundary.ts","../../../projects/bitstack-ng-boundary/src/lib/template.html","../../../projects/bitstack-ng-boundary/src/public-api.ts","../../../projects/bitstack-ng-boundary/src/bitstack-ng-boundary.ts"],"sourcesContent":["import {\n Component,\n EventEmitter,\n inject,\n Input, OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\nimport {TOrientationMode} from './model';\nimport {BreakpointObserver} from '@angular/cdk/layout';\nimport {Subject, takeUntil} from 'rxjs';\n\n@Component({\n selector: 'bs-boundary',\n templateUrl: 'template.html',\n standalone: true,\n styleUrls: ['./styles.scss'],\n})\nexport class BsBoundary implements OnInit, OnDestroy {\n\n @Input() isFixedCenter?: boolean = false;\n @Input() lockOrientation?: TOrientationMode = 'auto';\n @Input() forwardStyle?: Record<string, string>;\n\n @Output() orientationChange = new EventEmitter<TOrientationMode>();\n\n private breakpointObserver = inject(BreakpointObserver);\n private destroy$ = new Subject<void>();\n\n isLandscape = false;\n\n ngOnInit(): void {\n this.setupBreakpointObserver();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * 監控方向變化\n */\n setupBreakpointObserver() {\n if (this.lockOrientation === 'landscape') {\n this.isLandscape = true;\n return;\n }\n\n if (this.lockOrientation === 'portrait') {\n this.isLandscape = false;\n return;\n }\n\n this.breakpointObserver\n .observe('(orientation: landscape)')\n .pipe(takeUntil(this.destroy$))\n .subscribe(result => {\n this.orientationChange.emit(result.matches ? 'landscape' : 'portrait');\n this.isLandscape = result.matches;\n });\n }\n}\n","<div\n class=\"boundary-wrapper\"\n [class.fixed-center]=\"isFixedCenter\"\n [class.landscape]=\"isLandscape\"\n [style]=\"forwardStyle\"\n>\n <ng-content></ng-content>\n</div>\n","/*\n * Public API Surface of @bitstack/ng-boundary\n */\n\nexport * from './lib/bs-boundary';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAkBa,UAAU,CAAA;AANvB,IAAA,WAAA,GAAA;AAQa,QAAA,I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AAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAV,UAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,0OClBvB,0LAQA,EAAA,MAAA,EAAA,CAAA,ghCAAA,CAAA,EAAA,CAAA,CAAA;2FDUa,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;YACI,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,cAEX,IAAI,EAAA,QAAA,EAAA,0LAAA,EAAA,MAAA,EAAA,CAAA,ghCAAA,CAAA,EAAA,CAAA;8BAKP,aAAa,EAAA,CAAA;sBAArB,KAAK;gBACG,eAAe,EAAA,CAAA;sBAAvB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBAEI,iBAAiB,EAAA,CAAA;sBAA1B,MAAM;;;AExBX;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -7,7 +7,6 @@ class BsBoundary {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.isFixedCenter = false;
|
|
9
9
|
this.lockOrientation = 'auto';
|
|
10
|
-
this.afterBoundaryInit = new EventEmitter();
|
|
11
10
|
this.orientationChange = new EventEmitter();
|
|
12
11
|
this.breakpointObserver = inject(BreakpointObserver);
|
|
13
12
|
this.destroy$ = new Subject();
|
|
@@ -42,7 +41,7 @@ class BsBoundary {
|
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
BsBoundary.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BsBoundary, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
45
|
-
BsBoundary.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BsBoundary, isStandalone: true, selector: "bs-boundary", inputs: { isFixedCenter: "isFixedCenter", lockOrientation: "lockOrientation", forwardStyle: "forwardStyle" }, outputs: {
|
|
44
|
+
BsBoundary.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BsBoundary, isStandalone: true, selector: "bs-boundary", inputs: { isFixedCenter: "isFixedCenter", lockOrientation: "lockOrientation", forwardStyle: "forwardStyle" }, outputs: { orientationChange: "orientationChange" }, ngImport: i0, template: "<div\n class=\"boundary-wrapper\"\n [class.fixed-center]=\"isFixedCenter\"\n [class.landscape]=\"isLandscape\"\n [style]=\"forwardStyle\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--landscape-ratio: calc(var(--design-width) / var(--design-height));--portrait-ratio: calc(var(--design-height) / var(--design-width))}.boundary-wrapper{width:100%;height:100%;max-width:var(--boundary-width);max-height:var(--boundary-height)}.boundary-wrapper{--boundary-width: min(var(--vw100), var(--boundary-max-width));--boundary-height: min(var(--vh100), var(--boundary-max-height));--px2vw-ratio: calc(var(--boundary-width) / var(--design-base-width));--boundary-max-width: calc(var(--vh100) * var(--landscape-ratio));--boundary-max-height: calc(var(--vw100) * var(--portrait-ratio));--design-base-width: var(--design-width);--design-base-height: var(--design-height)}.boundary-wrapper.landscape{--boundary-max-width: calc(var(--vh100) * var(--portrait-ratio));--boundary-max-height: calc(var(--vw100) * var(--landscape-ratio));--design-base-width: var(--design-height);--design-base-height: var(--design-width)}.fixed-center{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;z-index:99}\n"] });
|
|
46
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BsBoundary, decorators: [{
|
|
47
46
|
type: Component,
|
|
48
47
|
args: [{ selector: 'bs-boundary', standalone: true, template: "<div\n class=\"boundary-wrapper\"\n [class.fixed-center]=\"isFixedCenter\"\n [class.landscape]=\"isLandscape\"\n [style]=\"forwardStyle\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--landscape-ratio: calc(var(--design-width) / var(--design-height));--portrait-ratio: calc(var(--design-height) / var(--design-width))}.boundary-wrapper{width:100%;height:100%;max-width:var(--boundary-width);max-height:var(--boundary-height)}.boundary-wrapper{--boundary-width: min(var(--vw100), var(--boundary-max-width));--boundary-height: min(var(--vh100), var(--boundary-max-height));--px2vw-ratio: calc(var(--boundary-width) / var(--design-base-width));--boundary-max-width: calc(var(--vh100) * var(--landscape-ratio));--boundary-max-height: calc(var(--vw100) * var(--portrait-ratio));--design-base-width: var(--design-width);--design-base-height: var(--design-height)}.boundary-wrapper.landscape{--boundary-max-width: calc(var(--vh100) * var(--portrait-ratio));--boundary-max-height: calc(var(--vw100) * var(--landscape-ratio));--design-base-width: var(--design-height);--design-base-height: var(--design-width)}.fixed-center{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;z-index:99}\n"] }]
|
|
@@ -52,8 +51,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
52
51
|
type: Input
|
|
53
52
|
}], forwardStyle: [{
|
|
54
53
|
type: Input
|
|
55
|
-
}], afterBoundaryInit: [{
|
|
56
|
-
type: Output
|
|
57
54
|
}], orientationChange: [{
|
|
58
55
|
type: Output
|
|
59
56
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitstack-ng-boundary.mjs","sources":["../../../projects/bitstack-ng-boundary/src/lib/bs-boundary.ts","../../../projects/bitstack-ng-boundary/src/lib/template.html","../../../projects/bitstack-ng-boundary/src/public-api.ts","../../../projects/bitstack-ng-boundary/src/bitstack-ng-boundary.ts"],"sourcesContent":["import {\n Component,\n
|
|
1
|
+
{"version":3,"file":"bitstack-ng-boundary.mjs","sources":["../../../projects/bitstack-ng-boundary/src/lib/bs-boundary.ts","../../../projects/bitstack-ng-boundary/src/lib/template.html","../../../projects/bitstack-ng-boundary/src/public-api.ts","../../../projects/bitstack-ng-boundary/src/bitstack-ng-boundary.ts"],"sourcesContent":["import {\n Component,\n EventEmitter,\n inject,\n Input, OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\nimport {TOrientationMode} from './model';\nimport {BreakpointObserver} from '@angular/cdk/layout';\nimport {Subject, takeUntil} from 'rxjs';\n\n@Component({\n selector: 'bs-boundary',\n templateUrl: 'template.html',\n standalone: true,\n styleUrls: ['./styles.scss'],\n})\nexport class BsBoundary implements OnInit, OnDestroy {\n\n @Input() isFixedCenter?: boolean = false;\n @Input() lockOrientation?: TOrientationMode = 'auto';\n @Input() forwardStyle?: Record<string, string>;\n\n @Output() orientationChange = new EventEmitter<TOrientationMode>();\n\n private breakpointObserver = inject(BreakpointObserver);\n private destroy$ = new Subject<void>();\n\n isLandscape = false;\n\n ngOnInit(): void {\n this.setupBreakpointObserver();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * 監控方向變化\n */\n setupBreakpointObserver() {\n if (this.lockOrientation === 'landscape') {\n this.isLandscape = true;\n return;\n }\n\n if (this.lockOrientation === 'portrait') {\n this.isLandscape = false;\n return;\n }\n\n this.breakpointObserver\n .observe('(orientation: landscape)')\n .pipe(takeUntil(this.destroy$))\n .subscribe(result => {\n this.orientationChange.emit(result.matches ? 'landscape' : 'portrait');\n this.isLandscape = result.matches;\n });\n }\n}\n","<div\n class=\"boundary-wrapper\"\n [class.fixed-center]=\"isFixedCenter\"\n [class.landscape]=\"isLandscape\"\n [style]=\"forwardStyle\"\n>\n <ng-content></ng-content>\n</div>\n","/*\n * Public API Surface of @bitstack/ng-boundary\n */\n\nexport * from './lib/bs-boundary';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAkBa,UAAU,CAAA;AANvB,IAAA,WAAA,GAAA;QAQa,IAAa,CAAA,aAAA,GAAa,KAAK,CAAC;QAChC,IAAe,CAAA,eAAA,GAAsB,MAAM,CAAC;AAG3C,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,YAAY,EAAoB,CAAC;AAE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AA,EAAA,IAAA,EAAA,UAAU,0OClBvB,0LAQA,EAAA,MAAA,EAAA,CAAA,ghCAAA,CAAA,EAAA,CAAA,CAAA;2FDUa,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,cAEX,IAAI,EAAA,QAAA,EAAA,0LAAA,EAAA,MAAA,EAAA,CAAA,ghCAAA,CAAA,EAAA,CAAA;8BAKP,aAAa,EAAA,CAAA;sBAArB,KAAK;gBACG,eAAe,EAAA,CAAA;sBAAvB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBAEI,iBAAiB,EAAA,CAAA;sBAA1B,MAAM;;;AExBX;;AAEG;;ACFH;;AAEG;;;;"}
|
package/lib/bs-boundary.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { TOrientationMode } from './model';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class BsBoundary implements OnInit, OnDestroy {
|
|
5
5
|
isFixedCenter?: boolean;
|
|
6
6
|
lockOrientation?: TOrientationMode;
|
|
7
7
|
forwardStyle?: Record<string, string>;
|
|
8
|
-
afterBoundaryInit: EventEmitter<ElementRef<HTMLDivElement>>;
|
|
9
8
|
orientationChange: EventEmitter<TOrientationMode>;
|
|
10
9
|
private breakpointObserver;
|
|
11
10
|
private destroy$;
|
|
@@ -17,5 +16,5 @@ export declare class BsBoundary implements OnInit, OnDestroy {
|
|
|
17
16
|
*/
|
|
18
17
|
setupBreakpointObserver(): void;
|
|
19
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<BsBoundary, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BsBoundary, "bs-boundary", never, { "isFixedCenter": "isFixedCenter"; "lockOrientation": "lockOrientation"; "forwardStyle": "forwardStyle"; }, { "
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BsBoundary, "bs-boundary", never, { "isFixedCenter": "isFixedCenter"; "lockOrientation": "lockOrientation"; "forwardStyle": "forwardStyle"; }, { "orientationChange": "orientationChange"; }, never, ["*"], true>;
|
|
21
20
|
}
|