@wgalleti/primevue-components 0.20.0 → 0.22.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.
@@ -0,0 +1,45 @@
1
+ import { WChartOption } from '../../utils/chart';
2
+ type __VLS_Props = {
3
+ /** Option do ECharts — série, eixos, tooltip etc. */
4
+ option: WChartOption;
5
+ /** Mostra o overlay de carregamento do ECharts (cores do DS). */
6
+ loading?: boolean;
7
+ /** true quando a consulta voltou vazia — mostra o estado vazio no lugar do gráfico. */
8
+ empty?: boolean;
9
+ emptyMessage?: string;
10
+ /** svg para impressão/PDF; canvas no dia a dia. */
11
+ renderer?: 'canvas' | 'svg';
12
+ /** Modo impressão: tema monocromático + SVG + sem animação (PDF Gotenberg). */
13
+ print?: boolean;
14
+ /** Altura CSS do gráfico (default: token `--chart-h`, senão 18rem). */
15
+ height?: string;
16
+ };
17
+ declare function __VLS_template(): {
18
+ attrs: Partial<{}>;
19
+ slots: {
20
+ empty?(_: {}): any;
21
+ unavailable?(_: {}): any;
22
+ };
23
+ refs: {
24
+ container: HTMLDivElement;
25
+ };
26
+ rootEl: HTMLDivElement;
27
+ };
28
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
29
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
30
+ height: string;
31
+ empty: boolean;
32
+ loading: boolean;
33
+ print: boolean;
34
+ emptyMessage: string;
35
+ renderer: "canvas" | "svg";
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
37
+ container: HTMLDivElement;
38
+ }, HTMLDivElement>;
39
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
40
+ export default _default;
41
+ type __VLS_WithTemplateSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -12,6 +12,7 @@ export { default as WFileUpload } from './form/WFileUpload.vue';
12
12
  export { default as WMoneyInput } from './form/WMoneyInput.vue';
13
13
  export { default as WTransferList } from './form/WTransferList.vue';
14
14
  export { default as WTreeSelect } from './form/WTreeSelect.vue';
15
+ export { default as WChart } from './charts/WChart.vue';
15
16
  export { default as WStatusTag } from './ui/WStatusTag.vue';
16
17
  export { default as WPageHeader } from './ui/WPageHeader.vue';
17
18
  export { default as WEmptyState } from './ui/WEmptyState.vue';
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-B5VP8lO5.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.WDialog=_._sfc_main$10;exports.WEditableTable=_._sfc_main$11;exports.WEmptyState=_._sfc_main$12;exports.WFileUpload=_._sfc_main$13;exports.WFormRenderer=_._sfc_main$14;exports.WFormSection=_._sfc_main$15;exports.WImageCropper=_.WImageCropper;exports.WInfoCard=_._sfc_main$16;exports.WKanbanBoard=_._sfc_main$17;exports.WKpiCard=_._sfc_main$18;exports.WKpiGrid=_._sfc_main$19;exports.WMapSelect=_._sfc_main$20;exports.WMarkdownEditor=_._sfc_main$21;exports.WMarkdownToc=_._sfc_main$22;exports.WMarkdownView=_._sfc_main$23;exports.WMoneyInput=_._sfc_main$24;exports.WPageHeader=_._sfc_main$25;exports.WProgressFlow=_._sfc_main$26;exports.WSectionHeader=_._sfc_main$27;exports.WStatusTag=_._sfc_main$28;exports.WStepFlow=_._sfc_main$29;exports.WStepSection=_._sfc_main$30;exports.WTabBar=_._sfc_main$31;exports.WTabNav=_._sfc_main$32;exports.WTabViewport=_._sfc_main$33;exports.WTransferList=_._sfc_main$34;exports.WTreeSelect=_._sfc_main$35;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-ByBa9LKO.cjs");exports.WActionBar=_._sfc_main;exports.WAutoCompleteFK=_._sfc_main$1;exports.WChart=_.WChart;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.WDialog=_._sfc_main$10;exports.WEditableTable=_._sfc_main$11;exports.WEmptyState=_._sfc_main$12;exports.WFileUpload=_._sfc_main$13;exports.WFormRenderer=_._sfc_main$14;exports.WFormSection=_._sfc_main$15;exports.WImageCropper=_.WImageCropper;exports.WInfoCard=_._sfc_main$16;exports.WKanbanBoard=_._sfc_main$17;exports.WKpiCard=_._sfc_main$18;exports.WKpiGrid=_._sfc_main$19;exports.WMapSelect=_._sfc_main$20;exports.WMarkdownEditor=_._sfc_main$21;exports.WMarkdownToc=_._sfc_main$22;exports.WMarkdownView=_._sfc_main$23;exports.WMoneyInput=_._sfc_main$24;exports.WPageHeader=_._sfc_main$25;exports.WProgressFlow=_._sfc_main$26;exports.WSectionHeader=_._sfc_main$27;exports.WStatusTag=_._sfc_main$28;exports.WStepFlow=_._sfc_main$29;exports.WStepSection=_._sfc_main$30;exports.WTabBar=_._sfc_main$31;exports.WTabNav=_._sfc_main$32;exports.WTabViewport=_._sfc_main$33;exports.WTransferList=_._sfc_main$34;exports.WTreeSelect=_._sfc_main$35;
2
2
  //# sourceMappingURL=components.cjs.map
