@otwb/ui 2.0.15 → 2.0.16

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/esm/page.d.ts CHANGED
@@ -1,170 +1,170 @@
1
- import {
2
- CheckboxProps,
3
- DatePickerProps, DatePickerSlots,
4
- DrawerContentProps, DrawerProps,
5
- InputNumberProps, InputNumberSlots, InputProps, InputSlots,
6
- ModalOptions,
7
- SelectGroupOption, SelectOption, SelectProps, SelectSlots,
8
- UploadFileInfo, UploadProps,
9
- } from 'ithinkdt-ui'
10
- import { MaybeRef, VNode } from 'vue'
11
-
12
- import { PublicProps } from '@otwb/common'
13
- import { DictItem, DictTypeKey } from '@otwb/common/dict'
14
- import { PageOptions } from '@otwb/page'
15
-
16
- import { CheckboxesProps, RadiosProps, UserDeptProps, UserGroupOption } from './components'
17
-
18
- type ShallowMaybeRef<T extends {}> = {
19
- [Key in (keyof T)]: MaybeRef<T[Key]>
20
- }
21
-
22
- declare module '@otwb/page' {
23
- interface FormComponentPresets {
24
- input: {
25
- inputProps?: ShallowMaybeRef<Omit<InputProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
26
- inputSlots?: InputSlots
27
- }
28
- number: {
29
- numberProps?: ShallowMaybeRef<Omit<InputNumberProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
30
- numberSlots?: InputNumberSlots
31
- }
32
- select: {
33
- selectProps?: ShallowMaybeRef<Omit<SelectProps, 'options' | 'value' | 'onUpdate:value' | 'disabled'> & PublicProps
34
- & {
35
- dictType?: DictTypeKey | undefined
36
- options?: DictItem[] | (SelectOption | SelectGroupOption)[] | undefined
37
- }>
38
- selectSlots?: SelectSlots
39
- }
40
-
41
- checkbox: {
42
- checkboxProps?: ShallowMaybeRef<Omit<CheckboxProps, 'checked' | 'onUpdate:checked' | 'disabled'>> & PublicProps
43
- checkboxSlots?: {
44
- default?: (() => VNode[]) | undefined
45
- checked?: (() => VNode[]) | undefined
46
- unchecked?: (() => VNode[]) | undefined
47
- }
48
- }
49
-
50
- checkboxes: {
51
- checkboxesProps?: ShallowMaybeRef<Omit<CheckboxesProps, 'disabled'> & PublicProps
52
- & {
53
- dictType?: DictTypeKey | undefined
54
- options?: DictItem[] | undefined
55
- }>
56
- checkboxesSlots?: { }
57
- }
58
-
59
- radios: {
60
- radiosProps?: ShallowMaybeRef<Omit<RadiosProps, 'disabled'> & PublicProps
61
- & {
62
- dictType?: DictTypeKey | undefined
63
- options?: DictItem[] | undefined
64
- }>
65
- radiosSlots?: { }
66
- }
67
-
68
- datepicker: {
69
- datepickerProps?: ShallowMaybeRef<Omit<DatePickerProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
70
- datepickerSlots?: DatePickerSlots
71
- }
72
-
73
- file: {
74
- fileProps?: ShallowMaybeRef<{
75
- type?: 'file' | 'image' | undefined
76
- multiple?: boolean | undefined
77
- max?: number | undefined
78
- accept?: string | undefined
79
- maxSize?: number | undefined
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?: {
96
- default?: (() => VNode[]) | undefined
97
- }
98
- }
99
-
100
- user: {
101
- userProps?: ShallowMaybeRef<Omit<UserDeptProps<boolean>, 'modelValue' | 'onUpdate:modelValue' | 'disabled'
102
- | 'users' | 'groups' | 'depts' | 'getUsersByGroup' | 'getUsersByDept'>> & PublicProps
103
- userSlots?: {}
104
- }
105
- }
106
-
107
- interface TableTypePresets {
108
- number: {
109
- /** 保留 n 位小数(保留 0) */
110
- fixed?: number | undefined
111
- /** 保留 n 位小数(不保留 0) */
112
- round?: number | undefined
113
- /** 保留 n 位数(不保留 0) */
114
- precision?: number | undefined
115
- /** 使用数字分隔符 */
116
- separator?: boolean | undefined
117
- /** 是否为百分数 */
118
- percent?: boolean | undefined
119
- }
120
-
121
- date: {
122
- formatter?: 'yyyy-MM-dd' | 'yyyy/MM/dd' | string & {} | undefined
123
- }
124
-
125
- datetime: {
126
- formatter?: 'yyyy-MM-dd HH:mm' | 'yyyy-MM-dd HH:mm:ss' | string & {} | undefined
127
- }
128
-
129
- dict: {
130
- dictType?: DictTypeKey | undefined
131
- options?: DictItem[] | (SelectOption | SelectGroupOption)[] | undefined
132
- multiple?: boolean | undefined
133
- labelField?: string | undefined
134
- valueField?: string | undefined
135
- statusMap?: Record<string, 'primary' | 'success' | 'warning' | 'danger' | string & {} | undefined> | undefined
136
- }
137
- email: {}
138
- url: {}
139
- color: {}
140
- file: { multiple?: boolean | undefined }
141
- image: { multiple?: boolean | undefined }
142
- user: { multiple?: boolean | undefined }
143
- dept: { multiple?: boolean | undefined }
144
- }
145
-
146
- type ModalOptionsKey = 'type' | keyof import('@otwb/page').ModalOptions
147
- interface ModalDrawerOptions extends ShallowMaybeRef<Omit<DrawerContentProps, ModalOptionsKey>>, ShallowMaybeRef<Omit<DrawerProps, ModalOptionsKey>> { }
148
-
149
- interface ModalDialogOptions extends ShallowMaybeRef<Omit<ModalOptions, ModalOptionsKey>> {}
150
- }
151
-
152
- export declare function createPageFormHelper(options?: {
153
- getUserGroups?: (() => Promise<UserGroupOption[]>) | undefined
154
- getUsersByGroup?: ((code: string) => Promise<{ username: string, nickname: string }[]>) | undefined
155
- getUsersByDept?: ((code: string) => Promise<{ username: string, nickname: string }[]>) | undefined
156
- getUsersByUsername?: ((usernames: string[]) => Promise<{ username: string, nickname: string }[]>) | undefined
157
- getDeptsByCode?: (codes: string[]) => Promise<{ code: string, name: string }[]>
158
- uploadFile?: (file: File, options?: {
159
- onProgress?: ((percent: number) => void) | undefined
160
- }) => Promise<string>
161
- getFileInfos?: (files: string[]) => Promise<UploadFileInfo[]>
162
- }): PageOptions['getFormItemRenderer']
163
- export declare function createPageTableHelper(options?: {
164
- getUsersByUsername?: (usernames: string[]) => Promise<{ username: string, nickname: string }[]>
165
- getDeptsByCode?: (codes: string[]) => Promise<{ code: string, name: string }[]>
166
- getFileInfos?: (fileIds: string[]) => Promise<UploadFileInfo[]>
167
- previewFileUrl?: (fileId: string) => string
168
- }): PageOptions['getCellRenderer']
169
- export declare function createFormHelper(options?: { }): PageOptions['getFormRenderer']
170
- export declare function createModalHelper(options?: { }): PageOptions['getModalRenderer']
1
+ import {
2
+ CheckboxProps,
3
+ DatePickerProps, DatePickerSlots,
4
+ DrawerContentProps, DrawerProps,
5
+ InputNumberProps, InputNumberSlots, InputProps, InputSlots,
6
+ ModalOptions,
7
+ SelectGroupOption, SelectOption, SelectProps, SelectSlots,
8
+ UploadFileInfo, UploadProps,
9
+ } from 'ithinkdt-ui'
10
+ import { MaybeRef, VNode } from 'vue'
11
+
12
+ import { PublicProps } from '@otwb/common'
13
+ import { DictItem, DictTypeKey } from '@otwb/common/dict'
14
+ import { PageOptions } from '@otwb/page'
15
+
16
+ import { CheckboxesProps, RadiosProps, UserDeptProps, UserGroupOption } from './components'
17
+
18
+ type ShallowMaybeRef<T extends {}> = {
19
+ [Key in (keyof T)]: MaybeRef<T[Key]>
20
+ }
21
+
22
+ declare module '@otwb/page' {
23
+ interface FormComponentPresets {
24
+ input: {
25
+ inputProps?: ShallowMaybeRef<Omit<InputProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
26
+ inputSlots?: InputSlots
27
+ }
28
+ number: {
29
+ numberProps?: ShallowMaybeRef<Omit<InputNumberProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
30
+ numberSlots?: InputNumberSlots
31
+ }
32
+ select: {
33
+ selectProps?: ShallowMaybeRef<Omit<SelectProps, 'options' | 'value' | 'onUpdate:value' | 'disabled'> & PublicProps
34
+ & {
35
+ dictType?: DictTypeKey | undefined
36
+ options?: DictItem[] | (SelectOption | SelectGroupOption)[] | undefined
37
+ }>
38
+ selectSlots?: SelectSlots
39
+ }
40
+
41
+ checkbox: {
42
+ checkboxProps?: ShallowMaybeRef<Omit<CheckboxProps, 'checked' | 'onUpdate:checked' | 'disabled'>> & PublicProps
43
+ checkboxSlots?: {
44
+ default?: (() => VNode[]) | undefined
45
+ checked?: (() => VNode[]) | undefined
46
+ unchecked?: (() => VNode[]) | undefined
47
+ }
48
+ }
49
+
50
+ checkboxes: {
51
+ checkboxesProps?: ShallowMaybeRef<Omit<CheckboxesProps, 'disabled'> & PublicProps
52
+ & {
53
+ dictType?: DictTypeKey | undefined
54
+ options?: DictItem[] | undefined
55
+ }>
56
+ checkboxesSlots?: { }
57
+ }
58
+
59
+ radios: {
60
+ radiosProps?: ShallowMaybeRef<Omit<RadiosProps, 'disabled'> & PublicProps
61
+ & {
62
+ dictType?: DictTypeKey | undefined
63
+ options?: DictItem[] | undefined
64
+ }>
65
+ radiosSlots?: { }
66
+ }
67
+
68
+ datepicker: {
69
+ datepickerProps?: ShallowMaybeRef<Omit<DatePickerProps, 'value' | 'onUpdate:value' | 'disabled'>> & PublicProps
70
+ datepickerSlots?: DatePickerSlots
71
+ }
72
+
73
+ file: {
74
+ fileProps?: ShallowMaybeRef<{
75
+ type?: 'file' | 'image' | undefined
76
+ multiple?: boolean | undefined
77
+ max?: number | undefined
78
+ accept?: string | undefined
79
+ maxSize?: number | undefined
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?: {
96
+ default?: (() => VNode[]) | undefined
97
+ }
98
+ }
99
+
100
+ user: {
101
+ userProps?: ShallowMaybeRef<Omit<UserDeptProps<boolean>, 'modelValue' | 'onUpdate:modelValue' | 'disabled'
102
+ | 'users' | 'groups' | 'depts' | 'getUsersByGroup' | 'getUsersByDept'>> & PublicProps
103
+ userSlots?: {}
104
+ }
105
+ }
106
+
107
+ interface TableTypePresets {
108
+ number: {
109
+ /** 保留 n 位小数(保留 0) */
110
+ fixed?: number | undefined
111
+ /** 保留 n 位小数(不保留 0) */
112
+ round?: number | undefined
113
+ /** 保留 n 位数(不保留 0) */
114
+ precision?: number | undefined
115
+ /** 使用数字分隔符 */
116
+ separator?: boolean | undefined
117
+ /** 是否为百分数 */
118
+ percent?: boolean | undefined
119
+ }
120
+
121
+ date: {
122
+ formatter?: 'yyyy-MM-dd' | 'yyyy/MM/dd' | string & {} | undefined
123
+ }
124
+
125
+ datetime: {
126
+ formatter?: 'yyyy-MM-dd HH:mm' | 'yyyy-MM-dd HH:mm:ss' | string & {} | undefined
127
+ }
128
+
129
+ dict: {
130
+ dictType?: DictTypeKey | undefined
131
+ options?: DictItem[] | (SelectOption | SelectGroupOption)[] | undefined
132
+ multiple?: boolean | undefined
133
+ labelField?: string | undefined
134
+ valueField?: string | undefined
135
+ statusMap?: Record<string, 'primary' | 'success' | 'warning' | 'danger' | string & {} | undefined> | undefined
136
+ }
137
+ email: {}
138
+ url: {}
139
+ color: {}
140
+ file: { multiple?: boolean | undefined }
141
+ image: { multiple?: boolean | undefined }
142
+ user: { multiple?: boolean | undefined }
143
+ dept: { multiple?: boolean | undefined }
144
+ }
145
+
146
+ type ModalOptionsKey = 'type' | keyof import('@otwb/page').ModalOptions
147
+ interface ModalDrawerOptions extends ShallowMaybeRef<Omit<DrawerContentProps, ModalOptionsKey>>, ShallowMaybeRef<Omit<DrawerProps, ModalOptionsKey>> { }
148
+
149
+ interface ModalDialogOptions extends ShallowMaybeRef<Omit<ModalOptions, ModalOptionsKey>> {}
150
+ }
151
+
152
+ export declare function createPageFormHelper(options?: {
153
+ getUserGroups?: (() => Promise<UserGroupOption[]>) | undefined
154
+ getUsersByGroup?: ((code: string) => Promise<{ username: string, nickname: string }[]>) | undefined
155
+ getUsersByDept?: ((code: string) => Promise<{ username: string, nickname: string }[]>) | undefined
156
+ getUsersByUsername?: ((usernames: string[]) => Promise<{ username: string, nickname: string }[]>) | undefined
157
+ getDeptsByCode?: (codes: string[]) => Promise<{ code: string, name: string }[]>
158
+ uploadFile?: (file: File, options?: {
159
+ onProgress?: ((percent: number) => void) | undefined
160
+ }) => Promise<string>
161
+ getFileInfos?: (files: string[]) => Promise<UploadFileInfo[]>
162
+ }): PageOptions['getFormItemRenderer']
163
+ export declare function createPageTableHelper(options?: {
164
+ getUsersByUsername?: (usernames: string[]) => Promise<{ username: string, nickname: string }[]>
165
+ getDeptsByCode?: (codes: string[]) => Promise<{ code: string, name: string }[]>
166
+ getFileInfos?: (fileIds: string[]) => Promise<UploadFileInfo[]>
167
+ previewFileUrl?: (fileId: string) => string
168
+ }): PageOptions['getCellRenderer']
169
+ export declare function createFormHelper(options?: { }): PageOptions['getFormRenderer']
170
+ export declare function createModalHelper(options?: { }): PageOptions['getModalRenderer']
package/esm/page.js CHANGED
@@ -1 +1 @@
1
- export * from '../dist/page.js'
1
+ export * from '../dist/page.js'
@@ -1,10 +1,10 @@
1
- import _useStyle from 'ithinkdt-ui/es/_mixins/use-style'
2
- import { Ref } from 'vue'
3
-
4
- export { c, cB, cE, cM } from 'ithinkdt-ui/es/_utils/cssr/index'
5
-
6
- export declare function useClsPrefix(): Ref<string>
7
-
8
- declare function useStyle(...params: Parameters<typeof _useStyle>): Ref<string>
9
-
10
- export default useStyle
1
+ import _useStyle from 'ithinkdt-ui/es/_mixins/use-style'
2
+ import { Ref } from 'vue'
3
+
4
+ export { c, cB, cE, cM } from 'ithinkdt-ui/es/_utils/cssr/index'
5
+
6
+ export declare function useClsPrefix(): Ref<string>
7
+
8
+ declare function useStyle(...params: Parameters<typeof _useStyle>): Ref<string>
9
+
10
+ export default useStyle
package/esm/use-style.js CHANGED
@@ -1 +1 @@
1
- export { c, cB, cE, cM, default, useClsPrefix } from '../dist/use-style.js'
1
+ export { c, cB, cE, cM, default, useClsPrefix } from '../dist/use-style.js'
package/locale.d.ts CHANGED
@@ -1,78 +1,78 @@
1
- export interface UILocale {
2
- all: string
3
- back: string
4
- layout: {
5
- sider: {
6
- collapse: string
7
- expand: string
8
- }
9
- screen: {
10
- full: string
11
- exitfull: string
12
- }
13
- mode: {
14
- auto: string
15
- light: string
16
- dark: string
17
- }
18
- tabs: {
19
- exitFullTab: string
20
- fullTab: string
21
- reloadTab: string
22
- openTabBlank: string
23
- closeAllTabs: string
24
- closeLeftTabs: string
25
- closeRightTabs: string
26
- closeOtherTabs: string
27
- }
28
- }
29
- account: {
30
- logout: string
31
- changePwd: string
32
- changeTenant: string
33
- }
34
- notification: {
35
- tip: (params: { count?: number | null }) => string
36
- title: string
37
- all: string
38
- unread: (params: { count: string }) => string
39
- markPageRead: string
40
- markRead: string
41
- markDelete: string
42
- time: string
43
- }
44
- timeago: (params: { time: string | number | Date }) => string
45
- page: {
46
- selection: {
47
- countText: (params: { count: number }) => string
48
- back: string
49
- view: string
50
- clear: string
51
- }
52
- pagination: {
53
- prefix: (params: { total: number }) => string
54
- suffix: string
55
- }
56
- custom: {
57
- tooltip: string
58
- reset: string
59
- }
60
- form: {
61
- submitText: string
62
- resetText: string
63
- cancelText: string
64
- selectFileText: string
65
- validate: {
66
- fileErrorMessage: string
67
- }
68
- }
69
- filter: {
70
- submitText: string
71
- expand: string
72
- collapse: string
73
- }
74
- }
75
- }
76
-
77
- declare const locale: UILocale
78
- export default locale
1
+ export interface UILocale {
2
+ all: string
3
+ back: string
4
+ layout: {
5
+ sider: {
6
+ collapse: string
7
+ expand: string
8
+ }
9
+ screen: {
10
+ full: string
11
+ exitfull: string
12
+ }
13
+ mode: {
14
+ auto: string
15
+ light: string
16
+ dark: string
17
+ }
18
+ tabs: {
19
+ exitFullTab: string
20
+ fullTab: string
21
+ reloadTab: string
22
+ openTabBlank: string
23
+ closeAllTabs: string
24
+ closeLeftTabs: string
25
+ closeRightTabs: string
26
+ closeOtherTabs: string
27
+ }
28
+ }
29
+ account: {
30
+ logout: string
31
+ changePwd: string
32
+ changeTenant: string
33
+ }
34
+ notification: {
35
+ tip: (params: { count?: number | null }) => string
36
+ title: string
37
+ all: string
38
+ unread: (params: { count: string }) => string
39
+ markPageRead: string
40
+ markRead: string
41
+ markDelete: string
42
+ time: string
43
+ }
44
+ timeago: (params: { time: string | number | Date }) => string
45
+ page: {
46
+ selection: {
47
+ countText: (params: { count: number }) => string
48
+ back: string
49
+ view: string
50
+ clear: string
51
+ }
52
+ pagination: {
53
+ prefix: (params: { total: number }) => string
54
+ suffix: string
55
+ }
56
+ custom: {
57
+ tooltip: string
58
+ reset: string
59
+ }
60
+ form: {
61
+ submitText: string
62
+ resetText: string
63
+ cancelText: string
64
+ selectFileText: string
65
+ validate: {
66
+ fileErrorMessage: string
67
+ }
68
+ }
69
+ filter: {
70
+ submitText: string
71
+ expand: string
72
+ collapse: string
73
+ }
74
+ }
75
+ }
76
+
77
+ declare const locale: UILocale
78
+ export default locale
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otwb/ui",
3
- "version": "2.0.15",
3
+ "version": "2.0.16",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "otwb UI",
@@ -58,20 +58,21 @@
58
58
  },
59
59
  "sideEffects": false,
60
60
  "dependencies": {
61
+ "@types/sortablejs": "^1.15.9",
62
+ "@vicons/antd": "^0.13.0",
61
63
  "@vueuse/core": "^14.0.0",
62
64
  "date-fns": "^4.1.0",
63
- "vueuc": "^0.4.65",
64
- "sortablejs": "^1.15.6",
65
- "@types/sortablejs": "^1.15.9",
66
65
  "nanoid": "^5.1.6",
66
+ "sortablejs": "^1.15.6",
67
+ "vueuc": "^0.4.65",
67
68
  "@otwb/common": "^2.0.7"
68
69
  },
69
70
  "peerDependencies": {
70
71
  "@otwb/page": ">=4.0",
71
- "vue": ">=3.5",
72
- "vue-router": ">=4.5",
73
72
  "ithinkdt-ui": ">=1.5",
74
- "unocss": ">=66"
73
+ "unocss": ">=66",
74
+ "vue": ">=3.5",
75
+ "vue-router": ">=4.5"
75
76
  },
76
77
  "peerDependenciesMeta": {
77
78
  "@otwb/page": {
@@ -1,5 +1,5 @@
1
- import { PresetFactory, PresetUnoTheme } from 'unocss'
2
-
3
- declare const ithinkdt: PresetFactory<PresetUnoTheme, {}>
4
-
5
- export default ithinkdt
1
+ import { PresetFactory, PresetUnoTheme } from 'unocss'
2
+
3
+ declare const ithinkdt: PresetFactory<PresetUnoTheme, {}>
4
+
5
+ export default ithinkdt