@skyux/indicators 5.3.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/bundles/skyux-indicators.umd.js +115 -114
- package/documentation.json +303 -30
- package/esm2015/index.js +38 -0
- package/esm2015/index.js.map +1 -0
- package/esm2015/{modules → lib/modules}/alert/alert.component.js +4 -4
- package/esm2015/lib/modules/alert/alert.component.js.map +1 -0
- package/esm2015/lib/modules/alert/alert.module.js +38 -0
- package/esm2015/lib/modules/alert/alert.module.js.map +1 -0
- package/esm2015/lib/modules/chevron/chevron.component.js +66 -0
- package/esm2015/lib/modules/chevron/chevron.component.js.map +1 -0
- package/esm2015/lib/modules/chevron/chevron.module.js +38 -0
- package/esm2015/lib/modules/chevron/chevron.module.js.map +1 -0
- package/esm2015/{modules → lib/modules}/expansion-indicator/expansion-indicator.component.js +4 -4
- package/esm2015/lib/modules/expansion-indicator/expansion-indicator.component.js.map +1 -0
- package/esm2015/lib/modules/expansion-indicator/expansion-indicator.module.js +19 -0
- package/esm2015/lib/modules/expansion-indicator/expansion-indicator.module.js.map +1 -0
- package/esm2015/{modules → lib/modules}/help-inline/help-inline.component.js +4 -4
- package/esm2015/lib/modules/help-inline/help-inline.component.js.map +1 -0
- package/esm2015/lib/modules/help-inline/help-inline.module.js +38 -0
- package/esm2015/lib/modules/help-inline/help-inline.module.js.map +1 -0
- package/esm2015/lib/modules/icon/icon-class-list.pipe.js +38 -0
- package/esm2015/lib/modules/icon/icon-class-list.pipe.js.map +1 -0
- package/esm2015/lib/modules/icon/icon-resolver.service.js +42 -0
- package/esm2015/lib/modules/icon/icon-resolver.service.js.map +1 -0
- package/esm2015/lib/modules/icon/icon-stack-item.js +2 -0
- package/esm2015/lib/modules/icon/icon-stack-item.js.map +1 -0
- package/esm2015/lib/modules/icon/icon-stack.component.js +23 -0
- package/esm2015/lib/modules/icon/icon-stack.component.js.map +1 -0
- package/esm2015/lib/modules/icon/icon.component.js +37 -0
- package/esm2015/lib/modules/icon/icon.component.js.map +1 -0
- package/esm2015/lib/modules/icon/icon.module.js +21 -0
- package/esm2015/lib/modules/icon/icon.module.js.map +1 -0
- package/esm2015/lib/modules/icon/types/icon-type.js +2 -0
- package/esm2015/lib/modules/icon/types/icon-type.js.map +1 -0
- package/esm2015/lib/modules/icon/types/icon-variant-type.js +2 -0
- package/esm2015/lib/modules/icon/types/icon-variant-type.js.map +1 -0
- package/esm2015/lib/modules/key-info/key-info-label.component.js +18 -0
- package/esm2015/lib/modules/key-info/key-info-label.component.js.map +1 -0
- package/esm2015/lib/modules/key-info/key-info-value.component.js +18 -0
- package/esm2015/lib/modules/key-info/key-info-value.component.js.map +1 -0
- package/esm2015/lib/modules/key-info/key-info.component.js +26 -0
- package/esm2015/lib/modules/key-info/key-info.component.js.map +1 -0
- package/esm2015/lib/modules/key-info/key-info.module.js +32 -0
- package/esm2015/lib/modules/key-info/key-info.module.js.map +1 -0
- package/esm2015/lib/modules/label/label-type.js +2 -0
- package/esm2015/lib/modules/label/label-type.js.map +1 -0
- package/esm2015/{modules → lib/modules}/label/label.component.js +4 -4
- package/esm2015/lib/modules/label/label.component.js.map +1 -0
- package/esm2015/lib/modules/label/label.module.js +19 -0
- package/esm2015/lib/modules/label/label.module.js.map +1 -0
- package/esm2015/lib/modules/shared/indicator-description-type.js +2 -0
- package/esm2015/lib/modules/shared/indicator-description-type.js.map +1 -0
- package/esm2015/lib/modules/shared/indicator-icon-type.js +2 -0
- package/esm2015/lib/modules/shared/indicator-icon-type.js.map +1 -0
- package/esm2015/lib/modules/shared/indicator-icon-utility.js +41 -0
- package/esm2015/lib/modules/shared/indicator-icon-utility.js.map +1 -0
- package/esm2015/lib/modules/shared/indicator-icon.js +2 -0
- package/esm2015/lib/modules/shared/indicator-icon.js.map +1 -0
- package/esm2015/lib/modules/shared/sky-indicators-resources.module.js +61 -0
- package/esm2015/lib/modules/shared/sky-indicators-resources.module.js.map +1 -0
- package/esm2015/lib/modules/status-indicator/status-indicator.component.js +99 -0
- package/esm2015/lib/modules/status-indicator/status-indicator.component.js.map +1 -0
- package/esm2015/lib/modules/status-indicator/status-indicator.module.js +34 -0
- package/esm2015/lib/modules/status-indicator/status-indicator.module.js.map +1 -0
- package/esm2015/lib/modules/text-highlight/text-highlight.directive.js +154 -0
- package/esm2015/lib/modules/text-highlight/text-highlight.directive.js.map +1 -0
- package/esm2015/lib/modules/text-highlight/text-highlight.module.js +18 -0
- package/esm2015/lib/modules/text-highlight/text-highlight.module.js.map +1 -0
- package/esm2015/{modules → lib/modules}/tokens/token.component.js +6 -5
- package/esm2015/lib/modules/tokens/token.component.js.map +1 -0
- package/esm2015/lib/modules/tokens/tokens.component.js +304 -0
- package/esm2015/lib/modules/tokens/tokens.component.js.map +1 -0
- package/esm2015/lib/modules/tokens/tokens.module.js +35 -0
- package/esm2015/lib/modules/tokens/tokens.module.js.map +1 -0
- package/esm2015/lib/modules/tokens/types/token-selected-event-args.js +2 -0
- package/esm2015/lib/modules/tokens/types/token-selected-event-args.js.map +1 -0
- package/esm2015/lib/modules/tokens/types/token.js +2 -0
- package/esm2015/lib/modules/tokens/types/token.js.map +1 -0
- package/esm2015/lib/modules/tokens/types/tokens-message-type.js +24 -0
- package/esm2015/lib/modules/tokens/types/tokens-message-type.js.map +1 -0
- package/esm2015/lib/modules/tokens/types/tokens-message.js +2 -0
- package/esm2015/lib/modules/tokens/types/tokens-message.js.map +1 -0
- package/esm2015/lib/modules/wait/wait-adapter.service.js +201 -0
- package/esm2015/lib/modules/wait/wait-adapter.service.js.map +1 -0
- package/esm2015/lib/modules/wait/wait-page-adapter.service.js +25 -0
- package/esm2015/lib/modules/wait/wait-page-adapter.service.js.map +1 -0
- package/esm2015/lib/modules/wait/wait-page.component.js +23 -0
- package/esm2015/lib/modules/wait/wait-page.component.js.map +1 -0
- package/esm2015/lib/modules/wait/wait.component.js +94 -0
- package/esm2015/lib/modules/wait/wait.component.js.map +1 -0
- package/esm2015/lib/modules/wait/wait.module.js +22 -0
- package/esm2015/lib/modules/wait/wait.module.js.map +1 -0
- package/esm2015/lib/modules/wait/wait.service.js +164 -0
- package/esm2015/lib/modules/wait/wait.service.js.map +1 -0
- package/esm2015/skyux-indicators.js +2 -2
- package/esm2015/skyux-indicators.js.map +1 -0
- package/esm2015/testing/alert-fixture.js +1 -1
- package/esm2015/testing/alert-fixture.js.map +1 -0
- package/esm2015/testing/label-fixture.js +1 -1
- package/esm2015/testing/label-fixture.js.map +1 -0
- package/esm2015/testing/public-api.js +1 -1
- package/esm2015/testing/public-api.js.map +1 -0
- package/esm2015/testing/skyux-indicators-testing.js +1 -1
- package/esm2015/testing/skyux-indicators-testing.js.map +1 -0
- package/esm2015/testing/wait-fixture.js +1 -1
- package/esm2015/testing/wait-fixture.js.map +1 -0
- package/fesm2015/skyux-indicators-testing.js.map +1 -1
- package/fesm2015/skyux-indicators.js +115 -114
- package/fesm2015/skyux-indicators.js.map +1 -1
- package/index.d.ts +35 -0
- package/{modules → lib/modules}/alert/alert.component.d.ts +0 -0
- package/{modules → lib/modules}/alert/alert.module.d.ts +0 -0
- package/{modules → lib/modules}/chevron/chevron.component.d.ts +0 -0
- package/{modules → lib/modules}/chevron/chevron.module.d.ts +0 -0
- package/{modules → lib/modules}/expansion-indicator/expansion-indicator.component.d.ts +0 -0
- package/{modules → lib/modules}/expansion-indicator/expansion-indicator.module.d.ts +0 -0
- package/{modules → lib/modules}/help-inline/help-inline.component.d.ts +0 -0
- package/{modules → lib/modules}/help-inline/help-inline.module.d.ts +0 -0
- package/{modules → lib/modules}/icon/icon-class-list.pipe.d.ts +0 -0
- package/{modules → lib/modules}/icon/icon-resolver.service.d.ts +0 -0
- package/{modules → lib/modules}/icon/icon-stack-item.d.ts +0 -0
- package/{modules → lib/modules}/icon/icon-stack.component.d.ts +0 -0
- package/{modules → lib/modules}/icon/icon.component.d.ts +4 -3
- package/{modules → lib/modules}/icon/icon.module.d.ts +0 -0
- package/{modules → lib/modules}/icon/types/icon-type.d.ts +0 -0
- package/{modules → lib/modules}/icon/types/icon-variant-type.d.ts +0 -0
- package/{modules → lib/modules}/key-info/key-info-label.component.d.ts +0 -0
- package/{modules → lib/modules}/key-info/key-info-value.component.d.ts +0 -0
- package/{modules → lib/modules}/key-info/key-info.component.d.ts +0 -0
- package/{modules → lib/modules}/key-info/key-info.module.d.ts +0 -0
- package/{modules → lib/modules}/label/label-type.d.ts +0 -0
- package/{modules → lib/modules}/label/label.component.d.ts +0 -0
- package/{modules → lib/modules}/label/label.module.d.ts +0 -0
- package/{modules → lib/modules}/shared/indicator-description-type.d.ts +0 -0
- package/{modules → lib/modules}/shared/indicator-icon-type.d.ts +0 -0
- package/{modules → lib/modules}/shared/indicator-icon-utility.d.ts +0 -0
- package/{modules → lib/modules}/shared/indicator-icon.d.ts +0 -0
- package/{modules → lib/modules}/shared/sky-indicators-resources.module.d.ts +0 -0
- package/{modules → lib/modules}/status-indicator/status-indicator.component.d.ts +0 -0
- package/{modules → lib/modules}/status-indicator/status-indicator.module.d.ts +0 -0
- package/{modules → lib/modules}/text-highlight/text-highlight.directive.d.ts +0 -0
- package/{modules → lib/modules}/text-highlight/text-highlight.module.d.ts +0 -0
- package/{modules → lib/modules}/tokens/token.component.d.ts +0 -0
- package/{modules → lib/modules}/tokens/tokens.component.d.ts +1 -1
- package/{modules → lib/modules}/tokens/tokens.module.d.ts +0 -0
- package/{modules → lib/modules}/tokens/types/token-selected-event-args.d.ts +0 -0
- package/{modules → lib/modules}/tokens/types/token.d.ts +0 -0
- package/{modules → lib/modules}/tokens/types/tokens-message-type.d.ts +0 -0
- package/{modules → lib/modules}/tokens/types/tokens-message.d.ts +0 -0
- package/{modules → lib/modules}/wait/wait-adapter.service.d.ts +0 -0
- package/{modules → lib/modules}/wait/wait-page-adapter.service.d.ts +0 -0
- package/{modules → lib/modules}/wait/wait-page.component.d.ts +0 -0
- package/{modules → lib/modules}/wait/wait.component.d.ts +0 -0
- package/{modules → lib/modules}/wait/wait.module.d.ts +0 -0
- package/{modules → lib/modules}/wait/wait.service.d.ts +0 -0
- package/package.json +20 -6
- package/skyux-indicators.d.ts +1 -1
- package/LICENSE +0 -21
- package/esm2015/modules/alert/alert.module.js +0 -38
- package/esm2015/modules/chevron/chevron.component.js +0 -66
- package/esm2015/modules/chevron/chevron.module.js +0 -38
- package/esm2015/modules/expansion-indicator/expansion-indicator.module.js +0 -19
- package/esm2015/modules/help-inline/help-inline.module.js +0 -38
- package/esm2015/modules/icon/icon-class-list.pipe.js +0 -37
- package/esm2015/modules/icon/icon-resolver.service.js +0 -41
- package/esm2015/modules/icon/icon-stack-item.js +0 -2
- package/esm2015/modules/icon/icon-stack.component.js +0 -23
- package/esm2015/modules/icon/icon.component.js +0 -36
- package/esm2015/modules/icon/icon.module.js +0 -21
- package/esm2015/modules/icon/types/icon-type.js +0 -2
- package/esm2015/modules/icon/types/icon-variant-type.js +0 -2
- package/esm2015/modules/key-info/key-info-label.component.js +0 -18
- package/esm2015/modules/key-info/key-info-value.component.js +0 -18
- package/esm2015/modules/key-info/key-info.component.js +0 -26
- package/esm2015/modules/key-info/key-info.module.js +0 -32
- package/esm2015/modules/label/label-type.js +0 -2
- package/esm2015/modules/label/label.module.js +0 -19
- package/esm2015/modules/shared/indicator-description-type.js +0 -2
- package/esm2015/modules/shared/indicator-icon-type.js +0 -2
- package/esm2015/modules/shared/indicator-icon-utility.js +0 -41
- package/esm2015/modules/shared/indicator-icon.js +0 -2
- package/esm2015/modules/shared/sky-indicators-resources.module.js +0 -61
- package/esm2015/modules/status-indicator/status-indicator.component.js +0 -98
- package/esm2015/modules/status-indicator/status-indicator.module.js +0 -34
- package/esm2015/modules/text-highlight/text-highlight.directive.js +0 -153
- package/esm2015/modules/text-highlight/text-highlight.module.js +0 -18
- package/esm2015/modules/tokens/tokens.component.js +0 -304
- package/esm2015/modules/tokens/tokens.module.js +0 -35
- package/esm2015/modules/tokens/types/token-selected-event-args.js +0 -2
- package/esm2015/modules/tokens/types/token.js +0 -2
- package/esm2015/modules/tokens/types/tokens-message-type.js +0 -24
- package/esm2015/modules/tokens/types/tokens-message.js +0 -2
- package/esm2015/modules/wait/wait-adapter.service.js +0 -201
- package/esm2015/modules/wait/wait-page-adapter.service.js +0 -25
- package/esm2015/modules/wait/wait-page.component.js +0 -23
- package/esm2015/modules/wait/wait.component.js +0 -93
- package/esm2015/modules/wait/wait.module.js +0 -22
- package/esm2015/modules/wait/wait.service.js +0 -162
- package/esm2015/public-api.js +0 -38
- package/public-api.d.ts +0 -35
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/tokens/tokens.component.ts","../../../../../../../../libs/components/indicators/src/lib/modules/tokens/tokens.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,SAAS,EACT,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAM3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAInE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;;;AAmCtD,MAAM,OAAO,kBAAkB;IA8J7B,YAAoB,cAAiC;QAAjC,mBAAc,GAAd,cAAc,CAAmB;QAlErD;;;WAGG;QAEI,wBAAmB,GAAG,IAAI,YAAY,EAAQ,CAAC;QAEtD;;;WAGG;QAEI,yBAAoB,GAAG,IAAI,YAAY,EAAQ,CAAC;QAEvD;;WAEG;QAEI,kBAAa,GAAG,IAAI,YAAY,EAA6B,CAAC;QAErE;;;WAGG;QAEI,iBAAY,G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Y,QAAQ;sBADlB,KAAK;gBAeK,WAAW;sBADrB,KAAK;gBAcK,WAAW;sBADrB,KAAK;gBAcC,SAAS;sBADf,KAAK;gBAUK,SAAS;sBADnB,KAAK;gBAaK,MAAM;sBADhB,KAAK;gBAeK,aAAa;sBADvB,KAAK;gBAeC,mBAAmB;sBADzB,MAAM;gBAQA,oBAAoB;sBAD1B,MAAM;gBAOA,aAAa;sBADnB,MAAM;gBAQA,YAAY;sBADlB,MAAM;gBA6BC,eAAe;sBADtB,YAAY;uBAAC,iBAAiB","sourcesContent":["import { animate, style, transition, trigger } from '@angular/animations';\n\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList,\n ViewChildren,\n} from '@angular/core';\n\nimport { Subject, Subscription } from 'rxjs';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyToken } from './types/token';\n\nimport { SkyTokensMessage } from './types/tokens-message';\n\nimport { SkyTokensMessageType } from './types/tokens-message-type';\n\nimport { SkyTokenSelectedEventArgs } from './types/token-selected-event-args';\n\nimport { SkyTokenComponent } from './token.component';\n\n@Component({\n selector: 'sky-tokens',\n templateUrl: './tokens.component.html',\n styleUrls: ['./tokens.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [\n trigger('blockAnimationOnLoad', [transition(':enter', [])]),\n trigger('dismiss', [\n transition(':enter', [\n style({\n opacity: 0,\n width: 0,\n }),\n animate(\n '150ms ease-in',\n style({\n opacity: 1,\n width: '*',\n })\n ),\n ]),\n transition(':leave', [\n animate(\n '150ms ease-in',\n style({\n opacity: 0,\n width: 0,\n })\n ),\n ]),\n ]),\n ],\n})\nexport class SkyTokensComponent implements OnDestroy {\n /**\n * Indicates whether to disable the tokens list to prevent users from selecting tokens,\n * dismissing tokens, or navigating through the list with the arrow keys. When the tokens list\n * is disabled, users can still place focus on items in the list using the `Tab` key.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n }\n\n public get disabled(): boolean {\n return !!this._disabled;\n }\n\n /**\n * Indicates whether users can remove tokens from the list by selecting their close buttons\n * or pressing the `Backspace` key.\n * @default true\n */\n @Input()\n public set dismissible(value: boolean) {\n this._dismissible = value;\n }\n\n public get dismissible(): boolean {\n return this._dismissible !== false;\n }\n\n /**\n * Specifies the token property to display for each item in the tokens list.\n * @default \"name\"\n */\n @Input()\n public set displayWith(value: string) {\n this._displayWith = value;\n }\n\n public get displayWith(): string {\n return this._displayWith || 'name';\n }\n\n /**\n * Specifies the token property that represents the token's unique identifier. When this property\n * is set, animations are enabled when dismissing tokens.\n */\n @Input()\n public trackWith: string;\n\n /**\n * Indicates whether users can focus on items in the list using the `Tab` key.\n * This does not affect the ability of users to select tokens, dismiss tokens,\n * or navigate through the list with the arrow keys.\n * @default true\n */\n @Input()\n public set focusable(value: boolean) {\n this._focusable = value;\n }\n\n public get focusable(): boolean {\n return this._focusable !== false;\n }\n\n /**\n * Specifies an array of tokens to include in the list.\n */\n @Input()\n public set tokens(value: SkyToken[]) {\n this._tokens = value;\n this.tokensChange.emit(this._tokens);\n }\n\n public get tokens(): SkyToken[] {\n return this._tokens || [];\n }\n\n /**\n * Specifies an observable of `SkyTokensMessage` that can place focus on a\n * particular token or remove the active token from the list.\n */\n @Input()\n public set messageStream(value: Subject<SkyTokensMessage>) {\n this._messageStream = value;\n this.initMessageStream();\n }\n\n public get messageStream(): Subject<SkyTokensMessage> {\n return this._messageStream;\n }\n\n /**\n * Fires when users navigate through the tokens list with the `Tab` key\n * and attempt to move past the final token in the list.\n */\n @Output()\n public focusIndexOverRange = new EventEmitter<void>();\n\n /**\n * Fires when usersnavigate through the tokens list with the `Tab` key\n * and attempt to move before the first token in the list.\n */\n @Output()\n public focusIndexUnderRange = new EventEmitter<void>();\n\n /**\n * Fires when users select a token in the list. This event emits the selected token.\n */\n @Output()\n public tokenSelected = new EventEmitter<SkyTokenSelectedEventArgs>();\n\n /**\n * Fires when the tokens in the list change.\n * This event emits an array of the tokens in the updated list.\n */\n @Output()\n public tokensChange = new EventEmitter<SkyToken[]>();\n\n /**\n * @internal\n */\n public get activeIndex(): number {\n return this._activeIndex || 0;\n }\n public set activeIndex(value: number) {\n if (value >= this.tokens.length) {\n value = this.tokens.length - 1;\n this.focusIndexOverRange.emit();\n }\n\n if (value < 0) {\n value = 0;\n this.focusIndexUnderRange.emit();\n }\n\n this._activeIndex = value;\n }\n\n /**\n * internal\n */\n public trackTokenFn: (index: number, item: SkyToken) => any;\n\n @ViewChildren(SkyTokenComponent)\n private tokenComponents: QueryList<SkyTokenComponent>;\n\n private messageStreamSub: Subscription;\n private ngUnsubscribe = new Subject();\n\n private _activeIndex: number;\n private _disabled: boolean;\n private _dismissible: boolean;\n private _focusable: boolean;\n private _tokens: SkyToken[];\n private _displayWith: string;\n private _messageStream: Subject<SkyTokensMessage>;\n\n constructor(private changeDetector: ChangeDetectorRef) {\n // Angular calls the trackBy function without applying the component instance's scope.\n // Use a fat-arrow function so the current component instance's trackWith property can\n // be referenced.\n this.trackTokenFn = (_index, item) => {\n if (this.trackWith) {\n return item.value[this.trackWith];\n }\n\n return item;\n };\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public onTokenClick(token: SkyToken): void {\n if (this.disabled) {\n return;\n }\n\n this.notifyTokenSelected(token);\n }\n\n public onTokenKeyDown(event: KeyboardEvent): void {\n if (!this.disabled) {\n /* tslint:disable-next-line:switch-default */\n switch (event.key) {\n case 'Left':\n case 'ArrowLeft':\n this.messageStream.next({\n type: SkyTokensMessageType.FocusPreviousToken,\n });\n event.preventDefault();\n break;\n\n case 'Right':\n case 'ArrowRight':\n this.messageStream.next({\n type: SkyTokensMessageType.FocusNextToken,\n });\n event.preventDefault();\n break;\n }\n }\n }\n\n public selectToken(token: SkyToken): void {\n if (!this.disabled) {\n this.notifyTokenSelected(token);\n }\n }\n\n public removeToken(token: SkyToken): void {\n this.tokens = this.tokens.filter((t) => t !== token);\n this.changeDetector.detectChanges();\n }\n\n private focusPreviousToken(): void {\n this.activeIndex--;\n this.focusActiveToken();\n }\n\n private focusNextToken(): void {\n this.activeIndex++;\n this.focusActiveToken();\n }\n\n private focusLastToken(): void {\n this.activeIndex = this.tokenComponents.length - 1;\n this.focusActiveToken();\n }\n\n private focusActiveToken(): void {\n const tokenComponent = this.tokenComponents.find(\n (_comp: SkyTokenComponent, i: number) => {\n return this.activeIndex === i;\n }\n );\n\n if (tokenComponent) {\n tokenComponent.focusElement();\n }\n }\n\n private removeActiveToken(): void {\n const token = this.tokens[this.activeIndex];\n if (token) {\n this.removeToken(token);\n }\n }\n\n private initMessageStream(): void {\n if (this.messageStreamSub) {\n this.messageStreamSub.unsubscribe();\n }\n\n if (this.messageStream) {\n this.messageStreamSub = this.messageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyTokensMessage) => {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyTokensMessageType.FocusLastToken:\n this.focusLastToken();\n break;\n\n case SkyTokensMessageType.FocusActiveToken:\n this.focusActiveToken();\n break;\n\n case SkyTokensMessageType.FocusPreviousToken:\n this.focusPreviousToken();\n break;\n\n case SkyTokensMessageType.FocusNextToken:\n this.focusNextToken();\n break;\n\n case SkyTokensMessageType.RemoveActiveToken:\n this.removeActiveToken();\n break;\n }\n });\n }\n }\n\n private notifyTokenSelected(token: SkyToken): void {\n this.tokenSelected.emit({\n token,\n });\n }\n}\n","<div\n *ngIf=\"tokens\"\n class=\"sky-tokens\"\n [@blockAnimationOnLoad]\n [attr.role]=\"tokens && tokens.length ? 'list' : null\"\n>\n <sky-token\n *ngFor=\"let token of tokens; let i = index; trackBy: trackTokenFn\"\n role=\"listitem\"\n [@.disabled]=\"!trackWith\"\n [@dismiss]\n [disabled]=\"disabled\"\n [dismissible]=\"dismissible\"\n [focusable]=\"focusable\"\n (dismiss)=\"removeToken(token)\"\n (click)=\"onTokenClick(token)\"\n (keydown)=\"onTokenKeyDown($event)\"\n (keyup.enter)=\"selectToken(token); $event.preventDefault()\"\n (tokenFocus)=\"activeIndex = i\"\n >\n {{ token.value[displayWith] }}\n </sky-token>\n <div class=\"sky-tokens-content\">\n <ng-content></ng-content>\n </div>\n</div>\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { SkyI18nModule } from '@skyux/i18n';
|
|
4
|
+
import { SkyTokenComponent } from './token.component';
|
|
5
|
+
import { SkyTokensComponent } from './tokens.component';
|
|
6
|
+
import { SkyIconModule } from '../icon/icon.module';
|
|
7
|
+
import { SkyIndicatorsResourcesModule } from '../shared/sky-indicators-resources.module';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export class SkyTokensModule {
|
|
10
|
+
}
|
|
11
|
+
SkyTokensModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTokensModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12
|
+
SkyTokensModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTokensModule, declarations: [SkyTokenComponent, SkyTokensComponent], imports: [CommonModule,
|
|
13
|
+
SkyI18nModule,
|
|
14
|
+
SkyIconModule,
|
|
15
|
+
SkyIndicatorsResourcesModule], exports: [SkyTokenComponent, SkyTokensComponent] });
|
|
16
|
+
SkyTokensModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTokensModule, imports: [[
|
|
17
|
+
CommonModule,
|
|
18
|
+
SkyI18nModule,
|
|
19
|
+
SkyIconModule,
|
|
20
|
+
SkyIndicatorsResourcesModule,
|
|
21
|
+
]] });
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTokensModule, decorators: [{
|
|
23
|
+
type: NgModule,
|
|
24
|
+
args: [{
|
|
25
|
+
declarations: [SkyTokenComponent, SkyTokensComponent],
|
|
26
|
+
imports: [
|
|
27
|
+
CommonModule,
|
|
28
|
+
SkyI18nModule,
|
|
29
|
+
SkyIconModule,
|
|
30
|
+
SkyIndicatorsResourcesModule,
|
|
31
|
+
],
|
|
32
|
+
exports: [SkyTokenComponent, SkyTokensComponent],
|
|
33
|
+
}]
|
|
34
|
+
}] });
|
|
35
|
+
//# sourceMappingURL=tokens.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/tokens/tokens.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;;AAYzF,MAAM,OAAO,eAAe;;6GAAf,eAAe;8GAAf,eAAe,iBATX,iBAAiB,EAAE,kBAAkB,aAElD,YAAY;QACZ,aAAa;QACb,aAAa;QACb,4BAA4B,aAEpB,iBAAiB,EAAE,kBAAkB;8GAEpC,eAAe,YARjB;YACP,YAAY;YACZ,aAAa;YACb,aAAa;YACb,4BAA4B;SAC7B;4FAGU,eAAe;kBAV3B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;oBACrD,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,aAAa;wBACb,4BAA4B;qBAC7B;oBACD,OAAO,EAAE,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;iBACjD","sourcesContent":["import { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\n\nimport { SkyI18nModule } from '@skyux/i18n';\n\nimport { SkyTokenComponent } from './token.component';\n\nimport { SkyTokensComponent } from './tokens.component';\n\nimport { SkyIconModule } from '../icon/icon.module';\n\nimport { SkyIndicatorsResourcesModule } from '../shared/sky-indicators-resources.module';\n\n@NgModule({\n declarations: [SkyTokenComponent, SkyTokensComponent],\n imports: [\n CommonModule,\n SkyI18nModule,\n SkyIconModule,\n SkyIndicatorsResourcesModule,\n ],\n exports: [SkyTokenComponent, SkyTokensComponent],\n})\nexport class SkyTokensModule {}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-selected-event-args.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/indicators/src/lib/modules/tokens/types/token-selected-event-args.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyToken } from './token';\n\nexport interface SkyTokenSelectedEventArgs {\n /**\n * Indicates the currently selected token.\n */\n token?: SkyToken;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/indicators/src/lib/modules/tokens/types/token.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkyToken {\n /**\n * Specifies the token's contents.\n */\n value: any;\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export var SkyTokensMessageType;
|
|
2
|
+
(function (SkyTokensMessageType) {
|
|
3
|
+
/**
|
|
4
|
+
* Places focus on the last token in the list.
|
|
5
|
+
*/
|
|
6
|
+
SkyTokensMessageType[SkyTokensMessageType["FocusLastToken"] = 0] = "FocusLastToken";
|
|
7
|
+
/**
|
|
8
|
+
* Places focus on the token that is currently selected.
|
|
9
|
+
*/
|
|
10
|
+
SkyTokensMessageType[SkyTokensMessageType["FocusActiveToken"] = 1] = "FocusActiveToken";
|
|
11
|
+
/**
|
|
12
|
+
* Places focus on the token before the currently selected token.
|
|
13
|
+
*/
|
|
14
|
+
SkyTokensMessageType[SkyTokensMessageType["FocusPreviousToken"] = 2] = "FocusPreviousToken";
|
|
15
|
+
/**
|
|
16
|
+
* Places focus on the token after the currently selected token.
|
|
17
|
+
*/
|
|
18
|
+
SkyTokensMessageType[SkyTokensMessageType["FocusNextToken"] = 3] = "FocusNextToken";
|
|
19
|
+
/**
|
|
20
|
+
* Removes the token that is currently selected from the list of tokens.
|
|
21
|
+
*/
|
|
22
|
+
SkyTokensMessageType[SkyTokensMessageType["RemoveActiveToken"] = 4] = "RemoveActiveToken";
|
|
23
|
+
})(SkyTokensMessageType || (SkyTokensMessageType = {}));
|
|
24
|
+
//# sourceMappingURL=tokens-message-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens-message-type.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/indicators/src/lib/modules/tokens/types/tokens-message-type.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBAyBX;AAzBD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,mFAAkB,CAAA;IAElB;;OAEG;IACH,uFAAoB,CAAA;IAEpB;;OAEG;IACH,2FAAsB,CAAA;IAEtB;;OAEG;IACH,mFAAkB,CAAA;IAElB;;OAEG;IACH,yFAAqB,CAAA;AACvB,CAAC,EAzBW,oBAAoB,KAApB,oBAAoB,QAyB/B","sourcesContent":["export enum SkyTokensMessageType {\n /**\n * Places focus on the last token in the list.\n */\n FocusLastToken = 0,\n\n /**\n * Places focus on the token that is currently selected.\n */\n FocusActiveToken = 1,\n\n /**\n * Places focus on the token before the currently selected token.\n */\n FocusPreviousToken = 2,\n\n /**\n * Places focus on the token after the currently selected token.\n */\n FocusNextToken = 3,\n\n /**\n * Removes the token that is currently selected from the list of tokens.\n */\n RemoveActiveToken = 4,\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens-message.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/indicators/src/lib/modules/tokens/types/tokens-message.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyTokensMessageType } from './tokens-message-type';\n\nexport interface SkyTokensMessage {\n /**\n * Specifies the type of message.\n */\n type?: SkyTokensMessageType;\n}\n"]}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Injectable, RendererFactory2, } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
// Need to add the following to classes which contain static methods.
|
|
4
|
+
// See: https://github.com/ng-packagr/ng-packagr/issues/641
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* @dynamic
|
|
8
|
+
*/
|
|
9
|
+
export class SkyWaitAdapterService {
|
|
10
|
+
constructor(rendererFactory) {
|
|
11
|
+
this.rendererFactory = rendererFactory;
|
|
12
|
+
this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
|
|
13
|
+
}
|
|
14
|
+
ngOnDestroy() {
|
|
15
|
+
this.clearListeners();
|
|
16
|
+
}
|
|
17
|
+
setWaitBounds(waitEl) {
|
|
18
|
+
this.renderer.setStyle(waitEl.nativeElement.parentElement, 'position', 'relative');
|
|
19
|
+
}
|
|
20
|
+
removeWaitBounds(waitEl) {
|
|
21
|
+
this.renderer.removeStyle(waitEl.nativeElement.parentElement, 'position');
|
|
22
|
+
}
|
|
23
|
+
setBusyState(waitEl, isFullPage, isWaiting, isNonBlocking = false, waitComponentId) {
|
|
24
|
+
const busyEl = isFullPage
|
|
25
|
+
? document.body
|
|
26
|
+
: waitEl.nativeElement.parentElement;
|
|
27
|
+
if (!isNonBlocking) {
|
|
28
|
+
if (isWaiting) {
|
|
29
|
+
this.renderer.setAttribute(busyEl, 'aria-busy', 'true');
|
|
30
|
+
// Remove focus from page when full page blocking wait
|
|
31
|
+
if (isFullPage || busyEl.contains(document.activeElement)) {
|
|
32
|
+
this.clearDocumentFocus();
|
|
33
|
+
}
|
|
34
|
+
if (isFullPage) {
|
|
35
|
+
SkyWaitAdapterService.isPageWaitActive = true;
|
|
36
|
+
const endListenerFunc = this.renderer.listen(document.body, 'keydown', (event) => {
|
|
37
|
+
/*istanbul ignore else */
|
|
38
|
+
if (event.key) {
|
|
39
|
+
/* istanbul ignore else */
|
|
40
|
+
if (event.key.toLowerCase() === 'tab') {
|
|
41
|
+
event.target.blur();
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
event.stopImmediatePropagation();
|
|
45
|
+
this.clearDocumentFocus();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
SkyWaitAdapterService.busyElements[waitComponentId] = {
|
|
50
|
+
listener: endListenerFunc,
|
|
51
|
+
busyEl: undefined,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
const endListenerFunc = this.renderer.listen(busyEl, 'focusin', (event) => {
|
|
56
|
+
/* istanbul ignore else */
|
|
57
|
+
if (!isNonBlocking) {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
event.stopImmediatePropagation();
|
|
61
|
+
if (SkyWaitAdapterService.isPageWaitActive) {
|
|
62
|
+
this.clearDocumentFocus();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
// Propagate tab navigation if attempted into waited element
|
|
66
|
+
const target = event.target;
|
|
67
|
+
target.blur();
|
|
68
|
+
this.focusNextElement(target, this.isShift(event), busyEl);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
SkyWaitAdapterService.busyElements[waitComponentId] = {
|
|
73
|
+
listener: endListenerFunc,
|
|
74
|
+
busyEl: busyEl,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.renderer.removeAttribute(busyEl, 'aria-busy');
|
|
80
|
+
if (isFullPage) {
|
|
81
|
+
SkyWaitAdapterService.isPageWaitActive = false;
|
|
82
|
+
}
|
|
83
|
+
if (waitComponentId in SkyWaitAdapterService.busyElements) {
|
|
84
|
+
SkyWaitAdapterService.busyElements[waitComponentId].listener();
|
|
85
|
+
delete SkyWaitAdapterService.busyElements[waitComponentId];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
focusNextElement(targetElement, shiftKey, busyEl) {
|
|
91
|
+
const focussable = this.getFocussableElements();
|
|
92
|
+
// If shift tab, go in the other direction
|
|
93
|
+
const modifier = shiftKey ? -1 : 1;
|
|
94
|
+
// Find the next navigable element that isn't waiting
|
|
95
|
+
const startingIndex = focussable.indexOf(targetElement);
|
|
96
|
+
let curIndex = startingIndex + modifier;
|
|
97
|
+
while (focussable[curIndex] &&
|
|
98
|
+
this.isElementBusyOrHidden(focussable[curIndex])) {
|
|
99
|
+
curIndex += modifier;
|
|
100
|
+
}
|
|
101
|
+
if (focussable[curIndex] &&
|
|
102
|
+
!this.isElementBusyOrHidden(focussable[curIndex])) {
|
|
103
|
+
focussable[curIndex].focus();
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
// Try wrapping the navigation
|
|
107
|
+
/* istanbul ignore next */
|
|
108
|
+
/* sanity check */
|
|
109
|
+
curIndex = modifier > 0 ? 0 : focussable.length - 1;
|
|
110
|
+
while (curIndex !== startingIndex &&
|
|
111
|
+
focussable[curIndex] &&
|
|
112
|
+
this.isElementBusyOrHidden(focussable[curIndex])) {
|
|
113
|
+
/* istanbul ignore next */
|
|
114
|
+
/* sanity check */
|
|
115
|
+
curIndex += modifier;
|
|
116
|
+
}
|
|
117
|
+
/* istanbul ignore else */
|
|
118
|
+
/* sanity check */
|
|
119
|
+
if (focussable[curIndex] &&
|
|
120
|
+
!this.isElementBusyOrHidden(focussable[curIndex])) {
|
|
121
|
+
focussable[curIndex].focus();
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
// No valid target, wipe focus
|
|
125
|
+
this.clearDocumentFocus();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// clear focussableElements list
|
|
129
|
+
this.focussableElements = undefined;
|
|
130
|
+
}
|
|
131
|
+
isShift(event) {
|
|
132
|
+
// Determine if shift+tab was used based on element order
|
|
133
|
+
const elements = this.getFocussableElements().filter((elem) => !this.isElementHidden(elem));
|
|
134
|
+
const previousInd = elements.indexOf(event.relatedTarget);
|
|
135
|
+
const currentInd = elements.indexOf(event.target);
|
|
136
|
+
return (previousInd === currentInd + 1 ||
|
|
137
|
+
(previousInd === 0 && currentInd === elements.length - 1) ||
|
|
138
|
+
previousInd > currentInd ||
|
|
139
|
+
!event.relatedTarget);
|
|
140
|
+
}
|
|
141
|
+
isElementHidden(element) {
|
|
142
|
+
const style = window.getComputedStyle(element);
|
|
143
|
+
return style.display === 'none' || style.visibility === 'hidden';
|
|
144
|
+
}
|
|
145
|
+
isElementBusyOrHidden(element) {
|
|
146
|
+
if (this.isElementHidden(element)) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
for (const key of Object.keys(SkyWaitAdapterService.busyElements)) {
|
|
150
|
+
const parentElement = SkyWaitAdapterService.busyElements[key].busyEl;
|
|
151
|
+
if (parentElement && parentElement.contains(element)) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
clearDocumentFocus() {
|
|
158
|
+
/* istanbul ignore else */
|
|
159
|
+
if (document.activeElement && document.activeElement.blur) {
|
|
160
|
+
document.activeElement.blur();
|
|
161
|
+
}
|
|
162
|
+
document.body.focus();
|
|
163
|
+
}
|
|
164
|
+
getFocussableElements() {
|
|
165
|
+
// Keep this cached so we can reduce querys
|
|
166
|
+
if (this.focussableElements) {
|
|
167
|
+
return this.focussableElements;
|
|
168
|
+
}
|
|
169
|
+
// Select all possible focussable elements
|
|
170
|
+
const focussableElements = 'a[href], ' +
|
|
171
|
+
'area[href], ' +
|
|
172
|
+
"input:not([disabled]):not([tabindex='-1']), " +
|
|
173
|
+
"button:not([disabled]):not([tabindex='-1']), " +
|
|
174
|
+
"select:not([disabled]):not([tabindex='-1']), " +
|
|
175
|
+
"textarea:not([disabled]):not([tabindex='-1']), " +
|
|
176
|
+
'iframe, object, embed, ' +
|
|
177
|
+
"*[tabindex]:not([tabindex='-1']), " +
|
|
178
|
+
'*[contenteditable=true]';
|
|
179
|
+
this.focussableElements = Array.prototype.filter.call(document.body.querySelectorAll(focussableElements), (element) => {
|
|
180
|
+
return (element.offsetWidth > 0 ||
|
|
181
|
+
element.offsetHeight > 0 ||
|
|
182
|
+
element === document.activeElement);
|
|
183
|
+
});
|
|
184
|
+
return this.focussableElements;
|
|
185
|
+
}
|
|
186
|
+
clearListeners() {
|
|
187
|
+
SkyWaitAdapterService.isPageWaitActive = false;
|
|
188
|
+
for (const key of Object.keys(SkyWaitAdapterService.busyElements)) {
|
|
189
|
+
SkyWaitAdapterService.busyElements[key].listener();
|
|
190
|
+
delete SkyWaitAdapterService.busyElements[key];
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
SkyWaitAdapterService.isPageWaitActive = false;
|
|
195
|
+
SkyWaitAdapterService.busyElements = {};
|
|
196
|
+
SkyWaitAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitAdapterService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
197
|
+
SkyWaitAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitAdapterService });
|
|
198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitAdapterService, decorators: [{
|
|
199
|
+
type: Injectable
|
|
200
|
+
}], ctorParameters: function () { return [{ type: i0.RendererFactory2 }]; } });
|
|
201
|
+
//# sourceMappingURL=wait-adapter.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/wait/wait-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAGV,gBAAgB,GACjB,MAAM,eAAe,CAAC;;AAEvB,qEAAqE;AACrE,2DAA2D;AAC3D;;;GAGG;AAEH,MAAM,OAAO,qBAAqB;IAUhC,YAAoB,eAAiC;QAAjC,oBAAe,GAAf,eAAe,CAAkB;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC5E,CAAC;IAEM,WAAW;QAChB,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAEM,aAAa,CAAC,MAAkB;QACrC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CACpB,MAAM,CAAC,aAAa,CAAC,aAAa,EAClC,UAAU,EACV,UAAU,CACX,CAAC;IACJ,CAAC;IAEM,gBAAgB,CAAC,MAAkB;QACxC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAC5E,CAAC;IAEM,YAAY,CACjB,MAAkB,EAClB,UAAmB,EACnB,SAAkB,EAClB,aAAa,GAAG,KAAK,EACrB,eAAwB;QAExB,MAAM,MAAM,GAAG,UAAU;YACvB,CAAC,CAAC,QAAQ,CAAC,IAAI;YACf,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC;QAEvC,IAAI,CAAC,aAAa,EAAE;YAClB,IAAI,SAAS,EAAE;gBACb,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;gBAExD,sDAAsD;gBACtD,IAAI,UAAU,IAAI,MAAM,CAAC,Q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,yBAAyB;YACzB,oCAAoC;YACpC,yBAAyB,CAAC;QAE5B,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CACnD,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAClD,CAAC,OAAY,EAAE,EAAE;YACf,OAAO,CACL,OAAO,CAAC,WAAW,GAAG,CAAC;gBACvB,OAAO,CAAC,YAAY,GAAG,CAAC;gBACxB,OAAO,KAAK,QAAQ,CAAC,aAAa,CACnC,CAAC;QACJ,CAAC,CACF,CAAC;QACF,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAEO,cAAc;QACpB,qBAAqB,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC/C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE;YACjE,qBAAqB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;YACnD,OAAO,qBAAqB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;SAChD;IACH,CAAC;;AA3Pc,sCAAgB,GAAG,KAAK,CAAC;AACzB,kCAAY,GAEvB,EAAE,CAAC;mHAJI,qBAAqB;uHAArB,qBAAqB;4FAArB,qBAAqB;kBADjC,UAAU","sourcesContent":["import {\n ElementRef,\n Injectable,\n OnDestroy,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\n\n// Need to add the following to classes which contain static methods.\n// See: https://github.com/ng-packagr/ng-packagr/issues/641\n/**\n * @internal\n * @dynamic\n */\n@Injectable()\nexport class SkyWaitAdapterService implements OnDestroy {\n private static isPageWaitActive = false;\n private static busyElements: {\n [key: string]: { busyEl: HTMLElement; listener: any };\n } = {};\n\n private focussableElements: HTMLElement[];\n\n private renderer: Renderer2;\n\n constructor(private rendererFactory: RendererFactory2) {\n this.renderer = this.rendererFactory.createRenderer(undefined, undefined);\n }\n\n public ngOnDestroy(): void {\n this.clearListeners();\n }\n\n public setWaitBounds(waitEl: ElementRef): void {\n this.renderer.setStyle(\n waitEl.nativeElement.parentElement,\n 'position',\n 'relative'\n );\n }\n\n public removeWaitBounds(waitEl: ElementRef): void {\n this.renderer.removeStyle(waitEl.nativeElement.parentElement, 'position');\n }\n\n public setBusyState(\n waitEl: ElementRef,\n isFullPage: boolean,\n isWaiting: boolean,\n isNonBlocking = false,\n waitComponentId?: string\n ): void {\n const busyEl = isFullPage\n ? document.body\n : waitEl.nativeElement.parentElement;\n\n if (!isNonBlocking) {\n if (isWaiting) {\n this.renderer.setAttribute(busyEl, 'aria-busy', 'true');\n\n // Remove focus from page when full page blocking wait\n if (isFullPage || busyEl.contains(document.activeElement)) {\n this.clearDocumentFocus();\n }\n\n if (isFullPage) {\n SkyWaitAdapterService.isPageWaitActive = true;\n const endListenerFunc = this.renderer.listen(\n document.body,\n 'keydown',\n (event: KeyboardEvent) => {\n /*istanbul ignore else */\n if (event.key) {\n /* istanbul ignore else */\n if (event.key.toLowerCase() === 'tab') {\n (event.target as any).blur();\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n this.clearDocumentFocus();\n }\n }\n }\n );\n SkyWaitAdapterService.busyElements[waitComponentId] = {\n listener: endListenerFunc,\n busyEl: undefined,\n };\n } else {\n const endListenerFunc = this.renderer.listen(\n busyEl,\n 'focusin',\n (event: KeyboardEvent) => {\n /* istanbul ignore else */\n if (!isNonBlocking) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n\n if (SkyWaitAdapterService.isPageWaitActive) {\n this.clearDocumentFocus();\n } else {\n // Propagate tab navigation if attempted into waited element\n const target: any = event.target;\n target.blur();\n this.focusNextElement(target, this.isShift(event), busyEl);\n }\n }\n }\n );\n SkyWaitAdapterService.busyElements[waitComponentId] = {\n listener: endListenerFunc,\n busyEl: busyEl,\n };\n }\n } else {\n this.renderer.removeAttribute(busyEl, 'aria-busy');\n\n if (isFullPage) {\n SkyWaitAdapterService.isPageWaitActive = false;\n }\n if (waitComponentId in SkyWaitAdapterService.busyElements) {\n SkyWaitAdapterService.busyElements[waitComponentId].listener();\n delete SkyWaitAdapterService.busyElements[waitComponentId];\n }\n }\n }\n }\n\n private focusNextElement(\n targetElement: HTMLElement,\n shiftKey: boolean,\n busyEl: Element\n ): void {\n const focussable = this.getFocussableElements();\n\n // If shift tab, go in the other direction\n const modifier = shiftKey ? -1 : 1;\n\n // Find the next navigable element that isn't waiting\n const startingIndex = focussable.indexOf(targetElement);\n let curIndex = startingIndex + modifier;\n while (\n focussable[curIndex] &&\n this.isElementBusyOrHidden(focussable[curIndex])\n ) {\n curIndex += modifier;\n }\n\n if (\n focussable[curIndex] &&\n !this.isElementBusyOrHidden(focussable[curIndex])\n ) {\n focussable[curIndex].focus();\n } else {\n // Try wrapping the navigation\n /* istanbul ignore next */\n /* sanity check */\n curIndex = modifier > 0 ? 0 : focussable.length - 1;\n while (\n curIndex !== startingIndex &&\n focussable[curIndex] &&\n this.isElementBusyOrHidden(focussable[curIndex])\n ) {\n /* istanbul ignore next */\n /* sanity check */\n curIndex += modifier;\n }\n\n /* istanbul ignore else */\n /* sanity check */\n if (\n focussable[curIndex] &&\n !this.isElementBusyOrHidden(focussable[curIndex])\n ) {\n focussable[curIndex].focus();\n } else {\n // No valid target, wipe focus\n this.clearDocumentFocus();\n }\n }\n\n // clear focussableElements list\n this.focussableElements = undefined;\n }\n\n private isShift(event: Event): boolean {\n // Determine if shift+tab was used based on element order\n const elements = this.getFocussableElements().filter(\n (elem) => !this.isElementHidden(elem)\n );\n\n const previousInd = elements.indexOf((event as any).relatedTarget);\n const currentInd = elements.indexOf(event.target as HTMLElement);\n\n return (\n previousInd === currentInd + 1 ||\n (previousInd === 0 && currentInd === elements.length - 1) ||\n previousInd > currentInd ||\n !(event as any).relatedTarget\n );\n }\n\n private isElementHidden(element: any): boolean {\n const style = window.getComputedStyle(element);\n return style.display === 'none' || style.visibility === 'hidden';\n }\n\n private isElementBusyOrHidden(element: any): boolean {\n if (this.isElementHidden(element)) {\n return true;\n }\n\n for (const key of Object.keys(SkyWaitAdapterService.busyElements)) {\n const parentElement = SkyWaitAdapterService.busyElements[key].busyEl;\n if (parentElement && parentElement.contains(element)) {\n return true;\n }\n }\n return false;\n }\n\n private clearDocumentFocus(): void {\n /* istanbul ignore else */\n if (document.activeElement && (document.activeElement as any).blur) {\n (document.activeElement as any).blur();\n }\n document.body.focus();\n }\n\n private getFocussableElements(): HTMLElement[] {\n // Keep this cached so we can reduce querys\n if (this.focussableElements) {\n return this.focussableElements;\n }\n\n // Select all possible focussable elements\n const focussableElements =\n 'a[href], ' +\n 'area[href], ' +\n \"input:not([disabled]):not([tabindex='-1']), \" +\n \"button:not([disabled]):not([tabindex='-1']), \" +\n \"select:not([disabled]):not([tabindex='-1']), \" +\n \"textarea:not([disabled]):not([tabindex='-1']), \" +\n 'iframe, object, embed, ' +\n \"*[tabindex]:not([tabindex='-1']), \" +\n '*[contenteditable=true]';\n\n this.focussableElements = Array.prototype.filter.call(\n document.body.querySelectorAll(focussableElements),\n (element: any) => {\n return (\n element.offsetWidth > 0 ||\n element.offsetHeight > 0 ||\n element === document.activeElement\n );\n }\n );\n return this.focussableElements;\n }\n\n private clearListeners(): void {\n SkyWaitAdapterService.isPageWaitActive = false;\n for (const key of Object.keys(SkyWaitAdapterService.busyElements)) {\n SkyWaitAdapterService.busyElements[key].listener();\n delete SkyWaitAdapterService.busyElements[key];\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export class SkyWaitPageAdapterService {
|
|
7
|
+
addPageWaitEl() {
|
|
8
|
+
document.body.appendChild(document.createElement('sky-wait-page'));
|
|
9
|
+
}
|
|
10
|
+
removePageWaitEl() {
|
|
11
|
+
const waitEl = document.querySelector('sky-wait-page');
|
|
12
|
+
if (waitEl) {
|
|
13
|
+
document.body.removeChild(waitEl);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
SkyWaitPageAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitPageAdapterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
18
|
+
SkyWaitPageAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitPageAdapterService, providedIn: 'root' });
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitPageAdapterService, decorators: [{
|
|
20
|
+
type: Injectable,
|
|
21
|
+
args: [{
|
|
22
|
+
providedIn: 'root',
|
|
23
|
+
}]
|
|
24
|
+
}] });
|
|
25
|
+
//# sourceMappingURL=wait-page-adapter.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait-page-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/wait/wait-page-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAE3C;;GAEG;AAIH,MAAM,OAAO,yBAAyB;IAC7B,aAAa;QAClB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;IACrE,CAAC;IAEM,gBAAgB;QACrB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QACvD,IAAI,MAAM,EAAE;YACV,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACnC;IACH,CAAC;;uHAVU,yBAAyB;2HAAzB,yBAAyB,cAFxB,MAAM;4FAEP,yBAAyB;kBAHrC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable } from '@angular/core';\n\n/**\n * @internal\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyWaitPageAdapterService {\n public addPageWaitEl(): void {\n document.body.appendChild(document.createElement('sky-wait-page'));\n }\n\n public removePageWaitEl(): void {\n const waitEl = document.querySelector('sky-wait-page');\n if (waitEl) {\n document.body.removeChild(waitEl);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "./wait.component";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export class SkyWaitPageComponent {
|
|
8
|
+
}
|
|
9
|
+
SkyWaitPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10
|
+
SkyWaitPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyWaitPageComponent, selector: "sky-wait-page", inputs: { hasBlockingWait: "hasBlockingWait", hasNonBlockingWait: "hasNonBlockingWait" }, ngImport: i0, template: "<div class=\"sky-wait-page\">\n <sky-wait\n [isFullPage]=\"true\"\n [isNonBlocking]=\"true\"\n [isWaiting]=\"hasNonBlockingWait\"\n >\n </sky-wait>\n <sky-wait [isFullPage]=\"true\" [isWaiting]=\"hasBlockingWait\"> </sky-wait>\n</div>\n", styles: [".sky-wait-page ::ng-deep .sky-wait-mask-loading-fixed{z-index:2000}\n"], components: [{ type: i1.SkyWaitComponent, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking"] }] });
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitPageComponent, decorators: [{
|
|
12
|
+
type: Component,
|
|
13
|
+
args: [{
|
|
14
|
+
selector: 'sky-wait-page',
|
|
15
|
+
templateUrl: './wait-page.component.html',
|
|
16
|
+
styleUrls: ['./wait-page.component.scss'],
|
|
17
|
+
}]
|
|
18
|
+
}], propDecorators: { hasBlockingWait: [{
|
|
19
|
+
type: Input
|
|
20
|
+
}], hasNonBlockingWait: [{
|
|
21
|
+
type: Input
|
|
22
|
+
}] } });
|
|
23
|
+
//# sourceMappingURL=wait-page.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait-page.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/wait/wait-page.component.ts","../../../../../../../../libs/components/indicators/src/lib/modules/wait/wait-page.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;AAEjD;;GAEG;AAMH,MAAM,OAAO,oBAAoB;;kHAApB,oBAAoB;sGAApB,oBAAoB,+ICVjC,2PASA;4FDCa,oBAAoB;kBALhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,eAAe;oBACzB,WAAW,EAAE,4BAA4B;oBACzC,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C;8BAGQ,eAAe;sBADrB,KAAK;gBAIC,kBAAkB;sBADxB,KAAK","sourcesContent":["import { Component, Input } from '@angular/core';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-wait-page',\n templateUrl: './wait-page.component.html',\n styleUrls: ['./wait-page.component.scss'],\n})\nexport class SkyWaitPageComponent {\n @Input()\n public hasBlockingWait: boolean;\n\n @Input()\n public hasNonBlockingWait: boolean;\n}\n","<div class=\"sky-wait-page\">\n <sky-wait\n [isFullPage]=\"true\"\n [isNonBlocking]=\"true\"\n [isWaiting]=\"hasNonBlockingWait\"\n >\n </sky-wait>\n <sky-wait [isFullPage]=\"true\" [isWaiting]=\"hasBlockingWait\"> </sky-wait>\n</div>\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Component, ElementRef, Input, Optional } from '@angular/core';
|
|
2
|
+
import { SkyLibResourcesService } from '@skyux/i18n';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import { SkyWaitAdapterService } from './wait-adapter.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "./wait-adapter.service";
|
|
7
|
+
import * as i2 from "@skyux/i18n";
|
|
8
|
+
import * as i3 from "@angular/common";
|
|
9
|
+
let nextId = 0;
|
|
10
|
+
export class SkyWaitComponent {
|
|
11
|
+
constructor(elRef, adapterService, resourceService) {
|
|
12
|
+
this.elRef = elRef;
|
|
13
|
+
this.adapterService = adapterService;
|
|
14
|
+
this.resourceService = resourceService;
|
|
15
|
+
this.ariaLabelStream = new BehaviorSubject('');
|
|
16
|
+
this.id = `sky-wait-${++nextId}`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* When set to `true`, wait indication appears on the parent element of the `sky-wait` component.
|
|
20
|
+
*/
|
|
21
|
+
set isWaiting(value) {
|
|
22
|
+
if (value && !this._isFullPage) {
|
|
23
|
+
this.adapterService.setWaitBounds(this.elRef);
|
|
24
|
+
}
|
|
25
|
+
else if (!value && !this._isFullPage) {
|
|
26
|
+
this.adapterService.removeWaitBounds(this.elRef);
|
|
27
|
+
}
|
|
28
|
+
this.adapterService.setBusyState(this.elRef, this.isFullPage, value, this.isNonBlocking, this.id);
|
|
29
|
+
this._isWaiting = value;
|
|
30
|
+
}
|
|
31
|
+
get isWaiting() {
|
|
32
|
+
return this._isWaiting;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* When set to `true`, wait indication appears on the page level instead of the
|
|
36
|
+
* parent element level. We recommend that you use the `beginBlockingPageWait` or
|
|
37
|
+
* `beginNonBlockingPageWait` functions of the `SkyWaitService` instead of setting this
|
|
38
|
+
* on the component level.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
set isFullPage(value) {
|
|
42
|
+
/* istanbul ignore else: untestable */
|
|
43
|
+
if (value) {
|
|
44
|
+
this.adapterService.removeWaitBounds(this.elRef);
|
|
45
|
+
}
|
|
46
|
+
else if (!value && this._isWaiting) {
|
|
47
|
+
this.adapterService.setWaitBounds(this.elRef);
|
|
48
|
+
}
|
|
49
|
+
this._isFullPage = value;
|
|
50
|
+
}
|
|
51
|
+
get isFullPage() {
|
|
52
|
+
return this._isFullPage;
|
|
53
|
+
}
|
|
54
|
+
ngOnInit() {
|
|
55
|
+
this.publishAriaLabel();
|
|
56
|
+
}
|
|
57
|
+
publishAriaLabel() {
|
|
58
|
+
if (this.ariaLabel) {
|
|
59
|
+
this.ariaLabelStream.next(this.ariaLabel);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
/* istanbul ignore else */
|
|
63
|
+
if (this.resourceService) {
|
|
64
|
+
const type = this.isFullPage ? '_page' : '';
|
|
65
|
+
const blocking = this.isNonBlocking ? '' : '_blocking';
|
|
66
|
+
const key = `skyux_wait${type}${blocking}_aria_alt_text`;
|
|
67
|
+
this.resourceService.getString(key).subscribe((value) => {
|
|
68
|
+
this.ariaLabelStream.next(value);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
SkyWaitComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitComponent, deps: [{ token: i0.ElementRef }, { token: i1.SkyWaitAdapterService }, { token: i2.SkyLibResourcesService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
74
|
+
SkyWaitComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyWaitComponent, selector: "sky-wait", inputs: { ariaLabel: "ariaLabel", isWaiting: "isWaiting", isFullPage: "isFullPage", isNonBlocking: "isNonBlocking" }, providers: [SkyWaitAdapterService], ngImport: i0, template: "<div class=\"sky-wait-container\">\n <div\n *ngIf=\"isWaiting\"\n class=\"sky-wait-mask\"\n [attr.aria-label]=\"ariaLabelStream | async\"\n [ngClass]=\"{\n 'sky-wait-mask-loading-fixed': isFullPage,\n 'sky-wait-mask-loading-non-blocking': isNonBlocking,\n 'sky-wait-mask-loading-blocking': !isNonBlocking\n }\"\n >\n <div class=\"sky-wait\">\n <div class=\"sky-wait-double-bounce1\"></div>\n <div class=\"sky-wait-double-bounce2\"></div>\n </div>\n </div>\n</div>\n", styles: [".sky-wait-mask-loading-blocking{margin:auto;position:absolute;top:0;right:0;left:0;bottom:0;background-color:#ffffffb3;z-index:1000}.sky-wait-mask-loading-fixed{position:fixed}.sky-wait{width:50px;height:50px;margin-top:-25px;margin-left:-25px;position:absolute;top:50%;left:50%}.sky-wait-mask-loading-non-blocking{bottom:0}.sky-wait-mask-loading-non-blocking .sky-wait{top:auto;right:auto;bottom:0;left:0;margin-left:auto;margin-right:auto}.sky-wait-double-bounce1,.sky-wait-double-bounce2{width:100%;height:100%;border-radius:50%;background-color:#72bf44;opacity:.6;position:absolute;top:0;left:0;animation:sk-bounce 2s infinite ease-in-out}.sky-wait-double-bounce2{animation-delay:-1s}@keyframes sk-bounce{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}.sky-wait-container.sky-wait-active{position:relative}\n"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i3.AsyncPipe } });
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitComponent, decorators: [{
|
|
76
|
+
type: Component,
|
|
77
|
+
args: [{
|
|
78
|
+
selector: 'sky-wait',
|
|
79
|
+
templateUrl: './wait.component.html',
|
|
80
|
+
styleUrls: ['./wait.component.scss'],
|
|
81
|
+
providers: [SkyWaitAdapterService],
|
|
82
|
+
}]
|
|
83
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.SkyWaitAdapterService }, { type: i2.SkyLibResourcesService, decorators: [{
|
|
84
|
+
type: Optional
|
|
85
|
+
}] }]; }, propDecorators: { ariaLabel: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], isWaiting: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], isFullPage: [{
|
|
90
|
+
type: Input
|
|
91
|
+
}], isNonBlocking: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}] } });
|
|
94
|
+
//# sourceMappingURL=wait.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/wait/wait.component.ts","../../../../../../../../libs/components/indicators/src/lib/modules/wait/wait.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAU,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;;;;;AAE/D,IAAI,MAAM,GAAG,CAAC,CAAC;AAQf,MAAM,OAAO,gBAAgB;IA2E3B,YACU,KAAiB,EACjB,cAAqC,EACzB,eAAuC;QAFnD,UAAK,GAAL,KAAK,CAAY;QACjB,mBAAc,GAAd,cAAc,CAAuB;QACzB,oBAAe,GAAf,eAAe,CAAwB;QATtD,oBAAe,GAAG,IAAI,eAAe,CAAS,EAAE,CAAC,CAAC;QAEjD,OAAE,GAAG,YAAY,EAAE,MAAM,EAAE,CAAC;IAQjC,CAAC;IAnEJ;;OAEG;IACH,IACW,SAAS,CAAC,KAAc;QACjC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAC9B,IAA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,CAAC,EAAE,CAAC;YAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YACvD,MAAM,GAAG,GAAG,aAAa,IAAI,GAAG,QAAQ,gBAAgB,CAAC;YACzD,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,KAAa,EAAE,EAAE;gBAC9D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;;8GApGU,gBAAgB;kGAAhB,gBAAgB,yJAFhB,CAAC,qBAAqB,CAAC,0BCdpC,ogBAiBA;4FDDa,gBAAgB;kBAN5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,UAAU;oBACpB,WAAW,EAAE,uBAAuB;oBACpC,SAAS,EAAE,CAAC,uBAAuB,CAAC;oBACpC,SAAS,EAAE,CAAC,qBAAqB,CAAC;iBACnC;;0BA+EI,QAAQ;4CApEJ,SAAS;sBADf,KAAK;gBAOK,SAAS;sBADnB,KAAK;gBA+BK,UAAU;sBADpB,KAAK;gBAsBC,aAAa;sBADnB,KAAK","sourcesContent":["import { Component, ElementRef, Input, OnInit, Optional } from '@angular/core';\n\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { BehaviorSubject } from 'rxjs';\n\nimport { SkyWaitAdapterService } from './wait-adapter.service';\n\nlet nextId = 0;\n\n@Component({\n selector: 'sky-wait',\n templateUrl: './wait.component.html',\n styleUrls: ['./wait.component.scss'],\n providers: [SkyWaitAdapterService],\n})\nexport class SkyWaitComponent implements OnInit {\n /**\n * Specifies an ARIA label for the wait icon while an element or page loads.\n * This sets the icon's `aria-label` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * The default value varies based on whether the wait is for an element or a page\n * and whether it is a blocking wait. For example, the default for a page-blocking\n * wait is \"Page loading. Please wait.\"\n */\n @Input()\n public ariaLabel: string;\n\n /**\n * When set to `true`, wait indication appears on the parent element of the `sky-wait` component.\n */\n @Input()\n public set isWaiting(value: boolean) {\n if (value && !this._isFullPage) {\n this.adapterService.setWaitBounds(this.elRef);\n } else if (!value && !this._isFullPage) {\n this.adapterService.removeWaitBounds(this.elRef);\n }\n\n this.adapterService.setBusyState(\n this.elRef,\n this.isFullPage,\n value,\n this.isNonBlocking,\n this.id\n );\n\n this._isWaiting = value;\n }\n\n public get isWaiting(): boolean {\n return this._isWaiting;\n }\n\n /**\n * When set to `true`, wait indication appears on the page level instead of the\n * parent element level. We recommend that you use the `beginBlockingPageWait` or\n * `beginNonBlockingPageWait` functions of the `SkyWaitService` instead of setting this\n * on the component level.\n * @default false\n */\n @Input()\n public set isFullPage(value: boolean) {\n /* istanbul ignore else: untestable */\n if (value) {\n this.adapterService.removeWaitBounds(this.elRef);\n } else if (!value && this._isWaiting) {\n this.adapterService.setWaitBounds(this.elRef);\n }\n\n this._isFullPage = value;\n }\n\n public get isFullPage(): boolean {\n return this._isFullPage;\n }\n\n /**\n * When set to `true`, wait indication appears in the bottom left corner of the element\n * instead of hiding the entire parent element.\n * @default false\n */\n @Input()\n public isNonBlocking: boolean;\n\n public ariaLabelStream = new BehaviorSubject<string>('');\n\n private id = `sky-wait-${++nextId}`;\n private _isFullPage: boolean;\n private _isWaiting: boolean;\n\n constructor(\n private elRef: ElementRef,\n private adapterService: SkyWaitAdapterService,\n @Optional() private resourceService: SkyLibResourcesService\n ) {}\n\n public ngOnInit(): void {\n this.publishAriaLabel();\n }\n\n private publishAriaLabel(): void {\n if (this.ariaLabel) {\n this.ariaLabelStream.next(this.ariaLabel);\n return;\n }\n\n /* istanbul ignore else */\n if (this.resourceService) {\n const type = this.isFullPage ? '_page' : '';\n const blocking = this.isNonBlocking ? '' : '_blocking';\n const key = `skyux_wait${type}${blocking}_aria_alt_text`;\n this.resourceService.getString(key).subscribe((value: string) => {\n this.ariaLabelStream.next(value);\n });\n }\n }\n}\n","<div class=\"sky-wait-container\">\n <div\n *ngIf=\"isWaiting\"\n class=\"sky-wait-mask\"\n [attr.aria-label]=\"ariaLabelStream | async\"\n [ngClass]=\"{\n 'sky-wait-mask-loading-fixed': isFullPage,\n 'sky-wait-mask-loading-non-blocking': isNonBlocking,\n 'sky-wait-mask-loading-blocking': !isNonBlocking\n }\"\n >\n <div class=\"sky-wait\">\n <div class=\"sky-wait-double-bounce1\"></div>\n <div class=\"sky-wait-double-bounce2\"></div>\n </div>\n </div>\n</div>\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { SkyI18nModule } from '@skyux/i18n';
|
|
4
|
+
import { SkyIndicatorsResourcesModule } from '../shared/sky-indicators-resources.module';
|
|
5
|
+
import { SkyWaitComponent } from './wait.component';
|
|
6
|
+
import { SkyWaitPageComponent } from './wait-page.component';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export class SkyWaitModule {
|
|
9
|
+
}
|
|
10
|
+
SkyWaitModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11
|
+
SkyWaitModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitModule, declarations: [SkyWaitComponent, SkyWaitPageComponent], imports: [CommonModule, SkyI18nModule, SkyIndicatorsResourcesModule], exports: [SkyWaitComponent] });
|
|
12
|
+
SkyWaitModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitModule, imports: [[CommonModule, SkyI18nModule, SkyIndicatorsResourcesModule]] });
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyWaitModule, decorators: [{
|
|
14
|
+
type: NgModule,
|
|
15
|
+
args: [{
|
|
16
|
+
declarations: [SkyWaitComponent, SkyWaitPageComponent],
|
|
17
|
+
imports: [CommonModule, SkyI18nModule, SkyIndicatorsResourcesModule],
|
|
18
|
+
exports: [SkyWaitComponent],
|
|
19
|
+
entryComponents: [SkyWaitPageComponent],
|
|
20
|
+
}]
|
|
21
|
+
}] });
|
|
22
|
+
//# sourceMappingURL=wait.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/wait/wait.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;;AAQ7D,MAAM,OAAO,aAAa;;2GAAb,aAAa;4GAAb,aAAa,iBALT,gBAAgB,EAAE,oBAAoB,aAC3C,YAAY,EAAE,aAAa,EAAE,4BAA4B,aACzD,gBAAgB;4GAGf,aAAa,YAJf,CAAC,YAAY,EAAE,aAAa,EAAE,4BAA4B,CAAC;4FAIzD,aAAa;kBANzB,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;oBACtD,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,4BAA4B,CAAC;oBACpE,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,eAAe,EAAE,CAAC,oBAAoB,CAAC;iBACxC","sourcesContent":["import { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\n\nimport { SkyI18nModule } from '@skyux/i18n';\n\nimport { SkyIndicatorsResourcesModule } from '../shared/sky-indicators-resources.module';\n\nimport { SkyWaitComponent } from './wait.component';\n\nimport { SkyWaitPageComponent } from './wait-page.component';\n\n@NgModule({\n declarations: [SkyWaitComponent, SkyWaitPageComponent],\n imports: [CommonModule, SkyI18nModule, SkyIndicatorsResourcesModule],\n exports: [SkyWaitComponent],\n entryComponents: [SkyWaitPageComponent],\n})\nexport class SkyWaitModule {}\n"]}
|