@wgalleti/primevue-components 0.13.0 → 0.15.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.
Files changed (37) hide show
  1. package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-Cx3AJma_.js +6296 -0
  2. package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-Cx3AJma_.js.map +1 -0
  3. package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-DX-6iLgb.cjs +36 -0
  4. package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-DX-6iLgb.cjs.map +1 -0
  5. package/dist/components/crud/WCrudSubview.vue.d.ts +36 -0
  6. package/dist/components/crud/WCrudView.vue.d.ts +27 -2
  7. package/dist/components/crud/WEditableTable.vue.d.ts +4 -2
  8. package/dist/components/index.d.ts +1 -0
  9. package/dist/components/ui/WMapSelect.vue.d.ts +26 -1
  10. package/dist/components.cjs +1 -1
  11. package/dist/components.js +26 -25
  12. package/dist/composables/index.d.ts +1 -0
  13. package/dist/composables/useSubviewCrud.d.ts +12 -0
  14. package/dist/composables.cjs +1 -1
  15. package/dist/composables.js +8 -7
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +61 -59
  19. package/dist/primevue-components.css +1 -1
  20. package/dist/types/index.d.ts +2 -1
  21. package/dist/types/manager.d.ts +11 -3
  22. package/dist/types/mapSelect.d.ts +11 -0
  23. package/dist/types/subview.d.ts +87 -0
  24. package/dist/useApi-BM5JpPDe.js +539 -0
  25. package/dist/useApi-BM5JpPDe.js.map +1 -0
  26. package/dist/useApi-CPt3Tj4n.cjs +2 -0
  27. package/dist/useApi-CPt3Tj4n.cjs.map +1 -0
  28. package/dist/utils/formRecord.d.ts +23 -0
  29. package/package.json +1 -1
  30. package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-BsT2oBqn.cjs +0 -36
  31. package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-BsT2oBqn.cjs.map +0 -1
  32. package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-f9YyFJQM.js +0 -6069
  33. package/dist/WKanbanBoard.vue_vue_type_script_setup_true_lang-f9YyFJQM.js.map +0 -1
  34. package/dist/useApi-237Q1Vdg.cjs +0 -2
  35. package/dist/useApi-237Q1Vdg.cjs.map +0 -1
  36. package/dist/useApi-BsrLTNwE.js +0 -409
  37. 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
+ };
@@ -35,6 +35,17 @@ type __VLS_Props = {
35
35
  * Opt-in: quando definida, exibe o seletor de colunas e persiste o que foi ocultado. */
36
36
  persistState?: string;
37
37
  };