@@ -1,41 +1,42 @@
1
- import { _ as s, a as W, b as r, c as o, d as t, e as i, f as d, g as n, h as l, i as p, j as C, k as c, l as u, m as w, n as S, o as m, W as b, p as g, q as F, r as T, s as k, t as D, u as M, v as f, w as B, x as E, y as H, z as I, A as K, B as v, C as y, D as A, E as P, F as R, G as V, H as h, I as x } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-BZaHvyom.js";
1
+ import { _ as s, a as W, W as r, b as o, c as t, d as i, e as d, f as n, g as l, h as p, i as C, j as c, k as u, l as w, m as S, n as m, o as b, p as g, q as F, r as T, s as k, t as D, u as M, v as f, w as B, x as E, y as H, z as I, A as K, B as h, C as v, D as y, E as A, F as P, G as R, H as V, I as x, J as G } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-rd2SGufX.js";
2
2
  export {
3
3
  s as WActionBar,
4
4
  W as WAutoCompleteFK,
5
- r as WCheckList,
6
- o as WCrudColumnRenderer,
7
- t as WCrudFormDialog,
8
- i as WCrudSubview,
9
- d as WCrudView,
10
- n as WDatePicker,
11
- l as WDateRange,
12
- p as WDetailHeader,
13
- C as WDialog,
14
- c as WEditableTable,
15
- u as WEmptyState,
16
- w as WFileUpload,
17
- S as WFormRenderer,
18
- m as WFormSection,
19
- b as WImageCropper,
20
- g as WInfoCard,
21
- F as WKanbanBoard,
22
- T as WKpiCard,
23
- k as WKpiGrid,
24
- D as WMapSelect,
25
- M as WMarkdownEditor,
26
- f as WMarkdownToc,
27
- B as WMarkdownView,
28
- E as WMoneyInput,
29
- H as WPageHeader,
30
- I as WProgressFlow,
31
- K as WSectionHeader,
5
+ r as WChart,
6
+ o as WCheckList,
7
+ t as WCrudColumnRenderer,
8
+ i as WCrudFormDialog,
9
+ d as WCrudSubview,
10
+ n as WCrudView,
11
+ l as WDatePicker,
12
+ p as WDateRange,
13
+ C as WDetailHeader,
14
+ c as WDialog,
15
+ u as WEditableTable,
16
+ w as WEmptyState,
17
+ S as WFileUpload,
18
+ m as WFormRenderer,
19
+ b as WFormSection,
20
+ g as WImageCropper,
21
+ F as WInfoCard,
22
+ T as WKanbanBoard,
23
+ k as WKpiCard,
24
+ D as WKpiGrid,
25
+ M as WMapSelect,
26
+ f as WMarkdownEditor,
27
+ B as WMarkdownToc,
28
+ E as WMarkdownView,
29
+ H as WMoneyInput,
30
+ I as WPageHeader,
31
+ K as WProgressFlow,
32
+ h as WSectionHeader,
32
33
  v as WStatusTag,
33
34
  y as WStepFlow,
34
35
  A as WStepSection,
35
36
  P as WTabBar,
36
37
  R as WTabNav,
37
38
  V as WTabViewport,
38
- h as WTransferList,
39
- x as WTreeSelect
39
+ x as WTransferList,
40
+ G as WTreeSelect
40
41
  };
