@donotdev/crud 0.0.12 → 0.0.13
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.js +1 -1
- package/dist/CrudStore.js +1 -1
- package/dist/FieldRegistry.js +1 -1
- package/dist/adapters/FirestoreAdapter.js +1 -1
- package/dist/adapters/FunctionsAdapter.js +1 -1
- package/dist/adapters/index.js +1 -1
- package/dist/components/CrudButton.js +1 -1
- package/dist/components/DisplayFieldRenderer.js +1 -1
- package/dist/components/EntityDisplayRenderer.js +1 -1
- package/dist/components/EntityFilters.d.ts.map +1 -1
- package/dist/components/EntityFilters.js +1 -1
- package/dist/components/FormFieldRenderer.js +1 -1
- package/dist/components/FormLayout.js +1 -1
- package/dist/components/controlled/complex/ControlledAddressField.js +1 -1
- package/dist/components/controlled/complex/ControlledDateField.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.js +1 -1
- package/dist/components/controlled/select/ControlledDropdownField.js +1 -1
- package/dist/components/controlled/select/ControlledMultiDropdownField.js +1 -1
- package/dist/components/controlled/select/ControlledRadioField.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.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.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.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/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.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.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/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.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/forms/hooks/index.js +1 -1
- package/dist/forms/hooks/useController.js +1 -1
- package/dist/forms/hooks/useEntityField.js +1 -1
- package/dist/forms/index.js +1 -1
- package/dist/forms/utils/getFieldsForOperation.js +1 -1
- package/dist/forms/utils/index.js +1 -1
- package/dist/forms/utils/isFieldEditable.js +1 -1
- package/dist/forms/utils/validateEntity.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useEntityFavorites.js +1 -1
- package/dist/hooks/useFileUpload.js +1 -1
- package/dist/hooks/useFormNavigationGuard.js +1 -1
- package/dist/hooks/useRelatedItems.js +1 -1
- package/dist/hooks/useUnsavedChangesWarning.js +1 -1
- package/dist/index.js +1 -1
- package/dist/stores/FormStore.js +1 -1
- package/dist/stores/UploadStore.js +1 -1
- package/dist/stores/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/useBaseCrudList.js +1 -1
- package/dist/useCrud.js +1 -1
- package/dist/useCrudCardList.js +1 -1
- package/dist/useCrudList.js +1 -1
- package/dist/utils/collections.js +1 -1
- package/dist/utils/fileStorage.js +1 -1
- package/dist/utils/imageProcessing.js +1 -1
- package/dist/utils/imageStorage.js +1 -1
- package/dist/utils/imageUtils.js +1 -1
- package/dist/utils/mergeWithOptimistic.js +1 -1
- package/dist/utils/scopeUtils.js +1 -1
- package/dist/utils/uploadValidation.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as C}from"react/jsx-runtime";import{useMemo as g}from"react";import{Controller as w,useWatch as y,useFormContext as D}from"react-hook-form";import{translateLabel as S}from"../../../forms/utils";import{DropdownComponent as j}from"../../form/fields";import{convertValidationRules as q}from"../types";function _(h){const{control:u,errors:d,fieldConfig:r,t:s,onChange:B}=h,{name:i,label:O,validation:n,options:V={}}=r,p=D()?.setValue,o=y({control:u}),t="dependsOn"in r?r.dependsOn:void 0,x=t&&o?o[t.field]:void 0,f=g(()=>{const e=n?.options;return e?typeof e=="function"?e(o||{}):e:[]},[n?.options,o,x]),b=g(()=>f.map(e=>({...e,label:S(e.label,s)})),[f,s]),c=V.fieldSpecific;return C(w,{name:i,control:u,rules:n?q(n):void 0,render:({field:e})=>{const v=l=>{const m=typeof l=="string"?l:l.target.value;if(e.onChange(m),t&&p&&c?.setParentOnChange){const a=c.setParentOnChange(m,o||{});a!=null&&p(t.field,a,{shouldValidate:!0,shouldDirty:!0})}};return C(j,{label:s(O),value:e.value!==void 0&&e.value!==null?String(e.value):"",onChange:v,onBlur:e.onBlur,options:b,error:!!d[i],helperText:d[i]?.message,required:n?.required})}})}export{_ as ControlledDropdownField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as m}from"react/jsx-runtime";import{useMemo as c}from"react";import{Controller as
|
|
1
|
+
"use client";import{jsx as m}from"react/jsx-runtime";import{useMemo as c}from"react";import{Controller as y,useWatch as O}from"react-hook-form";import{translateLabel as b}from"../../../forms/utils";import{MultiDropdownComponent as x}from"../../form/fields";import{convertValidationRules as A}from"../types";function D(f){const{control:i,errors:u,fieldConfig:t,t:a}=f,{name:l,label:g,validation:n}=t,r=O({control:i}),p="dependsOn"in t?t.dependsOn:void 0,h=p&&r?r[p.field]:void 0,d=c(()=>{const e=n?.options;return e?typeof e=="function"?e(r||{}):e:[]},[n?.options,r,h]),C=c(()=>d.map(e=>({value:String(e.value),label:b(e.label,a)})),[d,a]);return m(y,{name:l,control:i,rules:n?A(n):void 0,render:({field:e})=>{const v=s=>{let o;if(Array.isArray(s))o=s;else try{o=JSON.parse(s.target.value)}catch{o=[]}e.onChange(o)};return m(x,{...e,label:a(g),value:Array.isArray(e.value)?e.value:[],onChange:v,onBlur:e.onBlur,options:C,error:!!u[l],helperText:u[l]?.message,required:n?.required})}})}export{D as ControlledMultiDropdownField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as p}from"react/jsx-runtime";import{useMemo as
|
|
1
|
+
"use client";import{jsx as p}from"react/jsx-runtime";import{useMemo as m}from"react";import{Controller as v,useWatch as O}from"react-hook-form";import{translateLabel as h}from"../../../forms/utils";import{RadioFieldComponent as x}from"../../form/fields";import{convertValidationRules as V}from"../types";function L(f){const{control:a,errors:l,fieldConfig:r,t}=f,{name:i,label:c,validation:n}=r,o=O({control:a}),d="dependsOn"in r?r.dependsOn:void 0,g=d&&o?o[d.field]:void 0,u=m(()=>{const e=n?.options;return e?typeof e=="function"?e(o||{}):e:[]},[n?.options,o,g]),C=m(()=>u.map(e=>({value:String(e.value),label:h(e.label,t)})),[u,t]);return p(v,{name:i,control:a,rules:n?V(n):void 0,render:({field:e})=>p(x,{...e,label:t(c),value:e.value??void 0,onChange:s=>{const b=typeof s=="string"?s:s.target.value;e.onChange(b)},options:C,error:!!l[i],helperText:l[i]?.message,required:n?.required})})}export{L as ControlledRadioField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as s}from"react/jsx-runtime";import{useMemo as b}from"react";import{Controller as x}from"react-hook-form";import{ComboboxComponent as C}from"../../form/fields";import{translateLabel as y}from"../../../forms/utils";import{convertValidationRules as v}from"../types";function B(i){const{control:u,errors:l,fieldConfig:m,t:c,placeholder:p}=i,{name:t,label:d,validation:r,options:f={}}=m,g=b(()=>{const e=r?.min??1900,a=r?.max??new Date().getFullYear()+10,n=[];for(let o=a;o>=e;o--)n.push({value:String(o),label:String(o)});return n},[r?.min,r?.max]);return s(x,{name:t,control:u,rules:r?v(r):void 0,render:({field:e})=>{const a=n=>{const o=typeof n=="string"?n:n.target.value,h=o===""?void 0:Number(o);e.onChange(h)};return s(C,{...e,label:y(d,c),value:e.value!==void 0&&e.value!==null?String(e.value):"",onChange:a,onBlur:e.onBlur,options:g,error:!!l[t],helperText:l[t]?.message,required:r?.required,placeholder:p||f.placeholder,translationNamespace:"crud",placeholderKey:"actions.selectYear",placeholderDefault:"Select or type year",creatable:!0})}})}export{B as ControlledYearField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ControlledComboboxField as
|
|
1
|
+
import{ControlledComboboxField as e}from"./ControlledComboboxField";import{ControlledDropdownField as d}from"./ControlledDropdownField";import{ControlledMultiDropdownField as i}from"./ControlledMultiDropdownField";import{ControlledRadioField as p}from"./ControlledRadioField";import{ControlledYearField as x}from"./ControlledYearField";export{e as ControlledComboboxField,d as ControlledDropdownField,i as ControlledMultiDropdownField,p as ControlledRadioField,x as ControlledYearField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";function
|
|
1
|
+
"use client";function f(e){if(e){if(e instanceof RegExp)return e;try{const n=/^\/(.*)\/([gimyus]*)$/.exec(e);if(n){const[,r,t]=n;if(r)return new RegExp(r,t)}return new RegExp(e)}catch{return}}}function u(e){if(!e)return{};const n={};return e.required!==void 0&&(n.required=e.required),e.min!==void 0&&(n.min=e.min),e.max!==void 0&&(n.max=e.max),e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern&&typeof e.pattern=="string"&&(n.pattern={value:f(e.pattern)||/.*/,message:"Invalid format"}),n}export{f as convertPatternToRegex,u as convertValidationRules};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Avatar as m,Text as n}from"@donotdev/components";const p=({config:t,value:a,t:d,className:s,size:r="md"})=>{if(!a)return e(n,{as:"span",variant:"muted",className:s,children:"-"});const l={sm:"size-touch",md:"size-touch",lg:"h-16 w-16"},i=o=>o.split(" ").map(c=>c.charAt(0)).slice(0,2).join("").toUpperCase();return e(m,{src:a,alt:t.label||"Avatar",fallback:i(t.label||"AV"),className:`${l[r]} ${s||""}`})};var x=p;export{p as AvatarFieldDisplay,x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Badge as a,Text as i}from"@donotdev/components";const s=({config:d,value:n,t:o,className:t})=>{if(n==null)return e(i,{as:"span",variant:"muted",className:t,children:"-"});const r=typeof n=="boolean"?o(n?"common.yes":"common.no"):String(n);return e(a,{variant:typeof n=="boolean"?n?"default":"secondary":"outline",className:t,children:r})};var p=s;export{s as BadgeFieldDisplay,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=()=>null;var
|
|
1
|
+
const t=()=>null;var e=t;export{t as ButtonFieldDisplay,e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Badge as t,Text as i}from"@donotdev/components";const s=({config:c,value:n,t:a,className:o})=>{if(n==null)return r(i,{as:"span",variant:"muted",className:o,children:"-"});const e=a(n?"common.yes":"common.no");return r(t,{variant:n?"default":"secondary",className:o,children:e})};var f=s;export{s as CheckboxFieldDisplay,f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as d}from"react/jsx-runtime";import{Text as a,Spinner as c}from"@donotdev/components";const m=({config:i,value:n,t:p,className:t,loading:l=!1})=>{if(l)return e(c,{className:t});if(!n)return e(a,{as:"span",variant:"muted",className:t,children:"-"});try{const r=new Date(n),s=r.toLocaleDateString(),o=r.toLocaleTimeString();return i.type==="date"?e(a,{as:"span",className:t,children:s}):d("div",{className:t,children:[e(a,{as:"span",children:s}),e(a,{as:"span",variant:"muted",level:"small",children:o})]})}catch{return e(a,{as:"span",variant:"muted",className:t,children:"-"})}};var h=m;export{m as DateFieldDisplay,h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{Badge as e,BADGE_VARIANT as n,Text as o}from"@donotdev/components";const i=({config:s,value:r,t:p,className:t})=>r?a(e,{variant:n.OUTLINE,className:t,children:r}):a(o,{as:"span",variant:"muted",className:t,children:"-"});var c=i;export{i as DropdownDisplay,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,jsxs as s}from"react/jsx-runtime";import{Badge as t,BADGE_VARIANT as n,Text as a,Stack as d}from"@donotdev/components";const l=({config:o,value:e,t:c,className:i})=>e?s(d,{direction:"row",align:"center",gap:"medium",className:i,children:[r(a,{as:"span",level:"small",children:e.name}),e.size&&s(t,{variant:n.SECONDARY,children:[(e.size/1024).toFixed(1)," KB"]})]}):r(a,{as:"span",variant:"muted",className:i,children:"-"});var x=l;export{l as FileFieldDisplay,x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s,jsxs as i}from"react/jsx-runtime";import{Text as e}from"@donotdev/components";const o=({config:r,value:t,t:d,className:n})=>!t||t.lat===void 0&&t.lng===void 0?s(e,{as:"span",variant:"muted",className:n,children:"-"}):i(e,{as:"div",level:"small",className:`font-mono ${n||""}`,children:[t.lat?.toFixed(6),", ",t.lng?.toFixed(6)]});var x=o;export{o as GeoPointFieldDisplay,x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e=()=>null;var l=e;export{e as HiddenFieldDisplay,l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Avatar as c,Text as n}from"@donotdev/components";const p=({config:t,value:s,t:d,className:a,size:r="md"})=>{if(!s)return e(n,{as:"span",variant:"muted",className:a,children:"-"});const l={sm:"size-touch",md:"size-touch",lg:"h-16 w-16"},i=m=>m.split(" ").map(o=>o.charAt(0)).slice(0,2).join("").toUpperCase();return e(c,{src:s,alt:t.label||"Image",fallback:i(t.label||"IMG"),className:`${l[r]} ${a||""}`})};var x=p;export{p as ImageFieldDisplay,x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{Text as l}from"@donotdev/components";const s=({config:a,value:e,t:r,className:t})=>{if(!e)return o(l,{as:"span",variant:"muted",className:t,children:"-"});const i=(()=>{switch(a.type){case"email":return{href:`mailto:${e}`,"aria-label":r("common.sendEmailTo",{email:e})};case"tel":return{href:`tel:${e}`,"aria-label":r("common.callNumber",{number:e})};default:return{href:e,target:"_blank",rel:"noopener noreferrer","aria-label":r("common.openLink")}}})();return o("a",{...i,className:t||"",style:{color:"var(--primary)",textDecoration:"none"},onMouseEnter:n=>n.currentTarget.style.textDecoration="underline",onMouseLeave:n=>n.currentTarget.style.textDecoration="none",children:e})};var u=s;export{s as LinkFieldDisplay,u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Text as s}from"@donotdev/components";const o=({config:r,value:t,t:d,className:n})=>!t||t.lat===void 0&&t.lng===void 0?e(s,{as:"span",variant:"muted",className:n,children:"-"}):i(s,{as:"div",level:"small",className:`font-mono ${n||""}`,children:[t.lat?.toFixed(6),", ",t.lng?.toFixed(6)]});var x=o;export{o as MapFieldDisplay,x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Badge as e,BADGE_VARIANT as o,Text as p,Stack as s}from"@donotdev/components";const d=({config:m,value:r,t:c,className:a})=>!r||!Array.isArray(r)||r.length===0?t(p,{as:"span",variant:"muted",className:a,children:"-"}):t(s,{direction:"row",wrap:"wrap",gap:"medium",className:a,children:r.map((i,n)=>t(e,{variant:o.OUTLINE,children:String(i)},n))});var l=d;export{d as MultiDropdownDisplay,l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Badge as n,BADGE_VARIANT as p,Text as o,Stack as s}from"@donotdev/components";const d=({config:m,value:r,t:c,className:i})=>!r||!Array.isArray(r)||r.length===0?t(o,{as:"span",variant:"muted",className:i,children:"-"}):t(s,{direction:"row",wrap:"wrap",gap:"medium",className:i,children:r.map((a,e)=>t(n,{variant:p.OUTLINE,children:String(a)},e))});var f=d;export{d as MultiInputTextFieldDisplay,f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Text as t,Spinner as o}from"@donotdev/components";const s=({config:a,value:n,t:f,className:r,loading:i=!1})=>i?e(o,{className:r}):n==null?e(t,{as:"span",variant:"muted",className:r,children:"-"}):e(t,{as:"span",className:`font-mono ${r||""}`,children:n.toLocaleString()});var p=s;export{s as NumberFieldDisplay,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as
|
|
1
|
+
import{jsx as o,jsxs as s}from"react/jsx-runtime";import{Eye as d,EyeOff as n}from"lucide-react";import{useState as c}from"react";import{Skeleton as f,Button as m,CopyToClipboard as y,Stack as a}from"@donotdev/components";const x=({config:b,value:i,t:r,className:t,loading:p=!1})=>{const[e,l]=c(!1);return p?o(f,{className:t}):i?s(a,{direction:"row",align:"center",gap:"medium",className:t,children:[o("span",{style:{fontFamily:"monospace"},children:e?i:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}),s(a,{direction:"row",align:"center",gap:"tight",children:[o(m,{type:"button",onClick:()=>l(!e),"aria-label":e?"Hide password":"Show password",children:e?o(n,{}):o(d,{})}),o(y,{text:i,tooltipText:r("copyToClipboard")||"Copy to clipboard",copiedTooltipText:r("copied")||"Copied!",ariaLabel:r("copyPassword")||"Copy password"})]})]}):o("div",{style:{color:"var(--muted-foreground)"},children:"-"})};var C=x;export{x as PasswordFieldDisplay,C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{Text as a}from"@donotdev/components";const i=({config:s,value:e,t:o,className:t})=>e?n("a",{href:`tel:${e}`,className:t||"",style:{color:"var(--primary)",textDecoration:"none"},onMouseEnter:r=>r.currentTarget.style.textDecoration="underline",onMouseLeave:r=>r.currentTarget.style.textDecoration="none","aria-label":o("common.callNumber",{number:e}),children:e}):n(a,{as:"span",variant:"muted",className:t,children:"-"});var m=i;export{i as PhoneNumberDisplay,m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{Badge as e,BADGE_VARIANT as i,Text as n}from"@donotdev/components";const o=({config:s,value:r,t:d,className:t})=>r?a(e,{variant:i.OUTLINE,className:t,children:r}):a(n,{as:"span",variant:"muted",className:t,children:"-"});var c=o;export{o as RadioFieldDisplay,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Text as e}from"@donotdev/components";const o=({config:s,value:n,t:a,className:r})=>n==null?t(e,{as:"span",variant:"muted",className:r,children:"-"}):t(e,{as:"span",className:`font-mono ${r||""}`,children:n});var f=o;export{o as RangeFieldDisplay,f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Badge as a,BADGE_VARIANT as n,Text as s}from"@donotdev/components";const d=({config:o,value:r,t:m,className:e})=>{if(!r)return t(s,{as:"span",variant:"muted",className:e,children:"-"});const i=r.displayName||r.name||r.id||r;return t(a,{variant:n.OUTLINE,className:e,children:String(i)})};var f=d;export{d as ReferenceFieldDisplay,f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Text as t}from"@donotdev/components";const s=({config:a,value:r,t:n,className:o})=>!r||r.trim()===""?e(t,{as:"span",variant:"muted",className:o,children:"-"}):i("div",{className:o,style:{padding:"var(--gap-md)",backgroundColor:"var(--muted)",borderRadius:"var(--radius-md)",border:"1px solid var(--border)",minHeight:"38px"},children:[e("div",{dangerouslySetInnerHTML:{__html:r},style:{outline:"none",fontSize:"var(--font-size-base)",lineHeight:"1.6"},className:"prose prose-sm max-w-none"}),e("style",{children:`
|
|
2
2
|
/* Match Tiptap ProseMirror styling */
|
|
3
3
|
.prose p {
|
|
4
4
|
margin: 0.5em 0;
|
|
@@ -58,4 +58,4 @@ import{jsx as r,jsxs as s}from"react/jsx-runtime";import{Text as i}from"@donotde
|
|
|
58
58
|
.prose a:hover {
|
|
59
59
|
color: var(--primary-hover);
|
|
60
60
|
}
|
|
61
|
-
`})]});var
|
|
61
|
+
`})]});var p=s;export{s as RichTextDisplay,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Text as a}from"@donotdev/components";const s=({config:i,value:e,t:p,className:r})=>e?t(a,{as:"div",level:"small",className:`whitespace-pre-wrap ${r||""}`,children:e}):t(a,{as:"span",variant:"muted",className:r,children:"-"});var o=s;export{s as TextAreaDisplay,o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Mail as V,Calendar as k,Clock as N}from"lucide-react";import{useState as j}from"react";import{Skeleton as f,Badge as A,BADGE_VARIANT as F,Text as l,cn as T,CopyToClipboard as x,Stack as n}from"@donotdev/components";import{getWeekFromISOString as I}from"@donotdev/core";const B=({config:a,value:r,t:o,className:c,loading:C=!1,showCopy:m=!1,asBadge:b=!1,truncate:s=!1,maxLength:d=50,showLabel:p=!1})=>{const[E,h]=j(!1),M=async()=>{try{await navigator.clipboard.writeText(r),h(!0),setTimeout(()=>h(!1),2e3)}catch{}},y=()=>{switch(a.type){case"email":return e(V,{});case"month":case"week":return e(k,{});case"time":return e(N,{});default:return null}},S=t=>{if(!t)return null;switch(a.type){case"email":return i("a",{href:`mailto:${t}`,style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)"},onMouseEnter:u=>u.currentTarget.style.textDecoration="underline",onMouseLeave:u=>u.currentTarget.style.textDecoration="none",children:[y(),t]});case"month":return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long"});case"week":return I(t);case"time":return new Date(`2000-01-01T${t}`).toLocaleTimeString();default:return t}},w=t=>!s||t.length<=d?t:`${t.substring(0,d)}...`;if(C)return i(n,{gap:"tight",children:[p&&e(f,{style:{height:"1rem",width:"6rem"}}),e(f,{className:"dndev-w-full",style:{height:"1.5rem"}})]});if(!r)return i(n,{gap:"tight",children:[p&&e(l,{as:"span",variant:"muted",children:a.label||a.name}),e(l,{as:"span",variant:"muted",className:T(c),style:{fontStyle:"italic"},children:o("common.noValue",{defaultValue:"No value"})})]});const D=S(r),g=w(String(D));return b?i(n,{direction:"row",align:"center",gap:"tight",children:[y(),e(A,{variant:F.SECONDARY,className:c,children:g}),m&&e(x,{text:r,tooltipText:o("copyToClipboard")||"Copy to clipboard",copiedTooltipText:o("copied")||"Copied!",ariaLabel:o("copyToClipboard")||"Copy to clipboard"})]}):i(n,{gap:"tight",children:[p&&e(l,{as:"span",variant:"muted",children:a.label||a.name}),i(n,{direction:"row",align:"center",gap:"tight",children:[e("div",{className:T("dndev-flex-1",s&&"truncate",c),title:s&&r.length>d?r:void 0,children:e(l,{as:"span",children:g})}),m&&e(x,{text:r,tooltipText:o("copyToClipboard")||"Copy to clipboard",copiedTooltipText:o("copied")||"Copied!",ariaLabel:o("copyToClipboard")||"Copy to clipboard"})]})]})};var W=B;export{B as TextFieldDisplay,W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as e}from"@donotdev/components";const c=({config:m,value:s,t:d,className:a})=>{if(!s)return t(e,{as:"span",variant:"muted",className:a,children:"-"});try{const r=new Date(s),n=r.toLocaleDateString(),i=r.toLocaleTimeString();return o("div",{className:a,children:[t(e,{as:"span",children:n}),t(e,{as:"span",variant:"muted",level:"small",children:i})]})}catch{return t(e,{as:"span",variant:"muted",className:a,children:"-"})}};var f=c;export{c as TimestampFieldDisplay,f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as
|
|
1
|
+
import{default as l}from"./TextFieldDisplay";import{default as o}from"./BadgeFieldDisplay";import{default as p}from"./AvatarFieldDisplay";import{default as d}from"./LinkFieldDisplay";import{default as s}from"./DateFieldDisplay";import{default as m}from"./NumberFieldDisplay";import{default as D}from"./PhoneNumberDisplay";import{default as F}from"./TextAreaDisplay";import{default as T}from"./RichTextDisplay";import{default as b}from"./CheckboxFieldDisplay";import{default as g}from"./DropdownDisplay";import{default as M}from"./MultiDropdownDisplay";import{default as w}from"./MultiInputTextFieldDisplay";import{default as B}from"./RadioFieldDisplay";import{default as N}from"./RangeFieldDisplay";import{default as v}from"./FileFieldDisplay";import{default as G}from"./ImageFieldDisplay";import{default as L}from"./GeoPointFieldDisplay";import{default as q}from"./MapFieldDisplay";import{default as E}from"./ReferenceFieldDisplay";import{default as K}from"./TimestampFieldDisplay";import{default as Q}from"./HiddenFieldDisplay";import{default as U}from"./ButtonFieldDisplay";export{p as AvatarFieldDisplay,o as BadgeFieldDisplay,U as ButtonFieldDisplay,b as CheckboxFieldDisplay,s as DateFieldDisplay,g as DropdownDisplay,v as FileFieldDisplay,L as GeoPointFieldDisplay,Q as HiddenFieldDisplay,G as ImageFieldDisplay,d as LinkFieldDisplay,q as MapFieldDisplay,M as MultiDropdownDisplay,w as MultiInputTextFieldDisplay,m as NumberFieldDisplay,D as PhoneNumberDisplay,B as RadioFieldDisplay,N as RangeFieldDisplay,E as ReferenceFieldDisplay,T as RichTextDisplay,F as TextAreaDisplay,l as TextFieldDisplay,K as TimestampFieldDisplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,jsxs as f}from"react/jsx-runtime";import{MapPin as D}from"lucide-react";import{useState as S,useEffect as w,useRef as b,useMemo as F}from"react";import{Combobox as M,Stack as L}from"@donotdev/components";import{useTranslation as W,getPlatformEnvVar as Y}from"@donotdev/core";const $=({label:C,value:d,onChange:P,enableGoogleMaps:j=!1,extractDistrictCode:O,error:l,helperText:u,required:x})=>{const{t:n}=W("dndev"),[c,m]=S(d?.formatted_address||""),[g,v]=S([]),[I,p]=S(!1),h=b(null),_=b(null),i=b(null),y=Y("GOOGLE_MAPS_API_KEY")||"",s=j&&!!y,V=F(()=>g.map(e=>({value:e.place_id,label:e.description,description:e.structured_formatting?.secondary_text,content:f("div",{style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)"},children:[r(D,{style:{width:"var(--size-icon-sm)",height:"var(--size-icon-sm)"}}),f("div",{children:[r("div",{children:e.description}),e.structured_formatting?.secondary_text&&r("div",{style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:e.structured_formatting.secondary_text})]})]})})),[g]),G=e=>{_.current&&(p(!0),_.current.getDetails({placeId:e,fields:["formatted_address","geometry","address_components"]},(t,o)=>{if(p(!1),o===window.google?.maps?.places?.PlacesServiceStatus.OK&&t){const a=t.formatted_address||"",k=t.geometry?.location?.lat(),q=t.geometry?.location?.lng(),A={formatted_address:a,latitude:k,longitude:q};if(O&&t.address_components){const E=t.address_components.find(U=>U.types.includes("postal_code"))?.long_name||"",T=E.startsWith("92")?92:parseInt(E.slice(-2),10)||null;A.district_code=T}m(a),P(A)}}))};w(()=>{d?.formatted_address&&m(d.formatted_address)},[d]),w(()=>{if(!s)return;const e=()=>{if(window.google?.maps?.places){t();return}if(document.querySelector("#google-maps-script")){const a=setInterval(()=>{window.google?.maps?.places&&(clearInterval(a),t())},100);return}const o=document.createElement("script");o.id="google-maps-script",o.src=`https://maps.googleapis.com/maps/api/js?key=${y}&libraries=places`,o.async=!0,o.defer=!0,o.onload=()=>t(),document.head.appendChild(o)},t=()=>{window.google?.maps?.places&&(h.current=new window.google.maps.places.AutocompleteService,_.current=new window.google.maps.places.PlacesService(document.createElement("div")))};e()},[s,y]),w(()=>{if(!s||!c||!h.current){v([]);return}return i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{p(!0),h.current.getPlacePredictions({input:c,types:["geocode","establishment"]},(e,t)=>{p(!1),t===window.google?.maps?.places?.PlacesServiceStatus.OK&&e?v(e):v([])})},300),()=>{i.current&&clearTimeout(i.current)}},[s,c]);const K=e=>{m(e),P({formatted_address:e})},z=e=>{const t=Array.isArray(e)?e[0]||"":e;if(!s){K(t);return}g.some(a=>a.place_id===t)&&G(t)},R=e=>{s&&m(e)};return s?f(L,{gap:"tight",children:[r(M,{label:C,value:c,onValueChange:z,onSearchChange:R,placeholder:n("common.address_placeholder"),emptyMessage:n(I?"common.loading":"common.no_results"),options:V,required:x,variant:l?"destructive":void 0,isLoading:I,creatable:!0,createLabel:n("actions.use","Use")}),u&&r("p",{style:{fontSize:"var(--font-size-xs)",color:l?"var(--destructive-foreground)":"var(--muted-foreground)"},children:u})]}):f(L,{gap:"tight",children:[r(M,{label:C,value:c,onValueChange:z,placeholder:n("common.address_placeholder"),options:[],required:x,variant:l?"destructive":void 0,creatable:!0,createLabel:n("actions.use","Use")}),u&&r("p",{style:{fontSize:"var(--font-size-xs)",color:l?"var(--destructive-foreground)":"var(--muted-foreground)"},children:u})]})};var Z=$;export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Avatar as
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Avatar as u,Input as v,cn as h,Stack as n}from"@donotdev/components";const g=({config:t,value:a,onChange:s,error:f,helperText:l,t:i,className:c,...d})=>{const m=r=>r.split(" ").map(p=>p.charAt(0)).slice(0,2).join("").toUpperCase();return o(n,{gap:"medium",children:[o(n,{direction:"row",align:"center",gap:"medium",children:[e(u,{src:a,alt:t.label||"Avatar",fallback:m(t.label||"AV"),style:{height:"var(--touch-target)",width:"var(--touch-target)"}}),e("div",{className:"dndev-flex-1",children:e(v,{type:"url",className:h("dndev-w-full",c),placeholder:i("common.enterAvatarUrl"),value:a,onChange:r=>s(r.target.value),...d})})]}),l&&e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:l})]})};var j=g;export{g as AvatarFieldComponent,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Badge as s,Input as g,cn as f,Stack as a}from"@donotdev/components";const p=({config:u,value:r,onChange:d,error:v,helperText:n,t:o,variant:i="default",className:l,...m})=>t(a,{gap:"medium",children:[t(a,{direction:"row",align:"center",gap:"medium",children:[e(s,{variant:i,style:{minWidth:0},children:r||o("common.badgePreview")}),e("div",{className:"dndev-flex-1",children:e(g,{type:"text",className:f("dndev-w-full",l),placeholder:o("common.enterBadgeText"),value:r,onChange:c=>d(c.target.value),...m})})]}),n&&e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:n})]});var j=p;export{p as BadgeFieldComponent,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{Button as a}from"@donotdev/components";const l=({label:t,type:o,onClick:e,variant:n,disabled:r=!1})=>i(a,{type:o,onClick:e,variant:n,disabled:r,children:t});var m=l;export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
1
|
+
import{jsx as r,jsxs as c}from"react/jsx-runtime";import{Checkbox as h,Label as i,Stack as s}from"@donotdev/components";const d=({label:t,checked:n=!1,onChange:e,required:a})=>c(s,{direction:"row",align:"center",gap:"tight",children:[r(h,{checked:n,onCheckedChange:o=>{e&&e({target:{checked:o}})}}),r(i,{required:a,children:t})]});var C=d;export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a,jsxs as c}from"react/jsx-runtime";import{useMemo as E,useId as M}from"react";import{Combobox as V,Stack as d}from"@donotdev/components";import{useTranslation as _}from"@donotdev/core";const $=({label:u,value:n,options:s,error:f,helperText:o,onChange:l,onBlur:m,required:p,placeholder:g,translationNamespace:h="dndev",placeholderKey:b="actions.select",placeholderDefault:v="Select",creatable:x=!1,createLabel:C,emptyMessage:y})=>{const{t:r}=_(h),i=M(),S=E(()=>s.map(e=>({value:String(e.value),label:e.label})),[s]),j=e=>{if(l){const O={target:{value:Array.isArray(e)?e[0]||"":e}};l(O)}},z=e=>{e||m?.()},t=!!f,A=`${i}-error`,I=`${i}-helper`;return c(d,{gap:"tight",children:[a(V,{label:u,value:n||"",onValueChange:j,onOpenChange:z,placeholder:g||r(b,v),emptyMessage:y||r("messages.noResults","No results found"),creatable:x,createLabel:C||r("actions.create","Create"),options:S,required:p,variant:t?"destructive":void 0,clearable:!!n}),t&&c(d,{id:A,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[a("span",{children:"\u26A0"}),o]}),o&&!t&&a("p",{id:I,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:o})]})};var D=$;export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as f}from"react/jsx-runtime";import{useState as N,useEffect as V,useId as j}from"react";import{Input as E,FloatingLabel as I,Stack as z}from"@donotdev/components";const L=({label:m,value:r,onChange:g,currency:a="EUR",locale:y,error:s,helperText:l,required:v=!1,disabled:i=!1,placeholder:h})=>{const c=j(),b=y||(typeof navigator<"u"?navigator.language:"en-US"),d=e=>e==null||isNaN(e)?"":(e/100).toFixed(2),x=e=>{if(!e||e.trim()==="")return null;const t=e.replace(/[^\d.,\-]/g,"").replace(",","."),o=parseFloat(t);return isNaN(o)?null:Math.round(o*100)},[S,u]=N(d(r));V(()=>{u(d(r))},[r]);const C=e=>{const t=e.target.value;u(t);const F={target:{value:x(t)}};g(F)},p=(()=>{try{return new Intl.NumberFormat(b,{style:"currency",currency:a,currencyDisplay:"symbol"}).formatToParts(0).find(e=>e.type==="currency")?.value||a}catch{return a}})();return f(z,{gap:"tight",children:[n(I,{htmlFor:c,label:m,disabled:i,required:v,children:f("div",{style:{position:"relative"},children:[n("span",{style:{position:"absolute",left:"var(--gap-md)",top:"50%",transform:"translateY(-50%)",color:"var(--muted-foreground)",pointerEvents:"none",zIndex:1},children:p}),n(E,{id:c,type:"text",inputMode:"decimal",value:S,onChange:C,disabled:i,placeholder:h||"0.00","data-variant":s?"destructive":void 0,style:{paddingLeft:`calc(var(--gap-md) + ${p.length*.6}em + var(--gap-sm))`}})]})}),l&&n("p",{style:{fontSize:"var(--font-size-xs)",color:s?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:l})]})};var k=L;export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l,jsxs as
|
|
1
|
+
import{jsx as l,jsxs as S}from"react/jsx-runtime";import{Input as d,Stack as p}from"@donotdev/components";const m=({label:r,value:i,onChange:s,error:o,helperText:n,mode:e="date",required:g,...c})=>{const f=t=>{const u=t.target.value?new Date(t.target.value).toISOString():null;s(u)};let a="";if(i){const t=new Date(i);e==="date"?a=t.toISOString().split("T")[0]||"":e==="datetime-local"?a=t.toISOString().slice(0,16)||"":e==="month"?a=t.toISOString().slice(0,7):e==="time"?a=t.toISOString().slice(11,16):e==="week"&&(a=t.toISOString().split("T")[0]||"")}return S(p,{gap:"tight",children:[l(d,{label:r,type:e,value:a,onChange:f,required:g,className:"dndev-w-full",...c}),n&&l("p",{style:{fontSize:"var(--font-size-xs)",color:o?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:n})]})};var O=m;export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,jsxs as l,Fragment as ae}from"react/jsx-runtime";import{Upload as ie,X as se,FileText as P,FileSpreadsheet as le,File as de,Loader2 as ce,Eye as ue}from"lucide-react";import{useCallback as w,useState as M,useRef as F,useEffect as W,useImperativeHandle as pe,forwardRef as me}from"react";import{Button as G,BUTTON_VARIANT as V,Text as g,Stack as x,Progress as fe,Dialog as ge,DialogContent as ve,DialogHeader as he,DialogTitle as ye}from"@donotdev/components";import{handleError as D,useTranslation as we}from"@donotdev/core";import{useUploadContext as xe}from"../../../contexts/UploadContext";import{useUploadStore as Te}from"../../../stores/UploadStore";import{uploadFile as be,deleteFile as Pe,generateFileId as X,getFileIcon as Fe,formatFileSize as De,getDocumentAcceptString as Ne}from"../../../utils/fileStorage";function ke({type:f,className:c}){switch(f){case"pdf":return n(P,{className:c,style:{color:"var(--destructive)"}});case"doc":return n(P,{className:c,style:{color:"var(--primary)"}});case"xls":return n(le,{className:c,style:{color:"var(--success)"}});case"ppt":return n(P,{className:c,style:{color:"var(--warning)"}});case"text":case"html":return n(P,{className:c});default:return n(de,{className:c})}}const q=me(({name:f,label:c,value:v,onChange:N,error:k,helperText:R,multiple:p=!1,maxFiles:A=10,maxSize:C=25*1024*1024,storagePath:L="uploads/documents",required:K,enablePreview:H=!0},J)=>{const{t:Q}=we("dndev"),s=Q,h=xe(),I=Te(),O=!!h,[i,u]=M([]),[j,S]=M(!1),[U,_]=M(null),y=F(null),z=F(!1),T=F(void 0),Y=Ne(),b=w(e=>{const r=e.filter(t=>t.uploaded&&!t.error).map(t=>t.uploaded);N(p?r:r[0]||null)},[p,N]);W(()=>{if(z.current){z.current=!1;return}if(v){const e=[];(Array.isArray(v)?v:[v]).forEach(t=>{t.url&&e.push({id:X(),file:new File([],t.filename),uploadProgress:null,uploaded:t,error:null})}),u(e)}else u([])},[v]);const Z=w(async()=>{const e=i.filter(r=>!r.uploaded&&!r.error&&r.uploadProgress===null);if(e.length!==0){u(r=>r.map(t=>e.some(a=>a.id===t.id)?{...t,uploadProgress:0}:t));for(const r of e)try{const t=await be(r.file,{storagePath:L,onProgress:a=>{u(o=>o.map(d=>d.id===r.id?{...d,uploadProgress:a.progress}:d))}});u(a=>{const o=a.map(d=>d.id===r.id?{...d,uploaded:t,uploadProgress:100,error:null}:d);return queueMicrotask(()=>b(o)),o})}catch{u(a=>a.map(o=>o.id===r.id?{...o,error:"Upload failed",uploadProgress:null}:o))}}},[i,L,b]);T.current=Z,W(()=>{if(!(!h||!f))return I.registerUpload(h,f,async e=>{await T.current?.()}),()=>{I.unregisterUpload(h,f)}},[h,f,I]),pe(J,()=>({upload:async()=>{await T.current?.()},getDocuments:()=>B.current||[]}),[]);const B=F(i);B.current=i;const $=e=>{const r=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".html",".csv"],t="."+e.name.split(".").pop()?.toLowerCase();return r.includes(t)},E=w(e=>{const t=(p?A:1)-i.length;if(t<=0){D(new Error("Maximum documents reached"),{userMessage:s("document.errors.maxFiles",{max:A}),severity:"warning",showNotification:!0});return}const a=e.slice(0,t),o=[],d=(C/(1024*1024)).toFixed(0);for(const m of a){if(!$(m)){D(new Error("Invalid document type"),{userMessage:s("document.errors.invalidType",{fileName:m.name}),severity:"warning",showNotification:!0});continue}if(m.size>C){D(new Error("Document too large"),{userMessage:s("document.errors.exceedsSize",{fileName:m.name,size:d}),severity:"warning",showNotification:!0});continue}o.push({id:X(),file:m,uploadProgress:null,uploaded:null,error:null})}o.length!==0&&(u(m=>p?[...m,...o]:o),O||setTimeout(()=>T.current?.(),0))},[i,p,A,C,s,O]),ee=e=>{const r=Array.from(e.target.files||[]);r.length>0&&E(r),y.current&&(y.current.value="")},re=w(e=>{e.preventDefault(),S(!1);const r=Array.from(e.dataTransfer.files);E(r)},[E]),te=w(async e=>{const r=i[e];if(r)try{r.uploaded&&await Pe(r.uploaded);const t=i.filter((a,o)=>o!==e);z.current=!0,u(t),setTimeout(()=>b(t),0)}catch(t){D(t,{userMessage:s("document.delete.failed"),severity:"error",showNotification:!0})}},[i,b,s]),ne=e=>{e.uploaded?.url&&e.uploaded.mimeType==="application/pdf"&&_(e.uploaded.url)},oe=p||i.length===0;return l(ae,{children:[l(x,{gap:"tight",children:[l(g,{level:"body",align:"start",children:[c,K?"*":""]}),oe&&l("div",{role:"button",tabIndex:0,"aria-label":s("document.upload.ariaLabel"),className:"dndev-surface","data-variant":k?"destructive":"default",style:{border:"var(--border-width) dashed",borderColor:j?"var(--primary)":k?"var(--destructive)":"var(--border)",borderRadius:"var(--radius-lg)",padding:"var(--gap-lg)",backgroundColor:j?"color-mix(in oklab, var(--primary) 5%, transparent)":"var(--surface)",transition:"border-color var(--dur-fast), background-color var(--dur-fast)",cursor:"pointer",outline:"none"},onDragOver:e=>{e.preventDefault(),S(!0)},onDragLeave:()=>S(!1),onDrop:re,onClick:()=>y.current?.click(),onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),y.current?.click())},children:[n("input",{ref:y,type:"file",accept:Y,multiple:p,style:{display:"none"},onChange:ee}),l(x,{align:"center",justify:"center",gap:"medium",children:[n(ie,{className:"dndev-size-lg",style:{color:"var(--muted-foreground)"}}),n(g,{as:"p",variant:"muted",level:"small",align:"center",children:s("document.upload.hint")}),n(g,{as:"p",variant:"muted",level:"caption",align:"center",children:"PDF, Word, Excel, PowerPoint, TXT, Markdown, HTML"})]})]}),i.length>0&&n(x,{gap:"tight",children:i.map((e,r)=>{const t=Fe(e.uploaded?.mimeType||e.file.type,e.file.name),a=e.uploadProgress!==null&&e.uploadProgress<100,o=e.uploaded?.mimeType==="application/pdf"||e.file.name.toLowerCase().endsWith(".pdf");return l("div",{className:"dndev-surface","data-variant":"muted",style:{padding:"var(--gap-md)",borderRadius:"var(--radius-md)",display:"flex",alignItems:"center",gap:"var(--gap-md)"},children:[n(ke,{type:t,className:"dndev-size-md"}),l(x,{gap:"none",style:{flex:1,minWidth:0},children:[n(g,{level:"small",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.file.name}),l(g,{level:"caption",variant:"muted",children:[De(e.uploaded?.size||e.file.size),e.error&&l("span",{style:{color:"var(--destructive)"},children:[" ","\xB7 ",e.error]})]}),a&&n(fe,{value:e.uploadProgress||0,max:100,style:{marginTop:"var(--gap-xs)"}})]}),l(x,{direction:"row",gap:"tight",children:[H&&o&&e.uploaded&&n(G,{variant:V.GHOST,onClick:()=>ne(e),"aria-label":s("document.preview.ariaLabel"),children:n(ue,{className:"dndev-size-sm"})}),a?n(ce,{className:"dndev-size-sm",style:{animation:"spin 1s linear infinite"}}):n(G,{variant:V.GHOST,onClick:()=>te(r),"aria-label":s("document.delete.ariaLabel"),children:n(se,{className:"dndev-size-sm"})})]})]},e.id)})}),R&&n(g,{level:"caption",variant:k?"destructive":"muted",style:{marginTop:"var(--gap-xs)"},children:R})]}),H&&U&&n(ge,{open:!!U,onOpenChange:()=>_(null),children:l(ve,{style:{maxWidth:"90vw",maxHeight:"90vh",width:"900px",height:"80vh"},children:[n(he,{children:n(ye,{children:s("document.preview.title")})}),n("iframe",{src:U,style:{width:"100%",height:"100%",border:"none",borderRadius:"var(--radius-md)"},title:"PDF Preview"})]})})]})});q.displayName="DocumentFieldComponent";var Re=q;export{Re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o,jsxs as p}from"react/jsx-runtime";import{Select as g,Stack as m}from"@donotdev/components";import{useTranslation as f}from"@donotdev/core";const h=({label:r,value:n,options:s,error:l,helperText:t,onChange:a,onBlur:i,required:c})=>{const{t:d}=f("dndev"),u=n!=null?String(n):"";return p(m,{gap:"tight",children:[o(g,{label:r,value:u,onValueChange:e=>{a&&a({target:{value:e}})},onOpenChange:e=>!e&&i?.(),placeholder:d("actions.select","Select"),required:c,options:s.map(e=>({value:String(e.value),label:e.label}))}),t&&o("p",{style:{fontSize:"var(--font-size-xs)",color:l?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:t})]})};var C=h;export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a,jsxs as u}from"react/jsx-runtime";import{useState as w,useMemo as C}from"react";import{Clock as S}from"lucide-react";import{Label as $,Stack as l,Button as b,Slider as E}from"@donotdev/components";const x=[15,30,45,60,90,120,150,180],N={15:"duration.15m",30:"duration.30m",45:"duration.45m",60:"duration.1h",90:"duration.1h30",120:"duration.2h",150:"duration.2h30",180:"duration.3h"};function _(e,n){const i=e<60?`${e}m`:e%60===0?`${e/60}h`:`${Math.floor(e/60)}h${e%60}`,s=N[e];return!n||!s?i:n(`crud:${s}`,{defaultValue:i})??i}const j=({label:e,value:n,onChange:i,error:s,helperText:d,disabled:c,required:h,readonly:M,min:p=0,max:g=480,step:V=5,t:o})=>{const r=typeof n=="number"&&!Number.isNaN(n)?n:0,m=x.includes(r),[f,v]=w(!m&&r>0),k=C(()=>x.map(t=>({minutes:t,label:_(t,o)})),[o]),y=o?o("crud:duration.custom",{defaultValue:"Custom"}):"Custom";if(M){const t=r===0?o?o("crud:duration.zero",{defaultValue:"\u2014"}):"\u2014":r<60?o?o("crud:duration.minutes",{count:r,defaultValue:`${r} min`}):`${r} min`:o?o("crud:duration.hoursMinutes",{hours:Math.floor(r/60),minutes:r%60,defaultValue:`${Math.floor(r/60)}h${r%60?` ${r%60}min`:""}`}):`${Math.floor(r/60)}h${r%60?` ${r%60}m`:""}`;return u(l,{gap:"tight",children:[a($,{required:h,style:{fontSize:"var(--font-size-sm)",fontWeight:500},children:e}),u(l,{direction:"row",gap:"tight",align:"center",children:[a(S,{size:18,style:{color:"var(--muted-foreground)"},"aria-hidden":!0}),a("span",{style:{color:"var(--muted-foreground)",fontSize:"var(--font-size-sm)"},children:t})]}),d&&a("p",{style:{fontSize:"var(--font-size-xs)",color:s?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:d})]})}return u(l,{gap:"medium",children:[a($,{required:h,style:{fontSize:"var(--font-size-sm)",fontWeight:500},children:e}),u(l,{direction:"row",gap:"tight",align:"center",style:{flexWrap:"wrap"},children:[k.map(({minutes:t,label:z})=>u(b,{type:"button",variant:r===t?"primary":"outline",disabled:c,onClick:()=>{v(!1),i(t)},"aria-pressed":r===t,"aria-label":z,children:[a(S,{size:14,style:{marginRight:"var(--gap-xs)"},"aria-hidden":!0}),z]},t)),a(b,{type:"button",variant:f?"primary":"outline",disabled:c,onClick:()=>{v(!0),!m&&r>0?i(r):i(30)},"aria-pressed":f,"aria-label":y,children:y})]}),f&&a(l,{gap:"tight",style:{marginTop:"var(--gap-sm)"},children:a(E,{value:[m?30:r],onValueChange:([t])=>i(Math.max(p,Math.min(g,t??0))),min:p,max:g,step:V,showValue:!0,disabled:c,"aria-label":e})}),d&&a("p",{style:{fontSize:"var(--font-size-xs)",color:s?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:d})]})};var W=j;export{x as DURATION_PRESETS,W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as s,jsxs as p}from"react/jsx-runtime";import{Upload as Z,X as $,File as ee,Loader2 as re,FileText as C,FileSpreadsheet as oe,FileImage as se,FileVideo as ae,FileAudio as te,FileArchive as le,FileCode as ne}from"lucide-react";import{useCallback as y,useState as O,useRef as b,useEffect as _,useImperativeHandle as ie,forwardRef as de}from"react";import{Button as ue,BUTTON_VARIANT as ce,Text as F,Stack as P,Progress as pe}from"@donotdev/components";import{handleError as M,useTranslation as fe}from"@donotdev/core";import{useUploadContext as ge}from"../../../contexts/UploadContext";import{useUploadStore as me}from"../../../stores/UploadStore";import{uploadFile as ve,deleteFile as he,generateFileId as H,getFileIcon as ye,formatFileSize as Fe}from"../../../utils/fileStorage";function we({type:f,className:n}){switch(f){case"pdf":return s(C,{className:n,style:{color:"var(--destructive)"}});case"doc":return s(C,{className:n,style:{color:"var(--primary)"}});case"xls":return s(oe,{className:n,style:{color:"var(--success)"}});case"ppt":return s(C,{className:n,style:{color:"var(--warning)"}});case"image":return s(se,{className:n});case"video":return s(ae,{className:n});case"audio":return s(te,{className:n});case"archive":return s(le,{className:n});case"html":case"text":return s(ne,{className:n});default:return s(ee,{className:n})}}const D=de(({name:f,label:n,value:g,onChange:T,error:A,helperText:R,accept:V,multiple:d=!1,maxFiles:N=10,maxSize:k=50*1024*1024,storagePath:E="uploads/files",required:q},G)=>{const{t:K}=fe("dndev"),i=K,m=ge(),I=me(),j=!!m,[t,c]=O([]),[L,U]=O(!1),v=b(null),S=b(!1),w=b(void 0),x=y(e=>{const r=e.filter(o=>o.uploaded&&!o.error).map(o=>o.uploaded);T(d?r:r[0]||null)},[d,T]);_(()=>{if(S.current){S.current=!1;return}if(g){const e=[];(Array.isArray(g)?g:[g]).forEach(o=>{o.url&&e.push({id:H(),file:new File([],o.filename),uploadProgress:null,uploaded:o,error:null})}),c(e)}else c([])},[g]);const W=y(async()=>{const e=t.filter(r=>!r.uploaded&&!r.error&&r.uploadProgress===null);if(e.length!==0){c(r=>r.map(o=>e.some(l=>l.id===o.id)?{...o,uploadProgress:0}:o));for(const r of e)try{const o=await ve(r.file,{storagePath:E,onProgress:l=>{c(a=>a.map(u=>u.id===r.id?{...u,uploadProgress:l.progress}:u))}});c(l=>{const a=l.map(u=>u.id===r.id?{...u,uploaded:o,uploadProgress:100,error:null}:u);return queueMicrotask(()=>x(a)),a})}catch{c(l=>l.map(a=>a.id===r.id?{...a,error:"Upload failed",uploadProgress:null}:a))}}},[t,E,x]);w.current=W,_(()=>{if(!(!m||!f))return I.registerUpload(m,f,async e=>{await w.current?.()}),()=>{I.unregisterUpload(m,f)}},[m,f,I]),ie(G,()=>({upload:async()=>{await w.current?.()},getFiles:()=>B.current||[]}),[]);const B=b(t);B.current=t;const z=y(e=>{const o=(d?N:1)-t.length;if(o<=0){M(new Error("Maximum files reached"),{userMessage:i("file.errors.maxFiles",{max:N}),severity:"warning",showNotification:!0});return}const l=e.slice(0,o),a=[],u=(k/(1024*1024)).toFixed(0);for(const h of l){if(h.size>k){M(new Error("File too large"),{userMessage:i("file.errors.exceedsSize",{fileName:h.name,size:u}),severity:"warning",showNotification:!0});continue}a.push({id:H(),file:h,uploadProgress:null,uploaded:null,error:null})}a.length!==0&&(c(h=>d?[...h,...a]:a),j||setTimeout(()=>w.current?.(),0))},[t,d,N,k,i,j]),X=e=>{const r=Array.from(e.target.files||[]);r.length>0&&z(r),v.current&&(v.current.value="")},J=y(e=>{e.preventDefault(),U(!1);const r=Array.from(e.dataTransfer.files);z(r)},[z]),Q=y(async e=>{const r=t[e];if(r)try{r.uploaded&&await he(r.uploaded);const o=t.filter((l,a)=>a!==e);S.current=!0,c(o),setTimeout(()=>x(o),0)}catch(o){M(o,{userMessage:i("file.delete.failed"),severity:"error",showNotification:!0})}},[t,x,i]),Y=d||t.length===0,xe=t.some(e=>!e.uploaded&&!e.error&&e.uploadProgress===null);return p(P,{gap:"tight",children:[p(F,{level:"body",align:"start",children:[n,q?"*":""]}),Y&&p("div",{role:"button",tabIndex:0,"aria-label":i(d?"file.upload.ariaLabelMultiple":"file.upload.ariaLabelSingle"),className:"dndev-surface","data-variant":A?"destructive":"default",style:{border:"var(--border-width) dashed",borderColor:L?"var(--primary)":A?"var(--destructive)":"var(--border)",borderRadius:"var(--radius-lg)",padding:"var(--gap-lg)",backgroundColor:L?"color-mix(in oklab, var(--primary) 5%, transparent)":"var(--surface)",transition:"border-color var(--dur-fast), background-color var(--dur-fast)",cursor:"pointer",outline:"none"},onDragOver:e=>{e.preventDefault(),U(!0)},onDragLeave:()=>U(!1),onDrop:J,onClick:()=>v.current?.click(),onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),v.current?.click())},children:[s("input",{ref:v,type:"file",accept:V,multiple:d,style:{display:"none"},onChange:X}),p(P,{align:"center",justify:"center",gap:"medium",children:[s(Z,{className:"dndev-size-lg",style:{color:"var(--muted-foreground)"}}),s(F,{as:"p",variant:"muted",level:"small",align:"center",children:i(d?"file.upload.dragDropMultiple":"file.upload.dragDropSingle")})]})]}),t.length>0&&s(P,{gap:"tight",children:t.map((e,r)=>{const o=ye(e.uploaded?.mimeType||e.file.type,e.file.name),l=e.uploadProgress!==null&&e.uploadProgress<100,a=e.uploaded&&!e.error;return p("div",{className:"dndev-surface","data-variant":"muted",style:{padding:"var(--gap-md)",borderRadius:"var(--radius-md)",display:"flex",alignItems:"center",gap:"var(--gap-md)"},children:[s(we,{type:o,className:"dndev-size-md"}),p(P,{gap:"none",style:{flex:1,minWidth:0},children:[s(F,{level:"small",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.file.name}),p(F,{level:"caption",variant:"muted",children:[Fe(e.uploaded?.size||e.file.size),e.error&&p("span",{style:{color:"var(--destructive)"},children:[" ","\xB7 ",e.error]})]}),l&&s(pe,{value:e.uploadProgress||0,max:100,style:{marginTop:"var(--gap-xs)"}})]}),l?s(re,{className:"dndev-size-sm",style:{animation:"spin 1s linear infinite"}}):s(ue,{variant:ce.GHOST,onClick:()=>Q(r),"aria-label":i("file.delete.ariaLabel"),children:s($,{className:"dndev-size-sm"})})]},e.id)})}),R&&s(F,{level:"caption",variant:A?"destructive":"muted",style:{marginTop:"var(--gap-xs)"},children:R})]})});D.displayName="FileFieldComponent";var ze=D;export{ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as o,Fragment as w}from"react/jsx-runtime";import{useState as m}from"react";import{Checkbox as T,Label as O,Sheet as g,Stack as D,Text as j}from"@donotdev/components";import{useTranslation as H}from"@donotdev/core";const V=({checked:l=!1,onChange:s,required:u,privacyPolicyPath:a="/legal/privacy",termsPath:c="/legal/terms"})=>{const{t:n}=H("crud"),[x,d]=m(!1),[y,h]=m(!1),p=e=>{s&&s({target:{checked:e}})},C=e=>{e.target.tagName!=="A"&&(e.target.closest('[data-type="checkbox"]')||p(!l))},f=(e,b)=>{e.preventDefault(),b==="privacy"?d(!0):h(!0)},v=n("gdprConsent.consent",{defaultValue:"I agree to the"}),r=n("gdprConsent.privacyPolicy",{defaultValue:"privacy policy"}),i=n("gdprConsent.terms",{defaultValue:"terms of use"}),k=n("gdprConsent.and",{defaultValue:"and consent to the processing of my personal data."});return o(w,{children:[o(D,{direction:"row",align:"center",gap:"tight",children:[t(T,{checked:l,onCheckedChange:p}),t(O,{required:u,plain:!0,onClick:C,style:{cursor:"pointer"},children:o(j,{level:"small",children:[v," ",t("a",{href:a,onClick:e=>f(e,"privacy"),style:{textDecoration:"underline",cursor:"pointer"},children:r})," / ",t("a",{href:c,onClick:e=>f(e,"terms"),style:{textDecoration:"underline",cursor:"pointer"},children:i})," ",k]})})]}),t(g,{open:x,onOpenChange:d,side:"bottom",title:r,style:{width:"100%",height:"90%",maxHeight:"90dvh",display:"flex",flexDirection:"column",overflow:"hidden"},children:t("iframe",{src:a,style:{width:"100%",height:"100%",border:"none",flex:1,minHeight:0},title:r})}),t(g,{open:y,onOpenChange:h,side:"bottom",title:i,style:{width:"100%",height:"90%",maxHeight:"90dvh",display:"flex",flexDirection:"column",overflow:"hidden"},children:t("iframe",{src:c,style:{width:"100%",height:"100%",border:"none",flex:1,minHeight:0},title:i})})]})};var q=V;export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as c}from"react/jsx-runtime";import{Label as h,Input as g,Stack as u}from"@donotdev/components";const y=({label:m,value:e={lat:0,lng:0},onChange:l,error:a,helperText:r,disabled:d,required:f})=>{const v=i=>{const t=parseFloat(i.target.value)||0;if(t>=-90&&t<=90){const s={...e,lat:t},o={target:{value:JSON.stringify(s)}};l(o)}},p=i=>{const t=parseFloat(i.target.value)||0;if(t>=-180&&t<=180){const s={...e,lng:t},o={target:{value:JSON.stringify(s)}};l(o)}};return c(u,{gap:"tight",children:[n(h,{required:f,style:{display:"block",fontSize:"var(--font-size-sm)",fontWeight:500},children:m}),c(u,{direction:"row",gap:"medium",children:[n(g,{label:"Latitude",type:"number",value:e.lat,onChange:v,min:"-90",max:"90",step:"0.000001",disabled:d,"data-variant":a?"destructive":void 0,className:"dndev-w-full"}),n(g,{label:"Longitude",type:"number",value:e.lng,onChange:p,min:"-180",max:"180",step:"0.000001",disabled:d,"data-variant":a?"destructive":void 0,className:"dndev-w-full"})]}),r&&n("p",{style:{fontSize:"var(--font-size-xs)",color:a?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:r})]})};var L=y;export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";const
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";const d=({name:e,value:n})=>t("input",{type:"hidden",name:e,value:n});var i=d;export{i as default};
|