@mythpe/quasar-ui-qui 0.2.47 → 0.2.49
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
|
@@ -125,7 +125,7 @@ export const useMyth = () => {
|
|
|
125
125
|
align: 'center'
|
|
126
126
|
// sortable: !0
|
|
127
127
|
}
|
|
128
|
-
const opts = extend<ParseHeaderOptions>(!0, defaultOptions, options)
|
|
128
|
+
const opts = extend<ParseHeaderOptions>(!0, {}, defaultOptions, options)
|
|
129
129
|
let control: string | undefined = defaultOptions.controlKey
|
|
130
130
|
let controlStyle: string | undefined = defaultOptions.controlStyle
|
|
131
131
|
if (opts.controlKey) {
|
|
@@ -195,12 +195,14 @@ export const useMyth = () => {
|
|
|
195
195
|
if (!item.align) {
|
|
196
196
|
item.align = 'right'
|
|
197
197
|
}
|
|
198
|
-
opts.classes = opts.classes || ''
|
|
198
|
+
// opts.classes = opts.classes || ''
|
|
199
199
|
if (typeof opts.classes === 'function') {
|
|
200
|
-
|
|
200
|
+
const callback = opts.classes
|
|
201
|
+
opts.classes = (item) => (callback(item) || '') + ' m--control-cell'
|
|
202
|
+
} else if (typeof opts.classes === 'string') {
|
|
203
|
+
opts.classes += ' m--control-cell'
|
|
204
|
+
opts.classes = opts.classes.trim()
|
|
201
205
|
}
|
|
202
|
-
opts.classes += ' m--control-cell'
|
|
203
|
-
opts.classes = opts.classes.trim()
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
item = { ...opts, ...item }
|
|
@@ -18,8 +18,7 @@ import type { GenericFormValues } from './api/MInput'
|
|
|
18
18
|
|
|
19
19
|
export type MDtItem<T extends object = Record<keyof T, any>> = T & {
|
|
20
20
|
id: string | number;
|
|
21
|
-
|
|
22
|
-
}
|
|
21
|
+
} & Record<any, any>;
|
|
23
22
|
|
|
24
23
|
export type MDtItemIndex = number;
|
|
25
24
|
export type MDtExportOptions = 'pdf' | 'excel';
|
|
@@ -162,13 +161,13 @@ export type MDatatableScope = {
|
|
|
162
161
|
closeImageDialog: () => void;
|
|
163
162
|
}
|
|
164
163
|
type E = MDatatableDialogsOptions['item'];
|
|
165
|
-
export type GenericMDtBtn
|
|
164
|
+
export type GenericMDtBtn = Record<string, any> & {
|
|
166
165
|
name: string;
|
|
167
166
|
label?: string;
|
|
168
167
|
contextLabel?: string | null;
|
|
169
168
|
tooltip?: string;
|
|
170
|
-
click?: (item: UnwrapRef<
|
|
171
|
-
multiClick?: (items:
|
|
169
|
+
click?: <V extends E = E>(item: UnwrapRef<V> | Ref<V> | V, index: UnwrapRef<MDatatableDialogsOptions['index']>) => void;
|
|
170
|
+
multiClick?: <V extends E = E>(items: V[]) => void;
|
|
172
171
|
showIf?: boolean | ((item: UnwrapRef<MDatatableDialogsOptions['item']>, index: UnwrapRef<MDatatableDialogsOptions['index']>) => boolean);
|
|
173
172
|
order?: number;
|
|
174
173
|
attr?: Partial<MDtBtnProps> & Partial<{ icon?: string; textColor?: NamedColor | undefined; color?: NamedColor | undefined; }>;
|
package/src/types/m-helpers.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type ParseHeaderOptions = {
|
|
|
15
15
|
controlStyle?: 'max-width: 150px' | string
|
|
16
16
|
align?: 'left' | 'right' | 'center' | undefined
|
|
17
17
|
sortable?: boolean | undefined;
|
|
18
|
-
classes?: string | (() => string),
|
|
18
|
+
classes?: string | (() => string) | (<T>(item: T) => string),
|
|
19
19
|
noSort?: string[]
|
|
20
20
|
}
|
|
21
21
|
|