From 5113192ea2b1545b3f26b2e634754cb539671242 Mon Sep 17 00:00:00 2001 From: zhangbing4 Date: Mon, 15 Apr 2024 10:30:56 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E5=85=A8=E5=B1=80=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E6=B0=B4=E6=B3=A2=E7=BA=B9,close=20#984?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/button/index.vdt | 4 +-- components/checkbox/index.vdt | 4 +-- components/config/demos/disableWave.md | 47 ++++++++++++++++++++++++++ components/config/index.md | 3 +- components/config/index.ts | 4 ++- components/input/index.vdt | 4 +-- components/radio/index.vdt | 4 +-- components/select/base.vdt | 4 +-- 8 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 components/config/demos/disableWave.md diff --git a/components/button/index.vdt b/components/button/index.vdt index ac468d349..1fd2cb969 100644 --- a/components/button/index.vdt +++ b/components/button/index.vdt @@ -11,7 +11,7 @@ let { name, ghost, } = this.get(); -const { cls, k } = this.config; +const { cls, k, disableWave } = this.config; const checked = this.isChecked(); @@ -68,7 +68,7 @@ const isCheckType = checkType !== 'none'; const typeStyles = theme[type]; const waveColor = typeStyles && typeStyles.borderColor || theme.primary.borderColor; - diff --git a/components/checkbox/index.vdt b/components/checkbox/index.vdt index 706da71e5..557de9dcb 100644 --- a/components/checkbox/index.vdt +++ b/components/checkbox/index.vdt @@ -9,7 +9,7 @@ const { } = this.get(); const isChecked = this.isChecked(); -const { k } = this.config; +const { k, disableWave } = this.config; const classNameObj = { [`${k}-checkbox`]: true, @@ -46,7 +46,7 @@ const events = [ ev-keypress={this.onKeypress} {...events} > - + + + + checkbox + radio + + +``` + +```styl +.k-input, .k-input, .k-checkbox, .k-radio + margin 0 10px +``` + +```ts +interface Props { + value?: boolean, + day?: string | null +} +export default class extends Component { + static template = template; + static defaults() { + return { + value: false, + day: '' + } + } +} +``` \ No newline at end of file diff --git a/components/config/index.md b/components/config/index.md index 7cae0eabd..f70a3e2f1 100644 --- a/components/config/index.md +++ b/components/config/index.md @@ -15,6 +15,7 @@ sidebar: doc ```ts export interface ConfigProps { - classNamePrefix?: string + classNamePrefix?: string + disableWave?: boolean } ``` diff --git a/components/config/index.ts b/components/config/index.ts index 7f22176e2..dc74f27fb 100644 --- a/components/config/index.ts +++ b/components/config/index.ts @@ -2,7 +2,8 @@ import { createContext, ProviderProps } from '../context'; import { EMPTY_OBJ, Component } from 'intact'; export interface ConfigProps { - classNamePrefix?: string + classNamePrefix?: string, + disableWave?: boolean, } const { @@ -17,6 +18,7 @@ function useConfigContext() { return { cls: (name: string) => `${config.value!.classNamePrefix || 'k'}-${name}`, get k() { return config.value!.classNamePrefix || 'k' }, + get disableWave() { return config.value!.disableWave || false } } } diff --git a/components/input/index.vdt b/components/input/index.vdt index 5058f79a4..a7c1ebc2e 100644 --- a/components/input/index.vdt +++ b/components/input/index.vdt @@ -26,7 +26,7 @@ const { const { isFocus, focusInputOnClick }= this.focusHook; const isNotAutoRows = isStringOrNumber(rows) && rows !== 'auto'; -const { k } = this.config; +const { k, disableWave } = this.config; const classNameObj = { [`${k}-input`]: true, @@ -98,7 +98,7 @@ if (hasInputValue) { }} {isInvalid => { - return + return
diff --git a/components/radio/index.vdt b/components/radio/index.vdt index 075eb5ac2..0d6c8a407 100644 --- a/components/radio/index.vdt +++ b/components/radio/index.vdt @@ -7,7 +7,7 @@ const { children, value, ref, key, title, ...rest } = this.get(); const isChecked = value === trueValue; -const { k } = this.config; +const { k, disableWave } = this.config; const classNameObj = { [`${k}-radio`]: true, @@ -43,7 +43,7 @@ const events = [ ev-keypress={this.onKeypress} ev-click={this.fixClick} > - + {isInvalid => { - return + return Date: Wed, 17 Apr 2024 16:58:46 +0800 Subject: [PATCH 2/6] fix: fix ui styles --- components/menu/styles.ts | 4 ++-- components/tooltip/styles.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/components/menu/styles.ts b/components/menu/styles.ts index 2c60cbd69..d1bfd1a5f 100644 --- a/components/menu/styles.ts +++ b/components/menu/styles.ts @@ -125,6 +125,7 @@ export const makeMenuStyles = cache(function makeMenuStyles(k: string) { max-height: calc(100% - ${menu.header.height}); overflow-y: auto; overflow-x: hidden; + scrollbar-width: none; } // menu title @@ -169,8 +170,7 @@ export const makeMenuStyles = cache(function makeMenuStyles(k: string) { // theme light &.${k}-light { - border: 1px solid ${theme.color.disabledBg}; - border-top: 0; + border-right: 1px solid ${theme.color.disabledBg}; background: ${menu.light.bgColor}; .${k}-menu-header { color: ${menu.light.title.color}; diff --git a/components/tooltip/styles.ts b/components/tooltip/styles.ts index aceded859..d50e28e1a 100644 --- a/components/tooltip/styles.ts +++ b/components/tooltip/styles.ts @@ -150,7 +150,6 @@ export const makeStyles = cache(function makeStyles(k: string) { const borderDirection = directionMap[direction as keyof typeof directionMap]; return css` &.${k}-${direction} { - border-${borderDirection}-color: ${borderColor}; &:before { border-${borderDirection}-color: ${bgColor}; } From 67366a9ee25bf8eb99c38f860086eba8ef911d15 Mon Sep 17 00:00:00 2001 From: zhangbing4 Date: Wed, 17 Apr 2024 20:48:08 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20upload=20disabled=20status=20&=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4,close=20#972,=20#985?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/breadcrumb/index.ts | 2 +- components/breadcrumb/index.vdt | 6 +++++- components/menu/styles.ts | 6 +++--- components/upload/index.vdt | 5 +++-- components/upload/styles.ts | 11 +++++++++++ 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/components/breadcrumb/index.ts b/components/breadcrumb/index.ts index bbee72cd4..03e49d943 100644 --- a/components/breadcrumb/index.ts +++ b/components/breadcrumb/index.ts @@ -19,7 +19,7 @@ const typeDefs: Required> = { }; const defaults = (): Partial => ({ - separator: '>' + separator: '' }); export class Breadcrumb extends Component { diff --git a/components/breadcrumb/index.vdt b/components/breadcrumb/index.vdt index 5a53550d1..19e403578 100644 --- a/components/breadcrumb/index.vdt +++ b/components/breadcrumb/index.vdt @@ -1,6 +1,7 @@ import {getRestProps, mapChildren} from '../utils'; import {BreadcrumbItem} from './item'; import { makeStyles } from './styles'; +import { Icon } from '../icon'; const {children, separator, className} = this.get(); const { k } = this.config; @@ -13,7 +14,10 @@ const classNameObj = { const separatorVNode = ( - {separator} + + {separator} ); const vNodes = []; diff --git a/components/menu/styles.ts b/components/menu/styles.ts index d1bfd1a5f..e40b48d25 100644 --- a/components/menu/styles.ts +++ b/components/menu/styles.ts @@ -17,7 +17,7 @@ const defaults = { item: { height: '40px', - padding: '0 17px', + padding: '0 12px', bodyPadding: '0 4px', color: '#aeaeb9', hoverColor: '#fff', @@ -30,7 +30,7 @@ const defaults = { title: { height: '40px', - padding: '0 17px', + padding: '0 12px', color: '#fff', }, @@ -114,7 +114,7 @@ export const makeMenuStyles = cache(function makeMenuStyles(k: string) { // header .${k}-menu-header { height: ${menu.header.height}; - padding: 0 21px; + padding: 0 16px; color: ${menu.header.color}; font-size: ${menu.header.fontSize}; font-weight: bold; diff --git a/components/upload/index.vdt b/components/upload/index.vdt index 5dbfe2aa2..a5884da05 100644 --- a/components/upload/index.vdt +++ b/components/upload/index.vdt @@ -10,7 +10,7 @@ import {UploadFileStatus} from './useUpload'; const { className, accept, multiple, limit, - files, children, type, directory + files, children, type, directory, disabled } = this.get(); const drag = this.drag; @@ -22,6 +22,7 @@ const classNameObj = { [`${k}-drag`]: type === 'drag', [`${k}-dragover`]: drag.dragOver.value, [`${k}-gallery`]: type === 'gallery', + [`${k}-disabled`]: disabled, [makeStyles(k)]: true, }; @@ -40,7 +41,7 @@ const handle = ( {children}