freemium-ui 2.0.0-beta.72 → 2.0.0-beta.73

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
@@ -3517,12 +3517,12 @@ environment:"undefined"==typeof window?void 0:window};function Vf(e,t,n){
3517
3517
  void 0===n&&(n=wf);var r=e["default"+Sf(t)];return void 0!==r?r:n[t]}
3518
3518
  function Lf(e,t,n){void 0===n&&(n=wf);var r=e[t];if(void 0!==r)return r
3519
3519
  ;var a=e["initial"+Sf(t)];return void 0!==a?a:Vf(e,t,n)}function Af(e,t,n){
3520
- var r=e.items,a=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,i=e.itemToKey,l=t.selectedItem,c=t.highlightedIndex
3521
- ;return 0===r.length?-1:void 0!==a&&c===a?a:void 0!==o?o:l?r.findIndex((function(e){
3522
- return i(l)===i(e)})):0===n?-1:n<0?r.length-1:0}var kf=function(){return Ep}
3523
- ;function Tf(t,n,r,a){void 0===a&&(a={});var o=a.document,i=Of()
3524
- ;e.useEffect((function(){if(t&&!i&&o){var e=t(n);zf(e,o)}
3525
- }),[r]),e.useEffect((function(){return function(){var e,t
3520
+ var r=e.items,a=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,i=e.isItemDisabled,l=e.itemToKey,c=t.selectedItem,s=t.highlightedIndex
3521
+ ;return 0===r.length?-1:void 0===a||s!==a||i(r[a])?void 0===o||i(r[o])?c?r.findIndex((function(e){
3522
+ return l(c)===l(e)})):n<0&&!i(r[r.length-1])?r.length-1:n>0&&!i(r[0])?0:-1:o:a}
3523
+ var kf=function(){return Ep};function Tf(t,n,r,a){void 0===a&&(a={})
3524
+ ;var o=a.document,i=Of();e.useEffect((function(){if(t&&!i&&o){var e=t(n);zf(e,o)
3525
+ }}),r),e.useEffect((function(){return function(){var e,t
3526
3526
  ;zf.cancel(),(t=null==(e=o)?void 0:e.getElementById("a11y-status-message"))&&t.remove()
3527
3527
  }}),[o])}"production"!==process.env.NODE_ENV&&(kf=function(){
3528
3528
  for(var t=e.useRef(!0),n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a]
@@ -3958,35 +3958,35 @@ const a="string"==typeof t?t:t?.[r],o=t?.[r]??""
3958
3958
  e.createElement(e.Fragment,null,m?m(t,{key:a,value:o??a,disabled:!!t.disabled,
3959
3959
  showTick:h}):e.createElement(dv,{key:a,value:o||a,disabled:!!t.disabled,
3960
3960
  showTick:h},p(t,"list-item")))})))))))))),w&&z&&e.createElement(Hs,null,z))
