@wgalleti/primevue-components 0.18.0 → 0.20.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.
@@ -1,4 +1,4 @@
1
- import { MapSelectFeature, MapSelectFeatureStyle, MapSelectGeometry, MapSelectId, MapSelectPolygonStyle, MapSelectSelectionMode, MapSelectTooltips } from '../../types/mapSelect';
1
+ import { MapSelectDetailPlacement, MapSelectFeature, MapSelectFeatureDetail, MapSelectFeatureLabel, MapSelectFeatureStyle, MapSelectGeometry, MapSelectId, MapSelectPolygonStyle, MapSelectSelectionMode, MapSelectTooltips } from '../../types/mapSelect';
2
2
  /**
3
3
  * Seleção múltipla de polígonos num mapa de satélite, com painel lateral de busca.
4
4
  *
@@ -77,6 +77,12 @@ type __VLS_Props = {
77
77
  * rodapé): o clique no polígono emite `update:modelValue`. Em `'single'` o
78
78
  * clique substitui a seleção (`[id]`) e clicar no selecionado desmarca. */
79
79
  selectionMode?: MapSelectSelectionMode;
80
+ /** Feature destacada de fora, por cima de tudo (recebe o estilo de
81
+ * selecionado mesclado sobre o estado atual). É o feedback do arrasto:
82
+ * enquanto o dedo passeia com um item "na mão", quem chama liga o
83
+ * `hitTest` no `pointermove` e publica o id aqui — o polígono sob o dedo
84
+ * acende sem mexer na seleção. `null` desliga. */
85
+ highlightFeature?: MapSelectId | null;
80
86
  /** Estilo do polígono não selecionado. */
81
87
  polygonStyle?: MapSelectPolygonStyle;
82
88
  /** Estilo do polígono selecionado. */
@@ -86,8 +92,19 @@ type __VLS_Props = {
86
92
  * do domínio — ex.: contorno verde no talhão que a recomendação prevê —
87
93
  * sem o consumidor ter que reescrever os dois estilos inteiros. */
88
94
  featureStyle?: MapSelectFeatureStyle;
95
+ /** Texto do rótulo do polígono. Default: `"<nome> · <área>"`. Devolver `''`
96
+ * esconde o rótulo daquele polígono — útil quando o mapa é temático e o
97
+ * número do talhão já basta. */
98
+ featureLabel?: MapSelectFeatureLabel;
99
+ /** Abre o cartão do slot `#feature-detail` no hover ou no clique. `'none'`
100
+ * (default) não muda nada: sem slot e sem custo. O conteúdo do cartão é
101
+ * inteiro de quem chama — o componente só cuida de QUANDO e ONDE mostrar. */
102
+ featureDetail?: MapSelectFeatureDetail;
103
+ /** Onde o cartão de detalhe aparece: junto do cursor ou fixo no canto. */
104
+ detailPlacement?: MapSelectDetailPlacement;
89
105
  };
90
106
  declare function setCollapsed(value: boolean): void;
107
+ declare function fecharDetalhe(): void;
91
108
  declare function fitToScope(): void;
92
109
  /** Enquadra a layer de um id, com o mesmo padding do escopo. No-op se o id não
93
110
  * tem layer (sem geometria, ainda não chegou, mapa fora do ar). */
@@ -95,12 +112,32 @@ declare function fitToFeature(id: MapSelectId, options?: {
95
112
  padding?: [number, number];
96
113
  maxZoom?: number;
97
114
  }): void;
115
+ /** Feature sob um ponto da TELA (`clientX/clientY` de um PointerEvent) — o
116
+ * gancho do arrasto: soltar/passar um item por cima do mapa e descobrir qual
117
+ * polígono está sob o dedo. `null` fora do mapa, fora de qualquer polígono ou
118
+ * com o Leaflet fora do ar. */
119
+ declare function hitTest(clientX: number, clientY: number): MapSelectId | null;
98
120
  /** O mapa costuma nascer escondido (dentro de um Dialog): sem isto o Leaflet
99
121
  * calcula 0×0 e desenha só um pedaço quando o container aparece. */
100
122
  declare function refreshSize(): void;
