@donotdev/crud 0.1.1 → 0.1.42
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/LICENSE.md +21 -242
- package/README.md +0 -0
- package/dist/CrudService.bulk.d.ts +57 -0
- package/dist/CrudService.bulk.d.ts.map +1 -0
- package/dist/CrudService.bulk.js +1 -0
- package/dist/CrudService.bulkAcross.d.ts +23 -0
- package/dist/CrudService.bulkAcross.d.ts.map +1 -0
- package/dist/CrudService.bulkAcross.js +1 -0
- package/dist/CrudService.cache.d.ts +45 -0
- package/dist/CrudService.cache.d.ts.map +1 -0
- package/dist/CrudService.cache.js +1 -0
- package/dist/CrudService.d.ts +133 -98
- package/dist/CrudService.d.ts.map +1 -1
- package/dist/CrudService.internal.d.ts +80 -0
- package/dist/CrudService.internal.d.ts.map +1 -0
- package/dist/CrudService.internal.js +9 -0
- package/dist/CrudService.js +1 -9
- package/dist/CrudService.mutations.d.ts +7 -0
- package/dist/CrudService.mutations.d.ts.map +1 -0
- package/dist/CrudService.mutations.js +1 -0
- package/dist/CrudService.optimistic.d.ts +10 -0
- package/dist/CrudService.optimistic.d.ts.map +1 -0
- package/dist/CrudService.optimistic.js +1 -0
- package/dist/CrudService.queries.d.ts +27 -0
- package/dist/CrudService.queries.d.ts.map +1 -0
- package/dist/CrudService.queries.js +1 -0
- package/dist/CrudService.subscriptions.d.ts +17 -0
- package/dist/CrudService.subscriptions.d.ts.map +1 -0
- package/dist/CrudService.subscriptions.js +1 -0
- package/dist/CrudStore.d.ts.map +1 -1
- package/dist/CrudStore.js +1 -1
- package/dist/FieldRegistry.js +1 -1
- package/dist/adapters/FunctionsAdapter.d.ts +54 -17
- package/dist/adapters/FunctionsAdapter.d.ts.map +1 -1
- package/dist/adapters/FunctionsAdapter.js +1 -1
- package/dist/components/CrudButton.js +1 -1
- package/dist/components/CrudCard.d.ts.map +1 -1
- package/dist/components/CrudCard.js +1 -1
- package/dist/components/DateFilter.d.ts +1 -1
- package/dist/components/DateFilter.d.ts.map +1 -1
- package/dist/components/DateFilter.js +1 -1
- package/dist/components/DisplayFieldRenderer.d.ts +1 -1
- package/dist/components/DisplayFieldRenderer.js +1 -1
- package/dist/components/DisplayThumbnail.js +1 -1
- package/dist/components/EntityFilters.d.ts +6 -4
- package/dist/components/EntityFilters.d.ts.map +1 -1
- package/dist/components/EntityFilters.js +1 -1
- package/dist/components/FormFieldRenderer.d.ts.map +1 -1
- package/dist/components/FormFieldRenderer.js +1 -1
- package/dist/components/FormLayout.js +1 -1
- package/dist/components/YearFilter.d.ts +26 -0
- package/dist/components/YearFilter.d.ts.map +1 -0
- package/dist/components/YearFilter.js +1 -0
- package/dist/components/controlled/complex/ControlledAddressField.js +1 -1
- package/dist/components/controlled/complex/ControlledDateField.js +1 -1
- package/dist/components/controlled/complex/ControlledFieldArrayField.js +1 -1
- package/dist/components/controlled/complex/ControlledGeoPointField.js +1 -1
- package/dist/components/controlled/complex/ControlledMapField.js +1 -1
- package/dist/components/controlled/complex/ControlledMultiInputField.js +1 -1
- package/dist/components/controlled/complex/ControlledRichTextField.js +1 -1
- package/dist/components/controlled/complex/ControlledTimestampField.js +1 -1
- package/dist/components/controlled/complex/index.js +1 -1
- package/dist/components/controlled/file/ControlledDocumentField.js +1 -1
- package/dist/components/controlled/file/ControlledFileField.js +1 -1
- package/dist/components/controlled/file/ControlledImageField.js +1 -1
- package/dist/components/controlled/file/ControlledMultiDocumentField.js +1 -1
- package/dist/components/controlled/file/ControlledMultiFileField.js +1 -1
- package/dist/components/controlled/file/ControlledMultiImageField.js +1 -1
- package/dist/components/controlled/file/index.js +1 -1
- package/dist/components/controlled/index.js +1 -1
- package/dist/components/controlled/input/ControlledCheckboxField.js +1 -1
- package/dist/components/controlled/input/ControlledCurrencyField.js +1 -1
- package/dist/components/controlled/input/ControlledDurationField.js +1 -1
- package/dist/components/controlled/input/ControlledGdprConsentField.js +1 -1
- package/dist/components/controlled/input/ControlledNumberField.js +1 -1
- package/dist/components/controlled/input/ControlledPasswordField.js +1 -1
- package/dist/components/controlled/input/ControlledPhoneField.js +1 -1
- package/dist/components/controlled/input/ControlledPriceField.js +1 -1
- package/dist/components/controlled/input/ControlledRangeField.js +1 -1
- package/dist/components/controlled/input/ControlledRatingField.js +1 -1
- package/dist/components/controlled/input/ControlledSwitchField.js +1 -1
- package/dist/components/controlled/input/ControlledTextField.js +1 -1
- package/dist/components/controlled/input/ControlledTextareaField.js +1 -1
- package/dist/components/controlled/input/index.js +1 -1
- package/dist/components/controlled/select/ControlledComboboxField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledComboboxField.js +1 -1
- package/dist/components/controlled/select/ControlledDropdownField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledDropdownField.js +1 -1
- package/dist/components/controlled/select/ControlledMultiDropdownField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledMultiDropdownField.js +1 -1
- package/dist/components/controlled/select/ControlledRadioField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledRadioField.js +1 -1
- package/dist/components/controlled/select/ControlledReferenceField.js +1 -1
- package/dist/components/controlled/select/ControlledYearField.js +1 -1
- package/dist/components/controlled/select/index.js +1 -1
- package/dist/components/controlled/types.d.ts +2 -0
- package/dist/components/controlled/types.d.ts.map +1 -1
- package/dist/components/controlled/types.js +1 -1
- package/dist/components/fields/display/AvatarFieldDisplay.js +1 -1
- package/dist/components/fields/display/BadgeFieldDisplay.js +1 -1
- package/dist/components/fields/display/ButtonFieldDisplay.js +1 -1
- package/dist/components/fields/display/CheckboxFieldDisplay.js +1 -1
- package/dist/components/fields/display/DateFieldDisplay.js +1 -1
- package/dist/components/fields/display/DropdownDisplay.js +1 -1
- package/dist/components/fields/display/FileFieldDisplay.js +1 -1
- package/dist/components/fields/display/GeoPointFieldDisplay.js +1 -1
- package/dist/components/fields/display/HiddenFieldDisplay.js +1 -1
- package/dist/components/fields/display/ImageFieldDisplay.js +1 -1
- package/dist/components/fields/display/LinkFieldDisplay.js +1 -1
- package/dist/components/fields/display/MapFieldDisplay.js +1 -1
- package/dist/components/fields/display/MultiDropdownDisplay.js +1 -1
- package/dist/components/fields/display/MultiInputTextFieldDisplay.js +1 -1
- package/dist/components/fields/display/NumberFieldDisplay.js +1 -1
- package/dist/components/fields/display/PasswordFieldDisplay.js +1 -1
- package/dist/components/fields/display/PhoneNumberDisplay.js +1 -1
- package/dist/components/fields/display/RadioFieldDisplay.js +1 -1
- package/dist/components/fields/display/RangeFieldDisplay.js +1 -1
- package/dist/components/fields/display/ReferenceFieldDisplay.js +1 -1
- package/dist/components/fields/display/RichTextDisplay.js +2 -2
- package/dist/components/fields/display/TextAreaDisplay.js +1 -1
- package/dist/components/fields/display/TextFieldDisplay.d.ts.map +1 -1
- package/dist/components/fields/display/TextFieldDisplay.js +1 -1
- package/dist/components/fields/display/TimestampFieldDisplay.js +1 -1
- package/dist/components/fields/display/index.js +1 -1
- package/dist/components/form/fields/AddressFieldComponent.js +1 -1
- package/dist/components/form/fields/AvatarFieldComponent.js +1 -1
- package/dist/components/form/fields/BadgeFieldComponent.js +1 -1
- package/dist/components/form/fields/ButtonFieldComponent.js +1 -1
- package/dist/components/form/fields/CheckboxFieldComponent.d.ts.map +1 -1
- package/dist/components/form/fields/CheckboxFieldComponent.js +1 -1
- package/dist/components/form/fields/ComboboxComponent.js +1 -1
- package/dist/components/form/fields/CurrencyFieldComponent.js +1 -1
- package/dist/components/form/fields/DateFieldComponent.d.ts.map +1 -1
- package/dist/components/form/fields/DateFieldComponent.js +1 -1
- package/dist/components/form/fields/DocumentFieldComponent.d.ts +5 -11
- package/dist/components/form/fields/DocumentFieldComponent.d.ts.map +1 -1
- package/dist/components/form/fields/DocumentFieldComponent.js +1 -1
- package/dist/components/form/fields/DropdownComponent.js +1 -1
- package/dist/components/form/fields/DurationFieldComponent.js +1 -1
- package/dist/components/form/fields/FileFieldComponent.d.ts +5 -11
- package/dist/components/form/fields/FileFieldComponent.d.ts.map +1 -1
- package/dist/components/form/fields/FileFieldComponent.js +1 -1
- package/dist/components/form/fields/GdprConsentFieldComponent.js +1 -1
- package/dist/components/form/fields/GeoPointFieldComponent.js +1 -1
- package/dist/components/form/fields/HiddenFieldComponent.js +1 -1
- package/dist/components/form/fields/ImageFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/ImageFieldComponent.d.ts.map +1 -1
- package/dist/components/form/fields/ImageFieldComponent.js +1 -1
- package/dist/components/form/fields/MapFieldComponent.js +1 -1
- package/dist/components/form/fields/MultiDropdownComponent.js +1 -1
- package/dist/components/form/fields/MultiInputTextFieldComponent.js +1 -1
- package/dist/components/form/fields/NumberFieldComponent.js +1 -1
- package/dist/components/form/fields/PasswordFieldComponent.js +1 -1
- package/dist/components/form/fields/PhoneNumberComponent.d.ts.map +1 -1
- package/dist/components/form/fields/PhoneNumberComponent.js +1 -1
- package/dist/components/form/fields/PriceFieldComponent.d.ts +1 -1
- package/dist/components/form/fields/PriceFieldComponent.d.ts.map +1 -1
- package/dist/components/form/fields/PriceFieldComponent.js +1 -1
- package/dist/components/form/fields/RadioFieldComponent.js +1 -1
- package/dist/components/form/fields/RangeFieldComponent.js +1 -1
- package/dist/components/form/fields/RatingFieldComponent.js +1 -1
- package/dist/components/form/fields/ReferenceFieldComponent.js +1 -1
- package/dist/components/form/fields/RichTextComponent.js +1 -1
- package/dist/components/form/fields/SwitchFieldComponent.js +1 -1
- package/dist/components/form/fields/TextAreaComponent.js +1 -1
- package/dist/components/form/fields/TextFieldComponent.js +1 -1
- package/dist/components/form/fields/TimestampFieldComponent.js +1 -1
- package/dist/components/form/fields/index.js +1 -1
- package/dist/components/form/fields/internal/TiptapEditor.js +2 -2
- package/dist/components/form/internal/ImageViewerDialog.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/contexts/UploadContext.js +1 -1
- package/dist/contexts/index.js +1 -1
- package/dist/fieldTypeRegistry.js +1 -1
- package/dist/fieldTypeRegistry.store.js +1 -1
- package/dist/forms/hooks/index.js +1 -1
- package/dist/forms/hooks/useController.js +1 -1
- package/dist/forms/hooks/useEntityField.d.ts +2 -2
- package/dist/forms/hooks/useEntityField.d.ts.map +1 -1
- package/dist/forms/hooks/useEntityField.js +1 -1
- package/dist/forms/hooks/useEntityForm.d.ts +4 -4
- package/dist/forms/hooks/useEntityForm.d.ts.map +1 -1
- package/dist/forms/hooks/useEntityForm.js +1 -1
- package/dist/forms/index.d.ts +1 -1
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/forms/index.js +1 -1
- package/dist/forms/types.d.ts +26 -14
- package/dist/forms/types.d.ts.map +1 -1
- package/dist/forms/utils/buildInitialValues.d.ts +3 -3
- package/dist/forms/utils/buildInitialValues.d.ts.map +1 -1
- package/dist/forms/utils/buildInitialValues.js +1 -1
- package/dist/forms/utils/getFieldsForOperation.d.ts +3 -3
- package/dist/forms/utils/getFieldsForOperation.d.ts.map +1 -1
- package/dist/forms/utils/getFieldsForOperation.js +1 -1
- package/dist/forms/utils/index.js +1 -1
- package/dist/forms/utils/isFieldEditable.d.ts +6 -6
- package/dist/forms/utils/isFieldEditable.d.ts.map +1 -1
- package/dist/forms/utils/isFieldEditable.js +1 -1
- package/dist/forms/utils/translateFieldLabel.js +1 -1
- package/dist/forms/utils/validateEntity.d.ts +2 -2
- package/dist/forms/utils/validateEntity.d.ts.map +1 -1
- package/dist/forms/utils/validateEntity.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useCrudFilters.d.ts.map +1 -1
- package/dist/hooks/useCrudFilters.js +1 -1
- package/dist/hooks/useCrudPageSize.d.ts.map +1 -1
- package/dist/hooks/useCrudPageSize.js +1 -1
- package/dist/hooks/useEntityFavorites.js +1 -1
- package/dist/hooks/useFieldConditions.js +1 -1
- package/dist/hooks/useFileUpload.d.ts +18 -33
- package/dist/hooks/useFileUpload.d.ts.map +1 -1
- package/dist/hooks/useFileUpload.js +1 -1
- package/dist/hooks/useReferenceResolver.d.ts +2 -2
- package/dist/hooks/useReferenceResolver.d.ts.map +1 -1
- package/dist/hooks/useReferenceResolver.js +1 -1
- package/dist/hooks/useRelatedItems.d.ts +2 -2
- package/dist/hooks/useRelatedItems.d.ts.map +1 -1
- package/dist/hooks/useRelatedItems.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/registerBuiltinFieldTypes.d.ts.map +1 -1
- package/dist/registerBuiltinFieldTypes.js +1 -1
- package/dist/stores/FormStore.d.ts +32 -3
- package/dist/stores/FormStore.d.ts.map +1 -1
- package/dist/stores/FormStore.js +1 -1
- package/dist/stores/UploadStore.d.ts +65 -0
- package/dist/stores/UploadStore.d.ts.map +1 -1
- package/dist/stores/UploadStore.js +1 -1
- package/dist/stores/index.d.ts +1 -1
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +1 -1
- package/dist/symbol-index.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +40 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/useBaseCrudList.d.ts +2 -2
- package/dist/useBaseCrudList.d.ts.map +1 -1
- package/dist/useBaseCrudList.js +1 -1
- package/dist/useCrud.d.ts +54 -7
- package/dist/useCrud.d.ts.map +1 -1
- package/dist/useCrud.js +1 -1
- package/dist/useCrudCardList.d.ts +4 -3
- package/dist/useCrudCardList.d.ts.map +1 -1
- package/dist/useCrudCardList.js +1 -1
- package/dist/useCrudList.d.ts +4 -3
- package/dist/useCrudList.d.ts.map +1 -1
- package/dist/useCrudList.js +1 -1
- package/dist/utils/clientListProcessing.d.ts +4 -4
- package/dist/utils/clientListProcessing.d.ts.map +1 -1
- package/dist/utils/clientListProcessing.js +1 -1
- package/dist/utils/collections.d.ts +4 -4
- package/dist/utils/collections.d.ts.map +1 -1
- package/dist/utils/collections.js +1 -1
- package/dist/utils/fileStorage.d.ts +1 -1
- package/dist/utils/fileStorage.d.ts.map +1 -1
- package/dist/utils/fileStorage.js +1 -1
- package/dist/utils/imageProcessing.d.ts.map +1 -1
- package/dist/utils/imageProcessing.js +1 -1
- package/dist/utils/imageStorage.d.ts +1 -1
- package/dist/utils/imageStorage.d.ts.map +1 -1
- package/dist/utils/imageStorage.js +1 -1
- package/dist/utils/imageUtils.js +1 -1
- package/dist/utils/matchesFilter.js +1 -1
- package/dist/utils/mergeWithOptimistic.js +1 -1
- package/dist/utils/sanitizeHtml.d.ts.map +1 -1
- package/dist/utils/sanitizeHtml.js +1 -1
- package/dist/utils/scopeUtils.js +1 -1
- package/dist/utils/uploadValidation.js +1 -1
- package/dist/workflows/WorkflowPersistence.js +1 -1
- package/dist/workflows/defineWorkflow.d.ts +2 -2
- package/dist/workflows/defineWorkflow.d.ts.map +1 -1
- package/dist/workflows/defineWorkflow.js +1 -1
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/useEntityWorkflow.js +1 -1
- package/guidelines/COMPONENTS.md +0 -0
- package/guidelines/CRUD.md +64 -1
- package/guidelines/GOTCHAS.md +0 -0
- package/package.json +7 -6
- package/dist/hooks/useUnsavedChangesWarning.d.ts +0 -29
- package/dist/hooks/useUnsavedChangesWarning.d.ts.map +0 -1
- package/dist/hooks/useUnsavedChangesWarning.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/forms/types.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/forms/types.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,MAAM,EACN,WAAW,EACX,SAAS,EACT,cAAc,EACd,UAAU,EACV,QAAQ,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GAAG,SAAS,CAAC;CACzD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB,CAChC,CAAC,SAAS,SAAS,EACnB,CAAC,SAAS,MAAM,eAAe,CAAC,CAAC,CAAC;IAElC;;OAEG;IACH,KAAK,EAAE,qBAAqB,CAC1B,eAAe,CAAC,CAAC,CAAC,EAClB,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAC9B,CAAC;IAEF;;OAEG;IACH,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAEF;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE;QAClB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,KAAK,MAAM,GAAG,YAAY,CAAC;CAC7B"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* These helpers provide a single, canonical "initialValues" snapshot that
|
|
9
9
|
* React Hook Form can use as its dirty baseline.
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
11
|
+
import type { AnyEntity } from '@donotdev/core';
|
|
12
12
|
import type { InferEntityData } from '../types';
|
|
13
13
|
/**
|
|
14
14
|
* Build initial values for an existing DB record.
|
|
@@ -18,7 +18,7 @@ import type { InferEntityData } from '../types';
|
|
|
18
18
|
* - If the record has a non-null, non-undefined value, keep it.
|
|
19
19
|
* - Otherwise, apply the same type-specific defaults we use in forms.
|
|
20
20
|
*/
|
|
21
|
-
export declare function buildInitialFromRecord<E extends
|
|
21
|
+
export declare function buildInitialFromRecord<E extends AnyEntity>(entity: E, record: Partial<InferEntityData<E>>): Partial<InferEntityData<E>>;
|
|
22
22
|
/**
|
|
23
23
|
* Build schema defaults for create-mode forms.
|
|
24
24
|
*
|
|
@@ -26,5 +26,5 @@ export declare function buildInitialFromRecord<E extends Entity>(entity: E, reco
|
|
|
26
26
|
* buildInitialFromRecord.
|
|
27
27
|
* - This represents "what a brand-new object would look like" before any user edits.
|
|
28
28
|
*/
|
|
29
|
-
export declare function buildSchemaDefaults<E extends
|
|
29
|
+
export declare function buildSchemaDefaults<E extends AnyEntity>(entity: E): Partial<InferEntityData<E>>;
|
|
30
30
|
//# sourceMappingURL=buildInitialValues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildInitialValues.d.ts","sourceRoot":"","sources":["../../../src/forms/utils/buildInitialValues.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"buildInitialValues.d.ts","sourceRoot":"","sources":["../../../src/forms/utils/buildInitialValues.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA2BhD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,SAAS,EACxD,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAClC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CA6D7B;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,SAAS,EACrD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAG7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function u(i,r){if(r in i)return i[r];const o=r.replace(/_([a-z])/g,(t,n)=>n.toUpperCase());if(o!==r&&o in i)return i[o]}function f(i,r){if(r in i)return!0;const o=r.replace(/_([a-z])/g,(t,n)=>n.toUpperCase());return o!==r&&o in i}function a(i,r){const o=r??{},t={...o};return Object.entries(i.fields).forEach(([n,e])=>{const p=u(t,n);p!==void 0&&!(n in t)&&(t[n]=p);const c=!f(o,n)||p===null||p===void 0;if(n==="status"&&c)t[n]="draft";else if(e.type==="switch"){if(p==null){const l=e.options?.fieldSpecific;t[n]=l?.uncheckedValue??!1}}else c&&(e.type==="price"?t[n]=null:e.type==="checkbox"||e.type==="boolean"?t[n]=!1:e.type==="text"||e.type==="textarea"||e.type==="email"||e.type==="url"||e.type==="tel"||e.type==="iban"||e.type==="password"||e.type==="color"?t[n]="":(e.type==="number"||e.type==="range"||e.type==="rating")&&(t[n]=void 0))}),t}function s(i){return a(i,{})}export{a as buildInitialFromRecord,s as buildSchemaDefaults};
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
9
|
-
import type
|
|
9
|
+
import { type AnyEntity, type EntityField, type FieldType } from '@donotdev/core';
|
|
10
10
|
/** Entity fields input - supports Entity, Entity['fields'], or plain Record */
|
|
11
|
-
export type EntityFieldsInput =
|
|
11
|
+
export type EntityFieldsInput = AnyEntity | AnyEntity['fields'] | Record<string, EntityField<FieldType>>;
|
|
12
12
|
/** Field with computed editability for rendering */
|
|
13
13
|
export interface RenderableField<T extends FieldType = FieldType> {
|
|
14
14
|
/** Field name/key */
|
|
@@ -75,7 +75,7 @@ export interface GetFieldsForOperationOptions {
|
|
|
75
75
|
* ));
|
|
76
76
|
* ```
|
|
77
77
|
*
|
|
78
|
-
* @see {@link
|
|
78
|
+
* @see {@link AnyEntity} for entity definition structure
|
|
79
79
|
* @see {@link RenderableField} for return type
|
|
80
80
|
*
|
|
81
81
|
* @version 0.1.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFieldsForOperation.d.ts","sourceRoot":"","sources":["../../../src/forms/utils/getFieldsForOperation.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getFieldsForOperation.d.ts","sourceRoot":"","sources":["../../../src/forms/utils/getFieldsForOperation.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAIxB,+EAA+E;AAC/E,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,SAAS,CAAC,QAAQ,CAAC,GACnB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;AAE3C,oDAAoD;AACpD,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC9D,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,kCAAkC;AAClC,MAAM,WAAW,4BAA4B;IAC3C,0BAA0B;IAC1B,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,4BAA4B,GACpC,eAAe,EAAE,CA+DnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isFieldVisible as
|
|
1
|
+
import{EDITABLE as c,isFieldVisible as E}from"@donotdev/core";import{isFieldEditable as m}from"./isFieldEditable";function g(e,r){const{operation:t,viewerRole:b,availableFields:o}=r,a=b??"guest",f=e&&typeof e=="object"&&"fields"in e&&"name"in e?e.fields:e,p=Object.entries(f),s=[];for(const[n,u]of p){const i=u,l=i.visibility||"guest";if(!E(l,a)||i.editable===c.GENERATED||i.editable===c.COMPUTED||t==="create"&&l==="technical"||t==="edit"&&o&&!o.includes(n))continue;let d=m(i.editable,a,t);t==="edit"&&l==="technical"&&i.editable===void 0&&(d=!1),s.push({name:n,config:i,editable:d})}return s}export{g as getFieldsForOperation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isFieldEditable as
|
|
1
|
+
import{isFieldEditable as a}from"./isFieldEditable";import{getFieldsForOperation as t}from"./getFieldsForOperation";import{validateEntity as e}from"./validateEntity";import{translateFieldLabel as i,translateLabel as l}from"./translateFieldLabel";export{t as getFieldsForOperation,a as isFieldEditable,i as translateFieldLabel,l as translateLabel,e as validateEntity};
|
|
@@ -22,13 +22,13 @@ export type ViewerRole = 'public' | 'guest' | 'user' | 'admin' | 'super';
|
|
|
22
22
|
* isFieldEditable('user', 'admin', 'edit'); // true (admin >= user)
|
|
23
23
|
* isFieldEditable('super', 'admin', 'edit'); // false (admin < super)
|
|
24
24
|
*
|
|
25
|
-
* // Create-only field
|
|
26
|
-
* isFieldEditable(
|
|
27
|
-
* isFieldEditable(
|
|
25
|
+
* // Create-only field (`EDITABLE` from `@donotdev/core`; string literals still valid)
|
|
26
|
+
* isFieldEditable(EDITABLE.CREATE_ONLY, 'user', 'create'); // true
|
|
27
|
+
* isFieldEditable(EDITABLE.CREATE_ONLY, 'user', 'edit'); // false
|
|
28
28
|
*
|
|
29
|
-
* // Generated/computed
|
|
30
|
-
* isFieldEditable(
|
|
31
|
-
* isFieldEditable(
|
|
29
|
+
* // Generated/computed — always false (excluded from forms)
|
|
30
|
+
* isFieldEditable(EDITABLE.GENERATED, 'admin', 'create'); // false
|
|
31
|
+
* isFieldEditable(EDITABLE.COMPUTED, 'admin', 'edit'); // false
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
34
|
* @see {@link Editable} for editable configuration options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isFieldEditable.d.ts","sourceRoot":"","sources":["../../../src/forms/utils/isFieldEditable.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qDAAqD;AACrD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,QAAQ,GAAG,MAAM,GAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"isFieldEditable.d.ts","sourceRoot":"","sources":["../../../src/forms/utils/isFieldEditable.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qDAAqD;AACrD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,QAAQ,GAAG,MAAM,GAC3B,OAAO,CAoBT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasRoleAccess as
|
|
1
|
+
import{EDITABLE as t,hasRoleAccess as i}from"@donotdev/core";function o(e,E,s){return e===void 0||e===!0?!0:e===!1||e===t.GENERATED||e===t.COMPUTED?!1:e===t.CREATE_ONLY?s==="create":typeof e=="string"?i(E,e):!0}export{o as isFieldEditable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function i(e,r){if(typeof e=="string"&&e.includes(":")){const n=e.split(":"),t=n[1]??e,s=n[0];if(t.startsWith("status.")){const a=r(t);return a!==t&&a!==`${s}:${t}`?a:r(t,{ns:s})}return r(t,{ns:s})}return r(e)}function l(e,r,n){const t=r?.label||e;return i(t,n)}export{l as translateFieldLabel,i as translateLabel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnyEntity } from '@donotdev/core';
|
|
2
2
|
/**
|
|
3
3
|
* Validation operation type
|
|
4
4
|
*/
|
|
@@ -76,5 +76,5 @@ export interface ValidationResult<T> {
|
|
|
76
76
|
* @since 0.0.1
|
|
77
77
|
* @author AMBROISE PARK Consulting
|
|
78
78
|
*/
|
|
79
|
-
export declare function validateEntity<E extends
|
|
79
|
+
export declare function validateEntity<E extends AnyEntity>(entity: E, data: unknown, operation?: SchemaOperation): ValidationResult<Record<string, unknown>>;
|
|
80
80
|
//# sourceMappingURL=validateEntity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateEntity.d.ts","sourceRoot":"","sources":["../../../src/forms/utils/validateEntity.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"validateEntity.d.ts","sourceRoot":"","sources":["../../../src/forms/utils/validateEntity.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,oCAAoC;IACpC,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,SAAS,EAChD,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,OAAO,EACb,SAAS,GAAE,eAA0B,GACpC,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAgC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"valibot";import{createSchemas as
|
|
1
|
+
import*as o from"valibot";import{createSchemas as m}from"@donotdev/core";function i(t,r,c="create"){const e=m(t),u={create:e.create,draft:e.draft,update:e.update,full:e.get}[c],s=o.safeParse(u,r);return s.success?{success:!0,data:s.output}:{success:!1,issues:s.issues.map(a=>({path:a.path?.map(p=>p.key).join(".")||"",message:a.message}))}}export{i as validateEntity};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { useFileUpload } from './useFileUpload';
|
|
2
2
|
export type { FileMetadata, UseFileUploadOptions } from './useFileUpload';
|
|
3
|
-
export {
|
|
3
|
+
export type { FileEntry } from '../stores/UploadStore';
|
|
4
4
|
export { useEntityFavorites } from './useEntityFavorites';
|
|
5
5
|
export type { UseEntityFavoritesOptions, UseEntityFavoritesReturn, } from './useEntityFavorites';
|
|
6
6
|
export { useCrudFilters } from './useCrudFilters';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useFileUpload as
|
|
1
|
+
import{useFileUpload as e}from"./useFileUpload";import{useEntityFavorites as s}from"./useEntityFavorites";import{useCrudFilters as r}from"./useCrudFilters";import{useCrudPageSize as o}from"./useCrudPageSize";import{useRelatedItems as i}from"./useRelatedItems";import{useFieldConditions as a}from"./useFieldConditions";import{useReferenceResolver as t}from"./useReferenceResolver";export{r as useCrudFilters,o as useCrudPageSize,s as useEntityFavorites,a as useFieldConditions,e as useFileUpload,t as useReferenceResolver,i as useRelatedItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrudFilters.d.ts","sourceRoot":"","sources":["../../src/hooks/useCrudFilters.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,mDAAmD;AACnD,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,2BAA2B;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,qBAAqB;IACrB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,+CAA+C;IAC/C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mCAAmC;IACnC,oBAAoB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAoBD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,qBAAqB,GAC7B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"useCrudFilters.d.ts","sourceRoot":"","sources":["../../src/hooks/useCrudFilters.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,mDAAmD;AACnD,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,2BAA2B;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,qBAAqB;IACrB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,+CAA+C;IAC/C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mCAAmC;IACnC,oBAAoB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAoBD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,qBAAqB,GAC7B,oBAAoB,CAwCtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as o}from"react";import{useCrudStore as s}from"../CrudStore";const
|
|
1
|
+
import{useCallback as o}from"react";import{useCrudStore as s}from"../CrudStore";const c={};function u(l){const{collection:t}=l;s.getState().collections[t]?.ui?.filters||s.getState().getFilters(t);const r=s(e=>e.collections[t]?.ui?.filters??c),i=o(e=>{s.getState().setFilters(t,e)},[t]),n=s(e=>e.collections[t]?.ui?.showFavoritesOnly??!1),a=o(e=>{s.getState().setShowFavoritesOnly(t,e)},[t]);return{filters:r,setFilters:i,showFavoritesOnly:n,setShowFavoritesOnly:a}}export{u as useCrudFilters};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrudPageSize.d.ts","sourceRoot":"","sources":["../../src/hooks/useCrudPageSize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCrudPageSize.d.ts","sourceRoot":"","sources":["../../src/hooks/useCrudPageSize.ts"],"names":[],"mappings":"AAcA,oDAAoD;AACpD,MAAM,WAAW,sBAAsB;IACrC,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAKD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CAYvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useCrudStore as i}from"../CrudStore";const s=12;function S(a){const{collection:t,defaultPageSize:o=s}=a;return{pageSize:i(e=>e.collections[t]?.ui?.pageSize??o),setPageSize:e=>{i.getState().setPageSize(t,e)}}}export{S as useCrudPageSize};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as o}from"react";import{useLocalStorage as p}from"@donotdev/core";function y(s={}){const{storageKey:l,collection:u="entities"}=s,d=l||`favorites-${u}`,{value:t,setValue:a,isLoaded:c}=p(d,{defaultValue:[]}),v=o(e=>t.includes(e),[t]),n=o(e=>{a(i=>i.includes(e)?i.filter(r=>r!==e):[...i,e])},[a]),f=o(e=>{a(i=>i.includes(e)?i:[...i,e])},[a]),F=o(e=>{a(i=>i.filter(r=>r!==e))},[a]),m=o(()=>{a([])},[a]),g=o(e=>t.includes(e.id),[t]);return{favorites:t,isFavorite:v,toggleFavorite:n,addFavorite:f,removeFavorite:F,clearFavorites:m,favoritesFilter:g,isLoaded:c}}export{y as useEntityFavorites};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useMemo as
|
|
1
|
+
"use client";import{useMemo as s}from"react";import{useWatch as c}from"react-hook-form";import{evaluateFieldConditions as f}from"@donotdev/core";function u(o,r){const t=c({control:r}),e=s(()=>o.some(n=>n.config.conditions),[o]);return s(()=>{if(!e)return{};const n={};for(const i of o)i.config.conditions&&(n[i.name]=f(i.config.conditions,t));return n},[o,t,e])}export{u as useFieldConditions};
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
export
|
|
4
|
-
/** Unique ID for React keys */
|
|
5
|
-
id: string;
|
|
6
|
-
/** Original file object (for new uploads) */
|
|
7
|
-
file: File;
|
|
8
|
-
/** Local preview URL (blob: for new, https: for existing) */
|
|
9
|
-
previewURL: string;
|
|
10
|
-
/** Upload progress 0-100 (null = not started) */
|
|
11
|
-
progress: number | null;
|
|
12
|
-
/** Uploaded result (null = pending) */
|
|
13
|
-
uploaded: Picture | null;
|
|
14
|
-
/** Error message if upload failed */
|
|
15
|
-
error: string | null;
|
|
16
|
-
}
|
|
1
|
+
import type { FileEntry, UploadResult } from '../stores/UploadStore';
|
|
2
|
+
/** Backwards-compatible alias */
|
|
3
|
+
export type FileMetadata = FileEntry;
|
|
17
4
|
export interface UseFileUploadOptions {
|
|
18
5
|
/** Field name for UploadStore registration */
|
|
19
6
|
name: string;
|
|
20
|
-
/** Current value from form */
|
|
21
|
-
value:
|
|
7
|
+
/** Current value from form (Picture or FileAsset based) */
|
|
8
|
+
value: unknown;
|
|
22
9
|
/** Change handler to update form */
|
|
23
|
-
onChange: (value:
|
|
10
|
+
onChange: (value: unknown) => void;
|
|
24
11
|
/** Allow multiple files */
|
|
25
12
|
multiple?: boolean;
|
|
26
13
|
/** Max number of files (multiple mode) */
|
|
@@ -32,35 +19,33 @@ export interface UseFileUploadOptions {
|
|
|
32
19
|
/** Storage path prefix */
|
|
33
20
|
storagePath?: string;
|
|
34
21
|
/** Upload function - injected to avoid coupling to specific storage */
|
|
35
|
-
uploadFn?: (file: File, onProgress: (progress: number) => void) => Promise<
|
|
22
|
+
uploadFn?: (file: File, onProgress: (progress: number) => void) => Promise<UploadResult>;
|
|
36
23
|
}
|
|
37
24
|
/**
|
|
38
|
-
* useFileUpload -
|
|
25
|
+
* useFileUpload - Thin wrapper over UploadStore
|
|
39
26
|
*
|
|
40
|
-
*
|
|
41
|
-
* -
|
|
42
|
-
* -
|
|
43
|
-
* -
|
|
44
|
-
* - UploadStore integration
|
|
45
|
-
* - File validation
|
|
46
|
-
* - Progress tracking
|
|
47
|
-
* - Works with Image, File, Document field types
|
|
27
|
+
* Store is SSOT. Hook provides:
|
|
28
|
+
* - Selector (useFieldFiles) for React re-renders
|
|
29
|
+
* - Plain dispatch functions (addFiles, removeFile, reorderFiles)
|
|
30
|
+
* - 4 effects: init, RHF sync, registration, cleanup
|
|
48
31
|
*/
|
|
49
|
-
export declare function useFileUpload({ name, value, onChange, multiple, maxFiles, maxSize, accept,
|
|
32
|
+
export declare function useFileUpload({ name, value, onChange, multiple, maxFiles, maxSize, accept, uploadFn, }: UseFileUploadOptions): {
|
|
50
33
|
/** Current files (pending + uploaded) */
|
|
51
|
-
files:
|
|
34
|
+
files: FileEntry[];
|
|
52
35
|
/** Add new files (from drop/paste/input) */
|
|
53
36
|
addFiles: (newFiles: File[]) => void;
|
|
54
37
|
/** Remove a file by ID */
|
|
55
38
|
removeFile: (id: string) => void;
|
|
39
|
+
/** Reorder files by ID array (for drag-and-drop) */
|
|
40
|
+
reorderFiles: (orderedIds: string[]) => void;
|
|
56
41
|
/** Whether any files are pending upload */
|
|
57
42
|
hasPending: boolean;
|
|
58
43
|
/** Whether upload is in progress */
|
|
59
44
|
isUploading: boolean;
|
|
60
45
|
/** Overall progress 0-100 */
|
|
61
46
|
progress: number;
|
|
62
|
-
/** Form ID from context
|
|
63
|
-
formId: string
|
|
47
|
+
/** Form ID (from context or synthetic for standalone) */
|
|
48
|
+
formId: string;
|
|
64
49
|
/** Whether uploads are deferred (true inside EntityFormRenderer, false standalone) */
|
|
65
50
|
isDeferred: boolean;
|
|
66
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../src/hooks/useFileUpload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../src/hooks/useFileUpload.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErE,iCAAiC;AACjC,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;AAErC,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,KAAK,EAAE,OAAO,CAAC;IACf,oCAAoC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,CACT,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,KACnC,OAAO,CAAC,YAAY,CAAC,CAAC;CAC5B;AAiID;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,QAAa,EACb,OAA0B,EAC1B,MAAW,EACX,QAAQ,GACT,EAAE,oBAAoB;IA6RnB,yCAAyC;;IAEzC,4CAA4C;yBA9GlB,IAAI,EAAE;IAgHhC,0BAA0B;qBAjDJ,MAAM;IAmD5B,oDAAoD;+BA/CpB,MAAM,EAAE;IAiDxC,2CAA2C;;IAE3C,oCAAoC;;IAEpC,6BAA6B;;IAE7B,yDAAyD;;IAEzD,sFAAsF;;EAGzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useEffect as R,useRef as $}from"react";import{handleError as M}from"@donotdev/core";import{useUploadContext as I}from"../contexts/UploadContext";import{useUploadStore as s,useFieldFiles as N,generateStandaloneFormId as q}from"../stores/UploadStore";let j=0;function A(e){if(e){const r=e.split("/").pop()?.split("?")[0];if(r)return`file-${r}`}j+=1;const l=typeof performance<"u"?performance.now():Date.now(),i=Math.random().toString(36).slice(2,11);return`file-${j}-${l}-${i}`}function Q(e,l,i){return l.length>0&&!l.some(r=>{if(r.endsWith("/*")){const n=r.slice(0,-2);return e.type.startsWith(n)}return e.type===r})?{valid:!1,error:`File type ${e.type} not accepted`}:e.size>i?{valid:!1,error:`File exceeds ${(i/1048576).toFixed(0)}MB limit`}:{valid:!0}}function P(e){if(!e)return null;const l=(Array.isArray(e)?e:[e]).map(i=>typeof i=="object"&&i!==null?i.fullUrl??i.url??"":"").filter(Boolean);return l.length>0?l.join(","):null}function T(e){return e?(Array.isArray(e)?e:[e]).filter(l=>{if(typeof l!="object"||l===null)return!1;const i=l;return i.fullUrl||i.url}).map((l,i)=>{const r=l,n=r.fullUrl??r.url??"",E=r.thumbUrl??n,L=r.filename??n.split("/").pop()?.split("?")[0]??"existing";return{id:`${A(n)}-existing-${i}`,file:new File([],L),previewURL:E||n,status:"complete",progress:100,uploaded:l,error:null}}):[]}function x(e,l,i){const r=(i?e.filter(n=>!n.error):e.filter(n=>n.uploaded&&!n.error)).map(n=>n.uploaded?n.uploaded:i?{fullUrl:n.previewURL,thumbUrl:n.previewURL}:null).filter(n=>n!==null);return l?r.length>0?r:null:r[0]??null}function V({name:e,value:l,onChange:i,multiple:r=!1,maxFiles:n=10,maxSize:E=10*1024*1024,accept:L=[],uploadFn:F}){const o=I(),g=$(null);!o&&!g.current&&(g.current=q());const u=o??g.current,S=!!o,c=N(u,e),w=$(null);R(()=>{const t=P(l);if(t===w.current)return;w.current=t;const a=T(l);s.getState().setFieldFiles(u,e,a)},[l,u,e]),R(()=>{if(c.length===0&&!l)return;const t=x(c,r,S),a=P(t);if(a!==w.current&&(w.current=a,i(t),o)){const f=x(c,r,!1);s.getState().setResult(o,e,f)}},[c,r,S,i,e,o,l]),R(()=>{if(!o||!e)return;const t=s.getState();return t.registerUpload(o,e,async(a,f)=>{if(!F||f?.aborted)return;const h=s.getState().getFieldFiles(o,e).filter(d=>d.status!=="complete");if(h.length===0)return;for(const d of h)s.getState().markFileUploading(o,e,d.id);const b=await Promise.allSettled(h.map(async d=>{if(f?.aborted)throw new Error("Upload cancelled");try{const y=await F(d.file,v=>{s.getState().updateFileProgress(o,e,d.id,v)});return s.getState().updateFileResult(o,e,d.id,y),{id:d.id,error:null}}catch(y){const v=y instanceof Error?y.message:"Upload failed";return s.getState().updateFileError(o,e,d.id,v),{id:d.id,error:v}}})),m=s.getState().getFieldFiles(o,e),p=x(m,r,!1);s.getState().setResult(o,e,p);const U=b.filter(d=>d.status==="fulfilled"&&d.value.error!=null);if(U.length>0)throw new Error(`${U.length} file(s) failed to upload`)},()=>s.getState().getFieldFiles(o,e).some(a=>a.status!=="complete")),()=>{t.unregisterUpload(o,e)}},[o,e,F,r]),R(()=>()=>{const t=o??g.current;t&&s.getState().clearFieldFiles(t,e),g.current&&(s.getState().cleanup(g.current),g.current=null)},[o,e]);function k(t){const a=s.getState(),f=a.getFieldFiles(u,e),h=(r?n:1)-f.length;if(h<=0){M(new Error("Maximum files reached"),{userMessage:r?`Maximum ${n} files allowed`:"Only one file allowed",severity:"warning",showNotification:!0});return}const b=t.slice(0,h),m=[];for(const p of b){const U=Q(p,L,E);if(!U.valid){M(new Error(U.error),{userMessage:U.error,severity:"warning",showNotification:!0});continue}m.push({id:A(),file:p,previewURL:URL.createObjectURL(p),status:"pending",progress:null,uploaded:null,error:null})}if(m.length!==0&&(r?a.addFileEntries(u,e,m):(a.getFieldFiles(u,e).forEach(p=>{p.previewURL.startsWith("blob:")&&URL.revokeObjectURL(p.previewURL)}),a.setFieldFiles(u,e,m)),!S&&F))for(const p of m)z(p)}function O(t){s.getState().removeFileEntry(u,e,t)}function W(t){s.getState().reorderFileEntries(u,e,t)}async function z(t){if(F){s.getState().markFileUploading(u,e,t.id);try{const a=await F(t.file,f=>{s.getState().updateFileProgress(u,e,t.id,f)});s.getState().updateFileResult(u,e,t.id,a)}catch(a){const f=a instanceof Error?a.message:"Upload failed";s.getState().updateFileError(u,e,t.id,f)}}}const B=c.some(t=>t.status==="pending"),C=c.some(t=>t.status==="uploading"),D=c.length>0?c.reduce((t,a)=>t+(a.progress??0),0)/c.length:0;return{files:c,addFiles:k,removeFile:O,reorderFiles:W,hasPending:B,isUploading:C,progress:D,formId:u,isDeferred:S}}export{V as useFileUpload};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnyEntity } from '@donotdev/core';
|
|
2
2
|
/** Lookup map: collection → { id → displayLabel } */
|
|
3
3
|
export type ReferenceData = Record<string, Record<string, string>>;
|
|
4
4
|
/**
|
|
@@ -11,5 +11,5 @@ export type ReferenceData = Record<string, Record<string, string>>;
|
|
|
11
11
|
* @param entity - The entity whose reference fields to resolve
|
|
12
12
|
* @returns ReferenceData lookup map
|
|
13
13
|
*/
|
|
14
|
-
export declare function useReferenceResolver(entity:
|
|
14
|
+
export declare function useReferenceResolver(entity: AnyEntity, enabled?: boolean): ReferenceData;
|
|
15
15
|
//# sourceMappingURL=useReferenceResolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReferenceResolver.d.ts","sourceRoot":"","sources":["../../src/hooks/useReferenceResolver.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useReferenceResolver.d.ts","sourceRoot":"","sources":["../../src/hooks/useReferenceResolver.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAKhD,qDAAqD;AACrD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAgCnE;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,OAAO,UAAO,GACb,aAAa,CA8Df"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useMemo as F}from"react";import{buildReferenceLabel as
|
|
1
|
+
"use client";import{useMemo as F}from"react";import{buildReferenceLabel as R}from"../components/controlled/select/ControlledReferenceField";import{useCrudList as d}from"../useCrudList";function g(t){const i=new Map;for(const o of Object.values(t.fields)){const e=o.validation?.reference;if(typeof e=="string"&&!i.has(e)){const l=o.options?.fieldSpecific;i.set(e,{collection:e,labelFields:l?.labelFields,displayField:l?.displayField})}}return Array.from(i.values())}function h(t,i=!0){const o=F(()=>g(t),[t]),e=o[0],l=o[1],n=o[2],s=o[3],{items:a}=d(e?.collection??"__disabled_0__",{enabled:i&&!!e}),{items:f}=d(l?.collection??"__disabled_1__",{enabled:i&&!!l}),{items:r}=d(n?.collection??"__disabled_2__",{enabled:i&&!!n}),{items:_}=d(s?.collection??"__disabled_3__",{enabled:i&&!!s}),y=[{info:e,items:a},{info:l,items:f},{info:n,items:r},{info:s,items:_}];return F(()=>{const m={};for(const{info:c,items:b}of y){if(!c||!b.length)continue;const u={};for(const v of b){const p=v;u[p.id]=R(p,c.labelFields,c.displayField)}m[c.collection]=u}return m},[e?.collection,a,l?.collection,f,n?.collection,r,s?.collection,_])}export{h as useReferenceResolver};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnyEntity } from '@donotdev/core';
|
|
2
2
|
/** Options for the {@link useRelatedItems} hook. */
|
|
3
3
|
export interface UseRelatedItemsOptions {
|
|
4
4
|
/** Maximum number of related items to return (default: 3) */
|
|
@@ -34,5 +34,5 @@ export interface UseRelatedItemsReturn<T> {
|
|
|
34
34
|
* );
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
export declare function useRelatedItems<T extends Record<string, unknown>>(entity:
|
|
37
|
+
export declare function useRelatedItems<T extends Record<string, unknown>>(entity: AnyEntity, currentItem: T | null | undefined, allItems: T[] | null | undefined, matchFields: string[], options?: UseRelatedItemsOptions): UseRelatedItemsReturn<T>;
|
|
38
38
|
//# sourceMappingURL=useRelatedItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRelatedItems.d.ts","sourceRoot":"","sources":["../../src/hooks/useRelatedItems.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useRelatedItems.d.ts","sourceRoot":"","sources":["../../src/hooks/useRelatedItems.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,oDAAoD;AACpD,MAAM,WAAW,sBAAsB;IACrC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uDAAuD;AACvD,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,6BAA6B;IAC7B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EACjC,QAAQ,EAAE,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EAChC,WAAW,EAAE,MAAM,EAAE,EACrB,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CAAC,CAAC,CAAC,CAwD1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useMemo as
|
|
1
|
+
"use client";import{useMemo as g}from"react";function p(a,e,t,n,N={}){const{limit:o=3,tolerance:m=.2}=N,c=g(()=>{if(!e||!t||t.length===0||n.length===0)return[];const b=e.id;return t.filter(f=>f.id===b?!1:n.some(i=>{const r=a.fields[i];if(!r)return!1;const s=e[i],u=f[i];if(s==null||u==null)return!1;if(r.type==="number"||r.type==="range"||r.type==="year"){const l=Number(s),h=Number(u);if(isNaN(l)||isNaN(h))return!1;const d=Math.abs(l*m);return Math.abs(h-l)<=d}return String(s)===String(u)})).slice(0,o)},[e,t,n,a.fields,o,m]);return{items:c,hasItems:c.length>0}}export{p as useRelatedItems};
|
package/dist/index.d.ts
CHANGED
|
@@ -27,11 +27,11 @@ export { registerBuiltinFieldType, getFieldTypeMetadata, getFilterType, getDispl
|
|
|
27
27
|
*/
|
|
28
28
|
export { registerBuiltinFieldTypes } from './builtinFieldTypes';
|
|
29
29
|
export { useEntityForm, useEntityField, useController, isFieldEditable, getFieldsForOperation, validateEntity, translateFieldLabel, translateLabel, } from './forms';
|
|
30
|
-
export type { ViewerRole, RenderableField, GetFieldsForOperationOptions, EntityFieldsInput, SchemaOperation, ValidationIssue, ValidationResult, InferEntityData, InferEntityInput, InferEntityOutput, UseEntityFormOptions, EntityFormReturn, EntityFieldReturn, UseControllerProps, UseControllerReturn, ControllerRenderProps, ControllerFieldState, } from './forms';
|
|
30
|
+
export type { ViewerRole, RenderableField, GetFieldsForOperationOptions, EntityFieldsInput, SchemaOperation, ValidationIssue, ValidationResult, InferEntityData, InferEntityCreate, InferEntityInput, InferEntityOutput, UseEntityFormOptions, EntityFormReturn, EntityFieldReturn, UseControllerProps, UseControllerReturn, ControllerRenderProps, ControllerFieldState, } from './forms';
|
|
31
31
|
export { UploadProvider, useUploadContext } from './contexts';
|
|
32
32
|
export type { UploadProviderProps } from './contexts';
|
|
33
|
-
export { useFileUpload,
|
|
34
|
-
export type { FileMetadata, UseFileUploadOptions, UseEntityFavoritesOptions, UseEntityFavoritesReturn, UseRelatedItemsOptions, UseRelatedItemsReturn, UseCrudFiltersOptions, UseCrudFiltersReturn, UseCrudPageSizeOptions, UseCrudPageSizeReturn, ReferenceData, } from './hooks';
|
|
33
|
+
export { useFileUpload, useEntityFavorites, useRelatedItems, useCrudFilters, useCrudPageSize, useFieldConditions, useReferenceResolver, } from './hooks';
|
|
34
|
+
export type { FileMetadata, FileEntry, UseFileUploadOptions, UseEntityFavoritesOptions, UseEntityFavoritesReturn, UseRelatedItemsOptions, UseRelatedItemsReturn, UseCrudFiltersOptions, UseCrudFiltersReturn, UseCrudPageSizeOptions, UseCrudPageSizeReturn, ReferenceData, } from './hooks';
|
|
35
35
|
export { isStorageUrl, validatePicture, checkForBlobUrls, hasBlobUrls, } from './utils/uploadValidation';
|
|
36
36
|
export { defineWorkflow, useEntityWorkflow, saveWorkflowState, loadWorkflowState, clearWorkflowState, } from './workflows';
|
|
37
37
|
export type { WorkflowConfig, WorkflowStep, WorkflowStepContext, UseEntityWorkflowOptions, EntityWorkflowReturn, PersistedWorkflowState, } from './workflows';
|
|
@@ -39,5 +39,5 @@ export { formatValue } from './components/DisplayFieldRenderer';
|
|
|
39
39
|
export { buildReferenceLabel } from './components/controlled/select/ControlledReferenceField';
|
|
40
40
|
export { matchesFilter } from './utils/matchesFilter';
|
|
41
41
|
export { applyFilters, applySearch, applySort, getSearchableFields, } from './utils/clientListProcessing';
|
|
42
|
-
export type { ClientSort, ClientSortConfig } from './utils/clientListProcessing';
|
|
42
|
+
export type { ClientSort, ClientSortConfig, } from './utils/clientListProcessing';
|
|
43
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAGH,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,cAAc,CAAC;AAG7B,cAAc,UAAU,CAAC;AAIzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,YAAY,EACV,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9D,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO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B,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9D,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAG9F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,SAAS,EACT,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,UAAU,EACV,gBAAgB,GACjB,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./useCrud";export*from"./useCrudList";export*from"./useCrudCardList";export*from"./components";export*from"./stores";import{FunctionsAdapter as
|
|
1
|
+
export*from"./useCrud";export*from"./useCrudList";export*from"./useCrudCardList";export*from"./components";export*from"./stores";import{FunctionsAdapter as e}from"./adapters/FunctionsAdapter";import{getCrudService as a}from"./CrudService";import{useCrudStore as s}from"./CrudStore";import{OPTIMISTIC_STATUSES as t,CRUD_OPERATION as r}from"./types";import{loadDeterministicRange as i,upsertDeterministic as l,appendToCollection as o}from"./utils/collections";import{getFieldRegistry as p,registerFieldType as d,isFieldTypeRegistered as m}from"./FieldRegistry";import{registerBuiltinFieldType as F,getFieldTypeMetadata as u,getFilterType as n,getDisplayFormatter as f,isFilterable as y,getValueType as g,clearFieldTypeRegistry as c}from"./fieldTypeRegistry";import{registerBuiltinFieldTypes as T}from"./builtinFieldTypes";import{useEntityForm as S,useEntityField as C,useController as R,isFieldEditable as b,getFieldsForOperation as E,validateEntity as U,translateFieldLabel as v,translateLabel as k}from"./forms";import{UploadProvider as h,useUploadContext as w}from"./contexts";import{useFileUpload as I,useEntityFavorites as W,useRelatedItems as P,useCrudFilters as x,useCrudPageSize as D,useFieldConditions as O,useReferenceResolver as B}from"./hooks";import{isStorageUrl as A,validatePicture as L,checkForBlobUrls as M,hasBlobUrls as V}from"./utils/uploadValidation";import{defineWorkflow as _,useEntityWorkflow as z,saveWorkflowState as N,loadWorkflowState as j,clearWorkflowState as q}from"./workflows";import{formatValue as H}from"./components/DisplayFieldRenderer";import{buildReferenceLabel as J}from"./components/controlled/select/ControlledReferenceField";import{matchesFilter as K}from"./utils/matchesFilter";import{applyFilters as Q,applySearch as X,applySort as Y,getSearchableFields as Z}from"./utils/clientListProcessing";export{r as CRUD_OPERATION,e as FunctionsAdapter,t as OPTIMISTIC_STATUSES,h as UploadProvider,o as appendToCollection,Q as applyFilters,X as applySearch,Y as applySort,J as buildReferenceLabel,M as checkForBlobUrls,c as clearFieldTypeRegistry,q as clearWorkflowState,_ as defineWorkflow,H as formatValue,a as getCrudService,f as getDisplayFormatter,p as getFieldRegistry,u as getFieldTypeMetadata,E as getFieldsForOperation,n as getFilterType,Z as getSearchableFields,g as getValueType,V as hasBlobUrls,b as isFieldEditable,m as isFieldTypeRegistered,y as isFilterable,A as isStorageUrl,i as loadDeterministicRange,j as loadWorkflowState,K as matchesFilter,F as registerBuiltinFieldType,T as registerBuiltinFieldTypes,d as registerFieldType,N as saveWorkflowState,v as translateFieldLabel,k as translateLabel,l as upsertDeterministic,R as useController,x as useCrudFilters,D as useCrudPageSize,s as useCrudStore,W as useEntityFavorites,C as useEntityField,S as useEntityForm,z as useEntityWorkflow,O as useFieldConditions,I as useFileUpload,B as useReferenceResolver,P as useRelatedItems,w as useUploadContext,U as validateEntity,L as validatePicture};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerBuiltinFieldTypes.d.ts","sourceRoot":"","sources":["../src/registerBuiltinFieldTypes.tsx"],"names":[],"mappings":"AAgFA,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"registerBuiltinFieldTypes.d.ts","sourceRoot":"","sources":["../src/registerBuiltinFieldTypes.tsx"],"names":[],"mappings":"AAgFA,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,2BAA2B,CAAC;AAy0BnC;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAChD,aAAa,EAAE;IACb,iBAAiB,EAAE,CACjB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,GAAG,EACf,YAAY,CAAC,EAAE,GAAG,KACf,IAAI,CAAC;CACX,GACA,IAAI,CAuuBN"}
|