@donotdev/crud 0.1.43 → 0.1.44
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.bulk.js +1 -1
- package/dist/CrudService.cache.js +1 -1
- package/dist/CrudStore.js +1 -1
- package/dist/components/CrudCard.js +1 -1
- package/dist/components/EntityFilters.js +1 -1
- package/dist/components/controlled/input/ControlledDurationField.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/fields/display/BadgeFieldDisplay.js +1 -1
- package/dist/components/fields/display/CheckboxFieldDisplay.js +1 -1
- package/dist/components/fields/display/MapFieldDisplay.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/TextFieldDisplay.js +1 -1
- package/dist/components/form/fields/AddressFieldComponent.d.ts +12 -10
- package/dist/components/form/fields/AddressFieldComponent.d.ts.map +1 -1
- package/dist/components/form/fields/AddressFieldComponent.js +1 -1
- package/dist/components/form/fields/DropdownComponent.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/PhoneNumberComponent.js +1 -1
- package/dist/components/form/fields/PriceFieldComponent.js +1 -1
- package/dist/components/form/fields/RangeFieldComponent.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/forms/hooks/useEntityForm.js +1 -1
- package/dist/forms/utils/buildInitialValues.js +1 -1
- package/dist/forms/utils/isFieldEditable.js +1 -1
- package/dist/stores/FormStore.js +1 -1
- package/dist/stores/UploadStore.js +1 -1
- package/dist/symbol-index.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/clientListProcessing.js +1 -1
- package/dist/utils/collections.js +1 -1
- package/dist/utils/imageProcessing.js +1 -1
- package/dist/utils/uploadValidation.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{matchesFilter as u}from"./matchesFilter";import{getValueType as f}from"../fieldTypeRegistry.store";function d(t,
|
|
1
|
+
import{matchesFilter as u}from"./matchesFilter";import{getValueType as f}from"../fieldTypeRegistry.store";function d(t,r,l){const i=Object.entries(r);return i.length===0?t:t.filter(n=>i.every(([s,c])=>{const e=l.fields[s]?.type||"text";return u(n[s],c,e)}))}function a(t){if(t.search?.fields&&t.search.fields.length>0)return t.search.fields;const r=new Set(["string"]),l=[];for(const[i,n]of Object.entries(t.fields)){if(n.visibility==="hidden"||n.visibility==="technical")continue;const s=f(n.type);s&&r.has(s)&&l.push(i)}return l}function p(t,r,l){if(!r||r.trim()==="")return t;const i=r.toLowerCase(),n=a(l);return n.length===0?t.filter(s=>Object.values(s).some(c=>c==null?!1:String(c).toLowerCase().includes(i))):t.filter(s=>n.some(c=>{const e=s[c];return e==null?!1:typeof e=="object"&&"formatted_address"in e?String(e.formatted_address).toLowerCase().includes(i):String(e).toLowerCase().includes(i)}))}function m(t,r){if(typeof r=="function")return[...t].sort(r);const{field:l,direction:i="asc"}=r,n=i==="desc"?-1:1;return[...t].sort((s,c)=>{const e=s[l],o=c[l];return e==null&&o==null?0:e==null?1:o==null?-1:typeof e=="number"&&typeof o=="number"?(e-o)*n:typeof e=="object"&&"amount"in e&&typeof o=="object"&&"amount"in o?(e.amount-o.amount)*n:e instanceof Date&&o instanceof Date?(e.getTime()-o.getTime())*n:String(e).localeCompare(String(o))*n})}export{d as applyFilters,p as applySearch,m as applySort,a as getSearchableFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCrudService as i}from"../CrudService";async function p(
|
|
1
|
+
import{getCrudService as i}from"../CrudService";async function p(o,t){const a=i(),e=[],s=t.range?.start??1,r=t.range?.end??28;for(let c=s;c<=r;c++){const m=String(c),n=await a.get(t.path(o),m,t.schema);n&&e.push(n)}return e}async function d(o,t,a){const e=i();for(const s of a){const r=t.idOf(s);await e.set(t.path(o),r,s,t.schema)}}async function h(o,t,a){const e=i();if(t.idFrom){const s=t.idFrom(a);return e.set(t.path(o),s,a,t.schema)}return e.add(t.path(o),a,t.schema)}export{h as appendToCollection,p as loadDeterministicRange,d as upsertDeterministic};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const F=new WeakMap;function W(t){return JSON.stringify({maxWidth:t.maxWidth,maxHeight:t.maxHeight,thumbWidth:t.thumbWidth,thumbHeight:t.thumbHeight,aspectRatio:t.aspectRatio,quality:t.quality,crop:t.crop})}async function H(t,a={}){const n=W(a),h=F.get(t);if(h?.has(n))return h.get(n);const{maxWidth:
|
|
1
|
+
const F=new WeakMap;function W(t){return JSON.stringify({maxWidth:t.maxWidth,maxHeight:t.maxHeight,thumbWidth:t.thumbWidth,thumbHeight:t.thumbHeight,aspectRatio:t.aspectRatio,quality:t.quality,crop:t.crop})}async function H(t,a={}){const n=W(a),h=F.get(t);if(h?.has(n))return h.get(n);const{maxWidth:d=1920,maxHeight:e=1440,thumbWidth:i=300,thumbHeight:o=225,aspectRatio:l=4/3,quality:m=.85,crop:r}=a;return new Promise((g,c)=>{const s=new Image,w=new FileReader;w.onload=u=>{s.src=u.target?.result},w.onerror=()=>c(new Error("Failed to read file")),s.onload=async()=>{try{const{width:u,height:f}=M(r?r.width:s.width,r?r.height:s.height,d,e,l),y=await x(s,u,f,l,m,r),v=await x(s,i,o,l,.65,r),p={fullBlob:y,thumbBlob:v,width:u,height:f};let b=F.get(t);b||(b=new Map,F.set(t,b)),b.set(n,p),g(p)}catch(u){c(u)}},s.onerror=()=>c(new Error("Failed to load image")),w.readAsDataURL(t)})}function M(t,a,n,h,d){let e=t,i=a;e>n&&(i=n/e*i,e=n),i>h&&(e=h/i*e,i=h);const o=e/i;return Math.abs(o-d)>.01&&(o>d?i=e/d:e=i*d),{width:Math.round(e),height:Math.round(i)}}async function x(t,a,n,h,d,e){const i=document.createElement("canvas"),o=i.getContext("2d");if(!o)throw new Error("Failed to get canvas context");i.width=a,i.height=n,o.fillStyle="#FFFFFF",o.fillRect(0,0,a,n);let l,m,r,g;if(e)l=e.x,m=e.y,r=e.width,g=e.height;else{const c=t.width/t.height;r=t.width,g=t.height,l=0,m=0,c>h?(r=t.height*h,l=(t.width-r)/2):c<h&&(g=t.width/h,m=(t.height-g)/2)}return o.drawImage(t,l,m,r,g,0,0,a,n),new Promise((c,s)=>{i.toBlob(w=>{w?c(w):s(new Error("Failed to convert canvas to blob"))},"image/webp",d)})}function E(t,a){return t.type.startsWith("image/")?a&&t.size>a?{valid:!1,error:`File size exceeds ${(a/1048576).toFixed(1)}MB limit`}:{valid:!0}:{valid:!1,error:"File must be an image"}}export{H as processImage,E as validateImageFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";function
|
|
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((s,o)=>{const l=n?`${n}[${o}]`:`[${o}]`;t.push(...i(s,l))});else{const s=r;if(s.fullUrl!==void 0&&s.thumbUrl!==void 0){const o=s.fullUrl,l=s.thumbUrl,e=typeof o=="string"&&!u(o),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(s).forEach(([o,l])=>{const e=n?`${n}.${o}`:o;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.1.
|
|
3
|
+
"version": "0.1.44",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@dnd-kit/core": "^6.3.1",
|
|
58
58
|
"@dnd-kit/sortable": "^10.0.0",
|
|
59
59
|
"@dnd-kit/utilities": "^3.2.2",
|
|
60
|
-
"@donotdev/components": "^0.1.
|
|
61
|
-
"@donotdev/core": "^0.1.
|
|
60
|
+
"@donotdev/components": "^0.1.44",
|
|
61
|
+
"@donotdev/core": "^0.1.44",
|
|
62
62
|
"dompurify": "^3.3.2",
|
|
63
63
|
"react-easy-crop": "^5.5.6"
|
|
64
64
|
},
|