@ithinkdt/ui 4.0.0-21 → 4.0.0-22
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ithinkdt/ui",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "iThinkDT UI",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"vite": "npm:rolldown-vite@^7.1.17",
|
|
89
89
|
"vue": "^3.5.22",
|
|
90
90
|
"vue-router": "^4.6.0",
|
|
91
|
-
"@ithinkdt/page": "^4.0.0-
|
|
91
|
+
"@ithinkdt/page": "^4.0.0-14"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|
|
94
94
|
"release": "pnpm publish --no-git-checks"
|
|
@@ -13,6 +13,7 @@ const DataCustomItem = /* @__PURE__ */ defineComponent({
|
|
|
13
13
|
label: [String, Function],
|
|
14
14
|
disabled: Boolean,
|
|
15
15
|
hidden: Boolean,
|
|
16
|
+
showFixed: Boolean,
|
|
16
17
|
fixed: [Boolean, String],
|
|
17
18
|
},
|
|
18
19
|
emits: ['update-hidden', 'update-fixed'],
|
|
@@ -31,24 +32,30 @@ const DataCustomItem = /* @__PURE__ */ defineComponent({
|
|
|
31
32
|
onUpdateChecked={v => emit('update-hidden', !v)}
|
|
32
33
|
/>
|
|
33
34
|
<NEllipsis style="flex: 1 1 auto">{toValue(props.label)}</NEllipsis>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
{
|
|
36
|
+
props.showFixed
|
|
37
|
+
? [
|
|
38
|
+
<NButton
|
|
39
|
+
text
|
|
40
|
+
type={props.fixed === 'left' ? 'primary' : undefined}
|
|
41
|
+
onClick={() => emit('update-fixed', props.fixed === 'left' ? false : 'left')}
|
|
42
|
+
>
|
|
43
|
+
<NIcon>
|
|
44
|
+
<ILeft />
|
|
45
|
+
</NIcon>
|
|
46
|
+
</NButton>,
|
|
47
|
+
<NButton
|
|
48
|
+
text
|
|
49
|
+
type={props.fixed === 'right' ? 'primary' : undefined}
|
|
50
|
+
onClick={() => emit('update-fixed', props.fixed === 'right' ? false : 'right')}
|
|
51
|
+
>
|
|
52
|
+
<NIcon>
|
|
53
|
+
<IRight />
|
|
54
|
+
</NIcon>
|
|
55
|
+
</NButton>,
|
|
56
|
+
]
|
|
57
|
+
: undefined
|
|
58
|
+
}
|
|
52
59
|
</NFlex>
|
|
53
60
|
)
|
|
54
61
|
}
|
|
@@ -80,7 +87,7 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
80
87
|
},
|
|
81
88
|
showFixed: {
|
|
82
89
|
type: Boolean,
|
|
83
|
-
default:
|
|
90
|
+
default: true,
|
|
84
91
|
},
|
|
85
92
|
disabledField: {
|
|
86
93
|
type: String,
|
|
@@ -91,6 +98,13 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
91
98
|
default: 'visiblity',
|
|
92
99
|
},
|
|
93
100
|
tooltip: [String, Object],
|
|
101
|
+
size: {
|
|
102
|
+
type: Number,
|
|
103
|
+
default: 20,
|
|
104
|
+
},
|
|
105
|
+
type: {
|
|
106
|
+
type: String,
|
|
107
|
+
},
|
|
94
108
|
},
|
|
95
109
|
emits: {
|
|
96
110
|
custom: () => true,
|
|
@@ -100,7 +114,7 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
100
114
|
|
|
101
115
|
function emitCols(col, field, value) {
|
|
102
116
|
emit('custom', {
|
|
103
|
-
key: col.
|
|
117
|
+
key: col[props.keyField],
|
|
104
118
|
[field]: value,
|
|
105
119
|
})
|
|
106
120
|
}
|
|
@@ -134,8 +148,8 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
134
148
|
{{
|
|
135
149
|
trigger: () =>
|
|
136
150
|
withDirectives(
|
|
137
|
-
<NButton text>
|
|
138
|
-
<NIcon size=
|
|
151
|
+
<NButton text type={props.type}>
|
|
152
|
+
<NIcon size={props.size}>
|
|
139
153
|
<ICustom />
|
|
140
154
|
</NIcon>
|
|
141
155
|
</NButton>,
|
|
@@ -158,6 +172,7 @@ export const DataCustom = /* @__PURE__ */ defineComponent({
|
|
|
158
172
|
label={item[props.labelField]}
|
|
159
173
|
hidden={item[props.hiddenField]}
|
|
160
174
|
fixed={item[props.fixedField]}
|
|
175
|
+
showFixed={props.showFixed}
|
|
161
176
|
onUpdateHidden={v => emitCols(item, 'hidden', v)}
|
|
162
177
|
onUpdateFixed={v => emitCols(item, 'fixed', v)}
|
|
163
178
|
/>
|
|
@@ -5,6 +5,7 @@ import { pickProps } from '@ithinkdt/common/object'
|
|
|
5
5
|
|
|
6
6
|
import { useI18n } from '../use-i18n.js'
|
|
7
7
|
|
|
8
|
+
import { DataCustom } from './DataCustom.jsx'
|
|
8
9
|
import { DataForm } from './DataForm.jsx'
|
|
9
10
|
import { IDown, IUp } from './assets.jsx'
|
|
10
11
|
|
|
@@ -87,6 +88,11 @@ export const DataFilter = /* @__PURE__ */ defineComponent({
|
|
|
87
88
|
<NButton attrType="reset" disabled={props.disabled || props.loading}>
|
|
88
89
|
{resetText || t('common.page.form.resetText') }
|
|
89
90
|
</NButton>
|
|
91
|
+
{
|
|
92
|
+
customizable
|
|
93
|
+
? <DataCustom keyField="name" showFixed={false} data={formProps.items} onCustom={e => emit('custom', e)} size={18} type="primary" />
|
|
94
|
+
: undefined
|
|
95
|
+
}
|
|
90
96
|
{
|
|
91
97
|
collapsible && action.suffix
|
|
92
98
|
? (
|
package/src/components.d.ts
CHANGED
|
@@ -232,6 +232,8 @@ export type DataCustomProps<Data extends {}> = {
|
|
|
232
232
|
disabledField?: keyof Data | undefined
|
|
233
233
|
visiblityField?: keyof Data | undefined
|
|
234
234
|
labelTitle?: VNodeChild | undefined
|
|
235
|
+
size?: number | undefined
|
|
236
|
+
type?: 'primary' | 'default' | undefined
|
|
235
237
|
onCustom?: MaybeArray<
|
|
236
238
|
((reset: true) => void)
|
|
237
239
|
| ((sort: string[]) => void)
|