From d97f84f8793824df51fa1b9b9304c89d2cb69772 Mon Sep 17 00:00:00 2001 From: wangchangqi Date: Sat, 14 Jan 2023 16:55:29 +0800 Subject: [PATCH] =?UTF-8?q?(chore)=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89=E5=92=8C=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/base/global-style.ts | 6 +++++- src/components/dialog/alert-dialog.ts | 4 ++-- src/components/dialog/base-dialog.ts | 6 ++++-- src/components/dialog/confirm-dialog.ts | 6 +++--- src/components/dialog/prompt-dialog.ts | 6 +++--- src/components/dialog/select-dialog.ts | 8 ++++---- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/components/base/global-style.ts b/src/components/base/global-style.ts index 329cf17..767875c 100644 --- a/src/components/base/global-style.ts +++ b/src/components/base/global-style.ts @@ -292,7 +292,6 @@ const baseStyle = css` --font-main-black: #262626; /* 文字/正文次白 */ --font-secondary-white: #e0e0e0; - --font-normal-color: var(--font-main-black); /* 文字/底色黑 */ --font-base-black: var(--pure-black); /* 文字/底色白 */ @@ -328,6 +327,8 @@ const baseStyle = css` /* 文字/渐变银 */ --font-gradient-silver: var(--gradient-silver); /***************************文字通用颜色************************************/ + --font-normal-color: var(--font-main-black); + --font-normal-auxiliary-color: var(--font-sec-auxiliary-black); /* TBD: 颜色和实际还有冲突, 抽象...em */ /****************************文字尺寸*************************************/ /* 字体/超小尺寸/ */ @@ -390,6 +391,7 @@ const baseDarkStyle = css` :root { /****************************文字颜色*************************************/ --font-normal-color: var(--font-secondary-white); + --font-normal-auxiliary-color: var(--font-sec-auxiliary-white); /*****************************基础色**************************************/ --base-normal-bgc: var(--base-slider-black); } @@ -830,6 +832,7 @@ const darkStyle = css` --dialog-content: var(--font-secondary-white); --dialog-checkbox: var(--font-sec-auxiliary-white); + /* Li */ --li-label: var(--font-secondary-white); --li-square: var(--font-auxiliary-white); --li-bg-pressed: var(--opacity-white-12); @@ -838,6 +841,7 @@ const darkStyle = css` --li-value-default: var(--font-auxiliary-white); --li-description: var(--font-sec-auxiliary-white); --li-icon: var(--linear-icon-white); + --li-input: var(--font-sec-auxiliary-white); /* Card */ --card-label: var(--font-secondary-white); diff --git a/src/components/dialog/alert-dialog.ts b/src/components/dialog/alert-dialog.ts index 5123dfb..76f3366 100644 --- a/src/components/dialog/alert-dialog.ts +++ b/src/components/dialog/alert-dialog.ts @@ -7,7 +7,7 @@ import { customElement, query, } from '@star-web-components/base/star-base-element.js' -import StarBaseDialog from './base-dialog.js' +import StarBaseDialog, {EventCallback} from './base-dialog.js' import alertDialogStyles from './alert-dialog.css.js' import '@star-web-components/button/button.js' import '@star-web-components/button-group/button-group.js' @@ -17,7 +17,7 @@ interface AlertDialogOptions { text?: string /* alert的正文 */ checkBoxText?: string confirm?: string - onconfirm?: () => void + onconfirm?: EventCallback } @customElement('star-alert-dialog') diff --git a/src/components/dialog/base-dialog.ts b/src/components/dialog/base-dialog.ts index 5f4af91..a4876ce 100644 --- a/src/components/dialog/base-dialog.ts +++ b/src/components/dialog/base-dialog.ts @@ -10,6 +10,8 @@ import baseDialogStyles from './base-dialog.css.js' const USE_DIALOG = 0 +export type EventCallback = (e: Event) => void + export default class StarBaseDialog extends StarBaseElement { title!: string @@ -25,9 +27,9 @@ export default class StarBaseDialog extends StarBaseElement { confirm!: string - onconfirm!: (e: Event) => void + onconfirm!: EventCallback - oncancel!: (e: Event) => void + oncancel!: EventCallback @query('dialog') dialog!: HTMLDialogElement diff --git a/src/components/dialog/confirm-dialog.ts b/src/components/dialog/confirm-dialog.ts index ca69d9a..9ab12c8 100644 --- a/src/components/dialog/confirm-dialog.ts +++ b/src/components/dialog/confirm-dialog.ts @@ -5,7 +5,7 @@ import { TemplateResult, nothing, } from '@star-web-components/base/star-base-element.js' -import StarBaseDialog from './base-dialog.js' +import StarBaseDialog, {EventCallback} from './base-dialog.js' import confirmDialogStyles from './confirm-dialog.css.js' import '@star-web-components/button/button.js' import '@star-web-components/button-group/button-group.js' @@ -17,8 +17,8 @@ interface ConfirmDialogOptions { checkBoxText?: string cancel?: string confirm?: string - oncancel?: () => void - onconfirm?: () => void + oncancel?: EventCallback + onconfirm?: EventCallback } @customElement('star-confirm-dialog') diff --git a/src/components/dialog/prompt-dialog.ts b/src/components/dialog/prompt-dialog.ts index ce0b99b..7f6029f 100644 --- a/src/components/dialog/prompt-dialog.ts +++ b/src/components/dialog/prompt-dialog.ts @@ -8,7 +8,7 @@ import { CSSResultArray, TemplateResult, } from '@star-web-components/base/star-base-element.js' -import StarBaseDialog from './base-dialog.js' +import StarBaseDialog, {EventCallback} from './base-dialog.js' import promptDialogStyles from './prompt-dialog.css.js' import '@star-web-components/button/button.js' import '@star-web-components/button-group/button-group.js' @@ -19,8 +19,8 @@ interface PromptDialogOptions { value?: string cancel?: string confirm?: string - oncancel?: () => void - onconfirm?: () => void + oncancel?: EventCallback + onconfirm?: EventCallback } @customElement('star-prompt-dialog') diff --git a/src/components/dialog/select-dialog.ts b/src/components/dialog/select-dialog.ts index 55c27a2..8415734 100644 --- a/src/components/dialog/select-dialog.ts +++ b/src/components/dialog/select-dialog.ts @@ -7,7 +7,7 @@ import { CSSResultArray, TemplateResult, } from '@star-web-components/base/star-base-element.js' -import StarBaseDialog from './base-dialog.js' +import StarBaseDialog, {EventCallback} from './base-dialog.js' import selectDialogStyles from './select-dialog.css.js' import '@star-web-components/button/button.js' import '@star-web-components/button-group/button-group.js' @@ -23,9 +23,9 @@ interface SelectDialogOptions { image?: string cancel?: string confirm?: string - oncancel?: () => void - onconfirm?: (e: Event) => void - onselect?: (e: Event) => void + oncancel?: EventCallback + onconfirm?: EventCallback + onselect?: EventCallback multiple?: boolean optionsSlot: StarLi[] | TemplateResult }