From d37919efda56208b5a231e4ed397ffc9ba6f17a9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 14 Dec 2022 21:38:47 +0000 Subject: [PATCH 01/21] 1.0.0-next.679 --- CHANGELOG.md | 28 +++++++++++++++------------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be4690b996e..ac9cbb89e4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -337,25 +337,27 @@ Removed the event `calcitePaginationUpdate` event, use ### Features -- **dropdown-item:** Add `calciteDropdownItemSelect` event ([#6015](https://github.com/Esri/calcite-components/issues/6015)) ([b565ac9](https://github.com/Esri/calcite-components/commit/b565ac97e0d8b63527767fa10a75dce78d7f5a4b)), closes [#5940](https://github.com/Esri/calcite-components/issues/5940) [#5940](https://github.com/Esri/calcite-components/issues/5940) +- add built-in translations ([#5471](https://github.com/Esri/calcite-components/issues/5471)) ([d754b29](https://github.com/Esri/calcite-components/commit/d754b29467d40f8081eb7793fb13c1b4de9f7ebf)), closes [#4961](https://github.com/Esri/calcite-components/issues/4961) -- **input, input-number, input-text:** add inputMode and enterKeyHint properties ([#5976](https://github.com/Esri/calcite-components/issues/5976)) ([d567a9f](https://github.com/Esri/calcite-components/commit/d567a9fde5b3619f308133555ba0bae20ca85168)), closes [#5917](https://github.com/Esri/calcite-components/issues/5917) +* **dropdown-item:** Add `calciteDropdownItemSelect` event ([#6015](https://github.com/Esri/calcite-components/issues/6015)) ([b565ac9](https://github.com/Esri/calcite-components/commit/b565ac97e0d8b63527767fa10a75dce78d7f5a4b)), closes [#5940](https://github.com/Esri/calcite-components/issues/5940) [#5940](https://github.com/Esri/calcite-components/issues/5940) -- **action:** add built-in translation support for indicator text ([#5895](https://github.com/Esri/calcite-components/issues/5895)) ([704db6d](https://github.com/Esri/calcite-components/commit/704db6dfbe3a875fbd5b20c9b0eb0975aca24258)), closes [#4813](https://github.com/Esri/calcite-components/issues/4813) +* **input, input-number, input-text:** add inputMode and enterKeyHint properties ([#5976](https://github.com/Esri/calcite-components/issues/5976)) ([d567a9f](https://github.com/Esri/calcite-components/commit/d567a9fde5b3619f308133555ba0bae20ca85168)), closes [#5917](https://github.com/Esri/calcite-components/issues/5917) -- **list-item:** Add content slot for specialized content ([#5876](https://github.com/Esri/calcite-components/issues/5876)) ([a510773](https://github.com/Esri/calcite-components/commit/a510773ba87994010e84184f7709c84ce40f2d2c)), closes [#3032](https://github.com/Esri/calcite-components/issues/3032) [#3032](https://github.com/Esri/calcite-components/issues/3032) +* **action:** add built-in translation support for indicator text ([#5895](https://github.com/Esri/calcite-components/issues/5895)) ([704db6d](https://github.com/Esri/calcite-components/commit/704db6dfbe3a875fbd5b20c9b0eb0975aca24258)), closes [#4813](https://github.com/Esri/calcite-components/issues/4813) -- **textarea:** add default message bundle ([#5870](https://github.com/Esri/calcite-components/issues/5870)) ([c7a8495](https://github.com/Esri/calcite-components/commit/c7a84955b4f3cd09dbf7315ea59e0edaa7be2a6c)), closes [#863](https://github.com/Esri/calcite-components/issues/863) +* **list-item:** Add content slot for specialized content ([#5876](https://github.com/Esri/calcite-components/issues/5876)) ([a510773](https://github.com/Esri/calcite-components/commit/a510773ba87994010e84184f7709c84ce40f2d2c)), closes [#3032](https://github.com/Esri/calcite-components/issues/3032) [#3032](https://github.com/Esri/calcite-components/issues/3032) -- **input, input-text, input-number:** add attributes autocomplete, accept, multiple, pattern ([#5807](https://github.com/Esri/calcite-components/issues/5807)) ([feb4fce](https://github.com/Esri/calcite-components/commit/feb4fce9528920041d836446ef437f0f1c0e8ce2)), closes [#4079](https://github.com/Esri/calcite-components/issues/4079) +* **textarea:** add default message bundle ([#5870](https://github.com/Esri/calcite-components/issues/5870)) ([c7a8495](https://github.com/Esri/calcite-components/commit/c7a84955b4f3cd09dbf7315ea59e0edaa7be2a6c)), closes [#863](https://github.com/Esri/calcite-components/issues/863) -- **alert:** support actions-end ([#5750](https://github.com/Esri/calcite-components/issues/5750)) ([2447e16](https://github.com/Esri/calcite-components/commit/2447e167eb731f3a59775a5692530137bf9a70fd)) -- **list, list-item, list-item-group:** Adds support for selecting and filtering list items. Improves accessibility by using aria "treegrid" role. ([#4527](https://github.com/Esri/calcite-components/issues/4527)) ([f489c57](https://github.com/Esri/calcite-components/commit/f489c57095ec21df1f427176d2d635675eea95d3)) -- **pick-list, value-list:** Add calciteListFilter event, filteredItems prop, filterText prop and filteredData prop. ([#5681](https://github.com/Esri/calcite-components/issues/5681)) ([943d208](https://github.com/Esri/calcite-components/commit/943d2088b7cf447a12ebcd0babab145f543538a2)), closes [#4333](https://github.com/Esri/calcite-components/issues/4333) -- **popover:** Add focus-trap to popover and disableFocusTrap property. ([#5725](https://github.com/Esri/calcite-components/issues/5725)) ([a8ef353](https://github.com/Esri/calcite-components/commit/a8ef353bc031630b373f2bdd1bdc1cafd7e35be9)), closes [#2133](https://github.com/Esri/calcite-components/issues/2133) -- **popover:** Escape key should close open popovers. ([#5726](https://github.com/Esri/calcite-components/issues/5726)) ([2e2621d](https://github.com/Esri/calcite-components/commit/2e2621d57c4701f7a7e84f74d801c543ad4f45c0)) -- **tabs:** Add support for navigating with Home and End keys ([#5727](https://github.com/Esri/calcite-components/issues/5727)) ([823c429](https://github.com/Esri/calcite-components/commit/823c429439ec9f8cd1d6a1ff2aedf0b2da9c741b)), closes [#5661](https://github.com/Esri/calcite-components/issues/5661) -- **tooltip:** Add tooltip open, close, beforeOpen, and beforeClose events ([#5772](https://github.com/Esri/calcite-components/issues/5772)) ([64b5675](https://github.com/Esri/calcite-components/commit/64b56751d68f69d31ea943415f5d0d08bae634cc)), closes [#5734](https://github.com/Esri/calcite-components/issues/5734) +* **input, input-text, input-number:** add attributes autocomplete, accept, multiple, pattern ([#5807](https://github.com/Esri/calcite-components/issues/5807)) ([feb4fce](https://github.com/Esri/calcite-components/commit/feb4fce9528920041d836446ef437f0f1c0e8ce2)), closes [#4079](https://github.com/Esri/calcite-components/issues/4079) + +* **alert:** support actions-end ([#5750](https://github.com/Esri/calcite-components/issues/5750)) ([2447e16](https://github.com/Esri/calcite-components/commit/2447e167eb731f3a59775a5692530137bf9a70fd)) +* **list, list-item, list-item-group:** Adds support for selecting and filtering list items. Improves accessibility by using aria "treegrid" role. ([#4527](https://github.com/Esri/calcite-components/issues/4527)) ([f489c57](https://github.com/Esri/calcite-components/commit/f489c57095ec21df1f427176d2d635675eea95d3)) +* **pick-list, value-list:** Add calciteListFilter event, filteredItems prop, filterText prop and filteredData prop. ([#5681](https://github.com/Esri/calcite-components/issues/5681)) ([943d208](https://github.com/Esri/calcite-components/commit/943d2088b7cf447a12ebcd0babab145f543538a2)), closes [#4333](https://github.com/Esri/calcite-components/issues/4333) +* **popover:** Add focus-trap to popover and disableFocusTrap property. ([#5725](https://github.com/Esri/calcite-components/issues/5725)) ([a8ef353](https://github.com/Esri/calcite-components/commit/a8ef353bc031630b373f2bdd1bdc1cafd7e35be9)), closes [#2133](https://github.com/Esri/calcite-components/issues/2133) +* **popover:** Escape key should close open popovers. ([#5726](https://github.com/Esri/calcite-components/issues/5726)) ([2e2621d](https://github.com/Esri/calcite-components/commit/2e2621d57c4701f7a7e84f74d801c543ad4f45c0)) +* **tabs:** Add support for navigating with Home and End keys ([#5727](https://github.com/Esri/calcite-components/issues/5727)) ([823c429](https://github.com/Esri/calcite-components/commit/823c429439ec9f8cd1d6a1ff2aedf0b2da9c741b)), closes [#5661](https://github.com/Esri/calcite-components/issues/5661) +* **tooltip:** Add tooltip open, close, beforeOpen, and beforeClose events ([#5772](https://github.com/Esri/calcite-components/issues/5772)) ([64b5675](https://github.com/Esri/calcite-components/commit/64b56751d68f69d31ea943415f5d0d08bae634cc)), closes [#5734](https://github.com/Esri/calcite-components/issues/5734) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index a77bb934ee5..27cde262e5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@esri/calcite-components", - "version": "1.0.0-next.678", + "version": "1.0.0-next.679", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@esri/calcite-components", - "version": "1.0.0-next.678", + "version": "1.0.0-next.679", "license": "SEE LICENSE IN copyright.txt", "dependencies": { "@floating-ui/dom": "1.0.10", diff --git a/package.json b/package.json index 55d3fa983b8..51e3125ebd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components", - "version": "1.0.0-next.678", + "version": "1.0.0-next.679", "description": "Web Components for Esri's Calcite Design System.", "main": "dist/index.cjs.js", "module": "dist/index.js", From 645dd1ef4caf78aed08e00f3878b8bfe942602ce Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Wed, 14 Dec 2022 15:20:14 -0800 Subject: [PATCH 02/21] refactor(input-date-picker)!: Remove deprecated calciteDatePickerChange event (#6040) BREAKING CHANGE: Removed the `calciteDatePickerChange` event, use `calciteInputDatePickerChange` instead. --- .../input-date-picker/input-date-picker.e2e.ts | 5 ----- src/components/input-date-picker/input-date-picker.tsx | 9 +-------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/components/input-date-picker/input-date-picker.e2e.ts b/src/components/input-date-picker/input-date-picker.e2e.ts index 1904d5586b4..55ab27d61cb 100644 --- a/src/components/input-date-picker/input-date-picker.e2e.ts +++ b/src/components/input-date-picker/input-date-picker.e2e.ts @@ -45,7 +45,6 @@ describe("calcite-input-date-picker", () => { const input = await page.find("calcite-input-date-picker"); const changeEvent = await page.spyOnEvent("calciteInputDatePickerChange"); - const deprecatedChangeEvent = await page.spyOnEvent("calciteDatePickerChange"); expect(await input.getProperty("value")).toBe(""); @@ -67,7 +66,6 @@ describe("calcite-input-date-picker", () => { expect(await input.getProperty("valueAsDate")).toBeDefined(); expect(changeEvent).toHaveReceivedEventTimes(1); - expect(deprecatedChangeEvent).toHaveReceivedEventTimes(1); await page.keyboard.press("Backspace"); await page.keyboard.press("Backspace"); @@ -83,7 +81,6 @@ describe("calcite-input-date-picker", () => { await page.waitForChanges(); expect(changeEvent).toHaveReceivedEventTimes(2); - expect(deprecatedChangeEvent).toHaveReceivedEventTimes(2); expect(await input.getProperty("value")).toBe(""); expect(await input.getProperty("valueAsDate")).toBeUndefined(); @@ -96,10 +93,8 @@ describe("calcite-input-date-picker", () => { element.setProperty("value", ""); await page.waitForChanges(); const changeEvent = await page.spyOnEvent("calciteInputDatePickerChange"); - const deprecatedChangeEvent = await page.spyOnEvent("calciteDatePickerChange"); expect(changeEvent).toHaveReceivedEventTimes(0); - expect(deprecatedChangeEvent).toHaveReceivedEventTimes(0); expect(await element.getProperty("value")).toBe(""); expect(await element.getProperty("valueAsDate")).toBeUndefined(); }); diff --git a/src/components/input-date-picker/input-date-picker.tsx b/src/components/input-date-picker/input-date-picker.tsx index 0b4e85c6652..a94c0e2576a 100644 --- a/src/components/input-date-picker/input-date-picker.tsx +++ b/src/components/input-date-picker/input-date-picker.tsx @@ -374,12 +374,6 @@ export class InputDatePicker // Events // //-------------------------------------------------------------------------- - /** - * Fires when a user changes the date. - * - * @deprecated use `calciteInputDatePickerChange` instead. - */ - @Event({ cancelable: false }) calciteDatePickerChange: EventEmitter; /** * Fires when a user changes the date range. @@ -1011,9 +1005,8 @@ export class InputDatePicker this.value = newValue || ""; const changeEvent = this.calciteInputDatePickerChange.emit(); - const deprecatedDatePickerChangeEvent = this.calciteDatePickerChange.emit(value as Date); - if (changeEvent.defaultPrevented || deprecatedDatePickerChangeEvent.defaultPrevented) { + if (changeEvent.defaultPrevented) { this.value = oldValue; this.setInputValue(oldValue as string); } From 9b759fd33a890a9444560d566319dc66ad66e9ae Mon Sep 17 00:00:00 2001 From: Matt Driscoll Date: Wed, 14 Dec 2022 15:36:57 -0800 Subject: [PATCH 03/21] refactor(popover, dropdown, modal, pick-list-item, value-list-item)!: rename `disable*` properties (#6036) BREAKING CHANGE: Renamed `disable*` properties. - Dropdown - Renamed the property `disableCloseOnSelect`, use `closeOnSelectDisabled` instead. - Modal - Renamed the property `disableCloseButton`, use `closeButtonDisabled` instead. - Renamed the property `disableFocusTrap`, use `focusTrapDisabled` instead. - Renamed the property `disableOutsideClose`, use `outsideCloseDisabled` instead. - Renamed the property `disableEscape`, use `escapeDisabled` instead. - PickListItem - Renamed the property `disableDeselect`, use `deselectDisabled` instead. - Popover - Renamed the property `disableFlip`, use `flipDisabled` instead. - Renamed the property `disableFocusTrap`, use `focusTrapDisabled` instead. - Renamed the property `disablePointer`, use `pointerDisabled` instead. - ValueListItem - Renamed the property `disableDeselect`, use `deselectDisabled` instead. --- src/components/action-menu/action-menu.tsx | 4 +-- src/components/dropdown/dropdown.e2e.ts | 10 +++--- src/components/dropdown/dropdown.stories.ts | 22 ++++++------ src/components/dropdown/dropdown.tsx | 4 +-- src/components/dropdown/readme.md | 30 ++++++++-------- .../usage/Disabling-close-on-select.md | 4 +-- .../input-time-picker/input-time-picker.tsx | 2 +- src/components/modal/modal.e2e.ts | 12 +++---- src/components/modal/modal.stories.ts | 4 +-- src/components/modal/modal.tsx | 20 +++++------ src/components/modal/readme.md | 34 +++++++++---------- .../pick-list-item/pick-list-item.e2e.ts | 4 +-- .../pick-list-item/pick-list-item.tsx | 6 ++-- src/components/pick-list-item/readme.md | 24 ++++++------- src/components/pick-list/shared-list-logic.ts | 2 +- src/components/popover/popover.e2e.ts | 4 +-- src/components/popover/popover.stories.ts | 8 ++--- src/components/popover/popover.tsx | 22 ++++++------ src/components/popover/readme.md | 6 ++-- .../value-list-item/value-list-item.e2e.ts | 4 +-- .../value-list-item/value-list-item.tsx | 4 +-- src/demos/color-picker.html | 6 ++-- src/demos/modal.html | 18 +++++----- src/demos/shell/block-configurations.html | 2 +- .../demo-app-advanced-2-shell-header.html | 2 +- src/demos/shell/demo-app-advanced-2.html | 2 +- src/demos/shell/demo-app-advanced-3.html | 2 +- src/demos/shell/demo-app-advanced.html | 6 ++-- src/demos/shell/demo-app-blank.html | 2 +- src/demos/shell/nesting-testing-flow.html | 2 +- src/demos/shell/nesting-testing.html | 2 +- src/demos/theme/auto.html | 6 ++-- src/utils/floating-ui.ts | 17 +++++----- src/utils/focusTrapComponent.ts | 4 +-- 34 files changed, 150 insertions(+), 151 deletions(-) diff --git a/src/components/action-menu/action-menu.tsx b/src/components/action-menu/action-menu.tsx index 6ea00650e7a..6d1fd2ea944 100755 --- a/src/components/action-menu/action-menu.tsx +++ b/src/components/action-menu/action-menu.tsx @@ -299,14 +299,14 @@ export class ActionMenu implements LoadableComponent { return (
{ expect(await dropdownWrapper.isVisible()).toBe(false); }); - it("remains open when disable-close-on-select is requested and selected item is not in a selection-mode:none group", async () => { + it("remains open when close-on-select-disabled is requested and selected item is not in a selection-mode:none group", async () => { const page = await newE2EPage(); - await page.setContent(html` + await page.setContent(html` Open dropdown Dropdown Item Content @@ -722,9 +722,9 @@ describe("calcite-dropdown", () => { expect(await dropdownWrapper.isVisible()).toBe(true); }); - it("closes when disable-close-on-select is requested and selected item is in a selection-mode:none group", async () => { + it("closes when close-on-select-disabled is requested and selected item is in a selection-mode:none group", async () => { const page = await newE2EPage(); - await page.setContent(html` + await page.setContent(html` Open dropdown @@ -983,7 +983,7 @@ describe("calcite-dropdown", () => { it("item selection should work when placed inside shadow DOM (#992)", async () => { const wrappedDropdownTemplateHTML = html` - + Open 1 diff --git a/src/components/dropdown/dropdown.stories.ts b/src/components/dropdown/dropdown.stories.ts index 5ff10821f87..8143c3ebb51 100644 --- a/src/components/dropdown/dropdown.stories.ts +++ b/src/components/dropdown/dropdown.stories.ts @@ -25,7 +25,7 @@ export const simple = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -46,7 +46,7 @@ export const simpleAutoWidth = (): string => html` placement="${select("placement", menuPlacements, defaultMenuPlacement)}" scale="${select("scale", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -70,7 +70,7 @@ export const simpleFullWidth = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -93,7 +93,7 @@ export const withIcons = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -131,7 +131,7 @@ export const groupsAndSelectionModes = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -159,7 +159,7 @@ export const itemsAsLinks = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -197,7 +197,7 @@ export const darkThemeRTL_TestOnly = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -232,7 +232,7 @@ export const itemsAsLinksDarkTheme = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -271,7 +271,7 @@ export const scrollingAfterCertainItems_TestOnly = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -398,7 +398,7 @@ export const alignedCenter_TestOnly = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown @@ -427,7 +427,7 @@ export const alignedCenterRTL_TestOnly = (): string => html` scale="${select("scale", ["s", "m", "l"], "m")}" width="${select("width", ["s", "m", "l"], "m")}" type="${select("type", ["click", "hover"], "click")}" - ${boolean("disable-close-on-select", false)} + ${boolean("close-on-select-disabled", false)} ${boolean("disabled", false)} > Open Dropdown diff --git a/src/components/dropdown/dropdown.tsx b/src/components/dropdown/dropdown.tsx index bae63559d17..6bd1253e2ca 100644 --- a/src/components/dropdown/dropdown.tsx +++ b/src/components/dropdown/dropdown.tsx @@ -93,7 +93,7 @@ export class Dropdown implements InteractiveComponent, OpenCloseComponent, Float * If the `selectionMode` of the selected `calcite-dropdown-item`'s containing `calcite-dropdown-group` is `"none"`, the component will always close. * */ - @Prop({ reflect: true }) disableCloseOnSelect = false; + @Prop({ reflect: true }) closeOnSelectDisabled = false; /** * When `true`, interaction is prevented and the component is displayed with lower opacity. @@ -384,7 +384,7 @@ export class Dropdown implements InteractiveComponent, OpenCloseComponent, Float item: event.detail.requestedDropdownItem }); if ( - !this.disableCloseOnSelect || + !this.closeOnSelectDisabled || event.detail.requestedDropdownGroup.selectionMode === "none" ) { this.closeCalciteDropdown(); diff --git a/src/components/dropdown/readme.md b/src/components/dropdown/readme.md index 6bf290f4af1..52c699cc0cb 100644 --- a/src/components/dropdown/readme.md +++ b/src/components/dropdown/readme.md @@ -21,10 +21,10 @@ A `calcite-dropdown` can be used to provide an absolutely positioned set of sele ### Disabling-close-on-select -You can choose to leave the dropdown open when an item is selected with the `disable-close-on-select` attribute. Note that this will only apply when the `calcite-dropdown-group` selection mode is set to `single` or `multi` - dropdowns will always close when an item in `none` selection mode is selected. +You can choose to leave the dropdown open when an item is selected with the `close-on-select-disabled` attribute. Note that this will only apply when the `calcite-dropdown-group` selection mode is set to `single` or `multi` - dropdowns will always close when an item in `none` selection mode is selected. ```html - + Open dropdown Dropdown Item Content @@ -60,19 +60,19 @@ You can combine groups in a single dropdown, with varying selection modes: ## Properties -| Property | Attribute | Description | Type | Default | -| ---------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ---------------------- | -| `disableCloseOnSelect` | `disable-close-on-select` | When `true`, the component will remain open after a selection is made. If the `selectionMode` of the selected `calcite-dropdown-item`'s containing `calcite-dropdown-group` is `"none"`, the component will always close. | `boolean` | `false` | -| `disabled` | `disabled` | When `true`, interaction is prevented and the component is displayed with lower opacity. | `boolean` | `false` | -| `flipPlacements` | -- | Defines the available placements that can be used when a flip occurs. | `Placement[]` | `undefined` | -| `maxItems` | `max-items` | Specifies the maximum number of `calcite-dropdown-item`s to display before showing a scroller. Value must be greater than `0`, and does not include `groupTitle`'s from `calcite-dropdown-group`. | `number` | `0` | -| `open` | `open` | When `true`, displays and positions the component. | `boolean` | `false` | -| `overlayPositioning` | `overlay-positioning` | Determines the type of positioning to use for the overlaid content. Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout. `"fixed"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`. | `"absolute" \| "fixed"` | `"absolute"` | -| `placement` | `placement` | Determines where the component will be positioned relative to the container element. | `"bottom" \| "bottom-end" \| "bottom-start" \| "top" \| "top-end" \| "top-start"` | `defaultMenuPlacement` | -| `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `"m"` | -| `selectedItems` | -- | Specifies the component's selected items. | `HTMLCalciteDropdownItemElement[]` | `[]` | -| `type` | `type` | Specifies the action to open the component from the container element. | `"click" \| "hover"` | `"click"` | -| `width` | `width` | Specifies the width of the component. | `"l" \| "m" \| "s"` | `undefined` | +| Property | Attribute | Description | Type | Default | +| ----------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ---------------------- | +| `closeOnSelectDisabled` | `close-on-select-disabled` | When `true`, the component will remain open after a selection is made. If the `selectionMode` of the selected `calcite-dropdown-item`'s containing `calcite-dropdown-group` is `"none"`, the component will always close. | `boolean` | `false` | +| `disabled` | `disabled` | When `true`, interaction is prevented and the component is displayed with lower opacity. | `boolean` | `false` | +| `flipPlacements` | -- | Defines the available placements that can be used when a flip occurs. | `Placement[]` | `undefined` | +| `maxItems` | `max-items` | Specifies the maximum number of `calcite-dropdown-item`s to display before showing a scroller. Value must be greater than `0`, and does not include `groupTitle`'s from `calcite-dropdown-group`. | `number` | `0` | +| `open` | `open` | When `true`, displays and positions the component. | `boolean` | `false` | +| `overlayPositioning` | `overlay-positioning` | Determines the type of positioning to use for the overlaid content. Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout. `"fixed"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`. | `"absolute" \| "fixed"` | `"absolute"` | +| `placement` | `placement` | Determines where the component will be positioned relative to the container element. | `"bottom" \| "bottom-end" \| "bottom-start" \| "top" \| "top-end" \| "top-start"` | `defaultMenuPlacement` | +| `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `"m"` | +| `selectedItems` | -- | Specifies the component's selected items. | `HTMLCalciteDropdownItemElement[]` | `[]` | +| `type` | `type` | Specifies the action to open the component from the container element. | `"click" \| "hover"` | `"click"` | +| `width` | `width` | Specifies the width of the component. | `"l" \| "m" \| "s"` | `undefined` | ## Events diff --git a/src/components/dropdown/usage/Disabling-close-on-select.md b/src/components/dropdown/usage/Disabling-close-on-select.md index b0e2469873e..cb3d543b2e2 100644 --- a/src/components/dropdown/usage/Disabling-close-on-select.md +++ b/src/components/dropdown/usage/Disabling-close-on-select.md @@ -1,7 +1,7 @@ -You can choose to leave the dropdown open when an item is selected with the `disable-close-on-select` attribute. Note that this will only apply when the `calcite-dropdown-group` selection mode is set to `single` or `multi` - dropdowns will always close when an item in `none` selection mode is selected. +You can choose to leave the dropdown open when an item is selected with the `close-on-select-disabled` attribute. Note that this will only apply when the `calcite-dropdown-group` selection mode is set to `single` or `multi` - dropdowns will always close when an item in `none` selection mode is selected. ```html - + Open dropdown Dropdown Item Content diff --git a/src/components/input-time-picker/input-time-picker.tsx b/src/components/input-time-picker/input-time-picker.tsx index 8080c852a75..9282f68b080 100644 --- a/src/components/input-time-picker/input-time-picker.tsx +++ b/src/components/input-time-picker/input-time-picker.tsx @@ -607,7 +607,7 @@ export class InputTimePicker />
{ const page = await newE2EPage(); await page.setContent(""); const modal = await page.find("calcite-modal"); - modal.setProperty("disableCloseButton", true); + modal.setProperty("closeButtonDisabled", true); await page.waitForChanges(); const closeButton = await page.find("calcite-modal >>> .close"); expect(closeButton).toBe(null); @@ -294,7 +294,7 @@ describe("calcite-modal accessibility checks", () => { it("traps focus within the modal when open and disabled close button", async () => { const page = await newE2EPage(); await page.setContent( - ` + `
@@ -338,7 +338,7 @@ describe("calcite-modal accessibility checks", () => { })); it("focuses content if there is no close button", async () => - focusable(createModalHTML(focusableContentHTML, "disable-close-button"), { + focusable(createModalHTML(focusableContentHTML, "close-button-disabled"), { focusTargetSelector: `.${focusableContentTargetClass}` })); @@ -423,7 +423,7 @@ describe("calcite-modal accessibility checks", () => { it("should not close when the scrim is clicked", async () => { const page = await newE2EPage(); - await page.setContent(``); + await page.setContent(``); const modal = await page.find("calcite-modal"); modal.setProperty("open", true); await page.waitForChanges(); @@ -433,9 +433,9 @@ describe("calcite-modal accessibility checks", () => { expect(await modal.getProperty("open")).toBe(true); }); - it("does not close when Escape is pressed and disable-escape is set", async () => { + it("does not close when Escape is pressed and escape-disabled is set", async () => { const page = await newE2EPage(); - await page.setContent(``); + await page.setContent(``); const modal = await page.find("calcite-modal"); await modal.setProperty("open", true); await page.waitForChanges(); diff --git a/src/components/modal/modal.stories.ts b/src/components/modal/modal.stories.ts index c7afe12ba14..b5041d5a6ca 100644 --- a/src/components/modal/modal.stories.ts +++ b/src/components/modal/modal.stories.ts @@ -24,7 +24,7 @@ export const simple = (): string => html` width="${select("width", ["s", "m", "l"], "s")}" ${boolean("fullscreen", false)} ${boolean("docked", false)} - ${boolean("disable-escape", false)} + ${boolean("escape-disabled", false)} intl-close="${text("intl-close", "Close")}" >

Small Modal

@@ -50,7 +50,7 @@ export const darkThemeRTLCustomSize_TestOnly = (): string => html` width="${number("width", 300)}" ${boolean("fullscreen", false)} ${boolean("docked", false)} - ${boolean("disable-escape", false)} + ${boolean("escape-disabled", false)} intl-close="${text("intl-close", "Close")}" >

Small Modal

diff --git a/src/components/modal/modal.tsx b/src/components/modal/modal.tsx index ed9b3a8f303..a3f9870e3bc 100644 --- a/src/components/modal/modal.tsx +++ b/src/components/modal/modal.tsx @@ -92,24 +92,24 @@ export class Modal beforeClose: (el: HTMLElement) => Promise = () => Promise.resolve(); /** When `true`, disables the component's close button. */ - @Prop({ reflect: true }) disableCloseButton = false; + @Prop({ reflect: true }) closeButtonDisabled = false; /** * When `true`, prevents focus trapping. */ - @Prop({ reflect: true }) disableFocusTrap = false; + @Prop({ reflect: true }) focusTrapDisabled = false; - @Watch("disableFocusTrap") - handleDisableFocusTrap(disableFocusTrap: boolean): void { + @Watch("focusTrapDisabled") + handlefocusTrapDisabled(focusTrapDisabled: boolean): void { if (!this.open) { return; } - disableFocusTrap ? deactivateFocusTrap(this) : activateFocusTrap(this); + focusTrapDisabled ? deactivateFocusTrap(this) : activateFocusTrap(this); } /** When `true`, disables the closing of the component when clicked outside. */ - @Prop({ reflect: true }) disableOutsideClose = false; + @Prop({ reflect: true }) outsideCloseDisabled = false; /** * Accessible name for the component's close button. @@ -122,7 +122,7 @@ export class Modal @Prop({ reflect: true }) docked: boolean; /** When `true`, disables the default close on escape behavior. */ - @Prop({ reflect: true }) disableEscape = false; + @Prop({ reflect: true }) escapeDisabled = false; /** Specifies the size of the component. */ @Prop({ reflect: true }) scale: Scale = "m"; @@ -252,7 +252,7 @@ export class Modal } renderCloseButton(): VNode { - return !this.disableCloseButton ? ( + return !this.closeButtonDisabled ? (