Merge branch 'main' into docs

This commit is contained in:
07akioni 2024-11-26 01:19:39 +08:00
commit 05feb3054d
1521 changed files with 6290 additions and 4712 deletions

View File

@ -1,5 +1,30 @@
# CHANGELOG
## 2.40.2
`2025-11-26`
### Fixes
- Fix `n-time-picker`'s `use-12-hours` type error warning, closes [#4308](https://github.com/tusen-ai/naive-ui/issues/4308)
- Fix `input-number` the problem that the negative sign is replaced when the negative sign is entered.
- Fix `n-data-table`'s header will show scrollbar in some old browsers, closes [#6557](https://github.com/tusen-ai/naive-ui/issues/6557).
### Features
- 🌟 Adds `n-marquee` component.
- `n-image` adds `error` slot, closes [#5649](https://github.com/tusen-ai/naive-ui/issues/5649).
- `n-date-picker` adds `date-format` prop.
- `n-date-picker` adds `calendar-day-format` prop.
- `n-date-picker` adds `calendar-header-year-format` prop.
- `n-date-picker` adds `calendar-header-month-format` prop.
- `n-date-picker` adds `calendar-header-month-before-year` prop.
- `n-date-picker` adds `calendar-header-month-year-separator` prop.
- `n-progress`'s `color` prop supports gradient config.
- `n-select` adds `font-weight` theme variable
- `n-input` adds `font-weight` theme variable
- `n-data-table` adds `get-csv-header` and `get-csv-cell` props, closes [#6542](https://github.com/tusen-ai/naive-ui/issues/6542).
## 2.40.1
`2024-09-26`

View File

@ -1,5 +1,30 @@
# CHANGELOG
## 2.40.2
`2025-11-26`
### Fixes
- `n-time-picker``use-12-hours` 类型错误警告,关闭 [#4308](https://github.com/tusen-ai/naive-ui/issues/4308)
- 修复 `input-number` 存在负号时被替换的问题
- 修复 `n-data-table` 的 header 在部分浏览器中会出现滚动条,关闭 [#6557](https://github.com/tusen-ai/naive-ui/issues/6557)
### Features
- 🌟 新增 `n-marquee` 组件
- `n-image` 新增 `error` 插槽,关闭 [#5649](https://github.com/tusen-ai/naive-ui/issues/5649)
- `n-date-picker` 新增 `date-format` 属性
- `n-date-picker` 新增 `calendar-day-format` 属性
- `n-date-picker` 新增 `calendar-header-year-format` 属性
- `n-date-picker` 新增 `calendar-header-month-format` 属性
- `n-date-picker` 新增 `calendar-header-month-before-year` 属性
- `n-date-picker` 新增 `calendar-header-month-year-separator` 属性
- `n-progress``color` 属性支持渐变色配置
- `n-select` 新增 `font-weight` 主题变量
- `n-input` 新增 `font-weight` 主题变量
- `n-data-table` 新增 `get-csv-header``get-csv-cell` 属性,关闭 [#6542](https://github.com/tusen-ai/naive-ui/issues/6542)
## 2.40.1
`2024-09-26`

View File

@ -1,7 +1,7 @@
const path = require('node:path')
const fse = require('fs-extra')
const { marked } = require('marked')
const camelCase = require('lodash/camelCase')
const { marked } = require('marked')
const createRenderer = require('./md-renderer')
const projectPath = require('./project-path')

View File

@ -1,6 +1,6 @@
const { default: generate } = require('@babel/generator')
const parser = require('@babel/parser')
const { default: traverse } = require('@babel/traverse')
const { default: generate } = require('@babel/generator')
module.exports = function terseCssr(code) {
const patternSpace = / +/g

View File

@ -1,8 +1,8 @@
<script lang="ts">
import { defineComponent, onMounted } from 'vue'
import { useLoadingBar } from 'naive-ui'
import SiteHeader from './SiteHeader.vue'
import { defineComponent, onMounted } from 'vue'
import { loadingBarApiRef } from './routes/router'
import SiteHeader from './SiteHeader.vue'
import { useIsMobile } from './utils/composables'
export default defineComponent({

View File

@ -1,11 +1,8 @@
<script lang="ts">
import { MenuOutline } from '@vicons/ionicons5'
import { useMessage, version } from 'naive-ui'
import { computed, defineComponent, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useMessage, version } from 'naive-ui'
import { MenuOutline } from '@vicons/ionicons5'
import { repoUrl } from './utils/github-url'
import { i18n, useIsMobile, useIsTablet } from './utils/composables'
import { findMenuValue } from './utils/route'
import {
useComponentOptions,
useConfigProviderName,
@ -16,6 +13,9 @@ import {
useThemeName
} from './store'
import { renderMenuLabel } from './store/menu-options'
import { i18n, useIsMobile, useIsTablet } from './utils/composables'
import { repoUrl } from './utils/github-url'
import { findMenuValue } from './utils/route'
// match substr
function match(pattern, string) {

View File

@ -1,8 +1,8 @@
<script lang="ts">
import { defineComponent } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { initRouter, siteSetup } from './store'
import Site from './Site.vue'
import { initRouter, siteSetup } from './store'
export default defineComponent({
name: 'SiteProvider',

View File

@ -1,9 +1,9 @@
import { createApp } from 'vue'
import naive, { NThemeEditor } from '../src/index'
import createDemoRouter from './routes/router'
import { routes } from './routes/routes'
import { installDemoComponents } from './setup'
import SiteRoot from './SiteRoot.vue'
import { routes } from './routes/routes'
import createDemoRouter from './routes/router'
const app = createApp(SiteRoot)

View File

@ -1,9 +1,9 @@
import { createApp } from 'vue'
import naive, { NThemeEditor } from 'naive-ui'
import { createApp } from 'vue'
import createDemoRouter from './routes/router'
import { routes } from './routes/routes'
import { installDemoComponents } from './setup'
import SiteRoot from './SiteRoot.vue'
import { routes } from './routes/routes'
import createDemoRouter from './routes/router'
const app = createApp(SiteRoot)

View File

@ -1,12 +1,12 @@
<script lang="ts">
import { useMemo } from 'vooks'
// Frame component for components & docs page
import { computed, defineComponent, ref, toRef, watch } from 'vue'
import { useRoute } from 'vue-router'
import { useMemo } from 'vooks'
import { findMenuValue } from '../utils/route'
import { useIsMobile, useIsTablet } from '../utils/composables'
import { useComponentOptions, useDocOptions } from '../store'
import { renderMenuLabel } from '../store/menu-options'
import { useIsMobile, useIsTablet } from '../utils/composables'
import { findMenuValue } from '../utils/route'
import SiteFooter from './home/Footer.vue'
export default defineComponent({

View File

@ -57,12 +57,12 @@ You can use the `unplugin-auto-import` plugin to automatically import APIs.
If you develop using SFC, you can use the `unplugin-vue-components` plugin to automatically import components on demand.The plugin will automatically parse the components used in the template and import the components.
```ts
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
// vite.config.ts
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
@ -91,13 +91,13 @@ export default defineConfig({
## Install on Demand Globally
```js
import { createApp } from 'vue'
import {
// component
NButton,
// create naive ui
create
create,
// component
NButton
} from 'naive-ui'
import { createApp } from 'vue'
const naive = create({
components: [NButton]

View File

@ -57,12 +57,12 @@ Naive UI 支持 tree shaking组件、语言、主题均可 tree-shaking。
如果使用模板方式进行开发,可以使用 `unplugin-vue-components` 插件来按需自动加载组件,插件会自动解析模板中的使用到的组件,并导入组件。
```ts
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
// vite.config.ts
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
@ -91,13 +91,13 @@ export default defineConfig({
## 按需全局安装组件(手动)
```js
import { createApp } from 'vue'
import {
// component
NButton,
// create naive ui
create
create,
// component
NButton
} from 'naive-ui'
import { createApp } from 'vue'
const naive = create({
components: [NButton]

View File

@ -11,8 +11,8 @@ For how to enable JSX & TSX, please look at your toolchain's docs.
We recommend importing components directly when using JSX.
```js
import { defineComponent } from 'vue'
import { NButton } from 'naive-ui'
import { defineComponent } from 'vue'
export default defineComponent({
render() {

View File

@ -11,8 +11,8 @@
在 JSX 中,推荐以直接引入的形式使用组件。
```js
import { defineComponent } from 'vue'
import { NButton } from 'naive-ui'
import { defineComponent } from 'vue'
export default defineComponent({
render() {

View File

@ -28,8 +28,8 @@ You can also use the `unplugin-auto-import` plugin to automatically import APIs
```ts
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({

View File

@ -28,8 +28,8 @@ pnpm dlx nuxi module add nuxtjs-naive-ui
```ts
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({

View File

@ -22,8 +22,8 @@ Naive UI has `n-element` component. See [Element](../components/element).
```
```js
import { defineComponent, ref } from 'vue'
import { darkTheme } from 'naive-ui'
import { defineComponent, ref } from 'vue'
export default defineComponent({
setup() {

View File

@ -14,8 +14,8 @@ Use `n-config-provider` to set the theme of all its descendant components.
```
```js
import { defineComponent, ref } from 'vue'
import { darkTheme } from 'naive-ui'
import { defineComponent, ref } from 'vue'
export default defineComponent({
setup() {

View File

@ -7,8 +7,8 @@ Naive UI provides `useThemeVars`. It contains common theme variables.
```
```js
import { defineComponent } from 'vue'
import { useThemeVars } from 'naive-ui'
import { defineComponent } from 'vue'
export default defineComponent({
setup() {

View File

@ -22,8 +22,8 @@ Naive UI 提供 `n-element` 组件,参考 [Element](../components/element)。
```
```js
import { defineComponent, ref } from 'vue'
import { darkTheme } from 'naive-ui'
import { defineComponent, ref } from 'vue'
export default defineComponent({
setup() {

View File

@ -14,8 +14,8 @@
```
```js
import { defineComponent, ref } from 'vue'
import { darkTheme } from 'naive-ui'
import { defineComponent, ref } from 'vue'
export default defineComponent({
setup() {

View File

@ -7,8 +7,8 @@ Naive UI 提供 `useThemeVars`,它包含了常见的主题变量。
```
```js
import { defineComponent } from 'vue'
import { useThemeVars } from 'naive-ui'
import { defineComponent } from 'vue'
export default defineComponent({
setup() {

View File

@ -48,8 +48,8 @@ No tree-shaking. Bundle will have redundant codes.
If you want to install globally but don't want all components, please see [Import on Demand](import-on-demand).
```js
import { createApp } from 'vue'
import naive from 'naive-ui'
import { createApp } from 'vue'
const app = createApp(App)
app.use(naive)

View File

@ -48,8 +48,8 @@
如果你想全局安装但是不想安装全部组件,请参考[按需引入](import-on-demand)。
```js
import { createApp } from 'vue'
import naive from 'naive-ui'
import { createApp } from 'vue'
const app = createApp(App)
app.use(naive)

View File

@ -31,11 +31,11 @@ pnpm install --save-dev @css-render/vue3-ssr
```js
// .vitepress/theme/index.js
import { defineComponent, h, inject } from 'vue'
import DefaultTheme from 'vitepress/theme'
import { NConfigProvider } from 'naive-ui'
import { setup } from '@css-render/vue3-ssr'
import { NConfigProvider } from 'naive-ui'
import { useRoute } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import { defineComponent, h, inject } from 'vue'
const { Layout } = DefaultTheme

View File

@ -31,11 +31,11 @@ pnpm install --save-dev @css-render/vue3-ssr
```js
// .vitepress/theme/index.js
import { defineComponent, h, inject } from 'vue'
import DefaultTheme from 'vitepress/theme'
import { NConfigProvider } from 'naive-ui'
import { setup } from '@css-render/vue3-ssr'
import { NConfigProvider } from 'naive-ui'
import { useRoute } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import { defineComponent, h, inject } from 'vue'
const { Layout } = DefaultTheme

View File

@ -1,8 +1,8 @@
<script lang="ts">
import { defineComponent } from 'vue'
import { version } from 'naive-ui'
import { i18n } from '../../utils/composables'
import { defineComponent } from 'vue'
import { push } from '../../store'
import { i18n } from '../../utils/composables'
import { repoUrl } from '../../utils/github-url'
export default defineComponent({

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import { i18n, useIsMobile, useIsTablet } from '../../utils/composables'
import { useThemeName } from '../../store'
import { i18n, useIsMobile, useIsTablet } from '../../utils/composables'
import LandingFooter from './Footer.vue'
import leftImage from './Left.vue'
import rightImage from './Right.vue'

View File

@ -590,6 +590,10 @@ export const enComponentRoutes = [
path: 'highlight',
component: () =>
import('../../src/highlight/demos/enUS/index.demo-entry.md')
},
{
path: 'marquee',
component: () => import('../../src/marquee/demos/enUS/index.demo-entry.md')
}
]
@ -999,6 +1003,10 @@ export const zhComponentRoutes = [
path: 'highlight',
component: () =>
import('../../src/highlight/demos/zhCN/index.demo-entry.md')
},
{
path: 'marquee',
component: () => import('../../src/marquee/demos/zhCN/index.demo-entry.md')
}
]

View File

@ -1,7 +1,7 @@
import hljs from 'highlight.js/lib/core'
import cpp from 'highlight.js/lib/languages/cpp'
import javascript from 'highlight.js/lib/languages/javascript'
import python from 'highlight.js/lib/languages/python'
import cpp from 'highlight.js/lib/languages/cpp'
import xml from 'highlight.js/lib/languages/xml'
hljs.registerLanguage('javascript', javascript)

View File

@ -1,21 +1,21 @@
import { computed, ref } from 'vue'
import { useMemo } from 'vooks'
import {
NConfigProvider,
darkTheme,
dateEnUS,
dateZhCN,
enUS,
NConfigProvider,
useOsTheme,
zhCN
} from 'naive-ui'
import { useMemo } from 'vooks'
import { computed, ref } from 'vue'
import { TsConfigProvider } from '../../themes/tusimple/src'
import { i18n, useIsMobile } from '../utils/composables'
import hljs from './hljs'
import {
createComponentMenuOptions,
createDocumentationMenuOptions
} from './menu-options'
import hljs from './hljs'
let route = null
let router = null

View File

@ -1,8 +1,8 @@
// rubbish code here
import { NSpace, NTag } from 'naive-ui'
import { h } from 'vue'
import { RouterLink } from 'vue-router'
import { NSpace, NTag } from 'naive-ui'
export function renderMenuLabel(option) {
if (!('path' in option) || option.label === '--Debug') {
@ -663,6 +663,13 @@ export function createComponentMenuOptions({ lang, theme }) {
enSuffix: true,
path: '/drawer'
},
{
en: 'Marquee',
zh: '跑马灯',
enSuffix: true,
path: '/marquee',
isNew: true
},
{
en: 'Message',
zh: '信息',

View File

@ -1,11 +1,11 @@
<script lang="ts">
import { computed, defineComponent, nextTick, ref, watch } from 'vue'
import { CodeOutline } from '@vicons/ionicons5'
import { computed, defineComponent, nextTick, ref, watch } from 'vue'
import { useDisplayMode } from '../store'
import { i18n } from '../utils/composables'
import EditOnGithubButton from './EditOnGithubButton.vue'
import EditInCodeSandboxButton from './EditInCodeSandboxButton.vue'
import CopyCodeButton from './CopyCodeButton.vue'
import EditInCodeSandboxButton from './EditInCodeSandboxButton.vue'
import EditOnGithubButton from './EditOnGithubButton.vue'
export default defineComponent({
components: {

View File

@ -1,4 +1,4 @@
import { Fragment, computed, defineComponent, h } from 'vue'
import { computed, defineComponent, Fragment, h } from 'vue'
import { useIsMobile, useIsSmallDesktop, useIsTablet } from './composables'
export default defineComponent({

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { defineComponent } from 'vue'
import { useMessage } from 'naive-ui'
import { defineComponent } from 'vue'
export default defineComponent({
name: 'CopyCodeButton',

View File

@ -1,8 +1,8 @@
<script lang="ts">
import type { PropType } from 'vue'
import { defineComponent } from 'vue'
import type { ButtonProps } from 'naive-ui'
import type { PropType } from 'vue'
import EditIcon from '@vicons/fluent/Compose16Regular.js'
import { defineComponent } from 'vue'
import { blobUrl } from './github-url'
export default defineComponent({

View File

@ -1,5 +1,5 @@
import { inject, provide, reactive, toRef, watchEffect } from 'vue'
import { useBreakpoint, useMemo } from 'vooks'
import { inject, provide, reactive, toRef, watchEffect } from 'vue'
export function useIsMobile() {
const breakpointRef = useBreakpoint()

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "2.40.1",
"version": "2.40.2",
"packageManager": "pnpm@9.5.0",
"description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
"author": "07akioni",
@ -87,7 +87,7 @@
"vueuc": "^0.4.63"
},
"devDependencies": {
"@antfu/eslint-config": "^2.22.0",
"@antfu/eslint-config": "^3.9.2",
"@babel/core": "^7.22.15",
"@babel/generator": "^7.22.15",
"@babel/parser": "^7.22.16",
@ -106,7 +106,7 @@
"@vicons/ionicons5": "^0.12.0",
"@vitejs/plugin-vue": "^5.0.3",
"@vue/compiler-sfc": "^3.4.15",
"@vue/server-renderer": "~3.4.15",
"@vue/server-renderer": "^3.5.13",
"@vue/test-utils": "^2.4.1",
"autoprefixer": "^10.4.15",
"babel-jest": "^29.6.4",
@ -136,7 +136,7 @@
"typescript": "5.5.4",
"vfonts": "^0.0.3",
"vite": "^5.0.4",
"vue": "~3.4.15",
"vue": "~3.5.13",
"vue-router": "^4.2.4",
"vue-tsc": "^2.0.6"
},

View File

@ -1,7 +1,7 @@
const fs = require('node:fs').promises
const path = require('node:path')
const { genDts, collectVars } = require('./utils/collect-vars')
const { walk } = require('./utils')
const { genDts, collectVars } = require('./utils/collect-vars')
const srcPath = path.resolve(__dirname, '..', 'src')

View File

@ -1,7 +1,7 @@
const path = require('node:path')
const fs = require('fs-extra')
const glob = require('fast-glob')
const babel = require('@babel/core')
const glob = require('fast-glob')
const fs = require('fs-extra')
const formatConfigs = {
es: {

View File

@ -244,7 +244,7 @@ exports.genWebTypes = function genWebTypes() {
function extractComponentDescription() {
const description = docsFile.match(
RegExp(`#.*${componentName}\n(.*)## Demos`, 's')
new RegExp(`#.*${componentName}\n(.*)## Demos`, 's')
)
if (description) {
return description[1].trim()
@ -254,7 +254,7 @@ exports.genWebTypes = function genWebTypes() {
function extractSectionTable(sectionName) {
const result = {}
try {
const sectionHeaderRegex = RegExp(
const sectionHeaderRegex = new RegExp(
`##.*${componentName}[, ].*${sectionName}\n`
)
const location = docsFile.match(sectionHeaderRegex)

View File

@ -4,8 +4,8 @@ const { terseCssr } = require('./terse-cssr')
// replace __DEV__
const { genWebTypes } = require('./gen-web-types')
const { completePath } = require('./complete-path')
const { genWebTypes } = require('./gen-web-types')
;

View File

@ -1,9 +1,9 @@
import { type PropType, defineComponent, h, toRef } from 'vue'
import { resolveSlot } from '../../../_utils'
import { defineComponent, h, type PropType, toRef } from 'vue'
import { useStyle } from '../../../_mixins'
import { ClearIcon } from '../../icons'
import { resolveSlot } from '../../../_utils'
import { NBaseIcon } from '../../icon'
import NIconSwitchTransition from '../../icon-switch-transition'
import { ClearIcon } from '../../icons'
import style from './styles/index.cssr'
export default defineComponent({

View File

@ -1,5 +1,5 @@
import { c, cB, cE } from '../../../../_utils/cssr'
import { iconSwitchTransition } from '../../../../_styles/transitions/icon-switch.cssr'
import { c, cB, cE } from '../../../../_utils/cssr'
// vars:
// --n-bezier

View File

@ -1,4 +1,4 @@
import { type PropType, defineComponent, h, toRef } from 'vue'
import { defineComponent, h, type PropType, toRef } from 'vue'
import { useStyle } from '../../../_mixins'
import { NBaseIcon } from '../../icon'
import { CloseIcon } from '../../icons'

View File

@ -1,10 +1,10 @@
import {
defineComponent,
h,
type PropType,
Transition,
TransitionGroup,
type TransitionProps,
defineComponent,
h
type TransitionProps
} from 'vue'
export default defineComponent({

View File

@ -1,4 +1,4 @@
import { type PropType, defineComponent, h } from 'vue'
import { defineComponent, h, type PropType } from 'vue'
export default defineComponent({
props: {

View File

@ -1,5 +1,5 @@
import { Transition, defineComponent, h } from 'vue'
import { useIsMounted } from 'vooks'
import { defineComponent, h, Transition } from 'vue'
export default defineComponent({
name: 'BaseIconSwitchTransition',

View File

@ -1,4 +1,4 @@
import { type PropType, defineComponent, h, toRef } from 'vue'
import { defineComponent, h, type PropType, toRef } from 'vue'
import { useStyle } from '../../../_mixins'
import style from './styles/index.cssr'

View File

@ -1,42 +1,42 @@
export { default as AddIcon } from './Add'
export { default as ArrowBackIcon } from './ArrowBack'
export { default as ArrowDownIcon } from './ArrowDown'
export { default as ArrowUpIcon } from './ArrowUp'
export { default as AttachIcon } from './Attach'
export { default as BackwardIcon } from './Backward'
export { default as DateIcon } from './Date'
export { default as CancelIcon } from './Cancel'
export { default as CheckmarkIcon } from './Checkmark'
export { default as ChevronDownIcon } from './ChevronDown'
export { default as ChevronDownFilledIcon } from './ChevronDownFilled'
export { default as ChevronLeftIcon } from './ChevronLeft'
export { default as ChevronRightIcon } from './ChevronRight'
export { default as ClearIcon } from './Clear'
export { default as CloseIcon } from './Close'
export { default as EyeIcon } from './Eye'
export { default as EyeOffIcon } from './EyeOff'
export { default as TrashIcon } from './Trash'
export { default as DateIcon } from './Date'
export { default as DownloadIcon } from './Download'
export { default as EmptyIcon } from './Empty'
export { default as ErrorIcon } from './Error'
export { default as EyeIcon } from './Eye'
export { default as EyeOffIcon } from './EyeOff'
export { default as FastBackwardIcon } from './FastBackward'
export { default as FastForwardIcon } from './FastForward'
export { default as FileIcon } from './File'
export { default as FilterIcon } from './Filter'
export { default as ForwardIcon } from './Forward'
export { default as InfoIcon } from './Info'
export { default as MoreIcon } from './More'
export { default as PhotoIcon } from './Photo'
export { default as RemoveIcon } from './Remove'
export { default as ResizeSmallIcon } from './ResizeSmall'
export { default as RetryIcon } from './Retry'
export { default as RotateClockwiseIcon } from './RotateClockwise'
export { default as RotateCounterclockwiseIcon } from './RotateCounterclockwise'
export { default as SearchIcon } from './Search'
export { default as SuccessIcon } from './Success'
export { default as SwitcherIcon } from './Switcher'
export { default as TimeIcon } from './Time'
export { default as WarningIcon } from './Warning'
export { default as CancelIcon } from './Cancel'
export { default as ChevronDownIcon } from './ChevronDown'
export { default as ClearIcon } from './Clear'
export { default as ChevronDownFilledIcon } from './ChevronDownFilled'
export { default as ToIcon } from './To'
export { default as RetryIcon } from './Retry'
export { default as ArrowBackIcon } from './ArrowBack'
export { default as RotateClockwiseIcon } from './RotateClockwise'
export { default as RotateCounterclockwiseIcon } from './RotateCounterclockwise'
export { default as TrashIcon } from './Trash'
export { default as WarningIcon } from './Warning'
export { default as ZoomInIcon } from './ZoomIn'
export { default as ZoomOutIcon } from './ZoomOut'
export { default as FileIcon } from './File'
export { default as PhotoIcon } from './Photo'
export { default as ResizeSmallIcon } from './ResizeSmall'

View File

@ -1,6 +1,6 @@
import type { GlobalIconConfig } from '../../config-provider/src/internal-interface'
import { upperFirst } from 'lodash-es'
import { defineComponent, inject } from 'vue'
import type { GlobalIconConfig } from '../../config-provider/src/internal-interface'
import { configProviderInjectionKey } from '../../config-provider/src/context'
export function replaceable(name: keyof GlobalIconConfig, icon: JSX.Element) {

View File

@ -1,19 +1,19 @@
export { default as NIconSwitchTransition } from './icon-switch-transition'
export { default as NFadeInExpandTransition } from './fade-in-expand-transition'
export { default as NBaseClear } from './clear'
export { NBaseClose } from './close'
export { NBaseIcon } from './icon'
export { default as NFadeInExpandTransition } from './fade-in-expand-transition'
export { default as NBaseFocusDetector } from './focus-detector'
export { NBaseIcon } from './icon'
export { default as NIconSwitchTransition } from './icon-switch-transition'
export { default as NBaseLoading } from './loading'
export type { BaseLoadingExposedProps } from './loading'
export { default as NBaseMenuMask } from './menu-mask'
export { NScrollbar, NxScrollbar } from './scrollbar'
export type { ScrollbarInst, ScrollbarProps } from './scrollbar'
export { default as NInternalSelectMenu } from './select-menu'
export type { InternalSelectMenuRef } from './select-menu'
export { default as NBaseWave } from './wave'
export type { BaseWaveRef } from './wave'
export { default as NBaseMenuMask } from './menu-mask'
export { default as NInternalSelection } from './selection'
export type { InternalSelectionInst } from './selection'
export { default as NBaseSlotMachine } from './slot-machine'
export { default as NBaseClear } from './clear'
export { default as NBaseSuffix } from './suffix'
export { NScrollbar, NxScrollbar } from './scrollbar'
export type { ScrollbarInst, ScrollbarProps } from './scrollbar'
export { default as NBaseWave } from './wave'
export type { BaseWaveRef } from './wave'

View File

@ -1,6 +1,6 @@
import type { ExtractPublicPropTypes } from '../../../_utils'
import { defineComponent, h, toRef } from 'vue'
import { useStyle } from '../../../_mixins'
import type { ExtractPublicPropTypes } from '../../../_utils'
import NIconSwitchTransition from '../../icon-switch-transition'
import style from './styles/index.cssr'

View File

@ -1,5 +1,5 @@
import { c, cB, cE } from '../../../../_utils/cssr'
import { iconSwitchTransition } from '../../../../_styles/transitions/icon-switch.cssr'
import { c, cB, cE } from '../../../../_utils/cssr'
export default c([
c('@keyframes rotator', `

View File

@ -1,2 +1,2 @@
export { default } from './src/MenuMask'
export type { MenuMaskRef } from './src/interface'
export { default } from './src/MenuMask'

View File

@ -1,13 +1,13 @@
import type { MenuMaskRef } from './interface'
import {
Transition,
defineComponent,
h,
onBeforeUnmount,
ref,
toRef
toRef,
Transition
} from 'vue'
import { useStyle } from '../../../_mixins'
import type { MenuMaskRef } from './interface'
import style from './styles/index.cssr'
export default defineComponent({

View File

@ -1,5 +1,5 @@
import { cB } from '../../../../_utils/cssr'
import { fadeInTransition } from '../../../../_styles/transitions/fade-in.cssr'
import { cB } from '../../../../_utils/cssr'
export default cB('base-menu-mask', `
position: absolute;

View File

@ -1,29 +1,29 @@
import {
Fragment,
Transition,
computed,
defineComponent,
h,
mergeProps,
onBeforeUnmount,
onMounted,
ref,
watchEffect
} from 'vue'
import type { CSSProperties, HTMLAttributes, PropType, VNode } from 'vue'
import { off, on } from 'evtd'
import { VResizeObserver } from 'vueuc'
import { useIsIos } from 'vooks'
import { depx, getPreciseEventTarget } from 'seemly'
import { useConfig, useRtl, useTheme, useThemeClass } from '../../../_mixins'
import type { ThemeProps } from '../../../_mixins'
import type {
ExtractInternalPropTypes,
ExtractPublicPropTypes
} from '../../../_utils'
import { Wrapper, rtlInset, useReactivated } from '../../../_utils'
import { scrollbarLight } from '../styles'
import type { ScrollbarTheme } from '../styles'
import { off, on } from 'evtd'
import { depx, getPreciseEventTarget } from 'seemly'
import { useIsIos } from 'vooks'
import {
computed,
defineComponent,
Fragment,
h,
mergeProps,
onBeforeUnmount,
onMounted,
ref,
Transition,
watchEffect
} from 'vue'
import { VResizeObserver } from 'vueuc'
import { useConfig, useRtl, useTheme, useThemeClass } from '../../../_mixins'
import { rtlInset, useReactivated, Wrapper } from '../../../_utils'
import { scrollbarLight } from '../styles'
import style from './styles/index.cssr'
export interface ScrollTo {

View File

@ -1,5 +1,5 @@
import { c, cB, cE, cM } from '../../../../_utils/cssr'
import { fadeInTransition } from '../../../../_styles/transitions/fade-in.cssr'
import { c, cB, cE, cM } from '../../../../_utils/cssr'
// vars:
// --n-scrollbar-bezier

View File

@ -1,5 +1,5 @@
import { commonDark } from '../../../_styles/common'
import type { ScrollbarTheme } from './light'
import { commonDark } from '../../../_styles/common'
import { self } from './light'
const scrollbarDark: ScrollbarTheme = {

View File

@ -1,4 +1,4 @@
export { default as scrollbarDark } from './dark'
export { default as scrollbarLight } from './light'
export { default as scrollbarRtl } from './rtl'
export type { ScrollbarTheme, ScrollbarThemeVars } from './light'
export { default as scrollbarRtl } from './rtl'

View File

@ -1,6 +1,6 @@
import { commonLight } from '../../../_styles/common'
import type { ThemeCommonVars } from '../../../_styles/common'
import type { Theme } from '../../../_mixins'
import type { ThemeCommonVars } from '../../../_styles/common'
import { commonLight } from '../../../_styles/common'
import { commonVars } from './common'
export function self(vars: ThemeCommonVars) {

View File

@ -1,9 +1,9 @@
import { setup } from '@css-render/vue3-ssr'
import { renderToString } from '@vue/server-renderer'
/**
* @jest-environment node
*/
import { createSSRApp, h } from 'vue'
import { renderToString } from '@vue/server-renderer'
import { setup } from '@css-render/vue3-ssr'
import { NScrollbar } from '../index'
describe('sSR', () => {

View File

@ -1,2 +1,2 @@
export { default } from './src/SelectMenu'
export type { InternalSelectMenuRef } from './src/interface'
export { default } from './src/SelectMenu'

View File

@ -1,11 +1,11 @@
import { type PropType, type Ref, defineComponent, h, inject } from 'vue'
import type { TreeNode } from 'treemate'
import type { SelectGroupOption } from '../../../select/src/interface'
import { defineComponent, h, inject, type PropType, type Ref } from 'vue'
import { render } from '../../../_utils'
import {
internalSelectionMenuInjectionKey,
type RenderLabelImpl,
type RenderOptionImpl,
internalSelectionMenuInjectionKey
type RenderOptionImpl
} from './interface'
export default defineComponent({

View File

@ -1,24 +1,4 @@
import {
type CSSProperties,
type PropType,
type WatchStopHandle,
computed,
defineComponent,
h,
nextTick,
onBeforeUnmount,
onMounted,
provide,
ref,
toRef,
watch
} from 'vue'
import { type TreeNode, createIndexGetter } from 'treemate'
import { VirtualList, type VirtualListInst } from 'vueuc'
import { depx, getPadding, happensIn } from 'seemly'
import { NEmpty } from '../../../empty'
import { NScrollbar } from '../../scrollbar'
import type { ScrollbarInst } from '../../scrollbar'
import type { ThemeProps } from '../../../_mixins'
import type {
SelectGroupOption,
SelectIgnoredOption,
@ -26,18 +6,7 @@ import type {
SelectTreeMate,
Value
} from '../../../select/src/interface'
import { resolveSlot, resolveWrappedSlot, useOnResize } from '../../../_utils'
import { createKey } from '../../../_utils/cssr'
import { useConfig, useRtl, useTheme, useThemeClass } from '../../../_mixins'
import type { ThemeProps } from '../../../_mixins'
import NInternalLoading from '../../loading'
import NFocusDetector from '../../focus-detector'
import {
type InternalSelectMenuTheme,
internalSelectMenuLight
} from '../styles'
import NSelectOption from './SelectOption'
import NSelectGroupHeader from './SelectGroupHeader'
import type { ScrollbarInst } from '../../scrollbar'
import type {
InternalExposedProps,
NodeProps,
@ -45,10 +14,41 @@ import type {
RenderOption,
Size
} from './interface'
import { depx, getPadding, happensIn } from 'seemly'
import { createIndexGetter, type TreeNode } from 'treemate'
import {
computed,
type CSSProperties,
defineComponent,
h,
nextTick,
onBeforeUnmount,
onMounted,
type PropType,
provide,
ref,
toRef,
watch,
type WatchStopHandle
} from 'vue'
import { VirtualList, type VirtualListInst } from 'vueuc'
import { useConfig, useRtl, useTheme, useThemeClass } from '../../../_mixins'
import { resolveSlot, resolveWrappedSlot, useOnResize } from '../../../_utils'
import { createKey } from '../../../_utils/cssr'
import { NEmpty } from '../../../empty'
import NFocusDetector from '../../focus-detector'
import NInternalLoading from '../../loading'
import { NScrollbar } from '../../scrollbar'
import {
internalSelectMenuLight,
type InternalSelectMenuTheme
} from '../styles'
import {
internalSelectionMenuBodyInjectionKey,
internalSelectionMenuInjectionKey
} from './interface'
import NSelectGroupHeader from './SelectGroupHeader'
import NSelectOption from './SelectOption'
import style from './styles/index.cssr'
export default defineComponent({

View File

@ -1,22 +1,22 @@
import type { TreeNode } from 'treemate'
import type { SelectOption } from '../../../select/src/interface'
import { useMemo } from 'vooks'
import {
defineComponent,
h,
inject,
type PropType,
type Ref,
Transition,
type VNode,
defineComponent,
h,
inject
type VNode
} from 'vue'
import type { TreeNode } from 'treemate'
import { useMemo } from 'vooks'
import type { SelectOption } from '../../../select/src/interface'
import { mergeEventHandlers, render } from '../../../_utils'
import { CheckmarkIcon } from '../../icons'
import { NBaseIcon } from '../../icon'
import { CheckmarkIcon } from '../../icons'
import {
internalSelectionMenuInjectionKey,
type RenderLabelImpl,
type RenderOptionImpl,
internalSelectionMenuInjectionKey
type RenderOptionImpl
} from './interface'
function renderCheckMark(show: boolean, clsPrefix: string): VNode {

View File

@ -1,5 +1,5 @@
import type { HTMLAttributes, Ref, UnwrapRef, VNode, VNodeChild } from 'vue'
import type { TreeNode } from 'treemate'
import type { HTMLAttributes, Ref, UnwrapRef, VNode, VNodeChild } from 'vue'
import type {
SelectBaseOption,
SelectGroupOption,

View File

@ -1,5 +1,5 @@
import { c, cB, cE, cM, cNotM } from '../../../../_utils/cssr'
import { fadeInScaleUpTransition } from '../../../../_styles/transitions/fade-in-scale-up.cssr'
import { c, cB, cE, cM, cNotM } from '../../../../_utils/cssr'
// --n-loading-color
// --n-loading-size

View File

@ -1,7 +1,7 @@
import type { InternalSelectMenuTheme } from './light'
import { commonDark } from '../../../_styles/common'
import { emptyDark } from '../../../empty/styles'
import { scrollbarDark } from '../../scrollbar/styles'
import { commonDark } from '../../../_styles/common'
import type { InternalSelectMenuTheme } from './light'
import { self } from './light'
const internalSelectMenuDark: InternalSelectMenuTheme = {

View File

@ -1,7 +1,7 @@
export { default as internalSelectMenuLight } from './light'
export { default as internalSelectMenuDark } from './dark'
export { internalSelectMenuRtl } from './rtl'
export { default as internalSelectMenuLight } from './light'
export type {
InternalSelectMenuThemeVars,
InternalSelectMenuTheme
InternalSelectMenuTheme,
InternalSelectMenuThemeVars
} from './light'
export { internalSelectMenuRtl } from './rtl'

View File

@ -1,8 +1,8 @@
import { emptyLight } from '../../../empty/styles'
import { scrollbarLight } from '../../scrollbar/styles'
import { commonLight } from '../../../_styles/common'
import type { ThemeCommonVars } from '../../../_styles/common'
import { createTheme } from '../../../_mixins'
import { commonLight } from '../../../_styles/common'
import { emptyLight } from '../../../empty/styles'
import { scrollbarLight } from '../../scrollbar/styles'
import commonVariables from './_common'
export function self(vars: ThemeCommonVars) {

View File

@ -1,43 +1,43 @@
import {
type CSSProperties,
Fragment,
type InputHTMLAttributes,
type PropType,
type VNode,
computed,
defineComponent,
h,
nextTick,
onMounted,
ref,
toRef,
watch,
watchEffect
} from 'vue'
import { VOverflow, type VOverflowInst } from 'vueuc'
import { getPadding } from 'seemly'
import type { ThemeProps } from '../../../_mixins'
import type { FormValidationStatus } from '../../../form/src/interface'
import type { SelectBaseOption } from '../../../select/src/interface'
import type { TagRef } from '../../../tag/src/Tag'
import type {
RenderLabel,
RenderLabelImpl
} from '../../select-menu/src/interface'
import type { SelectBaseOption } from '../../../select/src/interface'
import type { FormValidationStatus } from '../../../form/src/interface'
import type { TagRef } from '../../../tag/src/Tag'
import { NPopover, type PopoverProps } from '../../../popover'
import { NTag } from '../../../tag'
import { useConfig, useRtl, useTheme, useThemeClass } from '../../../_mixins'
import type { ThemeProps } from '../../../_mixins'
import type { InternalSelectionTheme } from '../styles'
import type { RenderTag } from './interface'
import { getPadding } from 'seemly'
import {
computed,
type CSSProperties,
defineComponent,
Fragment,
h,
type InputHTMLAttributes,
nextTick,
onMounted,
type PropType,
ref,
toRef,
type VNode,
watch,
watchEffect
} from 'vue'
import { VOverflow, type VOverflowInst } from 'vueuc'
import { useConfig, useRtl, useTheme, useThemeClass } from '../../../_mixins'
import {
Wrapper,
createKey,
getTitleAttribute,
render,
useOnResize
useOnResize,
Wrapper
} from '../../../_utils'
import { NPopover, type PopoverProps } from '../../../popover'
import { NTag } from '../../../tag'
import Suffix from '../../suffix'
import { internalSelectionLight } from '../styles'
import type { InternalSelectionTheme } from '../styles'
import type { RenderTag } from './interface'
import style from './styles/index.cssr'
export interface InternalSelectionInst {
@ -424,6 +424,7 @@ export default defineComponent({
const {
common: { cubicBezierEaseInOut },
self: {
fontWeight,
borderRadius,
color,
placeholderColor,
@ -533,7 +534,9 @@ export default defineComponent({
'--n-clear-color-hover': clearColorHover,
'--n-clear-color-pressed': clearColorPressed,
// arrow-size
'--n-arrow-size': arrowSize
'--n-arrow-size': arrowSize,
// font-weight
'--n-font-weight': fontWeight
}
})
const themeClassHandle = inlineThemeDisabled

View File

@ -31,6 +31,7 @@ import {
// --n-arrow-color
// --n-arrow-size
// --n-loading-color
// --n-font-weight
// ...clear vars
// ...form item vars
export default c([

View File

@ -1,8 +1,8 @@
import type { InternalSelectionTheme } from './light'
import { changeColor } from 'seemly'
import { commonDark } from '../../../_styles/common'
import { popoverDark } from '../../../popover/styles'
import commonVars from './_common'
import type { InternalSelectionTheme } from './light'
const internalSelectionDark: InternalSelectionTheme = {
name: 'InternalSelection',
@ -37,10 +37,12 @@ const internalSelectionDark: InternalSelectionTheme = {
heightTiny,
heightSmall,
heightMedium,
heightLarge
heightLarge,
fontWeight
} = vars
return {
...commonVars,
fontWeight,
fontSizeTiny,
fontSizeSmall,
fontSizeMedium,

View File

@ -1,7 +1,7 @@
export { default as internalSelectionLight } from './light'
export { default as internalSelectionDark } from './dark'
export { internalSelectionRtl } from './rtl'
export { default as internalSelectionLight } from './light'
export type {
InternalSelectionTheme,
InternalSelectionThemeVars
} from './light'
export { internalSelectionRtl } from './rtl'

View File

@ -1,8 +1,8 @@
import type { ThemeCommonVars } from '../../../_styles/common'
import { changeColor } from 'seemly'
import { createTheme } from '../../../_mixins'
import { commonLight } from '../../../_styles/common'
import { popoverLight } from '../../../popover/styles'
import type { ThemeCommonVars } from '../../../_styles/common'
import { createTheme } from '../../../_mixins'
import commonVariables from './_common'
function self(vars: ThemeCommonVars) {
@ -33,7 +33,8 @@ function self(vars: ThemeCommonVars) {
heightTiny,
heightSmall,
heightMedium,
heightLarge
heightLarge,
fontWeight
} = vars
return {
...commonVariables,
@ -46,6 +47,7 @@ function self(vars: ThemeCommonVars) {
heightMedium,
heightLarge,
borderRadius,
fontWeight,
// default
textColor: textColor2,
textColorDisabled,

View File

@ -1,14 +1,14 @@
import {
TransitionGroup,
computed,
defineComponent,
h,
ref,
toRef,
TransitionGroup,
watch
} from 'vue'
import NFadeInExpandTransition from '../../fade-in-expand-transition'
import { useStyle } from '../../../_mixins'
import NFadeInExpandTransition from '../../fade-in-expand-transition'
import SlotMachineNumber from './SlotMachineNumber'
import style from './styles/index.cssr'

View File

@ -1,9 +1,9 @@
import {
type PropType,
computed,
defineComponent,
h,
nextTick,
type PropType,
ref,
toRef,
watch

View File

@ -1,6 +1,6 @@
import { c, cB, cE, cM } from '../../../../_utils/cssr'
import { fadeInWidthExpandTransition } from '../../../../_styles/transitions/fade-in-width-expand.cssr'
import { fadeUpWidthExpandTransition } from '../../../../_styles/transitions/fade-up-width-expand.cssr'
import { c, cB, cE, cM } from '../../../../_utils/cssr'
// ease-out: cubic-bezier(0, 0, .2, 1)
export default c([

View File

@ -1,9 +1,9 @@
import { type PropType, defineComponent, h } from 'vue'
import { defineComponent, h, type PropType } from 'vue'
import { resolveSlot } from '../../../_utils/vue'
import NBaseClear from '../../clear'
import NBaseLoading from '../../loading'
import { NBaseIcon } from '../../icon'
import { ChevronDownIcon } from '../../icons'
import { resolveSlot } from '../../../_utils/vue'
import NBaseLoading from '../../loading'
export default defineComponent({
name: 'InternalSelectionSuffix',

View File

@ -1,15 +1,15 @@
export { default as useFormItem } from './use-form-item'
export { default as useTheme, createTheme } from './use-theme'
export type {
ThemeProps,
MergedTheme,
ThemePropsReactive,
Theme
} from './use-theme'
export { default as useConfig, defaultClsPrefix } from './use-config'
export { default as useLocale } from './use-locale'
export { default as useStyle } from './use-style'
export { useThemeClass } from './use-css-vars-class'
export { default as useFormItem } from './use-form-item'
export { default as useHljs } from './use-hljs'
export type { Hljs } from './use-hljs'
export { useThemeClass } from './use-css-vars-class'
export { default as useLocale } from './use-locale'
export { useRtl } from './use-rtl'
export { default as useStyle } from './use-style'
export { createTheme, default as useTheme } from './use-theme'
export type {
MergedTheme,
Theme,
ThemeProps,
ThemePropsReactive
} from './use-theme'

View File

@ -1,9 +1,9 @@
import { type ComputedRef, type Ref, computed, inject, shallowRef } from 'vue'
import type {
Breakpoints,
GlobalComponentConfig,
RtlEnabledState
} from '../config-provider/src/internal-interface'
import { computed, type ComputedRef, inject, type Ref, shallowRef } from 'vue'
import { configProviderInjectionKey } from '../config-provider/src/context'
type UseConfigProps = Readonly<{

View File

@ -1,9 +1,9 @@
import { type ComputedRef, type Ref, inject, ref, watchEffect } from 'vue'
import { hash } from 'css-render'
import { useSsrAdapter } from '@css-render/vue3-ssr'
import { configProviderInjectionKey } from '../config-provider/src/context'
import { hash } from 'css-render'
import { type ComputedRef, inject, type Ref, ref, watchEffect } from 'vue'
import { throwError } from '../_utils'
import { c } from '../_utils/cssr'
import { configProviderInjectionKey } from '../config-provider/src/context'
export function useThemeClass(
componentName: string,

View File

@ -1,12 +1,12 @@
import type { FormValidationStatus } from '../form/src/interface'
import {
type ComputedRef,
type Ref,
computed,
type ComputedRef,
inject,
onBeforeUnmount,
provide
provide,
type Ref
} from 'vue'
import type { FormValidationStatus } from '../form/src/interface'
import { createInjectionKey } from '../_utils'
type FormItemSize = 'small' | 'medium' | 'large'

View File

@ -1,7 +1,7 @@
import { type ComputedRef, type Ref, computed, inject, watchEffect } from 'vue'
import type { HLJSApi } from 'highlight.js'
import { configProviderInjectionKey } from '../config-provider/src/context'
import { computed, type ComputedRef, inject, type Ref, watchEffect } from 'vue'
import { warn } from '../_utils'
import { configProviderInjectionKey } from '../config-provider/src/context'
interface UseHljsProps {
hljs?: unknown

View File

@ -1,8 +1,8 @@
import { type Ref, computed, inject } from 'vue'
import { dateEnUS, enUS } from '../locales'
import type { NLocale } from '../locales/common/enUS'
import type { NDateLocale } from '../locales/date/enUS'
import { computed, inject, type Ref } from 'vue'
import { configProviderInjectionKey } from '../config-provider/src/context'
import { dateEnUS, enUS } from '../locales'
export default function useLocale<T extends keyof NLocale>(
ns: T

View File

@ -1,10 +1,10 @@
import { type Ref, computed, inject, onBeforeMount, watchEffect } from 'vue'
import { exists } from 'css-render'
import { useSsrAdapter } from '@css-render/vue3-ssr'
import type {
RtlEnabledState,
RtlItem
} from '../config-provider/src/internal-interface'
import { useSsrAdapter } from '@css-render/vue3-ssr'
import { exists } from 'css-render'
import { computed, inject, onBeforeMount, type Ref, watchEffect } from 'vue'
import { configProviderInjectionKey } from '../config-provider/src/context'
import { cssrAnchorMetaName } from './common'

View File

@ -1,9 +1,9 @@
import type { CNode } from 'css-render'
import { type Ref, inject, onBeforeMount } from 'vue'
import { useSsrAdapter } from '@css-render/vue3-ssr'
import { configProviderInjectionKey } from '../config-provider/src/context'
import { inject, onBeforeMount, type Ref } from 'vue'
import globalStyle from '../_styles/global/index.cssr'
import { throwError } from '../_utils'
import { configProviderInjectionKey } from '../config-provider/src/context'
import { cssrAnchorMetaName } from './common'
export default function useStyle(

View File

@ -1,18 +1,18 @@
import {
type ComputedRef,
type PropType,
type Ref,
computed,
inject,
onBeforeMount
} from 'vue'
import { merge } from 'lodash-es'
import type { CNode } from 'css-render'
import type { ThemeCommonVars } from '../_styles/common'
import type { GlobalTheme } from '../config-provider'
import { useSsrAdapter } from '@css-render/vue3-ssr'
import { merge } from 'lodash-es'
import {
computed,
type ComputedRef,
inject,
onBeforeMount,
type PropType,
type Ref
} from 'vue'
import globalStyle from '../_styles/global/index.cssr'
import { configProviderInjectionKey } from '../config-provider/src/context'
import type { GlobalTheme } from '../config-provider'
import type { ThemeCommonVars } from '../_styles/common'
import { cssrAnchorMetaName } from './common'
export interface Theme<N, T = Record<string, unknown>, R = any> {

View File

@ -1,5 +1,5 @@
import { composite, rgba, scaleColor } from 'seemly'
import type { ThemeCommonVars } from './light'
import { composite, rgba, scaleColor } from 'seemly'
import commonVariables from './_common'
const base = {

View File

@ -1,15 +1,15 @@
export { useAdjustedTo } from './use-adjusted-to'
export {
useInjectionCollection,
useInjectionElementCollection,
useInjectionInstanceCollection
} from './use-collection'
export { useDeferredTrue } from './use-deferred-true'
export { useAdjustedTo } from './use-adjusted-to'
export { useHoudini } from './use-houdini'
export { useOnResize } from './use-resize'
export {
useLockHtmlScroll,
lockHtmlScrollRightCompensationRef
} from './use-lock-html-scroll'
export { useIsComposing } from './use-is-composing'
export {
lockHtmlScrollRightCompensationRef,
useLockHtmlScroll
} from './use-lock-html-scroll'
export { useReactivated } from './use-reactivated'
export { useOnResize } from './use-resize'

View File

@ -1,17 +1,17 @@
import { useMemo } from 'vooks'
import { off, on } from 'evtd'
import { useMemo } from 'vooks'
import {
type ComponentPublicInstance,
type ComputedRef,
type PropType,
inject,
onBeforeUnmount,
onMounted,
type PropType,
ref
} from 'vue'
import { internalSelectionMenuBodyInjectionKey } from '../../_internal/select-menu/src/interface'
import { modalBodyInjectionKey } from '../../modal/src/interface'
import { drawerBodyInjectionKey } from '../../drawer/src/interface'
import { modalBodyInjectionKey } from '../../modal/src/interface'
import { popoverBodyInjectionKey } from '../../popover/src/interface'
interface UseAdjustedToProps {

View File

@ -1,4 +1,4 @@
import { type Ref, onMounted, onUnmounted, ref } from 'vue'
import { onMounted, onUnmounted, type Ref, ref } from 'vue'
import { isBrowser } from '../env/is-browser'
export interface IWindowLocation {

View File

@ -1,10 +1,10 @@
import {
type InjectionKey,
type Ref,
getCurrentInstance,
inject,
type InjectionKey,
onBeforeUnmount,
onMounted,
type Ref,
watch
} from 'vue'

View File

@ -1,4 +1,4 @@
import { type Ref, onBeforeMount, onBeforeUnmount, ref } from 'vue'
import { onBeforeMount, onBeforeUnmount, type Ref, ref } from 'vue'
import { isBrowser } from '../env/is-browser'
const isComposingRef = ref(false)

View File

@ -1,10 +1,10 @@
import {
type Ref,
type WatchStopHandle,
onBeforeUnmount,
onMounted,
type Ref,
ref,
watch
watch,
type WatchStopHandle
} from 'vue'
let lockCount = 0

View File

@ -1,4 +1,4 @@
import { type Ref, onBeforeUnmount, onMounted } from 'vue'
import { onBeforeUnmount, onMounted, type Ref } from 'vue'
import { resizeObserverManager } from 'vueuc'
export function useOnResize(

View File

@ -1,3 +1,3 @@
export { formatLength } from './format-length'
export { color2Class } from './color-to-class'
export { formatLength } from './format-length'
export { rtlInset } from './rtl-inset'

View File

@ -1,5 +1,5 @@
import { type CNode, type CProperties, CssRender } from 'css-render'
import { plugin as BemPlugin } from '@css-render/plugin-bem'
import { type CNode, type CProperties, CssRender } from 'css-render'
const namespace = 'n'
const prefix = `.${namespace}-`
@ -49,17 +49,17 @@ function createKey<P extends string, S extends string>(
}
export {
asModal,
c,
cB,
cCB,
cE,
cM,
cNotM,
cCB,
createKey,
find,
insideModal,
insidePopover,
asModal,
prefix,
namespace,
find,
createKey
prefix
}

Some files were not shown because too many files have changed in this diff Show More