@ithinkdt/ui 4.0.0-5 → 4.0.0-9

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/auto-imports.d.ts CHANGED
@@ -1,10 +1,15 @@
1
- export declare const UI: {
2
- from: string
3
- imports: (string | { name: string; type: boolean })[]
1
+ export declare const UIDirectives: {
2
+ type: 'directive'
3
+ resolve: (name: string) => string | undefined
4
4
  }[]
5
- export default UI
6
5
 
7
- export declare const UIDirectives: {
8
- type: 'component' | 'directive'
6
+ export declare const UIComponents: {
7
+ type: 'component'
9
8
  resolve: (name: string) => string | undefined
10
9
  }[]
10
+
11
+ export declare const UI: {
12
+ from: string
13
+ imports: (string | { name: string, type: boolean })[]
14
+ }[]
15
+ export default UI
package/auto-imports.js CHANGED
@@ -1,19 +1,34 @@
1
- export const UI = [
1
+ export const UIDirectives = [
2
2
  {
3
- from: '@ithinkdt/ui',
4
- imports: ['vSpin', 'vTooltip'],
3
+ type: 'directive',
4
+ resolve(name) {
5
+ return ['Spin', 'Tooltip'].includes(name)
6
+ ? { name: `v${name}`, from: '@ithinkdt/ui/directives' }
7
+ : undefined
8
+ },
5
9
  },
6
10
  ]
7
11
 
8
- export default UI
9
-
10
- export const UIDirectives = [
12
+ export const UIComponents = [
11
13
  {
12
- type: 'directive',
14
+ type: 'component',
13
15
  resolve(name) {
14
- return ['Spin', 'Tooltip'].includes(name)
15
- ? { name: `v${name}`, from: '@ithinkdt/ui' }
16
+ return ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'].includes(name)
17
+ ? { name, from: '@ithinkdt/ui/components' }
16
18
  : undefined
17
19
  },
18
20
  },
19
21
  ]
22
+
23
+ export const UI = [
24
+ {
25
+ from: '@ithinkdt/ui/directives',
26
+ imports: ['vSpin', 'vTooltip'],
27
+ },
28
+ {
29
+ from: '@ithinkdt/ui/components',
30
+ imports: ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'],
31
+ },
32
+ ]
33
+
34
+ export default UI
package/package.json CHANGED
@@ -1,13 +1,21 @@
1
1
  {
2
2
  "name": "@ithinkdt/ui",
3
- "version": "4.0.0-5",
3
+ "version": "4.0.0-9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "iThinkDT UI",
7
7
  "keywords": [
8
+ "ithinkdt",
8
9
  "vue",
9
- "ithinkdt"
10
+ "ui"
10
11
  ],
12
+ "files": [
13
+ "src",
14
+ "auto-imports.*",
15
+ "shims.*",
16
+ "unocss.*"
17
+ ],
18
+ "main": "./src/index.js",
11
19
  "module": "./src/index.js",
12
20
  "types": "./src/index.d.ts",
13
21
  "exports": {
@@ -15,6 +23,22 @@
15
23
  "types": "./src/index.d.ts",
16
24
  "default": "./src/index.js"
17
25
  },
26
+ "./directives": {
27
+ "types": "./src/directives.d.ts",
28
+ "default": "./src/directives/index.js"
29
+ },
30
+ "./components": {
31
+ "types": "./src/components.d.ts",
32
+ "default": "./src/components/index.js"
33
+ },
34
+ "./use-style": {
35
+ "types": "./src/use-style.d.ts",
36
+ "default": "./src/use-style.js"
37
+ },
38
+ "./page": {
39
+ "types": "./src/page.d.ts",
40
+ "default": "./src/page.jsx"
41
+ },
18
42
  "./package.json": {
19
43
  "default": "./package.json"
20
44
  },
@@ -25,10 +49,6 @@
25
49
  "./unocss": {
26
50
  "types": "./unocss.d.ts",
27
51
  "default": "./unocss.js"
28
- },
29
- "./design": {
30
- "types": "./design/index.d.ts",
31
- "default": "./design/index.js"
32
52
  }
33
53
  },
34
54
  "publishConfig": {
@@ -37,25 +57,43 @@
37
57
  },
38
58
  "sideEffects": false,
39
59
  "dependencies": {
40
- "@unocss/preset-uno": ">=0.62.3",
41
- "@vueuse/core": "^11.0.3",
42
- "@ithinkdt/common": "^4.0.0-5"
60
+ "@vueuse/core": "^13.9.0",
61
+ "date-fns": "^4.1.0",
62
+ "vueuc": "^0.4.65",
63
+ "sortablejs": "^1.15.6",
64
+ "@types/sortablejs": "^1.15.8",
65
+ "nanoid": "^5.1.6",
66
+ "@ithinkdt/common": "^4.0.0-9"
43
67
  },
44
68
  "peerDependencies": {
45
- "@ithinkdt/core": ">=4.0",
46
- "vue": ">=3.4",
47
- "vue-router": ">=4.4",
48
- "ithinkdt-ui": ">=1.4"
69
+ "@ithinkdt/page": ">=4.0",
70
+ "vue": ">=3.5",
71
+ "vue-router": ">=4.5",
72
+ "ithinkdt-ui": ">=1.5",
73
+ "unocss": ">=66"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "@ithinkdt/page": {
77
+ "optional": true
78
+ },
79
+ "unocss": {
80
+ "optional": true
81
+ }
49
82
  },
50
83
  "devDependencies": {
51
- "ithinkdt-ui": "^1.4.5",
52
- "typescript": "~5.5.4",
53
- "vue": "^3.4.38",
54
- "vue-router": "^4.4.3",
55
- "@ithinkdt/core": "^4.0.0-5"
84
+ "@vitejs/plugin-vue-jsx": "^5.1.1",
85
+ "ithinkdt-ui": "^1.7.3",
86
+ "typescript": "~5.9.3",
87
+ "unocss": ">=66.5.2",
88
+ "vite": "npm:rolldown-vite@^7.1.16",
89
+ "vue": "^3.5.22",
90
+ "vue-router": "^4.5.1",
91
+ "@ithinkdt/page": "^4.0.0-9"
56
92
  },
57
93
  "scripts": {
58
- "format": "prettier --write \"./{src,tests}/**/*.{js,vue,ts,jsx,tsx}\"",
59
- "release": "pnpm publish --no-git-checks"
94
+ "build": " vite build && cp -r ./_src/*.d.ts ./src",
95
+ "prerelease": "cp -r ./src ./_src && pnpm run build",
96
+ "release": "pnpm publish --no-git-checks",
97
+ "postrelease": "rm -rf ./src && cp -r ./_src ./src && rm -rf ./_src"
60
98
  }
61
99
  }
@@ -0,0 +1,435 @@
1
+ import {
2
+ CheckboxGroupProps, DataTableInst as NDataTableInst, DataTableProps as NDataTableProps,
3
+ FormItemGiProps as NFormItemGiProps, FormProps as NFormProps, GridItemProps as NGridItemProps, GridProps as NGridProps,
4
+ PopoverProps,
5
+ RadioGroupProps, TransferProps,
6
+ } from 'ithinkdt-ui'
7
+ import Sortable from 'sortablejs'
8
+ import { AllowedComponentProps, MaybeRef, MaybeRefOrGetter, VNodeChild } from 'vue'
9
+ import type { CSSProperties, HTMLAttributes, TemplateRef } from 'vue'
10
+
11
+ import { GenericCtx, GenericExposed, GenericReturn, MaybeArray, MaybePromise, PublicProps } from '@ithinkdt/common'
12
+ import { DictItem } from '@ithinkdt/common/dict'
13
+ import { FormItem, PageParams, PresetKeyField, SortParams, TableActionRenderParam, TableColumn, ValidationResults, _DataWithPresetKeyField } from '@ithinkdt/page'
14
+
15
+ declare module '@ithinkdt/page' {
16
+
17
+ interface FormRenderExtraOptions {
18
+ showColon?: MaybeRef<boolean | undefined>
19
+ }
20
+
21
+ type FormItemOptionKeys = 'size' | 'showLabel' | 'labelWidth' | 'labelStyle' | 'labelAlign' | 'labelPlacement' | 'labelProps'
22
+ | 'showRequireMark' | 'requireMarkPlacement' | 'showFeedback' | 'feedbackClass' | 'feedbackStyle' | 'span' | 'offset'
23
+
24
+ type FormItemOptionExtra = {
25
+ [K in FormItemOptionKeys]?: MaybeRef<NFormItemGiProps[K]>
26
+ }
27
+
28
+ // eslint-disable-next-line ts/no-unused-vars
29
+ interface FormItemOptions<Model extends {}> extends FormItemOptionExtra {
30
+ showColon?: MaybeRef<boolean | undefined>
31
+ rowSpan?: MaybeRef<number | undefined>
32
+ tooltip?: MaybeRefOrGetter<VNodeChild | undefined>
33
+ tooltipPlacement?: MaybeRef<'bottom' | 'icon' | undefined>
34
+ showTooltipWhenReadonly?: MaybeRef<boolean | undefined>
35
+ }
36
+ // eslint-disable-next-line ts/no-unused-vars
37
+ interface FormItem<Model extends {}> extends Pick<NFormItemGiProps, FormItemOptionKeys> {
38
+ showColon?: boolean | undefined
39
+ rowSpan?: number | undefined
40
+ tooltip?: VNodeChild | (() => VNodeChild) | undefined
41
+ tooltipPlacement?: 'bottom' | 'icon' | undefined
42
+ showTooltipWhenReadonly?: boolean | undefined
43
+ }
44
+
45
+ interface FormItemRenderExtraParams {
46
+ size?: 'small' | 'medium' | 'large' | undefined
47
+ }
48
+
49
+ }
50
+
51
+ export type DataFormProps<Data extends {}> = Omit<NFormProps, 'model' | 'rules' | 'onSubmit' | 'validateMessages'> & {
52
+ items: FormItem<Data>[]
53
+ model: Data
54
+ readonly?: boolean | undefined
55
+ grid?: boolean | NGridProps | undefined
56
+ validation?: { [k in keyof Data]?: ValidationResults } | undefined
57
+ showColon?: boolean | undefined
58
+ loading?: boolean | undefined
59
+ showAction?: boolean | NGridItemProps & AllowedComponentProps | undefined
60
+ actionAlign?: 'start' | 'center' | 'end'
61
+ submitText?: VNodeChild | undefined
62
+ resetText?: VNodeChild | undefined
63
+ cancelText?: VNodeChild | undefined
64
+ showSubmitBtn?: boolean | undefined
65
+ showResetBtn?: boolean | undefined
66
+ showCancelBtn?: boolean | undefined
67
+ submitDisabled?: boolean | undefined
68
+ succeeded?: boolean | undefined
69
+ successText?: VNodeChild | undefined
70
+
71
+ tooltipPlacement?: 'bottom' | 'icon' | undefined
72
+ onSubmit?: MaybeArray<(model: Data) => void> | undefined
73
+ onRest?: MaybeArray<() => void> | undefined
74
+ }
75
+
76
+ export type DataFormEmits<Data extends {}> = {
77
+ (e: 'submit', model: Data): void
78
+ (e: 'reset'): void
79
+ }
80
+
81
+ export type DataFormSlots<_Data extends {}> = {
82
+ action?: (params: { cols: number, spans: number, overflow: boolean }) => VNodeChild
83
+ }
84
+
85
+ export type DataFormInst = {
86
+ }
87
+
88
+ export declare function DataForm<Data extends {}>(
89
+ props: DataFormProps<Data> & PublicProps,
90
+ ctx?: Pick<GenericCtx<DataFormProps<Data>, DataFormEmits<Data>, DataFormSlots<Data>, DataFormInst>, 'attrs' | 'emit' | 'slots'>,
91
+ expose?: (exposed?: GenericExposed<DataFormInst>) => void,
92
+ setup?: GenericCtx<DataFormProps<Data>, DataFormEmits<Data>, DataFormSlots<Data>, DataFormInst>,
93
+ ): GenericReturn<DataFormProps<Data>, DataFormEmits<Data>, DataFormSlots<Data>, DataFormInst>
94
+
95
+ export type DataFilterProps<Data extends {}> = Omit<NFormProps, 'model' | 'rules' | 'onSubmit' | 'validateMessages'> & {
96
+ items: FormItem<Data>[]
97
+ model: Data
98
+ loading?: boolean | undefined
99
+ filterOnReset?: boolean | undefined
100
+ filterText?: VNodeChild | undefined
101
+ resetText?: VNodeChild | undefined
102
+ grid?: boolean | Omit<NGridProps, 'collapsed' | 'collapsedRows'> | undefined
103
+ collapsible?: boolean | undefined
104
+ defaultCollapsed?: boolean | undefined
105
+ collapsedRows?: number | undefined
106
+ showColon?: boolean | undefined
107
+ tooltipPlacement?: 'bottom' | 'icon' | undefined
108
+ customizable?: boolean | undefined
109
+ onFilter?: MaybeArray<(model: Data) => void> | undefined
110
+ onRest?: MaybeArray<() => void> | undefined
111
+ onCustom?: MaybeArray<
112
+ ((reset: true) => void)
113
+ | ((sort: string[]) => void)
114
+ | ((modify: {
115
+ key: string
116
+ hidden: boolean
117
+ }) => void)
118
+ >
119
+ | undefined
120
+ onCollapse?: MaybeArray<(collapsed: boolean) => void> | undefined
121
+ }
122
+
123
+ export type DataFilterEmits<Data extends {}> = {
124
+ (e: 'filter', model: Data): void
125
+ (e: 'reset'): void
126
+ (e: 'custom', param: true | string[] | { key: string, hidden?: boolean }): void
127
+ (e: 'custom', sort: string[]): void
128
+ (e: 'custom', modify: {
129
+ key: string
130
+ hidden?: boolean
131
+ }): void
132
+ (e: 'collpase', collapsed: boolean): void
133
+ }
134
+
135
+ export type DataFilterInst = {
136
+ collapse(this: void, collapsed: boolean): void
137
+ }
138
+
139
+ export declare function DataFilter<Data extends {}>(
140
+ props: DataFilterProps<Data> & PublicProps,
141
+ ctx?: Pick<GenericCtx<DataFilterProps<Data>, DataFilterEmits<Data>, {}, DataFilterInst>, 'attrs' | 'emit' | 'slots'>,
142
+ expose?: (exposed?: GenericExposed<DataFilterInst>) => void,
143
+ setup?: GenericCtx<DataFilterProps<Data>, DataFilterEmits<Data>, {}, DataFilterInst>,
144
+ ): GenericReturn<DataFilterProps<Data>, DataFilterEmits<Data>, {}, DataFilterInst>
145
+
146
+ export type DataTableProps<Data extends {}, KeyField extends keyof Data>
147
+ = Omit<NDataTableProps, 'columns' | 'rowKey' | 'data' | 'checkedRowKeys' | 'defaultCheckedRowKeys' | 'onUpdate:checkedRowKeys' | 'onUpdateCheckedRowKeys'> & {
148
+ columns?: TableColumn<Data>[] | undefined
149
+ data?: Data[] | undefined
150
+ keyField?: KeyField | undefined
151
+ selectedKeys?: Data[KeyField][] | undefined
152
+ sorter?: SortParams<Data> | undefined
153
+ onSort?: MaybeArray<(param: SortParams<Data>) => void> | undefined
154
+ onSelect?: MaybeArray<(param: NonNullable<Data[KeyField]>[]) => void> | undefined
155
+ }
156
+
157
+ export type DataTableEmits<Data extends {}, KeyField extends keyof Data> = {
158
+ (e: 'sort', param: SortParams<Data>): void
159
+ (e: 'select', param: Data[KeyField][]): void
160
+ }
161
+
162
+ export type DataTableInst<Data extends {}, KeyField extends keyof Data> = NDataTableInst & {
163
+ scrollToView(rowKey: Data[KeyField]): void
164
+ }
165
+
166
+ export declare function DataTable<Data extends _DataWithPresetKeyField>(
167
+ props: DataTableProps<Data, PresetKeyField> & PublicProps,
168
+ ctx?: Pick<GenericCtx<DataTableProps<Data, PresetKeyField>, DataTableEmits<Data, PresetKeyField>, {}, DataTableInst<Data, PresetKeyField>>, 'attrs' | 'emit' | 'slots'>,
169
+ expose?: (exposed?: GenericExposed<DataTableInst<Data, PresetKeyField>>) => void,
170
+ setup?: GenericCtx<DataTableProps<Data, PresetKeyField>, DataTableEmits<Data, PresetKeyField>, {}, DataTableInst<Data, PresetKeyField>>,
171
+ ): GenericReturn<DataTableProps<Data, PresetKeyField>, DataTableEmits<Data, PresetKeyField>, {}, DataTableInst<Data, PresetKeyField>>
172
+
173
+ export declare function DataTable<Data extends {}, KeyField extends keyof Data>(
174
+ props: DataTableProps<Data, KeyField> & PublicProps,
175
+ ctx?: Pick<GenericCtx<DataTableProps<Data, KeyField>, DataTableEmits<Data, KeyField>, {}, DataTableInst<Data, KeyField>>, 'attrs' | 'emit' | 'slots'>,
176
+ expose?: (exposed?: GenericExposed<DataTableInst<Data, KeyField>>) => void,
177
+ setup?: GenericCtx<DataTableProps<Data, KeyField>, DataTableEmits<Data, KeyField>, {}, DataTableInst<Data, KeyField>>,
178
+ ): GenericReturn<DataTableProps<Data, KeyField>, DataTableEmits<Data, KeyField>, {}, DataTableInst<Data, KeyField>>
179
+
180
+ export declare function useDataTableDrag<T>(
181
+ tableRef: TemplateRef<HTMLElement>,
182
+ { data, onSort, ...options }: {
183
+ data: MaybeRef<T[]>
184
+ onSort: (info: { from: number, to: number }) => void
185
+ } & Omit<Sortable.Options, 'onSort'>
186
+ ): void
187
+
188
+ export type DataPaginationProps = (PageParams | { page: PageParams }) & {
189
+ simple?: boolean | undefined
190
+ total: number
191
+ pageSizes?: number[] | undefined
192
+ onChange?: MaybeArray<(value: PageParams) => void> | undefined
193
+ }
194
+
195
+ export type DataPaginationEmits = {
196
+ (e: 'change', value: PageParams): void
197
+ }
198
+
199
+ export declare function DataPagination(
200
+ props: DataPaginationProps & PublicProps,
201
+ ctx?: Pick<GenericCtx<DataPaginationProps, DataPaginationEmits, {}, {}>, 'attrs' | 'emit' | 'slots'>,
202
+ expose?: (exposed?: GenericExposed<{}>) => void,
203
+ setup?: GenericCtx<DataPaginationProps, DataPaginationEmits, {}, {}>,
204
+ ): GenericReturn<DataPaginationProps, DataPaginationEmits, {}, {}>
205
+
206
+ export type DataSelectionProps = {
207
+ 'count': number
208
+ 'modelValue': 'all' | 'selection'
209
+ 'onClear'?: MaybeArray<() => void> | undefined
210
+ 'onUpdate:modelValue'?: MaybeArray<(value: DataSelectionProps['modelValue']) => void> | undefined
211
+ }
212
+
213
+ export type DataSelectionEmits = {
214
+ (e: 'clear'): void
215
+ (e: 'update:modelValue', v: DataSelectionProps['modelValue']): void
216
+ }
217
+
218
+ export declare function DataSelection(
219
+ props: DataSelectionProps & PublicProps,
220
+ ctx?: Pick<GenericCtx<DataSelectionProps, DataSelectionEmits, {}, {}>, 'attrs' | 'emit' | 'slots'>,
221
+ expose?: (exposed?: GenericExposed<{}>) => void,
222
+ setup?: GenericCtx<DataSelectionProps, DataSelectionEmits, {}, {}>,
223
+ ): GenericReturn<DataSelectionProps, DataSelectionEmits, {}, {}>
224
+
225
+ export type DataCustomProps<Data extends {}> = {
226
+ data: Data[]
227
+ hiddenField?: keyof Data | undefined
228
+ fixedField?: keyof Data | undefined
229
+ labelField?: keyof Data | undefined
230
+ keyField?: keyof Data | undefined
231
+ showFixed?: boolean | undefined
232
+ disabledField?: keyof Data | undefined
233
+ visiblityField?: keyof Data | undefined
234
+ labelTitle?: VNodeChild | undefined
235
+ onCustom?: MaybeArray<
236
+ ((reset: true) => void)
237
+ | ((sort: string[]) => void)
238
+ | ((modify: {
239
+ key: string
240
+ hidden?: boolean | undefined
241
+ fixed?: 'left' | 'right' | false | undefined
242
+ }) => void)>
243
+ | undefined
244
+ }
245
+
246
+ export type DataCustomEmits = {
247
+ (e: 'custom', reset: true): void
248
+ (e: 'custom', sort: string[]): void
249
+ (e: 'custom', modify: {
250
+ key: string
251
+ hidden?: boolean | undefined
252
+ fixed?: 'left' | 'right' | false | undefined
253
+ }): void
254
+ }
255
+
256
+ export declare function DataCustom<Data extends {}>(
257
+ props: DataCustomProps<Data> & PublicProps,
258
+ ctx?: Pick<GenericCtx<DataCustomProps<Data>, DataCustomEmits, {}, {}>, 'attrs' | 'emit' | 'slots'>,
259
+ expose?: (exposed?: GenericExposed<{}>) => void,
260
+ setup?: GenericCtx<DataCustomProps<Data>, DataCustomEmits, {}, {}>,
261
+ ): GenericReturn<DataCustomProps<Data>, DataCustomEmits, {}, {}>
262
+
263
+ export type DataActionsProps = {
264
+ options?: TableActionRenderParam[] | undefined
265
+ }
266
+
267
+ export type DataActionsEmits = {}
268
+
269
+ export declare function DataActions(
270
+ props: DataActionsProps & PublicProps,
271
+ ctx?: Pick<GenericCtx<DataActionsProps, DataActionsEmits, { default?: () => VNodeChild }, {}>, 'attrs' | 'emit' | 'slots'>,
272
+ expose?: (exposed?: GenericExposed<{}>) => void,
273
+ setup?: GenericCtx<DataActionsProps, DataActionsEmits, { default?: () => VNodeChild }, {}>,
274
+ ): GenericReturn<DataActionsProps, DataActionsEmits, { default?: () => VNodeChild }, {}>
275
+
276
+ export type DataLocaleInputProps = {
277
+ 'label'?: VNodeChild | (() => VNodeChild) | undefined
278
+ 'modelValue'?: Record<string, string | undefined> | null | undefined
279
+ 'supports'?: { label: string, value: string }[] | undefined
280
+ 'defaultLang'?: string | undefined
281
+ 'showLang'?: string | undefined
282
+ 'disabled'?: boolean | undefined
283
+ 'defaultRows'?: number | undefined
284
+ 'onUpdate:modelValue'?: MaybeArray<(modelValue: Record<string, string | undefined> | null) => void> | undefined
285
+ 'onUpdateModelValue'?: MaybeArray<(modelValue: Record<string, string | undefined> | null) => void> | undefined
286
+ }
287
+
288
+ export type DataLocaleInputEmits = {
289
+ (e: 'update:modelValue', modelValue: Record<string, string | undefined> | null | undefined): void
290
+ (e: 'updateModelValue', modelValue: Record<string, string | undefined> | null | undefined): void
291
+ }
292
+
293
+ export declare function DataLocaleInput(
294
+ props: DataLocaleInputProps & PublicProps,
295
+ ctx?: Pick<GenericCtx<DataLocaleInputProps, DataLocaleInputEmits, {}, {}>, 'attrs' | 'emit' | 'slots'>,
296
+ expose?: (exposed?: GenericExposed<{}>) => void,
297
+ setup?: GenericCtx<DataLocaleInputProps, DataLocaleInputEmits, {}, {}>,
298
+ ): GenericReturn<DataLocaleInputProps, DataLocaleInputEmits, {}, {}>
299
+
300
+ export declare function useLocaleEdit(
301
+ title: VNodeChild | (() => VNodeChild),
302
+ onSubmit: (data: Record<string, string | undefined>) => void,
303
+ defaultRows?: MaybeRef<number | undefined>
304
+ ): {
305
+ open(this: void, data: MaybePromise<Record<string, string | undefined>>, readonly?: boolean): PromiseLike<Record<string, string | undefined>>
306
+ setSupports(this: void, supports: { label: string, value: string, required?: boolean }[]): void
307
+ }
308
+
309
+ export interface CheckboxesProps extends Omit<CheckboxGroupProps, 'value' | 'onUpdate:value' | 'defaultValue'> {
310
+ 'options'?: DictItem[] | Record<string, unknown>[] | undefined
311
+ 'vertical'?: boolean | undefined
312
+ 'default'?: boolean | string | DictItem | undefined
313
+ 'labelPadding'?: CSSProperties['padding']
314
+ 'labelField'?: string | undefined
315
+ 'valueField'?: string | undefined
316
+ 'disabledField'?: string | undefined
317
+ 'modelValue'?: string[] | number[] | null | undefined
318
+ 'onUpdate:modelValue'?: MaybeArray<(modelValue: string[] | number[] | null) => void> | undefined
319
+ 'onUpdateModelValue'?: MaybeArray<(modelValue: string[] | number[] | null) => void> | undefined
320
+ }
321
+
322
+ export interface CheckboxesEmits {
323
+ (e: 'update:modelValue', modelValue: string[] | number[] | null): void
324
+ (e: 'updateModelValue', modelValue: string[] | number[] | null): void
325
+ }
326
+
327
+ export declare function NCheckboxes(
328
+ props: CheckboxesProps & PublicProps,
329
+ ctx?: Pick<GenericCtx<CheckboxesProps, CheckboxesEmits, {}, {}>, 'attrs' | 'emit' | 'slots'>,
330
+ expose?: (exposed?: GenericExposed<{}>) => void,
331
+ setup?: GenericCtx<CheckboxesProps, CheckboxesEmits, {}, {}>,
332
+ ): GenericReturn<CheckboxesProps, CheckboxesEmits, {}, {}>
333
+
334
+ export interface RadiosProps extends Omit<RadioGroupProps, 'value' | 'onUpdate:value' | 'defaultValue'> {
335
+ 'options'?: DictItem[] | Record<string, unknown>[] | undefined
336
+ 'type'?: 'radio' | 'button' | 'button-primary' | undefined
337
+ 'vertical'?: boolean | undefined
338
+ 'default'?: boolean | string | DictItem | undefined
339
+ 'padding'?: CSSProperties['padding']
340
+ 'labelField'?: string | undefined
341
+ 'valueField'?: string | undefined
342
+ 'disabledField'?: string | undefined
343
+ 'modelValue'?: string | number | boolean | null | undefined
344
+ 'onUpdate:modelValue'?: MaybeArray<(modelValue: string | number | boolean | null) => void> | undefined
345
+ 'onUpdateModelValue'?: MaybeArray<(modelValue: string | number | boolean | null) => void> | undefined
346
+ }
347
+
348
+ export interface RadiosEmits {
349
+ (e: 'update:modelValue', modelValue: string | number | boolean | null): void
350
+ (e: 'updateModelValue', modelValue: string | number | boolean | null): void
351
+ }
352
+
353
+ export declare function NRadios(
354
+ props: RadiosProps & PublicProps,
355
+ ctx?: Pick<GenericCtx<RadiosProps, RadiosEmits, {}, {}>, 'attrs' | 'emit' | 'slots'>,
356
+ expose?: (exposed?: GenericExposed<{}>) => void,
357
+ setup?: GenericCtx<RadiosProps, RadiosEmits, {}, {}>,
358
+ ): GenericReturn<RadiosProps, RadiosEmits, {}, {}>
359
+
360
+ export interface UserGroupOption {
361
+ code: string
362
+ name: string
363
+ }
364
+ export interface DeptOption {
365
+ code: string
366
+ name: string
367
+ children?: DeptOption[]
368
+ }
369
+
370
+ interface UserDeptProps<Multiple extends boolean> {
371
+ 'type'?: 'user' | 'dept' | undefined
372
+ 'selectType'?: 'dropdown' | 'dialog' | 'transfer' | undefined
373
+ 'placeholder'?: string | undefined
374
+ 'menuProps'?: HTMLAttributes | undefined
375
+ 'multiple'?: Multiple | undefined
376
+ 'defaultExpandAll'?: boolean | undefined
377
+ 'filterable'?: boolean | undefined
378
+ 'disabled'?: boolean | undefined
379
+ 'size'?: TransferProps['size'] | undefined
380
+ 'users'?: { username: string, nickname: string }[] | undefined
381
+ 'groups'?: UserGroupOption[] | undefined
382
+ 'depts'?: DeptOption[] | undefined
383
+ 'getUsersByGroup'?: ((code: string) => Promise<{ username: string, nickname: string }[]>) | undefined
384
+ 'getUsersByDept'?: ((code: string) => Promise<{ username: string, nickname: string }[]>) | undefined
385
+ 'modelValue'?: Multiple extends true ? (string[] | null | undefined) : (string | null | undefined)
386
+ 'onUpdate:modelValue'?: MaybeArray<(value: Multiple extends true ? string[] : string) => void> | undefined
387
+ 'onUpdateModelValue'?: MaybeArray<(value: Multiple extends true ? string[] : string) => void> | undefined
388
+ }
389
+
390
+ interface UserDeptEmits<Multiple extends boolean> {
391
+ (e: 'update:modelValue', value: Multiple extends true ? string[] : string): void
392
+ (e: 'updateModelValue', value: Multiple extends true ? string[] : string): void
393
+ }
394
+
395
+ export declare const DtUserDept: <Multiple extends boolean>(
396
+ props: UserDeptProps<Multiple> & PublicProps,
397
+ ctx?: Pick<GenericCtx<UserDeptProps<Multiple>, UserDeptEmits<Multiple>>, 'attrs' | 'emit' | 'slots'>,
398
+ expose?: (exposed?: GenericExposed<{}>) => void,
399
+ setup?: GenericCtx<UserDeptProps<Multiple>, UserDeptEmits<Multiple>, {}, {}>,
400
+ ) => GenericReturn<UserDeptProps<Multiple>, UserDeptEmits<Multiple>, {}, {}>
401
+
402
+ interface UserRenderProps {
403
+ value?: string | string[] | null | undefined
404
+ multiple?: boolean | undefined
405
+ max?: number | undefined
406
+ size?: number | undefined
407
+ placement?: PopoverProps['placement']
408
+ getUsersByUsername?: ((usernames: string[]) => Promise<{ username: string, nickname: string }[]>) | undefined
409
+ }
410
+
411
+ interface UserRenderEmits {
412
+ }
413
+
414
+ export declare const DtUserRender: (
415
+ props: UserRenderProps & PublicProps,
416
+ ctx?: Pick<GenericCtx<UserRenderProps, UserRenderEmits>, 'attrs' | 'emit' | 'slots'>,
417
+ expose?: (exposed?: GenericExposed<{}>) => void,
418
+ setup?: GenericCtx<UserRenderProps, UserRenderEmits, {}, {}>,
419
+ ) => GenericReturn<UserRenderProps, UserRenderEmits, {}, {}>
420
+
421
+ interface DeptRenderProps {
422
+ value?: string | string[] | null | undefined
423
+ multiple?: boolean | undefined
424
+ getDeptsByCode?: (codes: string[]) => Promise<DeptOption[]>
425
+ }
426
+
427
+ interface DeptRenderEmits {
428
+ }
429
+
430
+ export declare const DtDeptRender: (
431
+ props: DeptRenderProps & PublicProps,
432
+ ctx?: Pick<GenericCtx<DeptRenderProps, DeptRenderEmits>, 'attrs' | 'emit' | 'slots'>,
433
+ expose?: (exposed?: GenericExposed<{}>) => void,
434
+ setup?: GenericCtx<DeptRenderProps, DeptRenderEmits, {}, {}>,
435
+ ) => GenericReturn<DeptRenderProps, DeptRenderEmits, {}, {}>