@scion/components 16.0.0 → 16.2.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/_index.scss +116 -1
- package/design/_index.scss +1 -0
- package/design/_theming.scss +244 -0
- package/design/colors/_scion-dark-colors.scss +91 -0
- package/design/colors/_scion-light-colors.scss +91 -0
- package/design/colors/_scion-static-colors.scss +4 -0
- package/design/components/_scion-component-tokens.scss +48 -0
- package/design/themes/_scion-dark-theme.scss +55 -0
- package/design/themes/_scion-light-theme.scss +55 -0
- package/dimension/dimension.directive.d.ts +1 -1
- package/dimension/dimension.module.d.ts +1 -2
- package/esm2022/dimension/dimension.directive.mjs +3 -2
- package/esm2022/dimension/dimension.module.mjs +3 -7
- package/esm2022/sashbox/element-ref.directive.mjs +7 -3
- package/esm2022/sashbox/public_api.mjs +4 -4
- package/esm2022/sashbox/sash-initializer.directive.mjs +7 -4
- package/esm2022/sashbox/sash.directive.mjs +3 -2
- package/esm2022/sashbox/sashbox.component.mjs +32 -24
- package/esm2022/sashbox/sashbox.module.mjs +5 -19
- package/esm2022/splitter/public_api.mjs +3 -3
- package/esm2022/splitter/splitter.component.mjs +15 -16
- package/esm2022/splitter/splitter.module.mjs +4 -8
- package/esm2022/throbber/ellipsis-throbber/ellipsis-throbber.component.mjs +3 -3
- package/esm2022/throbber/ripple-throbber/ripple-throbber.component.mjs +3 -3
- package/esm2022/throbber/roller-throbber/roller-throbber.component.mjs +3 -3
- package/esm2022/throbber/spinner-throbber/spinner-throbber.component.mjs +3 -3
- package/esm2022/throbber/throbber.component.mjs +19 -10
- package/esm2022/throbber/throbber.module.mjs +4 -20
- package/esm2022/viewport/native-scrollbar-track-size-provider.service.mjs +6 -5
- package/esm2022/viewport/public_api.mjs +4 -5
- package/esm2022/viewport/scrollable.directive.mjs +3 -2
- package/esm2022/viewport/scrollbar/scrollbar.component.mjs +9 -8
- package/esm2022/viewport/viewport.component.mjs +20 -12
- package/esm2022/viewport/viewport.module.mjs +4 -12
- package/fesm2022/scion-components-dimension.mjs +4 -7
- package/fesm2022/scion-components-dimension.mjs.map +1 -1
- package/fesm2022/scion-components-sashbox.mjs +48 -44
- package/fesm2022/scion-components-sashbox.mjs.map +1 -1
- package/fesm2022/scion-components-splitter.mjs +18 -22
- package/fesm2022/scion-components-splitter.mjs.map +1 -1
- package/fesm2022/scion-components-throbber.mjs +25 -28
- package/fesm2022/scion-components-throbber.mjs.map +1 -1
- package/fesm2022/scion-components-viewport.mjs +125 -122
- package/fesm2022/scion-components-viewport.mjs.map +1 -1
- package/package.json +7 -1
- package/sashbox/element-ref.directive.d.ts +1 -1
- package/sashbox/public_api.d.ts +3 -3
- package/sashbox/sash-initializer.directive.d.ts +1 -1
- package/sashbox/sash.directive.d.ts +2 -2
- package/sashbox/sashbox.component.d.ts +13 -14
- package/sashbox/sashbox.module.d.ts +1 -5
- package/splitter/public_api.d.ts +2 -2
- package/splitter/splitter.component.d.ts +13 -14
- package/splitter/splitter.module.d.ts +1 -2
- package/throbber/ellipsis-throbber/ellipsis-throbber.component.d.ts +1 -1
- package/throbber/ripple-throbber/ripple-throbber.component.d.ts +1 -1
- package/throbber/roller-throbber/roller-throbber.component.d.ts +1 -1
- package/throbber/spinner-throbber/spinner-throbber.component.d.ts +1 -1
- package/throbber/throbber.component.d.ts +4 -3
- package/throbber/throbber.module.d.ts +1 -6
- package/viewport/native-scrollbar-track-size-provider.service.d.ts +0 -2
- package/viewport/public_api.d.ts +3 -4
- package/viewport/scrollable.directive.d.ts +1 -1
- package/viewport/{_scrollbar.scss → scrollbar/_scrollbar.scss} +3 -4
- package/viewport/scrollbar/scrollbar.component.d.ts +6 -5
- package/viewport/viewport.component.d.ts +7 -6
- package/viewport/viewport.module.d.ts +1 -3
- /package/viewport/{_index.scss → scrollbar/_index.scss} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-throbber.mjs","sources":["../../../../projects/scion/components/throbber/src/ellipsis-throbber/ellipsis-throbber.component.ts","../../../../projects/scion/components/throbber/src/ellipsis-throbber/ellipsis-throbber.component.html","../../../../projects/scion/components/throbber/src/ripple-throbber/ripple-throbber.component.ts","../../../../projects/scion/components/throbber/src/ripple-throbber/ripple-throbber.component.html","../../../../projects/scion/components/throbber/src/roller-throbber/roller-throbber.component.ts","../../../../projects/scion/components/throbber/src/roller-throbber/roller-throbber.component.html","../../../../projects/scion/components/throbber/src/spinner-throbber/spinner-throbber.component.ts","../../../../projects/scion/components/throbber/src/spinner-throbber/spinner-throbber.component.html","../../../../projects/scion/components/throbber/src/throbber.component.ts","../../../../projects/scion/components/throbber/src/throbber.component.html","../../../../projects/scion/components/throbber/src/throbber.module.ts","../../../../projects/scion/components/throbber/src/public_api.ts","../../../../projects/scion/components/throbber/src/scion-components-throbber.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\n/**\n * Represents a throbber as an ellipsis consisting of three horizontally arranged points that appear one after the other.\n *\n * Throbber type: `ellipsis`\n */\n@Component({\n selector: 'sci-ellipsis-throbber',\n templateUrl: './ellipsis-throbber.component.html',\n styleUrls: ['./ellipsis-throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SciEllipsisThrobberComponent {\n}\n","<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\n/**\n * Represents a throbber with a rippled, centric wave effect, similar to throwing a stone into water.\n *\n * Throbber type: `ripple`\n */\n@Component({\n selector: 'sci-ripple-throbber',\n templateUrl: './ripple-throbber.component.html',\n styleUrls: ['./ripple-throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SciRippleThrobberComponent {\n}\n","<div class=\"circle\"></div>\n<div class=\"circle\"></div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\n/**\n * Represents a circular throbber with points rotating around the center of a circle. Points have a delayed acceleration, which leads to an accordion effect.\n *\n * Throbber type: `roller`\n */\n@Component({\n selector: 'sci-roller-throbber',\n templateUrl: './roller-throbber.component.html',\n styleUrls: ['./roller-throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SciRollerThrobberComponent {\n}\n","<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\n/**\n * Represents a classic spinner throbber with strokes arranged radially. The strokes light up one after the other in clockwise direction\n * and then then fade out again.\n *\n * Throbber type: `spinner`\n */\n@Component({\n selector: 'sci-spinner-throbber',\n templateUrl: './spinner-throbber.component.html',\n styleUrls: ['./spinner-throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SciSpinnerThrobberComponent {\n}\n","<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\n\n/**\n * Animated graphical control to indicate the execution of an action.\n *\n * Choose between different throbber presentations by setting the `type` property: `ellipsis`, `ripple`, `roller`, `spinner`.\n *\n * ### CSS styling:\n *\n * You can override the following CSS variables:\n *\n * - sci-throbber-color: Sets the color of the throbber (by default, uses `lightgray`).\n * - sci-throbber-size: Defines the size of the throbber. Most throbbers are quadratic having the same width and height.\n * For non-quadratic throbbers, the size usually specifies the height (by default, uses `50px`).\n * - sci-throbber-duration: Sets the duration of a single animation cycle (by default, uses `1.25s`).\n *\n * Example:\n *\n * ```css\n *\n * sci-throbber {\n * --sci-throbber-color: blue;\n * --sci-throbber-size: 50px;\n * --sci-throbber-duration: 1s\n * }\n * ```\n */\n@Component({\n selector: 'sci-throbber',\n templateUrl: './throbber.component.html',\n styleUrls: ['./throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SciThrobberComponent {\n\n /**\n * Chooses between different throbber presentation. If not set, uses `spinner` type.\n *\n * - **ellipsis**\n * Represents a throbber as an ellipsis consisting of three horizontally arranged points that appear one after the other.\n * - **ripple**\n * Represents a throbber with a rippled, centric wave effect, similar to throwing a stone into water.\n * - **roller**\n * Represents a circular throbber with points rotating around the center of a circle. Points have a delayed acceleration, which leads to an accordion effect.\n * - **spinner** (default)\n * Represents a classic spinner throbber with strokes arranged radially. The strokes light up one after the other in clockwise direction and then then fade out again.\n */\n @Input()\n public type: 'ellipsis' | 'ripple' | 'roller' | 'spinner' = 'spinner';\n}\n","<ng-container [ngSwitch]=\"type\">\n <sci-ellipsis-throbber *ngSwitchCase=\"'ellipsis'\"></sci-ellipsis-throbber>\n <sci-ripple-throbber *ngSwitchCase=\"'ripple'\"></sci-ripple-throbber>\n <sci-roller-throbber *ngSwitchCase=\"'roller'\"></sci-roller-throbber>\n <sci-spinner-throbber *ngSwitchCase=\"'spinner'\"></sci-spinner-throbber>\n <sci-spinner-throbber *ngSwitchDefault></sci-spinner-throbber>\n</ng-container>","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {SciThrobberComponent} from './throbber.component';\nimport {SciEllipsisThrobberComponent} from './ellipsis-throbber/ellipsis-throbber.component';\nimport {SciRippleThrobberComponent} from './ripple-throbber/ripple-throbber.component';\nimport {SciRollerThrobberComponent} from './roller-throbber/roller-throbber.component';\nimport {SciSpinnerThrobberComponent} from './spinner-throbber/spinner-throbber.component';\n\n/**\n * Provides {@link SciThrobberComponent}, an animated graphical control to indicate the execution of an action.\n */\n@NgModule({\n declarations: [\n SciThrobberComponent,\n SciEllipsisThrobberComponent,\n SciRippleThrobberComponent,\n SciRollerThrobberComponent,\n SciSpinnerThrobberComponent,\n ],\n imports: [\n CommonModule,\n ],\n exports: [\n SciThrobberComponent,\n ],\n})\nexport class SciThrobberModule {\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/throbber'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciThrobberModule} from './throbber.module';\nexport {SciThrobberComponent} from './throbber.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.SciEllipsisThrobberComponent","i3.SciRippleThrobberComponent","i4.SciRollerThrobberComponent","i5.SciSpinnerThrobberComponent"],"mappings":";;;;;AAAA;;;;;;;;AAQG;AAIH;;;;AAIG;AACH,MAMa,4BAA4B,CAAA;8GAA5B,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4BAA4B,6DCvBzC,yFAGA,EAAA,MAAA,EAAA,CAAA,mlBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;2FDoBa,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBANxC,SAAS;+BACE,uBAAuB,EAAA,eAAA,EAGhB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yFAAA,EAAA,MAAA,EAAA,CAAA,mlBAAA,CAAA,EAAA,CAAA;;;AErBjD;;;;;;;;AAQG;AAIH;;;;AAIG;AACH,MAMa,0BAA0B,CAAA;8GAA1B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,0BAA0B,2DCvBvC,8DAEA,EAAA,MAAA,EAAA,CAA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AAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAN1B,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAMH,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAf7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;wBACpB,4BAA4B;wBAC5B,0BAA0B;wBAC1B,0BAA0B;wBAC1B,2BAA2B;AAC5B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;AACrB,qBAAA;AACF,iBAAA,CAAA;;;ACnCD;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-throbber.mjs","sources":["../../../../projects/scion/components/throbber/src/ellipsis-throbber/ellipsis-throbber.component.ts","../../../../projects/scion/components/throbber/src/ellipsis-throbber/ellipsis-throbber.component.html","../../../../projects/scion/components/throbber/src/ripple-throbber/ripple-throbber.component.ts","../../../../projects/scion/components/throbber/src/ripple-throbber/ripple-throbber.component.html","../../../../projects/scion/components/throbber/src/roller-throbber/roller-throbber.component.ts","../../../../projects/scion/components/throbber/src/roller-throbber/roller-throbber.component.html","../../../../projects/scion/components/throbber/src/spinner-throbber/spinner-throbber.component.ts","../../../../projects/scion/components/throbber/src/spinner-throbber/spinner-throbber.component.html","../../../../projects/scion/components/throbber/src/throbber.component.ts","../../../../projects/scion/components/throbber/src/throbber.component.html","../../../../projects/scion/components/throbber/src/throbber.module.ts","../../../../projects/scion/components/throbber/src/public_api.ts","../../../../projects/scion/components/throbber/src/scion-components-throbber.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\n/**\n * Represents a throbber as an ellipsis consisting of three horizontally arranged points that appear one after the other.\n *\n * Throbber type: `ellipsis`\n */\n@Component({\n selector: 'sci-ellipsis-throbber',\n templateUrl: './ellipsis-throbber.component.html',\n styleUrls: ['./ellipsis-throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SciEllipsisThrobberComponent {\n}\n","<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\n/**\n * Represents a throbber with a rippled, centric wave effect, similar to throwing a stone into water.\n *\n * Throbber type: `ripple`\n */\n@Component({\n selector: 'sci-ripple-throbber',\n templateUrl: './ripple-throbber.component.html',\n styleUrls: ['./ripple-throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SciRippleThrobberComponent {\n}\n","<div class=\"circle\"></div>\n<div class=\"circle\"></div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\n/**\n * Represents a circular throbber with points rotating around the center of a circle. Points have a delayed acceleration, which leads to an accordion effect.\n *\n * Throbber type: `roller`\n */\n@Component({\n selector: 'sci-roller-throbber',\n templateUrl: './roller-throbber.component.html',\n styleUrls: ['./roller-throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SciRollerThrobberComponent {\n}\n","<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>\n<div class=\"point\"></div>","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\n/**\n * Represents a classic spinner throbber with strokes arranged radially. The strokes light up one after the other in clockwise direction\n * and then then fade out again.\n *\n * Throbber type: `spinner`\n */\n@Component({\n selector: 'sci-spinner-throbber',\n templateUrl: './spinner-throbber.component.html',\n styleUrls: ['./spinner-throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SciSpinnerThrobberComponent {\n}\n","<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>\n<div class=\"stroke\"></div>","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {NgSwitch, NgSwitchCase, NgSwitchDefault} from '@angular/common';\nimport {SciEllipsisThrobberComponent} from './ellipsis-throbber/ellipsis-throbber.component';\nimport {SciRippleThrobberComponent} from './ripple-throbber/ripple-throbber.component';\nimport {SciRollerThrobberComponent} from './roller-throbber/roller-throbber.component';\nimport {SciSpinnerThrobberComponent} from './spinner-throbber/spinner-throbber.component';\n\n/**\n * Animated graphical control to indicate the execution of an action.\n *\n * Choose between different throbber presentations by setting the `type` property: `ellipsis`, `ripple`, `roller`, `spinner`.\n *\n * ### Styling:\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-throbber` component, the following CSS variables can be set directly on the component.\n *\n * - sci-throbber-color: Sets the color of the throbber (by default, uses `lightgray`).\n * - sci-throbber-size: Defines the size of the throbber. Most throbbers are quadratic having the same width and height.\n * For non-quadratic throbbers, the size usually specifies the height (by default, uses `50px`).\n * - sci-throbber-duration: Sets the duration of a single animation cycle (by default, uses `1.25s`).\n *\n * Example:\n *\n * ```css\n *\n * sci-throbber {\n * --sci-throbber-color: blue;\n * --sci-throbber-size: 50px;\n * --sci-throbber-duration: 1s\n * }\n * ```\n */\n@Component({\n selector: 'sci-throbber',\n templateUrl: './throbber.component.html',\n styleUrls: ['./throbber.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n NgSwitch,\n NgSwitchCase,\n NgSwitchDefault,\n SciEllipsisThrobberComponent,\n SciRippleThrobberComponent,\n SciRollerThrobberComponent,\n SciSpinnerThrobberComponent,\n ],\n})\nexport class SciThrobberComponent {\n\n /**\n * Chooses between different throbber presentation. If not set, uses `spinner` type.\n *\n * - **ellipsis**\n * Represents a throbber as an ellipsis consisting of three horizontally arranged points that appear one after the other.\n * - **ripple**\n * Represents a throbber with a rippled, centric wave effect, similar to throwing a stone into water.\n * - **roller**\n * Represents a circular throbber with points rotating around the center of a circle. Points have a delayed acceleration, which leads to an accordion effect.\n * - **spinner** (default)\n * Represents a classic spinner throbber with strokes arranged radially. The strokes light up one after the other in clockwise direction and then then fade out again.\n */\n @Input()\n public type: 'ellipsis' | 'ripple' | 'roller' | 'spinner' = 'spinner';\n}\n","<ng-container [ngSwitch]=\"type\">\n <sci-ellipsis-throbber *ngSwitchCase=\"'ellipsis'\"></sci-ellipsis-throbber>\n <sci-ripple-throbber *ngSwitchCase=\"'ripple'\"></sci-ripple-throbber>\n <sci-roller-throbber *ngSwitchCase=\"'roller'\"></sci-roller-throbber>\n <sci-spinner-throbber *ngSwitchCase=\"'spinner'\"></sci-spinner-throbber>\n <sci-spinner-throbber *ngSwitchDefault></sci-spinner-throbber>\n</ng-container>","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {NgModule} from '@angular/core';\nimport {SciThrobberComponent} from './throbber.component';\n\n/**\n * Provides {@link SciThrobberComponent}, an animated graphical control to indicate the execution of an action.\n */\n@NgModule({\n imports: [\n SciThrobberComponent,\n ],\n exports: [\n SciThrobberComponent,\n ],\n})\nexport class SciThrobberModule {\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/throbber'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciThrobberModule} from './throbber.module';\nexport {SciThrobberComponent} from './throbber.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;AAQG;AAIH;;;;AAIG;AACH,MAOa,4BAA4B,CAAA;8GAA5B,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4BAA4B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EAAA,UAAA,EAAA,CAAA;kBAhBhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,mBAGP,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,QAAQ;wBACR,YAAY;wBACZ,eAAe;wBACf,4BAA4B;wBAC5B,0BAA0B;wBAC1B,0BAA0B;wBAC1B,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,waAAA,EAAA,MAAA,EAAA,CAAA,4OAAA,CAAA,EAAA,CAAA;8BAiBM,IAAI,EAAA,CAAA;sBADV,KAAK;;;AEzER;;;;;;;;AAQG;AAKH;;AAEG;AACH,MAQa,iBAAiB,CAAA;8GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAjB,iBAAiB,EAAA,OAAA,EAAA,CAN1B,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAGpB,oBAAoB,CAAA,EAAA,CAAA,CAAA,EAAA;+GAGX,iBAAiB,EAAA,CAAA,CAAA,EAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAR7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,oBAAoB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;AACrB,qBAAA;AACF,iBAAA,CAAA;;;ACvBD;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Inject, NgZone, Component, ChangeDetectionStrategy, ViewChild, HostBinding,
|
|
3
|
-
import * as i2 from '@angular/common';
|
|
4
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
2
|
+
import { Injectable, Inject, Directive, Input, NgZone, Component, ChangeDetectionStrategy, ViewChild, HostBinding, EventEmitter, ViewEncapsulation, Output, HostListener, NgModule } from '@angular/core';
|
|
5
3
|
import { coerceElement } from '@angular/cdk/coercion';
|
|
6
|
-
import { BehaviorSubject, Subject, fromEvent, of, merge, timer } from 'rxjs';
|
|
7
4
|
import { debounceTime, startWith, map, distinctUntilChanged, takeUntil, switchMap, first, withLatestFrom, takeWhile } from 'rxjs/operators';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
5
|
+
import { BehaviorSubject, Subject, fromEvent, merge, of, timer } from 'rxjs';
|
|
6
|
+
import { DOCUMENT, NgIf, AsyncPipe } from '@angular/common';
|
|
10
7
|
import { fromDimension$, fromMutation$ } from '@scion/toolkit/observable';
|
|
11
8
|
import { subscribeInside, filterArray } from '@scion/toolkit/operators';
|
|
9
|
+
import * as i2 from '@angular/cdk/scrolling';
|
|
10
|
+
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
12
11
|
|
|
13
12
|
/*
|
|
14
13
|
* Copyright (c) 2018-2019 Swiss Federal Railways
|
|
@@ -21,8 +20,6 @@ import { subscribeInside, filterArray } from '@scion/toolkit/operators';
|
|
|
21
20
|
*/
|
|
22
21
|
/**
|
|
23
22
|
* Provides the native scrollbar tracksize.
|
|
24
|
-
*
|
|
25
|
-
* @dynamic ignore 'strictMetadataEmit' errors due to the usage of {@link Document} as ambient type for DI.
|
|
26
23
|
*/
|
|
27
24
|
class SciNativeScrollbarTrackSizeProvider {
|
|
28
25
|
constructor(_document, _zone) {
|
|
@@ -70,9 +67,12 @@ class SciNativeScrollbarTrackSizeProvider {
|
|
|
70
67
|
});
|
|
71
68
|
viewportDiv.appendChild(viewportClientDiv);
|
|
72
69
|
this._document.body.appendChild(viewportDiv);
|
|
70
|
+
// Do not use client and offset width/height to calculate the size of the scrollbar, as they are rounded, resulting in unwanted spacing when zooming the page.
|
|
71
|
+
const viewportBounds = viewportDiv.getBoundingClientRect();
|
|
72
|
+
const viewportClientBounds = viewportClientDiv.getBoundingClientRect();
|
|
73
73
|
const trackSize = {
|
|
74
|
-
hScrollbarTrackHeight:
|
|
75
|
-
vScrollbarTrackWidth:
|
|
74
|
+
hScrollbarTrackHeight: viewportBounds.height - viewportClientBounds.height,
|
|
75
|
+
vScrollbarTrackWidth: viewportBounds.width - viewportClientBounds.width,
|
|
76
76
|
};
|
|
77
77
|
// destroy temporary viewport
|
|
78
78
|
this._document.body.removeChild(viewportDiv);
|
|
@@ -119,6 +119,95 @@ function setStyle(element, style) {
|
|
|
119
119
|
Object.keys(style).forEach(key => element.style.setProperty(key, style[key]));
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/*
|
|
123
|
+
* Copyright (c) 2018-2019 Swiss Federal Railways
|
|
124
|
+
*
|
|
125
|
+
* This program and the accompanying materials are made
|
|
126
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
127
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
128
|
+
*
|
|
129
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
130
|
+
*/
|
|
131
|
+
/**
|
|
132
|
+
* Makes the host element natively scrollable and hides native scrollbars by default, unless native scrollbars
|
|
133
|
+
* already sit on top of the viewport (e.g. in OS X).
|
|
134
|
+
*
|
|
135
|
+
* Because there is no cross-browser API to hide scrollbars without losing native scroll support, we set 'overflow'
|
|
136
|
+
* to 'scroll' but shift the native scrollbars out of the visible viewport area. The shift offset is computed upfront.
|
|
137
|
+
*
|
|
138
|
+
* This directive expects its host element to be the only child in document flow in its parent DOM element. It makes the host element
|
|
139
|
+
* fill up the entire space (width and height set to 100%). The parent element must have its CSS `overflow` property set to `hidden`
|
|
140
|
+
* to hide the pushed out native scrollbars.
|
|
141
|
+
*/
|
|
142
|
+
class SciScrollableDirective {
|
|
143
|
+
constructor(_host, _renderer, nativeScrollbarTrackSizeProvider) {
|
|
144
|
+
this._host = _host;
|
|
145
|
+
this._renderer = _renderer;
|
|
146
|
+
this._destroy$ = new Subject();
|
|
147
|
+
this._inputChange$ = new Subject();
|
|
148
|
+
/**
|
|
149
|
+
* Controls whether to display native scrollbars.
|
|
150
|
+
* Has no effect if the native scrollbar sits on top of the content, e.g. in OS X.
|
|
151
|
+
*/
|
|
152
|
+
this.isDisplayNativeScrollbar = false;
|
|
153
|
+
merge(nativeScrollbarTrackSizeProvider.trackSize$, this._inputChange$.pipe(map(() => nativeScrollbarTrackSizeProvider.trackSize)))
|
|
154
|
+
.pipe(takeUntil(this._destroy$))
|
|
155
|
+
.subscribe(nativeScrollbarTrackSize => {
|
|
156
|
+
if (nativeScrollbarTrackSize === null) { // the native scrollbar sits on top of the content
|
|
157
|
+
this.useNativeScrollbars();
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
this.isDisplayNativeScrollbar ? this.useNativeScrollbars() : this.shiftNativeScrollbars(nativeScrollbarTrackSize);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Uses the native scrollbars when content overflows.
|
|
166
|
+
*/
|
|
167
|
+
useNativeScrollbars() {
|
|
168
|
+
this.setStyle(this._host.nativeElement, {
|
|
169
|
+
overflow: 'auto',
|
|
170
|
+
width: '100%',
|
|
171
|
+
height: '100%',
|
|
172
|
+
marginRight: 0,
|
|
173
|
+
marginBottom: 0,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Shifts the native scrollbars out of the visible viewport area.
|
|
178
|
+
*/
|
|
179
|
+
shiftNativeScrollbars(nativeScrollbarTrackSize) {
|
|
180
|
+
this.setStyle(this._host.nativeElement, {
|
|
181
|
+
overflow: 'scroll',
|
|
182
|
+
width: `calc(100% + ${nativeScrollbarTrackSize.vScrollbarTrackWidth}px`,
|
|
183
|
+
height: `calc(100% + ${nativeScrollbarTrackSize.hScrollbarTrackHeight}px`,
|
|
184
|
+
marginRight: `-${nativeScrollbarTrackSize.vScrollbarTrackWidth}px`,
|
|
185
|
+
marginBottom: `-${nativeScrollbarTrackSize.hScrollbarTrackHeight}px`,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
setStyle(element, style) {
|
|
189
|
+
Object.keys(style).forEach(key => this._renderer.setStyle(element, key, style[key]));
|
|
190
|
+
}
|
|
191
|
+
ngOnChanges(changes) {
|
|
192
|
+
this._inputChange$.next();
|
|
193
|
+
}
|
|
194
|
+
ngOnDestroy() {
|
|
195
|
+
this._destroy$.next();
|
|
196
|
+
}
|
|
197
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciScrollableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SciNativeScrollbarTrackSizeProvider }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
198
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: SciScrollableDirective, isStandalone: true, selector: "[sciScrollable]", inputs: { isDisplayNativeScrollbar: ["sciScrollableDisplayNativeScrollbar", "isDisplayNativeScrollbar"] }, usesOnChanges: true, ngImport: i0 }); }
|
|
199
|
+
}
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciScrollableDirective, decorators: [{
|
|
201
|
+
type: Directive,
|
|
202
|
+
args: [{
|
|
203
|
+
selector: '[sciScrollable]',
|
|
204
|
+
standalone: true,
|
|
205
|
+
}]
|
|
206
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SciNativeScrollbarTrackSizeProvider }]; }, propDecorators: { isDisplayNativeScrollbar: [{
|
|
207
|
+
type: Input,
|
|
208
|
+
args: ['sciScrollableDisplayNativeScrollbar']
|
|
209
|
+
}] } });
|
|
210
|
+
|
|
122
211
|
/*
|
|
123
212
|
* Copyright (c) 2018-2019 Swiss Federal Railways
|
|
124
213
|
*
|
|
@@ -136,11 +225,12 @@ function setStyle(element, style) {
|
|
|
136
225
|
* - enlarges the thumb if the mouse pointer is near the thumb
|
|
137
226
|
* - allows paging on mousedown on the scroll track
|
|
138
227
|
*
|
|
139
|
-
* ###
|
|
228
|
+
* ### Styling:
|
|
140
229
|
*
|
|
141
|
-
*
|
|
230
|
+
* To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
|
|
231
|
+
* To style a specific `sci-scrollbar` component, the following CSS variables can be set directly on the component.
|
|
142
232
|
*
|
|
143
|
-
* - sci-scrollbar-color: Sets the color of the scrollbar
|
|
233
|
+
* - sci-scrollbar-color: Sets the color of the scrollbar.
|
|
144
234
|
*
|
|
145
235
|
* Example:
|
|
146
236
|
*
|
|
@@ -407,12 +497,12 @@ class SciScrollbarComponent {
|
|
|
407
497
|
this._destroy$.next();
|
|
408
498
|
}
|
|
409
499
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciScrollbarComponent, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
410
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: SciScrollbarComponent, selector: "sci-scrollbar", inputs: { direction: "direction", setViewport: ["viewport", "setViewport"] }, host: { properties: { "class.vertical": "this.vertical", "class.horizontal": "this.horizontal", "class.scrolling": "this.scrolling" } }, viewQueries: [{ propertyName: "thumbElement", first: true, predicate: ["thumb_handle"], descendants: true, static: true }], ngImport: i0, template: "<!-- scrolltrack to move the viewport client upwards (paging) -->\n<div class=\"scrolltrack-start\" (mousedown)=\"onScrollTrackMouseDown($event, 'up')\"></div>\n\n<!-- scrollthumb -->\n<div #thumb_handle\n class=\"thumb-handle\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\"\n (mousedown)=\"onMouseDown($event)\"\n (touchstart)=\"onTouchStart($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchcancel)=\"onTouchEnd($event)\">\n <div class=\"thumb\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\">\n </div>\n</div>\n\n<!-- scrolltrack to move the viewport client downwards (paging) -->\n<div class=\"scrolltrack-end\" (mousedown)=\"onScrollTrackMouseDown($event, 'down')\"></div>\n", styles: ["@charset \"UTF-8\";:host{display:flex;border:2px solid transparent;box-sizing:border-box
|
|
500
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: SciScrollbarComponent, isStandalone: true, selector: "sci-scrollbar", inputs: { direction: "direction", setViewport: ["viewport", "setViewport"] }, host: { properties: { "class.vertical": "this.vertical", "class.horizontal": "this.horizontal", "class.scrolling": "this.scrolling" } }, viewQueries: [{ propertyName: "thumbElement", first: true, predicate: ["thumb_handle"], descendants: true, static: true }], ngImport: i0, template: "<!-- scrolltrack to move the viewport client upwards (paging) -->\n<div class=\"scrolltrack-start\" (mousedown)=\"onScrollTrackMouseDown($event, 'up')\"></div>\n\n<!-- scrollthumb -->\n<div #thumb_handle\n class=\"thumb-handle\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\"\n (mousedown)=\"onMouseDown($event)\"\n (touchstart)=\"onTouchStart($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchcancel)=\"onTouchEnd($event)\">\n <div class=\"thumb\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\">\n </div>\n</div>\n\n<!-- scrolltrack to move the viewport client downwards (paging) -->\n<div class=\"scrolltrack-end\" (mousedown)=\"onScrollTrackMouseDown($event, 'down')\"></div>\n", styles: ["@charset \"UTF-8\";:host{display:flex;border:2px solid transparent;box-sizing:border-box;--\\275sci-scrollbar-color: var(--sci-scrollbar-color, rgb(78, 78, 78));--\\275sci-scrollbar-thumb-position-fr: 0;--\\275sci-scrollbar-thumb-size-fr: 0}:host.vertical{flex-direction:column}:host.horizontal{flex-direction:row}:host>div.scrolltrack-start{flex-grow:var(--\\275sci-scrollbar-thumb-position-fr)}:host>div.thumb-handle{flex-basis:20px;display:flex;flex-grow:var(--\\275sci-scrollbar-thumb-size-fr);align-items:center}:host>div.thumb-handle.vertical{flex-direction:column}:host>div.thumb-handle.horizontal{flex-direction:row}:host>div.thumb-handle>div.thumb{flex:auto;border-radius:4px;background-color:var(--\\275sci-scrollbar-color);opacity:.4;transition-duration:125ms;transition-property:width,height;transition-timing-function:ease-out}:host>div.thumb-handle>div.thumb.vertical{width:60%}:host>div.thumb-handle>div.thumb.horizontal{height:60%}:host>div.scrolltrack-end{flex-grow:calc(1 - (var(--\\275sci-scrollbar-thumb-position-fr) + var(--\\275sci-scrollbar-thumb-size-fr)))}:host-context:not(.overflow){display:none}:host-context:hover>div.thumb-handle>div.thumb,:host-context(.scrolling)>div.thumb-handle>div.thumb{background-color:var(--\\275sci-scrollbar-color);opacity:.75}:host-context:hover>div.thumb-handle>div.thumb.vertical,:host-context(.scrolling)>div.thumb-handle>div.thumb.vertical{width:100%}:host-context:hover>div.thumb-handle>div.thumb.horizontal,:host-context(.scrolling)>div.thumb-handle>div.thumb.horizontal{height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
411
501
|
}
|
|
412
502
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciScrollbarComponent, decorators: [{
|
|
413
503
|
type: Component,
|
|
414
|
-
args: [{ selector: 'sci-scrollbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- scrolltrack to move the viewport client upwards (paging) -->\n<div class=\"scrolltrack-start\" (mousedown)=\"onScrollTrackMouseDown($event, 'up')\"></div>\n\n<!-- scrollthumb -->\n<div #thumb_handle\n class=\"thumb-handle\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\"\n (mousedown)=\"onMouseDown($event)\"\n (touchstart)=\"onTouchStart($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchcancel)=\"onTouchEnd($event)\">\n <div class=\"thumb\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\">\n </div>\n</div>\n\n<!-- scrolltrack to move the viewport client downwards (paging) -->\n<div class=\"scrolltrack-end\" (mousedown)=\"onScrollTrackMouseDown($event, 'down')\"></div>\n", styles: ["@charset \"UTF-8\";:host{display:flex;border:2px solid transparent;box-sizing:border-box
|
|
415
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type:
|
|
504
|
+
args: [{ selector: 'sci-scrollbar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<!-- scrolltrack to move the viewport client upwards (paging) -->\n<div class=\"scrolltrack-start\" (mousedown)=\"onScrollTrackMouseDown($event, 'up')\"></div>\n\n<!-- scrollthumb -->\n<div #thumb_handle\n class=\"thumb-handle\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\"\n (mousedown)=\"onMouseDown($event)\"\n (touchstart)=\"onTouchStart($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchcancel)=\"onTouchEnd($event)\">\n <div class=\"thumb\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\">\n </div>\n</div>\n\n<!-- scrolltrack to move the viewport client downwards (paging) -->\n<div class=\"scrolltrack-end\" (mousedown)=\"onScrollTrackMouseDown($event, 'down')\"></div>\n", styles: ["@charset \"UTF-8\";:host{display:flex;border:2px solid transparent;box-sizing:border-box;--\\275sci-scrollbar-color: var(--sci-scrollbar-color, rgb(78, 78, 78));--\\275sci-scrollbar-thumb-position-fr: 0;--\\275sci-scrollbar-thumb-size-fr: 0}:host.vertical{flex-direction:column}:host.horizontal{flex-direction:row}:host>div.scrolltrack-start{flex-grow:var(--\\275sci-scrollbar-thumb-position-fr)}:host>div.thumb-handle{flex-basis:20px;display:flex;flex-grow:var(--\\275sci-scrollbar-thumb-size-fr);align-items:center}:host>div.thumb-handle.vertical{flex-direction:column}:host>div.thumb-handle.horizontal{flex-direction:row}:host>div.thumb-handle>div.thumb{flex:auto;border-radius:4px;background-color:var(--\\275sci-scrollbar-color);opacity:.4;transition-duration:125ms;transition-property:width,height;transition-timing-function:ease-out}:host>div.thumb-handle>div.thumb.vertical{width:60%}:host>div.thumb-handle>div.thumb.horizontal{height:60%}:host>div.scrolltrack-end{flex-grow:calc(1 - (var(--\\275sci-scrollbar-thumb-position-fr) + var(--\\275sci-scrollbar-thumb-size-fr)))}:host-context:not(.overflow){display:none}:host-context:hover>div.thumb-handle>div.thumb,:host-context(.scrolling)>div.thumb-handle>div.thumb{background-color:var(--\\275sci-scrollbar-color);opacity:.75}:host-context:hover>div.thumb-handle>div.thumb.vertical,:host-context(.scrolling)>div.thumb-handle>div.thumb.vertical{width:100%}:host-context:hover>div.thumb-handle>div.thumb.horizontal,:host-context(.scrolling)>div.thumb-handle>div.thumb.horizontal{height:100%}\n"] }]
|
|
505
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: Document, decorators: [{
|
|
416
506
|
type: Inject,
|
|
417
507
|
args: [DOCUMENT]
|
|
418
508
|
}] }, { type: i0.NgZone }]; }, propDecorators: { thumbElement: [{
|
|
@@ -431,95 +521,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
431
521
|
type: Input
|
|
432
522
|
}], setViewport: [{
|
|
433
523
|
type: Input,
|
|
434
|
-
args: ['viewport']
|
|
435
|
-
}] } });
|
|
436
|
-
|
|
437
|
-
/*
|
|
438
|
-
* Copyright (c) 2018-2019 Swiss Federal Railways
|
|
439
|
-
*
|
|
440
|
-
* This program and the accompanying materials are made
|
|
441
|
-
* available under the terms of the Eclipse Public License 2.0
|
|
442
|
-
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
443
|
-
*
|
|
444
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
445
|
-
*/
|
|
446
|
-
/**
|
|
447
|
-
* Makes the host element natively scrollable and hides native scrollbars by default, unless native scrollbars
|
|
448
|
-
* already sit on top of the viewport (e.g. in OS X).
|
|
449
|
-
*
|
|
450
|
-
* Because there is no cross-browser API to hide scrollbars without losing native scroll support, we set 'overflow'
|
|
451
|
-
* to 'scroll' but shift the native scrollbars out of the visible viewport area. The shift offset is computed upfront.
|
|
452
|
-
*
|
|
453
|
-
* This directive expects its host element to be the only child in document flow in its parent DOM element. It makes the host element
|
|
454
|
-
* fill up the entire space (width and height set to 100%). The parent element must have its CSS `overflow` property set to `hidden`
|
|
455
|
-
* to hide the pushed out native scrollbars.
|
|
456
|
-
*/
|
|
457
|
-
class SciScrollableDirective {
|
|
458
|
-
constructor(_host, _renderer, nativeScrollbarTrackSizeProvider) {
|
|
459
|
-
this._host = _host;
|
|
460
|
-
this._renderer = _renderer;
|
|
461
|
-
this._destroy$ = new Subject();
|
|
462
|
-
this._inputChange$ = new Subject();
|
|
463
|
-
/**
|
|
464
|
-
* Controls whether to display native scrollbars.
|
|
465
|
-
* Has no effect if the native scrollbar sits on top of the content, e.g. in OS X.
|
|
466
|
-
*/
|
|
467
|
-
this.isDisplayNativeScrollbar = false;
|
|
468
|
-
merge(nativeScrollbarTrackSizeProvider.trackSize$, this._inputChange$.pipe(map(() => nativeScrollbarTrackSizeProvider.trackSize)))
|
|
469
|
-
.pipe(takeUntil(this._destroy$))
|
|
470
|
-
.subscribe(nativeScrollbarTrackSize => {
|
|
471
|
-
if (nativeScrollbarTrackSize === null) { // the native scrollbar sits on top of the content
|
|
472
|
-
this.useNativeScrollbars();
|
|
473
|
-
}
|
|
474
|
-
else {
|
|
475
|
-
this.isDisplayNativeScrollbar ? this.useNativeScrollbars() : this.shiftNativeScrollbars(nativeScrollbarTrackSize);
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* Uses the native scrollbars when content overflows.
|
|
481
|
-
*/
|
|
482
|
-
useNativeScrollbars() {
|
|
483
|
-
this.setStyle(this._host.nativeElement, {
|
|
484
|
-
overflow: 'auto',
|
|
485
|
-
width: '100%',
|
|
486
|
-
height: '100%',
|
|
487
|
-
marginRight: 0,
|
|
488
|
-
marginBottom: 0,
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Shifts the native scrollbars out of the visible viewport area.
|
|
493
|
-
*/
|
|
494
|
-
shiftNativeScrollbars(nativeScrollbarTrackSize) {
|
|
495
|
-
this.setStyle(this._host.nativeElement, {
|
|
496
|
-
overflow: 'scroll',
|
|
497
|
-
width: `calc(100% + ${nativeScrollbarTrackSize.vScrollbarTrackWidth}px`,
|
|
498
|
-
height: `calc(100% + ${nativeScrollbarTrackSize.hScrollbarTrackHeight}px`,
|
|
499
|
-
marginRight: `-${nativeScrollbarTrackSize.vScrollbarTrackWidth}px`,
|
|
500
|
-
marginBottom: `-${nativeScrollbarTrackSize.hScrollbarTrackHeight}px`,
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
setStyle(element, style) {
|
|
504
|
-
Object.keys(style).forEach(key => this._renderer.setStyle(element, key, style[key]));
|
|
505
|
-
}
|
|
506
|
-
ngOnChanges(changes) {
|
|
507
|
-
this._inputChange$.next();
|
|
508
|
-
}
|
|
509
|
-
ngOnDestroy() {
|
|
510
|
-
this._destroy$.next();
|
|
511
|
-
}
|
|
512
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciScrollableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SciNativeScrollbarTrackSizeProvider }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
513
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: SciScrollableDirective, selector: "[sciScrollable]", inputs: { isDisplayNativeScrollbar: ["sciScrollableDisplayNativeScrollbar", "isDisplayNativeScrollbar"] }, usesOnChanges: true, ngImport: i0 }); }
|
|
514
|
-
}
|
|
515
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciScrollableDirective, decorators: [{
|
|
516
|
-
type: Directive,
|
|
517
|
-
args: [{
|
|
518
|
-
selector: '[sciScrollable]',
|
|
519
|
-
}]
|
|
520
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SciNativeScrollbarTrackSizeProvider }]; }, propDecorators: { isDisplayNativeScrollbar: [{
|
|
521
|
-
type: Input,
|
|
522
|
-
args: ['sciScrollableDisplayNativeScrollbar']
|
|
524
|
+
args: [{ alias: 'viewport', required: true }]
|
|
523
525
|
}] } });
|
|
524
526
|
|
|
525
527
|
/*
|
|
@@ -547,7 +549,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
547
549
|
*
|
|
548
550
|
* ## Adding the viewport to a layout
|
|
549
551
|
*
|
|
550
|
-
* Typically you would add the viewport component to a flexible layout, filling the remaining space vertically and horizontally, such as a flexbox container
|
|
552
|
+
* Typically, you would add the viewport component to a flexible layout, filling the remaining space vertically and horizontally, such as a flexbox container
|
|
551
553
|
* with the viewport's `flex` CSS property set to either `flex: auto` or `flex: 1 1 0`.
|
|
552
554
|
*
|
|
553
555
|
* The viewport is sized according to its content width and height. It grows to absorb any free space, thus overflowing its content only when encountering
|
|
@@ -569,7 +571,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
569
571
|
* By default, the viewport's content is added to a CSS grid container with a single column, filling remaining space vertically and horizontally.
|
|
570
572
|
* Using the `::part(content)` pseudo element selector, you can configure the grid container or apply a different layout, such as a flex or flow layout.
|
|
571
573
|
*
|
|
572
|
-
* #### Example of adding slotted content to a CSS flex container
|
|
574
|
+
* #### Example of adding slotted content to a CSS flex container
|
|
573
575
|
* ```css
|
|
574
576
|
* sci-viewport::part(content) {
|
|
575
577
|
* display: flex;
|
|
@@ -585,11 +587,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
585
587
|
* }
|
|
586
588
|
* ```
|
|
587
589
|
*
|
|
588
|
-
* ## Styling
|
|
590
|
+
* ## Styling
|
|
589
591
|
*
|
|
590
|
-
*
|
|
592
|
+
* To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
|
|
593
|
+
* To style a specific `sci-viewport` component, the following CSS variables can be set directly on the component.
|
|
591
594
|
*
|
|
592
|
-
* - sci-viewport-scrollbar-color: Sets the color of the scrollbar
|
|
595
|
+
* - sci-viewport-scrollbar-color: Sets the color of the scrollbar.
|
|
593
596
|
*
|
|
594
597
|
* ```css
|
|
595
598
|
* sci-viewport {
|
|
@@ -775,11 +778,17 @@ class SciViewportComponent {
|
|
|
775
778
|
return offset;
|
|
776
779
|
}
|
|
777
780
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciViewportComponent, deps: [{ token: i0.ElementRef }, { token: SciNativeScrollbarTrackSizeProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
778
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: SciViewportComponent, selector: "sci-viewport", inputs: { scrollbarStyle: "scrollbarStyle" }, outputs: { scroll: "scroll" }, host: { listeners: { "focus": "focus()" } }, viewQueries: [{ propertyName: "setViewport", first: true, predicate: ["viewport"], descendants: true, static: true }, { propertyName: "setViewportClient", first: true, predicate: ["viewport_client"], descendants: true, static: true }], ngImport: i0, template: "<!-- viewport and viewport client -->\n<div #viewport\n class=\"viewport\"\n tabindex=\"-1\"\n sciScrollable [sciScrollableDisplayNativeScrollbar]=\"scrollbarStyle === 'native'\"\n cdkScrollable\n (scroll)=\"onScroll($event)\">\n <div #viewport_client class=\"viewport-client\" part=\"content\">\n <slot></slot>\n </div>\n</div>\n\n<!-- render emulated scrollbars which sit on-top -->\n<ng-container *ngIf=\"scrollbarStyle === 'on-top' && (nativeScrollbarTrackSizeProvider.trackSize$ | async) !== null\">\n <sci-scrollbar [direction]=\"'vscroll'\" [viewport]=\"viewport\" class=\"e2e-vertical\"></sci-scrollbar>\n <sci-scrollbar [direction]=\"'hscroll'\" [viewport]=\"viewport\" class=\"e2e-horizontal\"></sci-scrollbar>\n</ng-container>\n", styles: ["
|
|
781
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: SciViewportComponent, isStandalone: true, selector: "sci-viewport", inputs: { scrollbarStyle: "scrollbarStyle" }, outputs: { scroll: "scroll" }, host: { listeners: { "focus": "focus()" } }, viewQueries: [{ propertyName: "setViewport", first: true, predicate: ["viewport"], descendants: true, static: true }, { propertyName: "setViewportClient", first: true, predicate: ["viewport_client"], descendants: true, static: true }], ngImport: i0, template: "<!-- viewport and viewport client -->\n<div #viewport\n class=\"viewport\"\n tabindex=\"-1\"\n sciScrollable [sciScrollableDisplayNativeScrollbar]=\"scrollbarStyle === 'native'\"\n cdkScrollable\n (scroll)=\"onScroll($event)\">\n <div #viewport_client class=\"viewport-client\" part=\"content\">\n <slot></slot>\n </div>\n</div>\n\n<!-- render emulated scrollbars which sit on-top -->\n<ng-container *ngIf=\"scrollbarStyle === 'on-top' && (nativeScrollbarTrackSizeProvider.trackSize$ | async) !== null\">\n <sci-scrollbar [direction]=\"'vscroll'\" [viewport]=\"viewport\" class=\"e2e-vertical\"></sci-scrollbar>\n <sci-scrollbar [direction]=\"'hscroll'\" [viewport]=\"viewport\" class=\"e2e-horizontal\"></sci-scrollbar>\n</ng-container>\n", styles: ["@charset \"UTF-8\";:host{--\\275sci-viewport-scrollbar-color: var(--sci-viewport-scrollbar-color, rgb(78, 78, 78));display:grid;grid-template-columns:100%;grid-template-rows:100%;position:relative;overflow:hidden;outline:none}:host:host-context(:not(:hover):not(:active)) sci-scrollbar:not(.scrolling){opacity:0}:host>div.viewport{display:grid;position:relative;outline:none;-webkit-overflow-scrolling:touch}:host>div.viewport>div.viewport-client{display:grid}:host>sci-scrollbar{--sci-scrollbar-color: var(--\\275sci-viewport-scrollbar-color);position:absolute;transition-duration:1s;transition-property:opacity;transition-timing-function:ease-out}:host>sci-scrollbar.vertical{top:0;right:0;bottom:0;left:unset;width:12px}:host>sci-scrollbar.horizontal{top:unset;right:0;bottom:0;left:0;height:12px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: SciScrollableDirective, selector: "[sciScrollable]", inputs: ["sciScrollableDisplayNativeScrollbar"] }, { kind: "component", type: SciScrollbarComponent, selector: "sci-scrollbar", inputs: ["direction", "viewport"] }], encapsulation: i0.ViewEncapsulation.ShadowDom }); }
|
|
779
782
|
}
|
|
780
783
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciViewportComponent, decorators: [{
|
|
781
784
|
type: Component,
|
|
782
|
-
args: [{ selector: 'sci-viewport', encapsulation: ViewEncapsulation.ShadowDom,
|
|
785
|
+
args: [{ selector: 'sci-viewport', encapsulation: ViewEncapsulation.ShadowDom, standalone: true, imports: [
|
|
786
|
+
NgIf,
|
|
787
|
+
AsyncPipe,
|
|
788
|
+
ScrollingModule,
|
|
789
|
+
SciScrollableDirective,
|
|
790
|
+
SciScrollbarComponent,
|
|
791
|
+
], template: "<!-- viewport and viewport client -->\n<div #viewport\n class=\"viewport\"\n tabindex=\"-1\"\n sciScrollable [sciScrollableDisplayNativeScrollbar]=\"scrollbarStyle === 'native'\"\n cdkScrollable\n (scroll)=\"onScroll($event)\">\n <div #viewport_client class=\"viewport-client\" part=\"content\">\n <slot></slot>\n </div>\n</div>\n\n<!-- render emulated scrollbars which sit on-top -->\n<ng-container *ngIf=\"scrollbarStyle === 'on-top' && (nativeScrollbarTrackSizeProvider.trackSize$ | async) !== null\">\n <sci-scrollbar [direction]=\"'vscroll'\" [viewport]=\"viewport\" class=\"e2e-vertical\"></sci-scrollbar>\n <sci-scrollbar [direction]=\"'hscroll'\" [viewport]=\"viewport\" class=\"e2e-horizontal\"></sci-scrollbar>\n</ng-container>\n", styles: ["@charset \"UTF-8\";:host{--\\275sci-viewport-scrollbar-color: var(--sci-viewport-scrollbar-color, rgb(78, 78, 78));display:grid;grid-template-columns:100%;grid-template-rows:100%;position:relative;overflow:hidden;outline:none}:host:host-context(:not(:hover):not(:active)) sci-scrollbar:not(.scrolling){opacity:0}:host>div.viewport{display:grid;position:relative;outline:none;-webkit-overflow-scrolling:touch}:host>div.viewport>div.viewport-client{display:grid}:host>sci-scrollbar{--sci-scrollbar-color: var(--\\275sci-viewport-scrollbar-color);position:absolute;transition-duration:1s;transition-property:opacity;transition-timing-function:ease-out}:host>sci-scrollbar.vertical{top:0;right:0;bottom:0;left:unset;width:12px}:host>sci-scrollbar.horizontal{top:unset;right:0;bottom:0;left:0;height:12px}\n"] }]
|
|
783
792
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: SciNativeScrollbarTrackSizeProvider }]; }, propDecorators: { setViewport: [{
|
|
784
793
|
type: ViewChild,
|
|
785
794
|
args: ['viewport', { static: true }]
|
|
@@ -809,23 +818,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
809
818
|
*/
|
|
810
819
|
class SciViewportModule {
|
|
811
820
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciViewportModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
812
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.1", ngImport: i0, type: SciViewportModule,
|
|
821
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.1", ngImport: i0, type: SciViewportModule, imports: [SciViewportComponent,
|
|
813
822
|
SciScrollbarComponent,
|
|
814
|
-
SciScrollableDirective],
|
|
815
|
-
ScrollingModule], exports: [SciViewportComponent,
|
|
823
|
+
SciScrollableDirective], exports: [SciViewportComponent,
|
|
816
824
|
SciScrollbarComponent,
|
|
817
825
|
SciScrollableDirective] }); }
|
|
818
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciViewportModule, imports: [
|
|
819
|
-
ScrollingModule] }); }
|
|
826
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciViewportModule, imports: [SciViewportComponent] }); }
|
|
820
827
|
}
|
|
821
828
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SciViewportModule, decorators: [{
|
|
822
829
|
type: NgModule,
|
|
823
830
|
args: [{
|
|
824
831
|
imports: [
|
|
825
|
-
CommonModule,
|
|
826
|
-
ScrollingModule,
|
|
827
|
-
],
|
|
828
|
-
declarations: [
|
|
829
832
|
SciViewportComponent,
|
|
830
833
|
SciScrollbarComponent,
|
|
831
834
|
SciScrollableDirective,
|
|
@@ -857,5 +860,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
857
860
|
* Generated bundle index. Do not edit.
|
|
858
861
|
*/
|
|
859
862
|
|
|
860
|
-
export {
|
|
863
|
+
export { SciScrollableDirective, SciScrollbarComponent, SciViewportComponent, SciViewportModule };
|
|
861
864
|
//# sourceMappingURL=scion-components-viewport.mjs.map
|