Skip to content

Commit

Permalink
refactor(action,action-bar,action-group,action-pad,alert,block-sectio…
Browse files Browse the repository at this point in the history
…n,block,button): remove deprecated `intl*` properties (#5982)

BREAKING CHANGE: Removed deprecated `intl*` properties , use
`messageOverrides` property instead.

- action:
* Removed the property `intlLoading` , use `messsageOverrides.loading`
instead.
* Removed the property `intlIndicator`, use `messageOverrides.indicator`
instead.

- action-bar:
* Removed the property `intlExpand` , use `messsageOverrides.expand`
instead.
* Removed the property `intlCollapse`, use `messageOverrides.collapse`
instead.

- action-group:
* Removed the property `intlMore` , use `messsageOverrides.more`
instead.

- action-pad:
* Removed the property `intlExpand` , use `messsageOverrides.expand`
instead.
* Removed the property `intlCollapse`, use `messageOverrides.collapse`
instead.

- alert:
* Removed the property `intlClose`, use `messageOverrides.close`
instead.

- block:
* Removed the property `intlExpand` , use `messsageOverrides.expand`
instead.
* Removed the property `intlCollapse`, use `messageOverrides.collapse`
instead.
* Removed the property `intlLoading` , use `messsageOverrides.loading`
instead.
* Removed the property `intlOptions`, use `messageOverrides.options`
instead.

- block-section:
* Removed the property `intlExpand` , use `messsageOverrides.expand`
instead.
* Removed the property `intlCollapse`, use `messageOverrides.collapse`
instead.

- button:
* Removed the property `intlLoading` , use `messsageOverrides.loading`
instead.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: JC Franco <[email protected]>
Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: jona7150 <[email protected]>
Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: Calcite Admin <[email protected]>
Co-authored-by: jcfranco <[email protected]>
Co-authored-by: Kitty Hurley <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eliza Khachatryan <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Driscoll <[email protected]>
Co-authored-by: Alison Stump <[email protected]>
  • Loading branch information
13 people authored Dec 15, 2022
1 parent 77ee23c commit 88040c8
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 163 deletions.
17 changes: 0 additions & 17 deletions src/components/action-bar/action-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,6 @@ export class ActionBar
this.conditionallyOverflowActions();
}

/**
* Specifies the label of the expand icon when the component is collapsed.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlExpand: string;

/**
* Specifies the label of the collapse icon when the component is expanded.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlCollapse: string;

/**
* The layout direction of the actions.
*/
Expand Down Expand Up @@ -139,8 +125,6 @@ export class ActionBar
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlCollapse")
@Watch("intlExpand")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down Expand Up @@ -348,7 +332,6 @@ export class ActionBar
<ExpandToggle
el={el}
expanded={expanded}
// rename intl properties for 1.0
intlCollapse={messages.collapse}
intlExpand={messages.expand}
position={position}
Expand Down
8 changes: 0 additions & 8 deletions src/components/action-group/action-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ export class ActionGroup implements ConditionalSlotComponent, LocalizedComponent
*/
@Prop({ reflect: true }) columns: Columns;

/**
* Specifies a text string for the `calcite-action-menu`.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlMore: string;

/**
* When `true`, the `calcite-action-menu` is open.
*/
Expand All @@ -87,7 +80,6 @@ export class ActionGroup implements ConditionalSlotComponent, LocalizedComponent
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlMore")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
16 changes: 0 additions & 16 deletions src/components/action-pad/action-pad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ export class ActionPad
*/
@Prop({ reflect: true }) layout: Layout = "vertical";

/**
* Specifies the label of the expand icon when the component is collapsed.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlExpand: string;

/**
* Specifies the label of the collapse icon when the component is expanded.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlCollapse: string;

/**
* Arranges the component depending on the element's `dir` property.
*/
Expand All @@ -111,8 +97,6 @@ export class ActionPad
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlCollapse")
@Watch("intlExpand")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
6 changes: 3 additions & 3 deletions src/components/action/action.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { newE2EPage } from "@stencil/core/testing";
import { accessible, disabled, hidden, renders, slots, t9n, defaults } from "../../tests/commonTests";
import { CSS, SLOTS, TEXT } from "./resources";
import { CSS, SLOTS } from "./resources";