101
123
  declare function __VLS_template(): {
102
124
  attrs: Partial<{}>;
103
125
  slots: {
126
+ 'feature-detail'?(_: {
127
+ feature: {
128
+ id: MapSelectId;
129
+ nome: string;
130
+ subtitulo?: string | undefined;
131
+ area?: number | undefined;
132
+ geometria?: {
133
+ type: "Polygon" | "MultiPolygon";
134
+ coordinates: [number, number][][] | [number, number][][][];
135
+ } | null | undefined;
136
+ dados?: Record<string, unknown> | undefined;
137
+ };
138
+ selected: boolean;
139
+ close: typeof fecharDetalhe;
140
+ }): any;
104
141
  item?(_: {
105
142
  feature: MapSelectFeature;
106
143
  selected: boolean;
@@ -129,10 +166,46 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
129
166
  fitToScope: typeof fitToScope;
130
167
  /** Enquadra o polígono de um id (padding igual ao do escopo). No-op sem layer. */
131
168
  fitToFeature: typeof fitToFeature;
169
+ /** Feature sob um ponto da tela (arrasto por cima do mapa). `null` fora. */
170
+ hitTest: typeof hitTest;
171
+ /** Feature do cartão de detalhe aberto (`null` fechado). */
172
+ detalhe: Readonly<import('vue').Ref<{
173
+ readonly id: MapSelectId;
174
+ readonly nome: string;
175
+ readonly subtitulo?: string | undefined;
176
+ readonly area?: number | undefined;
177
+ readonly geometria?: {
178
+ readonly type: "Polygon" | "MultiPolygon";
179
+ readonly coordinates: readonly (readonly (readonly [number, number])[])[] | readonly (readonly (readonly (readonly [number, number])[])[])[];
180
+ } | null | undefined;
181
+ readonly dados?: {
182
+ readonly [x: string]: Readonly<unknown>;
183
+ } | undefined;
184
+ } | null, {
185
+ readonly id: MapSelectId;
186
+ readonly nome: string;
187
+ readonly subtitulo?: string | undefined;
188
+ readonly area?: number | undefined;
189
+ readonly geometria?: {
190
+ readonly type: "Polygon" | "MultiPolygon";
191
+ readonly coordinates: readonly (readonly (readonly [number, number])[])[] | readonly (readonly (readonly (readonly [number, number])[])[])[];
192
+ } | null | undefined;
193
+ readonly dados?: {
194
+ readonly [x: string]: Readonly<unknown>;
195
+ } | undefined;
196
+ } | null>>;
197
+ /** Fecha o cartão de detalhe — para a tela fechar de fora (navegou, salvou). */
198
+ fecharDetalhe: typeof fecharDetalhe;
132
199
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
133
200
  "update:modelValue": (ids: MapSelectId[]) => any;
201
+ "feature-click": (feature: MapSelectFeature) => any;
202
+ "feature-enter": (feature: MapSelectFeature) => any;
203
+ "feature-leave": () => any;
134
204
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
135
205
  "onUpdate:modelValue"?: ((ids: MapSelectId[]) => any) | undefined;
206
+ "onFeature-click"?: ((feature: MapSelectFeature) => any) | undefined;
207
+ "onFeature-enter"?: ((feature: MapSelectFeature) => any) | undefined;
208
+ "onFeature-leave"?: (() => any) | undefined;
136
209
  }>, {
137
210
  modelValue: MapSelectId[];
138
211
  disabled: boolean;
@@ -157,9 +230,13 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
157
230
  badgeLabel: string;
158
231
  mapErrorMessage: string;
159
232
  tooltips: MapSelectTooltips;
233
+ highlightFeature: MapSelectId | null;
160
234
  polygonStyle: MapSelectPolygonStyle;
161
235
  polygonSelectedStyle: MapSelectPolygonStyle;
162
236
  featureStyle: MapSelectFeatureStyle;
237
+ featureLabel: MapSelectFeatureLabel;
238
+ featureDetail: MapSelectFeatureDetail;
239
+ detailPlacement: MapSelectDetailPlacement;
163
240
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
164
241
  root: HTMLDivElement;
165
242
  container: HTMLDivElement;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-DWs-ZSNZ.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-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;
2
2
  //# sourceMappingURL=components.cjs.map
@@ -1,4 +1,4 @@
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-DvyxNL4O.js";
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";
2
2
  export {
3
3
  s as WActionBar,
4
4
  W as WAutoCompleteFK,
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-DWs-ZSNZ.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 _=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;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
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-DvyxNL4O.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-DvyxNL4O.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
5
  import { u as Te, a as xe, b as Ee, c as he } from "./useRouteTabs-CSo1j_ji.js";
6
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
7
  import { D as ke } from "./labels-B28P8JNB.js";