feat: 风格统一格式化改动暂存

This commit is contained in:
XiaoDaiGua-Ray 2025-12-27 17:42:58 +08:00
parent d1cedda1f7
commit 6d2b557d27
277 changed files with 2623 additions and 3808 deletions

View File

@ -5,7 +5,6 @@ components.d.ts
.gitignore
public
yarn.*
.prettierrc.*
visualizer.*
visualizer.html
.env.*

View File

@ -1,21 +1,22 @@
module.exports = {
printWidth: 80, // 一行最多 `80` 字符
tabWidth: 2, // 使用 `2` 个空格缩进
useTabs: false, // 不使用缩进符, 而使用空格
semi: false, // 行尾不需要有分号
singleQuote: true, // 使用单引号
quoteProps: 'as-needed', // 对象的 `key` 仅在必要时用引号
jsxSingleQuote: false, // `jsx` 不使用单引号, 而使用双引号
trailingComma: 'all', // 尾随逗号
bracketSpacing: true, // 大括号内的首尾需要空格
arrowParens: 'always', // 箭头函数, 只有一个参数的时候, 也需要括号
rangeStart: 0, // 每个文件格式化的范围是文件的全部内容
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'all',
bracketSpacing: true,
arrowParens: 'always',
rangeStart: 0,
rangeEnd: Infinity,
requirePragma: false, // 不需要写文件开头的 `@prettier`
insertPragma: false, // 不需要自动在文件开头插入 `@prettier`
proseWrap: 'preserve', // 使用默认的折行标准
htmlWhitespaceSensitivity: 'css', // 根据显示样式决定 `html` 要不要折行
endOfLine: 'lf', // 换行符使用 `lf`,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
htmlWhitespaceSensitivity: 'css',
endOfLine: 'lf',
singleAttributePerLine: false,
bracketSameLine: false,
plugins: ['@ianvs/prettier-plugin-sort-imports'],
}

14
.vscode/settings.json vendored
View File

