@donotdev/ui 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/crud/components/EntityCardList.d.ts +16 -0
- package/dist/crud/components/EntityCardList.d.ts.map +1 -0
- package/dist/crud/components/EntityCardList.js +175 -0
- package/dist/crud/components/EntityDisplayRenderer.d.ts +13 -21
- package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityDisplayRenderer.js +138 -23
- package/dist/crud/components/EntityFormRenderer.d.ts +18 -0
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -0
- package/dist/crud/components/EntityFormRenderer.js +275 -0
- package/dist/crud/components/EntityList.d.ts +14 -0
- package/dist/crud/components/EntityList.d.ts.map +1 -0
- package/dist/crud/components/EntityList.js +201 -0
- package/dist/crud/components/index.d.ts +7 -5
- package/dist/crud/components/index.d.ts.map +1 -1
- package/dist/crud/components/index.js +6 -5
- package/dist/dndev.css +467 -143
- package/dist/index.js +4 -64
- package/dist/internal/common/RouteErrorFallback.d.ts.map +1 -1
- package/dist/internal/common/RouteErrorFallback.js +1 -2
- package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.js +3 -2
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +36 -6
- package/dist/internal/layout/components/NextJsAutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/NextJsAutoMetaTags.js +38 -10
- package/dist/internal/layout/components/footer/FooterBranding.d.ts +0 -2
- package/dist/internal/layout/components/footer/FooterBranding.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterBranding.js +4 -8
- package/dist/internal/layout/components/footer/FooterCopyright.d.ts +0 -2
- package/dist/internal/layout/components/footer/FooterCopyright.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterCopyright.js +2 -6
- package/dist/internal/layout/config/presets/moolti.js +2 -2
- package/dist/internal/layout/zones/DnDevFooter.d.ts.map +1 -1
- package/dist/internal/layout/zones/DnDevFooter.js +2 -2
- package/dist/routing/GoTo.d.ts +1 -1
- package/dist/routing/GoTo.d.ts.map +1 -1
- package/dist/routing/GoTo.js +1 -1
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/useFormNavigationBlocker.d.ts +14 -0
- package/dist/routing/hooks/useFormNavigationBlocker.d.ts.map +1 -0
- package/dist/routing/hooks/useFormNavigationBlocker.js +42 -0
- package/dist/routing/hooks/useNavigate.next.d.ts +1 -1
- package/dist/routing/hooks/useNavigate.next.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.next.js +7 -1
- package/dist/routing/hooks/useNavigate.vite.d.ts +1 -1
- package/dist/routing/hooks/useNavigate.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useNavigate.vite.js +7 -1
- package/dist/styles/index.css +467 -143
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/useFormStoreSafe.d.ts +59 -0
- package/dist/utils/useFormStoreSafe.d.ts.map +1 -0
- package/dist/utils/useFormStoreSafe.js +115 -0
- package/package.json +12 -12
- package/dist/crud/components/DisplayFieldRenderer.d.ts +0 -26
- package/dist/crud/components/DisplayFieldRenderer.d.ts.map +0 -1
- package/dist/crud/components/DisplayFieldRenderer.js +0 -107
- package/dist/crud/components/fields/display/AvatarFieldDisplay.d.ts +0 -23
- package/dist/crud/components/fields/display/AvatarFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/AvatarFieldDisplay.js +0 -38
- package/dist/crud/components/fields/display/BadgeFieldDisplay.d.ts +0 -21
- package/dist/crud/components/fields/display/BadgeFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/BadgeFieldDisplay.js +0 -31
- package/dist/crud/components/fields/display/ButtonFieldDisplay.d.ts +0 -29
- package/dist/crud/components/fields/display/ButtonFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/ButtonFieldDisplay.js +0 -12
- package/dist/crud/components/fields/display/CheckboxFieldDisplay.d.ts +0 -21
- package/dist/crud/components/fields/display/CheckboxFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/CheckboxFieldDisplay.js +0 -27
- package/dist/crud/components/fields/display/DateFieldDisplay.d.ts +0 -24
- package/dist/crud/components/fields/display/DateFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/DateFieldDisplay.js +0 -42
- package/dist/crud/components/fields/display/DropdownDisplay.d.ts +0 -21
- package/dist/crud/components/fields/display/DropdownDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/DropdownDisplay.js +0 -25
- package/dist/crud/components/fields/display/FileFieldDisplay.d.ts +0 -21
- package/dist/crud/components/fields/display/FileFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/FileFieldDisplay.js +0 -25
- package/dist/crud/components/fields/display/GeoPointFieldDisplay.d.ts +0 -25
- package/dist/crud/components/fields/display/GeoPointFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/GeoPointFieldDisplay.js +0 -25
- package/dist/crud/components/fields/display/HiddenFieldDisplay.d.ts +0 -30
- package/dist/crud/components/fields/display/HiddenFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/HiddenFieldDisplay.js +0 -12
- package/dist/crud/components/fields/display/ImageFieldDisplay.d.ts +0 -24
- package/dist/crud/components/fields/display/ImageFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/ImageFieldDisplay.js +0 -38
- package/dist/crud/components/fields/display/LinkFieldDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/LinkFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/LinkFieldDisplay.js +0 -47
- package/dist/crud/components/fields/display/MapFieldDisplay.d.ts +0 -25
- package/dist/crud/components/fields/display/MapFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/MapFieldDisplay.js +0 -25
- package/dist/crud/components/fields/display/MultiDropdownDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/MultiDropdownDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/MultiDropdownDisplay.js +0 -25
- package/dist/crud/components/fields/display/MultiInputTextFieldDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/MultiInputTextFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/MultiInputTextFieldDisplay.js +0 -25
- package/dist/crud/components/fields/display/NumberFieldDisplay.d.ts +0 -24
- package/dist/crud/components/fields/display/NumberFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/NumberFieldDisplay.js +0 -29
- package/dist/crud/components/fields/display/PasswordFieldDisplay.d.ts +0 -24
- package/dist/crud/components/fields/display/PasswordFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/PasswordFieldDisplay.js +0 -31
- package/dist/crud/components/fields/display/PhoneNumberDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/PhoneNumberDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/PhoneNumberDisplay.js +0 -26
- package/dist/crud/components/fields/display/RadioFieldDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/RadioFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/RadioFieldDisplay.js +0 -25
- package/dist/crud/components/fields/display/RangeFieldDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/RangeFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/RangeFieldDisplay.js +0 -25
- package/dist/crud/components/fields/display/ReferenceFieldDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/ReferenceFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/ReferenceFieldDisplay.js +0 -26
- package/dist/crud/components/fields/display/RichTextDisplay.d.ts +0 -25
- package/dist/crud/components/fields/display/RichTextDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/RichTextDisplay.js +0 -104
- package/dist/crud/components/fields/display/TextAreaDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/TextAreaDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/TextAreaDisplay.js +0 -25
- package/dist/crud/components/fields/display/TextFieldDisplay.d.ts +0 -42
- package/dist/crud/components/fields/display/TextFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/TextFieldDisplay.js +0 -97
- package/dist/crud/components/fields/display/TimestampFieldDisplay.d.ts +0 -22
- package/dist/crud/components/fields/display/TimestampFieldDisplay.d.ts.map +0 -1
- package/dist/crud/components/fields/display/TimestampFieldDisplay.js +0 -33
- package/dist/crud/components/fields/display/index.d.ts +0 -32
- package/dist/crud/components/fields/display/index.d.ts.map +0 -1
- package/dist/crud/components/fields/display/index.js +0 -32
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Degraded FormStore state - returned when CRUD package not installed
|
|
3
|
+
* Matches FormStoreState & FormStoreActions interface
|
|
4
|
+
*/
|
|
5
|
+
declare const DEGRADED_FORM_STORE_STATE: {
|
|
6
|
+
readonly forms: {};
|
|
7
|
+
readonly startSubmit: () => void;
|
|
8
|
+
readonly setUploading: () => void;
|
|
9
|
+
readonly setValidating: () => void;
|
|
10
|
+
readonly setSubmitting: () => void;
|
|
11
|
+
readonly setSuccess: () => void;
|
|
12
|
+
readonly setError: () => void;
|
|
13
|
+
readonly reset: () => void;
|
|
14
|
+
readonly cleanup: () => void;
|
|
15
|
+
readonly setIsDirty: () => void;
|
|
16
|
+
readonly hasDirtyForms: () => boolean;
|
|
17
|
+
readonly getDirtyFormIds: () => never[];
|
|
18
|
+
readonly getStatus: () => "idle";
|
|
19
|
+
readonly isLoading: () => boolean;
|
|
20
|
+
readonly getUploadProgress: () => number;
|
|
21
|
+
readonly getError: () => null;
|
|
22
|
+
readonly getIsDirty: () => boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Check if FormStore is available
|
|
26
|
+
*/
|
|
27
|
+
export declare const isFormStoreAvailable: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Safe access to FormStore.
|
|
30
|
+
* Returns degraded state selector result if CRUD package not installed.
|
|
31
|
+
*
|
|
32
|
+
* @param selector - Zustand selector function
|
|
33
|
+
* @returns Selected state, or degraded state selection if CRUD not available
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* const hasDirtyForms = useFormStoreSafe((state) => state.hasDirtyForms());
|
|
38
|
+
* // Always safe to call - returns false when degraded
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function useFormStoreSafe<T>(selector: (state: any) => T): T;
|
|
42
|
+
export declare namespace useFormStoreSafe {
|
|
43
|
+
var getState: () => typeof DEGRADED_FORM_STORE_STATE;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check if any forms are dirty (safe version).
|
|
47
|
+
* Returns false if CRUD package not available.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useHasDirtyFormsSafe(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Check if navigation should be blocked (safe version).
|
|
52
|
+
* Returns a function that checks FormStore and shows confirmation if needed.
|
|
53
|
+
*
|
|
54
|
+
* @param message - Confirmation message
|
|
55
|
+
* @returns Promise<boolean> - true if navigation should proceed
|
|
56
|
+
*/
|
|
57
|
+
export declare function checkFormNavigationSafe(message?: string): Promise<boolean>;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=useFormStoreSafe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormStoreSafe.d.ts","sourceRoot":"","sources":["../../src/utils/useFormStoreSafe.ts"],"names":[],"mappings":"AA8BA;;;GAGG;AACH,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;CAqBrB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB,SAAyC,CAAC;AAE3E;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAKlE;yBALe,gBAAgB;wBAmBA,OAAO,yBAAyB;;AAOhE;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,SAA4C,GAClD,OAAO,CAAC,OAAO,CAAC,CAUlB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// packages/ui/src/utils/useFormStoreSafe.ts
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Safe FormStore access for graceful degradation
|
|
4
|
+
* @description Provides FormStore functionality when @donotdev/crud is installed,
|
|
5
|
+
* gracefully degrades when not installed.
|
|
6
|
+
*
|
|
7
|
+
* ## CRITICAL: DO NOT USE DYNAMIC IMPORTS
|
|
8
|
+
*
|
|
9
|
+
* This file MUST use sync `import * as crudModule from '@donotdev/crud'`
|
|
10
|
+
* at module level. DO NOT refactor to use async `import('@donotdev/crud').then(...)`.
|
|
11
|
+
*
|
|
12
|
+
* @see packages/ui/src/utils/useAuthSafe.ts for pattern reference
|
|
13
|
+
* @see docs/development/GRACEFUL_DEGRADATION.md
|
|
14
|
+
* @version 0.0.1
|
|
15
|
+
* @since 0.0.1
|
|
16
|
+
* @author AMBROISE PARK Consulting
|
|
17
|
+
*/
|
|
18
|
+
import * as crudModule from '@donotdev/crud';
|
|
19
|
+
// Sync import - bundler aliases to empty module if not installed
|
|
20
|
+
// Decision made ONCE at module load time, never changes
|
|
21
|
+
// Extract useFormStore if available (undefined if package not installed/aliased)
|
|
22
|
+
// Zustand stores have both the hook and getState method
|
|
23
|
+
const realUseFormStore = crudModule?.useFormStore;
|
|
24
|
+
/**
|
|
25
|
+
* Degraded FormStore state - returned when CRUD package not installed
|
|
26
|
+
* Matches FormStoreState & FormStoreActions interface
|
|
27
|
+
*/
|
|
28
|
+
const DEGRADED_FORM_STORE_STATE = {
|
|
29
|
+
forms: {},
|
|
30
|
+
// State transitions (no-ops)
|
|
31
|
+
startSubmit: () => { },
|
|
32
|
+
setUploading: () => { },
|
|
33
|
+
setValidating: () => { },
|
|
34
|
+
setSubmitting: () => { },
|
|
35
|
+
setSuccess: () => { },
|
|
36
|
+
setError: () => { },
|
|
37
|
+
reset: () => { },
|
|
38
|
+
cleanup: () => { },
|
|
39
|
+
// Dirty state management
|
|
40
|
+
setIsDirty: () => { },
|
|
41
|
+
hasDirtyForms: () => false, // Key method - returns false when degraded
|
|
42
|
+
getDirtyFormIds: () => [],
|
|
43
|
+
// Getters
|
|
44
|
+
getStatus: () => 'idle',
|
|
45
|
+
isLoading: () => false,
|
|
46
|
+
getUploadProgress: () => 0,
|
|
47
|
+
getError: () => null,
|
|
48
|
+
getIsDirty: () => false,
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Check if FormStore is available
|
|
52
|
+
*/
|
|
53
|
+
export const isFormStoreAvailable = typeof realUseFormStore === 'function';
|
|
54
|
+
/**
|
|
55
|
+
* Safe access to FormStore.
|
|
56
|
+
* Returns degraded state selector result if CRUD package not installed.
|
|
57
|
+
*
|
|
58
|
+
* @param selector - Zustand selector function
|
|
59
|
+
* @returns Selected state, or degraded state selection if CRUD not available
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* const hasDirtyForms = useFormStoreSafe((state) => state.hasDirtyForms());
|
|
64
|
+
* // Always safe to call - returns false when degraded
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export function useFormStoreSafe(selector) {
|
|
68
|
+
if (realUseFormStore) {
|
|
69
|
+
return realUseFormStore(selector);
|
|
70
|
+
}
|
|
71
|
+
return selector(DEGRADED_FORM_STORE_STATE);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get FormStore state directly (non-hook version).
|
|
75
|
+
* Use this in non-React contexts or for one-time checks.
|
|
76
|
+
*
|
|
77
|
+
* @returns FormStore state, or degraded state if CRUD not available
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* const state = useFormStoreSafe.getState();
|
|
82
|
+
* const hasDirty = state.hasDirtyForms(); // Always safe to call
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
useFormStoreSafe.getState = () => {
|
|
86
|
+
if (realUseFormStore && typeof realUseFormStore.getState === 'function') {
|
|
87
|
+
return realUseFormStore.getState();
|
|
88
|
+
}
|
|
89
|
+
return DEGRADED_FORM_STORE_STATE;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Check if any forms are dirty (safe version).
|
|
93
|
+
* Returns false if CRUD package not available.
|
|
94
|
+
*/
|
|
95
|
+
export function useHasDirtyFormsSafe() {
|
|
96
|
+
const hasDirtyForms = useFormStoreSafe((state) => state.hasDirtyForms());
|
|
97
|
+
return hasDirtyForms();
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Check if navigation should be blocked (safe version).
|
|
101
|
+
* Returns a function that checks FormStore and shows confirmation if needed.
|
|
102
|
+
*
|
|
103
|
+
* @param message - Confirmation message
|
|
104
|
+
* @returns Promise<boolean> - true if navigation should proceed
|
|
105
|
+
*/
|
|
106
|
+
export async function checkFormNavigationSafe(message = 'You have unsaved changes. Discard them?') {
|
|
107
|
+
const state = useFormStoreSafe.getState();
|
|
108
|
+
const hasDirtyForms = state.hasDirtyForms();
|
|
109
|
+
if (!hasDirtyForms)
|
|
110
|
+
return true; // No dirty forms = allow navigation
|
|
111
|
+
if (typeof window !== 'undefined' && window.confirm) {
|
|
112
|
+
return window.confirm(message);
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -49,22 +49,22 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@hookform/resolvers": "^5.2.2",
|
|
51
51
|
"react-helmet-async": "^2.0.5",
|
|
52
|
-
"react-hook-form": "^7.71.
|
|
52
|
+
"react-hook-form": "^7.71.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@donotdev/adv-comps": "^0.0.
|
|
55
|
+
"@donotdev/adv-comps": "^0.0.9",
|
|
56
56
|
"@donotdev/auth": "^0.0.5",
|
|
57
57
|
"@donotdev/billing": "^0.0.5",
|
|
58
|
-
"@donotdev/components": "^0.0.
|
|
59
|
-
"@donotdev/core": "^0.0.
|
|
60
|
-
"@donotdev/crud": "^0.0.
|
|
61
|
-
"@donotdev/firebase": "^0.0.
|
|
58
|
+
"@donotdev/components": "^0.0.15",
|
|
59
|
+
"@donotdev/core": "^0.0.19",
|
|
60
|
+
"@donotdev/crud": "^0.0.10",
|
|
61
|
+
"@donotdev/firebase": "^0.0.8",
|
|
62
62
|
"@donotdev/oauth": "^0.0.5",
|
|
63
|
-
"firebase": "^12.
|
|
64
|
-
"lucide-react": "^0.
|
|
65
|
-
"react": "^19.2.
|
|
66
|
-
"react-dom": "^19.2.
|
|
67
|
-
"react-router-dom": "^7.
|
|
63
|
+
"firebase": "^12.8.0",
|
|
64
|
+
"lucide-react": "^0.563.0",
|
|
65
|
+
"react": "^19.2.4",
|
|
66
|
+
"react-dom": "^19.2.4",
|
|
67
|
+
"react-router-dom": "^7.13.0",
|
|
68
68
|
"valibot": "^1.2.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependenciesMeta": {
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { EntityField, FieldType, ValueTypeForField } from '@donotdev/core';
|
|
2
|
-
import type { ReactElement } from 'react';
|
|
3
|
-
interface DisplayFieldRendererBaseProps<T extends FieldType = FieldType> {
|
|
4
|
-
/** Field identifier */
|
|
5
|
-
name: string;
|
|
6
|
-
/** Field configuration */
|
|
7
|
-
config: EntityField<T>;
|
|
8
|
-
/** Translation function */
|
|
9
|
-
t: (key: string, options?: Record<string, any>) => string;
|
|
10
|
-
/** Field value to display */
|
|
11
|
-
value: ValueTypeForField<T>;
|
|
12
|
-
/** Additional CSS classes */
|
|
13
|
-
className?: string;
|
|
14
|
-
}
|
|
15
|
-
export type DisplayFieldRendererProps<T extends FieldType> = DisplayFieldRendererBaseProps<T>;
|
|
16
|
-
/**
|
|
17
|
-
* DisplayFieldRenderer selects and renders the appropriate display component
|
|
18
|
-
* based on the field type for read-only display mode.
|
|
19
|
-
*
|
|
20
|
-
* @version 0.0.1
|
|
21
|
-
* @since 0.0.1
|
|
22
|
-
* @author AMBROISE PARK Consulting
|
|
23
|
-
*/
|
|
24
|
-
export declare function DisplayFieldRenderer<T extends FieldType>({ name, config, t, value, className, }: DisplayFieldRendererProps<T>): ReactElement;
|
|
25
|
-
export default DisplayFieldRenderer;
|
|
26
|
-
//# sourceMappingURL=DisplayFieldRenderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayFieldRenderer.d.ts","sourceRoot":"","sources":["../../../src/crud/components/DisplayFieldRenderer.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AA8BhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,UAAU,6BAA6B,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IACrE,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,2BAA2B;IAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC;IAC1D,6BAA6B;IAC7B,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC5B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,SAAS,IACvD,6BAA6B,CAAC,CAAC,CAAC,CAAC;AAEnC;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,SAAS,EAAE,EACxD,IAAI,EACJ,MAAM,EACN,CAAC,EACD,KAAK,EACL,SAAS,GACV,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,YAAY,CAgS7C;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
// packages/ui/src/crud/components/DisplayFieldRenderer.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview DisplayFieldRenderer component
|
|
5
|
-
* @description Renders display fields based on field configuration
|
|
6
|
-
*
|
|
7
|
-
* @version 0.0.1
|
|
8
|
-
* @since 0.0.1
|
|
9
|
-
* @author AMBROISE PARK Consulting
|
|
10
|
-
*/
|
|
11
|
-
import { Stack } from '@donotdev/components';
|
|
12
|
-
// Import display field components
|
|
13
|
-
import { TextFieldDisplay, BadgeFieldDisplay, AvatarFieldDisplay, LinkFieldDisplay, DateFieldDisplay, NumberFieldDisplay, PhoneNumberDisplay, TextAreaDisplay, RichTextDisplay, CheckboxFieldDisplay, DropdownDisplay, MultiDropdownDisplay, MultiInputTextFieldDisplay, RadioFieldDisplay, RangeFieldDisplay, FileFieldDisplay, ImageFieldDisplay, GeoPointFieldDisplay, MapFieldDisplay, ReferenceFieldDisplay, TimestampFieldDisplay, HiddenFieldDisplay, ButtonFieldDisplay, } from './fields/display';
|
|
14
|
-
import PasswordFieldDisplay from './fields/display/PasswordFieldDisplay';
|
|
15
|
-
/**
|
|
16
|
-
* DisplayFieldRenderer selects and renders the appropriate display component
|
|
17
|
-
* based on the field type for read-only display mode.
|
|
18
|
-
*
|
|
19
|
-
* @version 0.0.1
|
|
20
|
-
* @since 0.0.1
|
|
21
|
-
* @author AMBROISE PARK Consulting
|
|
22
|
-
*/
|
|
23
|
-
export function DisplayFieldRenderer({ name, config, t, value, className, }) {
|
|
24
|
-
/**
|
|
25
|
-
* Renders appropriate display component based on field type
|
|
26
|
-
*/
|
|
27
|
-
const renderDisplayComponent = () => {
|
|
28
|
-
const type = config.type;
|
|
29
|
-
switch (type) {
|
|
30
|
-
case 'password':
|
|
31
|
-
return (_jsx(PasswordFieldDisplay, { config: config, value: value, t: t, className: className, loading: false }));
|
|
32
|
-
case 'text':
|
|
33
|
-
case 'email':
|
|
34
|
-
case 'month':
|
|
35
|
-
case 'week':
|
|
36
|
-
case 'time':
|
|
37
|
-
return (_jsx(TextFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
38
|
-
case 'avatar':
|
|
39
|
-
return (_jsx(AvatarFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
40
|
-
case 'badge':
|
|
41
|
-
return (_jsx(BadgeFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
42
|
-
case 'boolean':
|
|
43
|
-
case 'checkbox':
|
|
44
|
-
return (_jsx(CheckboxFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
45
|
-
case 'array':
|
|
46
|
-
return (_jsx(MultiInputTextFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
47
|
-
case 'multiselect':
|
|
48
|
-
return (_jsx(MultiDropdownDisplay, { config: config, value: value, t: t, className: className }));
|
|
49
|
-
case 'image':
|
|
50
|
-
return (_jsx(ImageFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
51
|
-
case 'url':
|
|
52
|
-
return (_jsx(LinkFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
53
|
-
case 'tel':
|
|
54
|
-
return (_jsx(PhoneNumberDisplay, { config: config, value: value, t: t, className: className }));
|
|
55
|
-
case 'color':
|
|
56
|
-
if (value && typeof value === 'string') {
|
|
57
|
-
return (_jsxs(Stack, { direction: "row", align: "center", gap: "tight", children: [_jsx("div", { style: {
|
|
58
|
-
backgroundColor: value,
|
|
59
|
-
width: '1.5rem',
|
|
60
|
-
height: '1.5rem',
|
|
61
|
-
}, "aria-label": `Color: ${value}` }), _jsx("span", { style: { fontFamily: 'monospace' }, children: value })] }));
|
|
62
|
-
}
|
|
63
|
-
return _jsx("span", { style: { color: 'var(--muted-foreground)' }, children: "-" });
|
|
64
|
-
case 'number':
|
|
65
|
-
case 'range':
|
|
66
|
-
return (_jsx(NumberFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
67
|
-
case 'date':
|
|
68
|
-
case 'datetime-local':
|
|
69
|
-
return (_jsx(DateFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
70
|
-
case 'timestamp':
|
|
71
|
-
return (_jsx(TimestampFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
72
|
-
case 'reference':
|
|
73
|
-
return (_jsx(ReferenceFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
74
|
-
case 'file':
|
|
75
|
-
return (_jsx(FileFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
76
|
-
case 'geopoint':
|
|
77
|
-
return (_jsx(GeoPointFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
78
|
-
case 'map':
|
|
79
|
-
return (_jsx(MapFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
80
|
-
case 'textarea':
|
|
81
|
-
return (_jsx(TextAreaDisplay, { config: config, value: value, t: t, className: className }));
|
|
82
|
-
case 'richtext':
|
|
83
|
-
return (_jsx(RichTextDisplay, { config: config, value: value, t: t, className: className }));
|
|
84
|
-
case 'select':
|
|
85
|
-
return (_jsx(DropdownDisplay, { config: config, value: value, t: t, className: className }));
|
|
86
|
-
case 'radio':
|
|
87
|
-
return (_jsx(RadioFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
88
|
-
case 'hidden':
|
|
89
|
-
return (_jsx(HiddenFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
90
|
-
case 'submit':
|
|
91
|
-
case 'reset':
|
|
92
|
-
return (_jsx(ButtonFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
93
|
-
default:
|
|
94
|
-
return (_jsx(TextFieldDisplay, { config: config, value: value, t: t, className: className }));
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
// Don't render hidden fields
|
|
98
|
-
if (config.visibility === 'hidden') {
|
|
99
|
-
return _jsx(_Fragment, {});
|
|
100
|
-
}
|
|
101
|
-
const displayComponent = renderDisplayComponent();
|
|
102
|
-
if (!displayComponent) {
|
|
103
|
-
return _jsx(_Fragment, {});
|
|
104
|
-
}
|
|
105
|
-
return _jsx("div", { className: className, children: displayComponent });
|
|
106
|
-
}
|
|
107
|
-
export default DisplayFieldRenderer;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { EntityField } from '@donotdev/core';
|
|
2
|
-
export interface AvatarFieldDisplayProps {
|
|
3
|
-
/** Field configuration */
|
|
4
|
-
config: EntityField<'image'>;
|
|
5
|
-
/** Value to display (image URL) */
|
|
6
|
-
value: string;
|
|
7
|
-
/** Translation function */
|
|
8
|
-
t: (key: string, options?: Record<string, any>) => string;
|
|
9
|
-
/** Additional CSS classes */
|
|
10
|
-
className?: string;
|
|
11
|
-
/** Avatar size */
|
|
12
|
-
size?: 'sm' | 'md' | 'lg';
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* AvatarFieldDisplay - Displays image values as avatars
|
|
16
|
-
*
|
|
17
|
-
* @version 0.0.1
|
|
18
|
-
* @since 0.0.1
|
|
19
|
-
* @author AMBROISE PARK Consulting
|
|
20
|
-
*/
|
|
21
|
-
export declare const AvatarFieldDisplay: React.ComponentType<AvatarFieldDisplayProps>;
|
|
22
|
-
export default AvatarFieldDisplay;
|
|
23
|
-
//# sourceMappingURL=AvatarFieldDisplay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarFieldDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/crud/components/fields/display/AvatarFieldDisplay.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,uBAAuB;IACtC,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC;IAC1D,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,aAAa,CAClD,uBAAuB,CAiCxB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// packages/ui/src/crud/components/fields/display/AvatarFieldDisplay.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview AvatarFieldDisplay component
|
|
5
|
-
* @description Displays image values as avatars
|
|
6
|
-
*
|
|
7
|
-
* @version 0.0.1
|
|
8
|
-
* @since 0.0.1
|
|
9
|
-
* @author AMBROISE PARK Consulting
|
|
10
|
-
*/
|
|
11
|
-
import { Avatar, Text } from '@donotdev/components';
|
|
12
|
-
/**
|
|
13
|
-
* AvatarFieldDisplay - Displays image values as avatars
|
|
14
|
-
*
|
|
15
|
-
* @version 0.0.1
|
|
16
|
-
* @since 0.0.1
|
|
17
|
-
* @author AMBROISE PARK Consulting
|
|
18
|
-
*/
|
|
19
|
-
export const AvatarFieldDisplay = ({ config, value, t, className, size = 'md' }) => {
|
|
20
|
-
if (!value) {
|
|
21
|
-
return (_jsx(Text, { as: "span", variant: "muted", className: className, children: "-" }));
|
|
22
|
-
}
|
|
23
|
-
const sizeClasses = {
|
|
24
|
-
sm: 'size-touch',
|
|
25
|
-
md: 'size-touch',
|
|
26
|
-
lg: 'h-16 w-16',
|
|
27
|
-
};
|
|
28
|
-
const getInitials = (label) => {
|
|
29
|
-
return label
|
|
30
|
-
.split(' ')
|
|
31
|
-
.map((word) => word.charAt(0))
|
|
32
|
-
.slice(0, 2)
|
|
33
|
-
.join('')
|
|
34
|
-
.toUpperCase();
|
|
35
|
-
};
|
|
36
|
-
return (_jsx(Avatar, { src: value, alt: config.label || 'Avatar', fallback: getInitials(config.label || 'AV'), className: `${sizeClasses[size]} ${className || ''}` }));
|
|
37
|
-
};
|
|
38
|
-
export default AvatarFieldDisplay;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { EntityField } from '@donotdev/core';
|
|
2
|
-
export interface BadgeFieldDisplayProps {
|
|
3
|
-
/** Field configuration */
|
|
4
|
-
config: EntityField<'boolean' | 'checkbox' | 'select' | 'radio'>;
|
|
5
|
-
/** Value to display */
|
|
6
|
-
value: boolean | string;
|
|
7
|
-
/** Translation function */
|
|
8
|
-
t: (key: string, options?: Record<string, any>) => string;
|
|
9
|
-
/** Additional CSS classes */
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* BadgeFieldDisplay - Displays boolean/select values as badges
|
|
14
|
-
*
|
|
15
|
-
* @version 0.0.1
|
|
16
|
-
* @since 0.0.1
|
|
17
|
-
* @author AMBROISE PARK Consulting
|
|
18
|
-
*/
|
|
19
|
-
export declare const BadgeFieldDisplay: React.ComponentType<BadgeFieldDisplayProps>;
|
|
20
|
-
export default BadgeFieldDisplay;
|
|
21
|
-
//# sourceMappingURL=BadgeFieldDisplay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeFieldDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/crud/components/fields/display/BadgeFieldDisplay.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACrC,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC;IACjE,uBAAuB;IACvB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,2BAA2B;IAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC;IAC1D,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC,sBAAsB,CA6BzE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// packages/ui/src/crud/components/fields/display/BadgeFieldDisplay.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview BadgeFieldDisplay component
|
|
5
|
-
* @description Displays boolean/select values as badges
|
|
6
|
-
*
|
|
7
|
-
* @version 0.0.1
|
|
8
|
-
* @since 0.0.1
|
|
9
|
-
* @author AMBROISE PARK Consulting
|
|
10
|
-
*/
|
|
11
|
-
import { Badge, Text } from '@donotdev/components';
|
|
12
|
-
/**
|
|
13
|
-
* BadgeFieldDisplay - Displays boolean/select values as badges
|
|
14
|
-
*
|
|
15
|
-
* @version 0.0.1
|
|
16
|
-
* @since 0.0.1
|
|
17
|
-
* @author AMBROISE PARK Consulting
|
|
18
|
-
*/
|
|
19
|
-
export const BadgeFieldDisplay = ({ config, value, t, className, }) => {
|
|
20
|
-
if (value === null || value === undefined) {
|
|
21
|
-
return (_jsx(Text, { as: "span", variant: "muted", className: className, children: "-" }));
|
|
22
|
-
}
|
|
23
|
-
const displayValue = typeof value === 'boolean'
|
|
24
|
-
? value
|
|
25
|
-
? t('common.yes')
|
|
26
|
-
: t('common.no')
|
|
27
|
-
: String(value);
|
|
28
|
-
const variant = typeof value === 'boolean' ? (value ? 'default' : 'secondary') : 'outline';
|
|
29
|
-
return (_jsx(Badge, { variant: variant, className: className, children: displayValue }));
|
|
30
|
-
};
|
|
31
|
-
export default BadgeFieldDisplay;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview ButtonFieldDisplay component
|
|
3
|
-
* @description Button fields are not displayed in read-only mode
|
|
4
|
-
*
|
|
5
|
-
* @version 0.0.1
|
|
6
|
-
* @since 0.0.1
|
|
7
|
-
* @author AMBROISE PARK Consulting
|
|
8
|
-
*/
|
|
9
|
-
import type { EntityField } from '@donotdev/core';
|
|
10
|
-
export interface ButtonFieldDisplayProps {
|
|
11
|
-
/** Field configuration */
|
|
12
|
-
config: EntityField<'submit' | 'reset'>;
|
|
13
|
-
/** Value to display */
|
|
14
|
-
value: any;
|
|
15
|
-
/** Translation function */
|
|
16
|
-
t: (key: string, options?: Record<string, any>) => string;
|
|
17
|
-
/** Additional CSS classes */
|
|
18
|
-
className?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* ButtonFieldDisplay - Button fields are not displayed in read-only mode
|
|
22
|
-
*
|
|
23
|
-
* @version 0.0.1
|
|
24
|
-
* @since 0.0.1
|
|
25
|
-
* @author AMBROISE PARK Consulting
|
|
26
|
-
*/
|
|
27
|
-
export declare const ButtonFieldDisplay: React.ComponentType<ButtonFieldDisplayProps>;
|
|
28
|
-
export default ButtonFieldDisplay;
|
|
29
|
-
//# sourceMappingURL=ButtonFieldDisplay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonFieldDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/crud/components/fields/display/ButtonFieldDisplay.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,uBAAuB;IACtC,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC;IACxC,uBAAuB;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,2BAA2B;IAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC;IAC1D,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,aAAa,CAClD,uBAAuB,CAGxB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// packages/ui/src/crud/components/fields/display/ButtonFieldDisplay.tsx
|
|
2
|
-
/**
|
|
3
|
-
* ButtonFieldDisplay - Button fields are not displayed in read-only mode
|
|
4
|
-
*
|
|
5
|
-
* @version 0.0.1
|
|
6
|
-
* @since 0.0.1
|
|
7
|
-
* @author AMBROISE PARK Consulting
|
|
8
|
-
*/
|
|
9
|
-
export const ButtonFieldDisplay = () => {
|
|
10
|
-
return null;
|
|
11
|
-
};
|
|
12
|
-
export default ButtonFieldDisplay;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { EntityField } from '@donotdev/core';
|
|
2
|
-
export interface CheckboxFieldDisplayProps {
|
|
3
|
-
/** Field configuration */
|
|
4
|
-
config: EntityField<'checkbox' | 'boolean'>;
|
|
5
|
-
/** Value to display */
|
|
6
|
-
value: boolean;
|
|
7
|
-
/** Translation function */
|
|
8
|
-
t: (key: string, options?: Record<string, any>) => string;
|
|
9
|
-
/** Additional CSS classes */
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* CheckboxFieldDisplay - Displays checkbox/boolean values as badges
|
|
14
|
-
*
|
|
15
|
-
* @version 0.0.1
|
|
16
|
-
* @since 0.0.1
|
|
17
|
-
* @author AMBROISE PARK Consulting
|
|
18
|
-
*/
|
|
19
|
-
export declare const CheckboxFieldDisplay: React.ComponentType<CheckboxFieldDisplayProps>;
|
|
20
|
-
export default CheckboxFieldDisplay;
|
|
21
|
-
//# sourceMappingURL=CheckboxFieldDisplay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxFieldDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/crud/components/fields/display/CheckboxFieldDisplay.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,yBAAyB;IACxC,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAC5C,uBAAuB;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,2BAA2B;IAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC;IAC1D,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,aAAa,CACpD,yBAAyB,CAkB1B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// packages/ui/src/crud/components/fields/display/CheckboxFieldDisplay.tsx
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview CheckboxFieldDisplay component
|
|
5
|
-
* @description Displays checkbox/boolean values as badges
|
|
6
|
-
*
|
|
7
|
-
* @version 0.0.1
|
|
8
|
-
* @since 0.0.1
|
|
9
|
-
* @author AMBROISE PARK Consulting
|
|
10
|
-
*/
|
|
11
|
-
import { Badge, Text } from '@donotdev/components';
|
|
12
|
-
/**
|
|
13
|
-
* CheckboxFieldDisplay - Displays checkbox/boolean values as badges
|
|
14
|
-
*
|
|
15
|
-
* @version 0.0.1
|
|
16
|
-
* @since 0.0.1
|
|
17
|
-
* @author AMBROISE PARK Consulting
|
|
18
|
-
*/
|
|
19
|
-
export const CheckboxFieldDisplay = ({ config, value, t, className }) => {
|
|
20
|
-
if (value === null || value === undefined) {
|
|
21
|
-
return (_jsx(Text, { as: "span", variant: "muted", className: className, children: "-" }));
|
|
22
|
-
}
|
|
23
|
-
const displayValue = value ? t('common.yes') : t('common.no');
|
|
24
|
-
const variant = value ? 'default' : 'secondary';
|
|
25
|
-
return (_jsx(Badge, { variant: variant, className: className, children: displayValue }));
|
|
26
|
-
};
|
|
27
|
-
export default CheckboxFieldDisplay;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { EntityField } from '@donotdev/core';
|
|
2
|
-
import type { ComponentType } from 'react';
|
|
3
|
-
export interface DateFieldDisplayProps {
|
|
4
|
-
/** Field configuration */
|
|
5
|
-
config: EntityField<'date' | 'datetime-local'>;
|
|
6
|
-
/** Value to display */
|
|
7
|
-
value: string;
|
|
8
|
-
/** Translation function */
|
|
9
|
-
t: (key: string, options?: Record<string, any>) => string;
|
|
10
|
-
/** Additional CSS classes */
|
|
11
|
-
className?: string;
|
|
12
|
-
/** Whether the field is loading */
|
|
13
|
-
loading?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* DateFieldDisplay - Displays date values in read-only mode
|
|
17
|
-
*
|
|
18
|
-
* @version 0.0.1
|
|
19
|
-
* @since 0.0.1
|
|
20
|
-
* @author AMBROISE PARK Consulting
|
|
21
|
-
*/
|
|
22
|
-
export declare const DateFieldDisplay: ComponentType<DateFieldDisplayProps>;
|
|
23
|
-
export default DateFieldDisplay;
|
|
24
|
-
//# sourceMappingURL=DateFieldDisplay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateFieldDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/crud/components/fields/display/DateFieldDisplay.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,qBAAqB;IACpC,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC;IAC/C,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC;IAC1D,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,qBAAqB,CA+CjE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|