@skyux/popovers 8.7.2 → 9.0.0-alpha.1
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/documentation.json +35 -35
- package/{esm2020 → esm2022}/lib/modules/dropdown/dropdown-button.component.mjs +4 -4
- package/esm2022/lib/modules/dropdown/dropdown-item.component.mjs +68 -0
- package/esm2022/lib/modules/dropdown/dropdown-menu.component.mjs +314 -0
- package/esm2022/lib/modules/dropdown/dropdown.component.mjs +391 -0
- package/{esm2020 → esm2022}/lib/modules/dropdown/dropdown.module.mjs +21 -21
- package/{esm2020 → esm2022}/lib/modules/popover/popover-adapter.service.mjs +4 -4
- package/esm2022/lib/modules/popover/popover-content.component.mjs +273 -0
- package/esm2022/lib/modules/popover/popover.component.mjs +236 -0
- package/esm2022/lib/modules/popover/popover.directive.mjs +217 -0
- package/{esm2020 → esm2022}/lib/modules/popover/popover.module.mjs +19 -19
- package/esm2022/lib/modules/shared/sky-popovers-resources.module.mjs +47 -0
- package/esm2022/testing/dropdown/dropdown-fixture.mjs +138 -0
- package/{esm2020 → esm2022}/testing/dropdown/dropdown-testing.module.mjs +5 -5
- package/esm2022/testing/dropdown/harness/dropdown-harness.mjs +95 -0
- package/esm2022/testing/dropdown/harness/dropdown-item-harness.mjs +38 -0
- package/esm2022/testing/dropdown/harness/dropdown-menu-harness.mjs +63 -0
- package/esm2022/testing/popover/harness/popover-body-harness.mjs +42 -0
- package/esm2022/testing/popover/harness/popover-content-harness.mjs +94 -0
- package/esm2022/testing/popover/harness/popover-harness.mjs +51 -0
- package/esm2022/testing/popover/popover-fixture.mjs +88 -0
- package/{esm2020 → esm2022}/testing/popover/popover-testing.module.mjs +11 -11
- package/fesm2022/skyux-popovers-testing.mjs +651 -0
- package/{fesm2020 → fesm2022}/skyux-popovers-testing.mjs.map +1 -1
- package/fesm2022/skyux-popovers.mjs +1827 -0
- package/{fesm2020 → fesm2022}/skyux-popovers.mjs.map +1 -1
- package/lib/modules/dropdown/dropdown-item.component.d.ts +1 -1
- package/lib/modules/dropdown/dropdown-menu.component.d.ts +1 -1
- package/lib/modules/dropdown/dropdown.component.d.ts +1 -1
- package/lib/modules/popover/popover.component.d.ts +1 -1
- package/lib/modules/popover/popover.directive.d.ts +1 -1
- package/package.json +18 -26
- package/esm2020/lib/modules/dropdown/dropdown-item.component.mjs +0 -70
- package/esm2020/lib/modules/dropdown/dropdown-menu.component.mjs +0 -307
- package/esm2020/lib/modules/dropdown/dropdown.component.mjs +0 -375
- package/esm2020/lib/modules/popover/popover-content.component.mjs +0 -268
- package/esm2020/lib/modules/popover/popover.component.mjs +0 -233
- package/esm2020/lib/modules/popover/popover.directive.mjs +0 -209
- package/esm2020/lib/modules/shared/sky-popovers-resources.module.mjs +0 -47
- package/esm2020/testing/dropdown/dropdown-fixture.mjs +0 -137
- package/esm2020/testing/dropdown/harness/dropdown-harness.mjs +0 -102
- package/esm2020/testing/dropdown/harness/dropdown-item-harness.mjs +0 -44
- package/esm2020/testing/dropdown/harness/dropdown-menu-harness.mjs +0 -69
- package/esm2020/testing/popover/harness/popover-body-harness.mjs +0 -42
- package/esm2020/testing/popover/harness/popover-content-harness.mjs +0 -100
- package/esm2020/testing/popover/harness/popover-harness.mjs +0 -56
- package/esm2020/testing/popover/popover-fixture.mjs +0 -74
- package/fesm2015/skyux-popovers-testing.mjs +0 -739
- package/fesm2015/skyux-popovers-testing.mjs.map +0 -1
- package/fesm2015/skyux-popovers.mjs +0 -1807
- package/fesm2015/skyux-popovers.mjs.map +0 -1
- package/fesm2020/skyux-popovers-testing.mjs +0 -660
- package/fesm2020/skyux-popovers.mjs +0 -1785
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/dropdown/dropdown-extensions.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/dropdown/types/dropdown-button-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/dropdown/types/dropdown-horizontal-alignment.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/dropdown/types/dropdown-menu-change.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/dropdown/types/dropdown-message-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/dropdown/types/dropdown-message.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/dropdown/types/dropdown-trigger-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/popover-animation-state.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/popover-animation.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/popover-context.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/popover-extensions.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-adapter-arrow-coordinates.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-adapter-elements.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-alignment.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-message-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-message.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-placement.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-position.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-trigger.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/popover/types/popover-type.mjs +0 -0
- /package/{esm2020 → esm2022}/skyux-popovers.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/dropdown/harness/dropdown-harness.filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/dropdown/harness/dropdown-item-harness.filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/dropdown/harness/dropdown-menu-harness.filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/dropdown/popovers-fixture-dropdown-item.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/dropdown/popovers-fixture-dropdown-menu.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/dropdown/popovers-fixture-dropdown.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/popover/harness/popover-content-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/popover/harness/popover-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/skyux-popovers-testing.mjs +0 -0
package/documentation.json
CHANGED
|
@@ -6489,34 +6489,29 @@
|
|
|
6489
6489
|
},
|
|
6490
6490
|
"codeExamples": [
|
|
6491
6491
|
{
|
|
6492
|
-
"fileName": "
|
|
6493
|
-
"filePath": "/projects/popovers/documentation/code-examples/
|
|
6494
|
-
"rawContents": "
|
|
6495
|
-
},
|
|
6496
|
-
{
|
|
6497
|
-
"fileName": "dropdown-demo.component.html",
|
|
6498
|
-
"filePath": "/projects/popovers/documentation/code-examples/dropdown/basic/dropdown-demo.component.html",
|
|
6499
|
-
"rawContents": "<sky-dropdown data-sky-id=\"dropdown-demo\">\n <sky-dropdown-button> Show dropdown </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let item of items\">\n <button\n type=\"button\"\n [attr.disabled]=\"item.disabled ? '' : null\"\n (click)=\"actionClicked(item.name)\"\n >\n {{ item.name }}\n </button>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n</sky-dropdown>\n"
|
|
6492
|
+
"fileName": "popover-demo.module.ts",
|
|
6493
|
+
"filePath": "/projects/popovers/documentation/code-examples/popover/programmatic/popover-demo.module.ts",
|
|
6494
|
+
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyHelpInlineModule } from '@skyux/indicators';\nimport { SkyPopoverModule } from '@skyux/popovers';\n\nimport { PopoverDemoComponent } from './popover-demo.component';\n\n@NgModule({\n imports: [CommonModule, SkyHelpInlineModule, SkyPopoverModule],\n declarations: [PopoverDemoComponent],\n exports: [PopoverDemoComponent],\n})\nexport class PopoverDemoModule {}\n"
|
|
6500
6495
|
},
|
|
6501
6496
|
{
|
|
6502
|
-
"fileName": "
|
|
6503
|
-
"filePath": "/projects/popovers/documentation/code-examples/
|
|
6504
|
-
"rawContents": "import {
|
|
6497
|
+
"fileName": "popover-demo.component.ts",
|
|
6498
|
+
"filePath": "/projects/popovers/documentation/code-examples/popover/programmatic/popover-demo.component.ts",
|
|
6499
|
+
"rawContents": "import { Component } from '@angular/core';\nimport { SkyPopoverMessage, SkyPopoverMessageType } from '@skyux/popovers';\n\nimport { Subject } from 'rxjs';\n\n@Component({\n selector: 'app-popover-demo',\n templateUrl: './popover-demo.component.html',\n})\nexport class PopoverDemoComponent {\n public popoverController = new Subject<SkyPopoverMessage>();\n\n #popoverOpen = false;\n\n public onPopoverStateChange(isOpen: boolean): void {\n this.#popoverOpen = isOpen;\n }\n\n public openPopover(): void {\n if (!this.#popoverOpen) {\n this.#sendMessage(SkyPopoverMessageType.Open);\n }\n }\n\n #sendMessage(type: SkyPopoverMessageType): void {\n const message: SkyPopoverMessage = { type };\n this.popoverController.next(message);\n }\n}\n"
|
|
6505
6500
|
},
|
|
6506
6501
|
{
|
|
6507
|
-
"fileName": "
|
|
6508
|
-
"filePath": "/projects/popovers/documentation/code-examples/
|
|
6509
|
-
"rawContents": "
|
|
6502
|
+
"fileName": "popover-demo.component.html",
|
|
6503
|
+
"filePath": "/projects/popovers/documentation/code-examples/popover/programmatic/popover-demo.component.html",
|
|
6504
|
+
"rawContents": "<sky-help-inline\n [skyPopover]=\"myPopover\"\n [skyPopoverMessageStream]=\"popoverController\"\n></sky-help-inline>\n\n<button\n class=\"sky-btn sky-btn-default sky-margin-inline-sm\"\n type=\"button\"\n (click)=\"openPopover()\"\n>\n Open popover with message stream\n</button>\n\n<sky-popover\n #myPopover\n (popoverClosed)=\"onPopoverStateChange(false)\"\n (popoverOpened)=\"onPopoverStateChange(true)\"\n>\n This is a popover.\n</sky-popover>\n"
|
|
6510
6505
|
},
|
|
6511
6506
|
{
|
|
6512
|
-
"fileName": "
|
|
6513
|
-
"filePath": "/projects/popovers/documentation/code-examples/
|
|
6514
|
-
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport {
|
|
6507
|
+
"fileName": "popover-demo.module.ts",
|
|
6508
|
+
"filePath": "/projects/popovers/documentation/code-examples/popover/basic/popover-demo.module.ts",
|
|
6509
|
+
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyPopoverModule } from '@skyux/popovers';\n\nimport { PopoverDemoComponent } from './popover-demo.component';\n\n@NgModule({\n imports: [CommonModule, SkyPopoverModule],\n declarations: [PopoverDemoComponent],\n exports: [PopoverDemoComponent],\n})\nexport class PopoverDemoModule {}\n"
|
|
6515
6510
|
},
|
|
6516
6511
|
{
|
|
6517
|
-
"fileName": "popover-demo.component.
|
|
6518
|
-
"filePath": "/projects/popovers/documentation/code-examples/popover/basic/popover-demo.component.
|
|
6519
|
-
"rawContents": "
|
|
6512
|
+
"fileName": "popover-demo.component.ts",
|
|
6513
|
+
"filePath": "/projects/popovers/documentation/code-examples/popover/basic/popover-demo.component.ts",
|
|
6514
|
+
"rawContents": "import { Component } from '@angular/core';\nimport { SkyPopoverAlignment, SkyPopoverPlacement } from '@skyux/popovers';\n\n@Component({\n selector: 'app-popover-demo',\n templateUrl: './popover-demo.component.html',\n})\nexport class PopoverDemoComponent {\n public dismissOnBlur: boolean | undefined;\n public popoverAlignment: SkyPopoverAlignment | undefined;\n public popoverBody = 'This is a popover.';\n public popoverPlacement: SkyPopoverPlacement | undefined;\n public popoverTitle: string | undefined = 'Did you know?';\n}\n"
|
|
6520
6515
|
},
|
|
6521
6516
|
{
|
|
6522
6517
|
"fileName": "popover-demo.component.spec.ts",
|
|
@@ -6524,29 +6519,34 @@
|
|
|
6524
6519
|
"rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { ComponentFixture, TestBed } from '@angular/core/testing';\nimport { NoopAnimationsModule } from '@angular/platform-browser/animations';\nimport { SkyPopoverAlignment, SkyPopoverPlacement } from '@skyux/popovers';\nimport { SkyPopoverHarness } from '@skyux/popovers/testing';\n\nimport { PopoverDemoComponent } from './popover-demo.component';\nimport { PopoverDemoModule } from './popover-demo.module';\n\ndescribe('Basic popover', () => {\n async function setupTest(options?: {\n titleText?: string;\n alignment?: SkyPopoverAlignment;\n placement?: SkyPopoverPlacement;\n dismissOnBlur?: boolean;\n }): Promise<{\n popoverHarness: SkyPopoverHarness;\n fixture: ComponentFixture<PopoverDemoComponent>;\n }> {\n const fixture = TestBed.createComponent(PopoverDemoComponent);\n const loader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n\n if (options) {\n fixture.componentInstance.popoverAlignment = options.alignment;\n fixture.componentInstance.popoverPlacement = options.placement;\n fixture.componentInstance.popoverTitle = options.titleText;\n fixture.componentInstance.dismissOnBlur = options.dismissOnBlur;\n }\n\n fixture.detectChanges();\n await fixture.whenStable();\n\n const popoverHarness = await loader.getHarness(\n SkyPopoverHarness.with({\n dataSkyId: 'popover-demo',\n })\n );\n\n return { popoverHarness, fixture };\n }\n\n beforeEach(() => {\n TestBed.configureTestingModule({\n imports: [PopoverDemoModule, NoopAnimationsModule],\n });\n });\n\n it('should open and close when the user interacts with the trigger', async () => {\n const { popoverHarness } = await setupTest();\n\n await expectAsync(popoverHarness.isOpen()).toBeResolvedTo(false);\n\n await popoverHarness.clickPopoverButton();\n await expectAsync(popoverHarness.isOpen()).toBeResolvedTo(true);\n\n await popoverHarness.clickPopoverButton();\n await expectAsync(popoverHarness.isOpen()).toBeResolvedTo(false);\n });\n\n it('should expose content properties when visible', async () => {\n const { popoverHarness } = await setupTest({\n titleText: 'Did you know?',\n placement: 'right',\n });\n\n await popoverHarness.clickPopoverButton();\n const contentHarness = await popoverHarness.getPopoverContent();\n\n await expectAsync(contentHarness.getTitleText()).toBeResolvedTo(\n 'Did you know?'\n );\n await expectAsync(contentHarness.getBodyText()).toBeResolvedTo(\n 'This is a popover.'\n );\n await expectAsync(contentHarness.getAlignment()).toBeResolvedTo('center');\n await expectAsync(contentHarness.getPlacement()).toBeResolvedTo('right');\n\n await popoverHarness.clickPopoverButton();\n // Attempting to call this method when the popover is closed will result in an error.\n await expectAsync(popoverHarness.getPopoverContent()).toBeRejectedWithError(\n 'Unable to retrieve the popover content because the popover is not open.'\n );\n });\n});\n"
|
|
6525
6520
|
},
|
|
6526
6521
|
{
|
|
6527
|
-
"fileName": "popover-demo.component.
|
|
6528
|
-
"filePath": "/projects/popovers/documentation/code-examples/popover/basic/popover-demo.component.
|
|
6529
|
-
"rawContents": "
|
|
6522
|
+
"fileName": "popover-demo.component.html",
|
|
6523
|
+
"filePath": "/projects/popovers/documentation/code-examples/popover/basic/popover-demo.component.html",
|
|
6524
|
+
"rawContents": "<button\n class=\"sky-btn sky-btn-default sky-margin-inline-sm\"\n type=\"button\"\n [skyPopover]=\"myPopover\"\n [skyPopoverAlignment]=\"popoverAlignment\"\n [skyPopoverPlacement]=\"popoverPlacement\"\n data-sky-id=\"popover-demo\"\n>\n Open popover on click\n</button>\n\n<button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [skyPopover]=\"myPopover\"\n skyPopoverTrigger=\"mouseenter\"\n>\n Open popover on hover\n</button>\n\n<sky-popover\n [dismissOnBlur]=\"dismissOnBlur\"\n [popoverTitle]=\"popoverTitle\"\n #myPopover\n>\n {{ popoverBody }}\n</sky-popover>\n"
|
|
6530
6525
|
},
|
|
6531
6526
|
{
|
|
6532
|
-
"fileName": "
|
|
6533
|
-
"filePath": "/projects/popovers/documentation/code-examples/
|
|
6534
|
-
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport {
|
|
6527
|
+
"fileName": "dropdown-demo.module.ts",
|
|
6528
|
+
"filePath": "/projects/popovers/documentation/code-examples/dropdown/basic/dropdown-demo.module.ts",
|
|
6529
|
+
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyDropdownModule } from '@skyux/popovers';\n\nimport { DropdownDemoComponent } from './dropdown-demo.component';\n\n@NgModule({\n imports: [CommonModule, SkyDropdownModule],\n exports: [DropdownDemoComponent],\n declarations: [DropdownDemoComponent],\n})\nexport class DropdownDemoModule {}\n"
|
|
6535
6530
|
},
|
|
6536
6531
|
{
|
|
6537
|
-
"fileName": "
|
|
6538
|
-
"filePath": "/projects/popovers/documentation/code-examples/
|
|
6539
|
-
"rawContents": "
|
|
6532
|
+
"fileName": "dropdown-demo.component.ts",
|
|
6533
|
+
"filePath": "/projects/popovers/documentation/code-examples/dropdown/basic/dropdown-demo.component.ts",
|
|
6534
|
+
"rawContents": "import { Component } from '@angular/core';\n\nimport { DropdownDemoItem } from './dropdown-demo-item';\n\n@Component({\n selector: 'app-dropdown-demo',\n templateUrl: './dropdown-demo.component.html',\n})\nexport class DropdownDemoComponent {\n public items: DropdownDemoItem[] = [\n { name: 'Option 1', disabled: false },\n { name: 'Disabled option', disabled: true },\n { name: 'Option 3', disabled: false },\n { name: 'Option 4', disabled: false },\n { name: 'Option 5', disabled: false },\n ];\n\n public actionClicked(action: string): void {\n alert(`You selected ${action}.`);\n }\n}\n"
|
|
6540
6535
|
},
|
|
6541
6536
|
{
|
|
6542
|
-
"fileName": "
|
|
6543
|
-
"filePath": "/projects/popovers/documentation/code-examples/
|
|
6544
|
-
"rawContents": "import {
|
|
6537
|
+
"fileName": "dropdown-demo.component.spec.ts",
|
|
6538
|
+
"filePath": "/projects/popovers/documentation/code-examples/dropdown/basic/dropdown-demo.component.spec.ts",
|
|
6539
|
+
"rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { ComponentFixture, TestBed } from '@angular/core/testing';\nimport { expect } from '@skyux-sdk/testing';\nimport { SkyDropdownHarness } from '@skyux/popovers/testing';\n\nimport { DropdownDemoComponent } from './dropdown-demo.component';\nimport { DropdownDemoModule } from './dropdown-demo.module';\n\ndescribe('Basic dropdown', () => {\n async function setupTest(): Promise<{\n dropdownHarness: SkyDropdownHarness;\n fixture: ComponentFixture<DropdownDemoComponent>;\n }> {\n const fixture = TestBed.createComponent(DropdownDemoComponent);\n const loader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n const dropdownHarness = await loader.getHarness(\n SkyDropdownHarness.with({\n dataSkyId: 'dropdown-demo',\n })\n );\n\n return { dropdownHarness, fixture };\n }\n\n beforeEach(() => {\n TestBed.configureTestingModule({\n imports: [DropdownDemoModule],\n });\n });\n\n it('should display the correct dropdown', async () => {\n const { dropdownHarness, fixture } = await setupTest();\n\n fixture.detectChanges();\n\n await expectAsync(dropdownHarness.getButtonStyle()).toBeResolvedTo(\n 'default'\n );\n await expectAsync(dropdownHarness.getButtonType()).toBeResolvedTo('select');\n await expectAsync(dropdownHarness.isDisabled()).toBeResolvedTo(false);\n await expectAsync(dropdownHarness.getAriaLabel()).toBeResolvedTo(\n 'Context menu'\n );\n await expectAsync(dropdownHarness.getTitle()).toBeResolvedTo(null);\n await expectAsync(dropdownHarness.isOpen()).toBeResolvedTo(false);\n });\n\n it('should open the correct dropdown menu', async () => {\n const { dropdownHarness, fixture } = await setupTest();\n\n fixture.detectChanges();\n await dropdownHarness.clickDropdownButton();\n fixture.detectChanges();\n\n const dropdownMenu = await dropdownHarness.getDropdownMenu();\n const dropdownMenuItems = await dropdownMenu.getItems();\n\n await expectAsync(dropdownHarness.isOpen()).toBeResolvedTo(true);\n await expectAsync(dropdownMenu.getAriaRole()).toBeResolvedTo('menu');\n\n await expectAsync(dropdownMenuItems?.[0].getText()).toBeResolvedTo(\n 'Option 1'\n );\n });\n\n it('should click the correct dropdown menu item', async () => {\n const { dropdownHarness, fixture } = await setupTest();\n\n const clickSpy = spyOn(fixture.componentInstance, 'actionClicked');\n fixture.detectChanges();\n await dropdownHarness.clickDropdownButton();\n fixture.detectChanges();\n\n const dropdownMenu = await dropdownHarness.getDropdownMenu();\n const dropdownMenuItem = await dropdownMenu.getItem({ text: 'Option 1' });\n\n await dropdownMenuItem?.click();\n\n expect(clickSpy).toHaveBeenCalledWith('Option 1');\n });\n});\n"
|
|
6545
6540
|
},
|
|
6546
6541
|
{
|
|
6547
|
-
"fileName": "
|
|
6548
|
-
"filePath": "/projects/popovers/documentation/code-examples/
|
|
6549
|
-
"rawContents": "
|
|
6542
|
+
"fileName": "dropdown-demo.component.html",
|
|
6543
|
+
"filePath": "/projects/popovers/documentation/code-examples/dropdown/basic/dropdown-demo.component.html",
|
|
6544
|
+
"rawContents": "<sky-dropdown data-sky-id=\"dropdown-demo\">\n <sky-dropdown-button> Show dropdown </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let item of items\">\n <button\n type=\"button\"\n [attr.disabled]=\"item.disabled ? '' : null\"\n (click)=\"actionClicked(item.name)\"\n >\n {{ item.name }}\n </button>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n</sky-dropdown>\n"
|
|
6545
|
+
},
|
|
6546
|
+
{
|
|
6547
|
+
"fileName": "dropdown-demo-item.ts",
|
|
6548
|
+
"filePath": "/projects/popovers/documentation/code-examples/dropdown/basic/dropdown-demo-item.ts",
|
|
6549
|
+
"rawContents": "export interface DropdownDemoItem {\n name: string;\n disabled: boolean;\n}\n"
|
|
6550
6550
|
}
|
|
6551
6551
|
]
|
|
6552
6552
|
}
|
|
@@ -4,11 +4,11 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
* Specifies the button for the dropdown menu.
|
|
5
5
|
*/
|
|
6
6
|
export class SkyDropdownButtonComponent {
|
|
7
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyDropdownButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyDropdownButtonComponent, selector: "sky-dropdown-button", ngImport: i0, template: "<ng-content></ng-content>\n" }); }
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
SkyDropdownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SkyDropdownButtonComponent, selector: "sky-dropdown-button", ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
10
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyDropdownButtonComponent, decorators: [{
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyDropdownButtonComponent, decorators: [{
|
|
11
11
|
type: Component,
|
|
12
12
|
args: [{ selector: 'sky-dropdown-button', template: "<ng-content></ng-content>\n" }]
|
|
13
13
|
}] });
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24tYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9wb3BvdmVycy9zcmMvbGliL21vZHVsZXMvZHJvcGRvd24vZHJvcGRvd24tYnV0dG9uLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9wb3BvdmVycy9zcmMvbGliL21vZHVsZXMvZHJvcGRvd24vZHJvcGRvd24tYnV0dG9uLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBRTFDOztHQUVHO0FBS0gsTUFBTSxPQUFPLDBCQUEwQjs4R0FBMUIsMEJBQTBCO2tHQUExQiwwQkFBMEIsMkRDVHZDLDZCQUNBOzsyRkRRYSwwQkFBMEI7a0JBSnRDLFNBQVM7K0JBQ0UscUJBQXFCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29tcG9uZW50IH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbi8qKlxuICogU3BlY2lmaWVzIHRoZSBidXR0b24gZm9yIHRoZSBkcm9wZG93biBtZW51LlxuICovXG5AQ29tcG9uZW50KHtcbiAgc2VsZWN0b3I6ICdza3ktZHJvcGRvd24tYnV0dG9uJyxcbiAgdGVtcGxhdGVVcmw6ICcuL2Ryb3Bkb3duLWJ1dHRvbi5jb21wb25lbnQuaHRtbCcsXG59KVxuZXhwb3J0IGNsYXNzIFNreURyb3Bkb3duQnV0dG9uQ29tcG9uZW50IHt9XG4iLCI8bmctY29udGVudD48L25nLWNvbnRlbnQ+XG4iXX0=
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation, } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/common";
|
|
4
|
+
/**
|
|
5
|
+
* Specifies the items to display on the dropdown menu.
|
|
6
|
+
*/
|
|
7
|
+
export class SkyDropdownItemComponent {
|
|
8
|
+
/**
|
|
9
|
+
* The ARIA role for the dropdown menu item
|
|
10
|
+
* [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)
|
|
11
|
+
* by indicating how the item functions and what it controls. For information about
|
|
12
|
+
* how an ARIA role indicates what an item represents on a web page, see the
|
|
13
|
+
* [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/#roles).
|
|
14
|
+
* @default "menuitem"
|
|
15
|
+
*/
|
|
16
|
+
set ariaRole(value) {
|
|
17
|
+
this.#_ariaRole = value ?? 'menuitem';
|
|
18
|
+
}
|
|
19
|
+
get ariaRole() {
|
|
20
|
+
return this.#_ariaRole;
|
|
21
|
+
}
|
|
22
|
+
#_ariaRole;
|
|
23
|
+
#changeDetector;
|
|
24
|
+
#renderer;
|
|
25
|
+
constructor(elementRef, changeDetector, renderer) {
|
|
26
|
+
this.elementRef = elementRef;
|
|
27
|
+
this.isActive = false;
|
|
28
|
+
this.#_ariaRole = 'menuitem';
|
|
29
|
+
this.#changeDetector = changeDetector;
|
|
30
|
+
this.#renderer = renderer;
|
|
31
|
+
}
|
|
32
|
+
ngAfterViewInit() {
|
|
33
|
+
// Make sure anchor elements are tab-able.
|
|
34
|
+
const buttonElement = this.#getButtonElement();
|
|
35
|
+
/* istanbul ignore else */
|
|
36
|
+
if (buttonElement) {
|
|
37
|
+
this.#renderer.setAttribute(buttonElement, 'tabIndex', '0');
|
|
38
|
+
}
|
|
39
|
+
this.#changeDetector.detectChanges();
|
|
40
|
+
}
|
|
41
|
+
focusElement(enableNativeFocus) {
|
|
42
|
+
this.isActive = true;
|
|
43
|
+
if (enableNativeFocus) {
|
|
44
|
+
this.#getButtonElement()?.focus();
|
|
45
|
+
}
|
|
46
|
+
this.#changeDetector.detectChanges();
|
|
47
|
+
}
|
|
48
|
+
isFocusable() {
|
|
49
|
+
const isFocusable = this.#getButtonElement()?.getAttribute('disabled') === null;
|
|
50
|
+
return isFocusable;
|
|
51
|
+
}
|
|
52
|
+
resetState() {
|
|
53
|
+
this.isActive = false;
|
|
54
|
+
this.#changeDetector.markForCheck();
|
|
55
|
+
}
|
|
56
|
+
#getButtonElement() {
|
|
57
|
+
return this.elementRef.nativeElement.querySelector('button,a');
|
|
58
|
+
}
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyDropdownItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
60
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyDropdownItemComponent, selector: "sky-dropdown-item", inputs: { ariaRole: "ariaRole" }, ngImport: i0, template: "<div\n class=\"sky-dropdown-item\"\n [attr.role]=\"ariaRole\"\n [ngClass]=\"{\n 'sky-dropdown-item-active': isActive\n }\"\n>\n <ng-content> </ng-content>\n</div>\n", styles: [".sky-dropdown-item{background-color:transparent;border:none;display:block;margin:4px;min-width:160px;text-align:left}.sky-dropdown-item.sky-dropdown-item-active a,.sky-dropdown-item.sky-dropdown-item-active button,.sky-dropdown-item:hover a,.sky-dropdown-item:hover button{background-color:#eeeeef}.sky-dropdown-item button[disabled],.sky-dropdown-item a[disabled]{cursor:default}.sky-dropdown-item button[disabled]:hover,.sky-dropdown-item a[disabled]:hover{background-color:transparent}.sky-dropdown-item>a,.sky-dropdown-item>button{background-color:transparent;border:none;color:#212327;cursor:pointer;display:block;padding:3px 20px;text-align:left;width:100%}.sky-dropdown-item>a:hover,.sky-dropdown-item>button:hover{text-decoration:none}.sky-dropdown-item>a[disabled],.sky-dropdown-item>button[disabled]{color:#686c73}.sky-dropdown-item>a[disabled]:hover,.sky-dropdown-item>button[disabled]:hover{cursor:default}.sky-theme-modern .sky-dropdown-item{margin:0}.sky-theme-modern .sky-dropdown-item.sky-dropdown-item-active,.sky-theme-modern .sky-dropdown-item:hover{background-color:transparent}.sky-theme-modern .sky-dropdown-item>a,.sky-theme-modern .sky-dropdown-item>button{padding:10px 20px;border-radius:6px;transition:box-shadow .15s}.sky-theme-modern .sky-dropdown-item>a:hover,.sky-theme-modern .sky-dropdown-item>button:hover{outline:solid 1px #1870B8;outline-offset:-1px}.sky-theme-modern .sky-dropdown-item>a:focus-visible,.sky-theme-modern .sky-dropdown-item>a:active,.sky-theme-modern .sky-dropdown-item>button:focus-visible,.sky-theme-modern .sky-dropdown-item>button:active{outline:solid 2px #1870B8;outline-offset:-2px}.sky-theme-modern .sky-dropdown-item>a:focus-visible:not(:active),.sky-theme-modern .sky-dropdown-item>button:focus-visible:not(:active){box-shadow:0 1px 8px #0000004d}.sky-theme-modern.sky-theme-mode-dark .sky-dropdown-item>a,.sky-theme-modern.sky-theme-mode-dark .sky-dropdown-item>button{color:#fbfcfe}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
61
|
+
}
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyDropdownItemComponent, decorators: [{
|
|
63
|
+
type: Component,
|
|
64
|
+
args: [{ selector: 'sky-dropdown-item', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"sky-dropdown-item\"\n [attr.role]=\"ariaRole\"\n [ngClass]=\"{\n 'sky-dropdown-item-active': isActive\n }\"\n>\n <ng-content> </ng-content>\n</div>\n", styles: [".sky-dropdown-item{background-color:transparent;border:none;display:block;margin:4px;min-width:160px;text-align:left}.sky-dropdown-item.sky-dropdown-item-active a,.sky-dropdown-item.sky-dropdown-item-active button,.sky-dropdown-item:hover a,.sky-dropdown-item:hover button{background-color:#eeeeef}.sky-dropdown-item button[disabled],.sky-dropdown-item a[disabled]{cursor:default}.sky-dropdown-item button[disabled]:hover,.sky-dropdown-item a[disabled]:hover{background-color:transparent}.sky-dropdown-item>a,.sky-dropdown-item>button{background-color:transparent;border:none;color:#212327;cursor:pointer;display:block;padding:3px 20px;text-align:left;width:100%}.sky-dropdown-item>a:hover,.sky-dropdown-item>button:hover{text-decoration:none}.sky-dropdown-item>a[disabled],.sky-dropdown-item>button[disabled]{color:#686c73}.sky-dropdown-item>a[disabled]:hover,.sky-dropdown-item>button[disabled]:hover{cursor:default}.sky-theme-modern .sky-dropdown-item{margin:0}.sky-theme-modern .sky-dropdown-item.sky-dropdown-item-active,.sky-theme-modern .sky-dropdown-item:hover{background-color:transparent}.sky-theme-modern .sky-dropdown-item>a,.sky-theme-modern .sky-dropdown-item>button{padding:10px 20px;border-radius:6px;transition:box-shadow .15s}.sky-theme-modern .sky-dropdown-item>a:hover,.sky-theme-modern .sky-dropdown-item>button:hover{outline:solid 1px #1870B8;outline-offset:-1px}.sky-theme-modern .sky-dropdown-item>a:focus-visible,.sky-theme-modern .sky-dropdown-item>a:active,.sky-theme-modern .sky-dropdown-item>button:focus-visible,.sky-theme-modern .sky-dropdown-item>button:active{outline:solid 2px #1870B8;outline-offset:-2px}.sky-theme-modern .sky-dropdown-item>a:focus-visible:not(:active),.sky-theme-modern .sky-dropdown-item>button:focus-visible:not(:active){box-shadow:0 1px 8px #0000004d}.sky-theme-modern.sky-theme-mode-dark .sky-dropdown-item>a,.sky-theme-modern.sky-theme-mode-dark .sky-dropdown-item>button{color:#fbfcfe}\n"] }]
|
|
65
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }]; }, propDecorators: { ariaRole: [{
|
|
66
|
+
type: Input
|
|
67
|
+
}] } });
|
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24taXRlbS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvcG9wb3ZlcnMvc3JjL2xpYi9tb2R1bGVzL2Ryb3Bkb3duL2Ryb3Bkb3duLWl0ZW0uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3BvcG92ZXJzL3NyYy9saWIvbW9kdWxlcy9kcm9wZG93bi9kcm9wZG93bi1pdGVtLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCx1QkFBdUIsRUFFdkIsU0FBUyxFQUVULEtBQUssRUFFTCxpQkFBaUIsR0FDbEIsTUFBTSxlQUFlLENBQUM7OztBQUV2Qjs7R0F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