@ -1,8 +1,17 @@
{
//
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
//
"eslint.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@ -64,6 +73,7 @@
"depcheckrc",
"domtoimage",
"EDITMSG",
"ianvs",
"iife",
"internalkey",
"jsbarcode",

View File

@ -1,3 +1,13 @@
## 5.2.5
## Feats
- 升级 `vite` 版本至 `7.x`,为了后面无缝衔接 `rolldown-vite` 做准备
- 升级所有主流依赖为 `7.x` 的配套
- 增强 `eslint`, `prettier` 规则,加强项目统一化的范式
- `typescript` 版本更新至 `5.9.3`
- 移除 `UnknownObjectKey` 类型,现在统一使用 `Recordable` 类型替代,或者全局的 `GlobalRecordable` 类型替代
## 5.2.4
## Feats
@ -779,7 +789,7 @@ const [
补充拓展了 `useModal` 方法,支持 `dad`, `fullscreen` 等拓展配置项。
```ts
import { useTable, useForm } from '@/components'
import { useForm, useTable } from '@/components'
const [registerTable, { getTableInstance }] = useTable()
const [registerForm, { getFormInstance }] = useForm()
@ -799,8 +809,7 @@ const [registerForm, { getFormInstance }] = useForm()
> 该方法比起常见的 `ref` 注册,然后 `tableRef.value.xxx` 的方法获取表格方法更为简洁一点。但是也值得注意的是,需要手动调用一次 `register` 方法,否则会报错;还有值得注意的是,需要注意表格方法的调用时机,需要等待表格注册完成后才能正常调用。如果需要在 `Parent Create` 阶段调用,可以尝试 `nextTick` 包裹一层。
```tsx
import { RTable } from '@/components'
import { useTable } from '@/components'
import { RTable, useTable } from '@/components'
defineComponent({
setup() {
@ -1972,7 +1981,7 @@ const demo2 = null
- 新增切换路由自动取消上一路由所有请求。但是可以通过配置 `useRequest``request` 方法的 `cancelConfig.cancel` 属性控制是否需要自动取消该请求。该配置默认为 `true`,当配置为 `false` 时,则不会被取消器取消
```ts
import { useRequest, useHookPlusRequest } from '@/axios/index'
import { useHookPlusRequest, useRequest } from '@/axios/index'
// useRequest
const { data, loading, run } = useRequest<{
@ -2038,8 +2047,8 @@ request({
- useHookPlusRequest 支持接收一个 Promise 返回值的方法,可以用来包裹 axios 方法然后进行请求配置
```ts
import { useHookPlusRequest, useRequest } from '@/axios/index'
import axiosInstance from '@/axios/instance'
import { useRequest, useHookPlusRequest } from '@/axios/index'
// 使用 useRequest
const { data, loading, run } = useRequest<{

View File

@ -1,8 +1,8 @@
import {
hasStorage,
setStorage,
getStorage,
hasStorage,
removeStorage,
setStorage,
} from '../../src/utils/cache'
describe('cache utils', () => {

View File

@ -1,5 +1,5 @@
import { RModal } from '../../src/components/base/RModal/index'
import { mount } from '@vue/test-utils'
import { RModal } from '../../src/components/base/RModal/index'
describe('RModal', () => {
it('should execute the onAfterEnter callback', () => {

View File

@ -1,5 +1,5 @@
import { printDom } from '../../src/utils/dom'
import { mount } from '@vue/test-utils'
import { printDom } from '../../src/utils/dom'
import renderHook from '../utils/renderHook'
// happy-dom 官方有一个 bug无法使用 canvas.toDataURL 方法。所以该模块单测暂时无法通过

View File

@ -1,4 +1,4 @@
import { setClass, hasClass, removeClass } from '../../src/utils/element'
import { hasClass, removeClass, setClass } from '../../src/utils/element'
import createRefElement from '../utils/createRefElement'
describe('setClass', () => {

View File

@ -1,4 +1,4 @@
import { setStyle, removeStyle } from '../../src/utils/element'
import { removeStyle, setStyle } from '../../src/utils/element'
import createRefElement from '../utils/createRefElement'
describe('setStyle', () => {

View File

@ -1,5 +1,5 @@
import setupMiniApp from '../utils/setupMiniApp'
import { useAppRoot } from '../../src/hooks/template/useAppRoot'
import setupMiniApp from '../utils/setupMiniApp'
describe('useAppRoot', async () => {
await setupMiniApp()

View File

@ -1,8 +1,7 @@
import setupMiniApp from '../utils/setupMiniApp'
import { useBadge } from '../../src/hooks/template/useBadge'
import { useMenuGetters } from '../../src/store'
import type { AppMenuExtraOptions } from '../../src/router/types'
import { useMenuGetters } from '../../src/store'
import setupMiniApp from '../utils/setupMiniApp'
describe('useBadge', async () => {
await setupMiniApp()

View File

@ -1,6 +1,6 @@
import { useContextmenuCoordinate } from '../../src/hooks/components/useContextmenuCoordinate'
import renderHook from '../utils/renderHook'
import createRefElement from '../utils/createRefElement'
import renderHook from '../utils/renderHook'
describe('useContextmenuCoordinate', () => {
const wrapperRef = createRefElement()

View File

@ -1,5 +1,5 @@
import { useDayjs } from '../../src/hooks/web/useDayjs'
import dayjs from 'dayjs'
import { useDayjs } from '../../src/hooks/web/useDayjs'
describe('useDayjs', () => {
const {

View File

@ -1,9 +1,8 @@
import setupMiniApp from '../utils/setupMiniApp'
import { useSiderBar } from '../../src/hooks/template/useSiderBar'
import { useMenuGetters, useMenuActions } from '../../src/store'
import { useVueRouter } from '../../src/hooks/web/useVueRouter'
import { useMenuActions, useMenuGetters } from '../../src/store'
import type { AppMenuOption, MenuTagOptions } from '../../src/types/modules/app'
import setupMiniApp from '../utils/setupMiniApp'
describe('useSiderBar', async () => {
await setupMiniApp()

View File

@ -1,6 +1,6 @@
import setupMiniApp from '../utils/setupMiniApp'
import { getVariableToRefs, setVariable } from '../../src/global-variable'
import { useSpinning } from '../../src/hooks/template/useSpinning'
import { setVariable, getVariableToRefs } from '../../src/global-variable'
import setupMiniApp from '../utils/setupMiniApp'
describe('useSpinning', async () => {
await setupMiniApp()

View File

@ -1,5 +1,5 @@
import setupMiniApp from '../utils/setupMiniApp'
import { useTheme } from '../../src/hooks/template/useTheme'
import setupMiniApp from '../utils/setupMiniApp'
describe('useTheme', async () => {
await setupMiniApp()

View File

@ -1,5 +1,5 @@
import setupMiniApp from '../utils/setupMiniApp'
import { useVueRouter } from '../../src/hooks/web/useVueRouter'
import setupMiniApp from '../utils/setupMiniApp'
describe('useVueRouter', async () => {
await setupMiniApp()

View File

@ -1,6 +1,6 @@
import setupMiniApp from '../utils/setupMiniApp'
import { useWatermark } from '../../src/hooks/template/useWatermark'
import { useSettingGetters } from '../../src/store'
import setupMiniApp from '../utils/setupMiniApp'
describe('useWatermark', async () => {
await setupMiniApp()

View File

@ -1,11 +1,11 @@
import {
isCurrency,
format,
add,
subtract,
multiply,
divide,
distribute,
divide,
format,
isCurrency,
multiply,
subtract,
} from '../../src/utils/precision'
describe('precision', () => {

View File

@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { createApp, defineComponent } from 'vue'
import type { App } from 'vue'
export default function renderHook<R = any>(

View File

@ -1,6 +1,6 @@
import { setupStore } from '../../src/store'
import { setupRouter } from '../../src/router'
import { setupI18n } from '../../src/locales'
import { setupRouter } from '../../src/router'
import { setupStore } from '../../src/store'
import renderHook from '../utils/renderHook'
/**

View File

@ -1,12 +1,12 @@
import vue from 'eslint-plugin-vue'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import prettier from 'eslint-plugin-prettier'
import globals from 'globals'
import parser from 'vue-eslint-parser'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'
import js from '@eslint/js'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import prettier from 'eslint-plugin-prettier'
import vue from 'eslint-plugin-vue'
import globals from 'globals'
import parser from 'vue-eslint-parser'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
@ -44,14 +44,11 @@ export default [
{
files: ['**/*.js', '**/*.ts', '**/*.jsx', '**/*.tsx', '**/*.vue'],
},
js.configs.recommended,
...vue.configs['flat/recommended'],
...compat.extends(
'eslint-config-prettier',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'plugin:vue/vue3-essential',
'plugin:prettier/recommended',
'prettier',
'./unplugin/.eslintrc-auto-import.json',
),
{
@ -213,7 +210,7 @@ export default [
},
],
'vue/v-on-event-hyphenation': ['error', 'never'],
'vue/component-tags-order': [
'vue/block-order': [
'error',
{
order: ['template', 'script', 'style'],
@ -258,92 +255,30 @@ export default [
],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: ['import'],
next: '*',
},
{
blankLine: 'any',
prev: 'import',
next: 'import',
},
{
blankLine: 'always',
prev: '*',
next: 'export',
},
{
blankLine: 'any',
prev: 'export',
next: 'export',
},
{
blankLine: 'always',
prev: ['const', 'let', 'var'],
next: '*',
},
{ blankLine: 'always', prev: 'import', next: '*' },
{ blankLine: 'any', prev: 'import', next: 'import' },
{ blankLine: 'always', prev: '*', next: 'export' },
{ blankLine: 'always', prev: 'export', next: '*' },
{ blankLine: 'any', prev: 'export', next: 'export' },
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var'],
},
{
blankLine: 'always',
prev: 'directive',
next: '*',
},
{
blankLine: 'any',
prev: 'directive',
next: 'directive',
},
{
blankLine: 'always',
prev: '*',
next: [
'if',
'class',
'for',
'do',
'while',
'switch',
'try',
'with',
'function',
'block',
'block-like',
'break',
'case',
'continue',
'return',
'throw',
'debugger',
],
},
{
blankLine: 'always',
prev: [
'if',
'class',
'for',
'do',
'while',
'switch',
'try',
'with',
'function',
'block',
'block-like',
'break',
'case',
'continue',
'return',
'throw',
'debugger',
],
next: '*',
},
{ blankLine: 'always', prev: '*', next: 'function' },
{ blankLine: 'always', prev: 'function', next: '*' },
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: '*', next: 'if' },
{ blankLine: 'always', prev: 'if', next: '*' },
{ blankLine: 'always', prev: '*', next: 'for' },
{ blankLine: 'always', prev: 'for', next: '*' },
{ blankLine: 'always', prev: '*', next: 'while' },
{ blankLine: 'always', prev: 'while', next: '*' },
{ blankLine: 'always', prev: '*', next: 'class' },
{ blankLine: 'always', prev: 'class', next: '*' },
{ blankLine: 'always', prev: '*', next: 'try' },
{ blankLine: 'always', prev: 'try', next: '*' },
],
'@typescript-eslint/no-unused-expressions': [
'error',

View File

@ -1,7 +1,7 @@
import { defineMock } from 'vite-plugin-mock-dev-server'
import { pagination, stringify, response, array } from '@mock/shared/utils'
import { tableMock } from '@mock/shared/database'
import { array, pagination, response, stringify } from '@mock/shared/utils'
import Mock from 'mockjs'
import { defineMock } from 'vite-plugin-mock-dev-server'
export const getPersonList = defineMock({
url: '/api/list',

51
package.json Executable file → Normal file
View File

@ -1,10 +1,10 @@
{
"name": "ray-template",
"private": false,
"version": "5.2.4",
"version": "5.2.5",
"type": "module",
"engines": {
"node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"node": "^20.0.0 || >=22.0.0",
"pnpm": ">=9.0.0"
},
"scripts": {
@ -47,14 +47,14 @@
"jsbarcode": "3.11.6",
"lodash-es": "^4.17.21",
"mockjs": "1.1.0",
"naive-ui": "^2.42.0",
"naive-ui": "^2.43.2",
"pinia": "^3.0.3",
"pinia-plugin-persistedstate": "^4.4.1",
"print-js": "^1.6.0",
"vue": "^3.5.24",
"vue": "^3.5.25",
"vue-demi": "0.14.10",
"vue-hooks-plus": "2.4.1",
"vue-i18n": "^9.13.1",
"vue-i18n": "^11.1.3",
"vue-router": "^4.6.3",
"vue3-next-qrcode": "3.0.2"
},
@ -62,28 +62,29 @@
"@commitlint/cli": "19.7.1",
"@commitlint/config-conventional": "19.7.1",
"@eslint/eslintrc": "3.3.1",
"@eslint/js": "9.30.1",
"@eslint/js": "9.39.1",
"@ianvs/prettier-plugin-sort-imports": "4.7.0",
"@interactjs/types": "1.10.27",
"@intlify/unplugin-vue-i18n": "4.0.0",
"@intlify/unplugin-vue-i18n": "11.0.1",
"@types/crypto-js": "4.2.2",
"@types/jsbarcode": "3.11.4",
"@types/lodash-es": "4.17.12",
"@types/mockjs": "1.0.10",
"@typescript-eslint/eslint-plugin": "8.36.0",
"@typescript-eslint/parser": "8.36.0",
"@vitejs/plugin-vue": "6.0.1",
"@vitejs/plugin-vue-jsx": "5.1.1",
"@vitest/ui": "3.0.5",
"@typescript-eslint/eslint-plugin": "8.47.0",
"@typescript-eslint/parser": "8.47.0",
"@vitejs/plugin-vue": "6.0.2",
"@vitejs/plugin-vue-jsx": "5.1.2",
"@vitest/ui": "4.0.12",
"@vue/eslint-config-prettier": "10.1.0",
"@vue/eslint-config-typescript": "14.2.0",
"@vue/test-utils": "2.4.6",
"autoprefixer": "10.4.21",
"depcheck": "1.4.7",
"eslint": "9.31.0",
"eslint": "9.39.1",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-prettier": "5.5.4",
"eslint-plugin-vue": "9.32.0",
"globals": "16.3.0",
"eslint-plugin-vue": "10.6.0",
"globals": "16.5.0",
"happy-dom": "17.1.0",
"husky": "8.0.3",
"lint-staged": "15.4.3",
@ -91,23 +92,23 @@
"postcss-px-to-viewport-8-with-include": "1.2.2",
"prettier": "3.6.2",
"rollup-plugin-gzip": "4.0.1",
"sass": "1.86.3",
"sass": "1.94.2",
"svg-sprite-loader": "6.0.11",
"typescript": "5.8.3",
"unocss": "66.3.3",
"unplugin-auto-import": "19.1.2",
"typescript": "5.9.3",
"unocss": "66.5.9",
"unplugin-auto-import": "20.2.0",
"unplugin-vue-components": "0.28.0",
"vite": "6.3.5",
"vite-bundle-analyzer": "0.16.0",
"vite": "7.2.6",
"vite-bundle-analyzer": "1.2.3",
"vite-plugin-cdn2": "1.1.0",
"vite-plugin-ejs": "1.7.0",
"vite-plugin-eslint": "1.8.1",
"vite-plugin-inspect": "0.10.6",
"vite-plugin-mock-dev-server": "1.8.3",
"vite-plugin-inspect": "11.3.3",
"vite-plugin-mock-dev-server": "2.0.4",
"vite-plugin-svg-icons": "2.0.1",
"vite-svg-loader": "5.1.0",
"vitest": "2.1.8",
"vue-eslint-parser": "9.4.3",
"vitest": "4.0.12",
"vue-eslint-parser": "10.2.0",
"vue-tsc": "2.2.8"
},
"description": "<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->",

4055
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,11 @@
import { RouterView } from 'vue-router'
import AppGlobalSpin from '@/app-components/app/AppGlobalSpin'
import AppLockScreen from '@/app-components/app/AppLockScreen'
import AppNaiveGlobalProvider from '@/app-components/provider/AppNaiveGlobalProvider'
import AppStyleProvider from '@/app-components/provider/AppStyleProvider'
import AppLockScreen from '@/app-components/app/AppLockScreen'
import AppWatermarkProvider from '@/app-components/provider/AppWatermarkProvider'
import AppGlobalSpin from '@/app-components/app/AppGlobalSpin'
import AppVersionProvider from '@/app-components/provider/AppVersionProvider'
import AppWatermarkProvider from '@/app-components/provider/AppWatermarkProvider'
import { APP_GLOBAL_LOADING } from '@/app-config'
import { RouterView } from 'vue-router'
export default defineComponent({
name: 'App',

View File

@ -1,5 +1,5 @@
import { useSettingGetters } from '@/store'
import { useVueRouter } from '@/hooks'
import { useSettingGetters } from '@/store'
/**
*

View File

@ -1,9 +1,9 @@
import {
DAYJS_LOCAL_MAP,
DEFAULT_DAYJS_LOCAL,
LOCAL_OPTIONS,
SYSTEM_DEFAULT_LOCAL,
SYSTEM_FALLBACK_LOCALE,
DAYJS_LOCAL_MAP,
DEFAULT_DAYJS_LOCAL,
} from '@/app-config'
/**

View File

@ -1,5 +1,4 @@
import { request } from '@/axios'
import type { PaginationResponse } from '@/types'
export interface MockListParams {

View File

@ -9,11 +9,10 @@
*/
import { request } from '@/axios'
import type { BasicResponse } from '@/types'
interface AxiosTestResponse extends UnknownObjectKey {
data: UnknownObjectKey[]
interface AxiosTestResponse extends GlobalRecordable {
data: GlobalRecordable[]
city?: string
}

View File

@ -6,13 +6,10 @@
* session catch
*/
import { NAvatar, NButton, NFlex } from 'naive-ui'
import { avatarProps } from 'naive-ui'
import { useSigningGetters } from '@/store'
import type { PropType } from 'vue'
import { avatarProps, NAvatar, NButton, NFlex } from 'naive-ui'
import type { AvatarProps, FlexProps } from 'naive-ui'
import type { PropType } from 'vue'
const AppAvatar = defineComponent({
name: 'AppAvatar',

View File

@ -15,11 +15,8 @@
* 2. 使
*/
import { NSpin } from 'naive-ui'
import { spinProps } from 'naive-ui'
import { getVariableToRefs } from '@/global-variable'
import { NSpin, spinProps } from 'naive-ui'
import type { SpinProps } from 'naive-ui'
const GlobalSpin = defineComponent({

View File

@ -1,5 +1,5 @@
import { useStorage } from '@vueuse/core'
import { APP_CATCH_KEY } from '@/app-config'
import { useStorage } from '@vueuse/core'
const appLockScreen = useStorage(
APP_CATCH_KEY.isAppLockScreen,

View File

@ -1,16 +1,13 @@
import { NInput, NFormItem, NButton } from 'naive-ui'
import AppAvatar from '@/app-components/app/AppAvatar'
import { RForm } from '@/components'
import useAppLockScreen from '@/app-components/app/AppLockScreen/appLockVar'
import { rules, useCondition } from '@/app-components/app/AppLockScreen/shared'
import { useSettingActions } from '@/store'
import { useTemplateRef } from 'vue'
import { useForm } from '@/components'
import { APP_CATCH_KEY } from '@/app-config'
import { setStorage, encrypt } from '@/utils'
import { RForm, useForm } from '@/components'
import { useSettingActions } from '@/store'
import { encrypt, setStorage } from '@/utils'
import { NButton, NFormItem, NInput } from 'naive-ui'
import type { InputInst } from 'naive-ui'
import { useTemplateRef } from 'vue'
const LockScreen = defineComponent({
name: 'LockScreen',

View File

@ -1,17 +1,14 @@
import '../../index.scss'
import { NInput, NFormItem, NButton, NFlex } from 'naive-ui'
import AppAvatar from '@/app-components/app/AppAvatar'
import { RForm } from '@/components'
import dayjs from 'dayjs'
import { useSigningActions, useSettingActions } from '@/store'
import { rules, useCondition } from '@/app-components/app/AppLockScreen/shared'
import useAppLockScreen from '@/app-components/app/AppLockScreen/appLockVar'
import { useDevice } from '@/hooks'
import { useForm } from '@/components'
import { rules, useCondition } from '@/app-components/app/AppLockScreen/shared'
import { APP_CATCH_KEY } from '@/app-config'
import { removeStorage, decrypt, getStorage } from '@/utils'
import { RForm, useForm } from '@/components'
import { useDevice } from '@/hooks'
import { useSettingActions, useSigningActions } from '@/store'
import { decrypt, getStorage, removeStorage } from '@/utils'
import dayjs from 'dayjs'
import { NButton, NFlex, NFormItem, NInput } from 'naive-ui'
export default defineComponent({
name: 'UnlockScreen',

View File

@ -1,8 +1,7 @@
import { RModal } from '@/components'
import { useSettingActions, useSettingGetters } from '@/store'
import LockScreen from './components/LockScreen'
import { useSettingGetters, useSettingActions } from '@/store'
const AppLockScreen = defineComponent({
name: 'AppLockScreen',
setup() {

View File

@ -1,4 +1,4 @@
import { NAvatar, NTooltip, NFlex } from 'naive-ui'
import { NAvatar, NFlex, NTooltip } from 'naive-ui'
interface AvatarOptions {
key: string

View File

@ -6,21 +6,20 @@
* ,
*/
import {
NDialogProvider,
NLoadingBarProvider,
NMessageProvider,
NNotificationProvider,
NConfigProvider,
createDiscreteApi,
darkTheme,
NGlobalStyle,
NModalProvider,
} from 'naive-ui'
import { MESSAGE_PROVIDER } from '@/app-config'
import { getNaiveLocales } from '@/locales/utils'
import { useSettingGetters } from '@/store'
import { MESSAGE_PROVIDER } from '@/app-config'
import {
createDiscreteApi,
darkTheme,
NConfigProvider,
NDialogProvider,
NGlobalStyle,
NLoadingBarProvider,
NMessageProvider,
NModalProvider,
NNotificationProvider,
} from 'naive-ui'
export default defineComponent({
name: 'GlobalProvider',

View File

@ -1,16 +1,15 @@
import { get } from 'lodash-es'
import { APP_CATCH_KEY, APP_THEME, GLOBAL_CLASS_NAMES } from '@/app-config'
import { useSettingGetters } from '@/store'
import type { SettingState } from '@/store/modules/setting/types'
import {
setClass,
removeClass,
setStyle,
colorToRgba,
getStorage,
removeClass,
setClass,
setStyle,
} from '@/utils'
import { useSettingGetters } from '@/store'
import { APP_CATCH_KEY, GLOBAL_CLASS_NAMES, APP_THEME } from '@/app-config'
import { useWindowSize } from '@vueuse/core'
import type { SettingState } from '@/store/modules/setting/types'
import { get } from 'lodash-es'
export default defineComponent({
name: 'AppStyleProvider',

View File

@ -4,11 +4,10 @@
* 退
*/
import { RModal } from '@/components'
import { getStorage, setStorage } from '@/utils'
import { useSigningActions } from '@/store'
import { APP_CATCH_KEY } from '@/app-config'
import { RModal } from '@/components'
import { useSigningActions } from '@/store'
import { getStorage, setStorage } from '@/utils'
export default defineComponent({
name: 'AppVersionProvider',

View File

@ -8,9 +8,8 @@
* useWatermark hook
*/
import { NWatermark } from 'naive-ui'
import { useSettingGetters } from '@/store'
import { NWatermark } from 'naive-ui'
export default defineComponent({
name: 'AppWatermarkProvider',

View File

@ -1,5 +1,9 @@
import type { TemplateLocale, LocalOptions, DayjsLocalMap } from '@/types'
import type { ValueOf } from '@/types'
import type {
DayjsLocalMap,
LocalOptions,
TemplateLocale,
ValueOf,
} from '@/types'
/**
*

View File

@ -1,6 +1,5 @@
import { axiosCanceler } from '@/axios/utils/interceptor'
import type { AxiosRequestInterceptor, FetchErrorFunction } from '@/axios/types'
import { axiosCanceler } from '@/axios/utils/interceptor'
/**
*

View File

@ -1,11 +1,10 @@
import { appendRequestHeaders } from '@/axios/utils/append-request-headers'
import { APP_CATCH_KEY } from '@/app-config'
import { getStorage } from '@/utils'
import type {
RequestInterceptorConfig,
AxiosRequestInterceptor,
RequestInterceptorConfig,
} from '@/axios/types'
import { appendRequestHeaders } from '@/axios/utils/append-request-headers'
import { getStorage } from '@/utils'
/**
*

View File

@ -1,9 +1,8 @@
import { axiosCanceler } from '@/axios/utils/interceptor'
import type {
AxiosResponseInterceptor,
FetchErrorFunction,
} from '@/axios/types'
import { axiosCanceler } from '@/axios/utils/interceptor'
/**
*

View File

@ -10,11 +10,10 @@
* 使
*/
import useHookPlusRequest from 'vue-hooks-plus/es/useRequest'
import request from '@/axios/instance'
import type { UseRequestOptions } from 'vue-hooks-plus/es/useRequest/types'
import type { AppRawRequestConfig } from '@/axios/types'
import useHookPlusRequest from 'vue-hooks-plus/es/useRequest'
import type { UseRequestOptions } from 'vue-hooks-plus/es/useRequest/types'
/**
*

View File

@ -1,15 +1,14 @@
import axios from 'axios'
import { AXIOS_CONFIG } from '@/app-config'
import { axiosInterceptor } from '@/axios/utils/interceptor'
import {
setupResponseInterceptor,
setupResponseErrorInterceptor,
} from '@/axios/axios-interceptor/response'
import {
setupRequestInterceptor,
setupRequestErrorInterceptor,
setupRequestInterceptor,
} from '@/axios/axios-interceptor/request'
import {
setupResponseErrorInterceptor,
setupResponseInterceptor,
} from '@/axios/axios-interceptor/response'
import { axiosInterceptor } from '@/axios/utils/interceptor'
import axios from 'axios'
import type { AxiosInstanceExpand, RequestInterceptorConfig } from './types'
// 创建 axios 实例

View File

@ -1,16 +1,16 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { AnyFn } from '@/types'
import type {
Axios,
AxiosDefaults,
AxiosError,
AxiosHeaders,
AxiosRequestConfig,
HeadersDefaults,
AxiosDefaults,
Axios,
AxiosResponse,
AxiosError,
InternalAxiosRequestConfig,
AxiosRequestHeaders,
AxiosResponse,
HeadersDefaults,
InternalAxiosRequestConfig,
} from 'axios'
import type { AnyFC } from '@/types'
export type AxiosHeaderValue =
| AxiosHeaders
@ -136,13 +136,13 @@ export type RequestInterceptorConfig<T = any> = AppRawRequestConfig<T>
export type ResponseInterceptorConfig<T = any, K = any> = AxiosResponse<T, K>
export interface ImplementQueue {
implementRequestInterceptorArray: AnyFC[]
implementResponseInterceptorArray: AnyFC[]
implementRequestInterceptorArray: AnyFn[]
implementResponseInterceptorArray: AnyFn[]
}
export interface ErrorImplementQueue {
implementRequestInterceptorErrorArray: AnyFC[]
implementResponseInterceptorErrorArray: AnyFC[]
implementRequestInterceptorErrorArray: AnyFn[]
implementResponseInterceptorErrorArray: AnyFn[]
}
export type FetchType = 'ok' | 'error'

View File

@ -1,4 +1,4 @@
import type { RawAxiosRequestHeaders, AxiosRequestConfig } from 'axios'
import type { AxiosRequestConfig, RawAxiosRequestHeaders } from 'axios'
import type { RequestHeaderOptions } from '../types'
/**

View File

@ -1,4 +1,4 @@
import type { RawAxiosRequestHeaders, AxiosRequestConfig } from 'axios'
import type { AxiosRequestConfig, RawAxiosRequestHeaders } from 'axios'
import type { RequestHeaderOptions } from '../types'
/**

View File

@ -1,16 +1,15 @@
import RequestCanceler from '@/axios/utils/RequestCanceler'
import { getAppEnvironment } from '@/utils'
import type {
RequestInterceptorConfig,
ResponseInterceptorConfig,
ImplementQueue,
AxiosFetchError,
AxiosFetchInstance,
ErrorImplementQueue,
FetchType,
AxiosFetchInstance,
AxiosFetchError,
ImplementQueue,
RequestInterceptorConfig,
ResponseInterceptorConfig,
} from '@/axios/types'
import type { AnyFC } from '@/types'
import RequestCanceler from '@/axios/utils/RequestCanceler'
import type { AnyFn } from '@/types'
import { getAppEnvironment } from '@/utils'
import type { AxiosError } from 'axios'
type ImplementKeys = keyof ImplementQueue
@ -88,7 +87,7 @@ export const axiosInterceptor = () => {
*/
const setImplement = (
key: ImplementKeys | ErrorImplementKeys,
func: AnyFC[],
func: AnyFn[],
fetchType: FetchType,
): void => {
if (fetchType === 'ok') {
@ -111,7 +110,7 @@ export const axiosInterceptor = () => {
const getImplement = (
key: ImplementKeys | ErrorImplementKeys,
fetchType: FetchType,
): AnyFC[] => {
): AnyFn[] => {
return fetchType === 'ok'
? implement[key as ImplementKeys]
: errorImplement[key as ErrorImplementKeys]
@ -125,7 +124,7 @@ export const axiosInterceptor = () => {
* @description
* -
*/
const executeQueue = (funcs: AnyFC[], ...args: unknown[]): void => {
const executeQueue = (funcs: AnyFn[], ...args: unknown[]): void => {
funcs.forEach((func) => {
if (typeof func === 'function') {
func(...args)

View File

@ -1,7 +1,6 @@
import type { ExtractPublicPropTypes } from 'vue'
import RBarcode from './src/Barcode'
import barcodeProps from './src/props'
import type { ExtractPublicPropTypes } from 'vue'
import type { RBarcodeSize } from './src/types'
// 扩展 BarcodeProps 以提供更好的类型提示

View File

@ -1,15 +1,12 @@
import './index.scss'
import { NSpin } from 'naive-ui'
import barcode from 'jsbarcode'
import props from './props'
import { completeSize, call } from '@/utils'
import { useTemplateRef } from 'vue'
import { call, completeSize } from '@/utils'
import { useResizeObserver } from '@vueuse/core'
import type { WatchStopHandle } from 'vue'
import type { UseResizeObserverReturn } from '@vueuse/core'
import barcode from 'jsbarcode'
import { NSpin } from 'naive-ui'
import { useTemplateRef } from 'vue'
import type { WatchStopHandle } from 'vue'
import props from './props'
export default defineComponent({
name: 'RBarcode',

View File

@ -1,11 +1,11 @@
import type { MaybeArray } from '@/types'
import type { PropType } from 'vue'
import type {
RBarcodeRender,
RBarcodeOptions,
RBarcodeFormat,
RBarcodeOptions,
RBarcodeRender,
RBarcodeSize,
} from './types'
import type { PropType } from 'vue'
import type { MaybeArray } from '@/types'
const props = {
/**

View File

@ -1,10 +1,9 @@
import RChart from './src/Chart'
import chartProps from './src/props'
import useChart from './src/hooks/useChart'
import type { ExtractPublicPropTypes } from 'vue'
import type * as RChartType from './src/types'
import RChart from './src/Chart'
import useChart from './src/hooks/useChart'
import type { UseChartReturn } from './src/hooks/useChart'
import chartProps from './src/props'
import type * as RChartType from './src/types'
export type ChartProps = ExtractPublicPropTypes<typeof chartProps>
export type { RChartType, UseChartReturn }

View File

@ -1,52 +1,53 @@
import './index.scss'
import { use, registerTheme, init } from 'echarts/core' // echarts 核心模块
import {
TitleComponent,
TooltipComponent,
GridComponent,
DatasetComponent,
TransformComponent,
LegendComponent,
ToolboxComponent,
AriaComponent,
} from 'echarts/components' // 提示框, 标题, 直角坐标系, 数据集, 内置数据转换器等组件(组件后缀都为 Component)
import {
BarChart,
LineChart,
PieChart,
CandlestickChart,
ScatterChart,
PictorialBarChart,
} from 'echarts/charts' // 系列类型(后缀都为 SeriesOption)
import { LegacyGridContainLabel, UniversalTransition } from 'echarts/features' // 标签自动布局, 全局过渡动画等特性
import { CanvasRenderer } from 'echarts/renderers' // echarts 渲染器
import { NCard } from 'naive-ui'
import props from './props'
import { throttle } from 'lodash-es'
import { completeSize, downloadBase64File, call, renderNode } from '@/utils'
import { getCustomEchartTheme, loadingOptions, setEchartOptions } from './utils'
import { APP_THEME } from '@/app-config'
import {
useResizeObserver,
useIntersectionObserver,
watchThrottled,
} from '@vueuse/core'
import { RMoreDropdown } from '@/components'
import { useSettingGetters } from '@/store'
import { useTemplateRef } from 'vue'
import { USE_CHART_PROVIDER_KEY } from './config'
import type { WatchStopHandle } from 'vue'
import type { AnyFC } from '@/types'
import type { DebouncedFunc } from 'lodash-es'
import type {
UseResizeObserverReturn,
UseIntersectionObserverReturn,
import type { AnyFn } from '@/types'
import { call, completeSize, downloadBase64File, renderNode } from '@/utils'
import {
useIntersectionObserver,
useResizeObserver,
watchThrottled,
} from '@vueuse/core'
import type {
UseIntersectionObserverReturn,
UseResizeObserverReturn,
} from '@vueuse/core'
// 提示框, 标题, 直角坐标系, 数据集, 内置数据转换器等组件(组件后缀都为 Component)
import {
BarChart,
CandlestickChart,
LineChart,
PictorialBarChart,
PieChart,
ScatterChart,
} from 'echarts/charts'
import {
AriaComponent,
DatasetComponent,
GridComponent,
LegendComponent,
TitleComponent,
ToolboxComponent,
TooltipComponent,
TransformComponent,
} from 'echarts/components'
import { init, registerTheme, use } from 'echarts/core' // echarts 核心模块
import type { ECharts, EChartsCoreOption } from 'echarts/core'
import type { DropdownProps, DropdownOption } from 'naive-ui'
// 系列类型(后缀都为 SeriesOption)
import { LegacyGridContainLabel, UniversalTransition } from 'echarts/features' // 标签自动布局, 全局过渡动画等特性
import { CanvasRenderer } from 'echarts/renderers' // echarts 渲染器
import { throttle } from 'lodash-es'
import type { DebouncedFunc } from 'lodash-es'
import { NCard } from 'naive-ui'
import type { DropdownOption, DropdownProps } from 'naive-ui'
import { useTemplateRef } from 'vue'
import type { WatchStopHandle } from 'vue'
import { USE_CHART_PROVIDER_KEY } from './config'
import props from './props'
import { getCustomEchartTheme, loadingOptions, setEchartOptions } from './utils'
// 获取 chart 主题
const echartThemes = getCustomEchartTheme()
@ -94,7 +95,7 @@ export default defineComponent({
// echart 实例
const echartInstanceRef = shallowRef<ECharts>()
// resize 防抖方法实例
let resizeThrottleReturn: DebouncedFunc<AnyFC> | null
let resizeThrottleReturn: DebouncedFunc<AnyFn> | null
// resize observer 实例
let resizeObserverReturn: UseResizeObserverReturn | null
// 当前配置主题
@ -366,7 +367,7 @@ export default defineComponent({
if (!resizeObserverReturn) {
resizeObserverReturn = useResizeObserver(
props.autoResizeObserverTarget || rayChartWrapperRef,
resizeThrottleReturn as AnyFC,
resizeThrottleReturn as AnyFn,
)
}
}

View File

@ -1,5 +1,5 @@
import type { ECharts } from 'echarts/core'
import type { VoidFC } from '@/types'
import type { ECharts } from 'echarts/core'
/**
*

View File

@ -1,5 +1,4 @@
import { USE_CHART_PROVIDER_KEY } from '../config'
import type { ChartTheme } from '../types'
export interface ChartProviderOptions {

View File

@ -1,23 +1,22 @@
import { loadingOptions, setEchartOptions } from './utils'
import type * as echarts from 'echarts/core' // echarts 核心模块
import type { PropType, VNode } from 'vue'
import type { MaybeArray } from '@/types'
import type { ECharts, SetOptionOpts } from 'echarts/core'
import type { MaybeArray, VoidFC } from '@/types'
import type {
MaybeComputedElementRef,
MaybeElement,
UseIntersectionObserverOptions,
} from '@vueuse/core'
import type * as echarts from 'echarts/core' // echarts 核心模块
import type { ECharts, SetOptionOpts } from 'echarts/core'
import type { CardProps, DropdownOption, DropdownProps } from 'naive-ui'
import type { PropType, VNode } from 'vue'
import type {
LoadingOptions,
ChartTheme,
EChartsExtensionInstallRegisters,
RChartPresetType,
LoadingOptions,
RChartDownloadOptions,
RChartPresetType,
} from './types'
import type { CardProps, DropdownProps, DropdownOption } from 'naive-ui'
import type { VoidFC } from '@/types'
import { loadingOptions, setEchartOptions } from './utils'
const props = {
/**

View File

@ -13,12 +13,12 @@ import type { ECharts } from 'echarts/core'
import type { CanvasRenderer } from 'echarts/renderers' // `echarts` 渲染器
export interface ChartThemeRawModules {
default: Record<string, UnknownObjectKey>
default: Record<string, GlobalRecordable>
}
export interface ChartThemeRawArray {
name: string
theme: UnknownObjectKey
theme: GlobalRecordable
}
export interface LoadingOptions {

View File

@ -1,6 +1,5 @@
import { useTheme } from '@/hooks'
import type { LoadingOptions } from '@/components/base/RChart/src/types'
import { useTheme } from '@/hooks'
/**
*

View File

@ -1,8 +1,7 @@
import type { ExtractPublicPropTypes } from 'vue'
import RCollapseGrid from './src'
import collapseGridProps from './src/props'
import type * as RCollapseGridType from './src/types'
import type { ExtractPublicPropTypes } from 'vue'
export type CollapseGridProps = ExtractPublicPropTypes<typeof collapseGridProps>
export type { RCollapseGridType }

View File

@ -9,14 +9,11 @@
*/
import './index.scss'
import { NCard, NGrid, NGridItem, NFlex } from 'naive-ui'
import { RIcon } from '@/components'
import { call } from '@/utils'
import props from './props'
import { NCard, NFlex, NGrid, NGridItem } from 'naive-ui'
import type { GridProps } from 'naive-ui'
import props from './props'
export default defineComponent({
name: 'RCollapseGrid',

View File

@ -1,8 +1,7 @@
import type { AnyFn, MaybeArray } from '@/types'
import { gridProps } from 'naive-ui'
import type { PropType } from 'vue'
import type { CollapseToggleText, ActionAlignType } from './types'
import type { AnyFC, MaybeArray } from '@/types'
import type { ActionAlignType, CollapseToggleText } from './types'
const props = {
/**

View File

@ -1,15 +1,11 @@
import './index.scss'
import { NCard } from 'naive-ui'
import { Teleport, Transition } from 'vue'
import interact from 'interactjs'
import { cardProps } from 'naive-ui'
import { unrefElement, completeSize, queryElements } from '@/utils'
import type { VNode } from 'vue'
import type { AnyFn } from '@/types'
import { completeSize, queryElements, unrefElement } from '@/utils'
import type { MaybeElement, MaybeRefOrGetter } from '@vueuse/core'
import type { AnyFC } from '@/types'
import interact from 'interactjs'
import { cardProps, NCard } from 'naive-ui'
import { Teleport, Transition } from 'vue'
import type { VNode } from 'vue'
type RestrictRectOptions = Parameters<typeof interact.modifiers.restrictRect>[0]
@ -323,7 +319,7 @@ export default defineComponent({
}
// 更新拖拽
const refreshDraggableWhenPropsChange = (fn: AnyFC) => {
const refreshDraggableWhenPropsChange = (fn: AnyFn) => {
isSetup = false
fn()

View File

@ -1,8 +1,7 @@
import RFlow from './src/Flow'
import flowProps from './src/props'
import { useFlow } from './src/hooks'
import type { ExtractPublicPropTypes } from 'vue'
import RFlow from './src/Flow'
import { useFlow } from './src/hooks'
import flowProps from './src/props'
export type FlowProps = ExtractPublicPropTypes<typeof flowProps>

View File

@ -1,14 +1,12 @@
import './index.scss'
import '@logicflow/core/lib/style/index.css'
import { useTemplateRef } from 'vue'
import props from './props'
import { completeSize, call } from '@/utils'
import { call, completeSize } from '@/utils'
import LogicFlow from '@logicflow/core'
import { omit } from 'lodash-es'
import type { FlowGraphData, G } from './types'
import { useTemplateRef } from 'vue'
import type { WatchStopHandle } from 'vue'
import props from './props'
import type { FlowGraphData, G } from './types'
// 是否首次注册插件
let isSetup = false

View File

@ -1,8 +1,7 @@
import { getDefaultFlowOptions } from './constant'
import type { FlowGraphData, FlowOptions, ExtensionType } from './types'
import type LogicFlow from '@logicflow/core'
import type { MaybeArray } from '@/types'
import type LogicFlow from '@logicflow/core'
import { getDefaultFlowOptions } from './constant'
import type { ExtensionType, FlowGraphData, FlowOptions } from './types'
const props = {
/**

View File

@ -1,5 +1,5 @@
import type LogicFlow from '@logicflow/core'
import type { Recordable, SetRequired } from '@/types'
import type LogicFlow from '@logicflow/core'
/**
*

View File

@ -1,10 +1,9 @@
import RForm from './src/Form'
import formProps from './src/props'
import useForm from './src/hooks/useForm'
import type * as RFormType from './src/types'
import type { ExtractPublicPropTypes } from 'vue'
import RForm from './src/Form'
import useForm from './src/hooks/useForm'
import type { UseFormReturn } from './src/hooks/useForm'
import formProps from './src/props'
import type * as RFormType from './src/types'
export type FormProps = ExtractPublicPropTypes<typeof formProps>
export type { RFormType, UseFormReturn }

View File

@ -1,12 +1,10 @@
import { NForm, NSpin } from 'naive-ui'
import props from './props'
import { call, unrefElement } from '@/utils'
import { useTemplateRef } from 'vue'
import { useEventListener } from '@vueuse/core'
import type { RFormInst } from './types'
import { NForm, NSpin } from 'naive-ui'
import { useTemplateRef } from 'vue'
import type { ShallowRef } from 'vue'
import props from './props'
import type { RFormInst } from './types'
export default defineComponent({
name: 'RForm',

View File

@ -1,12 +1,11 @@
import { cloneDeep } from 'lodash-es'
import type {
RFormInst,
FormValidateCallback,
ShouldRuleBeApplied,
RFormRules,
} from '../types'
import type { Recordable } from '@/types'
import { cloneDeep } from 'lodash-es'
import type {
FormValidateCallback,
RFormInst,
RFormRules,
ShouldRuleBeApplied,
} from '../types'
/**
*

View File

@ -1,7 +1,6 @@
import { formProps } from 'naive-ui'
import type { AnyFn, MaybeArray } from '@/types'
import { omit } from 'lodash-es'
import type { MaybeArray, AnyFC } from '@/types'
import { formProps } from 'naive-ui'
import type { RFormInst } from './types'
const props = {
@ -67,7 +66,7 @@ const props = {
* @default null
*/
onFinish: {
type: Function as PropType<AnyFC>,
type: Function as PropType<AnyFn>,
default: null,
},
/**

View File

@ -1,8 +1,7 @@
import type { ExtractPublicPropTypes } from 'vue'
import RIcon from './src/Icon'
import iconProps from './src/props'
import type { ExtractPublicPropTypes } from 'vue'
export type IconProps = ExtractPublicPropTypes<typeof iconProps>
export { RIcon, iconProps }

View File

@ -1,6 +1,5 @@
import './index.scss'
import { completeSize, call } from '@/utils'
import { call, completeSize } from '@/utils'
import props from './props'
export default defineComponent({

View File

@ -1,5 +1,5 @@
import type { PropType } from 'vue'
import type { MaybeArray } from '@/types'
import type { PropType } from 'vue'
const props = {
color: {

View File

@ -1,8 +1,7 @@
import type { ExtractPublicPropTypes } from 'vue'
import RIframe from './src/Iframe'
import iframeProps from './src/props'
import type * as RIframeType from './src/types'
import type { ExtractPublicPropTypes } from 'vue'
export type IframeProps = ExtractPublicPropTypes<typeof iframeProps>
export type { RIframeType }

View File

@ -1,11 +1,9 @@
import './index.scss'
import { NSpin } from 'naive-ui'
import { call, completeSize } from '@/utils'
import props from './props'
import { useEventListener } from '@vueuse/core'
import { NSpin } from 'naive-ui'
import { useTemplateRef } from 'vue'
import props from './props'
export default defineComponent({
name: 'RIframe',

View File

@ -1,6 +1,6 @@
import type { PropType } from 'vue'
import type { MaybeArray } from '@/types'
import type { SpinProps } from 'naive-ui'
import type { PropType } from 'vue'
import type { Lazy } from './types'
const props = {

View File

@ -1,10 +1,9 @@
import type { ExtractPublicPropTypes } from 'vue'
import useModal from './src/hooks/useModal'
import type { UseModalReturn } from './src/hooks/useModal'
import RModal from './src/Modal'
import modalProps from './src/props'
import useModal from './src/hooks/useModal'
import type * as RModalType from './src/types'
import type { ExtractPublicPropTypes } from 'vue'
import type { UseModalReturn } from './src/hooks/useModal'
export type ModalProps = ExtractPublicPropTypes<typeof modalProps>
export type { RModalType, UseModalReturn }

View File

@ -1,16 +1,13 @@
import './index.scss'
import { NModal } from 'naive-ui'
import props from './props'
import { completeSize, uuid } from '@/utils'
import { NModal } from 'naive-ui'
import type { ModalProps } from 'naive-ui'
import {
CSS_VARS_KEYS,
FULLSCREEN_CARD_TYPE_CLASS,
R_MODAL_CLASS,
CSS_VARS_KEYS,
} from './constant'
import type { ModalProps } from 'naive-ui'
import props from './props'
export default defineComponent({
name: 'RModal',

View File

@ -1,7 +1,6 @@
import { useModal as useNaiveModal, NScrollbar } from 'naive-ui'
import { queryElements, setStyle, completeSize, setClass } from '@/utils'
import { R_MODAL_CLASS, CSS_VARS_KEYS } from '../constant'
import { completeSize, queryElements, setClass, setStyle } from '@/utils'
import { NScrollbar, useModal as useNaiveModal } from 'naive-ui'
import { CSS_VARS_KEYS, R_MODAL_CLASS } from '../constant'
import type { RModalProps } from '../types'
/**

View File

@ -1,8 +1,7 @@
import type { ExtractPublicPropTypes } from 'vue'
import RMoreDropdown from './src/MoreDropdown'
import moreDropdownProps from './src/props'
import type { ExtractPublicPropTypes } from 'vue'
export type MoreDropdownProps = ExtractPublicPropTypes<typeof moreDropdownProps>
export { RMoreDropdown, moreDropdownProps }

View File

@ -1,10 +1,8 @@
import { NDropdown } from 'naive-ui'
import { RIcon } from '@/components'
import props from './props'
import { renderNode } from '@/utils'
import { NDropdown } from 'naive-ui'
import type { DropdownProps } from 'naive-ui'
import props from './props'
export default defineComponent({
name: 'RMoreDropdown',

View File

@ -1,7 +1,6 @@
import RSegment from './src/Segment'
import segmentProps from './src/props'
import type { ExtractPublicPropTypes } from 'vue'
import segmentProps from './src/props'
import RSegment from './src/Segment'
import type { RSegmentOptions } from './src/types'
export type SegmentProps = ExtractPublicPropTypes<typeof segmentProps>

View File

@ -1,12 +1,9 @@
import './index.scss'
import { NTabs, NTab, NPopover, NFlex } from 'naive-ui'
import props from './props'
import { themeOverrides } from './constant'
import { completeSize, isValueType, renderNode } from '@/utils'
import { NFlex, NPopover, NTab, NTabs } from 'naive-ui'
import type { TabsProps } from 'naive-ui'
import { themeOverrides } from './constant'
import props from './props'
import type { RSegmentOptions } from './types'
const iconSegmentTab = (option: RSegmentOptions) => {

View File

@ -1,9 +1,8 @@
import { tabsProps } from 'naive-ui'
import { omit } from 'lodash-es'
import { OMIT_TABS_PROPS_KEYS } from './constant'
import type { RSegmentOptions, RSegmentWidth } from './types'
import { tabsProps } from 'naive-ui'
import type { PropType } from 'vue'
import { OMIT_TABS_PROPS_KEYS } from './constant'
import type { RSegmentOptions, RSegmentWidth } from './types'
/**
*

View File

@ -1,6 +1,6 @@
import type { TabsProps, TabPaneProps, PopoverProps } from 'naive-ui'
import type { PopoverProps, TabPaneProps, TabsProps } from 'naive-ui'
import type { ExtractPublicPropTypes, VNode, VNodeChild } from 'vue'
import type { OMIT_TABS_PROPS_KEYS } from './constant'
import type { VNode, VNodeChild, ExtractPublicPropTypes } from 'vue'
export type OmitTabsPropsKeys = (typeof OMIT_TABS_PROPS_KEYS)[number]

View File

@ -1,12 +1,11 @@
import RTable from './src/Table'
import tableProps from './src/props'
import useTable from './src/hooks/useTable'
import useCheckedRowKeys from './src/hooks/useCheckedRowKeys'
import type * as RTableType from './src/types'
import type { UseTableReturn } from './src/hooks/useTable'
import type { UseCheckedRowKeysReturn } from './src/hooks/useCheckedRowKeys'
import type { ExtractPublicPropTypes } from 'vue'
import useCheckedRowKeys from './src/hooks/useCheckedRowKeys'
import type { UseCheckedRowKeysReturn } from './src/hooks/useCheckedRowKeys'
import useTable from './src/hooks/useTable'
import type { UseTableReturn } from './src/hooks/useTable'
import tableProps from './src/props'
import RTable from './src/Table'
import type * as RTableType from './src/types'
export type TableProps = ExtractPublicPropTypes<typeof tableProps>
export type { RTableType, UseTableReturn, UseCheckedRowKeysReturn }

View File

@ -1,20 +1,17 @@
import './index.scss'
import type { ComponentSize } from '@/types'
import { call, completeSize, renderNode, uuid } from '@/utils'
import { pick } from 'lodash-es'
import { NCard, NDataTable, NDropdown, NFlex } from 'naive-ui'
import Size from './components/Size'
import Fullscreen from './components/Fullscreen'
import type { DataTableProps, DropdownOption } from 'naive-ui'
import { useTemplateRef } from 'vue'
import C from './components/C'
import Fullscreen from './components/Fullscreen'
import Print from './components/Print'
import TablePropsSelect from './components/Props'
import Size from './components/Size'
import props from './props'
import { call, renderNode, uuid, completeSize } from '@/utils'
import { config } from './shared'
import { pick } from 'lodash-es'
import { useTemplateRef } from 'vue'
import type { DropdownOption, DataTableProps } from 'naive-ui'
import type { ComponentSize } from '@/types'
import type {
C as CType,
PropsComponentPopselectKeys,

View File

@ -7,18 +7,15 @@
* 2.
*/
import { NPopover, NFlex, NTree } from 'naive-ui'
import { RIcon } from '@/components'
import { config } from '../shared'
import props from '../props'
import type { AnyFn, MaybeArray } from '@/types'
import { call } from '@/utils'
import { cloneDeep, isEmpty } from 'lodash-es'
import type { TreeOption, TreeDropInfo } from 'naive-ui'
import { NFlex, NPopover, NTree } from 'naive-ui'
import type { TreeDropInfo, TreeOption } from 'naive-ui'
import props from '../props'
import { config } from '../shared'
import type { C } from '../types'
import type { AnyFC } from '@/types'
import type { MaybeArray } from '@/types'
type FixedClick = (type: 'left' | 'right', option: C, index: number) => void
@ -34,7 +31,7 @@ const RowIconRender = ({
}: {
icon: string
title: string
onClick?: AnyFC
onClick?: AnyFn
customClassName?: string
}) => {
return (

View File

@ -1,8 +1,6 @@
import { RIcon } from '@/components'
import { config } from '../shared'
import { useFullscreen } from 'vue-hooks-plus'
import { config } from '../shared'
import type { TableProvider } from '../types'
export default defineComponent({

View File

@ -1,9 +1,7 @@
import { RIcon } from '@/components'
import { config } from '../shared'
import props from '../props'
import { printDom } from '@/utils/dom'
import props from '../props'
import { config } from '../shared'
import type { TableProvider } from '../types'
export default defineComponent({

View File

@ -1,11 +1,9 @@
import { NPopselect } from 'naive-ui'
import { RIcon } from '@/components'
import { call } from '@/utils'
import { config, propsOptions } from '../shared'
import props from '../props'
import type { MaybeArray } from '@/types'
import { call } from '@/utils'
import { NPopselect } from 'naive-ui'
import props from '../props'
import { config, propsOptions } from '../shared'
import type { PropsComponentPopselectKeys } from '../types'
export default defineComponent({

View File

@ -1,13 +1,10 @@
import { NPopselect } from 'naive-ui'
import { RIcon } from '@/components'
import type { ComponentSize, MaybeArray } from '@/types'
import { call } from '@/utils'
import { NPopselect } from 'naive-ui'
import props from '../props'
import { config } from '../shared'
import type { ComponentSize } from '@/types'
import type { MaybeArray } from '@/types'
export default defineComponent({
name: 'TableSizeSelect',
props: {

View File

@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { effectDispose } from '@/utils'
import type { Recordable } from '@/types'
import { effectDispose } from '@/utils'
import type { MaybeRef } from '@vueuse/core'
import type { DataTableColumns, DataTableSelectionColumn } from 'naive-ui'

View File

@ -1,16 +1,15 @@
import { printDom } from '@/utils'
import type { PrintDomOptions } from '@/utils'
import type {
RTableInst,
ColumnKey,
CsvOptionsType,
FilterState,
RTableInst,
ScrollToOptions,
ColumnKey,
SortOrder,
UseTableRegister,
TableProvider,
UseTableRegister,
} from '../types'
import type { PrintDomOptions } from '@/utils'
/**
*

View File

@ -1,16 +1,14 @@
import type { MaybeArray, Recordable } from '@/types'
import { dataTableProps } from 'naive-ui'
import type { DataTableColumn, DropdownOption } from 'naive-ui'
import type { PropType, VNode } from 'vue'
import type { MaybeArray } from '@/types'
import type { DropdownOption, DataTableColumn } from 'naive-ui'
import type {
DownloadCsvTableOptions,
PrintTableOptions,
RTableInst,
RTableCardProps,
RTableInst,
UseTableRegister,
} from './types'
import type { Recordable } from '@/types'
const props = {
...dataTableProps,

View File

@ -1,16 +1,16 @@
import type {
DropdownOption,
DropdownGroupOption,
DropdownDividerOption,
DropdownRenderOption,
DataTableInst,
DataTableColumn,
DataTableBaseColumn,
CardProps,
} from 'naive-ui'
import type { VNode, CSSProperties, ShallowRef } from 'vue'
import type { Recordable } from '@/types'
import type { PrintDomOptions } from '@/utils/dom'
import type {
CardProps,
DataTableBaseColumn,
DataTableColumn,
DataTableInst,
DropdownDividerOption,
DropdownGroupOption,
DropdownOption,
DropdownRenderOption,
} from 'naive-ui'
import type { CSSProperties, ShallowRef, VNode } from 'vue'
export interface RTableCardProps extends CardProps {
style?: CSSProperties

View File

@ -1,8 +1,7 @@
import RTransitionComponent from './src/TransitionComponent.vue'
import transitionComponentProps from './src/props'
import type * as RTransitionComponentType from './src/types'
import type { ExtractPublicPropTypes } from 'vue'
import transitionComponentProps from './src/props'
import RTransitionComponent from './src/TransitionComponent.vue'
import type * as RTransitionComponentType from './src/types'
export type TransitionComponentProps = ExtractPublicPropTypes<
typeof transitionComponentProps

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