Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Dec 19, 2024
1 parent 5de9c45 commit 41db9e6
Show file tree
Hide file tree
Showing 87 changed files with 1,166 additions and 1,167 deletions.
4 changes: 2 additions & 2 deletions scripts/utils/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ function getPartsOfMdDemo(tokens) {
function createBlockTemplate(tag, content, attrs) {
const attrsStr = attrs
? Object.keys(attrs).reduce((attrsStr, key) => {
return `${attrsStr} ${key}="${attrs[key]}"`
}, '')
return `${attrsStr} ${key}="${attrs[key]}"`
}, '')
: ''
return `<${tag}${attrsStr}>
${content}
Expand Down
5 changes: 2 additions & 3 deletions src/_internal/icons/Attach.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { h } from 'vue'
import { replaceable } from './replaceable'

export default replaceable(
'attach',
export default replaceable('attach', () => (
<svg viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g fill="currentColor" fill-rule="nonzero">
<path d="M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z" />
</g>
</g>
</svg>
)
))
10 changes: 5 additions & 5 deletions src/_internal/select-menu/src/SelectMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,11 @@ export default defineComponent({
const { inlineThemeDisabled } = props
const themeClassHandle = inlineThemeDisabled
? useThemeClass(
'internal-select-menu',
computed(() => props.size[0]),
cssVarsRef,
props
)
'internal-select-menu',
computed(() => props.size[0]),
cssVarsRef,
props
)
: undefined
const exposedProps: InternalExposedProps = {
selfRef,
Expand Down
40 changes: 20 additions & 20 deletions src/_internal/selection/src/Selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ export default defineComponent({
return props.selectedOption
? props.renderTag
? props.renderTag({
option: props.selectedOption,
handleClose: () => {}
})
option: props.selectedOption,
handleClose: () => {}
})
: props.renderLabel
? props.renderLabel(props.selectedOption as never, true)
: render(
props.selectedOption[props.labelField],
props.selectedOption,
true
)
props.selectedOption[props.labelField],
props.selectedOption,
true
)
: props.placeholder
})
const labelRef = computed(() => {
Expand Down Expand Up @@ -541,13 +541,13 @@ export default defineComponent({
})
const themeClassHandle = inlineThemeDisabled
? useThemeClass(
'internal-selection',
computed(() => {
return props.size[0]
}),
cssVarsRef,
props
)
'internal-selection',
computed(() => {
return props.size[0]
}),
cssVarsRef,
props
)
: undefined
return {
mergedTheme: themeRef,
Expand Down Expand Up @@ -903,9 +903,9 @@ export default defineComponent({
<div class={`${clsPrefix}-base-selection-overlay__wrapper`}>
{renderTag
? renderTag({
option: this.selectedOption!,
handleClose: () => {}
})
option: this.selectedOption!,
handleClose: () => {}
})
: renderLabel
? renderLabel(this.selectedOption!, true)
: render(this.label, this.selectedOption, true)}
Expand Down Expand Up @@ -942,9 +942,9 @@ export default defineComponent({
<div class={`${clsPrefix}-base-selection-input__content`}>
{renderTag
? renderTag({
option: this.selectedOption!,
handleClose: () => {}
})
option: this.selectedOption!,
handleClose: () => {}
})
: renderLabel
? renderLabel(this.selectedOption!, true)
: render(this.label, this.selectedOption, true)}
Expand Down
2 changes: 1 addition & 1 deletion src/_utils/cssr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function createKey<P extends string, S extends string>(
+ (suffix === 'default'
? ''
: suffix.replace(/^[a-z]/, startChar =>
startChar.toUpperCase()))) as any
startChar.toUpperCase()))) as any
}

export {
Expand Down
14 changes: 7 additions & 7 deletions src/alert/src/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ export default defineComponent({
})
const themeClassHandle = inlineThemeDisabled
? useThemeClass(
'alert',
computed(() => {
return props.type[0]
}),
cssVarsRef,
props
)
'alert',
computed(() => {
return props.type[0]
}),
cssVarsRef,
props
)
: undefined
const visibleRef = ref(true)
const doAfterLeave = (): void => {
Expand Down
58 changes: 29 additions & 29 deletions src/avatar/src/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,35 +165,35 @@ export default defineComponent({
})
const themeClassHandle = inlineThemeDisabled
? useThemeClass(
'avatar',
computed(() => {
const size = mergedSizeRef.value
const round = mergedRoundRef.value
const bordered = mergedBorderedRef.value
const { color } = props
let hash = ''
if (size) {
if (typeof size === 'number') {
hash += `a${size}`
'avatar',
computed(() => {
const size = mergedSizeRef.value
const round = mergedRoundRef.value
const bordered = mergedBorderedRef.value
const { color } = props
let hash = ''
if (size) {
if (typeof size === 'number') {
hash += `a${size}`
}
else {
hash += size[0]
}
}
else {
hash += size[0]
if (round) {
hash += 'b'
}
}
if (round) {
hash += 'b'
}
if (bordered) {
hash += 'c'
}
if (color) {
hash += color2Class(color)
}
return hash
}),
cssVarsRef,
props
)
if (bordered) {
hash += 'c'
}
if (color) {
hash += color2Class(color)
}
return hash
}),
cssVarsRef,
props
)
: undefined

const shouldStartLoadingRef = ref(!props.lazy)
Expand Down Expand Up @@ -281,8 +281,8 @@ export default defineComponent({
img = this.renderFallback
? this.renderFallback()
: resolveSlot($slots.fallback, () => [
<img src={this.fallbackSrc} style={{ objectFit: this.objectFit }} />
])
<img src={this.fallbackSrc} style={{ objectFit: this.objectFit }} />
])
}
else {
img = resolveWrappedSlot($slots.default, (children) => {
Expand Down
34 changes: 17 additions & 17 deletions src/back-top/src/BackTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,23 +288,23 @@ export default defineComponent({
this.onRender?.()
return this.mergedShow
? h(
'div',
mergeProps(this.$attrs, {
class: [
`${mergedClsPrefix}-back-top`,
this.themeClass,
this.transitionDisabled
&& `${mergedClsPrefix}-back-top--transition-disabled`
],
style: [this.style, this.cssVars],
onClick: this.handleClick
}),
resolveSlot(this.$slots.default, () => [
<NBaseIcon clsPrefix={mergedClsPrefix}>
{{ default: () => BackTopIcon }}
</NBaseIcon>
])
)
'div',
mergeProps(this.$attrs, {
class: [
`${mergedClsPrefix}-back-top`,
this.themeClass,
this.transitionDisabled
&& `${mergedClsPrefix}-back-top--transition-disabled`
],
style: [this.style, this.cssVars],
onClick: this.handleClick
}),
resolveSlot(this.$slots.default, () => [
<NBaseIcon clsPrefix={mergedClsPrefix}>
{{ default: () => BackTopIcon }}
</NBaseIcon>
])
)
: null
}
}}
Expand Down
30 changes: 15 additions & 15 deletions src/badge/src/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ export default defineComponent({

const themeClassHandle = inlineThemeDisabled
? useThemeClass(
'badge',
computed(() => {
let hash = ''
const { type, color } = props
if (type) {
hash += type[0]
}
if (color) {
hash += color2Class(color)
}
return hash
}),
cssVarsRef,
props
)
'badge',
computed(() => {
let hash = ''
const { type, color } = props
if (type) {
hash += type[0]
}
if (color) {
hash += color2Class(color)
}
return hash
}),
cssVarsRef,
props
)
: undefined

const offsetStyleRef = computed(() => {
Expand Down
Loading

0 comments on commit 41db9e6

Please sign in to comment.