@wgalleti/primevue-components 0.13.0 → 0.14.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/{WKanbanBoard.vue_vue_type_script_setup_true_lang-f9YyFJQM.js → WKanbanBoard.vue_vue_type_script_setup_true_lang-D30LZLT8.js} +2359 -2204
- package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-D30LZLT8.js.map +1 -0
- package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-x3RaoczK.cjs +36 -0
- package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-x3RaoczK.cjs.map +1 -0
- package/dist/components/crud/WCrudSubview.vue.d.ts +36 -0
- package/dist/components/crud/WEditableTable.vue.d.ts +4 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +26 -25
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/useSubviewCrud.d.ts +12 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +8 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +61 -59
- package/dist/primevue-components.css +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/subview.d.ts +87 -0
- package/dist/useApi-BQJ_C2Yt.js +519 -0
- package/dist/useApi-BQJ_C2Yt.js.map +1 -0
- package/dist/useApi-DpkKD_bN.cjs +2 -0
- package/dist/useApi-DpkKD_bN.cjs.map +1 -0
- package/dist/utils/formRecord.d.ts +23 -0
- package/package.json +1 -1
- package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-BsT2oBqn.cjs +0 -36
- package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-BsT2oBqn.cjs.map +0 -1
- package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-f9YyFJQM.js.map +0 -1
- package/dist/useApi-237Q1Vdg.cjs +0 -2
- package/dist/useApi-237Q1Vdg.cjs.map +0 -1
- package/dist/useApi-BsrLTNwE.js +0 -409
- package/dist/useApi-BsrLTNwE.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EditableColumnDef } from '../../types/editableTable';
|
|
2
|
+
import { SubviewCrudReturn } from '../../types/subview';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
crud: SubviewCrudReturn<any>;
|
|
5
|
+
columns: EditableColumnDef[];
|
|
6
|
+
title?: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/** Rótulo do botão de adicionar (default: `Adicionar`). */
|
|
9
|
+
addLabel?: string;
|
|
10
|
+
/** Liga a coluna de expansão e o slot `#expansion`. */
|
|
11
|
+
expandable?: boolean;
|
|
12
|
+
/** Documento travado (emitido, aprovado): sem adicionar, editar nem excluir. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
dialogWidth?: string;
|
|
16
|
+
/** Nº de colunas do grid do form dialog (default: o do manager, senão 2). */
|
|
17
|
+
formColumns?: number;
|
|
18
|
+
/** Rótulo da primeira célula do rodapé de totais. */
|
|
19
|
+
footerLabel?: string;
|
|
20
|
+
rowKey?: string;
|
|
21
|
+
};
|
|
22
|
+
declare function __VLS_template(): any;
|
|
23
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
24
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
dialogWidth: string;
|
|
27
|
+
expandable: boolean;
|
|
28
|
+
addLabel: string;
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -20,12 +20,14 @@ type __VLS_Props = {
|
|
|
20
20
|
expandable?: boolean;
|
|
21
21
|
/** Rótulo do botão de adicionar. Omitido = sem botão (só o slot `#toolbar`). */
|
|
22
22
|
addLabel?: string;
|
|
23
|
-
/** Liga a coluna da lixeira.
|
|
23
|
+
/** Liga a coluna da lixeira. **Manda sozinha** na remoção: `disabled` trava as
|
|
24
|
+
* células, não a linha (tabela de leitura de onde ainda se remove é caso real —
|
|
25
|
+
* itens cujo CRUD acontece em dialog). Para travar tudo, `:removable="false"`. */
|
|
24
26
|
removable?: boolean;
|
|
25
27
|
emptyMessage?: string;
|
|
26
28
|
/** Rótulo da primeira célula do rodapé de totais. */
|
|
27
29
|
footerLabel?: string;
|
|
28
|
-
/** Trava todos os editores (a tabela vira leitura). */
|
|
30
|
+
/** Trava todos os editores (a tabela vira leitura) e o botão de adicionar. */
|
|
29
31
|
disabled?: boolean;
|
|
30
32
|
/** Campo usado como `key` das linhas. Sem ele, a chave é o índice. */
|
|
31
33
|
rowKey?: string;
|
|
@@ -2,6 +2,7 @@ export { default as WCrudView } from './crud/WCrudView.vue';
|
|
|
2
2
|
export { default as WCrudFormDialog } from './crud/WCrudFormDialog.vue';
|
|
3
3
|
export { default as WCrudColumnRenderer } from './crud/WCrudColumnRenderer.vue';
|
|
4
4
|
export { default as WEditableTable } from './crud/WEditableTable.vue';
|
|
5
|
+
export { default as WCrudSubview } from './crud/WCrudSubview.vue';
|
|
5
6
|
export { default as WAutoCompleteFK } from './form/WAutoCompleteFK.vue';
|
|
6
7
|
export { default as WFormRenderer } from './form/WFormRenderer.vue';
|
|
7
8
|
export { default as WImageCropper } from './form/WImageCropper.vue';
|
package/dist/components.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-x3RaoczK.cjs");exports.WActionBar=_._sfc_main;exports.WAutoCompleteFK=_._sfc_main$1;exports.WCheckList=_._sfc_main$2;exports.WCrudColumnRenderer=_._sfc_main$3;exports.WCrudFormDialog=_._sfc_main$4;exports.WCrudSubview=_._sfc_main$5;exports.WCrudView=_._sfc_main$6;exports.WDatePicker=_._sfc_main$7;exports.WDateRange=_._sfc_main$8;exports.WDetailHeader=_._sfc_main$9;exports.WEditableTable=_._sfc_main$10;exports.WEmptyState=_._sfc_main$11;exports.WFileUpload=_._sfc_main$12;exports.WFormRenderer=_._sfc_main$13;exports.WFormSection=_._sfc_main$14;exports.WImageCropper=_.WImageCropper;exports.WInfoCard=_._sfc_main$15;exports.WKanbanBoard=_._sfc_main$16;exports.WKpiCard=_._sfc_main$17;exports.WKpiGrid=_._sfc_main$18;exports.WMapSelect=_._sfc_main$19;exports.WMarkdownEditor=_._sfc_main$20;exports.WMarkdownToc=_._sfc_main$21;exports.WMarkdownView=_._sfc_main$22;exports.WMoneyInput=_._sfc_main$23;exports.WPageHeader=_._sfc_main$24;exports.WProgressFlow=_._sfc_main$25;exports.WSectionHeader=_._sfc_main$26;exports.WStatusTag=_._sfc_main$27;exports.WStepFlow=_._sfc_main$28;exports.WStepSection=_._sfc_main$29;exports.WTabBar=_._sfc_main$30;exports.WTransferList=_._sfc_main$31;exports.WTreeSelect=_._sfc_main$32;
|
|
2
2
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { _ as s, a as r, b as W, c as o, d as t, e as d, f as i, g as n, h as l, i as p, j as
|
|
1
|
+
import { _ as s, a as r, b as W, c as o, d as t, e as d, f as i, g as n, h as l, i as p, j as C, k as c, l as u, m as S, n as m, W as w, o as F, p as g, q as b, r as k, s as T, t as D, u as M, v as f, w as B, x as E, y as K, z as y, A, B as H, C as I, D as P, E as R, F as h } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-D30LZLT8.js";
|
|
2
2
|
export {
|
|
3
3
|
s as WActionBar,
|
|
4
4
|
r as WAutoCompleteFK,
|
|
5
5
|
W as WCheckList,
|
|
6
6
|
o as WCrudColumnRenderer,
|
|
7
7
|
t as WCrudFormDialog,
|
|
8
|
-
d as
|
|
9
|
-
i as
|
|
10
|
-
n as
|
|
11
|
-
l as
|
|
12
|
-
p as
|
|
8
|
+
d as WCrudSubview,
|
|
9
|
+
i as WCrudView,
|
|
10
|
+
n as WDatePicker,
|
|
11
|
+
l as WDateRange,
|
|
12
|
+
p as WDetailHeader,
|
|
13
|
+
C as WEditableTable,
|
|
13
14
|
c as WEmptyState,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
u as WFileUpload,
|
|
16
|
+
S as WFormRenderer,
|
|
17
|
+
m as WFormSection,
|
|
18
|
+
w as WImageCropper,
|
|
19
|
+
F as WInfoCard,
|
|
19
20
|
g as WKanbanBoard,
|
|
20
|
-
|
|
21
|
+
b as WKpiCard,
|
|
21
22
|
k as WKpiGrid,
|
|
22
23
|
T as WMapSelect,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
D as WMarkdownEditor,
|
|
25
|
+
M as WMarkdownToc,
|
|
26
|
+
f as WMarkdownView,
|
|
27
|
+
B as WMoneyInput,
|
|
28
|
+
E as WPageHeader,
|
|
29
|
+
K as WProgressFlow,
|
|
30
|
+
y as WSectionHeader,
|
|
31
|
+
A as WStatusTag,
|
|
32
|
+
H as WStepFlow,
|
|
33
|
+
I as WStepSection,
|
|
34
|
+
P as WTabBar,
|
|
35
|
+
R as WTransferList,
|
|
36
|
+
h as WTreeSelect
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SubviewCrudConfig, SubviewCrudReturn } from '../types/subview';
|
|
2
|
+
/**
|
|
3
|
+
* O CRUD do `WCrudSubview`: mesma experiência do `useCrudManager`, sobre um array.
|
|
4
|
+
*
|
|
5
|
+
* Nada aqui é assíncrono e nada fala com a rede — `save` e `performDelete` devolvem o
|
|
6
|
+
* array novo pelo `onChange` e acabou. O dono do estado decide o que fazer com isso
|
|
7
|
+
* (num editor de documento, tipicamente marcar como sujo e gravar o documento inteiro).
|
|
8
|
+
*
|
|
9
|
+
* O array recebido nunca é mutado: toda operação devolve um array novo, para o
|
|
10
|
+
* consumidor poder comparar referência e saber que mudou.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useSubviewCrud<T extends Record<string, unknown> = Record<string, unknown>>(config: SubviewCrudConfig<T>): SubviewCrudReturn<T>;
|
package/dist/composables.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useApi-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useApi-DpkKD_bN.cjs"),e=require("./useFormKeyboardNav-D4Ow3k4Y.cjs");function s(u){return u}exports.useApi=r.useApi;exports.useCrudManager=r.useCrudManager;exports.useSubviewCrud=r.useSubviewCrud;exports.extractApiError=e.extractApiError;exports.useApiError=e.useApiError;exports.useAppConfirm=e.useAppConfirm;exports.useAppToast=e.useAppToast;exports.useDateInput=e.useDateInput;exports.useFormKeyboardNav=e.useFormKeyboardNav;exports.useFormatters=e.useFormatters;exports.defineCrudConfig=s;
|
|
2
2
|
//# sourceMappingURL=composables.cjs.map
|
package/dist/composables.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { u, a as o } from "./useApi-
|
|
2
|
-
import { e as
|
|
1
|
+
import { u, a as o, b as t } from "./useApi-BQJ_C2Yt.js";
|
|
2
|
+
import { e as i, u as n, a as f, b as d, c as m, d as A, f as C } from "./useFormKeyboardNav-D4Irq5RE.js";
|
|
3
3
|
function e(r) {
|
|
4
4
|
return r;
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
7
|
e as defineCrudConfig,
|
|
8
|
-
|
|
8
|
+
i as extractApiError,
|
|
9
9
|
u as useApi,
|
|
10
10
|
n as useApiError,
|
|
11
11
|
f as useAppConfirm,
|
|
12
|
-
|
|
12
|
+
d as useAppToast,
|
|
13
13
|
o as useCrudManager,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
m as useDateInput,
|
|
15
|
+
A as useFormKeyboardNav,
|
|
16
|
+
C as useFormatters,
|
|
17
|
+
t as useSubviewCrud
|
|
17
18
|
};
|
|
18
19
|
//# sourceMappingURL=composables.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./plugin-D1YvyKXX.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./plugin-D1YvyKXX.cjs"),t=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-x3RaoczK.cjs"),W=require("./useApi-DpkKD_bN.cjs"),m=require("./useFormKeyboardNav-D4Ow3k4Y.cjs"),w=require("./types.cjs");function D(e,a,r){const n=e;return Array.isArray(n.results)?{data:n.results,page:n.page??a,page_size:n.page_size??r,rows:n.count??0,extras:n.extras??{}}:Array.isArray(n.data)?{data:n.data,page:n.page??a,page_size:n.page_size??r,rows:n.rows??0,extras:n.extras??{}}:{data:Array.isArray(e)?e:[],page:a,page_size:r,rows:Array.isArray(e)?e.length:0,extras:{}}}function y(e){return{async list(a,r={}){const n=await e.get(a,{params:r});return D(n.data,Number(r.page??1),Number(r.page_size??20))},async get(a,r,n){return{data:(await e.get(`${a}${r}/`,n)).data}},async create(a,r,n){return{data:(await e.post(a,r,n)).data}},async update(a,r,n,i){return{data:(await e.patch(`${a}${r}/`,n,i)).data}},async delete(a,r){await e.delete(`${a}${r}/`)}}}const F={install(e,a){if(!(a!=null&&a.axios)&&!(a!=null&&a.dataProvider))throw new Error('[wPrimeVueComponents] Informe "axios" ou "dataProvider" ao registrar o WPrimeVuePlugin.');const r=a.dataProvider??y(a.axios),n={axios:a.axios,dataProvider:r,defaultPageSize:a.defaultPageSize??20,dateFormat:a.dateFormat??"DD/MM/YYYY",dateTimeFormat:a.dateTimeFormat??"DD/MM/YYYY HH:mm",locale:a.locale??"pt-BR",currency:a.currency??"BRL"};a.axios&&e.provide(_.W_AXIOS_KEY,a.axios),e.provide(_.W_DATA_PROVIDER_KEY,r),e.provide(_.W_CONFIG_KEY,n),a.registerComponents!==!1&&(e.component("WCrudView",t._sfc_main$6),e.component("WCrudFormDialog",t._sfc_main$4),e.component("WCrudColumnRenderer",t._sfc_main$3),e.component("WAutoCompleteFK",t._sfc_main$1),e.component("WMoneyInput",t._sfc_main$23),e.component("WTransferList",t._sfc_main$31),e.component("WTreeSelect",t._sfc_main$32))}};function S(e){return e.split("?")[0].replace(/^\/+|\/+$/g,"").replace(/^api\/v\d+\//,"")}function P(e){return typeof e=="string"?{table:e}:e}function C(e,a=400){return{response:{status:a,data:{detail:e}},message:e}}function A(e){if(e instanceof FormData)throw C("SupabaseDataProvider nao envia FormData diretamente. Faça upload do arquivo no Storage e envie a URL/caminho no payload.");return e}function p(e){throw{response:{data:{detail:(e==null?void 0:e.message)??"Erro ao consultar Supabase",code:e==null?void 0:e.code,details:e==null?void 0:e.details,hint:e==null?void 0:e.hint}},message:(e==null?void 0:e.message)??"Erro ao consultar Supabase"}}function g(e,a){var i,s;const r=S(e),n=(i=a.resources)==null?void 0:i[r];if(n)return P(n);if((s=a.allowedTables)!=null&&s.includes(r))return{table:r};throw C(`Recurso Supabase nao registrado para o endpoint "${e}".`,404)}function v(e,a,r){const n=new Set(["page","page_size","search","ordering"]),i={...r.defaultFilters,...a};for(const[s,o]of Object.entries(i))n.has(s)||o===null||o===void 0||o===""||(e=e.eq(s,o));return e}function E(e,a,r){if(typeof a!="string"||!a.trim()||!(r!=null&&r.length))return e;const n=a.trim().replace(/,/g,"\\,"),i=r.map(s=>`${s}.ilike.%${n}%`).join(",");return e.or(i)}function b(e,a){const r=typeof e=="string"&&e?e:a;return r?{field:r.startsWith("-")?r.slice(1):r,ascending:!r.startsWith("-")}:null}function T(e,a){return e?a.mapListItem?e.map(r=>{var n;return(n=a.mapListItem)==null?void 0:n.call(a,r)}):e:[]}function R(e){const a=e.defaultSelect??"*";return{async list(r,n={}){var $;const i=g(r,e),s=Math.max(Number(n.page??1),1),o=Math.max(Number(n.page_size??20),1),c=(s-1)*o,d=c+o-1;let u=e.client.from(i.table).select(i.select??a,{count:"exact"});u=v(u,n,i),u=E(u,n.search,i.searchFields);const l=b(n.ordering,i.defaultOrdering);l&&(u=u.order(l.field,{ascending:l.ascending}));const f=await u.range(c,d);return f.error&&p(f.error),{data:T(f.data,i),page:s,page_size:o,rows:f.count??(($=f.data)==null?void 0:$.length)??0,extras:{}}},async get(r,n,i){const s=g(r,e),o=s.pk??"id",c=await e.client.from(s.table).select(s.select??a).eq(o,n).single();return c.error&&p(c.error),{data:c.data}},async create(r,n,i){const s=g(r,e),o=A(n),c=s.mapPayload?s.mapPayload(o,"create"):o,d=await e.client.from(s.table).insert(c).select(s.select??a).single();return d.error&&p(d.error),{data:d.data}},async update(r,n,i,s){const o=g(r,e),c=o.pk??"id",d=A(i),u=o.mapPayload?o.mapPayload(d,"update"):d,l=await e.client.from(o.table).update(u).eq(c,n).select(o.select??a).single();return l.error&&p(l.error),{data:l.data}},async delete(r,n){const i=g(r,e),s=i.pk??"id",o=i.softDelete===!0?{is_active:!1}:typeof i.softDelete=="object"?i.softDelete:null,c=o?await e.client.from(i.table).update(o).eq(s,n):await e.client.from(i.table).delete().eq(s,n);c.error&&p(c.error)}}}exports.W_AXIOS_KEY=_.W_AXIOS_KEY;exports.W_CONFIG_KEY=_.W_CONFIG_KEY;exports.W_DATA_PROVIDER_KEY=_.W_DATA_PROVIDER_KEY;exports.WActionBar=t._sfc_main;exports.WAutoCompleteFK=t._sfc_main$1;exports.WCheckList=t._sfc_main$2;exports.WCrudColumnRenderer=t._sfc_main$3;exports.WCrudFormDialog=t._sfc_main$4;exports.WCrudSubview=t._sfc_main$5;exports.WCrudView=t._sfc_main$6;exports.WDatePicker=t._sfc_main$7;exports.WDateRange=t._sfc_main$8;exports.WDetailHeader=t._sfc_main$9;exports.WEditableTable=t._sfc_main$10;exports.WEmptyState=t._sfc_main$11;exports.WFileUpload=t._sfc_main$12;exports.WFormRenderer=t._sfc_main$13;exports.WFormSection=t._sfc_main$14;exports.WImageCropper=t.WImageCropper;exports.WInfoCard=t._sfc_main$15;exports.WKanbanBoard=t._sfc_main$16;exports.WKpiCard=t._sfc_main$17;exports.WKpiGrid=t._sfc_main$18;exports.WMapSelect=t._sfc_main$19;exports.WMarkdownEditor=t._sfc_main$20;exports.WMarkdownToc=t._sfc_main$21;exports.WMarkdownView=t._sfc_main$22;exports.WMoneyInput=t._sfc_main$23;exports.WPageHeader=t._sfc_main$24;exports.WProgressFlow=t._sfc_main$25;exports.WSectionHeader=t._sfc_main$26;exports.WStatusTag=t._sfc_main$27;exports.WStepFlow=t._sfc_main$28;exports.WStepSection=t._sfc_main$29;exports.WTabBar=t._sfc_main$30;exports.WTransferList=t._sfc_main$31;exports.WTreeSelect=t._sfc_main$32;exports.W_STEP_FLOW_KEY=t.W_STEP_FLOW_KEY;exports.downloadCsv=t.downloadCsv;exports.mapApiFieldToColumnDef=t.mapApiFieldToColumnDef;exports.mapApiFieldToFieldDef=t.mapApiFieldToFieldDef;exports.mapApiFieldsToColumnDefs=t.mapApiFieldsToColumnDefs;exports.mapApiFieldsToFieldDefs=t.mapApiFieldsToFieldDefs;exports.toCsv=t.toCsv;exports.useApi=W.useApi;exports.useCrudManager=W.useCrudManager;exports.useSubviewCrud=W.useSubviewCrud;exports.extractApiError=m.extractApiError;exports.useApiError=m.useApiError;exports.useAppConfirm=m.useAppConfirm;exports.useAppToast=m.useAppToast;exports.useDateInput=m.useDateInput;exports.useFormatters=m.useFormatters;exports.DEFAULT_CRUD_LABELS=w.DEFAULT_CRUD_LABELS;exports.WPrimeVuePlugin=F;exports.createAxiosDataProvider=y;exports.createSupabaseDataProvider=R;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { WPrimeVuePlugin } from './plugin';
|
|
2
|
-
export { WCrudView, WCrudFormDialog, WCrudColumnRenderer, WEditableTable, WAutoCompleteFK, WFormRenderer, WDatePicker, WDateRange, WFileUpload, WImageCropper, WMoneyInput, WTransferList, WTreeSelect, WStatusTag, WPageHeader, WDetailHeader, WEmptyState, WInfoCard, WKpiCard, WKpiGrid, WSectionHeader, WFormSection, WActionBar, WProgressFlow, WStepFlow, WStepSection, WCheckList, WMapSelect, WMarkdownView, WMarkdownEditor, WMarkdownToc, WTabBar, WKanbanBoard, } from './components';
|
|
3
|
-
export { useCrudManager, useApi, useAppToast, useAppConfirm, useApiError, extractApiError, useFormatters, useDateInput, } from './composables';
|
|
2
|
+
export { WCrudView, WCrudFormDialog, WCrudColumnRenderer, WEditableTable, WCrudSubview, WAutoCompleteFK, WFormRenderer, WDatePicker, WDateRange, WFileUpload, WImageCropper, WMoneyInput, WTransferList, WTreeSelect, WStatusTag, WPageHeader, WDetailHeader, WEmptyState, WInfoCard, WKpiCard, WKpiGrid, WSectionHeader, WFormSection, WActionBar, WProgressFlow, WStepFlow, WStepSection, WCheckList, WMapSelect, WMarkdownView, WMarkdownEditor, WMarkdownToc, WTabBar, WKanbanBoard, } from './components';
|
|
3
|
+
export { useCrudManager, useSubviewCrud, useApi, useAppToast, useAppConfirm, useApiError, extractApiError, useFormatters, useDateInput, } from './composables';
|
|
4
4
|
export type { DateValueFormat } from './composables';
|
|
5
5
|
export { createAxiosDataProvider, createSupabaseDataProvider } from './data-providers';
|
|
6
|
-
export type { PaginatedResponse, PaginationState, SortState, UseApiOptions, UseApiReturn, ColumnDef, ColumnType, FieldDef, FieldType, SelectOption, EditableColumnDef, EditableColumnEditor, EditableRow, CheckListItem, CheckListLevel, KanbanColumn, KanbanMoveEvent, MapSelectFeature, MapSelectGeometry, MapSelectId, MapSelectPolygonStyle, MapSelectPosition, RowAction, CrudLabels, KpiItem, CrudManagerConfig, CrudManagerReturn, WPluginOptions, WPluginConfig, DataProvider, DataProviderListParams, DataProviderListResponse, DataProviderRequestConfig, DataProviderResponse, } from './types';
|
|
6
|
+
export type { PaginatedResponse, PaginationState, SortState, UseApiOptions, UseApiReturn, ColumnDef, ColumnType, FieldDef, FieldType, SelectOption, EditableColumnDef, EditableColumnEditor, EditableRow, CheckListItem, CheckListLevel, KanbanColumn, KanbanMoveEvent, MapSelectFeature, MapSelectGeometry, MapSelectId, MapSelectPolygonStyle, MapSelectPosition, RowAction, CrudLabels, KpiItem, CrudManagerConfig, CrudManagerReturn, SubviewCrudConfig, SubviewCrudReturn, WPluginOptions, WPluginConfig, DataProvider, DataProviderListParams, DataProviderListResponse, DataProviderRequestConfig, DataProviderResponse, } from './types';
|
|
7
7
|
export type { StatusMapping } from './components/ui/WStatusTag.vue';
|
|
8
8
|
export type { InfoField } from './components/ui/WInfoCard.vue';
|
|
9
9
|
export type { StepFlowContext, StepFlowOrientation } from './utils/stepFlow';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { b as y, W as _, a as w } from "./plugin-BKa0eSEM.js";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as B, b as O,
|
|
4
|
-
import { u as
|
|
5
|
-
import { e as Fe, u as
|
|
6
|
-
import { DEFAULT_CRUD_LABELS as
|
|
2
|
+
import { f as C, d as S, c as b, a as A, w as P, E as v, F } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-D30LZLT8.js";
|
|
3
|
+
import { _ as B, b as O, e as V, g as H, h as N, i as q, j, k as U, l as G, m as J, n as X, W as Q, o as Z, p as ee, q as ae, r as te, s as re, t as se, u as ne, v as oe, x as ie, y as ce, z as de, A as le, B as ue, C as fe, D as me, G as pe, H as ge, I as We, J as ye, K as _e, L as we, M as Ce } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-D30LZLT8.js";
|
|
4
|
+
import { u as be, a as Ae, b as Pe } from "./useApi-BQJ_C2Yt.js";
|
|
5
|
+
import { e as Fe, u as De, a as xe, b as Ee, c as Te, f as he } from "./useFormKeyboardNav-D4Irq5RE.js";
|
|
6
|
+
import { DEFAULT_CRUD_LABELS as Re } from "./types.js";
|
|
7
7
|
function D(e, a, t) {
|
|
8
8
|
const r = e;
|
|
9
9
|
return Array.isArray(r.results) ? {
|
|
@@ -65,7 +65,7 @@ const I = {
|
|
|
65
65
|
locale: a.locale ?? "pt-BR",
|
|
66
66
|
currency: a.currency ?? "BRL"
|
|
67
67
|
};
|
|
68
|
-
a.axios && e.provide(y, a.axios), e.provide(_, t), e.provide(w, r), a.registerComponents !== !1 && (e.component("WCrudView",
|
|
68
|
+
a.axios && e.provide(y, a.axios), e.provide(_, t), e.provide(w, r), a.registerComponents !== !1 && (e.component("WCrudView", C), e.component("WCrudFormDialog", S), e.component("WCrudColumnRenderer", b), e.component("WAutoCompleteFK", A), e.component("WMoneyInput", P), e.component("WTransferList", v), e.component("WTreeSelect", F));
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
function E(e) {
|
|
@@ -142,12 +142,12 @@ function Y(e) {
|
|
|
142
142
|
return {
|
|
143
143
|
async list(t, r = {}) {
|
|
144
144
|
var p;
|
|
145
|
-
const s = m(t, e), n = Math.max(Number(r.page ?? 1), 1), o = Math.max(Number(r.page_size ?? 20), 1), i = (n - 1) * o,
|
|
145
|
+
const s = m(t, e), n = Math.max(Number(r.page ?? 1), 1), o = Math.max(Number(r.page_size ?? 20), 1), i = (n - 1) * o, d = i + o - 1;
|
|
146
146
|
let c = e.client.from(s.table).select(s.select ?? a, { count: "exact" });
|
|
147
147
|
c = h(c, r, s), c = $(c, r.search, s.searchFields);
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
const u = await c.range(i,
|
|
148
|
+
const l = R(r.ordering, s.defaultOrdering);
|
|
149
|
+
l && (c = c.order(l.field, { ascending: l.ascending }));
|
|
150
|
+
const u = await c.range(i, d);
|
|
151
151
|
return u.error && f(u.error), {
|
|
152
152
|
data: z(u.data, s),
|
|
153
153
|
page: n,
|
|
@@ -161,12 +161,12 @@ function Y(e) {
|
|
|
161
161
|
return i.error && f(i.error), { data: i.data };
|
|
162
162
|
},
|
|
163
163
|
async create(t, r, s) {
|
|
164
|
-
const n = m(t, e), o = g(r), i = n.mapPayload ? n.mapPayload(o, "create") : o,
|
|
165
|
-
return
|
|
164
|
+
const n = m(t, e), o = g(r), i = n.mapPayload ? n.mapPayload(o, "create") : o, d = await e.client.from(n.table).insert(i).select(n.select ?? a).single();
|
|
165
|
+
return d.error && f(d.error), { data: d.data };
|
|
166
166
|
},
|
|
167
167
|
async update(t, r, s, n) {
|
|
168
|
-
const o = m(t, e), i = o.pk ?? "id",
|
|
169
|
-
return
|
|
168
|
+
const o = m(t, e), i = o.pk ?? "id", d = g(s), c = o.mapPayload ? o.mapPayload(d, "update") : d, l = await e.client.from(o.table).update(c).eq(i, r).select(o.select ?? a).single();
|
|
169
|
+
return l.error && f(l.error), { data: l.data };
|
|
170
170
|
},
|
|
171
171
|
async delete(t, r) {
|
|
172
172
|
const s = m(t, e), n = s.pk ?? "id", o = s.softDelete === !0 ? { is_active: !1 } : typeof s.softDelete == "object" ? s.softDelete : null, i = o ? await e.client.from(s.table).update(o).eq(n, r) : await e.client.from(s.table).delete().eq(n, r);
|
|
@@ -175,60 +175,62 @@ function Y(e) {
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
export {
|
|
178
|
-
|
|
178
|
+
Re as DEFAULT_CRUD_LABELS,
|
|
179
179
|
B as WActionBar,
|
|
180
|
-
|
|
180
|
+
A as WAutoCompleteFK,
|
|
181
181
|
O as WCheckList,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
H as
|
|
187
|
-
N as
|
|
188
|
-
q as
|
|
189
|
-
j as
|
|
190
|
-
U as
|
|
191
|
-
G as
|
|
192
|
-
J as
|
|
193
|
-
X as
|
|
194
|
-
Q as
|
|
195
|
-
Z as
|
|
196
|
-
ee as
|
|
197
|
-
ae as
|
|
198
|
-
te as
|
|
199
|
-
re as
|
|
200
|
-
se as
|
|
201
|
-
ne as
|
|
202
|
-
|
|
203
|
-
|
|
182
|
+
b as WCrudColumnRenderer,
|
|
183
|
+
S as WCrudFormDialog,
|
|
184
|
+
V as WCrudSubview,
|
|
185
|
+
C as WCrudView,
|
|
186
|
+
H as WDatePicker,
|
|
187
|
+
N as WDateRange,
|
|
188
|
+
q as WDetailHeader,
|
|
189
|
+
j as WEditableTable,
|
|
190
|
+
U as WEmptyState,
|
|
191
|
+
G as WFileUpload,
|
|
192
|
+
J as WFormRenderer,
|
|
193
|
+
X as WFormSection,
|
|
194
|
+
Q as WImageCropper,
|
|
195
|
+
Z as WInfoCard,
|
|
196
|
+
ee as WKanbanBoard,
|
|
197
|
+
ae as WKpiCard,
|
|
198
|
+
te as WKpiGrid,
|
|
199
|
+
re as WMapSelect,
|
|
200
|
+
se as WMarkdownEditor,
|
|
201
|
+
ne as WMarkdownToc,
|
|
202
|
+
oe as WMarkdownView,
|
|
203
|
+
P as WMoneyInput,
|
|
204
|
+
ie as WPageHeader,
|
|
204
205
|
I as WPrimeVuePlugin,
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
ce as WProgressFlow,
|
|
207
|
+
de as WSectionHeader,
|
|
207
208
|
le as WStatusTag,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
ue as WStepFlow,
|
|
210
|
+
fe as WStepSection,
|
|
211
|
+
me as WTabBar,
|
|
212
|
+
v as WTransferList,
|
|
213
|
+
F as WTreeSelect,
|
|
213
214
|
y as W_AXIOS_KEY,
|
|
214
215
|
w as W_CONFIG_KEY,
|
|
215
216
|
_ as W_DATA_PROVIDER_KEY,
|
|
216
|
-
|
|
217
|
+
pe as W_STEP_FLOW_KEY,
|
|
217
218
|
x as createAxiosDataProvider,
|
|
218
219
|
Y as createSupabaseDataProvider,
|
|
219
|
-
|
|
220
|
+
ge as downloadCsv,
|
|
220
221
|
Fe as extractApiError,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
222
|
+
We as mapApiFieldToColumnDef,
|
|
223
|
+
ye as mapApiFieldToFieldDef,
|
|
224
|
+
_e as mapApiFieldsToColumnDefs,
|
|
225
|
+
we as mapApiFieldsToFieldDefs,
|
|
226
|
+
Ce as toCsv,
|
|
227
|
+
be as useApi,
|
|
228
|
+
De as useApiError,
|
|
229
|
+
xe as useAppConfirm,
|
|
230
|
+
Ee as useAppToast,
|
|
231
|
+
Ae as useCrudManager,
|
|
232
|
+
Te as useDateInput,
|
|
233
|
+
he as useFormatters,
|
|
234
|
+
Pe as useSubviewCrud
|
|
233
235
|
};
|
|
234
236
|
//# sourceMappingURL=index.js.map
|