@wgalleti/primevue-components 0.3.4

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 (85) hide show
  1. package/README.md +218 -0
  2. package/dist/components/crud/WCrudColumnRenderer.vue.d.ts +8 -0
  3. package/dist/components/crud/WCrudFormDialog.vue.d.ts +214 -0
  4. package/dist/components/crud/WCrudView.vue.d.ts +89 -0
  5. package/dist/components/form/WAutoCompleteFK.vue.d.ts +43 -0
  6. package/dist/components/form/WFormRenderer.vue.d.ts +41 -0
  7. package/dist/components/form/WMoneyInput.vue.d.ts +28 -0
  8. package/dist/components/form/WTransferList.vue.d.ts +25 -0
  9. package/dist/components/index.d.ts +18 -0
  10. package/dist/components/ui/WActionBar.vue.d.ts +27 -0
  11. package/dist/components/ui/WDetailHeader.vue.d.ts +29 -0
  12. package/dist/components/ui/WEmptyState.vue.d.ts +13 -0
  13. package/dist/components/ui/WFormSection.vue.d.ts +23 -0
  14. package/dist/components/ui/WInfoCard.vue.d.ts +11 -0
  15. package/dist/components/ui/WKpiCard.vue.d.ts +33 -0
  16. package/dist/components/ui/WKpiGrid.vue.d.ts +31 -0
  17. package/dist/components/ui/WPageHeader.vue.d.ts +27 -0
  18. package/dist/components/ui/WProgressFlow.vue.d.ts +33 -0
  19. package/dist/components/ui/WSectionHeader.vue.d.ts +25 -0
  20. package/dist/components/ui/WStatusTag.vue.d.ts +10 -0
  21. package/dist/composables/index.d.ts +6 -0
  22. package/dist/composables/useApi.d.ts +2 -0
  23. package/dist/composables/useApiError.d.ts +4 -0
  24. package/dist/composables/useAppConfirm.d.ts +4 -0
  25. package/dist/composables/useAppToast.d.ts +6 -0
  26. package/dist/composables/useCrudManager.d.ts +2 -0
  27. package/dist/composables/useFormatters.d.ts +19 -0
  28. package/dist/data-providers/axiosDataProvider.d.ts +3 -0
  29. package/dist/data-providers/index.d.ts +2 -0
  30. package/dist/data-providers/supabaseDataProvider.d.ts +54 -0
  31. package/dist/index.cjs +11 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.d.ts +11 -0
  34. package/dist/index.js +3287 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/plugin.d.ts +2 -0
  37. package/dist/primevue-components.css +1 -0
  38. package/dist/types/api.d.ts +60 -0
  39. package/dist/types/components/crud/WCrudColumnRenderer.vue.d.ts +8 -0
  40. package/dist/types/components/crud/WCrudFormDialog.vue.d.ts +49 -0
  41. package/dist/types/components/crud/WCrudView.vue.d.ts +103 -0
  42. package/dist/types/components/form/WAutoCompleteFK.vue.d.ts +43 -0
  43. package/dist/types/components/form/WFormRenderer.vue.d.ts +40 -0
  44. package/dist/types/components/form/WMoneyInput.vue.d.ts +28 -0
  45. package/dist/types/components/form/WTransferList.vue.d.ts +25 -0
  46. package/dist/types/components/index.d.ts +18 -0
  47. package/dist/types/components/ui/WActionBar.vue.d.ts +25 -0
  48. package/dist/types/components/ui/WDetailHeader.vue.d.ts +24 -0
  49. package/dist/types/components/ui/WEmptyState.vue.d.ts +13 -0
  50. package/dist/types/components/ui/WFormSection.vue.d.ts +19 -0
  51. package/dist/types/components/ui/WInfoCard.vue.d.ts +11 -0
  52. package/dist/types/components/ui/WKpiCard.vue.d.ts +32 -0
  53. package/dist/types/components/ui/WKpiGrid.vue.d.ts +26 -0
  54. package/dist/types/components/ui/WPageHeader.vue.d.ts +22 -0
  55. package/dist/types/components/ui/WProgressFlow.vue.d.ts +28 -0
  56. package/dist/types/components/ui/WSectionHeader.vue.d.ts +22 -0
  57. package/dist/types/components/ui/WStatusTag.vue.d.ts +10 -0
  58. package/dist/types/composables/index.d.ts +6 -0
  59. package/dist/types/composables/useApi.d.ts +2 -0
  60. package/dist/types/composables/useApiError.d.ts +4 -0
  61. package/dist/types/composables/useAppConfirm.d.ts +4 -0
  62. package/dist/types/composables/useAppToast.d.ts +6 -0
  63. package/dist/types/composables/useCrudManager.d.ts +2 -0
  64. package/dist/types/composables/useFormatters.d.ts +19 -0
  65. package/dist/types/crud.d.ts +184 -0
  66. package/dist/types/data-providers/axiosDataProvider.d.ts +3 -0
  67. package/dist/types/data-providers/index.d.ts +2 -0
  68. package/dist/types/data-providers/supabaseDataProvider.d.ts +54 -0
  69. package/dist/types/dataProvider.d.ts +28 -0
  70. package/dist/types/index.d.ts +12 -0
  71. package/dist/types/plugin.d.ts +2 -0
  72. package/dist/types/types/api.d.ts +60 -0
  73. package/dist/types/types/crud.d.ts +184 -0
  74. package/dist/types/types/dataProvider.d.ts +28 -0
  75. package/dist/types/types/index.d.ts +6 -0
  76. package/dist/types/types/plugin.d.ts +24 -0
  77. package/dist/types/utils/cep.d.ts +14 -0
  78. package/dist/types/utils/dates.d.ts +5 -0
  79. package/dist/types/utils/fieldMapper.d.ts +20 -0
  80. package/dist/types/utils/masks.d.ts +8 -0
  81. package/dist/utils/cep.d.ts +14 -0
  82. package/dist/utils/dates.d.ts +5 -0
  83. package/dist/utils/fieldMapper.d.ts +20 -0
  84. package/dist/utils/masks.d.ts +8 -0
  85. package/package.json +78 -0
