Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(chip,card,combobox,date-picker,flow,flow-item,filter, input-date-picker)!: remove deprecated intl* & accessible label properties #6041

Merged
merged 6 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions src/components/card/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,6 @@ export class Card implements ConditionalSlotComponent, LocalizedComponent, T9nCo
/** When `true`, the component is selectable. */
@Prop({ reflect: true }) selectable = false;

/**
* 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 `selectable` is `true`, the accessible name for the component's checkbox for selection.
*
* @default "Select"
*/
@Prop({ reflect: false }) intlSelect?: string;

/**
* When `selectable` is `true`, the accessible name for the component's checkbox for deselection.
*
* @default "Deselect"
*/
@Prop({ reflect: false }) intlDeselect?: string;

/** Sets the placement of the thumbnail defined in the `thumbnail` slot. */
@Prop({ reflect: true }) thumbnailPosition: LogicalFlowPosition = "block-start";

Expand All @@ -108,9 +86,6 @@ export class Card implements ConditionalSlotComponent, LocalizedComponent, T9nCo
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlLoading")
@Watch("intlDeselect")
@Watch("intlSelect")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
2 changes: 1 addition & 1 deletion src/components/chip/chip.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,5 @@ describe("calcite-chip", () => {
});
});

it("supports translation", () => t9n("calcite-chip", false, ["dismissLabel"]));
it("supports translation", () => t9n("calcite-chip"));
});
19 changes: 0 additions & 19 deletions src/components/chip/chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ export class Chip
/** When `true`, a close button is added to the component. */
@Prop({ reflect: true, mutable: true }) closable = false;

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

/** Specifies an icon to display. */
@Prop({ reflect: true }) icon: string;

Expand Down Expand Up @@ -99,7 +91,6 @@ export class Chip
*/
@Prop({ mutable: true }) messages: Messages;

@Watch("dismissLabel")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down Expand Up @@ -191,16 +182,6 @@ export class Chip

private guid: string = guid();

getExtraMessageOverrides(): Partial<Messages> {
const extraOverrides: Partial<Messages> = {};

if (this.dismissLabel) {
extraOverrides.dismissLabel = this.dismissLabel;
}

return extraOverrides;
}

//--------------------------------------------------------------------------
//
// Render Methods
Expand Down
154 changes: 0 additions & 154 deletions src/components/color-picker/color-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,140 +131,6 @@ export class ColorPicker
/** When `true`, hides the saved colors section. */
@Prop({ reflect: true }) hideSaved = false;

/**
* Accessible name for the RGB section's blue channel.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlB: string;

/**
* Accessible name for the RGB section's blue channel description.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlBlue: string;

/**
* Accessible name for the delete color button.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlDeleteColor: string;

/**
* Accessible name for the RGB section's green channel.
*
* @default "G"
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlG: string;

/**
* Accessible name for the RGB section's green channel description.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlGreen: string;

/**
* Accessible name for the HSV section's hue channel.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlH: string;

/**
* Accessible name for the HSV mode.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlHsv: string;

/**
* Accessible name for the Hex input.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlHex: string;

/**
* Accessible name for the HSV section's hue channel description.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlHue: string;

/**
* Accessible name for the Hex input when there is no color selected.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlNoColor: string;

/**
* Accessible name for the RGB section's red channel.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlR: string;

/**
* Accessible name for the RGB section's red channel description.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlRed: string;

/**
* Accessible name for the RGB mode.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlRgb: string;

/**
* Accessible name for the HSV section's saturation channel.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlS: string;

/**
* Accessible name for the HSV section's saturation channel description.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlSaturation: string;

/**
* Accessible name for the save color button.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlSaveColor: string;

/**
* Accessible name for the saved colors section.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlSaved: string;

/**
* Accessible name for the HSV section's value channel.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlV: string;

/**
* Accessible name for the HSV section's value channel description.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlValue: string;

/** Specifies the size of the component. */
@Prop({ reflect: true }) scale: Scale = "m";

Expand All @@ -282,26 +148,6 @@ export class ColorPicker
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlG")
@Watch("intlB")
@Watch("intlV")
@Watch("intlBlue")
@Watch("intlDeleteColor")
@Watch("intlGreen")
@Watch("intlH")
@Watch("intlHsv")
@Watch("intlHex")
@Watch("intlHue")
@Watch("intlNoColor")
@Watch("intlR")
@Watch("intlRed")
@Watch("intlRgb")
@Watch("intlS")
@Watch("intlSaturation")
@Watch("intlSaveColor")
@Watch("intlSaved")
@Watch("intlV")
@Watch("intlValue")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
11 changes: 1 addition & 10 deletions src/components/combobox/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ export class Combobox
}
}

/**
* Accessible name for the component's remove tag when a `calcite-combobox-item` is selected.
*
* @default "Remove tag"
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`.
*/
@Prop({ reflect: false }) intlRemoveTag: string;

/**
* Defines the available placements that can be used when a flip occurs.
*/
Expand All @@ -238,7 +230,6 @@ export class Combobox
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlRemoveTag")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down Expand Up @@ -1074,10 +1065,10 @@ export class Combobox
<calcite-chip
class={chipClasses}
closable
dismissLabel={messages.removeTag}
icon={item.icon}
id={item.guid ? `${chipUidPrefix}${item.guid}` : null}
key={item.textLabel}
messageOverrides={{ dismissLabel: messages.removeTag }}
onCalciteChipClose={() => this.calciteChipCloseHandler(item)}
scale={scale}
title={label}
Expand Down
16 changes: 0 additions & 16 deletions src/components/date-picker/date-picker.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@ const createAttributes: (options?: { exceptions: string[] }) => Attributes = ({
return this;
}
},
{
name: "intl-next-month",
commit(): Attribute {
this.value = text("intl-next-month", "Next month");
delete this.build;
return this;
}
},
{
name: "intl-prev-month",
commit(): Attribute {
this.value = text("intl-prev-month", "Previous month");
delete this.build;
return this;
}
},
{
name: "lang",
commit(): Attribute {
Expand Down
27 changes: 0 additions & 27 deletions src/components/date-picker/date-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,30 +142,6 @@ export class DatePicker implements LocalizedComponent, T9nComponent {
}
}

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

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

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

/**
* Specifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed.
*
Expand Down Expand Up @@ -193,9 +169,6 @@ export class DatePicker implements LocalizedComponent, T9nComponent {
*/
@Prop({ mutable: true }) messages: Messages;

@Watch("intlNextMonth")
@Watch("intlPrevMonth")
@Watch("intlYear")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
16 changes: 0 additions & 16 deletions src/components/filter/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ export class Filter
*/
@Prop({ mutable: true }) filteredItems: object[] = [];

/**
* A text label that will appear on the clear button.
*
* @deprecated – translations are now built-in, if you need to override a string, please use `messageOverrides`.
*/
@Prop() intlClear: string;

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

/**
* Specifies placeholder text for the input element.
*/
Expand Down Expand Up @@ -116,8 +102,6 @@ export class Filter
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlClear")
@Watch("intlLabel")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
Expand Down
Loading