-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: implement .fire() to replace dispatchCustomEvent helper
- Loading branch information
Showing
18 changed files
with
205 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { customElement } from 'lit/decorators.js'; | ||
|
||
import { appDatePickerDialogBaseName } from './constants.js'; | ||
import { DatePickerDialogBase } from './date-picker-dialog-base.js'; | ||
|
||
@customElement(appDatePickerDialogBaseName) | ||
export class AppDatePickerDialogBase extends DatePickerDialogBase {} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
[appDatePickerDialogBaseName]: AppDatePickerDialogBase; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const appDatePickerDialogBaseName = 'app-date-picker-dialog-base' as const; | ||
export const appDatePickerDialogName = 'app-date-picker-dialog' as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Dialog } from '@material/mwc-dialog'; | ||
|
||
import { datePickerDialogBaseStyling } from './stylings.js'; | ||
|
||
export class DatePickerDialogBase extends Dialog { | ||
public static override styles = [ | ||
...Dialog.styles, | ||
datePickerDialogBaseStyling, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { css, unsafeCSS } from 'lit'; | ||
|
||
import { appDatePickerDialogName } from './constants.js'; | ||
|
||
export const datePickerDialogBaseStyling = css` | ||
:host { | ||
display: block; | ||
} | ||
.mdc-dialog__content { | ||
padding: 0; | ||
} | ||
`; | ||
|
||
export const datePickerDialogStyling = css` | ||
${unsafeCSS(appDatePickerDialogName)} { | ||
display: block; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Dialog } from '@material/mwc-dialog'; | ||
|
||
export interface DatePickerDialogProperties extends DialogProperties { | ||
confirmLabel: string; | ||
dismissLabel: string; | ||
resetLabel: string; | ||
show(): void; | ||
} | ||
|
||
export interface DialogClosingEventDetail { | ||
action: DialogClosingEventDetailAction; | ||
} | ||
|
||
export type DialogClosingEventDetailAction = 'cancel' | 'reset' | 'set'; | ||
|
||
type DialogProperties = Pick<Dialog, 'open'>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.