describe("calcite-action", () => {
it("has property defaults", async () =>
Expand Down Expand Up @@ -136,7 +136,7 @@ describe("calcite-action", () => {
await page.setContent(`<calcite-action indicator text="hello world"></calcite-action>`);

const button = await page.find(`calcite-action >>> .${CSS.button}`);
expect(button.getAttribute("aria-label")).toBe(`hello world (${TEXT.indicator})`);
expect(button.getAttribute("aria-label")).toBe(`hello world (Indicator present)`);
});

it("should have label", async () => {
Expand Down Expand Up @@ -192,6 +192,6 @@ describe("calcite-action", () => {

expect(liveRegion.getAttribute("aria-live")).toBe("polite");
expect(liveRegion.getAttribute("role")).toBe("region");
expect(liveRegion.textContent).toBe(TEXT.indicator);
expect(liveRegion.textContent).toBe("Indicator present");
});
});
20 changes: 1 addition & 19 deletions src/components/action/action.tsx
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Build
} from "@stencil/core";
import { Alignment, Appearance, Scale } from "../interfaces";
import { CSS, TEXT, SLOTS } from "./resources";
import { CSS, SLOTS } from "./resources";
import { guid } from "../../utils/guid";
import { createObserver } from "../../utils/observers";
import { InteractiveComponent, updateHostInteraction } from "../../utils/interactive";
Expand Down Expand Up @@ -82,21 +82,6 @@ export class Action
*/
@Prop({ reflect: true }) indicator = false;

/**
* When `indicator` is `true`, specifies the accessible context of the `indicator`.
*
* @default "Indicator present"
*/
@Prop() intlIndicator: string = TEXT.indicator;

/**
* Specifies the text label to display while loading.
*
* @default "Loading"
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlLoading?: string;

/**
* Specifies the label of the component. If no label is provided, the label inherits what's provided for the `text` prop.
*/
Expand Down Expand Up @@ -134,8 +119,6 @@ export class Action
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlLoading")
@Watch("intlIndicator")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down Expand Up @@ -295,7 +278,6 @@ export class Action
buttonId,
messages
} = this;

const ariaLabel = `${label || text}${indicator ? ` (${messages.indicator})` : ""}`;

const buttonClasses = {
Expand Down
3 changes: 2 additions & 1 deletion src/components/action/assets/action/t9n/messages_en.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"loading": "Loading"
"loading": "Loading",
"indicator": "Indicator present"
}
5 changes: 0 additions & 5 deletions src/components/action/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ export const CSS = {
textContainerVisible: "text-container--visible"
};

export const TEXT = {
loading: "Loading",
indicator: "indicator present"
};

export const SLOTS = {
tooltip: "tooltip"
};
9 changes: 0 additions & 9 deletions src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen
*/
@Prop({ reflect: true }) icon: string | boolean;

/**
* Specifies the text label for the close button.
*
* @default "Close"
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlClose: string;

/** Specifies an accessible name for the component. */
@Prop() label!: string;

Expand All @@ -143,7 +135,6 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlClose")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
16 changes: 0 additions & 16 deletions src/components/block-section/block-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ export class BlockSection implements LocalizedComponent, T9nComponent {
//
// --------------------------------------------------------------------------

/**
* Accessible name for the component's collapse button.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlCollapse: string;

/**
* Accessible name for the component's expand button.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlExpand: string;

/**
* When `true`, expands the component and its contents.
*/
Expand Down Expand Up @@ -93,8 +79,6 @@ export class BlockSection implements LocalizedComponent, T9nComponent {
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlCollapse")
@Watch("intlExpand")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
24 changes: 0 additions & 24 deletions src/components/block/block.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,6 @@ const createBlockAttributes: (options?: { exceptions: string[] }) => Attributes
delete this.build;
return this;
}
},
{
name: "intl-collapse",
commit(): Attribute {
this.value = text("intlCollapse", "Collapse", group);
delete this.build;
return this;
}
},
{
name: "intl-expand",
commit(): Attribute {
this.value = text("intlExpand", "Expand", group);
delete this.build;
return this;
}
}
],
exceptions
Expand All @@ -123,14 +107,6 @@ const createSectionAttributes: () => Attributes = () => {
{
name: "toggle-display",
value: select("toggleDisplay", toggleDisplayOptions, toggleDisplayOptions[0], group)
},
{
name: "intl-collapse",
value: text("intlCollapse", "Collapse", group)
},
{
name: "intl-expand",
value: text("intlExpand", "Expand", group)
}
];
};
Expand Down
36 changes: 0 additions & 36 deletions src/components/block/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,6 @@ export class Block
*/
@Prop({ reflect: true }) headingLevel: HeadingLevel;

/**
* Accessible name for the component's collapse button.
*
* @default "Collapse"
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlCollapse?: string;

/**
* Accessible name for the component's expand button.
*
* @default "Expand"
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlExpand?: string;

/**
* Accessible name when the component is loading.
*
* @default "Loading"
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlLoading?: string;

/**
* Accessible name for the component's options button.
*
* @default "Options"
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlOptions?: string;

/**
* When `true`, a busy indicator is displayed.
*/
Expand Down Expand Up @@ -141,10 +109,6 @@ export class Block
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlCollapse")
@Watch("intlExpand")
@Watch("intlLoading")
@Watch("intlOptions")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
9 changes: 0 additions & 9 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ export class Button
/** Specifies an icon to display at the start of the component. */
@Prop({ reflect: true }) iconStart: string;

/**
* Accessible name when the component is loading.
*
* @default "Loading"
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlLoading?: string;

/**
* When `true`, a busy indicator is displayed and interaction is disabled.
*/
Expand Down Expand Up @@ -166,7 +158,6 @@ export class Button
}
}

@Watch("intlLoading")
@Watch("messageOverrides")
onMessagesChange(): void {
/** referred in t9n util */
Expand Down

0 comments on commit 88040c8

Please sign in to comment.