@@ -0,0 +1,24 @@
1
+ import type { AxiosInstance } from 'axios';
2
+ import type { DataProvider } from './dataProvider';
3
+ export interface WPluginOptions {
4
+ axios?: AxiosInstance;
5
+ dataProvider?: DataProvider;
6
+ defaultPageSize?: number;
7
+ dateFormat?: string;
8
+ dateTimeFormat?: string;
9
+ locale?: string;
10
+ currency?: string;
11
+ registerComponents?: boolean;
12
+ }
13
+ export interface WPluginConfig {
14
+ axios?: AxiosInstance;
15
+ dataProvider: DataProvider;
16
+ defaultPageSize: number;
17
+ dateFormat: string;
18
+ dateTimeFormat: string;
19
+ locale: string;
20
+ currency: string;
21
+ }
22
+ export declare const W_AXIOS_KEY: unique symbol;
23
+ export declare const W_DATA_PROVIDER_KEY: unique symbol;
24
+ export declare const W_CONFIG_KEY: unique symbol;
@@ -0,0 +1,14 @@
1
+ export interface ViaCepResponse {
2
+ cep: string;
3
+ logradouro: string;
4
+ complemento: string;
5
+ bairro: string;
6
+ localidade: string;
7
+ uf: string;
8
+ ibge: string;
9
+ gia: string;
10
+ ddd: string;
11
+ siafi: string;
12
+ erro?: true;
13
+ }
14
+ export declare function lookupCep(cep: string): Promise<ViaCepResponse | null>;
@@ -0,0 +1,5 @@
1
+ export declare function parseDate(value: string | Date | null | undefined): Date | null;
2
+ export declare function toDateString(value: Date | string | null | undefined): string | null;
3
+ export declare function toDateTimeString(value: Date | string | null | undefined): string | null;
4
+ export declare function formatDateValue(value: string | Date | null | undefined, format?: string): string;
5
+ export declare function formatDateTimeValue(value: string | Date | null | undefined): string;
@@ -0,0 +1,20 @@
1
+ import type { FieldDef, ColumnDef } from '@/types/crud';
2
+ export interface ApiFieldMeta {
3
+ name: string;
4
+ label: string;
5
+ type: string;
6
+ required?: boolean;
7
+ max_length?: number;
8
+ choices?: {
9
+ value: string;
10
+ label: string;
11
+ }[];
12
+ read_only?: boolean;
13
+ endpoint?: string;
14
+ option_label?: string;
15
+ option_value?: string;
16
+ }
17
+ export declare function mapApiFieldToFieldDef(apiField: ApiFieldMeta): FieldDef;
18
+ export declare function mapApiFieldsToFieldDefs(apiFields: ApiFieldMeta[]): FieldDef[];
19
+ export declare function mapApiFieldToColumnDef(apiField: ApiFieldMeta): ColumnDef;
20
+ export declare function mapApiFieldsToColumnDefs(apiFields: ApiFieldMeta[], maxColumns?: number): ColumnDef[];
@@ -0,0 +1,8 @@
1
+ export declare function stripMask(value: string): string;
2
+ export declare function formatCpf(value: string | null | undefined): string;
3
+ export declare function formatCnpj(value: string | null | undefined): string;
4
+ export declare function formatCpfCnpj(value: string | null | undefined): string;
5
+ export declare function formatTelefone(value: string | null | undefined): string;
6
+ export declare function validateCpf(value: string | null | undefined): string | null;
7
+ export declare function validateCnpj(value: string | null | undefined): string | null;
8
+ export declare function validateCpfCnpj(value: string | null | undefined): string | null;
@@ -0,0 +1,14 @@
1
+ export interface ViaCepResponse {
2
+ cep: string;
3
+ logradouro: string;
4
+ complemento: string;
5
+ bairro: string;
6
+ localidade: string;
7
+ uf: string;
8
+ ibge: string;
9
+ gia: string;
10
+ ddd: string;
11
+ siafi: string;
12
+ erro?: true;
13
+ }
14
+ export declare function lookupCep(cep: string): Promise<ViaCepResponse | null>;
@@ -0,0 +1,5 @@
1
+ export declare function parseDate(value: string | Date | null | undefined): Date | null;
2
+ export declare function toDateString(value: Date | string | null | undefined): string | null;
3
+ export declare function toDateTimeString(value: Date | string | null | undefined): string | null;
4
+ export declare function formatDateValue(value: string | Date | null | undefined, format?: string): string;
5
+ export declare function formatDateTimeValue(value: string | Date | null | undefined): string;
@@ -0,0 +1,20 @@
1
+ import { FieldDef, ColumnDef } from '../types/crud';
2
+ export interface ApiFieldMeta {
3
+ name: string;
4
+ label: string;
5
+ type: string;
6
+ required?: boolean;
7
+ max_length?: number;
8
+ choices?: {
9
+ value: string;
10
+ label: string;
11
+ }[];
12
+ read_only?: boolean;
13
+ endpoint?: string;
14
+ option_label?: string;
15
+ option_value?: string;
16
+ }
17
+ export declare function mapApiFieldToFieldDef(apiField: ApiFieldMeta): FieldDef;
18
+ export declare function mapApiFieldsToFieldDefs(apiFields: ApiFieldMeta[]): FieldDef[];
19
+ export declare function mapApiFieldToColumnDef(apiField: ApiFieldMeta): ColumnDef;
20
+ export declare function mapApiFieldsToColumnDefs(apiFields: ApiFieldMeta[], maxColumns?: number): ColumnDef[];
@@ -0,0 +1,8 @@
1
+ export declare function stripMask(value: string): string;
2
+ export declare function formatCpf(value: string | null | undefined): string;
3
+ export declare function formatCnpj(value: string | null | undefined): string;
4
+ export declare function formatCpfCnpj(value: string | null | undefined): string;
5
+ export declare function formatTelefone(value: string | null | undefined): string;
6
+ export declare function validateCpf(value: string | null | undefined): string | null;
7
+ export declare function validateCnpj(value: string | null | undefined): string | null;
8
+ export declare function validateCpfCnpj(value: string | null | undefined): string | null;
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@wgalleti/primevue-components",
3
+ "version": "0.3.4",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "packageManager": "yarn@1.22.22",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "main": "./dist/index.cjs",
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.cjs"
22
+ },
23
+ "./style.css": "./dist/primevue-components.css"
24
+ },
25
+ "sideEffects": [
26
+ "**/*.css"
27
+ ],
28
+ "scripts": {
29
+ "dev": "yarn --cwd playground dev",
30
+ "build": "vite build && vue-tsc --declaration --emitDeclarationOnly --outDir dist/types",
31
+ "type-check": "vue-tsc --noEmit",
32
+ "lint": "eslint \"src/**/*.{vue,js,ts}\" --fix",
33
+ "format": "prettier --write src/",
34
+ "prepublishOnly": "yarn build",
35
+ "release": "yarn type-check && yarn build && npm publish --registry https://registry.npmjs.org/",
36
+ "release:patch": "yarn version --patch && yarn release",
37
+ "release:minor": "yarn version --minor && yarn release",
38
+ "release:major": "yarn version --major && yarn release",
39
+ "docs:dev": "vitepress dev docs",
40
+ "docs:build": "vitepress build docs",
41
+ "docs:preview": "vitepress preview docs"
42
+ },
43
+ "peerDependencies": {
44
+ "axios": "^1.0.0",
45
+ "dayjs": "^1.11.0",
46
+ "primevue": "^4.2.0",
47
+ "vue": "^3.4.0"
48
+ },
49
+ "peerDependenciesMeta": {
50
+ "axios": {
51
+ "optional": true
52
+ }
53
+ },
54
+ "dependencies": {
55
+ "maska": "^3.2.0"
56
+ },
57
+ "devDependencies": {
58
+ "@primevue/themes": "^4.2.0",
59
+ "@vitejs/plugin-vue": "^5.2.0",
60
+ "axios": "^1.7.0",
61
+ "dayjs": "^1.11.0",
62
+ "prettier": "^3.4.0",
63
+ "primeicons": "^7.0.0",
64
+ "primevue": "^4.2.0",
65
+ "typescript": "~5.7.0",
66
+ "vite": "^6.0.0",
67
+ "vite-plugin-dts": "^4.0.0",
68
+ "vitepress": "^1.6.4",
69
+ "vue": "^3.5.0",
70
+ "vue-tsc": "^2.2.0"
71
+ },
72
+ "workspaces": [
73
+ "playground"
74
+ ],
75
+ "engines": {
76
+ "node": ">=18.0.0"
77
+ }
78
+ }