Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Sep 12, 2021
1 parent 190167d commit 952a7ed
Show file tree
Hide file tree
Showing 9 changed files with 597 additions and 547 deletions.
7 changes: 4 additions & 3 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/sh
if [ -z "$husky_skip_init" ]; then
debug () {
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}

readonly hook_name="$(basename "$0")"
Expand All @@ -23,8 +25,7 @@ if [ -z "$husky_skip_init" ]; then

if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
exit $exitCode
fi

exit 0
exit $exitCode
fi
1,071 changes: 560 additions & 511 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,25 @@
]
},
"dependencies": {
"@material/mwc-base": "^0.21.0",
"@material/mwc-button": "^0.21.0",
"@material/mwc-icon-button": "^0.21.0",
"lit": "^2.0.0-rc.2",
"nodemod": "^2.8.4",
"tslib": "^2.2.0"
"@material/mwc-base": "^0.23.0-canary.3fae6c2d.0",
"@material/mwc-button": "^0.23.0-canary.3fae6c2d.0",
"@material/mwc-icon-button": "^0.23.0-canary.3fae6c2d.0",
"lit": "^2.0.0-rc.4",
"nodemod": "^3.0.0",
"tslib": "^2.3.1"
},
"devDependencies": {
"@commitlint/config-conventional": "^12.1.4",
"@commitlint/config-conventional": "^13.1.0",
"@reallyland/tsconfig": "^3.0.2",
"@skypack/package-check": "^0.2.2",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"eslint-plugin-lit": "^1.4.1",
"eslint-plugin-lit-a11y": "^1.0.1",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-regexp": "^0.12.1",
"eslint-plugin-regexp": "^1.1.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"typescript": "^4.3.2"
"typescript": "^4.4.3"
},
"engines": {
"node": ">= 14.x",
Expand Down
14 changes: 7 additions & 7 deletions src/date-picker/date-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class DatePicker extends DatePickerMixin(DatePickerMinMaxMixin(LitElement
private readonly _TODAY_DATE: Date;
//#endregion private properties

public static styles = [
public static override styles = [
resetShadowRoot,
datePickerStyling,
webkitScrollbarStyling,
Expand All @@ -96,7 +96,7 @@ export class DatePicker extends DatePickerMixin(DatePickerMinMaxMixin(LitElement
this.valueAsNumber = +todayDate;
}

public willUpdate(changedProperties: DatePickerChangedProperties): void {
public override willUpdate(changedProperties: DatePickerChangedProperties): void {
if (changedProperties.has('locale')) {
this.#formatters = toFormatters(this.locale);
}
Expand Down Expand Up @@ -162,7 +162,7 @@ export class DatePicker extends DatePickerMixin(DatePickerMinMaxMixin(LitElement
}
}

protected firstUpdated(): void {
protected override firstUpdated(): void {
const focusableElements: HTMLElement[] = [];

// TODO: focus element
Expand All @@ -179,7 +179,7 @@ export class DatePicker extends DatePickerMixin(DatePickerMinMaxMixin(LitElement
});
}

protected async updated(
protected override async updated(
changedProperties: DatePickerChangedProperties
): Promise<void> {
if (this.startView === 'calendar') {
Expand All @@ -199,7 +199,7 @@ export class DatePicker extends DatePickerMixin(DatePickerMinMaxMixin(LitElement
}

// FIXME: To not render min and max buttons
protected render(): TemplateResult {
protected override render(): TemplateResult {
const formatters = this.#formatters;
const currentDate = this._currentDate;
const selectedDate = this._selectedDate;
Expand All @@ -224,7 +224,7 @@ export class DatePicker extends DatePickerMixin(DatePickerMinMaxMixin(LitElement
<mwc-icon-button
class=month-dropdown
label=${this.yearDropdownLabel}
ariaLabel=${this.yearDropdownLabel}
@click=${this.#updateStartView}
>${iconArrowDropdown}</mwc-icon-button>
</div>
Expand Down Expand Up @@ -334,7 +334,7 @@ export class DatePicker extends DatePickerMixin(DatePickerMinMaxMixin(LitElement
return shouldRender ? html`
<mwc-icon-button
data-navigation=${navigationType}
label=${isPreviousNavigationType ? this.previousMonthLabel : this.nextMonthLabel}
ariaLabel=${isPreviousNavigationType ? this.previousMonthLabel : this.nextMonthLabel}
@click=${this.#navigateMonth}
>${isPreviousNavigationType ? iconChevronLeft : iconChevronRight}</mwc-icon-button>
` : html`<div data-navigation=${navigationType}></div>`;
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/split-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type splitString = {
export function splitString<SourceType extends string = string, ReturnType = string>(
source: SourceType,
callbackFn?: SplitStringCallbackFn<ReturnType>,
separator: RegExp | string = /,\s*/i
separator: RegExp | string = /,\s*/
): ReturnType[] {
const dateList = typeof source === 'string' && source.length > 0
? source.split(separator) as unknown as ReturnType[]
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/to-resolved-date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type { MaybeDate } from './typings.js';
export function toResolvedDate(date?: MaybeDate): Date {
const dateDate = date == null ? new Date() : new Date(date);
const isUTCDateFormat = typeof date === 'string' && (
/^\d{4}-\d{2}-\d{2}$/i.test(date) ||
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}(Z|\+00:00|-00:00)$/i.test(date));
/^\d{4}-\d{2}-\d{2}$/.test(date) ||
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}(?:Z|\+00:00|-00:00)$/.test(date));
const isUnixTimestamp = typeof date === 'number' && date > 0 && isFinite(date);

let fy = dateDate.getFullYear();
Expand Down
10 changes: 5 additions & 5 deletions src/month-calendar/month-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export class MonthCalendar extends LitElement implements MonthCalendarProperties
*/
#shouldFocusSelectedDate = false;

public static shadowRootOptions = {
public static override shadowRootOptions = {
...LitElement.shadowRootOptions,
delegatesFocus: true,
};

public static styles = [
public static override styles = [
baseStyling,
resetShadowRoot,
monthCalendarStyling,
Expand All @@ -63,18 +63,18 @@ export class MonthCalendar extends LitElement implements MonthCalendarProperties
};
}

protected shouldUpdate(): boolean {
protected override shouldUpdate(): boolean {
return this.data.formatters != null;
}

protected async updated(): Promise<void> {
protected override async updated(): Promise<void> {
if (this.#shouldFocusSelectedDate) {
await focusElement(this.selectedCalendarDay);
this.#shouldFocusSelectedDate = false;
}
}

protected render(): TemplateResult | typeof nothing {
protected override render(): TemplateResult | typeof nothing {
const {
calendar,
date,
Expand Down
8 changes: 4 additions & 4 deletions src/year-grid-button/year-grid-button.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ButtonBase } from '@material/mwc-button/mwc-button-base.js';
import { style } from '@material/mwc-button/styles-css.js';
import { styles } from '@material/mwc-button/styles.css';

import { yearGridButtonStyling } from './stylings.js';

export class YearGridButton extends ButtonBase {
static styles = [
style,
static override styles = [
styles,
// FIXME(motss): Remove this hack once @material updates to use latest lit
yearGridButtonStyling as unknown as typeof style,
yearGridButtonStyling as unknown as typeof styles,
];
}
10 changes: 5 additions & 5 deletions src/year-grid/year-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class YearGrid extends LitElement implements YearGridProperties {
@queryAsync('button[data-year][aria-selected="true"]')
public selectedYearGridButton!: Promise<HTMLButtonElement | null>;

public static styles = [
public static override styles = [
baseStyling,
resetButton,
resetShadowRoot,
Expand All @@ -49,21 +49,21 @@ export class YearGrid extends LitElement implements YearGridProperties {
this.#todayYear = todayDate.getUTCFullYear();
}

protected shouldUpdate(): boolean {
protected override shouldUpdate(): boolean {
return this.data.formatters != null;
}

public willUpdate(changedProperties: YearGridChangedProperties): void {
public override willUpdate(changedProperties: YearGridChangedProperties): void {
if (changedProperties.has('data')) {
this.#selectedYear = this.data.date.getUTCFullYear();
}
}

protected async firstUpdated(): Promise<void> {
protected override async firstUpdated(): Promise<void> {
await focusElement(this.selectedYearGridButton, element => element.scrollIntoView());
}

protected render(): TemplateResult | typeof nothing {
protected override render(): TemplateResult | typeof nothing {
const {
date,
formatters,
Expand Down

0 comments on commit 952a7ed

Please sign in to comment.