3961
- },uv=({itemIdentifier:t="id",label:n,id:r,items:a=[],placeholder:o,readOnly:i=!1,disabled:l=!1,isRequired:c=!1,hideClear:s=!1,itemToString:u,name:d,filterKey:h,width:p,customValues:f,onCustomValueAdd:m,itemComponent:v,emptyItemsText:g,getCustomMessage:y,style:b,onChange:w,useComboboxProps:C,isErrored:z,errorText:M,defaultSelectedItem:x,isMenuLoading:E})=>{
3962
- const S=qt(),[_,H]=e.useState(a),{isOpen:D,selectedItem:V,getToggleButtonProps:L,getLabelProps:A,getMenuProps:k,openMenu:T,highlightedIndex:R,setHighlightedIndex:P,setInputValue:I,inputValue:O,getItemProps:N,getInputProps:F}=wm({
3963
- id:r,selectedItem:x,items:_,onSelectedItemChange:({selectedItem:e})=>{
3961
+ },uv=({itemIdentifier:t="id",label:n,id:r,items:a=[],placeholder:o,readOnly:i=!1,disabled:l=!1,isRequired:c=!1,hideClear:s=!1,itemToString:u,name:d,filterKey:h,width:p,customValues:f,onCustomValueAdd:m,itemComponent:v,emptyItemsText:g,getCustomMessage:y,style:b,onChange:w,useComboboxProps:C,isErrored:z,errorText:M,defaultSelectedItem:x,isMenuLoading:E,clearInputOnselect:S=!1})=>{
3962
+ const _=qt(),[H,D]=e.useState(a),{isOpen:V,selectedItem:L,getToggleButtonProps:A,getLabelProps:k,getMenuProps:T,openMenu:R,highlightedIndex:P,setHighlightedIndex:I,setInputValue:O,inputValue:N,getItemProps:F,getInputProps:B}=wm({
3963
+ id:r,selectedItem:x,items:H,onSelectedItemChange:({selectedItem:e})=>{
3964
3964
  console.log("onSelectedItemChange",{sI:e}),w?.(e??null)},
3965
3965
  onIsOpenChange:({isOpen:e})=>{
3966
- if(e&&(""===O||V&&h&&(O||"").toLowerCase()===`${V?.[h||t]||""}`.toLowerCase()))H(a),
3967
- P(V?a.indexOf(V):-1);else{const t=V?u(V):"";V&&!e&&t!==O&&I(t)}e||H(a)},
3968
- onInputValueChange:({inputValue:e})=>{
3969
- D&&(""===e||V&&h&&(e||"").toLowerCase()===`${V?.[h||t]||""}`.toLowerCase())?H(a):H((n=>n.filter((n=>!e||("string"==typeof n?n:n?.[h||t]).toLowerCase().includes(e.toLowerCase())))))
3970
- },itemToString:e=>e?u(e,"downshift"):"",...C}),B=!l&&!i&&D
3966
+ if(e&&(""===N||L&&h&&(N||"").toLowerCase()===`${L?.[h||t]||""}`.toLowerCase()))D(a),
3967
+ I(L?a.indexOf(L):-1);else{const t=L?u(L):"";L&&!e&&t!==N&&O(t)}e||D(a),S&&O("")
3968
+ },onInputValueChange:({inputValue:e})=>{
3969
+ V&&(""===e||L&&h&&(e||"").toLowerCase()===`${L?.[h||t]||""}`.toLowerCase())?D(a):D((n=>n.filter((n=>!e||("string"==typeof n?n:n?.[h||t]).toLowerCase().includes(e.toLowerCase())))))
3970
+ },itemToString:e=>e?u(e,"downshift"):"",...C}),j=!l&&!i&&V
3971
3971
  ;return e.createElement(vh,{width:p},e.createElement(Fr,{
3972
- className:"input-label",...A({disabled:l,readOnly:i})
3973
- },n,n&&c&&e.createElement(jr,null,"*")),e.createElement(ev,{...F({name:d,
3972
+ className:"input-label",...k({disabled:l,readOnly:i})
3973
+ },n,n&&c&&e.createElement(jr,null,"*")),e.createElement(ev,{...B({name:d,
3974
3974
  readOnly:i,disabled:l}),placeholder:o,
3975
- endAdornment:e.createElement(zh,null,!l&&!i&&!s&&V&&e.createElement($r,{
3976
- "aria-label":"close",onClick:e=>{I(""),w?.(null),T(),e.stopPropagation()},
3977
- style:{borderRadius:"50%"}},e.createElement(Mr,{fill:S.colors.text.primary
3978
- })),e.createElement($r,{...L({disabled:l,readOnly:i,"aria-label":"toggle-button"
3979
- })},e.createElement(mh,{$isOpen:B,fill:S.colors.text.primary,width:8,height:8
3980
- }))),style:b}),!i&&!l&&e.createElement(yh,{$isOpen:D,...k({disabled:l,readOnly:i
3975
+ endAdornment:e.createElement(zh,null,!l&&!i&&!s&&L&&e.createElement($r,{
3976
+ "aria-label":"close",onClick:e=>{O(""),w?.(null),R(),e.stopPropagation()},
3977
+ style:{borderRadius:"50%"}},e.createElement(Mr,{fill:_.colors.text.primary
3978
+ })),e.createElement($r,{...A({disabled:l,readOnly:i,"aria-label":"toggle-button"
3979
+ })},e.createElement(mh,{$isOpen:j,fill:_.colors.text.primary,width:8,height:8
3980
+ }))),style:b}),!i&&!l&&e.createElement(yh,{$isOpen:V,...T({disabled:l,readOnly:i
3981
3981
  })
3982
- },E?e.createElement(Ch,null,e.createElement(lv,null)):e.createElement(e.Fragment,null,D&&0===_.length&&e.createElement(e.Fragment,null,f?e.createElement(bh,null,e.createElement(wh,{
3983
- onClick:e=>{e.stopPropagation(),m&&m({inputValue:O,customValues:!0}),I("")}
3984
- },y?.(O)||"Click to add")):e.createElement(bh,{readOnly:!0
3985
- },g||"No items")),D&&_.map(((n,r)=>{const a="string"==typeof n?n:n?.[t]
3986
- ;return e.createElement(e.Fragment,{key:a},v?v(n,{isHilighted:R===r,
3987
- isSelected:V===n,key:a,...N({item:n,index:r})}):e.createElement(bh,{
3988
- $isHilighted:R===r,$isSelected:V===n,key:a,...N({item:n,index:r})
3989
- },u(n),V===n&&e.createElement(xr,{fill:S.colors.common.accent})))
3982
+ },E?e.createElement(Ch,null,e.createElement(lv,null)):e.createElement(e.Fragment,null,V&&0===H.length&&e.createElement(e.Fragment,null,f?e.createElement(bh,null,e.createElement(wh,{
3983
+ onClick:e=>{e.stopPropagation(),m&&m({inputValue:N,customValues:!0}),O("")}
3984
+ },y?.(N)||"Click to add")):e.createElement(bh,{readOnly:!0
3985
+ },g||"No items")),V&&H.map(((n,r)=>{const a="string"==typeof n?n:n?.[t]
3986
+ ;return e.createElement(e.Fragment,{key:a},v?v(n,{isHilighted:P===r,
3987
+ isSelected:L===n,key:a,...F({item:n,index:r})}):e.createElement(bh,{
3988
+ $isHilighted:P===r,$isSelected:L===n,key:a,...F({item:n,index:r})
3989
+ },u(n),L===n&&e.createElement(xr,{fill:_.colors.common.accent})))
3990
3990
  })))),z&&M&&e.createElement(Hs,null,M))
3991
3991
  },dv=e.forwardRef((({children:t,showTick:n=!0,...r},a)=>{const o=qt()
3992
3992
  ;return e.createElement(Dh,{className:"SelectItem",...r,ref:a
@@ -9052,7 +9052,7 @@ void 0!==t.handleDocumentFocus&&document.addEventListener("focus",t.handleDocume
9052
9052
  }),[A,k,X,Q,q]),re=null!==(a=function(e){var t=r.useRef()
9053
9053
  ;return r.useEffect((function(){t.current=e}),[e]),t.current}(y))&&void 0!==a&&a
9054
9054
  ;r.useEffect((function(){y&&B(!0),!re&&y&&te(),re&&!y&&ne()
9055
- }),[y,te,ne,re]),r.useEffect((function(){return function(){y&&ne()}}),[])
9055
+ }),[y,te,ne,re]),r.useEffect((function(){return function(){ne()}}),[])
9056
9056
  ;var ae=r.useCallback((function(e){var t=PM(j)
9057
9057
  ;_&&t instanceof HTMLElement&&t.focus(),null==C||C(e)
9058
9058
  }),[C,_]),oe=r.useCallback((function(){}),[]),ie=r.useCallback((function(e){
@@ -14884,8 +14884,8 @@ uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length
14884
14884
  getDefaultOptions:e=>({onGroupingChange:xF("grouping",e),
14885
14885
  groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{
14886
14886
  t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))
14887
- },e.getCanGroup=()=>{var n,r,a,o
14888
- ;return null!=(n=null==(r=null!=(a=null==(o=e.columnDef.enableGrouping)||o)?a:t.options.enableGrouping)||r)?n:!!e.accessorFn
14887
+ },e.getCanGroup=()=>{var n,r
14888
+ ;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(r=t.options.enableGrouping)||r)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)
14889
14889
  },e.getIsGrouped=()=>{var n
14890
14890
  ;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)
14891
14891
  },e.getGroupedIndex=()=>{var n
@@ -15091,15 +15091,8 @@ e.getGlobalAutoFilterFn=()=>$F.includesString,e.getGlobalFilterFn=()=>{var t,n
15091
15091
  },e.setGlobalFilter=t=>{
15092
15092
  null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)
15093
15093
  },e.resetGlobalFilter=t=>{
15094
- e.setGlobalFilter(t?void 0:e.initialState.globalFilter)
15095
- },e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),
15096
- e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),
15097
- e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),
15098
- e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,
15099
- e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),
15100
- e.getGlobalFacetedMinMaxValues=()=>{
15101
- if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}
15102
- },aB={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({
15094
+ e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},aB={
15095
+ getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({
15103
15096
  onExpandedChange:xF("expanded",e),paginateExpandedRows:!0}),createTable:e=>{
15104
15097
  let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(t){
15105
15098
  if(null!=(r=null!=(a=e.options.autoResetAll)?a:e.options.autoResetExpanded)?r:!e.options.manualExpanding){
@@ -15299,10 +15292,18 @@ e.resetSorting=t=>{var n,r
15299
15292
  },e.getPreSortedRowModel=()=>e.getGroupedRowModel(),
15300
15293
  e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),
15301
15294
  e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())
15302
- }},gB=[VF,tB,qF,ZF,kF,YF,rB,vB,KF,aB,{getInitialState:e=>({...e,pagination:{
15303
- pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),
15304
- getDefaultOptions:e=>({onPaginationChange:xF("pagination",e)}),createTable:e=>{
15305
- let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(t){
15295
+ }},gB=[VF,tB,qF,ZF,kF,YF,{createTable:e=>{
15296
+ e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),
15297
+ e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),
15298
+ e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),
15299
+ e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,
15300
+ e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),
15301
+ e.getGlobalFacetedMinMaxValues=()=>{
15302
+ if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}
15303
+ },rB,vB,KF,aB,{getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,
15304
+ ...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({
15305
+ onPaginationChange:xF("pagination",e)}),createTable:e=>{let t=!1,n=!1
15306
+ ;e._autoResetPageIndex=()=>{var r,a;if(t){
15306
15307
  if(null!=(r=null!=(a=e.options.autoResetAll)?a:e.options.autoResetPageIndex)?r:!e.options.manualPagination){
15307
15308
  if(n)return;n=!0,e._queue((()=>{e.resetPageIndex(),n=!1}))}}else e._queue((()=>{
15308
15309
  t=!0}))
package/dist/index.d.ts CHANGED
@@ -539,6 +539,7 @@ interface DropdownProps<T extends DefaultDropdownItem = DefaultDropdownItem> ext
539
539
  */
540
540
  useComboboxProps?: UseComboboxProps<T>;
541
541
  itemComponent?: (item: T, props?: DropdownItemProps | DropdownInputItemProps) => React.ReactNode | string;
542
+ clearInputOnselect?: boolean;
542
543
  buttonContentProps?: SelectContentProps;
543
544
  }
544
545
  interface DropdownButtonProps<T extends DefaultDropdownItem = DefaultDropdownItem> extends DropdownProps<T> {
package/dist/index.js CHANGED
@@ -3511,14 +3511,14 @@ environment:"undefined"==typeof window?void 0:window};function nm(e,t,n){
3511
3511
  void 0===n&&(n=Wf);var r=e["default"+Qf(t)];return void 0!==r?r:n[t]}
3512
3512
  function rm(e,t,n){void 0===n&&(n=Wf);var r=e[t];if(void 0!==r)return r
3513
3513
  ;var a=e["initial"+Qf(t)];return void 0!==a?a:nm(e,t,n)}function am(e,t,n){
3514
- var r=e.items,a=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,i=e.itemToKey,l=t.selectedItem,c=t.highlightedIndex
3515
- ;return 0===r.length?-1:void 0!==a&&c===a?a:void 0!==o?o:l?r.findIndex((function(e){
3516
- return i(l)===i(e)})):0===n?-1:n<0?r.length-1:0}var om=function(){return Xp}
3517
- ;function im(e,t,n,r){void 0===r&&(r={});var a=r.document,o=um();f((function(){
3518
- if(e&&!o&&a){var n=e(t);Kf(n,a)}}),[n]),f((function(){return function(){var e,t
3519
- ;Kf.cancel(),
3520
- (t=null==(e=a)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}
3521
- }),[a])}"production"!==process.env.NODE_ENV&&(om=function(){
3514
+ var r=e.items,a=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,i=e.isItemDisabled,l=e.itemToKey,c=t.selectedItem,s=t.highlightedIndex
3515
+ ;return 0===r.length?-1:void 0===a||s!==a||i(r[a])?void 0===o||i(r[o])?c?r.findIndex((function(e){
3516
+ return l(c)===l(e)})):n<0&&!i(r[r.length-1])?r.length-1:n>0&&!i(r[0])?0:-1:o:a}
3517
+ var om=function(){return Xp};function im(e,t,n,r){void 0===r&&(r={})
3518
+ ;var a=r.document,o=um();f((function(){if(e&&!o&&a){var n=e(t);Kf(n,a)}
3519
+ }),n),f((function(){return function(){var e,t
3520
+ ;Kf.cancel(),(t=null==(e=a)?void 0:e.getElementById("a11y-status-message"))&&t.remove()
3521
+ }}),[a])}"production"!==process.env.NODE_ENV&&(om=function(){
3522
3522
  for(var e=r(!0),t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3523
3523
  ;var o=r(n.reduce((function(e,t){return e[t]={},e}),{}));return f((function(){
3524
3524
  Object.keys(o.current).forEach((function(t){var n=o.current[t]
@@ -3943,35 +3943,35 @@ const a="string"==typeof e?e:e?.[r],o=e?.[r]??""
3943
3943
  t.createElement(t.Fragment,null,m?m(e,{key:a,value:o??a,disabled:!!e.disabled,
3944
3944
  showTick:h}):t.createElement(Rv,{key:a,value:o||a,disabled:!!e.disabled,
3945
3945
  showTick:h},p(e,"list-item")))})))))))))),w&&z&&t.createElement(Xs,null,z))
3946
- },Pv=({itemIdentifier:e="id",label:n,id:r,items:a=[],placeholder:o,readOnly:i=!1,disabled:l=!1,isRequired:c=!1,hideClear:s=!1,itemToString:u,name:d,filterKey:h,width:p,customValues:f,onCustomValueAdd:m,itemComponent:v,emptyItemsText:g,getCustomMessage:y,style:b,onChange:w,useComboboxProps:C,isErrored:z,errorText:M,defaultSelectedItem:x,isMenuLoading:S})=>{
3947
- const E=vn(),[_,H]=t.useState(a),{isOpen:D,selectedItem:V,getToggleButtonProps:A,getLabelProps:L,getMenuProps:k,openMenu:T,highlightedIndex:I,setHighlightedIndex:P,setInputValue:R,inputValue:O,getItemProps:N,getInputProps:F}=Wm({
3948
- id:r,selectedItem:x,items:_,onSelectedItemChange:({selectedItem:e})=>{
3946
+ },Pv=({itemIdentifier:e="id",label:n,id:r,items:a=[],placeholder:o,readOnly:i=!1,disabled:l=!1,isRequired:c=!1,hideClear:s=!1,itemToString:u,name:d,filterKey:h,width:p,customValues:f,onCustomValueAdd:m,itemComponent:v,emptyItemsText:g,getCustomMessage:y,style:b,onChange:w,useComboboxProps:C,isErrored:z,errorText:M,defaultSelectedItem:x,isMenuLoading:S,clearInputOnselect:E=!1})=>{
3947
+ const _=vn(),[H,D]=t.useState(a),{isOpen:V,selectedItem:A,getToggleButtonProps:L,getLabelProps:k,getMenuProps:T,openMenu:I,highlightedIndex:P,setHighlightedIndex:R,setInputValue:O,inputValue:N,getItemProps:F,getInputProps:B}=Wm({
3948
+ id:r,selectedItem:x,items:H,onSelectedItemChange:({selectedItem:e})=>{
3949
3949
  console.log("onSelectedItemChange",{sI:e}),w?.(e??null)},
3950
3950
  onIsOpenChange:({isOpen:t})=>{
3951
- if(t&&(""===O||V&&h&&(O||"").toLowerCase()===`${V?.[h||e]||""}`.toLowerCase()))H(a),
3952
- P(V?a.indexOf(V):-1);else{const e=V?u(V):"";V&&!t&&e!==O&&R(e)}t||H(a)},
3953
- onInputValueChange:({inputValue:t})=>{
3954
- D&&(""===t||V&&h&&(t||"").toLowerCase()===`${V?.[h||e]||""}`.toLowerCase())?H(a):H((n=>n.filter((n=>!t||("string"==typeof n?n:n?.[h||e]).toLowerCase().includes(t.toLowerCase())))))
3955
- },itemToString:e=>e?u(e,"downshift"):"",...C}),B=!l&&!i&&D
3951
+ if(t&&(""===N||A&&h&&(N||"").toLowerCase()===`${A?.[h||e]||""}`.toLowerCase()))D(a),
3952
+ R(A?a.indexOf(A):-1);else{const e=A?u(A):"";A&&!t&&e!==N&&O(e)}t||D(a),E&&O("")
3953
+ },onInputValueChange:({inputValue:t})=>{
3954
+ V&&(""===t||A&&h&&(t||"").toLowerCase()===`${A?.[h||e]||""}`.toLowerCase())?D(a):D((n=>n.filter((n=>!t||("string"==typeof n?n:n?.[h||e]).toLowerCase().includes(t.toLowerCase())))))
3955
+ },itemToString:e=>e?u(e,"downshift"):"",...C}),$=!l&&!i&&V
3956
3956
  ;return t.createElement($h,{width:p},t.createElement(la,{
3957
- className:"input-label",...L({disabled:l,readOnly:i})
3958
- },n,n&&c&&t.createElement(sa,null,"*")),t.createElement(Ev,{...F({name:d,
3957
+ className:"input-label",...k({disabled:l,readOnly:i})
3958
+ },n,n&&c&&t.createElement(sa,null,"*")),t.createElement(Ev,{...B({name:d,
3959
3959
  readOnly:i,disabled:l}),placeholder:o,
3960
- endAdornment:t.createElement(Kh,null,!l&&!i&&!s&&V&&t.createElement(ua,{
3961
- "aria-label":"close",onClick:e=>{R(""),w?.(null),T(),e.stopPropagation()},
3962
- style:{borderRadius:"50%"}},t.createElement(jr,{fill:E.colors.text.primary
3963
- })),t.createElement(ua,{...A({disabled:l,readOnly:i,"aria-label":"toggle-button"
3964
- })},t.createElement(Bh,{$isOpen:B,fill:E.colors.text.primary,width:8,height:8
3965
- }))),style:b}),!i&&!l&&t.createElement(Uh,{$isOpen:D,...k({disabled:l,readOnly:i
3960
+ endAdornment:t.createElement(Kh,null,!l&&!i&&!s&&A&&t.createElement(ua,{
3961
+ "aria-label":"close",onClick:e=>{O(""),w?.(null),I(),e.stopPropagation()},
3962
+ style:{borderRadius:"50%"}},t.createElement(jr,{fill:_.colors.text.primary
3963
+ })),t.createElement(ua,{...L({disabled:l,readOnly:i,"aria-label":"toggle-button"
3964
+ })},t.createElement(Bh,{$isOpen:$,fill:_.colors.text.primary,width:8,height:8
3965
+ }))),style:b}),!i&&!l&&t.createElement(Uh,{$isOpen:V,...T({disabled:l,readOnly:i
3966
3966
  })
3967
- },S?t.createElement(Gh,null,t.createElement(kv,null)):t.createElement(t.Fragment,null,D&&0===_.length&&t.createElement(t.Fragment,null,f?t.createElement(Yh,null,t.createElement(Wh,{
3968
- onClick:e=>{e.stopPropagation(),m&&m({inputValue:O,customValues:!0}),R("")}
3969
- },y?.(O)||"Click to add")):t.createElement(Yh,{readOnly:!0
3970
- },g||"No items")),D&&_.map(((n,r)=>{const a="string"==typeof n?n:n?.[e]
3971
- ;return t.createElement(t.Fragment,{key:a},v?v(n,{isHilighted:I===r,
3972
- isSelected:V===n,key:a,...N({item:n,index:r})}):t.createElement(Yh,{
3973
- $isHilighted:I===r,$isSelected:V===n,key:a,...N({item:n,index:r})
3974
- },u(n),V===n&&t.createElement(Ur,{fill:E.colors.common.accent})))
3967
+ },S?t.createElement(Gh,null,t.createElement(kv,null)):t.createElement(t.Fragment,null,V&&0===H.length&&t.createElement(t.Fragment,null,f?t.createElement(Yh,null,t.createElement(Wh,{
3968
+ onClick:e=>{e.stopPropagation(),m&&m({inputValue:N,customValues:!0}),O("")}
3969
+ },y?.(N)||"Click to add")):t.createElement(Yh,{readOnly:!0
3970
+ },g||"No items")),V&&H.map(((n,r)=>{const a="string"==typeof n?n:n?.[e]
3971
+ ;return t.createElement(t.Fragment,{key:a},v?v(n,{isHilighted:P===r,
3972
+ isSelected:A===n,key:a,...F({item:n,index:r})}):t.createElement(Yh,{
3973
+ $isHilighted:P===r,$isSelected:A===n,key:a,...F({item:n,index:r})
3974
+ },u(n),A===n&&t.createElement(Ur,{fill:_.colors.common.accent})))
3975
3975
  })))),z&&M&&t.createElement(Xs,null,M))
3976
3976
  },Rv=t.forwardRef((({children:e,showTick:n=!0,...r},a)=>{const o=vn()
3977
3977
  ;return t.createElement(tp,{className:"SelectItem",...r,ref:a
@@ -9081,7 +9081,7 @@ void 0!==t.handleDocumentFocus&&document.addEventListener("focus",t.handleDocume
9081
9081
  }),[L,k,X,Q,q]),re=null!==(a=function(t){var n=e.useRef()
9082
9082
  ;return e.useEffect((function(){n.current=t}),[t]),n.current}(g))&&void 0!==a&&a
9083
9083
  ;e.useEffect((function(){g&&B(!0),!re&&g&&te(),re&&!g&&ne()
9084
- }),[g,te,ne,re]),e.useEffect((function(){return function(){g&&ne()}}),[])
9084
+ }),[g,te,ne,re]),e.useEffect((function(){return function(){ne()}}),[])
9085
9085
  ;var ae=e.useCallback((function(e){var t=ux($)
9086
9086
  ;E&&t instanceof HTMLElement&&t.focus(),null==w||w(e)
9087
9087
  }),[w,E]),oe=e.useCallback((function(){}),[]),ie=e.useCallback((function(e){
@@ -14991,8 +14991,8 @@ uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length
14991
14991
  getDefaultOptions:e=>({onGroupingChange:aB("grouping",e),
14992
14992
  groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{
14993
14993
  t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))
14994
- },e.getCanGroup=()=>{var n,r,a,o
14995
- ;return null!=(n=null==(r=null!=(a=null==(o=e.columnDef.enableGrouping)||o)?a:t.options.enableGrouping)||r)?n:!!e.accessorFn
14994
+ },e.getCanGroup=()=>{var n,r
14995
+ ;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(r=t.options.enableGrouping)||r)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)
14996
14996
  },e.getIsGrouped=()=>{var n
14997
14997
  ;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)
14998
14998
  },e.getGroupedIndex=()=>{var n
@@ -15198,15 +15198,8 @@ e.getGlobalAutoFilterFn=()=>MB.includesString,e.getGlobalFilterFn=()=>{var t,n
15198
15198
  },e.setGlobalFilter=t=>{
15199
15199
  null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)
15200
15200
  },e.resetGlobalFilter=t=>{
15201
- e.setGlobalFilter(t?void 0:e.initialState.globalFilter)
15202
- },e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),
15203
- e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),
15204
- e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),
15205
- e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,
15206
- e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),
15207
- e.getGlobalFacetedMinMaxValues=()=>{
15208
- if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}
15209
- },OB={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({
15201
+ e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},OB={
15202
+ getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({
15210
15203
  onExpandedChange:aB("expanded",e),paginateExpandedRows:!0}),createTable:e=>{
15211
15204
  let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(t){
15212
15205
  if(null!=(r=null!=(a=e.options.autoResetAll)?a:e.options.autoResetExpanded)?r:!e.options.manualExpanding){
@@ -15406,10 +15399,18 @@ e.resetSorting=t=>{var n,r
15406
15399
  },e.getPreSortedRowModel=()=>e.getGroupedRowModel(),
15407
15400
  e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),
15408
15401
  e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())
15409
- }},XB=[uB,IB,DB,VB,pB,SB,RB,ZB,HB,OB,{getInitialState:e=>({...e,pagination:{
15410
- pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),
15411
- getDefaultOptions:e=>({onPaginationChange:aB("pagination",e)}),createTable:e=>{
15412
- let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(t){
15402
+ }},XB=[uB,IB,DB,VB,pB,SB,{createTable:e=>{
15403
+ e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),
15404
+ e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),
15405
+ e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),
15406
+ e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,
15407
+ e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),
15408
+ e.getGlobalFacetedMinMaxValues=()=>{
15409
+ if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}
15410
+ },RB,ZB,HB,OB,{getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,
15411
+ ...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({
15412
+ onPaginationChange:aB("pagination",e)}),createTable:e=>{let t=!1,n=!1
15413
+ ;e._autoResetPageIndex=()=>{var r,a;if(t){
15413
15414
  if(null!=(r=null!=(a=e.options.autoResetAll)?a:e.options.autoResetPageIndex)?r:!e.options.manualPagination){
15414
15415
  if(n)return;n=!0,e._queue((()=>{e.resetPageIndex(),n=!1}))}}else e._queue((()=>{
15415
15416
  t=!0}))
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.0-beta.72",
3
+ "version": "2.0.0-beta.73",
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.72",
3
+ "version": "2.0.0-beta.73",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",