@wgalleti/primevue-components 0.8.0 → 0.8.2
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/README.md +17 -0
- package/bin/wpvc.mjs +209 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-C9YG4BXB.cjs +12 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-C9YG4BXB.cjs.map +1 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-CoGaRckJ.js +3348 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-CoGaRckJ.js.map +1 -0
- package/dist/components/crud/WCrudFormDialog.vue.d.ts +2 -215
- package/dist/components/crud/WCrudView.vue.d.ts +3 -9
- package/dist/components/form/WAutoCompleteFK.vue.d.ts +1 -1
- package/dist/components/form/WDatePicker.vue.d.ts +44 -0
- package/dist/components/form/WFormRenderer.vue.d.ts +2 -37
- package/dist/components/index.d.ts +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.cjs.map +1 -1
- package/dist/components.js +63 -92
- package/dist/components.js.map +1 -1
- package/dist/composables/index.d.ts +3 -0
- package/dist/composables/useDateInput.d.ts +29 -0
- package/dist/composables/useFormKeyboardNav.d.ts +11 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.cjs.map +1 -1
- package/dist/composables.js +10 -8
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +53 -50
- package/dist/primevue-components.css +1 -1
- package/dist/types/field.d.ts +5 -0
- package/dist/types/manager.d.ts +3 -0
- package/dist/useApi-BDjRqSFt.cjs +2 -0
- package/dist/{useApi-5Pr4nXAa.cjs.map → useApi-BDjRqSFt.cjs.map} +1 -1
- package/dist/{useApi-Bxrw3Sia.js → useApi-CzOJADZw.js} +2 -2
- package/dist/{useApi-Bxrw3Sia.js.map → useApi-CzOJADZw.js.map} +1 -1
- package/dist/useFormKeyboardNav-D4Irq5RE.js +461 -0
- package/dist/useFormKeyboardNav-D4Irq5RE.js.map +1 -0
- package/dist/useFormKeyboardNav-D4Ow3k4Y.cjs +3 -0
- package/dist/useFormKeyboardNav-D4Ow3k4Y.cjs.map +1 -0
- package/package.json +7 -2
- package/skill/SKILL.md +67 -0
- package/skill/references/components.md +51 -0
- package/skill/references/crud.md +83 -0
- package/skill/references/migration.md +58 -0
- package/skill/references/setup.md +74 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-BS3zNV1Z.js +0 -3126
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-BS3zNV1Z.js.map +0 -1
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-DlnsDNZ5.cjs +0 -12
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-DlnsDNZ5.cjs.map +0 -1
- package/dist/useApi-5Pr4nXAa.cjs +0 -2
- package/dist/useApiError-BEbEk2Kq.cjs +0 -3
- package/dist/useApiError-BEbEk2Kq.cjs.map +0 -1
- package/dist/useApiError-C7rPzGrF.js +0 -375
- package/dist/useApiError-C7rPzGrF.js.map +0 -1
|
@@ -1,219 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
visible: boolean;
|
|
4
|
-
title: string;
|
|
5
|
-
fields: FieldDef[];
|
|
6
|
-
formData: Record<string, unknown>;
|
|
7
|
-
isEditing: boolean;
|
|
8
|
-
saving: boolean;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
width?: string;
|
|
11
|
-
/** Nº de colunas do grid do form (repassado ao WFormRenderer; default 2). */
|
|
12
|
-
formColumns?: number;
|
|
13
|
-
};
|
|
14
|
-
declare function __VLS_template(): {
|
|
15
|
-
attrs: Partial<{}>;
|
|
16
|
-
slots: Partial<Record<`field-${string}`, (_: {
|
|
17
|
-
field: FieldDef;
|
|
18
|
-
formData: Record<string, unknown>;
|
|
19
|
-
isEditing: boolean;
|
|
20
|
-
setFormField: (f: string, v: unknown) => void;
|
|
21
|
-
}) => any>> & Partial<Record<`image-${string}`, (_: {
|
|
22
|
-
field: FieldDef;
|
|
23
|
-
formData: Record<string, unknown>;
|
|
24
|
-
}) => any>> & {
|
|
25
|
-
footer?(_: {
|
|
26
|
-
saving: boolean;
|
|
27
|
-
disabled: boolean;
|
|
28
|
-
}): any;
|
|
29
|
-
};
|
|
30
|
-
refs: {
|
|
31
|
-
rendererRef: ({
|
|
32
|
-
$: import('vue').ComponentInternalInstance;
|
|
33
|
-
$data: {};
|
|
34
|
-
$props: {
|
|
35
|
-
readonly fields: FieldDef[];
|
|
36
|
-
readonly formData: Record<string, unknown>;
|
|
37
|
-
readonly isEditing: boolean;
|
|
38
|
-
readonly disabled?: boolean | undefined;
|
|
39
|
-
readonly columns?: number | undefined;
|
|
40
|
-
readonly "onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
41
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
42
|
-
$attrs: import('vue').Attrs;
|
|
43
|
-
$refs: {
|
|
44
|
-
[x: string]: unknown;
|
|
45
|
-
};
|
|
46
|
-
$slots: Readonly<{
|
|
47
|
-
[name: string]: import('vue').Slot<any> | undefined;
|
|
48
|
-
}>;
|
|
49
|
-
$root: import('vue').ComponentPublicInstance | null;
|
|
50
|
-
$parent: import('vue').ComponentPublicInstance | null;
|
|
51
|
-
$host: Element | null;
|
|
52
|
-
$emit: (event: "update:field", field: string, value: unknown) => void;
|
|
53
|
-
$el: HTMLDivElement;
|
|
54
|
-
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
55
|
-
fields: FieldDef[];
|
|
56
|
-
formData: Record<string, unknown>;
|
|
57
|
-
isEditing: boolean;
|
|
58
|
-
disabled?: boolean;
|
|
59
|
-
columns?: number;
|
|
60
|
-
}> & Readonly<{
|
|
61
|
-
"onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
62
|
-
}>, {
|
|
63
|
-
validateAll: () => string[];
|
|
64
|
-
clearErrors: () => void;
|
|
65
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
66
|
-
"update:field": (field: string, value: unknown) => any;
|
|
67
|
-
}, string, {
|
|
68
|
-
disabled: boolean;
|
|
69
|
-
columns: number;
|
|
70
|
-
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
71
|
-
beforeCreate?: (() => void) | (() => void)[];
|
|
72
|
-
created?: (() => void) | (() => void)[];
|
|
73
|
-
beforeMount?: (() => void) | (() => void)[];
|
|
74
|
-
mounted?: (() => void) | (() => void)[];
|
|
75
|
-
beforeUpdate?: (() => void) | (() => void)[];
|
|
76
|
-
updated?: (() => void) | (() => void)[];
|
|
77
|
-
activated?: (() => void) | (() => void)[];
|
|
78
|
-
deactivated?: (() => void) | (() => void)[];
|
|
79
|
-
beforeDestroy?: (() => void) | (() => void)[];
|
|
80
|
-
beforeUnmount?: (() => void) | (() => void)[];
|
|
81
|
-
destroyed?: (() => void) | (() => void)[];
|
|
82
|
-
unmounted?: (() => void) | (() => void)[];
|
|
83
|
-
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
84
|
-
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
85
|
-
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
86
|
-
};
|
|
87
|
-
$forceUpdate: () => void;
|
|
88
|
-
$nextTick: typeof import('vue').nextTick;
|
|
89
|
-
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
90
|
-
} & Readonly<{
|
|
91
|
-
disabled: boolean;
|
|
92
|
-
columns: number;
|
|
93
|
-
}> & Omit<Readonly<{
|
|
94
|
-
fields: FieldDef[];
|
|
95
|
-
formData: Record<string, unknown>;
|
|
96
|
-
isEditing: boolean;
|
|
97
|
-
disabled?: boolean;
|
|
98
|
-
columns?: number;
|
|
99
|
-
}> & Readonly<{
|
|
100
|
-
"onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
101
|
-
}>, ("disabled" | "columns") | "validateAll" | "clearErrors"> & {
|
|
102
|
-
validateAll: () => string[];
|
|
103
|
-
clearErrors: () => void;
|
|
104
|
-
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
105
|
-
$slots: Partial<Record<`field-${string}`, (_: {
|
|
106
|
-
field: FieldDef;
|
|
107
|
-
formData: Record<string, unknown>;
|
|
108
|
-
isEditing: boolean;
|
|
109
|
-
setFormField: (f: string, v: unknown) => void;
|
|
110
|
-
}) => any>> & Partial<Record<`image-${string}`, (_: {
|
|
111
|
-
field: FieldDef;
|
|
112
|
-
formData: Record<string, unknown>;
|
|
113
|
-
}) => any>>;
|
|
114
|
-
}) | null;
|
|
115
|
-
};
|
|
116
|
-
rootEl: any;
|
|
117
|
-
};
|
|
1
|
+
declare function __VLS_template(): any;
|
|
118
2
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
119
|
-
declare const __VLS_component:
|
|
120
|
-
"update:visible": (value: boolean) => any;
|
|
121
|
-
"update:field": (field: string, value: unknown) => any;
|
|
122
|
-
save: () => any;
|
|
123
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
124
|
-
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
125
|
-
"onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
126
|
-
onSave?: (() => any) | undefined;
|
|
127
|
-
}>, {
|
|
128
|
-
disabled: boolean;
|
|
129
|
-
width: string;
|
|
130
|
-
formColumns: number;
|
|
131
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
132
|
-
rendererRef: ({
|
|
133
|
-
$: import('vue').ComponentInternalInstance;
|
|
134
|
-
$data: {};
|
|
135
|
-
$props: {
|
|
136
|
-
readonly fields: FieldDef[];
|
|
137
|
-
readonly formData: Record<string, unknown>;
|
|
138
|
-
readonly isEditing: boolean;
|
|
139
|
-
readonly disabled?: boolean | undefined;
|
|
140
|
-
readonly columns?: number | undefined;
|
|
141
|
-
readonly "onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
142
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
143
|
-
$attrs: import('vue').Attrs;
|
|
144
|
-
$refs: {
|
|
145
|
-
[x: string]: unknown;
|
|
146
|
-
};
|
|
147
|
-
$slots: Readonly<{
|
|
148
|
-
[name: string]: import('vue').Slot<any> | undefined;
|
|
149
|
-
}>;
|
|
150
|
-
$root: import('vue').ComponentPublicInstance | null;
|
|
151
|
-
$parent: import('vue').ComponentPublicInstance | null;
|
|
152
|
-
$host: Element | null;
|
|
153
|
-
$emit: (event: "update:field", field: string, value: unknown) => void;
|
|
154
|
-
$el: HTMLDivElement;
|
|
155
|
-
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
156
|
-
fields: FieldDef[];
|
|
157
|
-
formData: Record<string, unknown>;
|
|
158
|
-
isEditing: boolean;
|
|
159
|
-
disabled?: boolean;
|
|
160
|
-
columns?: number;
|
|
161
|
-
}> & Readonly<{
|
|
162
|
-
"onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
163
|
-
}>, {
|
|
164
|
-
validateAll: () => string[];
|
|
165
|
-
clearErrors: () => void;
|
|
166
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
167
|
-
"update:field": (field: string, value: unknown) => any;
|
|
168
|
-
}, string, {
|
|
169
|
-
disabled: boolean;
|
|
170
|
-
columns: number;
|
|
171
|
-
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
172
|
-
beforeCreate?: (() => void) | (() => void)[];
|
|
173
|
-
created?: (() => void) | (() => void)[];
|
|
174
|
-
beforeMount?: (() => void) | (() => void)[];
|
|
175
|
-
mounted?: (() => void) | (() => void)[];
|
|
176
|
-
beforeUpdate?: (() => void) | (() => void)[];
|
|
177
|
-
updated?: (() => void) | (() => void)[];
|
|
178
|
-
activated?: (() => void) | (() => void)[];
|
|
179
|
-
deactivated?: (() => void) | (() => void)[];
|
|
180
|
-
beforeDestroy?: (() => void) | (() => void)[];
|
|
181
|
-
beforeUnmount?: (() => void) | (() => void)[];
|
|
182
|
-
destroyed?: (() => void) | (() => void)[];
|
|
183
|
-
unmounted?: (() => void) | (() => void)[];
|
|
184
|
-
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
185
|
-
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
186
|
-
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
187
|
-
};
|
|
188
|
-
$forceUpdate: () => void;
|
|
189
|
-
$nextTick: typeof import('vue').nextTick;
|
|
190
|
-
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
191
|
-
} & Readonly<{
|
|
192
|
-
disabled: boolean;
|
|
193
|
-
columns: number;
|
|
194
|
-
}> & Omit<Readonly<{
|
|
195
|
-
fields: FieldDef[];
|
|
196
|
-
formData: Record<string, unknown>;
|
|
197
|
-
isEditing: boolean;
|
|
198
|
-
disabled?: boolean;
|
|
199
|
-
columns?: number;
|
|
200
|
-
}> & Readonly<{
|
|
201
|
-
"onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
202
|
-
}>, ("disabled" | "columns") | "validateAll" | "clearErrors"> & {
|
|
203
|
-
validateAll: () => string[];
|
|
204
|
-
clearErrors: () => void;
|
|
205
|
-
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
206
|
-
$slots: Partial<Record<`field-${string}`, (_: {
|
|
207
|
-
field: FieldDef;
|
|
208
|
-
formData: Record<string, unknown>;
|
|
209
|
-
isEditing: boolean;
|
|
210
|
-
setFormField: (f: string, v: unknown) => void;
|
|
211
|
-
}) => any>> & Partial<Record<`image-${string}`, (_: {
|
|
212
|
-
field: FieldDef;
|
|
213
|
-
formData: Record<string, unknown>;
|
|
214
|
-
}) => any>>;
|
|
215
|
-
}) | null;
|
|
216
|
-
}, any>;
|
|
3
|
+
declare const __VLS_component: any;
|
|
217
4
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
218
5
|
export default _default;
|
|
219
6
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CrudManagerReturn } from '../../types/manager';
|
|
2
|
-
import { FieldDef } from '../../types/field';
|
|
3
2
|
import { KpiItem } from '../../types/kpi';
|
|
4
3
|
type __VLS_Props = {
|
|
5
4
|
crud: CrudManagerReturn<any>;
|
|
@@ -39,12 +38,7 @@ declare function __VLS_template(): {
|
|
|
39
38
|
}) => any>> & Partial<Record<`column-${string}`, (_: {
|
|
40
39
|
data: any;
|
|
41
40
|
value: any;
|
|
42
|
-
}) => any>> & Partial<Record<`field-${string}`, (_: {
|
|
43
|
-
field: FieldDef;
|
|
44
|
-
formData: Record<string, unknown>;
|
|
45
|
-
isEditing: boolean;
|
|
46
|
-
setFormField: (f: string, v: unknown) => void;
|
|
47
|
-
}) => any>> & {
|
|
41
|
+
}) => any>> & Partial<Record<`field-${string}`, (_: any) => any>> & {
|
|
48
42
|
'header-actions'?(_: {}): any;
|
|
49
43
|
'before-table'?(_: {}): any;
|
|
50
44
|
'bulk-actions'?(_: {
|
|
@@ -104,9 +98,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
104
98
|
onPrint?: ((data: Record<string, unknown>) => any) | undefined;
|
|
105
99
|
}>, {
|
|
106
100
|
dialogWidth: string;
|
|
107
|
-
contextMenu: boolean;
|
|
108
|
-
showHeader: boolean;
|
|
109
101
|
showSearch: boolean;
|
|
102
|
+
showHeader: boolean;
|
|
110
103
|
autoInit: boolean;
|
|
111
104
|
showKpi: boolean;
|
|
112
105
|
kpiIcon: string;
|
|
@@ -117,6 +110,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
117
110
|
defaultView: "table" | "cards";
|
|
118
111
|
cardFields: number;
|
|
119
112
|
actionRail: boolean;
|
|
113
|
+
contextMenu: boolean;
|
|
120
114
|
showPrint: boolean;
|
|
121
115
|
exportCsv: boolean;
|
|
122
116
|
csvFilename: string;
|
|
@@ -51,5 +51,5 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
51
51
|
canEdit: boolean;
|
|
52
52
|
canDelete: boolean;
|
|
53
53
|
dialogWidth: string;
|
|
54
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false,
|
|
54
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, any, any>;
|
|
55
55
|
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DateValueFormat } from '../../composables/useDateInput';
|
|
2
|
+
/**
|
|
3
|
+
* Campo de data pt-BR padronizado.
|
|
4
|
+
* - Exibe `DD/MM/YYYY` (ou `DD/MM/YYYY HH:mm` com `showTime`) e salva `YYYY-MM-DD`.
|
|
5
|
+
* - Digitação direta com máscara: `30051988` vira `30/05/1988`.
|
|
6
|
+
* - Ícone de calendário abre o seletor (Hoje / Limpar).
|
|
7
|
+
* - `F2` preenche a data de hoje.
|
|
8
|
+
* - `autonow`: no mount, se o valor for `null`, preenche hoje; senão mantém.
|
|
9
|
+
*/
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
modelValue?: string | Date | null;
|
|
12
|
+
/** Formato do valor emitido: `'iso'` (YYYY-MM-DD, default) ou `'date'` (Date). */
|
|
13
|
+
valueFormat?: DateValueFormat;
|
|
14
|
+
showTime?: boolean;
|
|
15
|
+
/** No mount: se o valor for `null`, preenche a data de hoje. */
|
|
16
|
+
autonow?: boolean;
|
|
17
|
+
minDate?: string | Date;
|
|
18
|
+
maxDate?: string | Date;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
showClear?: boolean;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
invalid?: boolean;
|
|
23
|
+
inputId?: string;
|
|
24
|
+
};
|
|
25
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
|
+
"update:modelValue": (value: string | Date | null) => any;
|
|
27
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
|
+
"onUpdate:modelValue"?: ((value: string | Date | null) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
modelValue: string | Date | null;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
showClear: boolean;
|
|
33
|
+
valueFormat: DateValueFormat;
|
|
34
|
+
showTime: boolean;
|
|
35
|
+
autonow: boolean;
|
|
36
|
+
invalid: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
38
|
+
op: ({
|
|
39
|
+
$props: import('primevue/popover').PopoverProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
40
|
+
$slots: import('primevue/popover').PopoverSlots;
|
|
41
|
+
$emit: ((e: "show") => void) & ((e: "hide") => void);
|
|
42
|
+
} & import('primevue/popover').PopoverMethods) | null;
|
|
43
|
+
}, HTMLDivElement>;
|
|
44
|
+
export default _default;
|
|
@@ -1,41 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
fields: FieldDef[];
|
|
4
|
-
formData: Record<string, unknown>;
|
|
5
|
-
isEditing: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
/** Nº de colunas do grid (default 2). Campos ocupam frações via `colSpan`;
|
|
8
|
-
* grupos podem sobrepor via `fieldGroup.columns`. */
|
|
9
|
-
columns?: number;
|
|
10
|
-
};
|
|
11
|
-
declare function validateAll(): string[];
|
|
12
|
-
declare function clearErrors(): void;
|
|
13
|
-
declare function __VLS_template(): {
|
|
14
|
-
attrs: Partial<{}>;
|
|
15
|
-
slots: Partial<Record<`field-${string}`, (_: {
|
|
16
|
-
field: FieldDef;
|
|
17
|
-
formData: Record<string, unknown>;
|
|
18
|
-
isEditing: boolean;
|
|
19
|
-
setFormField: (f: string, v: unknown) => void;
|
|
20
|
-
}) => any>> & Partial<Record<`image-${string}`, (_: {
|
|
21
|
-
field: FieldDef;
|
|
22
|
-
formData: Record<string, unknown>;
|
|
23
|
-
}) => any>>;
|
|
24
|
-
refs: {};
|
|
25
|
-
rootEl: HTMLDivElement;
|
|
26
|
-
};
|
|
1
|
+
declare function __VLS_template(): any;
|
|
27
2
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
28
|
-
declare const __VLS_component:
|
|
29
|
-
validateAll: typeof validateAll;
|
|
30
|
-
clearErrors: typeof clearErrors;
|
|
31
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
32
|
-
"update:field": (field: string, value: unknown) => any;
|
|
33
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
-
"onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
35
|
-
}>, {
|
|
36
|
-
disabled: boolean;
|
|
37
|
-
columns: number;
|
|
38
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
3
|
+
declare const __VLS_component: any;
|
|
39
4
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
40
5
|
export default _default;
|
|
41
6
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -4,6 +4,7 @@ export { default as WCrudColumnRenderer } from './crud/WCrudColumnRenderer.vue';
|
|
|
4
4
|
export { default as WAutoCompleteFK } from './form/WAutoCompleteFK.vue';
|
|
5
5
|
export { default as WFormRenderer } from './form/WFormRenderer.vue';
|
|
6
6
|
export { default as WImageCropper } from './form/WImageCropper.vue';
|
|
7
|
+
export { default as WDatePicker } from './form/WDatePicker.vue';
|
|
7
8
|
export { default as WDateRange } from './form/WDateRange.vue';
|
|
8
9
|
export { default as WFileUpload } from './form/WFileUpload.vue';
|
|
9
10
|
export { default as WMoneyInput } from './form/WMoneyInput.vue';
|
package/dist/components.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./WProgressFlow.vue_vue_type_script_setup_true_lang-C9YG4BXB.cjs"),e=require("vue"),m=require("primevue/button"),g={class:"w-fileupload",style:{display:"flex","flex-direction":"column",gap:"0.5rem"}},W=["accept","multiple"],v={key:0,style:{"list-style":"none",margin:"0",padding:"0",display:"flex","flex-direction":"column",gap:"0.35rem"}},k={style:{flex:"1",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},B={style:{opacity:"0.6"}},x=e.defineComponent({__name:"WFileUpload",props:{modelValue:{default:null},multiple:{type:Boolean,default:!1},accept:{default:void 0},maxSize:{default:10485760},disabled:{type:Boolean,default:!1},chooseLabel:{default:"Selecionar arquivo"}},emits:["update:modelValue","error"],setup(a,{emit:p}){const o=a,s=p,d=e.ref(null),c=e.computed(()=>{const l=o.modelValue;return l?Array.isArray(l)?l:[l]:[]});function f(){var l;(l=d.value)==null||l.click()}function _(l){const n=l.target,r=Array.from(n.files||[]);n.value="";const i=[];for(const u of r){if(u.size>o.maxSize){s("error",`"${u.name}" acima do limite de ${(o.maxSize/1048576).toFixed(1)}MB.`);continue}i.push(u)}i.length&&s("update:modelValue",o.multiple?[...c.value,...i]:i[0])}function y(l){if(!o.multiple){s("update:modelValue",null);return}const n=c.value.slice();n.splice(l,1),s("update:modelValue",n.length?n:null)}function $(l){return l<1024?`${l} B`:l<1048576?`${(l/1024).toFixed(0)} KB`:`${(l/1048576).toFixed(1)} MB`}return(l,n)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",null,[e.createVNode(e.unref(m),{type:"button",label:a.chooseLabel,icon:"pi pi-upload",outlined:"",size:"small",disabled:a.disabled,onClick:f},null,8,["label","disabled"])]),e.createElementVNode("input",{ref_key:"input",ref:d,type:"file",accept:a.accept,multiple:a.multiple,style:{display:"none"},onChange:_},null,40,W),c.value.length?(e.openBlock(),e.createElementBlock("ul",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(r,i)=>(e.openBlock(),e.createElementBlock("li",{key:`${r.name}-${i}`,style:{display:"flex","align-items":"center",gap:"0.5rem","font-size":"0.85rem"}},[n[0]||(n[0]=e.createElementVNode("i",{class:"pi pi-file",style:{opacity:"0.6"}},null,-1)),e.createElementVNode("span",k,e.toDisplayString(r.name),1),e.createElementVNode("span",B,e.toDisplayString($(r.size)),1),e.createVNode(e.unref(m),{type:"button",icon:"pi pi-times",text:"",rounded:"",size:"small",severity:"danger",disabled:a.disabled,onClick:u=>y(i)},null,8,["disabled","onClick"])]))),128))])):e.renderSlot(l.$slots,"empty",{},()=>[n[1]||(n[1]=e.createElementVNode("span",{style:{"font-size":"0.8rem",opacity:"0.6"}},"Nenhum arquivo selecionado",-1))],void 0,1)]))}});exports.WActionBar=t._sfc_main;exports.WAutoCompleteFK=t._sfc_main$1;exports.WCrudColumnRenderer=t._sfc_main$2;exports.WCrudFormDialog=t._sfc_main$3;exports.WCrudView=t._sfc_main$4;exports.WDatePicker=t._sfc_main$5;exports.WDateRange=t._sfc_main$6;exports.WDetailHeader=t._sfc_main$7;exports.WEmptyState=t._sfc_main$8;exports.WFormRenderer=t._sfc_main$9;exports.WFormSection=t._sfc_main$10;exports.WImageCropper=t.WImageCropper;exports.WInfoCard=t._sfc_main$11;exports.WKpiCard=t._sfc_main$12;exports.WKpiGrid=t._sfc_main$13;exports.WMoneyInput=t._sfc_main$14;exports.WPageHeader=t._sfc_main$15;exports.WProgressFlow=t._sfc_main$16;exports.WSectionHeader=t._sfc_main$17;exports.WStatusTag=t._sfc_main$18;exports.WTransferList=t._sfc_main$19;exports.WFileUpload=x;
|
|
2
2
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.cjs","sources":["../src/components/form/
|
|
1
|
+
{"version":3,"file":"components.cjs","sources":["../src/components/form/WFileUpload.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\nimport Button from 'primevue/button'\n\n/**\n * Upload de arquivo(s) genérico (single ou multiple), sem dependência pesada.\n * O `v-model` guarda `File` (single) ou `File[]` (multiple). Valida tamanho por\n * arquivo e emite `error` para os que excederem.\n */\nconst props = withDefaults(\n defineProps<{\n modelValue?: File | File[] | null\n multiple?: boolean\n accept?: string\n /** Tamanho máximo por arquivo em bytes (default 10MB). */\n maxSize?: number\n disabled?: boolean\n chooseLabel?: string\n }>(),\n {\n modelValue: null,\n multiple: false,\n accept: undefined,\n maxSize: 10_485_760,\n disabled: false,\n chooseLabel: 'Selecionar arquivo',\n },\n)\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: File | File[] | null]\n error: [message: string]\n}>()\n\nconst input = ref<HTMLInputElement | null>(null)\nconst files = computed<File[]>(() => {\n const v = props.modelValue\n if (!v) return []\n return Array.isArray(v) ? v : [v]\n})\n\nfunction open() {\n input.value?.click()\n}\n\nfunction onChange(e: Event) {\n const el = e.target as HTMLInputElement\n const picked = Array.from(el.files || [])\n el.value = ''\n const valid: File[] = []\n for (const f of picked) {\n if (f.size > props.maxSize) {\n emit('error', `\"${f.name}\" acima do limite de ${(props.maxSize / 1_048_576).toFixed(1)}MB.`)\n continue\n }\n valid.push(f)\n }\n if (!valid.length) return\n emit('update:modelValue', props.multiple ? [...files.value, ...valid] : valid[0])\n}\n\nfunction removeAt(i: number) {\n if (!props.multiple) {\n emit('update:modelValue', null)\n return\n }\n const next = files.value.slice()\n next.splice(i, 1)\n emit('update:modelValue', next.length ? next : null)\n}\n\nfunction fmtSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`\n if (bytes < 1_048_576) return `${(bytes / 1024).toFixed(0)} KB`\n return `${(bytes / 1_048_576).toFixed(1)} MB`\n}\n</script>\n\n<template>\n <div class=\"w-fileupload\" style=\"display: flex; flex-direction: column; gap: 0.5rem\">\n <div>\n <Button\n type=\"button\"\n :label=\"chooseLabel\"\n icon=\"pi pi-upload\"\n outlined\n size=\"small\"\n :disabled=\"disabled\"\n @click=\"open\"\n />\n </div>\n <input\n ref=\"input\"\n type=\"file\"\n :accept=\"accept\"\n :multiple=\"multiple\"\n style=\"display: none\"\n @change=\"onChange\"\n />\n <ul\n v-if=\"files.length\"\n style=\"\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 0.35rem;\n \"\n >\n <li\n v-for=\"(f, i) in files\"\n :key=\"`${f.name}-${i}`\"\n style=\"display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem\"\n >\n <i class=\"pi pi-file\" style=\"opacity: 0.6\" />\n <span style=\"flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap\">\n {{ f.name }}\n </span>\n <span style=\"opacity: 0.6\">{{ fmtSize(f.size) }}</span>\n <Button\n type=\"button\"\n icon=\"pi pi-times\"\n text\n rounded\n size=\"small\"\n severity=\"danger\"\n :disabled=\"disabled\"\n @click=\"removeAt(i)\"\n />\n </li>\n </ul>\n <slot v-else name=\"empty\">\n <span style=\"font-size: 0.8rem; opacity: 0.6\">Nenhum arquivo selecionado</span>\n </slot>\n </div>\n</template>\n"],"names":["props","__props","emit","__emit","input","ref","files","computed","v","open","_a","onChange","e","el","picked","valid","f","removeAt","i","next","fmtSize","bytes","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_createVNode","_unref","Button","_hoisted_3","_Fragment","_renderList","_hoisted_4","_toDisplayString","_hoisted_5","$event","_renderSlot","_ctx","_cache"],"mappings":"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"}
|