freemium-ui 2.0.0-beta.27 → 2.0.0-beta.28

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/index.cjs.js CHANGED
@@ -16132,8 +16132,8 @@ open:t,onOpenChange:e=>{e||l?.()}},e.createElement(sm,null,e.createElement(um,{
16132
16132
  forceMount:!0,className:"DialogOverlay",onClick:()=>l?.()}),e.createElement(dm,{
16133
16133
  forceMount:!0,className:`DialogContent ${a}`.trim(),size:s??"default",
16134
16134
  fullWidth:o,align:r,position:c,style:i
16135
- },n))),exports.MoreVertical=od,exports.MultiSelectDropdown=({itemIdentifier:t="id",label:n,id:r,items:a=[],onChange:o,placeholder:i,readOnly:l=!1,disabled:c=!1,isRequired:s=!1,itemToString:u,name:d,filterKey:h,width:p,useComboboxProps:f,useMultipleSelectionProps:m,emptyItemsText:v,getCustomMessage:g,onCustomValueAdd:y,customValues:b,inputValue:w,hideClear:C,removeSelectedItem:z,selectedItem:M,handleInputChange:x,isErrored:E,isMenuLoading:S,errorText:_,InputProps:H,itemComponent:D,isDynamicMenu:L,locale:V,maxAllowedLength:A,minAllowedLength:k,onBackSpace:T})=>{
16136
- const R=qt(),[P,I]=e.useState(""),[O,N]=e.useState([]),F=e.useMemo((()=>a.filter((e=>!P||("string"==typeof e?e:e?.[h||t]).toLowerCase().includes(P.toLowerCase())))),[a,h,t,P]),{getSelectedItemProps:B,getDropdownProps:j,removeSelectedItem:U,setSelectedItems:$}=Bf({
16135
+ },n))),exports.MoreVertical=od,exports.MultiSelectDropdown=({itemIdentifier:t="id",label:n,id:r,items:a=[],onChange:o,placeholder:i,readOnly:l=!1,disabled:c=!1,isRequired:s=!1,itemToString:u,name:d,filterKey:h,width:p,useComboboxProps:f,useMultipleSelectionProps:m,emptyItemsText:v,getCustomMessage:g,onCustomValueAdd:y,customValues:b,inputValue:w,hideClear:C,removeSelectedItem:z,defaultSelectedItems:M=[],handleInputChange:x,isErrored:E,isMenuLoading:S,errorText:_,InputProps:H,itemComponent:D,isDynamicMenu:L,locale:V,maxAllowedLength:A,minAllowedLength:k,onBackSpace:T})=>{
16136
+ const R=qt(),[P,I]=e.useState(""),[O,N]=e.useState([...M]),F=e.useMemo((()=>a.filter((e=>!P||("string"==typeof e?e:e?.[h||t]).toLowerCase().includes(P.toLowerCase())))),[a,h,t,P]),{getSelectedItemProps:B,getDropdownProps:j,removeSelectedItem:U,setSelectedItems:$}=Bf({
16137
16137
  selectedItems:O,onStateChange:({selectedItems:e,type:t})=>{switch(t){
16138
16138
  case Bf.stateChangeTypes.SelectedItemKeyDownBackspace:
16139
16139
  case Bf.stateChangeTypes.SelectedItemKeyDownDelete:
@@ -16149,10 +16149,9 @@ case ff.stateChangeTypes.InputKeyDownEnter:case ff.stateChangeTypes.ItemClick:
16149
16149
  case ff.stateChangeTypes.InputBlur:
16150
16150
  r&&(O.indexOf(r)>-1?N(O.filter((e=>e?.[t]!==r?.[t]))):N([...O,r]),I(""));break
16151
16151
  ;case ff.stateChangeTypes.InputChange:I(e||"")}},...f});e.useEffect((()=>{x?.(P)
16152
- }),[x,P]),e.useEffect((()=>{o?.(O)}),[o,O]),e.useEffect((()=>{N(M??[])
16153
- }),[M]),e.useEffect((()=>{I(w??"")}),[w]);const Q=!c&&!l&&Y
16154
- ;return e.createElement(ld,{width:p,isOpen:Q},e.createElement(wn,{
16155
- className:"input-label",...G({disabled:c,readOnly:l})
16152
+ }),[x,P]),e.useEffect((()=>{o?.(O)}),[o,O]),e.useEffect((()=>{I(w??"")}),[w])
16153
+ ;const Q=!c&&!l&&Y;return e.createElement(ld,{width:p,isOpen:Q
16154
+ },e.createElement(wn,{className:"input-label",...G({disabled:c,readOnly:l})
16156
16155
  },n,s&&e.createElement(zn,null,"*")),e.createElement(cd,{disabled:c,
16157
16156
  isErrored:!!E,"aria-invalid":E
16158
16157
  },e.createElement(hm,null,O.map(((t,n)=>e.createElement(Sm,{
package/dist/index.d.ts CHANGED
@@ -707,7 +707,7 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem = De
707
707
  /**
708
708
  * selected item of dropdown
709
709
  */
710
- selectedItem?: T[];
710
+ defaultSelectedItems?: T[];
711
711
  /**
712
712
  * Called when select an option or input value change
713
713
  */
@@ -795,7 +795,7 @@ interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem = De
795
795
  /**
796
796
  * MultiSelectDropdown displays a list or drop-down box that enables selection of an option or multiple options from an available list of values.
797
797
  */
798
- declare const MultiSelectDropdown: <T extends DefaultMultiSelectDropdownItem>({ itemIdentifier, label, id, items, onChange, placeholder, readOnly, disabled, isRequired, itemToString, name, filterKey, width, useComboboxProps, useMultipleSelectionProps, emptyItemsText, getCustomMessage, onCustomValueAdd, customValues, inputValue: iV, hideClear, removeSelectedItem: rSelectedItem, selectedItem, handleInputChange, isErrored, isMenuLoading, errorText, InputProps, itemComponent, isDynamicMenu, locale, maxAllowedLength, minAllowedLength, onBackSpace, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
798
+ declare const MultiSelectDropdown: <T extends DefaultMultiSelectDropdownItem>({ itemIdentifier, label, id, items, onChange, placeholder, readOnly, disabled, isRequired, itemToString, name, filterKey, width, useComboboxProps, useMultipleSelectionProps, emptyItemsText, getCustomMessage, onCustomValueAdd, customValues, inputValue: iV, hideClear, removeSelectedItem: rSelectedItem, defaultSelectedItems, handleInputChange, isErrored, isMenuLoading, errorText, InputProps, itemComponent, isDynamicMenu, locale, maxAllowedLength, minAllowedLength, onBackSpace, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
799
799
 
800
800
  type DefaultProps = {
801
801
  /**
package/dist/index.js CHANGED
@@ -3878,8 +3878,8 @@ className:"StyledTag"},i||l?t.createElement(Km,{className:"AvatarRoot"
3878
3878
  className:"AvatarFallback",delayMs:600
3879
3879
  },l)):t.createElement("div",null),e,t.createElement(Xm,{...n,onClick:r
3880
3880
  },t.createElement(mr,{fill:u.colors.text.primary})))
3881
- },ev=({itemIdentifier:e="id",label:n,id:r,items:a=[],onChange:o,placeholder:i,readOnly:l=!1,disabled:c=!1,isRequired:s=!1,itemToString:u,name:d,filterKey:h,width:p,useComboboxProps:f,useMultipleSelectionProps:m,emptyItemsText:v,getCustomMessage:g,onCustomValueAdd:y,customValues:b,inputValue:w,hideClear:C,removeSelectedItem:z,selectedItem:M,handleInputChange:x,isErrored:S,isMenuLoading:E,errorText:_,InputProps:H,itemComponent:D,isDynamicMenu:L,locale:V,maxAllowedLength:A,minAllowedLength:k,onBackSpace:T})=>{
3882
- const P=vn(),[I,R]=t.useState(""),[O,N]=t.useState([]),F=t.useMemo((()=>a.filter((t=>!I||("string"==typeof t?t:t?.[h||e]).toLowerCase().includes(I.toLowerCase())))),[a,h,e,I]),{getSelectedItemProps:B,getDropdownProps:j,removeSelectedItem:U,setSelectedItems:$}=hm({
3881
+ },ev=({itemIdentifier:e="id",label:n,id:r,items:a=[],onChange:o,placeholder:i,readOnly:l=!1,disabled:c=!1,isRequired:s=!1,itemToString:u,name:d,filterKey:h,width:p,useComboboxProps:f,useMultipleSelectionProps:m,emptyItemsText:v,getCustomMessage:g,onCustomValueAdd:y,customValues:b,inputValue:w,hideClear:C,removeSelectedItem:z,defaultSelectedItems:M=[],handleInputChange:x,isErrored:S,isMenuLoading:E,errorText:_,InputProps:H,itemComponent:D,isDynamicMenu:L,locale:V,maxAllowedLength:A,minAllowedLength:k,onBackSpace:T})=>{
3882
+ const P=vn(),[I,R]=t.useState(""),[O,N]=t.useState([...M]),F=t.useMemo((()=>a.filter((t=>!I||("string"==typeof t?t:t?.[h||e]).toLowerCase().includes(I.toLowerCase())))),[a,h,e,I]),{getSelectedItemProps:B,getDropdownProps:j,removeSelectedItem:U,setSelectedItems:$}=hm({
3883
3883
  selectedItems:O,onStateChange:({selectedItems:e,type:t})=>{switch(t){
3884
3884
  case hm.stateChangeTypes.SelectedItemKeyDownBackspace:
3885
3885
  case hm.stateChangeTypes.SelectedItemKeyDownDelete:
@@ -3895,10 +3895,9 @@ case Nf.stateChangeTypes.InputKeyDownEnter:case Nf.stateChangeTypes.ItemClick:
3895
3895
  case Nf.stateChangeTypes.InputBlur:
3896
3896
  r&&(O.indexOf(r)>-1?N(O.filter((t=>t?.[e]!==r?.[e]))):N([...O,r]),R(""));break
3897
3897
  ;case Nf.stateChangeTypes.InputChange:R(t||"")}},...f});t.useEffect((()=>{x?.(I)
3898
- }),[x,I]),t.useEffect((()=>{o?.(O)}),[o,O]),t.useEffect((()=>{N(M??[])
3899
- }),[M]),t.useEffect((()=>{R(w??"")}),[w]);const Q=!c&&!l&&Y
3900
- ;return t.createElement(Ad,{width:p,isOpen:Q},t.createElement(Fn,{
3901
- className:"input-label",...G({disabled:c,readOnly:l})
3898
+ }),[x,I]),t.useEffect((()=>{o?.(O)}),[o,O]),t.useEffect((()=>{R(w??"")}),[w])
3899
+ ;const Q=!c&&!l&&Y;return t.createElement(Ad,{width:p,isOpen:Q
3900
+ },t.createElement(Fn,{className:"input-label",...G({disabled:c,readOnly:l})
3902
3901
  },n,s&&t.createElement(jn,null,"*")),t.createElement(kd,{disabled:c,
3903
3902
  isErrored:!!S,"aria-invalid":S
3904
3903
  },t.createElement(Nm,null,O.map(((e,n)=>t.createElement(Jm,{
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.0-beta.27",
3
+ "version": "2.0.0-beta.28",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.0-beta.27",
3
+ "version": "2.0.0-beta.28",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",