@wgalleti/primevue-components 0.6.1 → 0.8.0
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/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-BS3zNV1Z.js +3126 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-BS3zNV1Z.js.map +1 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-DlnsDNZ5.cjs +12 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-DlnsDNZ5.cjs.map +1 -0
- package/dist/components/crud/WCrudColumnRenderer.vue.d.ts +1 -1
- package/dist/components/crud/WCrudFormDialog.vue.d.ts +7 -11
- package/dist/components/crud/WCrudView.vue.d.ts +21 -2
- package/dist/components/form/WAutoCompleteFK.vue.d.ts +2 -1
- package/dist/components/form/WDateRange.vue.d.ts +23 -0
- package/dist/components/form/WFileUpload.vue.d.ts +48 -0
- package/dist/components/form/WFormRenderer.vue.d.ts +1 -1
- package/dist/components/form/WImageCropper.vue.d.ts +57 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/ui/WKpiGrid.vue.d.ts +1 -1
- package/dist/components.cjs +2 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.d.ts +2 -0
- package/dist/components.js +156 -0
- package/dist/components.js.map +1 -0
- package/dist/composables/defineCrudConfig.d.ts +18 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/useCrudManager.d.ts +1 -1
- package/dist/composables.cjs +2 -0
- package/dist/composables.cjs.map +1 -0
- package/dist/composables.d.ts +2 -0
- package/dist/composables.js +16 -0
- package/dist/composables.js.map +1 -0
- package/dist/index.cjs +1 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +122 -3542
- package/dist/index.js.map +1 -1
- package/dist/plugin-BKa0eSEM.js +7 -0
- package/dist/plugin-BKa0eSEM.js.map +1 -0
- package/dist/plugin-D1YvyKXX.cjs +2 -0
- package/dist/plugin-D1YvyKXX.cjs.map +1 -0
- package/dist/primevue-components.css +1 -1
- package/dist/types/action.d.ts +19 -0
- package/dist/types/column.d.ts +30 -0
- package/dist/types/componentMeta.d.ts +33 -0
- package/dist/types/field.d.ts +95 -0
- package/dist/types/index.d.ts +11 -14
- package/dist/types/kpi.d.ts +13 -0
- package/dist/types/labels.d.ts +17 -0
- package/dist/types/manager.d.ts +98 -0
- package/dist/types/plugin.d.ts +24 -2
- package/dist/types.cjs +2 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +23 -0
- package/dist/types.js.map +1 -0
- package/dist/useApi-5Pr4nXAa.cjs +2 -0
- package/dist/useApi-5Pr4nXAa.cjs.map +1 -0
- package/dist/useApi-Bxrw3Sia.js +395 -0
- package/dist/useApi-Bxrw3Sia.js.map +1 -0
- package/dist/useApiError-BEbEk2Kq.cjs +3 -0
- package/dist/useApiError-BEbEk2Kq.cjs.map +1 -0
- package/dist/useApiError-C7rPzGrF.js +375 -0
- package/dist/useApiError-C7rPzGrF.js.map +1 -0
- package/dist/utils/csv.d.ts +1 -1
- package/dist/utils/fieldMapper.d.ts +2 -1
- package/package.json +49 -12
- package/dist/types/components/crud/WCrudColumnRenderer.vue.d.ts +0 -8
- package/dist/types/components/crud/WCrudFormDialog.vue.d.ts +0 -52
- package/dist/types/components/crud/WCrudView.vue.d.ts +0 -127
- package/dist/types/components/form/WAutoCompleteFK.vue.d.ts +0 -54
- package/dist/types/components/form/WFormRenderer.vue.d.ts +0 -44
- package/dist/types/components/form/WMoneyInput.vue.d.ts +0 -28
- package/dist/types/components/form/WTransferList.vue.d.ts +0 -25
- package/dist/types/components/index.d.ts +0 -18
- package/dist/types/components/ui/WActionBar.vue.d.ts +0 -25
- package/dist/types/components/ui/WDetailHeader.vue.d.ts +0 -24
- package/dist/types/components/ui/WEmptyState.vue.d.ts +0 -13
- package/dist/types/components/ui/WFormSection.vue.d.ts +0 -19
- package/dist/types/components/ui/WInfoCard.vue.d.ts +0 -11
- package/dist/types/components/ui/WKpiCard.vue.d.ts +0 -32
- package/dist/types/components/ui/WKpiGrid.vue.d.ts +0 -31
- package/dist/types/components/ui/WPageHeader.vue.d.ts +0 -22
- package/dist/types/components/ui/WProgressFlow.vue.d.ts +0 -28
- package/dist/types/components/ui/WSectionHeader.vue.d.ts +0 -22
- package/dist/types/components/ui/WStatusTag.vue.d.ts +0 -10
- package/dist/types/composables/index.d.ts +0 -6
- package/dist/types/composables/useApi.d.ts +0 -2
- package/dist/types/composables/useApiError.d.ts +0 -4
- package/dist/types/composables/useAppConfirm.d.ts +0 -4
- package/dist/types/composables/useAppToast.d.ts +0 -6
- package/dist/types/composables/useCrudManager.d.ts +0 -2
- package/dist/types/composables/useFormatters.d.ts +0 -19
- package/dist/types/crud.d.ts +0 -221
- package/dist/types/data-providers/axiosDataProvider.d.ts +0 -3
- package/dist/types/data-providers/index.d.ts +0 -2
- package/dist/types/data-providers/supabaseDataProvider.d.ts +0 -54
- package/dist/types/types/api.d.ts +0 -60
- package/dist/types/types/crud.d.ts +0 -221
- package/dist/types/types/dataProvider.d.ts +0 -28
- package/dist/types/types/index.d.ts +0 -6
- package/dist/types/types/plugin.d.ts +0 -24
- package/dist/types/utils/cep.d.ts +0 -14
- package/dist/types/utils/csv.d.ts +0 -13
- package/dist/types/utils/dates.d.ts +0 -5
- package/dist/types/utils/fieldMapper.d.ts +0 -20
- package/dist/types/utils/masks.d.ts +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldDef } from '../../types/
|
|
1
|
+
import { FieldDef } from '../../types/field';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
visible: boolean;
|
|
4
4
|
title: string;
|
|
@@ -39,9 +39,7 @@ declare function __VLS_template(): {
|
|
|
39
39
|
readonly columns?: number | undefined;
|
|
40
40
|
readonly "onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
41
41
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
42
|
-
$attrs:
|
|
43
|
-
[x: string]: unknown;
|
|
44
|
-
};
|
|
42
|
+
$attrs: import('vue').Attrs;
|
|
45
43
|
$refs: {
|
|
46
44
|
[x: string]: unknown;
|
|
47
45
|
};
|
|
@@ -100,10 +98,10 @@ declare function __VLS_template(): {
|
|
|
100
98
|
columns?: number;
|
|
101
99
|
}> & Readonly<{
|
|
102
100
|
"onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
103
|
-
}>, ("disabled" | "columns") | "validateAll" | "clearErrors"> &
|
|
101
|
+
}>, ("disabled" | "columns") | "validateAll" | "clearErrors"> & {
|
|
104
102
|
validateAll: () => string[];
|
|
105
103
|
clearErrors: () => void;
|
|
106
|
-
}
|
|
104
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
107
105
|
$slots: Partial<Record<`field-${string}`, (_: {
|
|
108
106
|
field: FieldDef;
|
|
109
107
|
formData: Record<string, unknown>;
|
|
@@ -142,9 +140,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
142
140
|
readonly columns?: number | undefined;
|
|
143
141
|
readonly "onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
144
142
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
145
|
-
$attrs:
|
|
146
|
-
[x: string]: unknown;
|
|
147
|
-
};
|
|
143
|
+
$attrs: import('vue').Attrs;
|
|
148
144
|
$refs: {
|
|
149
145
|
[x: string]: unknown;
|
|
150
146
|
};
|
|
@@ -203,10 +199,10 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
203
199
|
columns?: number;
|
|
204
200
|
}> & Readonly<{
|
|
205
201
|
"onUpdate:field"?: ((field: string, value: unknown) => any) | undefined;
|
|
206
|
-
}>, ("disabled" | "columns") | "validateAll" | "clearErrors"> &
|
|
202
|
+
}>, ("disabled" | "columns") | "validateAll" | "clearErrors"> & {
|
|
207
203
|
validateAll: () => string[];
|
|
208
204
|
clearErrors: () => void;
|
|
209
|
-
}
|
|
205
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
210
206
|
$slots: Partial<Record<`field-${string}`, (_: {
|
|
211
207
|
field: FieldDef;
|
|
212
208
|
formData: Record<string, unknown>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { CrudManagerReturn
|
|
1
|
+
import { CrudManagerReturn } from '../../types/manager';
|
|
2
|
+
import { FieldDef } from '../../types/field';
|
|
3
|
+
import { KpiItem } from '../../types/kpi';
|
|
2
4
|
type __VLS_Props = {
|
|
3
5
|
crud: CrudManagerReturn<any>;
|
|
4
6
|
title: string;
|
|
@@ -25,6 +27,9 @@ type __VLS_Props = {
|
|
|
25
27
|
csvFilename?: string;
|
|
26
28
|
csvScope?: 'all' | 'page';
|
|
27
29
|
csvPageSize?: number;
|
|
30
|
+
/** Chave de persistência do estado de coluna (visibilidade) em localStorage.
|
|
31
|
+
* Opt-in: quando definida, exibe o seletor de colunas e persiste o que foi ocultado. */
|
|
32
|
+
persistState?: string;
|
|
28
33
|
};
|
|
29
34
|
declare function __VLS_template(): {
|
|
30
35
|
attrs: Partial<{}>;
|
|
@@ -35,13 +40,17 @@ declare function __VLS_template(): {
|
|
|
35
40
|
data: any;
|
|
36
41
|
value: any;
|
|
37
42
|
}) => any>> & Partial<Record<`field-${string}`, (_: {
|
|
38
|
-
field:
|
|
43
|
+
field: FieldDef;
|
|
39
44
|
formData: Record<string, unknown>;
|
|
40
45
|
isEditing: boolean;
|
|
41
46
|
setFormField: (f: string, v: unknown) => void;
|
|
42
47
|
}) => any>> & {
|
|
43
48
|
'header-actions'?(_: {}): any;
|
|
44
49
|
'before-table'?(_: {}): any;
|
|
50
|
+
'bulk-actions'?(_: {
|
|
51
|
+
selected: any[];
|
|
52
|
+
crud: CrudManagerReturn<any>;
|
|
53
|
+
}): any;
|
|
45
54
|
'toolbar-start'?(_: {}): any;
|
|
46
55
|
'toolbar-start'?(_: {}): any;
|
|
47
56
|
'toolbar-filters'?(_: {}): any;
|
|
@@ -71,6 +80,11 @@ declare function __VLS_template(): {
|
|
|
71
80
|
}): any;
|
|
72
81
|
};
|
|
73
82
|
refs: {
|
|
83
|
+
chooser: ({
|
|
84
|
+
$props: import('primevue/popover').PopoverProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
85
|
+
$slots: import('primevue/popover').PopoverSlots;
|
|
86
|
+
$emit: ((e: "show") => void) & ((e: "hide") => void);
|
|
87
|
+
} & import('primevue/popover').PopoverMethods) | null;
|
|
74
88
|
cm: ({
|
|
75
89
|
$props: import('primevue/contextmenu').ContextMenuProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
76
90
|
$slots: import('primevue/contextmenu').ContextMenuSlots;
|
|
@@ -109,6 +123,11 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
109
123
|
csvScope: "all" | "page";
|
|
110
124
|
csvPageSize: number;
|
|
111
125
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
126
|
+
chooser: ({
|
|
127
|
+
$props: import('primevue/popover').PopoverProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
128
|
+
$slots: import('primevue/popover').PopoverSlots;
|
|
129
|
+
$emit: ((e: "show") => void) & ((e: "hide") => void);
|
|
130
|
+
} & import('primevue/popover').PopoverMethods) | null;
|
|
112
131
|
cm: ({
|
|
113
132
|
$props: import('primevue/contextmenu').ContextMenuProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
114
133
|
$slots: import('primevue/contextmenu').ContextMenuSlots;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seletor de intervalo de datas (período). Wrapper fino do DatePicker em modo
|
|
3
|
+
* range com padrões pt-BR. O `v-model` guarda `[início, fim]` como `Date[]`.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
modelValue?: Date[] | null;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
minDate?: Date;
|
|
9
|
+
maxDate?: Date;
|
|
10
|
+
showButtonBar?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: Date[] | null) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: Date[] | null) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
modelValue: Date[] | null;
|
|
19
|
+
placeholder: string;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
showButtonBar: boolean;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upload de arquivo(s) genérico (single ou multiple), sem dependência pesada.
|
|
3
|
+
* O `v-model` guarda `File` (single) ou `File[]` (multiple). Valida tamanho por
|
|
4
|
+
* arquivo e emite `error` para os que excederem.
|
|
5
|
+
*/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
modelValue?: File | File[] | null;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
accept?: string;
|
|
10
|
+
/** Tamanho máximo por arquivo em bytes (default 10MB). */
|
|
11
|
+
maxSize?: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
chooseLabel?: string;
|
|
14
|
+
};
|
|
15
|
+
declare function __VLS_template(): {
|
|
16
|
+
attrs: Partial<{}>;
|
|
17
|
+
slots: {
|
|
18
|
+
empty?(_: {}): any;
|
|
19
|
+
};
|
|
20
|
+
refs: {
|
|
21
|
+
input: HTMLInputElement;
|
|
22
|
+
};
|
|
23
|
+
rootEl: HTMLDivElement;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
26
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
27
|
+
error: (message: string) => any;
|
|
28
|
+
"update:modelValue": (value: File | File[] | null) => any;
|
|
29
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
onError?: ((message: string) => any) | undefined;
|
|
31
|
+
"onUpdate:modelValue"?: ((value: File | File[] | null) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
modelValue: File | File[] | null;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
accept: string;
|
|
36
|
+
maxSize: number;
|
|
37
|
+
multiple: boolean;
|
|
38
|
+
chooseLabel: string;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
40
|
+
input: HTMLInputElement;
|
|
41
|
+
}, HTMLDivElement>;
|
|
42
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upload de imagem com preview e crop (pan + zoom) integrado.
|
|
3
|
+
* Sem dependência externa — o recorte é feito via <canvas>.
|
|
4
|
+
* Emite um `File` recortado (ou `null`), consumível direto pelo
|
|
5
|
+
* `useCrudManager`, que detecta campos de imagem e envia como multipart.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
modelValue?: File | string | null;
|
|
9
|
+
accept?: string;
|
|
10
|
+
/** Tamanho máximo em bytes (default 5MB). */
|
|
11
|
+
maxSize?: number;
|
|
12
|
+
/** Proporção do recorte (1 = quadrado). Ignorado quando `circular`. */
|
|
13
|
+
aspectRatio?: number;
|
|
14
|
+
/** Stencil circular (avatar). Força proporção 1 e saída PNG com alpha. */
|
|
15
|
+
circular?: boolean;
|
|
16
|
+
/** Dimensões do preview em px. */
|
|
17
|
+
width?: number;
|
|
18
|
+
height?: number;
|
|
19
|
+
};
|
|
20
|
+
declare function openPicker(): void;
|
|
21
|
+
declare function __VLS_template(): {
|
|
22
|
+
attrs: Partial<{}>;
|
|
23
|
+
slots: {
|
|
24
|
+
placeholder?(_: {
|
|
25
|
+
open: typeof openPicker;
|
|
26
|
+
}): any;
|
|
27
|
+
};
|
|
28
|
+
refs: {
|
|
29
|
+
fileInput: HTMLInputElement;
|
|
30
|
+
};
|
|
31
|
+
rootEl: HTMLDivElement;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
34
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
35
|
+
error: (message: string) => any;
|
|
36
|
+
"update:modelValue": (value: File | null) => any;
|
|
37
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
38
|
+
onError?: ((message: string) => any) | undefined;
|
|
39
|
+
"onUpdate:modelValue"?: ((value: File | null) => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
modelValue: File | string | null;
|
|
42
|
+
width: number;
|
|
43
|
+
accept: string;
|
|
44
|
+
maxSize: number;
|
|
45
|
+
aspectRatio: number;
|
|
46
|
+
circular: boolean;
|
|
47
|
+
height: number;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
49
|
+
fileInput: HTMLInputElement;
|
|
50
|
+
}, HTMLDivElement>;
|
|
51
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
52
|
+
export default _default;
|
|
53
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
54
|
+
new (): {
|
|
55
|
+
$slots: S;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -3,6 +3,9 @@ export { default as WCrudFormDialog } from './crud/WCrudFormDialog.vue';
|
|
|
3
3
|
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
|
+
export { default as WImageCropper } from './form/WImageCropper.vue';
|
|
7
|
+
export { default as WDateRange } from './form/WDateRange.vue';
|
|
8
|
+
export { default as WFileUpload } from './form/WFileUpload.vue';
|
|
6
9
|
export { default as WMoneyInput } from './form/WMoneyInput.vue';
|
|
7
10
|
export { default as WTransferList } from './form/WTransferList.vue';
|
|
8
11
|
export { default as WStatusTag } from './ui/WStatusTag.vue';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./WProgressFlow.vue_vue_type_script_setup_true_lang-DlnsDNZ5.cjs"),e=require("vue"),$=require("primevue/datepicker"),p=require("primevue/button"),v=e.defineComponent({__name:"WDateRange",props:{modelValue:{default:null},placeholder:{default:"Selecione o período"},minDate:{},maxDate:{},showButtonBar:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(a,{emit:m}){const o=m;function r(d){o("update:modelValue",d??null)}return(d,u)=>(e.openBlock(),e.createBlock(e.unref($),{"model-value":a.modelValue??void 0,"selection-mode":"range",placeholder:a.placeholder,"min-date":a.minDate,"max-date":a.maxDate,"show-button-bar":a.showButtonBar,disabled:a.disabled,"date-format":"dd/mm/yy",fluid:"","onUpdate:modelValue":r},null,8,["model-value","placeholder","min-date","max-date","show-button-bar","disabled"]))}}),W={class:"w-fileupload",style:{display:"flex","flex-direction":"column",gap:"0.5rem"}},B=["accept","multiple"],h={key:0,style:{"list-style":"none",margin:"0",padding:"0",display:"flex","flex-direction":"column",gap:"0.35rem"}},x={style:{flex:"1",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},V={style:{opacity:"0.6"}},b=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:m}){const o=a,r=m,d=e.ref(null),u=e.computed(()=>{const t=o.modelValue;return t?Array.isArray(t)?t:[t]:[]});function f(){var t;(t=d.value)==null||t.click()}function _(t){const n=t.target,s=Array.from(n.files||[]);n.value="";const i=[];for(const c of s){if(c.size>o.maxSize){r("error",`"${c.name}" acima do limite de ${(o.maxSize/1048576).toFixed(1)}MB.`);continue}i.push(c)}i.length&&r("update:modelValue",o.multiple?[...u.value,...i]:i[0])}function y(t){if(!o.multiple){r("update:modelValue",null);return}const n=u.value.slice();n.splice(t,1),r("update:modelValue",n.length?n:null)}function g(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(0)} KB`:`${(t/1048576).toFixed(1)} MB`}return(t,n)=>(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",null,[e.createVNode(e.unref(p),{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,B),u.value.length?(e.openBlock(),e.createElementBlock("ul",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(s,i)=>(e.openBlock(),e.createElementBlock("li",{key:`${s.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",x,e.toDisplayString(s.name),1),e.createElementVNode("span",V,e.toDisplayString(g(s.size)),1),e.createVNode(e.unref(p),{type:"button",icon:"pi pi-times",text:"",rounded:"",size:"small",severity:"danger",disabled:a.disabled,onClick:c=>y(i)},null,8,["disabled","onClick"])]))),128))])):e.renderSlot(t.$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=l._sfc_main;exports.WAutoCompleteFK=l._sfc_main$1;exports.WCrudColumnRenderer=l._sfc_main$2;exports.WCrudFormDialog=l._sfc_main$3;exports.WCrudView=l._sfc_main$4;exports.WDetailHeader=l._sfc_main$5;exports.WEmptyState=l._sfc_main$6;exports.WFormRenderer=l._sfc_main$7;exports.WFormSection=l._sfc_main$8;exports.WImageCropper=l.WImageCropper;exports.WInfoCard=l._sfc_main$9;exports.WKpiCard=l._sfc_main$10;exports.WKpiGrid=l._sfc_main$11;exports.WMoneyInput=l._sfc_main$12;exports.WPageHeader=l._sfc_main$13;exports.WProgressFlow=l._sfc_main$14;exports.WSectionHeader=l._sfc_main$15;exports.WStatusTag=l._sfc_main$16;exports.WTransferList=l._sfc_main$17;exports.WDateRange=v;exports.WFileUpload=b;
|
|
2
|
+
//# sourceMappingURL=components.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.cjs","sources":["../src/components/form/WDateRange.vue","../src/components/form/WFileUpload.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport DatePicker from 'primevue/datepicker'\n\n/**\n * Seletor de intervalo de datas (período). Wrapper fino do DatePicker em modo\n * range com padrões pt-BR. O `v-model` guarda `[início, fim]` como `Date[]`.\n */\nwithDefaults(\n defineProps<{\n modelValue?: Date[] | null\n placeholder?: string\n minDate?: Date\n maxDate?: Date\n showButtonBar?: boolean\n disabled?: boolean\n }>(),\n {\n modelValue: null,\n placeholder: 'Selecione o período',\n showButtonBar: true,\n disabled: false,\n },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [value: Date[] | null] }>()\n\nfunction onUpdate(v: unknown) {\n emit('update:modelValue', (v as Date[] | null) ?? null)\n}\n</script>\n\n<template>\n <DatePicker\n :model-value=\"modelValue ?? undefined\"\n selection-mode=\"range\"\n :placeholder=\"placeholder\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n :show-button-bar=\"showButtonBar\"\n :disabled=\"disabled\"\n date-format=\"dd/mm/yy\"\n fluid\n @update:model-value=\"onUpdate\"\n />\n</template>\n","<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":["emit","__emit","onUpdate","v","_createBlock","_unref","DatePicker","__props","props","input","ref","files","computed","open","_a","onChange","e","el","picked","valid","f","removeAt","i","next","fmtSize","bytes","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_createVNode","Button","_hoisted_3","_Fragment","_renderList","_hoisted_4","_toDisplayString","_hoisted_5","$event","_renderSlot","_ctx","_cache"],"mappings":"yfAwBA,MAAMA,EAAOC,EAEb,SAASC,EAASC,EAAY,CAC5BH,EAAK,oBAAsBG,GAAuB,IAAI,CACxD,6BAIEC,EAAAA,YAWEC,EAAAA,MAAAC,CAAA,EAAA,CAVC,cAAaC,EAAA,YAAc,OAC5B,iBAAe,QACd,YAAaA,EAAA,YACb,WAAUA,EAAA,QACV,WAAUA,EAAA,QACV,kBAAiBA,EAAA,cACjB,SAAUA,EAAA,SACX,cAAY,WACZ,MAAA,GACC,sBAAoBL,CAAA,2tBCjCzB,MAAMM,EAAQD,EAoBRP,EAAOC,EAKPQ,EAAQC,EAAAA,IAA6B,IAAI,EACzCC,EAAQC,EAAAA,SAAiB,IAAM,CACnC,MAAMT,EAAIK,EAAM,WAChB,OAAKL,EACE,MAAM,QAAQA,CAAC,EAAIA,EAAI,CAACA,CAAC,EADjB,CAAA,CAEjB,CAAC,EAED,SAASU,GAAO,QACdC,EAAAL,EAAM,QAAN,MAAAK,EAAa,OACf,CAEA,SAASC,EAASC,EAAU,CAC1B,MAAMC,EAAKD,EAAE,OACPE,EAAS,MAAM,KAAKD,EAAG,OAAS,CAAA,CAAE,EACxCA,EAAG,MAAQ,GACX,MAAME,EAAgB,CAAA,EACtB,UAAWC,KAAKF,EAAQ,CACtB,GAAIE,EAAE,KAAOZ,EAAM,QAAS,CAC1BR,EAAK,QAAS,IAAIoB,EAAE,IAAI,yBAAyBZ,EAAM,QAAU,SAAW,QAAQ,CAAC,CAAC,KAAK,EAC3F,QACF,CACAW,EAAM,KAAKC,CAAC,CACd,CACKD,EAAM,QACXnB,EAAK,oBAAqBQ,EAAM,SAAW,CAAC,GAAGG,EAAM,MAAO,GAAGQ,CAAK,EAAIA,EAA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,EAAAA,gBADFhB,EAAE,IAAI,EAAA,CAAA,EAEXS,qBAAuD,OAAvDQ,EAAuDD,EAAAA,gBAAzBZ,EAAQJ,EAAE,IAAI,CAAA,EAAA,CAAA,EAC5CU,cASEzB,EAAAA,MAAA0B,CAAA,EAAA,CARA,KAAK,SACL,KAAK,cACL,KAAA,GACA,QAAA,GACA,KAAK,QACL,SAAS,SACR,SAAUxB,EAAA,SACV,QAAK+B,GAAEjB,EAAS,CAAC,CAAA,8CAIxBkB,EAAAA,WAEOC,oBAFP,IAEO,CADLC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAZ,EAAAA,mBAA+E,OAAA,CAAzE,MAAA,CAAA,YAAA,SAAA,QAAA,MAAA,EAAwC,6BAA0B,EAAA,EAAA"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { _ as N, a as P, b as T, c as j, d as G, e as J, f as O, g as Q, h as X, W as Y, i as Z, j as _, k as ee, l as le, m as te, n as ae, o as oe, p as ne, q as ie } from "./WProgressFlow.vue_vue_type_script_setup_true_lang-BS3zNV1Z.js";
|
|
2
|
+
import { defineComponent as h, openBlock as u, createBlock as V, unref as f, ref as k, computed as C, createElementBlock as c, createElementVNode as i, createVNode as y, Fragment as S, renderList as w, toDisplayString as W, renderSlot as F } from "vue";
|
|
3
|
+
import z from "primevue/datepicker";
|
|
4
|
+
import g from "primevue/button";
|
|
5
|
+
const E = /* @__PURE__ */ h({
|
|
6
|
+
__name: "WDateRange",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: { default: null },
|
|
9
|
+
placeholder: { default: "Selecione o período" },
|
|
10
|
+
minDate: {},
|
|
11
|
+
maxDate: {},
|
|
12
|
+
showButtonBar: { type: Boolean, default: !0 },
|
|
13
|
+
disabled: { type: Boolean, default: !1 }
|
|
14
|
+
},
|
|
15
|
+
emits: ["update:modelValue"],
|
|
16
|
+
setup(l, { emit: p }) {
|
|
17
|
+
const a = p;
|
|
18
|
+
function n(d) {
|
|
19
|
+
a("update:modelValue", d ?? null);
|
|
20
|
+
}
|
|
21
|
+
return (d, r) => (u(), V(f(z), {
|
|
22
|
+
"model-value": l.modelValue ?? void 0,
|
|
23
|
+
"selection-mode": "range",
|
|
24
|
+
placeholder: l.placeholder,
|
|
25
|
+
"min-date": l.minDate,
|
|
26
|
+
"max-date": l.maxDate,
|
|
27
|
+
"show-button-bar": l.showButtonBar,
|
|
28
|
+
disabled: l.disabled,
|
|
29
|
+
"date-format": "dd/mm/yy",
|
|
30
|
+
fluid: "",
|
|
31
|
+
"onUpdate:modelValue": n
|
|
32
|
+
}, null, 8, ["model-value", "placeholder", "min-date", "max-date", "show-button-bar", "disabled"]));
|
|
33
|
+
}
|
|
34
|
+
}), D = {
|
|
35
|
+
class: "w-fileupload",
|
|
36
|
+
style: { display: "flex", "flex-direction": "column", gap: "0.5rem" }
|
|
37
|
+
}, $ = ["accept", "multiple"], A = {
|
|
38
|
+
key: 0,
|
|
39
|
+
style: { "list-style": "none", margin: "0", padding: "0", display: "flex", "flex-direction": "column", gap: "0.35rem" }
|
|
40
|
+
}, K = { style: { flex: "1", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" } }, L = { style: { opacity: "0.6" } }, H = /* @__PURE__ */ h({
|
|
41
|
+
__name: "WFileUpload",
|
|
42
|
+
props: {
|
|
43
|
+
modelValue: { default: null },
|
|
44
|
+
multiple: { type: Boolean, default: !1 },
|
|
45
|
+
accept: { default: void 0 },
|
|
46
|
+
maxSize: { default: 10485760 },
|
|
47
|
+
disabled: { type: Boolean, default: !1 },
|
|
48
|
+
chooseLabel: { default: "Selecionar arquivo" }
|
|
49
|
+
},
|
|
50
|
+
emits: ["update:modelValue", "error"],
|
|
51
|
+
setup(l, { emit: p }) {
|
|
52
|
+
const a = l, n = p, d = k(null), r = C(() => {
|
|
53
|
+
const e = a.modelValue;
|
|
54
|
+
return e ? Array.isArray(e) ? e : [e] : [];
|
|
55
|
+
});
|
|
56
|
+
function v() {
|
|
57
|
+
var e;
|
|
58
|
+
(e = d.value) == null || e.click();
|
|
59
|
+
}
|
|
60
|
+
function x(e) {
|
|
61
|
+
const t = e.target, s = Array.from(t.files || []);
|
|
62
|
+
t.value = "";
|
|
63
|
+
const o = [];
|
|
64
|
+
for (const m of s) {
|
|
65
|
+
if (m.size > a.maxSize) {
|
|
66
|
+
n("error", `"${m.name}" acima do limite de ${(a.maxSize / 1048576).toFixed(1)}MB.`);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
o.push(m);
|
|
70
|
+
}
|
|
71
|
+
o.length && n("update:modelValue", a.multiple ? [...r.value, ...o] : o[0]);
|
|
72
|
+
}
|
|
73
|
+
function b(e) {
|
|
74
|
+
if (!a.multiple) {
|
|
75
|
+
n("update:modelValue", null);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const t = r.value.slice();
|
|
79
|
+
t.splice(e, 1), n("update:modelValue", t.length ? t : null);
|
|
80
|
+
}
|
|
81
|
+
function B(e) {
|
|
82
|
+
return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(0)} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
83
|
+
}
|
|
84
|
+
return (e, t) => (u(), c("div", D, [
|
|
85
|
+
i("div", null, [
|
|
86
|
+
y(f(g), {
|
|
87
|
+
type: "button",
|
|
88
|
+
label: l.chooseLabel,
|
|
89
|
+
icon: "pi pi-upload",
|
|
90
|
+
outlined: "",
|
|
91
|
+
size: "small",
|
|
92
|
+
disabled: l.disabled,
|
|
93
|
+
onClick: v
|
|
94
|
+
}, null, 8, ["label", "disabled"])
|
|
95
|
+
]),
|
|
96
|
+
i("input", {
|
|
97
|
+
ref_key: "input",
|
|
98
|
+
ref: d,
|
|
99
|
+
type: "file",
|
|
100
|
+
accept: l.accept,
|
|
101
|
+
multiple: l.multiple,
|
|
102
|
+
style: { display: "none" },
|
|
103
|
+
onChange: x
|
|
104
|
+
}, null, 40, $),
|
|
105
|
+
r.value.length ? (u(), c("ul", A, [
|
|
106
|
+
(u(!0), c(S, null, w(r.value, (s, o) => (u(), c("li", {
|
|
107
|
+
key: `${s.name}-${o}`,
|
|
108
|
+
style: { display: "flex", "align-items": "center", gap: "0.5rem", "font-size": "0.85rem" }
|
|
109
|
+
}, [
|
|
110
|
+
t[0] || (t[0] = i("i", {
|
|
111
|
+
class: "pi pi-file",
|
|
112
|
+
style: { opacity: "0.6" }
|
|
113
|
+
}, null, -1)),
|
|
114
|
+
i("span", K, W(s.name), 1),
|
|
115
|
+
i("span", L, W(B(s.size)), 1),
|
|
116
|
+
y(f(g), {
|
|
117
|
+
type: "button",
|
|
118
|
+
icon: "pi pi-times",
|
|
119
|
+
text: "",
|
|
120
|
+
rounded: "",
|
|
121
|
+
size: "small",
|
|
122
|
+
severity: "danger",
|
|
123
|
+
disabled: l.disabled,
|
|
124
|
+
onClick: (m) => b(o)
|
|
125
|
+
}, null, 8, ["disabled", "onClick"])
|
|
126
|
+
]))), 128))
|
|
127
|
+
])) : F(e.$slots, "empty", {}, () => [
|
|
128
|
+
t[1] || (t[1] = i("span", { style: { "font-size": "0.8rem", opacity: "0.6" } }, "Nenhum arquivo selecionado", -1))
|
|
129
|
+
], void 0, 1)
|
|
130
|
+
]));
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
export {
|
|
134
|
+
N as WActionBar,
|
|
135
|
+
P as WAutoCompleteFK,
|
|
136
|
+
T as WCrudColumnRenderer,
|
|
137
|
+
j as WCrudFormDialog,
|
|
138
|
+
G as WCrudView,
|
|
139
|
+
E as WDateRange,
|
|
140
|
+
J as WDetailHeader,
|
|
141
|
+
O as WEmptyState,
|
|
142
|
+
H as WFileUpload,
|
|
143
|
+
Q as WFormRenderer,
|
|
144
|
+
X as WFormSection,
|
|
145
|
+
Y as WImageCropper,
|
|
146
|
+
Z as WInfoCard,
|
|
147
|
+
_ as WKpiCard,
|
|
148
|
+
ee as WKpiGrid,
|
|
149
|
+
le as WMoneyInput,
|
|
150
|
+
te as WPageHeader,
|
|
151
|
+
ae as WProgressFlow,
|
|
152
|
+
oe as WSectionHeader,
|
|
153
|
+
ne as WStatusTag,
|
|
154
|
+
ie as WTransferList
|
|
155
|
+
};
|
|
156
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/components/form/WDateRange.vue","../src/components/form/WFileUpload.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport DatePicker from 'primevue/datepicker'\n\n/**\n * Seletor de intervalo de datas (período). Wrapper fino do DatePicker em modo\n * range com padrões pt-BR. O `v-model` guarda `[início, fim]` como `Date[]`.\n */\nwithDefaults(\n defineProps<{\n modelValue?: Date[] | null\n placeholder?: string\n minDate?: Date\n maxDate?: Date\n showButtonBar?: boolean\n disabled?: boolean\n }>(),\n {\n modelValue: null,\n placeholder: 'Selecione o período',\n showButtonBar: true,\n disabled: false,\n },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [value: Date[] | null] }>()\n\nfunction onUpdate(v: unknown) {\n emit('update:modelValue', (v as Date[] | null) ?? null)\n}\n</script>\n\n<template>\n <DatePicker\n :model-value=\"modelValue ?? undefined\"\n selection-mode=\"range\"\n :placeholder=\"placeholder\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n :show-button-bar=\"showButtonBar\"\n :disabled=\"disabled\"\n date-format=\"dd/mm/yy\"\n fluid\n @update:model-value=\"onUpdate\"\n />\n</template>\n","<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":["emit","__emit","onUpdate","v","_createBlock","_unref","DatePicker","__props","props","input","ref","files","computed","open","_a","onChange","el","picked","valid","f","removeAt","i","next","fmtSize","bytes","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_createVNode","Button","_hoisted_3","_Fragment","_renderList","_hoisted_4","_toDisplayString","_hoisted_5","$event","_renderSlot","_ctx","_cache"],"mappings":";;;;;;;;;;;;;;;;AAwBA,UAAMA,IAAOC;AAEb,aAASC,EAASC,GAAY;AAC5B,MAAAH,EAAK,qBAAsBG,KAAuB,IAAI;AAAA,IACxD;2BAIEC,EAWEC,EAAAC,CAAA,GAAA;AAAA,MAVC,eAAaC,EAAA,cAAc;AAAA,MAC5B,kBAAe;AAAA,MACd,aAAaA,EAAA;AAAA,MACb,YAAUA,EAAA;AAAA,MACV,YAAUA,EAAA;AAAA,MACV,mBAAiBA,EAAA;AAAA,MACjB,UAAUA,EAAA;AAAA,MACX,eAAY;AAAA,MACZ,OAAA;AAAA,MACC,uBAAoBL;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;ACjCzB,UAAMM,IAAQD,GAoBRP,IAAOC,GAKPQ,IAAQC,EAA6B,IAAI,GACzCC,IAAQC,EAAiB,MAAM;AACnC,YAAMT,IAAIK,EAAM;AAChB,aAAKL,IACE,MAAM,QAAQA,CAAC,IAAIA,IAAI,CAACA,CAA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@
|
|
|
1
|
+
import { CrudManagerConfig } from '../types/manager';
|
|
2
|
+
/**
|
|
3
|
+
* Helper de autoria tipado para o config do `useCrudManager`.
|
|
4
|
+
*
|
|
5
|
+
* Dá inferência do tipo do registro `T` (usado em `rowActions`, `onAfterSave`,
|
|
6
|
+
* `transformPayload`, etc.) e autocomplete/type-check ao montar o config,
|
|
7
|
+
* sem precisar anotar `CrudManagerConfig<T>` na mão.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const config = defineCrudConfig<Produto>({
|
|
11
|
+
* endpoint: '/produtos',
|
|
12
|
+
* columns: [...],
|
|
13
|
+
* form: [...],
|
|
14
|
+
* onAfterSave: (p) => { p.nome }, // p é Produto
|
|
15
|
+
* })
|
|
16
|
+
* const crud = useCrudManager(config)
|
|
17
|
+
*/
|
|
18
|
+
export declare function defineCrudConfig<T extends Record<string, unknown> = Record<string, unknown>>(config: CrudManagerConfig<T>): CrudManagerConfig<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CrudManagerConfig, CrudManagerReturn } from '../types/
|
|
1
|
+
import { CrudManagerConfig, CrudManagerReturn } from '../types/manager';
|
|
2
2
|
export declare function useCrudManager<T extends Record<string, unknown> = Record<string, unknown>>(config: CrudManagerConfig<T>): CrudManagerReturn<T>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useApi-5Pr4nXAa.cjs"),r=require("./useApiError-BEbEk2Kq.cjs");function s(u){return u}exports.useApi=e.useApi;exports.useCrudManager=e.useCrudManager;exports.extractApiError=r.extractApiError;exports.useApiError=r.useApiError;exports.useAppConfirm=r.useAppConfirm;exports.useAppToast=r.useAppToast;exports.useFormatters=r.useFormatters;exports.defineCrudConfig=s;
|
|
2
|
+
//# sourceMappingURL=composables.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composables.cjs","sources":["../src/composables/defineCrudConfig.ts"],"sourcesContent":["import type { CrudManagerConfig } from '@/types/manager'\n\n/**\n * Helper de autoria tipado para o config do `useCrudManager`.\n *\n * Dá inferência do tipo do registro `T` (usado em `rowActions`, `onAfterSave`,\n * `transformPayload`, etc.) e autocomplete/type-check ao montar o config,\n * sem precisar anotar `CrudManagerConfig<T>` na mão.\n *\n * @example\n * const config = defineCrudConfig<Produto>({\n * endpoint: '/produtos',\n * columns: [...],\n * form: [...],\n * onAfterSave: (p) => { p.nome }, // p é Produto\n * })\n * const crud = useCrudManager(config)\n */\nexport function defineCrudConfig<T extends Record<string, unknown> = Record<string, unknown>>(\n config: CrudManagerConfig<T>,\n): CrudManagerConfig<T> {\n return config\n}\n"],"names":["defineCrudConfig","config"],"mappings":"iKAkBO,SAASA,EACdC,EACsB,CACtB,OAAOA,CACT"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { u as o, a as u } from "./useApi-Bxrw3Sia.js";
|
|
2
|
+
import { e as t, u as i, a as n, b as f, c as A } from "./useApiError-C7rPzGrF.js";
|
|
3
|
+
function e(r) {
|
|
4
|
+
return r;
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
e as defineCrudConfig,
|
|
8
|
+
t as extractApiError,
|
|
9
|
+
o as useApi,
|
|
10
|
+
i as useApiError,
|
|
11
|
+
n as useAppConfirm,
|
|
12
|
+
f as useAppToast,
|
|
13
|
+
u as useCrudManager,
|
|
14
|
+
A as useFormatters
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=composables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composables.js","sources":["../src/composables/defineCrudConfig.ts"],"sourcesContent":["import type { CrudManagerConfig } from '@/types/manager'\n\n/**\n * Helper de autoria tipado para o config do `useCrudManager`.\n *\n * Dá inferência do tipo do registro `T` (usado em `rowActions`, `onAfterSave`,\n * `transformPayload`, etc.) e autocomplete/type-check ao montar o config,\n * sem precisar anotar `CrudManagerConfig<T>` na mão.\n *\n * @example\n * const config = defineCrudConfig<Produto>({\n * endpoint: '/produtos',\n * columns: [...],\n * form: [...],\n * onAfterSave: (p) => { p.nome }, // p é Produto\n * })\n * const crud = useCrudManager(config)\n */\nexport function defineCrudConfig<T extends Record<string, unknown> = Record<string, unknown>>(\n config: CrudManagerConfig<T>,\n): CrudManagerConfig<T> {\n return config\n}\n"],"names":["defineCrudConfig","config"],"mappings":";;AAkBO,SAASA,EACdC,GACsB;AACtB,SAAOA;AACT;"}
|