@ithinkdt/ui 4.0.0-10 → 4.0.0-100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components-BdbuJNhZ.js +1650 -0
- package/dist/components.js +5 -0
- package/dist/directives-DUuJW647.js +183 -0
- package/dist/directives.js +3 -0
- package/{src → dist}/index.js +698 -835
- package/dist/page.js +519 -0
- package/dist/use-i18n-Dx7V4KrY.js +6 -0
- package/dist/use-style-DcT-1dj4.js +29 -0
- package/dist/use-style.js +2 -0
- package/{src → esm}/components.d.ts +16 -3
- package/esm/components.js +1 -0
- package/{src → esm}/design.d.ts +9 -0
- package/esm/directives.js +1 -0
- package/esm/index.js +1 -0
- package/{src → esm}/page.d.ts +43 -26
- package/esm/page.js +1 -0
- package/esm/use-style.js +1 -0
- package/locale.d.ts +4 -0
- package/package.json +27 -27
- package/unocss.d.ts +0 -5
- package/unocss.js +0 -95
- /package/{src → esm}/directives.d.ts +0 -0
- /package/{src → esm}/index.d.ts +0 -0
- /package/{src → esm}/use-style.d.ts +0 -0
package/{src → esm}/page.d.ts
RENAMED
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CheckboxProps,
|
|
2
|
+
CheckboxProps,
|
|
3
|
+
DatePickerProps, DatePickerSlots,
|
|
3
4
|
DrawerContentProps, DrawerProps,
|
|
4
5
|
InputNumberProps, InputNumberSlots, InputProps, InputSlots,
|
|
5
6
|
ModalOptions,
|
|
6
7
|
SelectGroupOption, SelectOption, SelectProps, SelectSlots,
|
|
7
|
-
UploadFileInfo,
|
|
8
|
+
UploadFileInfo, UploadProps,
|
|
8
9
|
} from 'ithinkdt-ui'
|
|
9
|
-
import { MaybeRef, VNode
|
|
10
|
+
import { MaybeRef, VNode } from 'vue'
|
|
10
11
|
|
|
12
|
+
import { PublicProps } from '@ithinkdt/common'
|
|
11
13
|
import { DictItem, DictTypeKey } from '@ithinkdt/common/dict'
|
|
12
14
|
import { PageOptions } from '@ithinkdt/page'
|
|
13
15
|
|
|
14
16
|
import { CheckboxesProps, RadiosProps, UserDeptProps, UserGroupOption } from './components'
|
|
15
17
|
|
|
16
|
-
type
|
|
18
|
+
type ShallowMaybeRef<T extends {}> = {
|
|
17
19
|
[Key in (keyof T)]: MaybeRef<T[Key]>
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
declare module '@ithinkdt/page' {
|
|
21
23
|
interface FormComponentPresets {
|
|
22
24
|
input: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
inputProps?: ShallowMaybeRef<Omit<InputProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
|
|
26
|
+
inputSlots?: InputSlots
|
|
25
27
|
}
|
|
26
28
|
number: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
numberProps?: ShallowMaybeRef<Omit<InputNumberProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
|
|
30
|
+
numberSlots?: InputNumberSlots
|
|
29
31
|
}
|
|
30
32
|
select: {
|
|
31
|
-
|
|
33
|
+
selectProps?: ShallowMaybeRef<Omit<SelectProps, 'options' | 'value' | 'onUpdate:value' | 'disabled'> & PublicProps
|
|
32
34
|
& {
|
|
33
35
|
dictType?: DictTypeKey | undefined
|
|
34
36
|
options?: DictItem[] | (SelectOption | SelectGroupOption)[] | undefined
|
|
35
37
|
}>
|
|
36
|
-
|
|
38
|
+
selectSlots?: SelectSlots
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
checkbox: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
checkboxProps?: ShallowMaybeRef<Omit<CheckboxProps, 'checked' | 'onUpdate:checked' | 'disabled'>> & PublicProps
|
|
43
|
+
checkboxSlots?: {
|
|
42
44
|
default?: (() => VNode[]) | undefined
|
|
43
45
|
checked?: (() => VNode[]) | undefined
|
|
44
46
|
unchecked?: (() => VNode[]) | undefined
|
|
@@ -46,45 +48,59 @@ declare module '@ithinkdt/page' {
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
checkboxes: {
|
|
49
|
-
|
|
51
|
+
checkboxesProps?: ShallowMaybeRef<Omit<CheckboxesProps, 'disabled'> & PublicProps
|
|
50
52
|
& {
|
|
51
53
|
dictType?: DictTypeKey | undefined
|
|
52
54
|
options?: DictItem[] | undefined
|
|
53
55
|
}>
|
|
54
|
-
|
|
56
|
+
checkboxesSlots?: { }
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
radios: {
|
|
58
|
-
|
|
60
|
+
radiosProps?: ShallowMaybeRef<Omit<RadiosProps, 'disabled'> & PublicProps
|
|
59
61
|
& {
|
|
60
62
|
dictType?: DictTypeKey | undefined
|
|
61
63
|
options?: DictItem[] | undefined
|
|
62
64
|
}>
|
|
63
|
-
|
|
65
|
+
radiosSlots?: { }
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
datepicker: {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
datepickerProps?: ShallowMaybeRef<Omit<DatePickerProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
|
|
70
|
+
datepickerSlots?: DatePickerSlots
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
file: {
|
|
72
|
-
|
|
74
|
+
fileProps?: ShallowMaybeRef<{
|
|
73
75
|
type?: 'file' | 'image' | undefined
|
|
74
76
|
multiple?: boolean | undefined
|
|
75
77
|
max?: number | undefined
|
|
76
78
|
accept?: string | undefined
|
|
77
79
|
maxSize?: number | undefined
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
onBeforeUpload?: UploadProps['onBeforeUpload']
|
|
81
|
+
} & PublicProps>
|
|
82
|
+
fileSlots?: {
|
|
83
|
+
default?: (() => VNode[]) | undefined
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
upload: {
|
|
87
|
+
uploadProps?: ShallowMaybeRef<{
|
|
88
|
+
type?: 'file' | 'image' | undefined
|
|
89
|
+
multiple?: boolean | undefined
|
|
90
|
+
max?: number | undefined
|
|
91
|
+
accept?: string | undefined
|
|
92
|
+
maxSize?: number | undefined
|
|
93
|
+
onBeforeUpload?: UploadProps['onBeforeUpload']
|
|
94
|
+
} & PublicProps>
|
|
95
|
+
uploadSlots?: {
|
|
80
96
|
default?: (() => VNode[]) | undefined
|
|
81
97
|
}
|
|
82
98
|
}
|
|
83
99
|
|
|
84
100
|
user: {
|
|
85
|
-
|
|
86
|
-
| 'users' | 'groups' | 'depts' | 'getUsersByGroup' | 'getUsersByDept'>> &
|
|
87
|
-
|
|
101
|
+
userProps?: ShallowMaybeRef<Omit<UserDeptProps<boolean>, 'modelValue' | 'onUpdate:modelValue' | 'disabled'
|
|
102
|
+
| 'users' | 'groups' | 'depts' | 'getUsersByGroup' | 'getUsersByDept'>> & PublicProps
|
|
103
|
+
userSlots?: {}
|
|
88
104
|
}
|
|
89
105
|
}
|
|
90
106
|
|
|
@@ -128,9 +144,9 @@ declare module '@ithinkdt/page' {
|
|
|
128
144
|
}
|
|
129
145
|
|
|
130
146
|
type ModalOptionsKey = 'type' | keyof import('@ithinkdt/page').ModalOptions
|
|
131
|
-
interface ModalDrawerOptions extends
|
|
147
|
+
interface ModalDrawerOptions extends ShallowMaybeRef<Omit<DrawerContentProps, ModalOptionsKey>>, ShallowMaybeRef<Omit<DrawerProps, ModalOptionsKey>> { }
|
|
132
148
|
|
|
133
|
-
interface ModalDialogOptions extends
|
|
149
|
+
interface ModalDialogOptions extends ShallowMaybeRef<Omit<ModalOptions, ModalOptionsKey>> {}
|
|
134
150
|
}
|
|
135
151
|
|
|
136
152
|
export declare function createPageFormHelper(options?: {
|
|
@@ -142,6 +158,7 @@ export declare function createPageFormHelper(options?: {
|
|
|
142
158
|
uploadFile?: (file: File, options?: {
|
|
143
159
|
onProgress?: ((percent: number) => void) | undefined
|
|
144
160
|
}) => Promise<string>
|
|
161
|
+
getFileInfos?: (files: string[]) => Promise<UploadFileInfo[]>
|
|
145
162
|
}): PageOptions['getFormItemRenderer']
|
|
146
163
|
export declare function createPageTableHelper(options?: {
|
|
147
164
|
getUsersByUsername?: (usernames: string[]) => Promise<{ username: string, nickname: string }[]>
|
package/esm/page.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/page.js'
|
package/esm/use-style.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { c, cB, cE, cM, default, useClsPrefix } from '../dist/use-style.js'
|
package/locale.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface UILocale {
|
|
|
29
29
|
account: {
|
|
30
30
|
logout: string
|
|
31
31
|
changePwd: string
|
|
32
|
+
changeTenant: string
|
|
32
33
|
}
|
|
33
34
|
notification: {
|
|
34
35
|
tip: (params: { count?: number | null }) => string
|
|
@@ -61,6 +62,9 @@ export interface UILocale {
|
|
|
61
62
|
resetText: string
|
|
62
63
|
cancelText: string
|
|
63
64
|
selectFileText: string
|
|
65
|
+
validate: {
|
|
66
|
+
fileErrorMessage: string
|
|
67
|
+
}
|
|
64
68
|
}
|
|
65
69
|
filter: {
|
|
66
70
|
submitText: string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ithinkdt/ui",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-100",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "iThinkDT UI",
|
|
@@ -10,34 +10,35 @@
|
|
|
10
10
|
"ui"
|
|
11
11
|
],
|
|
12
12
|
"files": [
|
|
13
|
-
"
|
|
13
|
+
"dist",
|
|
14
|
+
"esm",
|
|
14
15
|
"auto-imports.*",
|
|
15
16
|
"locale.*",
|
|
16
17
|
"unocss.*"
|
|
17
18
|
],
|
|
18
|
-
"main": "./
|
|
19
|
-
"module": "./
|
|
20
|
-
"types": "./
|
|
19
|
+
"main": "./esm/index.js",
|
|
20
|
+
"module": "./esm/index.js",
|
|
21
|
+
"types": "./esm/index.d.ts",
|
|
21
22
|
"exports": {
|
|
22
23
|
".": {
|
|
23
|
-
"types": "./
|
|
24
|
-
"default": "./
|
|
24
|
+
"types": "./esm/index.d.ts",
|
|
25
|
+
"default": "./esm/index.js"
|
|
25
26
|
},
|
|
26
27
|
"./directives": {
|
|
27
|
-
"types": "./
|
|
28
|
-
"default": "./
|
|
28
|
+
"types": "./esm/directives.d.ts",
|
|
29
|
+
"default": "./esm/directives.js"
|
|
29
30
|
},
|
|
30
31
|
"./components": {
|
|
31
|
-
"types": "./
|
|
32
|
-
"default": "./
|
|
32
|
+
"types": "./esm/components.d.ts",
|
|
33
|
+
"default": "./esm/components.js"
|
|
33
34
|
},
|
|
34
35
|
"./use-style": {
|
|
35
|
-
"types": "./
|
|
36
|
-
"default": "./
|
|
36
|
+
"types": "./esm/use-style.d.ts",
|
|
37
|
+
"default": "./esm/use-style.js"
|
|
37
38
|
},
|
|
38
39
|
"./page": {
|
|
39
|
-
"types": "./
|
|
40
|
-
"default": "./
|
|
40
|
+
"types": "./esm/page.d.ts",
|
|
41
|
+
"default": "./esm/page.js"
|
|
41
42
|
},
|
|
42
43
|
"./package.json": {
|
|
43
44
|
"default": "./package.json"
|
|
@@ -57,13 +58,13 @@
|
|
|
57
58
|
},
|
|
58
59
|
"sideEffects": false,
|
|
59
60
|
"dependencies": {
|
|
60
|
-
"@vueuse/core": "^
|
|
61
|
+
"@vueuse/core": "^14.0.0",
|
|
61
62
|
"date-fns": "^4.1.0",
|
|
62
63
|
"vueuc": "^0.4.65",
|
|
63
64
|
"sortablejs": "^1.15.6",
|
|
64
|
-
"@types/sortablejs": "^1.15.
|
|
65
|
+
"@types/sortablejs": "^1.15.9",
|
|
65
66
|
"nanoid": "^5.1.6",
|
|
66
|
-
"@ithinkdt/common": "^4.0.0-
|
|
67
|
+
"@ithinkdt/common": "^4.0.0-100"
|
|
67
68
|
},
|
|
68
69
|
"peerDependencies": {
|
|
69
70
|
"@ithinkdt/page": ">=4.0",
|
|
@@ -82,18 +83,17 @@
|
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
85
|
"@vitejs/plugin-vue-jsx": "^5.1.1",
|
|
85
|
-
"ithinkdt-ui": "^1.
|
|
86
|
+
"ithinkdt-ui": "^1.8.0",
|
|
86
87
|
"typescript": "~5.9.3",
|
|
87
|
-
"unocss": ">=66.5.
|
|
88
|
-
"vite": "npm:rolldown-vite@^7.1.
|
|
88
|
+
"unocss": ">=66.5.4",
|
|
89
|
+
"vite": "npm:rolldown-vite@^7.1.20",
|
|
89
90
|
"vue": "^3.5.22",
|
|
90
|
-
"vue-router": "^4.
|
|
91
|
-
"@ithinkdt/page": "^4.0.0-
|
|
91
|
+
"vue-router": "^4.6.3",
|
|
92
|
+
"@ithinkdt/page": "^4.0.0-100"
|
|
92
93
|
},
|
|
93
94
|
"scripts": {
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"release": "pnpm publish --no-git-checks"
|
|
97
|
-
"postrelease": "rm -rf ./src && cp -r ./_src ./src && rm -rf ./_src"
|
|
95
|
+
"dev": "vite build --watch",
|
|
96
|
+
"build": "vite build",
|
|
97
|
+
"release": "pnpm run build && pnpm publish --no-git-checks"
|
|
98
98
|
}
|
|
99
99
|
}
|
package/unocss.d.ts
DELETED
package/unocss.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
const ithinkdt = () => {
|
|
2
|
-
return {
|
|
3
|
-
name: 'preset-ithinkdt',
|
|
4
|
-
theme: {
|
|
5
|
-
colors: {
|
|
6
|
-
...Object.fromEntries(
|
|
7
|
-
['primary', 'success', 'warning', 'danger'].map(name => [
|
|
8
|
-
name,
|
|
9
|
-
{
|
|
10
|
-
DEFAULT: `rgb(var(--color-${name}-rgb) / <alpha-value>)`,
|
|
11
|
-
...Object.fromEntries(
|
|
12
|
-
['hover', 'active'].map(level => [
|
|
13
|
-
level,
|
|
14
|
-
`rgb(var(--color-${name}-${level}-rgb) / <alpha-value>)`,
|
|
15
|
-
]),
|
|
16
|
-
),
|
|
17
|
-
},
|
|
18
|
-
]),
|
|
19
|
-
),
|
|
20
|
-
text: {
|
|
21
|
-
DEFAULT: `rgb(var(--color-text-rgb))`,
|
|
22
|
-
},
|
|
23
|
-
base: {
|
|
24
|
-
DEFAULT: `rgb(var(--color-base-rgb))`,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
borderRadius: Object.fromEntries(
|
|
28
|
-
['tiny', 'small', 'medium', 'large'].map(size => [size, `var(--rounded-${size})`]),
|
|
29
|
-
),
|
|
30
|
-
},
|
|
31
|
-
variants: [
|
|
32
|
-
// stuck:
|
|
33
|
-
(matcher) => {
|
|
34
|
-
const array = ['top', 'right', 'bottom', 'left']
|
|
35
|
-
const index = array.findIndex(it => matcher.startsWith(`stuck-${it}:`))
|
|
36
|
-
if (index === -1)
|
|
37
|
-
return matcher
|
|
38
|
-
return {
|
|
39
|
-
matcher: matcher.slice(7 + array[index].length),
|
|
40
|
-
handle: (input, next) => next({
|
|
41
|
-
...input,
|
|
42
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ''} @container scroll-state(stuck: ${array[index]})`,
|
|
43
|
-
}),
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
rules: [
|
|
48
|
-
['scroll-state', { 'container-type': 'scroll-state' }],
|
|
49
|
-
[
|
|
50
|
-
/^bg-img-(.*)$/,
|
|
51
|
-
([_, r]) => {
|
|
52
|
-
return {
|
|
53
|
-
'background-image': r[0] === '[' && r.at(-1) === ']' ? r.slice(1, -1) : r,
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
[
|
|
58
|
-
/^mask-(.*)$/,
|
|
59
|
-
([_, r]) => {
|
|
60
|
-
const mask = `var(--un-icon) no-repeat`
|
|
61
|
-
return {
|
|
62
|
-
'--un-icon': r[0] === '[' && r.at(-1) === ']' ? r.slice(1, -1) : r,
|
|
63
|
-
mask,
|
|
64
|
-
'mask-size': '100% 100%',
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
],
|
|
69
|
-
shortcuts: [
|
|
70
|
-
[
|
|
71
|
-
/^card-(.*)$/,
|
|
72
|
-
([_, size]) => {
|
|
73
|
-
const i = ['none', 'small', 'medium', 'large'].indexOf(size)
|
|
74
|
-
if (i === -1) return
|
|
75
|
-
const p = [0, 2, 4, 5][i]
|
|
76
|
-
return `rounded-${size} px-${p + 1} py-${p} bg-white dark:bg-dark ease-in-out transition-shadow
|
|
77
|
-
hover:shadow-[0_1px_2px_0_rgba(0_0_0_/_0.03),0_1px_6px_-1px_rgba(0_0_0_/_0.02),0_2px_4px_0_rgba(0_0_0_/_0.02)]`
|
|
78
|
-
},
|
|
79
|
-
{ autocomplete: ['card-none', 'card-small', 'card-medium', 'card-large'] },
|
|
80
|
-
],
|
|
81
|
-
{
|
|
82
|
-
'ell': 'truncate',
|
|
83
|
-
'ell-2': 'line-clamp-2',
|
|
84
|
-
'ell-3': 'line-clamp-3',
|
|
85
|
-
'flex-x-center': 'flex items-center',
|
|
86
|
-
'flex-y-center': 'flex justify-center',
|
|
87
|
-
'flex-center': 'flex justify-center items-center',
|
|
88
|
-
'page': 'flex flex-col p-5 gap-4',
|
|
89
|
-
'card': `card-medium`,
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export default ithinkdt
|
|
File without changes
|
/package/{src → esm}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|