@donotdev/crud 0.0.21 → 0.0.22
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.d.ts.map +1 -1
- package/dist/CrudStore.d.ts.map +1 -1
- package/dist/FieldRegistry.d.ts +1 -1
- package/dist/FieldRegistry.d.ts.map +1 -1
- package/dist/adapters/FunctionsAdapter.d.ts +15 -0
- package/dist/adapters/FunctionsAdapter.d.ts.map +1 -1
- package/dist/components/CrudCard.js +1 -1
- package/dist/components/DateFilter.d.ts.map +1 -1
- package/dist/components/DateFilter.js +1 -1
- package/dist/components/DisplayFieldRenderer.d.ts.map +1 -1
- package/dist/components/DisplayFieldRenderer.js +1 -1
- package/dist/components/EntityFilters.d.ts +4 -1
- 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/controlled/complex/ControlledAddressField.d.ts.map +1 -1
- package/dist/components/controlled/complex/ControlledDateField.d.ts.map +1 -1
- package/dist/components/controlled/complex/ControlledFieldArrayField.d.ts.map +1 -1
- package/dist/components/controlled/complex/ControlledGeoPointField.d.ts.map +1 -1
- package/dist/components/controlled/complex/ControlledMapField.d.ts.map +1 -1
- package/dist/components/controlled/complex/ControlledMultiInputField.d.ts.map +1 -1
- package/dist/components/controlled/complex/ControlledRichTextField.d.ts.map +1 -1
- package/dist/components/controlled/complex/ControlledTimestampField.d.ts.map +1 -1
- package/dist/components/controlled/file/ControlledDocumentField.d.ts.map +1 -1
- package/dist/components/controlled/file/ControlledFileField.d.ts.map +1 -1
- package/dist/components/controlled/file/ControlledImageField.d.ts.map +1 -1
- package/dist/components/controlled/file/ControlledMultiDocumentField.d.ts.map +1 -1
- package/dist/components/controlled/file/ControlledMultiFileField.d.ts.map +1 -1
- package/dist/components/controlled/file/ControlledMultiImageField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledCheckboxField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledCurrencyField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledDurationField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledGdprConsentField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledNumberField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledPasswordField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledPhoneField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledPriceField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledRangeField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledRatingField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledSwitchField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledTextField.d.ts.map +1 -1
- package/dist/components/controlled/input/ControlledTextareaField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledComboboxField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledDropdownField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledMultiDropdownField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledRadioField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledReferenceField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledYearField.d.ts.map +1 -1
- package/dist/components/controlled/select/ControlledYearField.js +1 -1
- package/dist/components/controlled/types.d.ts.map +1 -1
- package/dist/components/form/fields/DurationFieldComponent.js +1 -1
- package/dist/components/form/fields/ImageFieldComponent.d.ts.map +1 -1
- package/dist/components/form/fields/PriceFieldComponent.js +1 -1
- package/dist/components/form/fields/RichTextComponent.d.ts +1 -1
- package/dist/components/form/fields/RichTextComponent.d.ts.map +1 -1
- package/dist/components/form/fields/SwitchFieldComponent.d.ts.map +1 -1
- package/dist/contexts/UploadContext.d.ts.map +1 -1
- package/dist/fieldTypeRegistry.d.ts +1 -1
- package/dist/fieldTypeRegistry.d.ts.map +1 -1
- package/dist/forms/hooks/useController.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/forms/types.d.ts +2 -2
- package/dist/forms/types.d.ts.map +1 -1
- package/dist/forms/utils/buildInitialValues.d.ts.map +1 -1
- package/dist/hooks/useCrudFilters.d.ts.map +1 -1
- package/dist/hooks/useFieldConditions.d.ts +1 -1
- package/dist/hooks/useFieldConditions.d.ts.map +1 -1
- package/dist/hooks/useUnsavedChangesWarning.d.ts +0 -1
- package/dist/hooks/useUnsavedChangesWarning.d.ts.map +1 -1
- package/dist/hooks/useUnsavedChangesWarning.js +1 -1
- package/dist/registerBuiltinFieldTypes.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/useBaseCrudList.d.ts.map +1 -1
- package/dist/useBaseCrudList.js +1 -1
- package/dist/useCrud.d.ts.map +1 -1
- package/dist/useCrudCardList.d.ts.map +1 -1
- package/dist/useCrudCardList.js +1 -1
- package/dist/useCrudList.d.ts.map +1 -1
- package/dist/useCrudList.js +1 -1
- package/dist/utils/clientListProcessing.d.ts.map +1 -1
- package/dist/utils/fileStorage.d.ts.map +1 -1
- package/dist/utils/imageStorage.d.ts.map +1 -1
- package/dist/utils/mergeWithOptimistic.d.ts +0 -8
- package/dist/utils/mergeWithOptimistic.d.ts.map +1 -1
- package/dist/workflows/defineWorkflow.d.ts.map +1 -1
- package/dist/workflows/useEntityWorkflow.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrudService.d.ts","sourceRoot":"","sources":["../src/CrudService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CrudService.d.ts","sourceRoot":"","sources":["../src/CrudService.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAEX,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC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IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,CAAC,CAAC;IA4FP,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC;CA6EjB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,mBAE1B,CAAC"}
|
package/dist/CrudStore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrudStore.d.ts","sourceRoot":"","sources":["../src/CrudStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CrudStore.d.ts","sourceRoot":"","sources":["../src/CrudStore.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAEV,SAAS,EACT,WAAW,EAIZ,MAAM,SAAS,CAAC;AAyBjB;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,iIAuZvB,CAAC"}
|
package/dist/FieldRegistry.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
9
9
|
import type { EntityField, FieldType, ValueTypeForField } from '@donotdev/core';
|
|
10
|
+
import type { ControlledFieldProps } from './components/controlled/types';
|
|
10
11
|
import type { ComponentType, ReactElement } from 'react';
|
|
11
12
|
import type { FieldValues } from 'react-hook-form';
|
|
12
|
-
import type { ControlledFieldProps } from './components/controlled/types';
|
|
13
13
|
export type { ControlledFieldProps };
|
|
14
14
|
/**
|
|
15
15
|
* Props for uncontrolled field components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldRegistry.d.ts","sourceRoot":"","sources":["../src/FieldRegistry.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,iBA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;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS;IAIrE;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAIzD;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAInC;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B;;OAEG;IACH,kBAAkB,IAAI,MAAM,EAAE;IAI9B;;OAEG;IACH,KAAK,IAAI,IAAI;CAKd;AAKD;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAKhD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,MAAM,EACjD,YAAY,EAAE,qBAAqB,CAAC,EAAE,CAAC,GACtC,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Firebase Functions Backend Adapter
|
|
3
|
+
* @description HTTP callable Functions adapter for secure CRUD operations
|
|
4
|
+
*
|
|
5
|
+
* **Features:**
|
|
6
|
+
* - Server-side security (admin checks, auth verification)
|
|
7
|
+
* - Schema validation on server
|
|
8
|
+
* - Idempotency keys support
|
|
9
|
+
* - Audit logs and metadata
|
|
10
|
+
* - Rate limiting
|
|
11
|
+
*
|
|
12
|
+
* @version 0.0.1
|
|
13
|
+
* @since 0.0.1
|
|
14
|
+
* @author AMBROISE PARK Consulting
|
|
15
|
+
*/
|
|
1
16
|
import type { dndevSchema, ICrudAdapter, ListSchemaType, PaginatedQueryResult } from '@donotdev/core';
|
|
2
17
|
/**
|
|
3
18
|
* Query options for Functions queries
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionsAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/FunctionsAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FunctionsAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/FunctionsAdapter.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,WAAW,EAEX,YAAY,EACZ,cAAc,EACd,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AASxB;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACnE,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAgBD,qBAAa,gBAAiB,YAAW,YAAY;IACnD,QAAQ,CAAC,cAAc,QAAQ;IAE/B;;OAEG;YACW,WAAW;IAWzB;;OAEG;YACW,aAAa;IASrB,GAAG,CAAC,CAAC,EACT,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAC3B,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAgBd,GAAG,CAAC,CAAC,EACT,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,IAAI,CAAC;IAaV,MAAM,CAAC,CAAC,EACZ,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GACf,OAAO,CAAC,IAAI,CAAC;IAmBV,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBzD,GAAG,CAAC,CAAC,EACT,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAwBnD,KAAK,CAAC,CAAC,EACX,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAC5B,UAAU,GAAE,cAAsC,GACjD,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAqEnC,SAAS,CAAC,CAAC,KAAK,MAAM,IAAI;IAS1B,qBAAqB,CAAC,CAAC,KAAK,MAAM,IAAI;CAQvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as T}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as o,jsxs as T}from"react/jsx-runtime";import{Trash2 as G}from"lucide-react";import{useMemo as g}from"react";import{Card as H,Stack as j,Text as B,ActionButton as J}from"@donotdev/components";import{useTranslation as I,getListCardFieldNames as K}from"@donotdev/core";import{formatValue as h}from"./DisplayFieldRenderer";import{DisplayThumbnail as N}from"./DisplayThumbnail";import{translateFieldLabel as O}from"../forms/utils/translateFieldLabel";import{useCrud as Q}from"../useCrud";function d(e){return e==="image"||e==="images"}function U(e){return g(()=>{const t=e.listCardFields;if(t&&!Array.isArray(t)){const s=t;return{titleFields:s.title??[],subtitleFields:s.subtitle??[],contentFields:s.content??[],footerFields:s.footer??[]}}const c=K(e),f=c.filter(s=>!d(e.fields[s]?.type)),v=c.filter(s=>d(e.fields[s]?.type)),C=f.length>0?[f[0]]:[],b=[...f.slice(1,4),...v];return{titleFields:C,subtitleFields:[],contentFields:b,footerFields:[]}},[e])}function L({item:e,entity:t,onClick:c,titleFields:f,subtitleFields:v,contentFields:C,footerFields:b,showDelete:s=!1,renderActions:V,elevated:M=!0,className:P}){const{t:a}=I([t.namespace,"crud"]),{t:p}=I("crud"),F=U(t),x=f??F.titleFields,S=v??F.subtitleFields,A=C??F.contentFields,m=b??F.footerFields,D=g(()=>{if(!x?.length)return e.id??"";const r=x.filter(i=>typeof i=="string").filter(i=>!d(t.fields[i]?.type)).map(i=>{const n=t.fields[i],y=e[i],u=n?h(y,n,a,{compact:!0,asString:!0}):y;return typeof u=="string"?u:String(u??"")}).filter(Boolean),l=!Array.isArray(t.listCardFields)&&t.listCardFields?.titleSeparator!=null?t.listCardFields.titleSeparator:" ";return r.join(l)||String(e.id??"")},[e,t.fields,x,t.listCardFields,a]),R=g(()=>S?.length&&S.filter(r=>typeof r=="string").filter(r=>!d(t.fields[r]?.type)).map(r=>{const l=t.fields[r],i=e[r],n=l?h(i,l,a,{compact:!0,asString:!0}):i;return typeof n=="string"?n:String(n??"")}).filter(Boolean).join(" ")||void 0,[e,t.fields,S,a]),q=g(()=>{if(!A?.length)return null;const r=A.map(l=>{const i=t.fields[l];if(!i)return null;if(d(i.type)){const n=e[l];return n==null?null:o(N,{pictures:n,alt:String(D),aspectRatio:"16/9"},l)}return T("div",{children:[o(B,{level:"small",variant:"muted",children:O(l,i,a)}),o(B,{children:h(e[l],i,a,{compact:!0})})]},l)}).filter(Boolean);return r.length>0?o(j,{direction:"column",gap:"tight",children:r}):null},[e,t.fields,A,D,a]),z=g(()=>{if(!m?.length)return;if(m.some(l=>d(t.fields[l]?.type))){const l=m.map(i=>{const n=t.fields[i];if(!n)return null;if(d(n.type)){const u=e[i];return u==null?null:o(N,{pictures:u,alt:"",aspectRatio:"1"},i)}const y=h(e[i],n,a,{compact:!0});return o("span",{children:y},i)});return o(j,{direction:"row",gap:"tight",align:"center",children:l.filter(Boolean)})}const r=m.map(l=>{const i=t.fields[l];return i?h(e[l],i,a,{compact:!0}):e[l]});return o(B,{level:"small",children:r.join(" \xB7 ")})},[e,t.fields,m,a]),E=Q(t).delete,k=o(H,{title:String(D??""),subtitle:R,content:q??void 0,footer:z,clickable:!!c,onClick:c?()=>c(e.id):void 0,elevated:M,className:P}),w=V||s?T("div",{style:{position:"absolute",top:"var(--gap-sm)",right:"var(--gap-sm)",zIndex:10,display:"flex",alignItems:"flex-start",gap:"var(--gap-xs)"},onClick:r=>r.stopPropagation(),onMouseDown:r=>r.stopPropagation(),children:[V,s&&o(J,{action:async()=>{await E(e.id)},confirmText:p("delete.confirm",{defaultValue:"Are you sure you want to delete this item?"}),confirmTitle:p("delete.title",{defaultValue:"Delete Item"}),loadingText:p("delete.loading",{defaultValue:"Deleting..."}),variant:"destructive",icon:G,"aria-label":p("delete",{defaultValue:"Delete"}),children:p("delete",{defaultValue:"Delete"})})]}):null;return w?T("div",{style:{position:"relative",height:"100%"},children:[k,w]}):k}var W=L;export{L as CrudCard,W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFilter.d.ts","sourceRoot":"","sources":["../../src/components/DateFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateFilter.d.ts","sourceRoot":"","sources":["../../src/components/DateFilter.tsx"],"names":[],"mappings":"AAyBA,MAAM,MAAM,eAAe,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAC9C,0EAA0E;IAC1E,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,yCAAyC;IACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,KAAK,IAAI,CAAC;IACvD,8CAA8C;IAC9C,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IACjE,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAa,GACd,EAAE,eAAe,2CAySjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e,jsxs as b,Fragment as ct}from"react/jsx-runtime";import{X as ut}from"lucide-react";import{useState as k,useMemo as ht}from"react";import{Button as S,Calendar as St,FloatingLabel as Dt,Sheet as T,Text as $t}from"@donotdev/components";import{formatDate as xt}from"@donotdev/core";function ft({label:D,fieldType:vt,value:l,onChange:$,tCrud:i,locale:j="en"}){const[M,o]=k(!1),[F,x]=k(null),N=ht(()=>l?typeof l=="object"&&l!==null&&"min"in l?{min:l.min||"",max:l.max||""}:{min:"",max:""}:{min:"",max:""},[l]),C=t=>{if(!t)return"";try{const n=new Date(t+"T00:00:00");return xt(n,j)}catch{return t}},O=()=>{const t=new Date;t.setHours(0,0,0,0);const n=t.getFullYear(),d=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),g=`${n}-${d}-${r}`,s=new Date(t);s.setDate(s.getDate()-1);const v=s.getFullYear(),f=String(s.getMonth()+1).padStart(2,"0"),z=String(s.getDate()).padStart(2,"0"),B=`${v}-${f}-${z}`,m=new Date(t);m.setDate(m.getDate()+1);const H=m.getFullYear(),L=String(m.getMonth()+1).padStart(2,"0"),X=String(m.getDate()).padStart(2,"0"),q=`${H}-${L}-${X}`,p=new Date(t);p.setDate(p.getDate()-7);const A=p.getFullYear(),G=String(p.getMonth()+1).padStart(2,"0"),I=String(p.getDate()).padStart(2,"0"),J=`${A}-${G}-${I}`,c=new Date(t);c.setDate(c.getDate()-30);const K=c.getFullYear(),P=String(c.getMonth()+1).padStart(2,"0"),Q=String(c.getDate()).padStart(2,"0"),R=`${K}-${P}-${Q}`,u=new Date(t);u.setDate(u.getDate()+7);const U=u.getFullYear(),Z=String(u.getMonth()+1).padStart(2,"0"),_=String(u.getDate()).padStart(2,"0"),tt=`${U}-${Z}-${_}`,h=new Date(t);h.setDate(h.getDate()+30);const et=h.getFullYear(),at=String(h.getMonth()+1).padStart(2,"0"),nt=String(h.getDate()).padStart(2,"0"),rt=`${et}-${at}-${nt}`,y=new Date(t.getFullYear(),t.getMonth(),1),lt=y.getFullYear(),it=String(y.getMonth()+1).padStart(2,"0"),ot=String(y.getDate()).padStart(2,"0"),st=`${lt}-${it}-${ot}`,w=new Date(t.getFullYear(),t.getMonth()+1,0),dt=w.getFullYear(),gt=String(w.getMonth()+1).padStart(2,"0"),mt=String(w.getDate()).padStart(2,"0"),pt=`${dt}-${gt}-${mt}`;return{today:g,yesterday:B,tomorrow:q,last7Days:J,last30Days:R,next7Days:tt,next30Days:rt,thisMonthStart:st,thisMonthEnd:pt}},a=N,W=O(),E=!!(a?.min||a?.max),Y=t=>{const n=t==="start",d=n?a?.min:a?.max;return e("div",{style:{padding:"var(--gap-md)"},children:b("div",{style:{display:"flex",flexDirection:"column",gap:"var(--gap-md)"},children:[e("div",{style:{display:"flex",flexWrap:"wrap",gap:"var(--gap-tight)"},children:(n?["today","yesterday","last7Days","last30Days","thisMonthStart"]:["today","tomorrow","next7Days","next30Days","thisMonthEnd"]).map(r=>{const g=W[r];return e(S,{variant:"outline",onClick:()=>{$({min:n?g:a?.min||"",max:n?a?.max||"":g}),o(!1)},children:i(`filter.${r}`,{defaultValue:r})},r)})}),e(St,{selected:d?new Date(d+"T00:00:00"):void 0,mode:"single",onSelect:r=>{if(!r)return;const g=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),v=String(r.getDate()).padStart(2,"0"),f=`${g}-${s}-${v}`;$({min:n?f:a?.min||"",max:n?a?.max||"":f}),o(!1)},defaultMonth:d?new Date(d+"T00:00:00"):new Date}),e(S,{variant:"ghost",display:"compact",onClick:()=>{$({min:n?"":a?.min||"",max:n&&a?.max||""}),o(!1)},children:i("filter.clear",{defaultValue:"Clear"})})]})})},V=b(ct,{children:[e(T,{trigger:e(S,{variant:"ghost",onClick:()=>{x("start"),o(!0)},style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a?.min?C(a.min):i("filter.min",{defaultValue:"Min"})}),title:`${D} - ${i("filter.min",{defaultValue:"Min"})}`,open:M&&F==="start",onOpenChange:t=>{o(t),t||x(null)},children:Y("start")}),e($t,{level:"small",variant:"muted",className:"dndev-range-input-separator",children:"\u2013"}),e(T,{trigger:e(S,{variant:"ghost",onClick:()=>{x("end"),o(!0)},style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a?.max?C(a.max):i("filter.max",{defaultValue:"Max"})}),title:`${D} - ${i("filter.max",{defaultValue:"Max"})}`,open:M&&F==="end",onOpenChange:t=>{o(t),t||x(null)},children:Y("end")}),e(S,{variant:"ghost",display:"compact",icon:e(ut,{size:16}),onClick:()=>{$(void 0)},disabled:!E,"aria-label":i("filter.clear",{defaultValue:"Clear"})})]});return D?e(Dt,{label:D,children:e("div",{className:"dndev-range-input",children:V})}):e("div",{className:"dndev-range-input",children:V})}export{ft as DateFilter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayFieldRenderer.d.ts","sourceRoot":"","sources":["../../src/components/DisplayFieldRenderer.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"DisplayFieldRenderer.d.ts","sourceRoot":"","sources":["../../src/components/DisplayFieldRenderer.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,yBAAyB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IACxE,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,0BAA0B;IAC1B,KAAK,EAAE,GAAG,CAAC;IACX,2BAA2B;IAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC;CAC3D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,EACzD,OAAO,CAAC,EAAE,uBAAuB,GAChC,MAAM,GAAG,YAAY,CA0DvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,EACpE,IAAI,EACJ,MAAM,EACN,KAAK,EACL,CAAC,GACF,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,YAAY,CAyC7C;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{Text as a,Stack as c}from"@donotdev/components";import{handleError as d}from"@donotdev/core";import{
|
|
1
|
+
"use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{Text as a,Stack as c}from"@donotdev/components";import{handleError as d}from"@donotdev/core";import{getDisplayFormatter as u}from"../fieldTypeRegistry";import{translateFieldLabel as y}from"../forms/utils";function m(r,e,o,n){const i=n?.compact??!1;if(r==null||r==="")return i?t("span",{style:{color:"var(--muted-foreground)"},children:"\u2014"}):t(a,{variant:"muted",children:"\u2014"});const l=u(e.type);if(l)try{return l(r,e,o,n)}catch(f){return d(f,{userMessage:`Error formatting field "${e.label||e.name}"`,context:{fieldType:e.type,fieldName:e.label||"unknown",operation:"display_format"},severity:"warning"}),i?t("span",{style:{color:"var(--muted-foreground)"},children:String(r)}):t(a,{variant:"muted",children:String(r)})}return d(new Error(`Display formatter not registered for field type: ${e.type}`),{userMessage:`Field type "${e.type}" is missing display formatter`,context:{fieldType:e.type,fieldName:e.label||"unknown",operation:"display_format",fix:"Add displayFormatter to registerBuiltinFieldType() in registerBuiltinFieldTypes.tsx"},severity:"warning"}),i?t("span",{style:{color:"var(--muted-foreground)"},children:String(r)}):t(a,{variant:"muted",children:String(r)})}function p({name:r,config:e,value:o,t:n}){const i=m(o,e,n,{compact:!1}),l=y(r,e,n);return s(c,{direction:"row",align:"baseline",style:{marginBottom:"var(--gap-sm)",padding:"var(--gap-sm)",minHeight:"38px",alignItems:"center"},children:[s(a,{variant:"muted",style:{fontSize:"var(--font-size-sm)",fontWeight:500,minWidth:"fit-content",flexShrink:0},children:[l,":"]}),t("div",{style:{flex:1,display:"flex",alignItems:"center"},children:typeof i=="string"?t(a,{children:i}):i})]})}var g=p;export{p as DisplayFieldRenderer,g as default,m as formatValue};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GridCols } from '@donotdev/components';
|
|
1
2
|
import type { Entity } from '@donotdev/core';
|
|
2
3
|
export { matchesFilter } from '../utils/matchesFilter';
|
|
3
4
|
export interface EntityFiltersProps<T extends Record<string, any> & {
|
|
@@ -11,6 +12,8 @@ export interface EntityFiltersProps<T extends Record<string, any> & {
|
|
|
11
12
|
fieldsToFilter?: string[];
|
|
12
13
|
/** Layout variant: 'inline' (multi-column grid) or 'sidebar' (single column stack) */
|
|
13
14
|
variant?: 'inline' | 'sidebar';
|
|
15
|
+
/** Override responsive grid columns. Default: [2, 4, 6] for inline, 2 for sidebar. */
|
|
16
|
+
cols?: GridCols;
|
|
14
17
|
/** Optional: Data array to extract unique values and min/max from (if not provided, fetches automatically) */
|
|
15
18
|
data?: T[];
|
|
16
19
|
}
|
|
@@ -37,5 +40,5 @@ export declare function EntityFilters<T extends Record<string, any> & {
|
|
|
37
40
|
id: string;
|
|
38
41
|
} = Record<string, any> & {
|
|
39
42
|
id: string;
|
|
40
|
-
}>({ entity, data: dataProp, fieldsToFilter, variant, }: EntityFiltersProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
43
|
+
}>({ entity, data: dataProp, fieldsToFilter, variant, cols, }: EntityFiltersProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
41
44
|
//# sourceMappingURL=EntityFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityFilters.d.ts","sourceRoot":"","sources":["../../src/components/EntityFilters.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityFilters.d.ts","sourceRoot":"","sources":["../../src/components/EntityFilters.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAa7C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,WAAW,kBAAkB,CACjC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IACrE,EAAE,EAAE,MAAM,CAAC;CACZ;IAED,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IAEf,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B,sFAAsF;IACtF,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAE/B,sFAAsF;IACtF,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB,8GAA8G;IAC9G,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;CACZ;AAED;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,aAAa,CAC3B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IACrE,EAAE,EAAE,MAAM,CAAC;CACZ,EACD,EACA,MAAM,EACN,IAAI,EAAE,QAAQ,EACd,cAAc,EACd,OAAkB,EAClB,IAAI,GACL,EAAE,kBAAkB,CAAC,CAAC,CAAC,kDA0pBvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as d,jsxs as _}from"react/jsx-runtime";import{FilterX as Y}from"lucide-react";import{useMemo as S}from"react";import{Button as Z,Combobox as U,Grid as ee,Rating as te,RangeInput as ie,Slider as le,Stack as re}from"@donotdev/components";import{useTranslation as D,handleError as B}from"@donotdev/core";import{DateFilter as ae}from"./DateFilter";import{getFilterType as $,isFilterable as ne}from"../fieldTypeRegistry";import{translateFieldLabel as se,translateLabel as I}from"../forms/utils";import{useCrudFilters as oe}from"../hooks/useCrudFilters";import{useCrudCardList as me}from"../useCrudCardList";import{matchesFilter as fe}from"../utils/matchesFilter";import{matchesFilter as de}from"../utils/matchesFilter";function ue({entity:f,data:A,fieldsToFilter:j,variant:L="inline",cols:P}){const z=L==="sidebar",{t:p,i18n:G}=D("crud"),{t:w}=D([f.namespace,"crud"]),X=G?.language||"en",{data:q}=me(f,{enabled:!A}),c=A??(q?.items||[]),{filters:b,setFilters:k}=oe({collection:f.collection}),g=S(()=>(j&&j.length>0?j:f.listFields||Object.keys(f.fields)).filter(i=>{const t=f.fields[i]?.type||"text";return ne(t)}),[j,f.listFields,f.fields]),R=S(()=>{const i={};return g.forEach(t=>{const o=Object.fromEntries(Object.entries(b).filter(([l])=>l!==t));if(Object.keys(o).length===0){i[t]=c;return}i[t]=c.filter(l=>Object.entries(o).every(([m,h])=>{const F=l[m],x=f.fields[m]?.type||"text";return fe(F,h,x)}))}),i},[c,b,f.fields,g]),H=S(()=>{const i={};return g.forEach(t=>{const o=f.fields[t];if(!o)return;const l=o.type||"text",m=$(l);if(!m){B(new Error(`Field type "${l}" not registered in field type registry`),{userMessage:`Field type "${l}" is missing from registry`,context:{fieldType:l,fieldName:t,operation:"minmax_computation",fix:"Add to registerBuiltinFieldTypes.ts or registerFieldType()"},severity:"warning"});return}const h=m==="range"&&(l==="date"||l==="datetime-local"||l==="timestamp"||l==="time"||l==="week"||l==="month"||l==="year"),F=m==="range"&&!h,x=l==="price";if(F||x){const a=c.map(r=>r[t]).filter(r=>r!=null&&r!=="").map(r=>x&&typeof r=="object"&&r!==null?Number(r.amount):typeof r=="number"?r:Number(r)).filter(r=>!isNaN(r));a.length>0&&(i[t]={min:Math.min(...a),max:Math.max(...a)})}else if(h){const a=c.map(r=>r[t]).filter(r=>r!=null&&r!=="").map(r=>r instanceof Date?r:new Date(r)).filter(r=>!isNaN(r.getTime()));if(a.length>0){const r=new Date(Math.min(...a.map(C=>C.getTime()))),T=new Date(Math.max(...a.map(C=>C.getTime()))),V=r.toISOString().split("T")[0],v=T.toISOString().split("T")[0];i[t]={min:V||"",max:v||""}}}}),i},[c,f.fields,g]),y=(i,t)=>{const o={...b};if(!t||t==="")delete o[i];else if(Array.isArray(t))o[i]=t;else if(typeof t=="object"&&"min"in t){const l=t.min&&t.min!=="",m=t.max&&t.max!=="";!l&&!m?delete o[i]:o[i]=t}else o[i]=t;k(o)},J=()=>{k({})},O=S(()=>g.length===0?null:g.map(i=>{const t=f.fields[i];if(!t)return null;const o=se(i,t,w),l=t.type||"text",m=$(l);if(!m)return B(new Error(`Field type "${l}" not registered in field type registry`),{userMessage:`Field type "${l}" is missing from registry`,context:{fieldType:l,fieldName:i,operation:"filter_ui_render",fix:"Add to registerBuiltinFieldTypes.ts or registerFieldType()"},severity:"warning"}),null;const h=m==="range"&&(l==="date"||l==="datetime-local"||l==="timestamp"||l==="time"||l==="week"||l==="month"||l==="year"),F=m==="range"&&!h,x=m==="select",a=b[i],r=typeof a=="object"&&a!==null&&"min"in a?a:{min:"",max:""};if(m==="rating"){const n=t.validation?.max??5,s=typeof a=="string"&&a!==""?Number(a):0;return d("div",{style:{gridColumn:"span 2",gridRow:"span 1"},children:d(te,{value:s,max:n,"aria-label":o,onChange:e=>{y(i,e===s?void 0:String(e))}})},i)}if(F){const n=H[i],s=n?.min??0,e=n?.max??100,u=r.min?Number(r.min):s,N=r.max?Number(r.max):e;return _(re,{gap:"tight",style:{gridColumn:"span 2"},children:[d(ie,{type:"number",label:o,minPlaceholder:p("filter.min",{defaultValue:"Min"}),maxPlaceholder:p("filter.max",{defaultValue:"Max"}),minValue:r.min||"",maxValue:r.max||"",actualMin:s,actualMax:e,onChange:(M,W)=>{y(i,{min:M,max:W})},onClear:()=>y(i,void 0)}),d(le,{value:[u,N],min:s,max:e,step:1,onValueChange:M=>{y(i,{min:String(M[0]),max:String(M[1])})}})]},i)}if(h){const n=l==="week"||l==="month"||l==="year"?l:"date",s=(()=>{if(a){if(typeof a=="object"&&"min"in a){const e=a;return{min:e.min&&e.min.split("T")[0]||"",max:e.max&&e.max.split("T")[0]||""}}if(typeof a=="string"){const e=a.split("T")[0]||"";return{min:e,max:e}}}})();return d("div",{style:{gridColumn:"span 2",gridRow:"span 1"},children:d(ae,{label:o,fieldType:n,value:s,locale:X,onChange:e=>{if(!e){y(i,void 0);return}typeof e=="object"&&"min"in e&&y(i,{min:e.min||"",max:e.max||""})},tCrud:p})},i)}const T=x&&t.validation&&"options"in t.validation&&t.validation?Array.isArray(t.validation.options)?t.validation.options:typeof t.validation.options=="function"?t.validation.options():[]:[],V=R[i]||c,v=new Set,C=m==="address";V.forEach(n=>{const s=n[i];if(s!=null)if(C&&typeof s=="object"&&"formatted_address"in s){const e=s;e.formatted_address&&v.add(String(e.formatted_address))}else v.add(String(s))});const E=[{value:"all",label:p("filter.selectPlaceholder",{defaultValue:"All"})}];if(T.length>0){const n=[],s=[];T.forEach(e=>{const u=typeof e=="string"?e:e.value,N=typeof e=="string"?e:e.label;v.has(u)?n.push({value:u,label:N}):s.push({value:u,label:N})}),n.sort((e,u)=>e.label.localeCompare(u.label)),s.sort((e,u)=>e.label.localeCompare(u.label)),n.forEach(e=>{E.push({value:e.value,label:I(e.label,w),disabled:!1})}),s.forEach(e=>{E.push({value:e.value,label:I(e.label,w),disabled:!0})})}else Array.from(v).sort().slice(0,100).forEach(n=>{E.push({value:n,label:n})});return d("div",{style:{gridColumn:"span 1",gridRow:"span 1"},children:d(U,{label:o,value:typeof a=="string"?a:void 0,onValueChange:n=>{y(i,n==="all"||!n?"":String(n))},options:E,placeholder:p("filter.placeholder",{defaultValue:"Filter..."}),clearable:!0})},i)}),[g,f.fields,c,b,w,p,R]);if(!O||O.length===0)return null;const K=O.filter(Boolean),Q=Object.keys(b).length>0;return _(ee,{cols:P??(z?2:[2,4,4,6]),children:[K,d(Z,{variant:"outline",icon:d(Y,{size:18}),onClick:J,disabled:!Q,style:{gridColumn:"1 / -1",gridRow:"span 1"},children:p("filter.clear",{defaultValue:"Clear Filters"})})]})}export{ue as EntityFilters,de as matchesFilter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldRenderer.d.ts","sourceRoot":"","sources":["../../src/components/FormFieldRenderer.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
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CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,MAAM,sBAAsB,CAChC,CAAC,SAAS,SAAS,EACnB,YAAY,SAAS,WAAW,GAAG,WAAW,IAC5C,iBAAiB,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AAE5D;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,SAAS,SAAS,EACnB,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,EACA,IAAI,EACJ,MAAM,EACN,CAAC,EACD,GAAG,KAAK,EACT,EAAE,sBAAsB,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,YAAY,CA0GxD;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledAddressField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledAddressField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledAddressField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledAddressField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA8Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledDateField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledDateField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA2C7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledFieldArrayField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledFieldArrayField.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ControlledFieldArrayField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledFieldArrayField.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAmBD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA2Kd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledGeoPointField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledGeoPointField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledGeoPointField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledGeoPointField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA4Cd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledMapField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledMapField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledMapField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledMapField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA4C5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledMultiInputField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledMultiInputField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledMultiInputField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledMultiInputField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAyCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledRichTextField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledRichTextField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledRichTextField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledRichTextField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAwBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledTimestampField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledTimestampField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledTimestampField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/complex/ControlledTimestampField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAuBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledDocumentField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledDocumentField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledDocumentField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledDocumentField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA6Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledFileField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledFileField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledFileField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledFileField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA6B7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledImageField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledImageField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledImageField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledImageField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA6Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledMultiDocumentField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledMultiDocumentField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledMultiDocumentField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledMultiDocumentField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAuCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledMultiFileField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledMultiFileField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledMultiFileField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledMultiFileField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAuCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledMultiImageField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledMultiImageField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledMultiImageField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/file/ControlledMultiImageField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAuCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledCheckboxField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledCheckboxField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledCheckboxField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledCheckboxField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAuBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledCurrencyField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledCurrencyField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledCurrencyField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledCurrencyField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA4Dd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledDurationField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledDurationField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledDurationField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledDurationField.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA8Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledGdprConsentField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledGdprConsentField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledGdprConsentField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledGdprConsentField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,OAAO,CAAC;AAGvD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA0Dd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledNumberField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledNumberField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledNumberField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledNumberField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA4Dd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledPasswordField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledPasswordField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledPasswordField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledPasswordField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAyBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledPhoneField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledPhoneField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledPhoneField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledPhoneField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAsBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledPriceField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledPriceField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledPriceField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledPriceField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA2Cd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledRangeField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledRangeField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledRangeField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledRangeField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAsCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledRatingField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledRatingField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledRatingField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledRatingField.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA8Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledSwitchField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledSwitchField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledSwitchField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledSwitchField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA2Dd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledTextField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledTextField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledTextField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledTextField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAoC7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledTextareaField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledTextareaField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledTextareaField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/input/ControlledTextareaField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA+Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledComboboxField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledComboboxField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledComboboxField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledComboboxField.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;;;GAQG;AAEH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAsGd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledDropdownField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledDropdownField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledDropdownField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledDropdownField.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;;;GAQG;AAEH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CA4Gd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledMultiDropdownField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledMultiDropdownField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledMultiDropdownField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledMultiDropdownField.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;;;GAQG;AAEH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAiFd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledRadioField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledRadioField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledRadioField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledRadioField.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;;;;;GAQG;AAEH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAiEd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledReferenceField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledReferenceField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledReferenceField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledReferenceField.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAqBR;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,oBAAoB,GAC1B,YAAY,CAyDd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledYearField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledYearField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlledYearField.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/select/ControlledYearField.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA2D7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i}from"react/jsx-runtime";import{useMemo as h}from"react";import{Controller as b}from"react-hook-form";import{
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import{useMemo as h}from"react";import{Controller as b}from"react-hook-form";import{translateLabel as C}from"../../../forms/utils";import{ComboboxComponent as x}from"../../form/fields";import{convertValidationRules as y}from"../types";function S(s){const{control:m,errors:n,fieldConfig:u,t:c,placeholder:p}=s,{name:l,label:d,validation:r,options:f={}}=u,v=h(()=>{const e=r?.min??1900,t=r?.max??new Date().getFullYear()+10,a=[];for(let o=t;o>=e;o--)a.push({value:String(o),label:String(o)});return a},[r?.min,r?.max]);return i(b,{name:l,control:m,rules:r?y(r):void 0,render:({field:e})=>{const t=a=>{const o=typeof a=="string"?a:a.target.value,g=o===""?void 0:Number(o);e.onChange(g)};return i(x,{...e,label:C(d,c),value:e.value!==void 0&&e.value!==null?String(e.value):"",onChange:t,onBlur:e.onBlur,options:v,error:!!n[l],helperText:n[l]?.message,required:r?.required,placeholder:p||f.placeholder,translationNamespace:"crud",placeholderKey:"actions.selectYear",placeholderDefault:"Select or type year",creatable:!0})}})}export{S as ControlledYearField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/controlled/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEhF,OAAO,KAAK,EACV,OAAO,EACP,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,IAAI,EACJ,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB,CACnC,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,EAAE,SAAS,SAAS,GAAG,SAAS;IAEhC,oFAAoF;IACpF,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;IAC9D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,qBAAqB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC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,8FAA8F;IAC9F,KAAK,CAAC,EAAE,qBAAqB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,6FAA6F;IAC7F,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7B,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AAEH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GACnC,MAAM,GAAG,SAAS,CAsBpB;AAED;;;;GAIG;AAEH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,GAAG,GAAG,eAAe,CA4BvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i,jsxs as u}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as i,jsxs as u}from"react/jsx-runtime";import{Clock as x}from"lucide-react";import{useState as T,useMemo as k}from"react";import{Label as $,Stack as s,Button as S,Slider as w}from"@donotdev/components";const f=[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 q(e,n){const o=e<60?`${e}m`:e%60===0?`${e/60}h`:`${Math.floor(e/60)}h${e%60}`,l=N[e];return!n||!l?o:n(`crud:${l}`,{defaultValue:o})??o}const W=({label:e,value:n,onChange:o,error:l,helperText:d,disabled:m,required:p,readonly:M,min:g=0,max:v=480,step:V=5,t})=>{const r=typeof n=="number"&&!Number.isNaN(n)?n:0,h=f.includes(r),[c,b]=T(!h&&r>0),C=k(()=>f.map(a=>({minutes:a,label:q(a,t)})),[t]),y=t?t("crud:duration.custom",{defaultValue:"Custom"}):"Custom";if(M){const a=r===0?t?t("crud:duration.zero",{defaultValue:"\u2014"}):"\u2014":r<60?t?t("crud:duration.minutes",{count:r,defaultValue:`${r} min`}):`${r} min`:t?t("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(s,{gap:"tight",children:[i($,{required:p,style:{fontSize:"var(--font-size-sm)",fontWeight:500},children:e}),u(s,{direction:"row",gap:"tight",align:"center",children:[i(x,{size:18,style:{color:"var(--muted-foreground)"},"aria-hidden":!0}),i("span",{style:{color:"var(--muted-foreground)",fontSize:"var(--font-size-sm)"},children:a})]}),d&&i("p",{style:{fontSize:"var(--font-size-xs)",color:l?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:d})]})}return u(s,{children:[i($,{required:p,style:{fontSize:"var(--font-size-sm)",fontWeight:500},children:e}),u(s,{direction:"row",gap:"tight",align:"center",style:{flexWrap:"wrap"},children:[C.map(({minutes:a,label:z})=>u(S,{type:"button",variant:r===a?"primary":"outline",disabled:m,onClick:()=>{b(!1),o(a)},"aria-pressed":r===a,"aria-label":z,children:[i(x,{size:14,style:{marginRight:"var(--gap-xs)"},"aria-hidden":!0}),z]},a)),i(S,{type:"button",variant:c?"primary":"outline",disabled:m,onClick:()=>{b(!0),!h&&r>0?o(r):o(30)},"aria-pressed":c,"aria-label":y,children:y})]}),c&&i(s,{gap:"tight",style:{marginTop:"var(--gap-sm)"},children:i(w,{value:[h?30:r],onValueChange:([a])=>o(Math.max(g,Math.min(v,a??0))),min:g,max:v,step:V,showValue:!0,disabled:m,"aria-label":e})}),d&&i("p",{style:{fontSize:"var(--font-size-xs)",color:l?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:d})]})};var j=W;export{f as DURATION_PRESETS,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageFieldComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/form/fields/ImageFieldComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageFieldComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/form/fields/ImageFieldComponent.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAe9C,MAAM,WAAW,wBAAwB;IACvC,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;IACnC,qBAAqB;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACtD,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gGAAgG;IAChG,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AA8LD;;GAEG;AACH,QAAA,MAAM,mBAAmB,6HA0QxB,CAAC;AAIF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{
|
|
1
|
+
"use client";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{CirclePlus as R,CircleMinus as U}from"lucide-react";import{useId as q,useState as z}from"react";import{Input as C,Checkbox as D,Stack as E,Select as A,CollapsiblePrimitive as B,CollapsibleTrigger as G,CollapsibleContent as H}from"@donotdev/components";import{useTranslation as J,getCurrencySymbol as L}from"@donotdev/core";const O=["EUR","USD","GBP","CHF","JPY","KRW"],Y=({label:f,value:n,onChange:I,error:s,helperText:g,required:P=!1,disabled:c=!1,placeholder:N="0",defaultCurrency:i="EUR",optionsTitle:x="Price options",currencies:b})=>{const u=q(),{t:p}=J("crud"),r=b?.length?b:[...O],h=n?.currency??i,m=r.includes(h)?h:r[0]??i,T=n?.vatIncluded??!0,y=n?.discountPercent??0,S=`${f} (${L(m)})`,d=e=>{const l=e.amount!==void 0?e.amount:n?.amount??0;let t=e.currency!==void 0?e.currency:n?.currency??i;r.includes(t)||(t=m);const F=e.vatIncluded!==void 0?e.vatIncluded:n?.vatIncluded??!0,M=e.discountPercent!==void 0?e.discountPercent:n?.discountPercent??0;I({amount:Number(l),currency:t,vatIncluded:F,discountPercent:Number(M)})},k=e=>{const l=e.target.value;if(l===""||l===null){d({amount:0});return}const t=parseFloat(l);d({amount:isNaN(t)?0:t})},V=e=>{d({currency:e||i})},$=e=>{const l=e.target.value;if(l===""||l===null){d({discountPercent:0});return}const t=parseFloat(l);d({discountPercent:isNaN(t)?0:t})},[v,j]=z(!1);return o(B,{open:v,onOpenChange:j,children:[o(E,{children:[o("div",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:"var(--gap-sm)",alignItems:"end"},children:[a(C,{id:u,type:"number",inputMode:"decimal",label:S,value:n?.amount!==void 0&&n?.amount!==null?n.amount:"",onChange:k,disabled:c,placeholder:N,required:P,min:0,step:.01,"data-variant":s?"destructive":void 0,"aria-invalid":s}),a(G,{asChild:!0,children:a("button",{type:"button","aria-label":x,"aria-expanded":v,className:"dndev-collapsible-trigger",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"var(--gap-sm)",background:"none",border:"none",cursor:"pointer"},children:v?a(U,{className:"dndev-collapsible-icon","aria-hidden":"true"}):a(R,{className:"dndev-collapsible-icon","aria-hidden":"true"})})})]}),a(H,{className:"dndev-collapsible-content",children:o("div",{style:{display:"grid",gridTemplateColumns:r.length>1?"1fr auto 1fr":"auto 1fr",gap:"var(--gap-sm)",alignItems:"end",paddingTop:"var(--gap-md)"},children:[r.length>1&&a(A,{value:m,onValueChange:V,placeholder:i,options:r.map(e=>({value:e,label:e})),disabled:c,label:p("price.currency",{defaultValue:"Currency"})}),a(D,{id:`${u}-vat`,label:p("price.vatIncluded",{defaultValue:"VAT Incl."}),checked:T,onCheckedChange:e=>d({vatIncluded:e===!0}),disabled:c}),a(C,{id:`${u}-discount`,type:"number",inputMode:"decimal",min:0,max:100,step:1,value:y===0?"":y,onChange:$,disabled:c,placeholder:"0",label:p("price.discountLabel",{defaultValue:"Discount (%)"})})]})})]}),g&&a("p",{style:{fontSize:"var(--font-size-xs)",color:s?"var(--destructive-foreground)":"var(--muted-foreground)"},children:g})]})};var w=Y;export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/form/fields/RichTextComponent.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RichTextComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/form/fields/RichTextComponent.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAY3C;;;;;;;GAOG;AACH,QAAA,MAAM,iBAAiB,EAAE,aAAa,CAAC,sBAAsB,CA+E5D,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchFieldComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/form/fields/SwitchFieldComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwitchFieldComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/form/fields/SwitchFieldComponent.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAExD,MAAM,WAAW,yBAAyB;IACxC,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,oBAAoB,EAAE,aAAa,CAAC,yBAAyB,CAuClE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadContext.d.ts","sourceRoot":"","sources":["../../src/contexts/UploadContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UploadContext.d.ts","sourceRoot":"","sources":["../../src/contexts/UploadContext.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAIvE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAErD"}
|