41
42
  //# sourceMappingURL=components.js.map
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./plugin-D2IZHyBm.cjs"),t=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-B5VP8lO5.cjs"),W=require("./useRouteTabs-VGx93R83.cjs"),m=require("./useFormKeyboardNav-BgBAe0C7.cjs"),w=require("./labels-pNskxXcl.cjs");function C(e,a,n){const r=e;return Array.isArray(r.results)?{data:r.results,page:r.page??a,page_size:r.page_size??n,rows:r.count??0,extras:r.extras??{}}:Array.isArray(r.data)?{data:r.data,page:r.page??a,page_size:r.page_size??n,rows:r.rows??0,extras:r.extras??{}}:{data:Array.isArray(e)?e:[],page:a,page_size:n,rows:Array.isArray(e)?e.length:0,extras:{}}}function y(e){return{async list(a,n={}){const r=await e.get(a,{params:n});return C(r.data,Number(n.page??1),Number(n.page_size??20))},async get(a,n,r){return{data:(await e.get(`${a}${n}/`,r)).data}},async create(a,n,r){return{data:(await e.post(a,n,r)).data}},async update(a,n,r,s){return{data:(await e.patch(`${a}${n}/`,r,s)).data}},async delete(a,n){await e.delete(`${a}${n}/`)}}}const S={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 n=a.dataProvider??y(a.axios),r={axios:a.axios,dataProvider:n,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,n),e.provide(_.W_CONFIG_KEY,r),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$24),e.component("WTransferList",t._sfc_main$34),e.component("WTreeSelect",t._sfc_main$35))}};function b(e){return e.split("?")[0].replace(/^\/+|\/+$/g,"").replace(/^api\/v\d+\//,"")}function D(e){return typeof e=="string"?{table:e}:e}function T(e,a=400){return{response:{status:a,data:{detail:e}},message:e}}function A(e){if(e instanceof FormData)throw T("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 s,i;const n=b(e),r=(s=a.resources)==null?void 0:s[n];if(r)return D(r);if((i=a.allowedTables)!=null&&i.includes(n))return{table:n};throw T(`Recurso Supabase nao registrado para o endpoint "${e}".`,404)}function F(e,a,n){const r=new Set(["page","page_size","search","ordering"]),s={...n.defaultFilters,...a};for(const[i,o]of Object.entries(s))r.has(i)||o===null||o===void 0||o===""||(e=e.eq(i,o));return e}function v(e,a,n){if(typeof a!="string"||!a.trim()||!(n!=null&&n.length))return e;const r=a.trim().replace(/,/g,"\\,"),s=n.map(i=>`${i}.ilike.%${r}%`).join(",");return e.or(s)}function E(e,a){const n=typeof e=="string"&&e?e:a;return n?{field:n.startsWith("-")?n.slice(1):n,ascending:!n.startsWith("-")}:null}function P(e,a){return e?a.mapListItem?e.map(n=>{var r;return(r=a.mapListItem)==null?void 0:r.call(a,n)}):e:[]}function R(e){const a=e.defaultSelect??"*";return{async list(n,r={}){var $;const s=g(n,e),i=Math.max(Number(r.page??1),1),o=Math.max(Number(r.page_size??20),1),c=(i-1)*o,l=c+o-1;let u=e.client.from(s.table).select(s.select??a,{count:"exact"});u=F(u,r,s),u=v(u,r.search,s.searchFields);const d=E(r.ordering,s.defaultOrdering);d&&(u=u.order(d.field,{ascending:d.ascending}));const f=await u.range(c,l);return f.error&&p(f.error),{data:P(f.data,s),page:i,page_size:o,rows:f.count??(($=f.data)==null?void 0:$.length)??0,extras:{}}},async get(n,r,s){const i=g(n,e),o=i.pk??"id",c=await e.client.from(i.table).select(i.select??a).eq(o,r).single();return c.error&&p(c.error),{data:c.data}},async create(n,r,s){const i=g(n,e),o=A(r),c=i.mapPayload?i.mapPayload(o,"create"):o,l=await e.client.from(i.table).insert(c).select(i.select??a).single();return l.error&&p(l.error),{data:l.data}},async update(n,r,s,i){const o=g(n,e),c=o.pk??"id",l=A(s),u=o.mapPayload?o.mapPayload(l,"update"):l,d=await e.client.from(o.table).update(u).eq(c,r).select(o.select??a).single();return d.error&&p(d.error),{data:d.data}},async delete(n,r){const s=g(n,e),i=s.pk??"id",o=s.softDelete===!0?{is_active:!1}:typeof s.softDelete=="object"?s.softDelete:null,c=o?await e.client.from(s.table).update(o).eq(i,r):await e.client.from(s.table).delete().eq(i,r);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.W_TAB_HOST_KEY=_.W_TAB_HOST_KEY;exports.useTabHost=_.useTabHost;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.WDialog=t._sfc_main$10;exports.WEditableTable=t._sfc_main$11;exports.WEmptyState=t._sfc_main$12;exports.WFileUpload=t._sfc_main$13;exports.WFormRenderer=t._sfc_main$14;exports.WFormSection=t._sfc_main$15;exports.WImageCropper=t.WImageCropper;exports.WInfoCard=t._sfc_main$16;exports.WKanbanBoard=t._sfc_main$17;exports.WKpiCard=t._sfc_main$18;exports.WKpiGrid=t._sfc_main$19;exports.WMapSelect=t._sfc_main$20;exports.WMarkdownEditor=t._sfc_main$21;exports.WMarkdownToc=t._sfc_main$22;exports.WMarkdownView=t._sfc_main$23;exports.WMoneyInput=t._sfc_main$24;exports.WPageHeader=t._sfc_main$25;exports.WProgressFlow=t._sfc_main$26;exports.WSectionHeader=t._sfc_main$27;exports.WStatusTag=t._sfc_main$28;exports.WStepFlow=t._sfc_main$29;exports.WStepSection=t._sfc_main$30;exports.WTabBar=t._sfc_main$31;exports.WTabNav=t._sfc_main$32;exports.WTabViewport=t._sfc_main$33;exports.WTransferList=t._sfc_main$34;exports.WTreeSelect=t._sfc_main$35;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.useRouteTabs=W.useRouteTabs;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=S;exports.createAxiosDataProvider=y;exports.createSupabaseDataProvider=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./plugin-D2IZHyBm.cjs"),a=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-ByBa9LKO.cjs"),W=require("./useRouteTabs-VGx93R83.cjs"),m=require("./useFormKeyboardNav-BgBAe0C7.cjs"),C=require("./labels-pNskxXcl.cjs");function b(e,t,n){const r=e;return Array.isArray(r.results)?{data:r.results,page:r.page??t,page_size:r.page_size??n,rows:r.count??0,extras:r.extras??{}}:Array.isArray(r.data)?{data:r.data,page:r.page??t,page_size:r.page_size??n,rows:r.rows??0,extras:r.extras??{}}:{data:Array.isArray(e)?e:[],page:t,page_size:n,rows:Array.isArray(e)?e.length:0,extras:{}}}function T(e){return{async list(t,n={}){const r=await e.get(t,{params:n});return b(r.data,Number(n.page??1),Number(n.page_size??20))},async get(t,n,r){return{data:(await e.get(`${t}${n}/`,r)).data}},async create(t,n,r){return{data:(await e.post(t,n,r)).data}},async update(t,n,r,i){return{data:(await e.patch(`${t}${n}/`,r,i)).data}},async delete(t,n){await e.delete(`${t}${n}/`)}}}const w={install(e,t){if(!(t!=null&&t.axios)&&!(t!=null&&t.dataProvider))throw new Error('[wPrimeVueComponents] Informe "axios" ou "dataProvider" ao registrar o WPrimeVuePlugin.');const n=t.dataProvider??T(t.axios),r={axios:t.axios,dataProvider:n,defaultPageSize:t.defaultPageSize??20,dateFormat:t.dateFormat??"DD/MM/YYYY",dateTimeFormat:t.dateTimeFormat??"DD/MM/YYYY HH:mm",locale:t.locale??"pt-BR",currency:t.currency??"BRL"};t.axios&&e.provide(l.W_AXIOS_KEY,t.axios),e.provide(l.W_DATA_PROVIDER_KEY,n),e.provide(l.W_CONFIG_KEY,r),t.registerComponents!==!1&&(e.component("WCrudView",a._sfc_main$6),e.component("WCrudFormDialog",a._sfc_main$4),e.component("WCrudColumnRenderer",a._sfc_main$3),e.component("WAutoCompleteFK",a._sfc_main$1),e.component("WMoneyInput",a._sfc_main$24),e.component("WTransferList",a._sfc_main$34),e.component("WTreeSelect",a._sfc_main$35))}};function S(e){return e.split("?")[0].replace(/^\/+|\/+$/g,"").replace(/^api\/v\d+\//,"")}function D(e){return typeof e=="string"?{table:e}:e}function y(e,t=400){return{response:{status:t,data:{detail:e}},message:e}}function A(e){if(e instanceof FormData)throw y("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,t){var i,s;const n=S(e),r=(i=t.resources)==null?void 0:i[n];if(r)return D(r);if((s=t.allowedTables)!=null&&s.includes(n))return{table:n};throw y(`Recurso Supabase nao registrado para o endpoint "${e}".`,404)}function P(e,t,n){const r=new Set(["page","page_size","search","ordering"]),i={...n.defaultFilters,...t};for(const[s,o]of Object.entries(i))r.has(s)||o===null||o===void 0||o===""||(e=e.eq(s,o));return e}function F(e,t,n){if(typeof t!="string"||!t.trim()||!(n!=null&&n.length))return e;const r=t.trim().replace(/,/g,"\\,"),i=n.map(s=>`${s}.ilike.%${r}%`).join(",");return e.or(i)}function v(e,t){const n=typeof e=="string"&&e?e:t;return n?{field:n.startsWith("-")?n.slice(1):n,ascending:!n.startsWith("-")}:null}function E(e,t){return e?t.mapListItem?e.map(n=>{var r;return(r=t.mapListItem)==null?void 0:r.call(t,n)}):e:[]}function h(e){const t=e.defaultSelect??"*";return{async list(n,r={}){var $;const i=g(n,e),s=Math.max(Number(r.page??1),1),o=Math.max(Number(r.page_size??20),1),c=(s-1)*o,d=c+o-1;let u=e.client.from(i.table).select(i.select??t,{count:"exact"});u=P(u,r,i),u=F(u,r.search,i.searchFields);const _=v(r.ordering,i.defaultOrdering);_&&(u=u.order(_.field,{ascending:_.ascending}));const f=await u.range(c,d);return f.error&&p(f.error),{data:E(f.data,i),page:s,page_size:o,rows:f.count??(($=f.data)==null?void 0:$.length)??0,extras:{}}},async get(n,r,i){const s=g(n,e),o=s.pk??"id",c=await e.client.from(s.table).select(s.select??t).eq(o,r).single();return c.error&&p(c.error),{data:c.data}},async create(n,r,i){const s=g(n,e),o=A(r),c=s.mapPayload?s.mapPayload(o,"create"):o,d=await e.client.from(s.table).insert(c).select(s.select??t).single();return d.error&&p(d.error),{data:d.data}},async update(n,r,i,s){const o=g(n,e),c=o.pk??"id",d=A(i),u=o.mapPayload?o.mapPayload(d,"update"):d,_=await e.client.from(o.table).update(u).eq(c,r).select(o.select??t).single();return _.error&&p(_.error),{data:_.data}},async delete(n,r){const i=g(n,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,r):await e.client.from(i.table).delete().eq(s,r);c.error&&p(c.error)}}}exports.W_AXIOS_KEY=l.W_AXIOS_KEY;exports.W_CONFIG_KEY=l.W_CONFIG_KEY;exports.W_DATA_PROVIDER_KEY=l.W_DATA_PROVIDER_KEY;exports.W_TAB_HOST_KEY=l.W_TAB_HOST_KEY;exports.useTabHost=l.useTabHost;exports.WActionBar=a._sfc_main;exports.WAutoCompleteFK=a._sfc_main$1;exports.WChart=a.WChart;exports.WCheckList=a._sfc_main$2;exports.WCrudColumnRenderer=a._sfc_main$3;exports.WCrudFormDialog=a._sfc_main$4;exports.WCrudSubview=a._sfc_main$5;exports.WCrudView=a._sfc_main$6;exports.WDatePicker=a._sfc_main$7;exports.WDateRange=a._sfc_main$8;exports.WDetailHeader=a._sfc_main$9;exports.WDialog=a._sfc_main$10;exports.WEditableTable=a._sfc_main$11;exports.WEmptyState=a._sfc_main$12;exports.WFileUpload=a._sfc_main$13;exports.WFormRenderer=a._sfc_main$14;exports.WFormSection=a._sfc_main$15;exports.WImageCropper=a.WImageCropper;exports.WInfoCard=a._sfc_main$16;exports.WKanbanBoard=a._sfc_main$17;exports.WKpiCard=a._sfc_main$18;exports.WKpiGrid=a._sfc_main$19;exports.WMapSelect=a._sfc_main$20;exports.WMarkdownEditor=a._sfc_main$21;exports.WMarkdownToc=a._sfc_main$22;exports.WMarkdownView=a._sfc_main$23;exports.WMoneyInput=a._sfc_main$24;exports.WPageHeader=a._sfc_main$25;exports.WProgressFlow=a._sfc_main$26;exports.WSectionHeader=a._sfc_main$27;exports.WStatusTag=a._sfc_main$28;exports.WStepFlow=a._sfc_main$29;exports.WStepSection=a._sfc_main$30;exports.WTabBar=a._sfc_main$31;exports.WTabNav=a._sfc_main$32;exports.WTabViewport=a._sfc_main$33;exports.WTransferList=a._sfc_main$34;exports.WTreeSelect=a._sfc_main$35;exports.W_STEP_FLOW_KEY=a.W_STEP_FLOW_KEY;exports.buildChartTheme=a.buildChartTheme;exports.buildPrintTheme=a.buildPrintTheme;exports.donutOption=a.donutOption;exports.downloadCsv=a.downloadCsv;exports.mapApiFieldToColumnDef=a.mapApiFieldToColumnDef;exports.mapApiFieldToFieldDef=a.mapApiFieldToFieldDef;exports.mapApiFieldsToColumnDefs=a.mapApiFieldsToColumnDefs;exports.mapApiFieldsToFieldDefs=a.mapApiFieldsToFieldDefs;exports.toCsv=a.toCsv;exports.useApi=W.useApi;exports.useCrudManager=W.useCrudManager;exports.useRouteTabs=W.useRouteTabs;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=C.DEFAULT_CRUD_LABELS;exports.WPrimeVuePlugin=w;exports.createAxiosDataProvider=T;exports.createSupabaseDataProvider=h;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { WPrimeVuePlugin } from './plugin';
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, WDialog, WTabBar, WTabNav, WTabViewport, WKanbanBoard, } from './components';
2
+ export { WCrudView, WCrudFormDialog, WCrudColumnRenderer, WEditableTable, WCrudSubview, WAutoCompleteFK, WFormRenderer, WDatePicker, WDateRange, WFileUpload, WImageCropper, WMoneyInput, WTransferList, WTreeSelect, WChart, WStatusTag, WPageHeader, WDetailHeader, WEmptyState, WInfoCard, WKpiCard, WKpiGrid, WSectionHeader, WFormSection, WActionBar, WProgressFlow, WStepFlow, WStepSection, WCheckList, WMapSelect, WMarkdownView, WMarkdownEditor, WMarkdownToc, WDialog, WTabBar, WTabNav, WTabViewport, WKanbanBoard, } from './components';
3
3
  export { useCrudManager, useSubviewCrud, useApi, useAppToast, useAppConfirm, useApiError, extractApiError, useFormatters, useDateInput, useRouteTabs, } from './composables';
4
4
  export type { DateValueFormat } from './composables';
5
5
  export { createAxiosDataProvider, createSupabaseDataProvider } from './data-providers';
@@ -12,6 +12,8 @@ export type { CreateSupabaseDataProviderOptions, SupabaseDataProviderClient, Sup
12
12
  export { DEFAULT_CRUD_LABELS, W_AXIOS_KEY, W_CONFIG_KEY, W_DATA_PROVIDER_KEY, W_TAB_HOST_KEY, useTabHost, } from './types';
13
13
  export type { ApiFieldMeta } from './utils/fieldMapper';
14
14
  export { mapApiFieldToFieldDef, mapApiFieldsToFieldDefs, mapApiFieldToColumnDef, mapApiFieldsToColumnDefs, } from './utils/fieldMapper';
15
+ export type { ChartTheme, DonutOptionInput, WChartOption } from './utils/chart';
16
+ export { buildChartTheme, buildPrintTheme, donutOption } from './utils/chart';
15
17
  export type { ToCsvOptions } from './utils/csv';
16
18
  export { toCsv, downloadCsv } from './utils/csv';
17
19
  export type { TreeSelectId, TreeSelectOption, TreeSelectNode, TreeSelectionKeys, TreeSelectionState, } from './utils/treeSelect';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { W as _, b as y, a as w } from "./plugin-CIBvOgwG.js";
2
2
  import { c as O, u as B } from "./plugin-CIBvOgwG.js";
3
- import { f as b, d as S, c as A, a as C, x as P, H as v, I as D } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-BZaHvyom.js";
4
- import { _ as N, b as V, e as q, g as j, h as U, i as G, j as J, k as X, l as Q, m as Z, n as ee, o as ae, W as te, p as se, q as re, r as ne, s as oe, t as ie, u as ce, v as ue, w as le, y as de, z as fe, A as me, B as pe, C as ge, D as We, E as _e, F as ye, G as we, J as be, K as Se, L as Ae, M as Ce, N as Pe, O as ve, P as De } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-BZaHvyom.js";
5
- import { u as Te, a as xe, b as Ee, c as he } from "./useRouteTabs-CSo1j_ji.js";
6
- import { e as $e, u as ze, a as Le, b as Me, c as Ye, f as Ie } from "./useFormKeyboardNav-BrKZrHq9.js";
7
- import { D as ke } from "./labels-B28P8JNB.js";
8
- function F(e, a, t) {
3
+ import { f as b, d as C, c as S, a as P, y as A, I as T, J as v } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-rd2SGufX.js";
4
+ import { _ as N, W as V, b as q, e as j, g as U, h as G, i as J, j as Q, k as X, l as Z, m as ee, n as ae, o as te, p as se, q as re, r as ne, s as oe, t as ie, u as ce, v as ue, w as de, x as le, z as me, A as fe, B as pe, C as ge, D as We, E as _e, F as ye, G as we, H as be, K as Ce, L as Se, M as Pe, N as Ae, O as Te, P as ve, Q as De, R as Fe, S as xe, T as Ee } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-rd2SGufX.js";
5
+ import { u as Re, a as $e, b as ze, c as Le } from "./useRouteTabs-CSo1j_ji.js";
6
+ import { e as Ye, u as Ie, a as Ke, b as ke, c as Oe, f as Be } from "./useFormKeyboardNav-BrKZrHq9.js";
7
+ import { D as Ne } from "./labels-B28P8JNB.js";
8
+ function D(e, a, t) {
9
9
  const s = e;
10
10
  return Array.isArray(s.results) ? {
11
11
  data: s.results,
@@ -27,11 +27,11 @@ function F(e, a, t) {
27
27
  extras: {}
28
28
  };
29
29
  }
30
- function T(e) {
30
+ function F(e) {
31
31
  return {
32
32
  async list(a, t = {}) {
33
33
  const s = await e.get(a, { params: t });
34
- return F(
34
+ return D(
35
35
  s.data,
36
36
  Number(t.page ?? 1),
37
37
  Number(t.page_size ?? 20)
@@ -57,7 +57,7 @@ const Y = {
57
57
  throw new Error(
58
58
  '[wPrimeVueComponents] Informe "axios" ou "dataProvider" ao registrar o WPrimeVuePlugin.'
59
59
  );
60
- const t = a.dataProvider ?? T(a.axios), s = {
60
+ const t = a.dataProvider ?? F(a.axios), s = {
61
61
  axios: a.axios,
62
62
  dataProvider: t,
63
63
  defaultPageSize: a.defaultPageSize ?? 20,
@@ -66,7 +66,7 @@ const Y = {
66
66
  locale: a.locale ?? "pt-BR",
67
67
  currency: a.currency ?? "BRL"
68
68
  };
69
- a.axios && e.provide(_, a.axios), e.provide(y, t), e.provide(w, s), a.registerComponents !== !1 && (e.component("WCrudView", b), e.component("WCrudFormDialog", S), e.component("WCrudColumnRenderer", A), e.component("WAutoCompleteFK", C), e.component("WMoneyInput", P), e.component("WTransferList", v), e.component("WTreeSelect", D));
69
+ a.axios && e.provide(_, a.axios), e.provide(y, t), e.provide(w, s), a.registerComponents !== !1 && (e.component("WCrudView", b), e.component("WCrudFormDialog", C), e.component("WCrudColumnRenderer", S), e.component("WAutoCompleteFK", P), e.component("WMoneyInput", A), e.component("WTransferList", T), e.component("WTreeSelect", v));
70
70
  }
71
71
  };
72
72
  function x(e) {
@@ -91,7 +91,7 @@ function g(e) {
91
91
  );
92
92
  return e;
93
93
  }
94
- function f(e) {
94
+ function m(e) {
95
95
  throw {
96
96
  response: {
97
97
  data: {
@@ -104,7 +104,7 @@ function f(e) {
104
104
  message: (e == null ? void 0 : e.message) ?? "Erro ao consultar Supabase"
105
105
  };
106
106
  }
107
- function m(e, a) {
107
+ function f(e, a) {
108
108
  var r, n;
109
109
  const t = x(e), s = (r = a.resources) == null ? void 0 : r[t];
110
110
  if (s)
@@ -143,101 +143,105 @@ function I(e) {
143
143
  return {
144
144
  async list(t, s = {}) {
145
145
  var p;
146
- const r = m(t, e), n = Math.max(Number(s.page ?? 1), 1), o = Math.max(Number(s.page_size ?? 20), 1), i = (n - 1) * o, u = i + o - 1;
146
+ const r = f(t, e), n = Math.max(Number(s.page ?? 1), 1), o = Math.max(Number(s.page_size ?? 20), 1), i = (n - 1) * o, u = i + o - 1;
147
147
  let c = e.client.from(r.table).select(r.select ?? a, { count: "exact" });
148
148
  c = h(c, s, r), c = R(c, s.search, r.searchFields);
149
- const l = $(s.ordering, r.defaultOrdering);
150
- l && (c = c.order(l.field, { ascending: l.ascending }));
151
- const d = await c.range(i, u);
152
- return d.error && f(d.error), {
153
- data: z(d.data, r),
149
+ const d = $(s.ordering, r.defaultOrdering);
150
+ d && (c = c.order(d.field, { ascending: d.ascending }));
151
+ const l = await c.range(i, u);
152
+ return l.error && m(l.error), {
153
+ data: z(l.data, r),
154
154
  page: n,
155
155
  page_size: o,
156
- rows: d.count ?? ((p = d.data) == null ? void 0 : p.length) ?? 0,
156
+ rows: l.count ?? ((p = l.data) == null ? void 0 : p.length) ?? 0,
157
157
  extras: {}
158
158
  };
159
159
  },
160
160
  async get(t, s, r) {
161
- const n = m(t, e), o = n.pk ?? "id", i = await e.client.from(n.table).select(n.select ?? a).eq(o, s).single();
162
- return i.error && f(i.error), { data: i.data };
161
+ const n = f(t, e), o = n.pk ?? "id", i = await e.client.from(n.table).select(n.select ?? a).eq(o, s).single();
162
+ return i.error && m(i.error), { data: i.data };
163
163
  },
164
164
  async create(t, s, r) {
165
- const n = m(t, e), o = g(s), i = n.mapPayload ? n.mapPayload(o, "create") : o, u = await e.client.from(n.table).insert(i).select(n.select ?? a).single();
166
- return u.error && f(u.error), { data: u.data };
165
+ const n = f(t, e), o = g(s), i = n.mapPayload ? n.mapPayload(o, "create") : o, u = await e.client.from(n.table).insert(i).select(n.select ?? a).single();
166
+ return u.error && m(u.error), { data: u.data };
167
167
  },
168
168
  async update(t, s, r, n) {
169
- const o = m(t, e), i = o.pk ?? "id", u = g(r), c = o.mapPayload ? o.mapPayload(u, "update") : u, l = await e.client.from(o.table).update(c).eq(i, s).select(o.select ?? a).single();
170
- return l.error && f(l.error), { data: l.data };
169
+ const o = f(t, e), i = o.pk ?? "id", u = g(r), c = o.mapPayload ? o.mapPayload(u, "update") : u, d = await e.client.from(o.table).update(c).eq(i, s).select(o.select ?? a).single();
170
+ return d.error && m(d.error), { data: d.data };
171
171
  },
172
172
  async delete(t, s) {
173
- const r = m(t, e), n = r.pk ?? "id", o = r.softDelete === !0 ? { is_active: !1 } : typeof r.softDelete == "object" ? r.softDelete : null, i = o ? await e.client.from(r.table).update(o).eq(n, s) : await e.client.from(r.table).delete().eq(n, s);
174
- i.error && f(i.error);
173
+ const r = f(t, e), n = r.pk ?? "id", o = r.softDelete === !0 ? { is_active: !1 } : typeof r.softDelete == "object" ? r.softDelete : null, i = o ? await e.client.from(r.table).update(o).eq(n, s) : await e.client.from(r.table).delete().eq(n, s);
174
+ i.error && m(i.error);
175
175
  }
176
176
  };
177
177
  }
178
178
  export {
179
- ke as DEFAULT_CRUD_LABELS,
179
+ Ne as DEFAULT_CRUD_LABELS,
180
180
  N as WActionBar,
181
- C as WAutoCompleteFK,
182
- V as WCheckList,
183
- A as WCrudColumnRenderer,
184
- S as WCrudFormDialog,
185
- q as WCrudSubview,
181
+ P as WAutoCompleteFK,
182
+ V as WChart,
183
+ q as WCheckList,
184
+ S as WCrudColumnRenderer,
185
+ C as WCrudFormDialog,
186
+ j as WCrudSubview,
186
187
  b as WCrudView,
187
- j as WDatePicker,
188
- U as WDateRange,
189
- G as WDetailHeader,
190
- J as WDialog,
188
+ U as WDatePicker,
189
+ G as WDateRange,
190
+ J as WDetailHeader,
191
+ Q as WDialog,
191
192
  X as WEditableTable,
192
- Q as WEmptyState,
193
- Z as WFileUpload,
194
- ee as WFormRenderer,
195
- ae as WFormSection,
196
- te as WImageCropper,
197
- se as WInfoCard,
198
- re as WKanbanBoard,
199
- ne as WKpiCard,
200
- oe as WKpiGrid,
201
- ie as WMapSelect,
202
- ce as WMarkdownEditor,
203
- ue as WMarkdownToc,
193
+ Z as WEmptyState,
194
+ ee as WFileUpload,
195
+ ae as WFormRenderer,
196
+ te as WFormSection,
197
+ se as WImageCropper,
198
+ re as WInfoCard,
199
+ ne as WKanbanBoard,
200
+ oe as WKpiCard,
201
+ ie as WKpiGrid,
202
+ ce as WMapSelect,
203
+ ue as WMarkdownEditor,
204
+ de as WMarkdownToc,
204
205
  le as WMarkdownView,
205
- P as WMoneyInput,
206
- de as WPageHeader,
206
+ A as WMoneyInput,
207
+ me as WPageHeader,
207
208
  Y as WPrimeVuePlugin,
208
209
  fe as WProgressFlow,
209
- me as WSectionHeader,
210
- pe as WStatusTag,
211
- ge as WStepFlow,
212
- We as WStepSection,
213
- _e as WTabBar,
214
- ye as WTabNav,
215
- we as WTabViewport,
216
- v as WTransferList,
217
- D as WTreeSelect,
210
+ pe as WSectionHeader,
211
+ ge as WStatusTag,
212
+ We as WStepFlow,
213
+ _e as WStepSection,
214
+ ye as WTabBar,
215
+ we as WTabNav,
216
+ be as WTabViewport,
217
+ T as WTransferList,
218
+ v as WTreeSelect,
218
219
  _ as W_AXIOS_KEY,
219
220
  w as W_CONFIG_KEY,
220
221
  y as W_DATA_PROVIDER_KEY,
221
- be as W_STEP_FLOW_KEY,
222
+ Ce as W_STEP_FLOW_KEY,
222
223
  O as W_TAB_HOST_KEY,
223
- T as createAxiosDataProvider,
224
+ Se as buildChartTheme,
225
+ Pe as buildPrintTheme,
226
+ F as createAxiosDataProvider,
224
227
  I as createSupabaseDataProvider,
225
- Se as downloadCsv,
226
- $e as extractApiError,
227
- Ae as mapApiFieldToColumnDef,
228
- Ce as mapApiFieldToFieldDef,
229
- Pe as mapApiFieldsToColumnDefs,
230
- ve as mapApiFieldsToFieldDefs,
231
- De as toCsv,
232
- Te as useApi,
233
- ze as useApiError,
234
- Le as useAppConfirm,
235
- Me as useAppToast,
236
- xe as useCrudManager,
237
- Ye as useDateInput,
238
- Ie as useFormatters,
239
- Ee as useRouteTabs,
240
- he as useSubviewCrud,
228
+ Ae as donutOption,
229
+ Te as downloadCsv,
230
+ Ye as extractApiError,
231
+ ve as mapApiFieldToColumnDef,
232
+ De as mapApiFieldToFieldDef,
233
+ Fe as mapApiFieldsToColumnDefs,
234
+ xe as mapApiFieldsToFieldDefs,
235
+ Ee as toCsv,
236
+ Re as useApi,
237
+ Ie as useApiError,
238
+ Ke as useAppConfirm,
239
+ ke as useAppToast,
240
+ $e as useCrudManager,
241
+ Oe as useDateInput,
242
+ Be as useFormatters,
243
+ ze as useRouteTabs,
244
+ Le as useSubviewCrud,
241
245
  B as useTabHost
242
246
  };
243
247
  //# sourceMappingURL=index.js.map