freemium-ui 2.0.79 → 2.0.80
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/lib/index.cjs.js +37 -26
- package/lib/index.d.ts +4 -0
- package/lib/index.js +37 -26
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/lib/index.cjs.js
CHANGED
|
@@ -13034,40 +13034,45 @@ defaultSelectedItem:n.find((e=>e.id===t.value))??null,style:t.style,
|
|
|
13034
13034
|
className:`${t.className??""} bp-custom-dropdown bp-custom-dropdown-${t.name??""}`.trim(),
|
|
13035
13035
|
onChange:e=>{t?.onChange?.({target:{value:e?.id}})}})}
|
|
13036
13036
|
return e.createElement(ab,{itemToString:()=>"",type:"button"})},eF=t=>{
|
|
13037
|
-
const{placeholder:n,name:r,isRequired:o,label:a,isErrored:i,language:l,errorText:c,id:s,cancelButtonText:u="Cancel",updateButtonText:d="Update",disabled:h,displayFormat:f="YYYY-MM-DD",portalContainer:p,value:m,useTime:v,...
|
|
13037
|
+
const{placeholder:n,name:r,isRequired:o,label:a,isErrored:i,language:l,errorText:c,id:s,cancelButtonText:u="Cancel",updateButtonText:d="Update",disabled:h,displayFormat:f="YYYY-MM-DD",portalContainer:p,value:m,useTime:v,dateToHilight:g,...y}=t,b=document.querySelector('div[role="dialog"].DialogContent'),w=cr(),C=e.useRef(m??null),[z,M]=e.useState(m??null),[x,E]=e.useState()
|
|
13038
13038
|
;return e.useEffect((()=>(window.addEventListener("popstate",(()=>{
|
|
13039
|
-
YN("DateRangePicker",{action:"Closing",useTime:v}),
|
|
13040
|
-
|
|
13039
|
+
YN("DateRangePicker",{action:"Closing",useTime:v}),E(!1),setTimeout((()=>{
|
|
13040
|
+
E(void 0)}),0)})),()=>{document.body.removeEventListener("popstate",(()=>{}))
|
|
13041
13041
|
})),[]),e.createElement(ZN,{
|
|
13042
13042
|
id:`${v?"datetime":"date"}-picker-container-${s??""}`.trim(),"aria-invalid":i,
|
|
13043
|
-
dir:
|
|
13043
|
+
dir:w.direction},a&&e.createElement(Do,{htmlFor:t.id,className:"input-label"
|
|
13044
13044
|
},a,a&&o&&e.createElement(Lo,null,"*")),e.createElement(XN,{$isErrored:i,
|
|
13045
13045
|
disabled:t.disabled}),e.createElement(CM,null,e.createElement(gN,{
|
|
13046
13046
|
canClearSelection:!0,closeOnSelection:!1,disabled:h,locale:l||"en-US",
|
|
13047
13047
|
maxDate:$N(new Date).add(10,"years").toDate(),
|
|
13048
13048
|
minDate:$N(new Date).subtract(100,"years").toDate(),fill:!0,
|
|
13049
13049
|
highlightCurrentDay:!0,inputProps:{placeholder:n||f,name:r,id:s,
|
|
13050
|
-
"aria-disabled":h},dayPickerProps:{disabled:h,dir:
|
|
13051
|
-
|
|
13050
|
+
"aria-disabled":h},dayPickerProps:{disabled:h,dir:w.direction,components:{...g?{
|
|
13051
|
+
Day:t=>{const n=e.useRef(null),r=$A(t.date,t.displayMonth,n),o={name:"day",
|
|
13052
|
+
type:"button",...r.buttonProps,
|
|
13053
|
+
className:r.buttonProps.className?.replace("rdp-day_today","")}
|
|
13054
|
+
;return $N(t.date).isSame($N(g),"day")&&(o.className=`${o.className||""} rdp-day_today`),
|
|
13055
|
+
e.createElement("button",{ref:n,...o})}}:{},Dropdown:t=>e.createElement(QN,{
|
|
13056
|
+
...t,disabled:h})}},showActionsBar:!1,
|
|
13052
13057
|
footerElement:u||d?e.createElement(qN,null,u&&e.createElement(xm,{
|
|
13053
|
-
variant:"secondary",disabled:h,onClick:()=>{
|
|
13054
|
-
|
|
13055
|
-
|
|
13058
|
+
variant:"secondary",disabled:h,onClick:()=>{M(m??null),E(!1),setTimeout((()=>{
|
|
13059
|
+
E(void 0)}),0)}},u),d&&e.createElement(xm,{disabled:(m??null)===z,onClick:()=>{
|
|
13060
|
+
y.onChange?.(z,!0),C.current=z,E(!1),setTimeout((()=>{E(void 0)}),0)}
|
|
13056
13061
|
},d)):void 0,popoverProps:{hasBackdrop:!0,canEscapeKeyClose:!0,minimal:!1,
|
|
13057
|
-
placement:"ltr"===
|
|
13058
|
-
onClosed:()=>{
|
|
13059
|
-
portalContainer:p??(
|
|
13062
|
+
placement:"ltr"===w.direction?"bottom-start":"bottom-end",usePortal:!0,
|
|
13063
|
+
onClosed:()=>{C.current!==z&&(y.onChange?.(z,!0),C.current=z)},
|
|
13064
|
+
portalContainer:p??(b||void 0),...void 0!==x?{isOpen:x}:{}},
|
|
13060
13065
|
parseDate:e=>e?$N(e).toDate():new Date,formatDate:e=>e?$N(e).format(f):"",...v?{
|
|
13061
13066
|
timePrecision:"minute",timePickerProps:{useAmPm:!0,showArrowButtons:!1},
|
|
13062
|
-
showTimezoneSelect:!1,disableTimezoneSelect:!0}:{},...
|
|
13063
|
-
value:
|
|
13064
|
-
const{placeholder:n,name:r,isRequired:o,label:a,isErrored:i,errorText:l,id:c,disabled:s,cancelButtonText:u="Cancel",updateButtonText:d="Update",language:h,displayFormat:f="YYYY-MM-DD",portalContainer:p,value:m,useTime:v,...
|
|
13067
|
+
showTimezoneSelect:!1,disableTimezoneSelect:!0}:{},...y,onChange:e=>{M(e)},
|
|
13068
|
+
value:z??""})),i&&c&&e.createElement(lm,null,c))},tF=t=>{
|
|
13069
|
+
const{placeholder:n,name:r,isRequired:o,label:a,isErrored:i,errorText:l,id:c,disabled:s,cancelButtonText:u="Cancel",updateButtonText:d="Update",language:h,displayFormat:f="YYYY-MM-DD",portalContainer:p,value:m,useTime:v,dateToHilight:g,...y}=t,b=document.querySelector('div[role="dialog"].DialogContent'),w=cr(),C=e.useRef(m??[null,null]),[z,M]=e.useState(m??[null,null]),[x,E]=e.useState()
|
|
13065
13070
|
;return e.useEffect((()=>(window.addEventListener("popstate",(()=>{
|
|
13066
|
-
YN("DateRangePicker",{action:"Closing",useTime:v}),
|
|
13067
|
-
|
|
13071
|
+
YN("DateRangePicker",{action:"Closing",useTime:v}),E(!1),setTimeout((()=>{
|
|
13072
|
+
E(void 0)}),0)})),()=>{document.body.removeEventListener("popstate",(()=>{}))
|
|
13068
13073
|
})),[]),e.createElement(ZN,{
|
|
13069
13074
|
id:`${v?"datetime":"date"}-range-picker-container-${c??""}`.trim(),
|
|
13070
|
-
"aria-invalid":i,dir:
|
|
13075
|
+
"aria-invalid":i,dir:w.direction},a&&e.createElement(Do,{htmlFor:t.id,
|
|
13071
13076
|
className:"input-label"
|
|
13072
13077
|
},a,a&&o&&e.createElement(Lo,null,"*")),e.createElement(XN,{
|
|
13073
13078
|
$inputLength:f.length-(v?1:0),$isErrored:i,disabled:t.disabled
|
|
@@ -13077,21 +13082,27 @@ minDate:$N(new Date).subtract(100,"years").toDate(),fill:!0,
|
|
|
13077
13082
|
highlightCurrentDay:!0,shortcuts:!1,startInputProps:{placeholder:n||f,name:r,
|
|
13078
13083
|
id:"start-date-picker-input","aria-disabled":s},endInputProps:{placeholder:n||f,
|
|
13079
13084
|
name:r,id:"end-date-picker-input","aria-disabled":s},dayPickerProps:{disabled:s,
|
|
13080
|
-
dir:
|
|
13085
|
+
dir:w.direction,components:{...g?{Day:t=>{
|
|
13086
|
+
const n=e.useRef(null),r=$A(t.date,t.displayMonth,n),o={name:"day",
|
|
13087
|
+
type:"button",...r.buttonProps,
|
|
13088
|
+
className:r.buttonProps.className?.replace("rdp-day_today","")}
|
|
13089
|
+
;return $N(t.date).isSame($N(g),"day")&&(o.className=`${o.className||""} rdp-day_today`),
|
|
13090
|
+
e.createElement("button",{ref:n,...o})}}:{},Dropdown:t=>e.createElement(QN,{
|
|
13091
|
+
...t,disabled:s})}},
|
|
13081
13092
|
footerElement:u||d?e.createElement(qN,null,u&&e.createElement(xm,{
|
|
13082
13093
|
variant:"secondary",disabled:s,onClick:()=>{
|
|
13083
|
-
|
|
13094
|
+
M(m??[null,null]),E(!1),setTimeout((()=>{E(void 0)}),0)}
|
|
13084
13095
|
},u),d&&e.createElement(xm,{
|
|
13085
|
-
disabled:(m??[null,null])?.[0]?.toISOString()===
|
|
13086
|
-
onClick:()=>{
|
|
13096
|
+
disabled:(m??[null,null])?.[0]?.toISOString()===z?.[0]?.toISOString()&&(m??[null,null])?.[1]?.toISOString()===z?.[1]?.toISOString(),
|
|
13097
|
+
onClick:()=>{y.onChange?.(z),C.current=z,E(!1),setTimeout((()=>{E(void 0)}),0)}
|
|
13087
13098
|
},d)):void 0,popoverProps:{hasBackdrop:!0,canEscapeKeyClose:!0,minimal:!1,
|
|
13088
|
-
placement:"ltr"===
|
|
13099
|
+
placement:"ltr"===w.direction?"bottom-start":"bottom-end",usePortal:!0,
|
|
13089
13100
|
onClosed:()=>{
|
|
13090
|
-
|
|
13091
|
-
|
|
13101
|
+
C.current?.[0]?.toISOString()===z?.[0]?.toISOString()&&C.current?.[1]?.toISOString()===z?.[1]?.toISOString()||(y.onChange?.(z),
|
|
13102
|
+
C.current=z)},portalContainer:p??(b||void 0),...void 0!==x?{isOpen:x}:{}},
|
|
13092
13103
|
parseDate:e=>e?$N(e).toDate():new Date,formatDate:e=>e?$N(e).format(f):"",...v?{
|
|
13093
13104
|
timePrecision:"minute",timePickerProps:{useAmPm:!0,showArrowButtons:!1}}:{},
|
|
13094
|
-
...
|
|
13105
|
+
...y,onChange:e=>{M(e)},value:z})),i&&l&&e.createElement(lm,null,l))},nF=[{
|
|
13095
13106
|
id:"AM",name:"AM"},{id:"PM",name:"PM"
|
|
13096
13107
|
}],rF="Popover",[oF,aF]=i(rF,[bh]),iF=bh(),[lF,cF]=oF(rF),sF=e.forwardRef(((t,n)=>{
|
|
13097
13108
|
const{__scopePopover:r,...o}=t,i=cF("PopoverTrigger",r),l=iF(r),c=s(n,i.triggerRef),u=e.createElement(b.button,a({
|
package/lib/index.d.ts
CHANGED
|
@@ -1003,6 +1003,10 @@ type DefaultProps = {
|
|
|
1003
1003
|
label?: string;
|
|
1004
1004
|
language?: string;
|
|
1005
1005
|
placeholder?: string;
|
|
1006
|
+
/**
|
|
1007
|
+
* Today's date according to the user's timezone in the YYYY-MM-DD format
|
|
1008
|
+
*/
|
|
1009
|
+
dateToHilight?: string;
|
|
1006
1010
|
/**
|
|
1007
1011
|
* Whether disabled select
|
|
1008
1012
|
*/
|
package/lib/index.js
CHANGED
|
@@ -13104,42 +13104,47 @@ defaultSelectedItem:n.find((t=>t.id===e.value))??null,style:e.style,
|
|
|
13104
13104
|
className:`${e.className??""} bp-custom-dropdown bp-custom-dropdown-${e.name??""}`.trim(),
|
|
13105
13105
|
onChange:t=>{e?.onChange?.({target:{value:t?.id}})}})}
|
|
13106
13106
|
return t.createElement(Vb,{itemToString:()=>"",type:"button"})},DF=e=>{
|
|
13107
|
-
const{placeholder:n,name:r,isRequired:o,label:a,isErrored:i,language:l,errorText:c,id:s,cancelButtonText:u="Cancel",updateButtonText:d="Update",disabled:h,displayFormat:p="YYYY-MM-DD",portalContainer:f,value:m,useTime:v,...
|
|
13107
|
+
const{placeholder:n,name:r,isRequired:o,label:a,isErrored:i,language:l,errorText:c,id:s,cancelButtonText:u="Cancel",updateButtonText:d="Update",disabled:h,displayFormat:p="YYYY-MM-DD",portalContainer:f,value:m,useTime:v,dateToHilight:g,...y}=e,b=document.querySelector('div[role="dialog"].DialogContent'),w=Hr(),C=t.useRef(m??null),[z,M]=t.useState(m??null),[x,E]=t.useState()
|
|
13108
13108
|
;return t.useEffect((()=>(window.addEventListener("popstate",(()=>{
|
|
13109
|
-
wF("DateRangePicker",{action:"Closing",useTime:v}),
|
|
13110
|
-
|
|
13109
|
+
wF("DateRangePicker",{action:"Closing",useTime:v}),E(!1),setTimeout((()=>{
|
|
13110
|
+
E(void 0)}),0)})),()=>{document.body.removeEventListener("popstate",(()=>{}))
|
|
13111
13111
|
})),[]),t.createElement(EF,{
|
|
13112
13112
|
id:`${v?"datetime":"date"}-picker-container-${s??""}`.trim(),"aria-invalid":i,
|
|
13113
|
-
dir:
|
|
13113
|
+
dir:w.direction},a&&t.createElement(Zo,{htmlFor:e.id,className:"input-label"
|
|
13114
13114
|
},a,a&&o&&t.createElement(Jo,null,"*")),t.createElement(SF,{$isErrored:i,
|
|
13115
13115
|
disabled:e.disabled}),t.createElement(ZM,null,t.createElement(WN,{
|
|
13116
13116
|
canClearSelection:!0,closeOnSelection:!1,disabled:h,locale:l||"en-US",
|
|
13117
13117
|
maxDate:vF(new Date).add(10,"years").toDate(),
|
|
13118
13118
|
minDate:vF(new Date).subtract(100,"years").toDate(),fill:!0,
|
|
13119
13119
|
highlightCurrentDay:!0,inputProps:{placeholder:n||p,name:r,id:s,
|
|
13120
|
-
"aria-disabled":h},dayPickerProps:{disabled:h,dir:
|
|
13121
|
-
|
|
13120
|
+
"aria-disabled":h},dayPickerProps:{disabled:h,dir:w.direction,components:{...g?{
|
|
13121
|
+
Day:e=>{const n=t.useRef(null),r=vL(e.date,e.displayMonth,n),o={name:"day",
|
|
13122
|
+
type:"button",...r.buttonProps,
|
|
13123
|
+
className:r.buttonProps.className?.replace("rdp-day_today","")}
|
|
13124
|
+
;return vF(e.date).isSame(vF(g),"day")&&(o.className=`${o.className||""} rdp-day_today`),
|
|
13125
|
+
t.createElement("button",{ref:n,...o})}}:{},Dropdown:e=>t.createElement(HF,{
|
|
13126
|
+
...e,disabled:h})}},showActionsBar:!1,
|
|
13122
13127
|
footerElement:u||d?t.createElement(xF,null,u&&t.createElement(Gm,{
|
|
13123
|
-
variant:"secondary",disabled:h,onClick:()=>{
|
|
13124
|
-
|
|
13125
|
-
|
|
13128
|
+
variant:"secondary",disabled:h,onClick:()=>{M(m??null),E(!1),setTimeout((()=>{
|
|
13129
|
+
E(void 0)}),0)}},u),d&&t.createElement(Gm,{disabled:(m??null)===z,onClick:()=>{
|
|
13130
|
+
y.onChange?.(z,!0),C.current=z,E(!1),setTimeout((()=>{E(void 0)}),0)}
|
|
13126
13131
|
},d)):void 0,popoverProps:{hasBackdrop:!0,canEscapeKeyClose:!0,minimal:!1,
|
|
13127
|
-
placement:"ltr"===
|
|
13128
|
-
onClosed:()=>{
|
|
13129
|
-
portalContainer:f??(
|
|
13132
|
+
placement:"ltr"===w.direction?"bottom-start":"bottom-end",usePortal:!0,
|
|
13133
|
+
onClosed:()=>{C.current!==z&&(y.onChange?.(z,!0),C.current=z)},
|
|
13134
|
+
portalContainer:f??(b||void 0),...void 0!==x?{isOpen:x}:{}},
|
|
13130
13135
|
parseDate:e=>e?vF(e).toDate():new Date,formatDate:e=>e?vF(e).format(p):"",...v?{
|
|
13131
13136
|
timePrecision:"minute",timePickerProps:{useAmPm:!0,showArrowButtons:!1},
|
|
13132
|
-
showTimezoneSelect:!1,disableTimezoneSelect:!0}:{},...
|
|
13133
|
-
value:
|
|
13137
|
+
showTimezoneSelect:!1,disableTimezoneSelect:!0}:{},...y,onChange:e=>{M(e)},
|
|
13138
|
+
value:z??""})),i&&c&&t.createElement(Dm,null,c))},AF=e=>{
|
|
13134
13139
|
const{displayFormat:n="YYYY-MM-DD hh:mm A",...r}=e;return t.createElement(DF,{
|
|
13135
13140
|
...r,displayFormat:n,useTime:!0})},LF=e=>{
|
|
13136
|
-
const{placeholder:n,name:r,isRequired:o,label:a,isErrored:i,errorText:l,id:c,disabled:s,cancelButtonText:u="Cancel",updateButtonText:d="Update",language:h,displayFormat:p="YYYY-MM-DD",portalContainer:f,value:m,useTime:v,...
|
|
13141
|
+
const{placeholder:n,name:r,isRequired:o,label:a,isErrored:i,errorText:l,id:c,disabled:s,cancelButtonText:u="Cancel",updateButtonText:d="Update",language:h,displayFormat:p="YYYY-MM-DD",portalContainer:f,value:m,useTime:v,dateToHilight:g,...y}=e,b=document.querySelector('div[role="dialog"].DialogContent'),w=Hr(),C=t.useRef(m??[null,null]),[z,M]=t.useState(m??[null,null]),[x,E]=t.useState()
|
|
13137
13142
|
;return t.useEffect((()=>(window.addEventListener("popstate",(()=>{
|
|
13138
|
-
wF("DateRangePicker",{action:"Closing",useTime:v}),
|
|
13139
|
-
|
|
13143
|
+
wF("DateRangePicker",{action:"Closing",useTime:v}),E(!1),setTimeout((()=>{
|
|
13144
|
+
E(void 0)}),0)})),()=>{document.body.removeEventListener("popstate",(()=>{}))
|
|
13140
13145
|
})),[]),t.createElement(EF,{
|
|
13141
13146
|
id:`${v?"datetime":"date"}-range-picker-container-${c??""}`.trim(),
|
|
13142
|
-
"aria-invalid":i,dir:
|
|
13147
|
+
"aria-invalid":i,dir:w.direction},a&&t.createElement(Zo,{htmlFor:e.id,
|
|
13143
13148
|
className:"input-label"
|
|
13144
13149
|
},a,a&&o&&t.createElement(Jo,null,"*")),t.createElement(SF,{
|
|
13145
13150
|
$inputLength:p.length-(v?1:0),$isErrored:i,disabled:e.disabled
|
|
@@ -13149,21 +13154,27 @@ minDate:vF(new Date).subtract(100,"years").toDate(),fill:!0,
|
|
|
13149
13154
|
highlightCurrentDay:!0,shortcuts:!1,startInputProps:{placeholder:n||p,name:r,
|
|
13150
13155
|
id:"start-date-picker-input","aria-disabled":s},endInputProps:{placeholder:n||p,
|
|
13151
13156
|
name:r,id:"end-date-picker-input","aria-disabled":s},dayPickerProps:{disabled:s,
|
|
13152
|
-
dir:
|
|
13157
|
+
dir:w.direction,components:{...g?{Day:e=>{
|
|
13158
|
+
const n=t.useRef(null),r=vL(e.date,e.displayMonth,n),o={name:"day",
|
|
13159
|
+
type:"button",...r.buttonProps,
|
|
13160
|
+
className:r.buttonProps.className?.replace("rdp-day_today","")}
|
|
13161
|
+
;return vF(e.date).isSame(vF(g),"day")&&(o.className=`${o.className||""} rdp-day_today`),
|
|
13162
|
+
t.createElement("button",{ref:n,...o})}}:{},Dropdown:e=>t.createElement(HF,{
|
|
13163
|
+
...e,disabled:s})}},
|
|
13153
13164
|
footerElement:u||d?t.createElement(xF,null,u&&t.createElement(Gm,{
|
|
13154
13165
|
variant:"secondary",disabled:s,onClick:()=>{
|
|
13155
|
-
|
|
13166
|
+
M(m??[null,null]),E(!1),setTimeout((()=>{E(void 0)}),0)}
|
|
13156
13167
|
},u),d&&t.createElement(Gm,{
|
|
13157
|
-
disabled:(m??[null,null])?.[0]?.toISOString()===
|
|
13158
|
-
onClick:()=>{
|
|
13168
|
+
disabled:(m??[null,null])?.[0]?.toISOString()===z?.[0]?.toISOString()&&(m??[null,null])?.[1]?.toISOString()===z?.[1]?.toISOString(),
|
|
13169
|
+
onClick:()=>{y.onChange?.(z),C.current=z,E(!1),setTimeout((()=>{E(void 0)}),0)}
|
|
13159
13170
|
},d)):void 0,popoverProps:{hasBackdrop:!0,canEscapeKeyClose:!0,minimal:!1,
|
|
13160
|
-
placement:"ltr"===
|
|
13171
|
+
placement:"ltr"===w.direction?"bottom-start":"bottom-end",usePortal:!0,
|
|
13161
13172
|
onClosed:()=>{
|
|
13162
|
-
|
|
13163
|
-
|
|
13173
|
+
C.current?.[0]?.toISOString()===z?.[0]?.toISOString()&&C.current?.[1]?.toISOString()===z?.[1]?.toISOString()||(y.onChange?.(z),
|
|
13174
|
+
C.current=z)},portalContainer:f??(b||void 0),...void 0!==x?{isOpen:x}:{}},
|
|
13164
13175
|
parseDate:e=>e?vF(e).toDate():new Date,formatDate:e=>e?vF(e).format(p):"",...v?{
|
|
13165
13176
|
timePrecision:"minute",timePickerProps:{useAmPm:!0,showArrowButtons:!1}}:{},
|
|
13166
|
-
...
|
|
13177
|
+
...y,onChange:e=>{M(e)},value:z})),i&&l&&t.createElement(Dm,null,l))},VF=e=>{
|
|
13167
13178
|
const{displayFormat:n="YYYY-MM-DD hh:mm A",...r}=e;return t.createElement(LF,{
|
|
13168
13179
|
...r,displayFormat:n,useTime:!0})},kF=[{id:"AM",name:"AM"},{id:"PM",name:"PM"
|
|
13169
13180
|
}],TF=e=>{
|
package/lib/package.json
CHANGED