@donotdev/crud 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/CrudService.cache.js +1 -1
  2. package/dist/CrudService.subscriptions.js +1 -1
  3. package/dist/components/form/fields/AddressFieldComponent.js +1 -1
  4. package/dist/components/form/fields/ComboboxComponent.js +1 -1
  5. package/dist/components/form/fields/CurrencyFieldComponent.js +1 -1
  6. package/dist/components/form/fields/DateFieldComponent.js +1 -1
  7. package/dist/components/form/fields/DropdownComponent.js +1 -1
  8. package/dist/components/form/fields/DurationFieldComponent.js +1 -1
  9. package/dist/components/form/fields/GeoPointFieldComponent.js +1 -1
  10. package/dist/components/form/fields/ImageFieldComponent.js +1 -1
  11. package/dist/components/form/fields/MultiDropdownComponent.js +1 -1
  12. package/dist/components/form/fields/NumberFieldComponent.js +1 -1
  13. package/dist/components/form/fields/PasswordFieldComponent.js +1 -1
  14. package/dist/components/form/fields/PhoneNumberComponent.js +1 -1
  15. package/dist/components/form/fields/PriceFieldComponent.js +1 -1
  16. package/dist/components/form/fields/RadioFieldComponent.js +1 -1
  17. package/dist/components/form/fields/RangeFieldComponent.js +1 -1
  18. package/dist/components/form/fields/RatingFieldComponent.js +1 -1
  19. package/dist/components/form/fields/ReferenceFieldComponent.js +1 -1
  20. package/dist/components/form/fields/TextAreaComponent.js +1 -1
  21. package/dist/components/form/fields/TextFieldComponent.js +1 -1
  22. package/dist/components/form/fields/internal/TiptapEditor.js +1 -1
  23. package/dist/forms/utils/buildInitialValues.js +1 -1
  24. package/dist/forms/utils/conditionAwareResolver.js +1 -1
  25. package/dist/forms/utils/emptyValue.js +1 -1
  26. package/dist/forms/utils/fieldErrorMessages.js +1 -1
  27. package/dist/tsconfig.tsbuildinfo +1 -1
  28. package/dist/useCrudCardList.js +1 -1
  29. package/dist/useCrudList.js +1 -1
  30. package/dist/utils/collections.js +1 -1
  31. package/dist/utils/uploadValidation.js +1 -1
  32. package/package.json +3 -3