38
+ /**
39
+ * Rola a tabela até a linha cujo pk é `value` — o par do `v-model:selectedRow`
40
+ * para o sentido "de fora para dentro" (selecionou no mapa/gráfico, a linha
41
+ * aparece). Só alcança a página atual: linha em outra página não é buscada — é
42
+ * do consumidor decidir o que fazer nesse caso (a lista é lazy). Com linhas de
43
+ * expansão abertas o índice DOM diverge do índice do item; aí não rola.
44
+ */
45
+ declare function scrollToRow(value: unknown): void;
46
+ type __VLS_PublicProps = {
47
+ 'selectedRow'?: Record<string, unknown> | null;
48
+ } & __VLS_Props;
38
49
  declare function __VLS_template(): {
39
50
  attrs: Partial<{}>;
40
51
  slots: Partial<Record<`column-${string}`, (_: {
@@ -88,6 +99,11 @@ declare function __VLS_template(): {
88
99
  }): any;
89
100
  };
90
101
  refs: {
102
+ tableRef: ({
103
+ $props: import('primevue/datatable').DataTableProps<any> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
104
+ $slots: import('primevue/datatable').DataTableSlots<any>;
105
+ $emit: ((e: "page", event: import('primevue/datatable').DataTablePageEvent) => void) & ((e: "sort", event: import('primevue/datatable').DataTableSortEvent) => void) & ((e: "filter", event: import('primevue/datatable').DataTableFilterEvent) => void) & ((e: "value-change", value: any[]) => void) & ((e: "update:first", value: number) => void) & ((e: "update:rows", value: number) => void) & ((e: "update:sortField", value: string) => void) & ((e: "update:sortOrder", value: number | undefined) => void) & ((e: "update:multiSortMeta", value: import('primevue/datatable').DataTableSortMeta[] | null | undefined) => void) & ((e: "update:selection", value: any) => void) & ((e: "update:contextMenuSelection", value: any) => void) & ((e: "update:expandedRows", value: any[] | import('primevue/datatable').DataTableExpandedRows) => void) & ((e: "update:expandedRowGroups", value: any[] | import('primevue/datatable').DataTableExpandedRows) => void) & ((e: "update:filters", value: import('primevue/datatable').DataTableFilterMeta) => void) & ((e: "update:editingRows", value: any[] | import('primevue/datatable').DataTableEditingRows) => void) & ((e: "row-click", event: import('primevue/datatable').DataTableRowClickEvent<any>) => void) & ((e: "row-dblclick", event: import('primevue/datatable').DataTableRowDoubleClickEvent) => void) & ((e: "row-contextmenu", event: import('primevue/datatable').DataTableRowContextMenuEvent) => void) & ((e: "row-select", event: import('primevue/datatable').DataTableRowSelectEvent<any>) => void) & ((e: "row-select-all", event: import('primevue/datatable').DataTableRowSelectAllEvent<any>) => void) & ((e: "row-unselect-all", event: import('primevue/datatable').DataTableRowUnselectAllEvent) => void) & ((e: "row-unselect", event: import('primevue/datatable').DataTableRowUnselectEvent) => void) & ((e: "select-all-change", event: import('primevue/datatable').DataTableSelectAllChangeEvent) => void) & ((e: "column-resize-end", event: import('primevue/datatable').DataTableColumnResizeEndEvent) => void) & ((e: "column-reorder", event: import('primevue/datatable').DataTableColumnReorderEvent) => void) & ((e: "row-reorder", event: import('primevue/datatable').DataTableRowReorderEvent) => void) & ((e: "row-expand", event: import('primevue/datatable').DataTableRowExpandEvent<any>) => void) & ((e: "row-collapse", event: import('primevue/datatable').DataTableRowCollapseEvent) => void) & ((e: "rowgroup-expand", event: import('primevue/datatable').DataTableRowExpandEvent<any>) => void) & ((e: "rowgroup-collapse", event: import('primevue/datatable').DataTableRowCollapseEvent) => void) & ((e: "cell-edit-init", event: import('primevue/datatable').DataTableCellEditInitEvent<any>) => void) & ((e: "cell-edit-complete", event: import('primevue/datatable').DataTableCellEditCompleteEvent<any>) => void) & ((e: "cell-edit-cancel", event: import('primevue/datatable').DataTableCellEditCancelEvent) => void) & ((e: "row-edit-init", event: import('primevue/datatable').DataTableRowEditInitEvent<any>) => void) & ((e: "row-edit-save", event: import('primevue/datatable').DataTableRowEditSaveEvent<any>) => void) & ((e: "row-edit-cancel", event: import('primevue/datatable').DataTableRowEditCancelEvent<any>) => void) & ((e: "state-restore", event: import('primevue/datatable').DataTableStateEvent<any>) => void) & ((e: "state-save", event: import('primevue/datatable').DataTableStateEvent<any>) => void);
106
+ } & import('primevue/datatable').DataTableMethods) | null;
91
107
  chooser: ({
92
108
  $props: import('primevue/popover').PopoverProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
93
109
  $slots: import('primevue/popover').PopoverSlots;
@@ -102,14 +118,18 @@ declare function __VLS_template(): {
102
118
  rootEl: HTMLDivElement;
103
119
  };
104
120
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
105
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
121
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
122
+ scrollToRow: typeof scrollToRow;
123
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
106
124
  "row-expand": (data: unknown) => any;
107
125
  "row-collapse": (data: unknown) => any;
108
126
  print: (data: Record<string, unknown>) => any;
109
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
127
+ "update:selectedRow": (value: Record<string, unknown> | null) => any;
128
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
110
129
  "onRow-expand"?: ((data: unknown) => any) | undefined;
111
130
  "onRow-collapse"?: ((data: unknown) => any) | undefined;
112
131
  onPrint?: ((data: Record<string, unknown>) => any) | undefined;
132
+ "onUpdate:selectedRow"?: ((value: Record<string, unknown> | null) => any) | undefined;
113
133
  }>, {
114
134
  dialogWidth: string;
115
135
  showSearch: boolean;
@@ -131,6 +151,11 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
131
151
  csvScope: "all" | "page";
132
152
  csvPageSize: number;
133
153
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
154
+ tableRef: ({
155
+ $props: import('primevue/datatable').DataTableProps<any> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
156
+ $slots: import('primevue/datatable').DataTableSlots<any>;
157
+ $emit: ((e: "page", event: import('primevue/datatable').DataTablePageEvent) => void) & ((e: "sort", event: import('primevue/datatable').DataTableSortEvent) => void) & ((e: "filter", event: import('primevue/datatable').DataTableFilterEvent) => void) & ((e: "value-change", value: any[]) => void) & ((e: "update:first", value: number) => void) & ((e: "update:rows", value: number) => void) & ((e: "update:sortField", value: string) => void) & ((e: "update:sortOrder", value: number | undefined) => void) & ((e: "update:multiSortMeta", value: import('primevue/datatable').DataTableSortMeta[] | null | undefined) => void) & ((e: "update:selection", value: any) => void) & ((e: "update:contextMenuSelection", value: any) => void) & ((e: "update:expandedRows", value: any[] | import('primevue/datatable').DataTableExpandedRows) => void) & ((e: "update:expandedRowGroups", value: any[] | import('primevue/datatable').DataTableExpandedRows) => void) & ((e: "update:filters", value: import('primevue/datatable').DataTableFilterMeta) => void) & ((e: "update:editingRows", value: any[] | import('primevue/datatable').DataTableEditingRows) => void) & ((e: "row-click", event: import('primevue/datatable').DataTableRowClickEvent<any>) => void) & ((e: "row-dblclick", event: import('primevue/datatable').DataTableRowDoubleClickEvent) => void) & ((e: "row-contextmenu", event: import('primevue/datatable').DataTableRowContextMenuEvent) => void) & ((e: "row-select", event: import('primevue/datatable').DataTableRowSelectEvent<any>) => void) & ((e: "row-select-all", event: import('primevue/datatable').DataTableRowSelectAllEvent<any>) => void) & ((e: "row-unselect-all", event: import('primevue/datatable').DataTableRowUnselectAllEvent) => void) & ((e: "row-unselect", event: import('primevue/datatable').DataTableRowUnselectEvent) => void) & ((e: "select-all-change", event: import('primevue/datatable').DataTableSelectAllChangeEvent) => void) & ((e: "column-resize-end", event: import('primevue/datatable').DataTableColumnResizeEndEvent) => void) & ((e: "column-reorder", event: import('primevue/datatable').DataTableColumnReorderEvent) => void) & ((e: "row-reorder", event: import('primevue/datatable').DataTableRowReorderEvent) => void) & ((e: "row-expand", event: import('primevue/datatable').DataTableRowExpandEvent<any>) => void) & ((e: "row-collapse", event: import('primevue/datatable').DataTableRowCollapseEvent) => void) & ((e: "rowgroup-expand", event: import('primevue/datatable').DataTableRowExpandEvent<any>) => void) & ((e: "rowgroup-collapse", event: import('primevue/datatable').DataTableRowCollapseEvent) => void) & ((e: "cell-edit-init", event: import('primevue/datatable').DataTableCellEditInitEvent<any>) => void) & ((e: "cell-edit-complete", event: import('primevue/datatable').DataTableCellEditCompleteEvent<any>) => void) & ((e: "cell-edit-cancel", event: import('primevue/datatable').DataTableCellEditCancelEvent) => void) & ((e: "row-edit-init", event: import('primevue/datatable').DataTableRowEditInitEvent<any>) => void) & ((e: "row-edit-save", event: import('primevue/datatable').DataTableRowEditSaveEvent<any>) => void) & ((e: "row-edit-cancel", event: import('primevue/datatable').DataTableRowEditCancelEvent<any>) => void) & ((e: "state-restore", event: import('primevue/datatable').DataTableStateEvent<any>) => void) & ((e: "state-save", event: import('primevue/datatable').DataTableStateEvent<any>) => void);
158
+ } & import('primevue/datatable').DataTableMethods) | null;
134
159
  chooser: ({
135
160
  $props: import('primevue/popover').PopoverProps & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
136
161
  $slots: import('primevue/popover').PopoverSlots;
@@ -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';
@@ -1,4 +1,4 @@
1
- import { MapSelectFeature, MapSelectGeometry, MapSelectId, MapSelectPolygonStyle } from '../../types/mapSelect';
1
+ import { MapSelectFeature, 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
  *
@@ -66,12 +66,30 @@ type __VLS_Props = {
66
66
  * duplica a busca da própria tela e a área somada não tem o que somar.
67
67
  * `modelValue` continua valendo: dá para destacar um polígono de fora. */
68
68
  readonly?: boolean;
69
+ /** Tooltip dos polígonos. `'permanent'` (default) mantém o rótulo sempre
70
+ * visível; `'hover'` só o mostra sob o cursor — com muitos polígonos
71
+ * (100+), o permanente vira um nó DOM por talhão reposicionado a cada
72
+ * pan/zoom, e o `'hover'` devolve a fluidez. */
73
+ tooltips?: MapSelectTooltips;
74
+ /** Modo de seleção por clique. Sem valor, o default preserva o comportamento
75
+ * de sempre: interativo → `'multiple'`, `readonly` → `'none'`. Definido
76
+ * explicitamente, vale MESMO com `readonly` (que segue escondendo painel e
77
+ * rodapé): o clique no polígono emite `update:modelValue`. Em `'single'` o
78
+ * clique substitui a seleção (`[id]`) e clicar no selecionado desmarca. */
79
+ selectionMode?: MapSelectSelectionMode;
69
80
  /** Estilo do polígono não selecionado. */
70
81
  polygonStyle?: MapSelectPolygonStyle;
71
82
  /** Estilo do polígono selecionado. */
72
83
  polygonSelectedStyle?: MapSelectPolygonStyle;
73
84
  };
74
85
  declare function setCollapsed(value: boolean): void;
86
+ declare function fitToScope(): void;
87
+ /** Enquadra a layer de um id, com o mesmo padding do escopo. No-op se o id não
88
+ * tem layer (sem geometria, ainda não chegou, mapa fora do ar). */
89
+ declare function fitToFeature(id: MapSelectId, options?: {
90
+ padding?: [number, number];
91
+ maxZoom?: number;
92
+ }): void;
75
93
  /** O mapa costuma nascer escondido (dentro de um Dialog): sem isto o Leaflet
76
94
  * calcula 0×0 e desenha só um pedaço quando o container aparece. */
77
95
  declare function refreshSize(): void;
@@ -101,6 +119,11 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
101
119
  /** Painel flutuante recolhido? (só faz sentido no `layout="sobreposto"`.) */
102
120
  collapsed: Readonly<import('vue').Ref<boolean, boolean>>;
103
121
  setCollapsed: typeof setCollapsed;
122
+ /** Reenquadra no escopo (ou na união das features) — o fit automático só
123
+ * acontece uma vez; páginas novas de `features` não movem o mapa. */
124
+ fitToScope: typeof fitToScope;
125
+ /** Enquadra o polígono de um id (padding igual ao do escopo). No-op sem layer. */
126
+ fitToFeature: typeof fitToFeature;
104
127
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
105
128
  "update:modelValue": (ids: MapSelectId[]) => any;
106
129
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
@@ -110,6 +133,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
110
133
  disabled: boolean;
111
134
  height: string;
112
135
  readonly: boolean;
136
+ selectionMode: MapSelectSelectionMode;
113
137
  emptyMessage: string;
114
138
  features: MapSelectFeature[];
115
139
  scopeGeometry: MapSelectGeometry | null;
@@ -127,6 +151,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
127
151
  expandLabel: string;
128
152
  badgeLabel: string;
129
153
  mapErrorMessage: string;
154
+ tooltips: MapSelectTooltips;
130
155
  polygonStyle: MapSelectPolygonStyle;
131
156
  polygonSelectedStyle: MapSelectPolygonStyle;
132
157
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-BsT2oBqn.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.WCrudView=_._sfc_main$5;exports.WDatePicker=_._sfc_main$6;exports.WDateRange=_._sfc_main$7;exports.WDetailHeader=_._sfc_main$8;exports.WEditableTable=_._sfc_main$9;exports.WEmptyState=_._sfc_main$10;exports.WFileUpload=_._sfc_main$11;exports.WFormRenderer=_._sfc_main$12;exports.WFormSection=_._sfc_main$13;exports.WImageCropper=_.WImageCropper;exports.WInfoCard=_._sfc_main$14;exports.WKanbanBoard=_._sfc_main$15;exports.WKpiCard=_._sfc_main$16;exports.WKpiGrid=_._sfc_main$17;exports.WMapSelect=_._sfc_main$18;exports.WMarkdownEditor=_._sfc_main$19;exports.WMarkdownToc=_._sfc_main$20;exports.WMarkdownView=_._sfc_main$21;exports.WMoneyInput=_._sfc_main$22;exports.WPageHeader=_._sfc_main$23;exports.WProgressFlow=_._sfc_main$24;exports.WSectionHeader=_._sfc_main$25;exports.WStatusTag=_._sfc_main$26;exports.WStepFlow=_._sfc_main$27;exports.WStepSection=_._sfc_main$28;exports.WTabBar=_._sfc_main$29;exports.WTransferList=_._sfc_main$30;exports.WTreeSelect=_._sfc_main$31;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-DX-6iLgb.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
@@ -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 c, k as C, l as m, m as S, W as u, n as w, o as g, p as F, q as k, r as T, s as b, 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 } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-f9YyFJQM.js";
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-Cx3AJma_.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 WCrudView,
9
- i as WDatePicker,
10
- n as WDateRange,
11
- l as WDetailHeader,
12
- p as WEditableTable,
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
- C as WFileUpload,
15
- m as WFormRenderer,
16
- S as WFormSection,
17
- u as WImageCropper,
18
- w as WInfoCard,
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
- F as WKpiCard,
21
+ b as WKpiCard,
21
22
  k as WKpiGrid,
22
23
  T as WMapSelect,
23
- b as WMarkdownEditor,
24
- D as WMarkdownToc,
25
- M as WMarkdownView,
26
- f as WMoneyInput,
27
- B as WPageHeader,
28
- E as WProgressFlow,
29
- K as WSectionHeader,
30
- y as WStatusTag,
31
- A as WStepFlow,
32
- H as WStepSection,
33
- I as WTabBar,
34
- P as WTransferList,
35
- R as WTreeSelect
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
@@ -1,4 +1,5 @@
1
1
  export { useCrudManager } from './useCrudManager';
2
+ export { useSubviewCrud } from './useSubviewCrud';
2
3
  export { defineCrudConfig } from './defineCrudConfig';
3
4
  export { useFormKeyboardNav } from './useFormKeyboardNav';
4
5
  export { useDateInput } from './useDateInput';
@@ -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>;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useApi-237Q1Vdg.cjs"),e=require("./useFormKeyboardNav-D4Ow3k4Y.cjs");function s(u){return u}exports.useApi=r.useApi;exports.useCrudManager=r.useCrudManager;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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useApi-CPt3Tj4n.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
@@ -1,18 +1,19 @@
1
- import { u, a as o } from "./useApi-BsrLTNwE.js";
2
- import { e as p, u as n, a as f, b as i, c as d, d as m, f as A } from "./useFormKeyboardNav-D4Irq5RE.js";
1
+ import { u, a as o, b as t } from "./useApi-BM5JpPDe.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
- p as extractApiError,
8
+ i as extractApiError,
9
9
  u as useApi,
10
10
  n as useApiError,
11
11
  f as useAppConfirm,
12
- i as useAppToast,
12
+ d as useAppToast,
13
13
  o as useCrudManager,
14
- d as useDateInput,
15
- m as useFormKeyboardNav,
16
- A as useFormatters
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"),r=require("./WKanbanBoard.vue_vue_type_script_setup_true_lang-BsT2oBqn.cjs"),A=require("./useApi-237Q1Vdg.cjs"),m=require("./useFormKeyboardNav-D4Ow3k4Y.cjs"),F=require("./types.cjs");function C(e,a,t){const n=e;return Array.isArray(n.results)?{data:n.results,page:n.page??a,page_size:n.page_size??t,rows:n.count??0,extras:n.extras??{}}:Array.isArray(n.data)?{data:n.data,page:n.page??a,page_size:n.page_size??t,rows:n.rows??0,extras:n.extras??{}}:{data:Array.isArray(e)?e:[],page:a,page_size:t,rows:Array.isArray(e)?e.length:0,extras:{}}}function y(e){return{async list(a,t={}){const n=await e.get(a,{params:t});return C(n.data,Number(t.page??1),Number(t.page_size??20))},async get(a,t,n){return{data:(await e.get(`${a}${t}/`,n)).data}},async create(a,t,n){return{data:(await e.post(a,t,n)).data}},async update(a,t,n,i){return{data:(await e.patch(`${a}${t}/`,n,i)).data}},async delete(a,t){await e.delete(`${a}${t}/`)}}}const P={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 t=a.dataProvider??y(a.axios),n={axios:a.axios,dataProvider:t,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,t),e.provide(_.W_CONFIG_KEY,n),a.registerComponents!==!1&&(e.component("WCrudView",r._sfc_main$5),e.component("WCrudFormDialog",r._sfc_main$4),e.component("WCrudColumnRenderer",r._sfc_main$3),e.component("WAutoCompleteFK",r._sfc_main$1),e.component("WMoneyInput",r._sfc_main$22),e.component("WTransferList",r._sfc_main$30),e.component("WTreeSelect",r._sfc_main$31))}};function w(e){return e.split("?")[0].replace(/^\/+|\/+$/g,"").replace(/^api\/v\d+\//,"")}function E(e){return typeof e=="string"?{table:e}:e}function D(e,a=400){return{response:{status:a,data:{detail:e}},message:e}}function $(e){if(e instanceof FormData)throw D("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 t=w(e),n=(i=a.resources)==null?void 0:i[t];if(n)return E(n);if((s=a.allowedTables)!=null&&s.includes(t))return{table:t};throw D(`Recurso Supabase nao registrado para o endpoint "${e}".`,404)}function S(e,a,t){const n=new Set(["page","page_size","search","ordering"]),i={...t.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 v(e,a,t){if(typeof a!="string"||!a.trim()||!(t!=null&&t.length))return e;const n=a.trim().replace(/,/g,"\\,"),i=t.map(s=>`${s}.ilike.%${n}%`).join(",");return e.or(i)}function T(e,a){const t=typeof e=="string"&&e?e:a;return t?{field:t.startsWith("-")?t.slice(1):t,ascending:!t.startsWith("-")}:null}function b(e,a){return e?a.mapListItem?e.map(t=>{var n;return(n=a.mapListItem)==null?void 0:n.call(a,t)}):e:[]}function R(e){const a=e.defaultSelect??"*";return{async list(t,n={}){var W;const i=g(t,e),s=Math.max(Number(n.page??1),1),o=Math.max(Number(n.page_size??20),1),c=(s-1)*o,l=c+o-1;let u=e.client.from(i.table).select(i.select??a,{count:"exact"});u=S(u,n,i),u=v(u,n.search,i.searchFields);const d=T(n.ordering,i.defaultOrdering);d&&(u=u.order(d.field,{ascending:d.ascending}));const f=await u.range(c,l);return f.error&&p(f.error),{data:b(f.data,i),page:s,page_size:o,rows:f.count??((W=f.data)==null?void 0:W.length)??0,extras:{}}},async get(t,n,i){const s=g(t,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(t,n,i){const s=g(t,e),o=$(n),c=s.mapPayload?s.mapPayload(o,"create"):o,l=await e.client.from(s.table).insert(c).select(s.select??a).single();return l.error&&p(l.error),{data:l.data}},async update(t,n,i,s){const o=g(t,e),c=o.pk??"id",l=$(i),u=o.mapPayload?o.mapPayload(l,"update"):l,d=await e.client.from(o.table).update(u).eq(c,n).select(o.select??a).single();return d.error&&p(d.error),{data:d.data}},async delete(t,n){const i=g(t,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=r._sfc_main;exports.WAutoCompleteFK=r._sfc_main$1;exports.WCheckList=r._sfc_main$2;exports.WCrudColumnRenderer=r._sfc_main$3;exports.WCrudFormDialog=r._sfc_main$4;exports.WCrudView=r._sfc_main$5;exports.WDatePicker=r._sfc_main$6;exports.WDateRange=r._sfc_main$7;exports.WDetailHeader=r._sfc_main$8;exports.WEditableTable=r._sfc_main$9;exports.WEmptyState=r._sfc_main$10;exports.WFileUpload=r._sfc_main$11;exports.WFormRenderer=r._sfc_main$12;exports.WFormSection=r._sfc_main$13;exports.WImageCropper=r.WImageCropper;exports.WInfoCard=r._sfc_main$14;exports.WKanbanBoard=r._sfc_main$15;exports.WKpiCard=r._sfc_main$16;exports.WKpiGrid=r._sfc_main$17;exports.WMapSelect=r._sfc_main$18;exports.WMarkdownEditor=r._sfc_main$19;exports.WMarkdownToc=r._sfc_main$20;exports.WMarkdownView=r._sfc_main$21;exports.WMoneyInput=r._sfc_main$22;exports.WPageHeader=r._sfc_main$23;exports.WProgressFlow=r._sfc_main$24;exports.WSectionHeader=r._sfc_main$25;exports.WStatusTag=r._sfc_main$26;exports.WStepFlow=r._sfc_main$27;exports.WStepSection=r._sfc_main$28;exports.WTabBar=r._sfc_main$29;exports.WTransferList=r._sfc_main$30;exports.WTreeSelect=r._sfc_main$31;exports.W_STEP_FLOW_KEY=r.W_STEP_FLOW_KEY;exports.downloadCsv=r.downloadCsv;exports.mapApiFieldToColumnDef=r.mapApiFieldToColumnDef;exports.mapApiFieldToFieldDef=r.mapApiFieldToFieldDef;exports.mapApiFieldsToColumnDefs=r.mapApiFieldsToColumnDefs;exports.mapApiFieldsToFieldDefs=r.mapApiFieldsToFieldDefs;exports.toCsv=r.toCsv;exports.useApi=A.useApi;exports.useCrudManager=A.useCrudManager;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=F.DEFAULT_CRUD_LABELS;exports.WPrimeVuePlugin=P;exports.createAxiosDataProvider=y;exports.createSupabaseDataProvider=R;
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-DX-6iLgb.cjs"),W=require("./useApi-CPt3Tj4n.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 { e as A, d as P, c as C, a as S, v as F, D as b, E as v } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-f9YyFJQM.js";
3
- import { _ as B, b as O, f as V, g as H, h as N, i as q, j, k as U, l as G, m as J, W as X, n as Q, o as Z, p as ee, q as ae, r as te, s as re, t as se, u as ne, w as oe, x as ie, y as ce, z as le, A as de, B as ue, C as fe, F as me, G as pe, H as ge, I as We, J as ye, K as _e, L as we } from "./WKanbanBoard.vue_vue_type_script_setup_true_lang-f9YyFJQM.js";
4
- import { u as Pe, a as Ce } from "./useApi-BsrLTNwE.js";
5
- import { e as Fe, u as be, a as ve, b as De, c as xe, f as Ee } from "./useFormKeyboardNav-D4Irq5RE.js";
6
- import { DEFAULT_CRUD_LABELS as he } from "./types.js";
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-Cx3AJma_.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-Cx3AJma_.js";
4
+ import { u as be, a as Ae, b as Pe } from "./useApi-BM5JpPDe.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", A), e.component("WCrudFormDialog", P), e.component("WCrudColumnRenderer", C), e.component("WAutoCompleteFK", S), e.component("WMoneyInput", F), e.component("WTransferList", b), e.component("WTreeSelect", v));
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, l = i + o - 1;
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 d = R(r.ordering, s.defaultOrdering);
149
- d && (c = c.order(d.field, { ascending: d.ascending }));
150
- const u = await c.range(i, l);
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, l = await e.client.from(n.table).insert(i).select(n.select ?? a).single();
165
- return l.error && f(l.error), { data: l.data };
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", l = g(s), c = o.mapPayload ? o.mapPayload(l, "update") : l, d = await e.client.from(o.table).update(c).eq(i, r).select(o.select ?? a).single();
169
- return d.error && f(d.error), { data: d.data };
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
- he as DEFAULT_CRUD_LABELS,
178
+ Re as DEFAULT_CRUD_LABELS,
179
179
  B as WActionBar,
180
- S as WAutoCompleteFK,
180
+ A as WAutoCompleteFK,
181
181
  O as WCheckList,
182
- C as WCrudColumnRenderer,
183
- P as WCrudFormDialog,
184
- A as WCrudView,
185
- V as WDatePicker,
186
- H as WDateRange,
187
- N as WDetailHeader,
188
- q as WEditableTable,
189
- j as WEmptyState,
190
- U as WFileUpload,
191
- G as WFormRenderer,
192
- J as WFormSection,
193
- X as WImageCropper,
194
- Q as WInfoCard,
195
- Z as WKanbanBoard,
196
- ee as WKpiCard,
197
- ae as WKpiGrid,
198
- te as WMapSelect,
199
- re as WMarkdownEditor,
200
- se as WMarkdownToc,
201
- ne as WMarkdownView,
202
- F as WMoneyInput,
203
- oe as WPageHeader,
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
- ie as WProgressFlow,
206
- ce as WSectionHeader,
206
+ ce as WProgressFlow,
207
+ de as WSectionHeader,
207
208
  le as WStatusTag,
208
- de as WStepFlow,
209
- ue as WStepSection,
210
- fe as WTabBar,
211
- b as WTransferList,
212
- v as WTreeSelect,
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
- me as W_STEP_FLOW_KEY,
217
+ pe as W_STEP_FLOW_KEY,
217
218
  x as createAxiosDataProvider,
218
219
  Y as createSupabaseDataProvider,
219
- pe as downloadCsv,
220
+ ge as downloadCsv,
220
221
  Fe as extractApiError,
221
- ge as mapApiFieldToColumnDef,
222
- We as mapApiFieldToFieldDef,
223
- ye as mapApiFieldsToColumnDefs,
224
- _e as mapApiFieldsToFieldDefs,
225
- we as toCsv,
226
- Pe as useApi,
227
- be as useApiError,
228
- ve as useAppConfirm,
229
- De as useAppToast,
230
- Ce as useCrudManager,
231
- xe as useDateInput,
232
- Ee as useFormatters
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