@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.
- package/dist/CrudService.cache.js +1 -1
- package/dist/CrudService.subscriptions.js +1 -1
- package/dist/components/form/fields/AddressFieldComponent.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.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/GeoPointFieldComponent.js +1 -1
- package/dist/components/form/fields/ImageFieldComponent.js +1 -1
- package/dist/components/form/fields/MultiDropdownComponent.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.js +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/TextAreaComponent.js +1 -1
- package/dist/components/form/fields/TextFieldComponent.js +1 -1
- package/dist/components/form/fields/internal/TiptapEditor.js +1 -1
- package/dist/forms/utils/buildInitialValues.js +1 -1
- package/dist/forms/utils/conditionAwareResolver.js +1 -1
- package/dist/forms/utils/emptyValue.js +1 -1
- package/dist/forms/utils/fieldErrorMessages.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/useCrudCardList.js +1 -1
- package/dist/useCrudList.js +1 -1
- package/dist/utils/collections.js +1 -1
- package/dist/utils/uploadValidation.js +1 -1
- package/package.json +3 -3
package/dist/useCrudCardList.js
CHANGED
|
@@ -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(
|
|
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};
|
package/dist/useCrudList.js
CHANGED
|
@@ -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(
|
|
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
|
|
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,
|
|
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
|
+
"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.
|
|
60
|
-
"@donotdev/core": "^0.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": {
|