@@ -1 +1 @@
1
- import{useMemo as d}from"react";import{useCrudFilters as p}from"./hooks/useCrudFilters";import{useBaseCrudList as f}from"./useBaseCrudList";import{applyFilters as h,applySearch as y,applySort as g}from"./utils/clientListProcessing";function C(a,t={}){const o={enabled:t.enabled,queryOptions:t.queryOptions,schema:t.schema,entity:t.entity,staleTime:t.staleTime,noCache:t.noCache,translate:t.translate},e=f(a,"listCard",null,o),s=typeof a=="string"?null:a,n=typeof a=="string"?a:a.collection,{filters:l}=p({collection:n}),i=t.clientSort===null?null:t.clientSort??s?.defaultSort??null,{processed:u,filteredTotal:c}=d(()=>{let r=e.items;s&&Object.keys(l).length>0&&(r=h(r,l,s)),s&&t.searchQuery&&(r=y(r,t.searchQuery,s));const m=r.length;return i&&(r=g(r,i)),{processed:r,filteredTotal:m}},[e.items,l,t.searchQuery,i,s]);return{status:e.status,data:e.data?{items:e.data.items}:null,items:e.items,processed:u,filteredTotal:c,loading:e.loading,fetching:e.fetching,error:e.error,mutate:e.mutate,refresh:e.refresh,isAvailable:e.isAvailable}}export{C as useCrudCardList};
1
+ import{useMemo as d}from"react";import{useCrudFilters as p}from"./hooks/useCrudFilters";import{useBaseCrudList as f}from"./useBaseCrudList";import{applyFilters as h,applySearch as y,applySort as g}from"./utils/clientListProcessing";function C(s,e={}){const o={enabled:e.enabled,queryOptions:e.queryOptions,schema:e.schema,entity:e.entity,staleTime:e.staleTime,noCache:e.noCache,translate:e.translate},t=f(s,"listCard",null,o),l=typeof s=="string"?null:s,n=typeof s=="string"?s:s.collection,{filters:a}=p({collection:n}),i=e.clientSort===null?null:e.clientSort??l?.defaultSort??null,{processed:u,filteredTotal:c}=d(()=>{let r=t.items;l&&Object.keys(a).length>0&&(r=h(r,a,l)),l&&e.searchQuery&&(r=y(r,e.searchQuery,l));const m=r.length;return i&&(r=g(r,i)),{processed:r,filteredTotal:m}},[t.items,a,e.searchQuery,i,l]);return{status:t.status,data:t.data?{items:t.data.items}:null,items:t.items,processed:u,filteredTotal:c,loading:t.loading,fetching:t.fetching,error:t.error,mutate:t.mutate,refresh:t.refresh,isAvailable:t.isAvailable}}export{C as useCrudCardList};
@@ -1 +1 @@
1
- import{useMemo as h}from"react";import{useCrudFilters as g}from"./hooks/useCrudFilters";import{useBaseCrudList as S}from"./useBaseCrudList";import{applyFilters as C,applySearch as T,applySort as b}from"./utils/clientListProcessing";function Q(s,e={}){const i=e.pagination??"auto",n=e.page??1,p=e.pageSize??10,c={mode:i,page:n,pageSize:p},u={enabled:e.enabled,queryOptions:e.queryOptions,schema:e.schema,entity:e.entity,staleTime:e.staleTime,noCache:e.noCache,translate:e.translate},l=S(s,"list",c,u),a=typeof s=="string"?null:s,m=typeof s=="string"?s:s.collection,{filters:o}=g({collection:m}),r=e.clientSort===null?null:e.clientSort??a?.defaultSort??null,{processed:d,filteredTotal:y}=h(()=>{let t=l.items;a&&Object.keys(o).length>0&&(t=C(t,o,a)),a&&e.searchQuery&&(t=T(t,e.searchQuery,a));const f=t.length;return r&&(t=b(t,r)),{processed:t,filteredTotal:f}},[l.items,o,e.searchQuery,r,a]);return{...l,processed:d,filteredTotal:y}}export{Q as useCrudList};
1
+ import{useMemo as h}from"react";import{useCrudFilters as g}from"./hooks/useCrudFilters";import{useBaseCrudList as S}from"./useBaseCrudList";import{applyFilters as C,applySearch as T,applySort as b}from"./utils/clientListProcessing";function Q(r,e={}){const i=e.pagination??"auto",n=e.page??1,p=e.pageSize??10,c={mode:i,page:n,pageSize:p},u={enabled:e.enabled,queryOptions:e.queryOptions,schema:e.schema,entity:e.entity,staleTime:e.staleTime,noCache:e.noCache,translate:e.translate},l=S(r,"list",c,u),a=typeof r=="string"?null:r,m=typeof r=="string"?r:r.collection,{filters:o}=g({collection:m}),s=e.clientSort===null?null:e.clientSort??a?.defaultSort??null,{processed:d,filteredTotal:y}=h(()=>{let t=l.items;a&&Object.keys(o).length>0&&(t=C(t,o,a)),a&&e.searchQuery&&(t=T(t,e.searchQuery,a));const f=t.length;return s&&(t=b(t,s)),{processed:t,filteredTotal:f}},[l.items,o,e.searchQuery,s,a]);return{...l,processed:d,filteredTotal:y}}export{Q as useCrudList};
@@ -1 +1 @@
1
- import{getCrudService as i}from"../CrudService";async function p(e,t){const a=i(),s=[],o=t.range?.start??1,r=t.range?.end??28;for(let c=o;c<=r;c++){const m=String(c),n=await a.get(t.path(e),m,t.schema);n&&s.push(n)}return s}async function d(e,t,a){const s=i();for(const o of a){const r=t.idOf(o);await s.set(t.path(e),r,o,t.schema)}}async function h(e,t,a){const s=i();if(t.idFrom){const o=t.idFrom(a);await s.set(t.path(e),o,a,t.schema);return}return s.add(t.path(e),a,t.schema)}export{h as appendToCollection,p as loadDeterministicRange,d as upsertDeterministic};
1
+ import{getCrudService as i}from"../CrudService";async function p(e,t){const n=i(),s=[],r=t.range?.start??1,o=t.range?.end??28;for(let c=r;c<=o;c++){const m=String(c),a=await n.get(t.path(e),m,t.schema);a&&s.push(a)}return s}async function d(e,t,n){const s=i();for(const r of n){const o=t.idOf(r);await s.set(t.path(e),o,r,t.schema)}}async function h(e,t,n){const s=i();if(t.idFrom){const r=t.idFrom(n);await s.set(t.path(e),r,n,t.schema);return}return s.add(t.path(e),n,t.schema)}export{h as appendToCollection,p as loadDeterministicRange,d as upsertDeterministic};
@@ -1 +1 @@
1
- "use client";function u(r){return!r||typeof r!="string"?!1:r.startsWith("https://")&&!r.startsWith("blob:")}function h(r){return!(!r||typeof r!="object"||!u(r.fullUrl)||r.thumbUrl&&!u(r.thumbUrl))}function i(r,l=""){const t=[];if(r==null)return t;if(typeof r=="string")return r.startsWith("blob:")&&t.push(l||"root"),t;if(typeof r!="object")return t;if(Array.isArray(r))r.forEach((s,o)=>{const n=l?`${l}[${o}]`:`[${o}]`;t.push(...i(s,n))});else{const s=r;if(s.fullUrl!==void 0&&s.thumbUrl!==void 0){const o=s.fullUrl,n=s.thumbUrl,e=typeof o=="string"&&!u(o),c=n&&typeof n=="string"&&!u(n);if(e||c){const f=l||"root";t.push(`${f}.fullUrl or ${f}.thumbUrl contains blob URL`)}}else Object.entries(s).forEach(([o,n])=>{const e=l?`${l}.${o}`:o;t.push(...i(n,e))})}return t}function b(r){return i(r).length>0}export{i as checkForBlobUrls,b as hasBlobUrls,u as isStorageUrl,h as validatePicture};
1
+ "use client";function u(r){return!r||typeof r!="string"?!1:r.startsWith("https://")&&!r.startsWith("blob:")}function h(r){return!(!r||typeof r!="object"||!u(r.fullUrl)||r.thumbUrl&&!u(r.thumbUrl))}function i(r,n=""){const t=[];if(r==null)return t;if(typeof r=="string")return r.startsWith("blob:")&&t.push(n||"root"),t;if(typeof r!="object")return t;if(Array.isArray(r))r.forEach((o,s)=>{const l=n?`${n}[${s}]`:`[${s}]`;t.push(...i(o,l))});else{const o=r;if(o.fullUrl!==void 0&&o.thumbUrl!==void 0){const s=o.fullUrl,l=o.thumbUrl,e=typeof s=="string"&&!u(s),c=l&&typeof l=="string"&&!u(l);if(e||c){const f=n||"root";t.push(`${f}.fullUrl or ${f}.thumbUrl contains blob URL`)}}else Object.entries(o).forEach(([s,l])=>{const e=n?`${n}.${s}`:s;t.push(...i(l,e))})}return t}function b(r){return i(r).length>0}export{i as checkForBlobUrls,b as hasBlobUrls,u as isStorageUrl,h as validatePicture};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/crud",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -56,8 +56,8 @@
56
56
  "@dnd-kit/core": "^6.3.1",
57
57
  "@dnd-kit/sortable": "^10.0.0",
58
58
  "@dnd-kit/utilities": "^3.2.2",
59
- "@donotdev/components": "^0.3.4",
60
- "@donotdev/core": "^0.3.3",
59
+ "@donotdev/components": "^0.3.5",
60
+ "@donotdev/core": "^0.3.4",
61
61
  "react-easy-crop": "^5.5.7"
62
62
  },
63
63
  "peerDependencies": {