hrm_ui_lib 2.1.0-alpha.18 → 2.1.0-alpha.20

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.
Files changed (111) hide show
  1. package/assets/styles/styles.css +1 -1
  2. package/components/Alert/Alert.js +1 -2
  3. package/components/Avatar/AvatarGroup.js +1 -2
  4. package/components/Badge/Badge.js +1 -2
  5. package/components/Breadcrumb/Breadcrumb.js +1 -2
  6. package/components/Button/Button.js +1 -2
  7. package/components/ButtonGroup/ButtonGroup.js +1 -2
  8. package/components/ButtonGroup/ButtonGroupItem.js +1 -2
  9. package/components/Card/CardComponent/Card.js +1 -2
  10. package/components/Card/CardComponent/CardBody.js +1 -2
  11. package/components/Card/CardComponent/CardHead.js +1 -2
  12. package/components/CardGroup/CardGroupComponent/CardBody.js +1 -2
  13. package/components/CardGroup/CardGroupComponent/CardGroup.js +1 -2
  14. package/components/CardGroup/CardGroupComponent/CardHead.js +1 -2
  15. package/components/Checkbox/Checkbox.js +1 -2
  16. package/components/Chips/Chips.js +1 -2
  17. package/components/Collapse/Collapse/Collapse.js +1 -2
  18. package/components/Collapse/Collapse/Title.js +1 -2
  19. package/components/Collapse/CollapseGroup/CollapseGroup.js +1 -3
  20. package/components/Collapse/CollapseItem/CollapseItem.js +1 -2
  21. package/components/Container/Container.js +1 -2
  22. package/components/Copy/Copy.js +1 -2
  23. package/components/Counter/Counter.js +1 -2
  24. package/components/DatePicker/CustomHeader/CustomHeader.js +1 -2
  25. package/components/DatePicker/RangeDatePicker/RangeDatePickerDesktop.js +1 -2
  26. package/components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js +1 -2
  27. package/components/DatePicker/SimpleDatePicker/SimpleDatePickerDesktop.js +1 -2
  28. package/components/DatePicker/SimpleDatePicker/SimpleDatePickerMobile.js +1 -2
  29. package/components/DatePicker/TimePicker/MobileModalContent.js +1 -2
  30. package/components/DatePicker/TimePicker/TimePickerDesktop.js +1 -2
  31. package/components/DatePicker/TimePicker/TimePickerMobile.js +1 -2
  32. package/components/Divider/Divider.js +1 -2
  33. package/components/Empty/Empty.js +1 -2
  34. package/components/FileUpload/DropzoneFileUpload/DropzoneFileUpload.js +1 -2
  35. package/components/FileUpload/DropzoneFileUpload/PreviewItem.js +1 -2
  36. package/components/FileUpload/FileUpload.js +1 -2
  37. package/components/FileUpload/UploadItems.js +1 -3
  38. package/components/FormField/FormField.js +1 -3
  39. package/components/Heading/Heading.js +1 -2
  40. package/components/Image/Image.js +1 -1
  41. package/components/Input/Input.js +2 -3
  42. package/components/LineChart/LineChart.d.ts +3 -0
  43. package/components/LineChart/LineChart.js +8 -0
  44. package/components/LineChart/helper.d.ts +3 -0
  45. package/components/LineChart/helper.js +1 -0
  46. package/components/LineChart/index.d.ts +2 -0
  47. package/components/LineChart/index.js +1 -0
  48. package/components/LineChart/types.d.ts +14 -0
  49. package/components/Menu/NestedMenu.js +1 -2
  50. package/components/More/More.js +1 -3
  51. package/components/Pagination/Pagination.js +1 -2
  52. package/components/Popover/PopoverMobile.js +1 -2
  53. package/components/Progress/Progress.js +1 -2
  54. package/components/ProgressStep/ProgressStep.js +1 -2
  55. package/components/ProgressStep/Step.js +2 -3
  56. package/components/Radio/Radio.js +1 -2
  57. package/components/Radio/RadioGroup.js +1 -2
  58. package/components/Select/ButtonSelect/ButtonSelect.js +1 -3
  59. package/components/Select/FilterSelect/FilterDropdown.js +1 -3
  60. package/components/Select/FilterSelect/FilterGroupDropdown.js +1 -2
  61. package/components/Select/FilterSelect/FilterSelect.js +2 -2
  62. package/components/Select/MultiSelect/MobileWrapper.js +1 -2
  63. package/components/Select/MultiSelect/MultiBase/MultiBase.js +2 -4
  64. package/components/Select/MultiSelect/MultiSelect.js +1 -2
  65. package/components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js +3 -6
  66. package/components/Select/MultiSelect/MultiSelectWithTabs/MultiSelectWithTabs.js +2 -4
  67. package/components/Select/NestedSelect/NestedSelect.js +1 -2
  68. package/components/Select/Select/SelectDesktop/index.js +1 -2
  69. package/components/Select/Select/SelectMobile/index.js +2 -4
  70. package/components/Select/SharedComponents/ButtonSelectWrapper/Button/Button.js +1 -2
  71. package/components/Select/SharedComponents/Footer.js +1 -2
  72. package/components/Select/SharedComponents/InputSelectWrapper/InputSelectWrapper.js +3 -3
  73. package/components/Select/SharedComponents/Loading.js +1 -2
  74. package/components/SideSheet/Footer/Footer.js +1 -2
  75. package/components/SideSheet/SideSheet.js +1 -2
  76. package/components/Skeleton/Skeleton.d.ts +3 -0
  77. package/components/Skeleton/Skeleton.js +4 -0
  78. package/components/Skeleton/consts.d.ts +5 -0
  79. package/components/Skeleton/consts.js +1 -0
  80. package/components/Skeleton/index.d.ts +2 -0
  81. package/components/Skeleton/index.js +1 -0
  82. package/components/Skeleton/types.d.ts +24 -0
  83. package/components/Skeleton/types.js +0 -0
  84. package/components/Snackbar/Snackbar.js +1 -2
  85. package/components/Status/Status.js +1 -2
  86. package/components/Stepper/Stepper.js +1 -2
  87. package/components/Switcher/Switcher.js +1 -2
  88. package/components/Tab/Tab.js +1 -2
  89. package/components/Tab/TabItem.js +2 -3
  90. package/components/Table/Header.js +1 -3
  91. package/components/Table/Row.js +1 -3
  92. package/components/Table/Table.js +1 -2
  93. package/components/Table/utils.js +1 -3
  94. package/components/TableV2/ColumnHeader.js +1 -2
  95. package/components/TableV2/ColumnSettings.js +2 -4
  96. package/components/TableV2/IndeterminateCheckbox.js +2 -2
  97. package/components/TableV2/Table.js +1 -2
  98. package/components/Text/Text.js +1 -2
  99. package/components/Textarea/Textarea.js +1 -2
  100. package/components/Tooltip/Tooltip.js +1 -1
  101. package/components/UnderConstruction/UnderConstruction.js +1 -2
  102. package/helperComponents/Loader/Loader.js +1 -2
  103. package/package.json +1 -1
  104. package/components/Feedback/Feedback.d.ts +0 -3
  105. package/components/Feedback/Feedback.js +0 -3
  106. package/components/Feedback/consts.d.ts +0 -1
  107. package/components/Feedback/consts.js +0 -1
  108. package/components/Feedback/index.d.ts +0 -1
  109. package/components/Feedback/index.js +0 -1
  110. package/components/Feedback/types.d.ts +0 -5
  111. /package/components/{Feedback → LineChart}/types.js +0 -0
@@ -1,8 +1,7 @@
1
1
  import{jsx as e,jsxs as f}from"react/jsx-runtime";import v from"classnames";import{useMemo as h}from"react";import{Text as n}from"../Text/Text.js";import{StepTypes as g}from"./types.js";import{PROGRESS_STATUSES as a}from"./consts.js";import w from"../SVGIcons/IconDismissCircle.js";import j from"../SVGIcons/IconCheckmarkCircle.js";const H=s=>{const{width:t,step:r,stepSize:i="large",index:l,activeStep:c,stepType:m,onStepClick:o}=s,{label:p,subText:d,value:u,status:x}=r,S=c===u,_=x===a.completed,T=x===a.rejected,b=x===a.reviewed,y=h(()=>S&&!T?"brand":_||T?"inverse":"tertiary",[_,T,S]),N=h(()=>{if(m===g.number)/* @__PURE__ */
2
2
  return e(n,{type:y,size:"large"==i?"medium":"small",weight:"large"==i?"semibold":"regular",children:`${l}`});if(m===g.dot){if(S)/* @__PURE__ */
3
- return e("span",{className:v("step__circle__dot")});if(_){const s="large"==i?"small":"xsmall";/* @__PURE__ */
4
- return e(T?w:j,{size:s,type:"inverse"})}}return null},[l,m,i,_,S,T,y]);/* @__PURE__ */
5
- return f("div",{className:v("step",`step--${i}`,{active:S,completed:_&&!S,rejected:T,review:b}),style:{width:t},onClick:()=>{o&&o(u)},children:[
3
+ return e("span",{className:v("step__circle__dot")});if(_){/* @__PURE__ */
4
+ return e(T?w:j,{size:"large"==i?"small":"xsmall",type:"inverse"})}}return null},[l,m,i,_,S,T,y]);/* @__PURE__ */return f("div",{className:v("step",`step--${i}`,{active:S,completed:_&&!S,rejected:T,review:b}),style:{width:t},onClick:()=>{o&&o(u)},children:[
6
5
  /* @__PURE__ */e("div",{className:"step__top",children:/* @__PURE__ */e("div",{className:"step__circle",children:N})}),
7
6
  /* @__PURE__ */f("div",{className:"step__label",children:[
8
7
  /* @__PURE__ */e(n,{size:"large"==i?"standard":"small",weight:"semibold",lineHeight:"large",className:"text-truncate",children:p}),
@@ -1,4 +1,3 @@
1
- import{jsxs as t,jsx as l}from"react/jsx-runtime";import{forwardRef as _}from"react";import{Text as m}from"../Text/Text.js";import x from"classnames";const y=_((e,a)=>{const{name:r,label:s,helperText:o,disabled:d,setFieldValue:i,isSelected:c,value:n,className:p="",onClick:b,dataId:h="",iconProps:y}=e,u=!!n||!!c,_=y||/* @__PURE__ */l("span",{className:"controller__icon"});/* @__PURE__ */
2
- return t("label",{className:x("controller","controller--radio",p,{"controller--disabled":d}),children:[
1
+ import{jsxs as t,jsx as l}from"react/jsx-runtime";import{forwardRef as _}from"react";import{Text as m}from"../Text/Text.js";import x from"classnames";const y=_((e,a)=>{const{name:r,label:s,helperText:o,disabled:d,setFieldValue:i,isSelected:c,value:n,className:p="",onClick:b,dataId:h="",iconProps:y}=e,u=!!n||!!c,_=y||/* @__PURE__ */l("span",{className:"controller__icon"});/* @__PURE__ */return t("label",{className:x("controller","controller--radio",p,{"controller--disabled":d}),children:[
3
2
  /* @__PURE__ */l("input",{"data-id":h,type:"radio",tabIndex:0,onChange:()=>{r&&i&&i(r,!u,{shouldValidate:!u}),b&&b(!u)},checked:c,disabled:d}),_,s?/* @__PURE__ */t("div",{className:"controller__right",children:[
4
3
  /* @__PURE__ */l(m,{type:d?"disabled":"primary",className:"controller__label",children:s}),o?/* @__PURE__ */l(m,{size:"small",type:d?"disabled":"secondary",children:o}):null]}):null]})});y.displayName="Radio";export{y as Radio};
@@ -1,4 +1,3 @@
1
- import{jsxs as b,jsx as l}from"react/jsx-runtime";import{forwardRef as g}from"react";import{Radio as N}from"./Radio.js";import{Label as x}from"../../helperComponents/Label/Label.js";import _ from"classnames";const R=g((a,e)=>{const{isHorizontal:r=!1,name:o,options:s,setFieldValue:d,value:i,handleChange:t,label:m,required:n,disabled:p,className:u,labelAddons:c,hasError:h,selected:g}=a;/* @__PURE__ */
2
- return b("div",{className:_("radio-group",{"radio-group--horizontal":r,"radio-group--vertical":!r},u),children:[
1
+ import{jsxs as b,jsx as l}from"react/jsx-runtime";import{forwardRef as g}from"react";import{Radio as N}from"./Radio.js";import{Label as x}from"../../helperComponents/Label/Label.js";import _ from"classnames";const R=g((a,e)=>{const{isHorizontal:r=!1,name:o,options:s,setFieldValue:d,value:i,handleChange:t,label:m,required:n,disabled:p,className:u,labelAddons:c,hasError:h,selected:g}=a;/* @__PURE__ */return b("div",{className:_("radio-group",{"radio-group--horizontal":r,"radio-group--vertical":!r},u),children:[
3
2
  /* @__PURE__ */l(x,{className:"radio-group__label",text:m,invalid:h,required:n,disabled:p,labelAddons:c}),
4
3
  /* @__PURE__ */l("div",{className:"radio-group__inner",children:s.map(a=>/* @__PURE__ */l(N,{label:a.label,helperText:a.helperText,name:o,disabled:p,className:"radio-group__item",isSelected:a.value===i||a.value===g,onClick:()=>(a=>{o&&d&&d(o,a,{shouldValidate:!0}),t&&t(a)})(a.value),dataId:a.dataId},a.value))})]})});R.displayName="RadioGroup";export{R as RadioGroup};
@@ -1,3 +1 @@
1
- import{jsx as o,Fragment as A}from"react/jsx-runtime";import{useState as n,useRef as E,useId as G}from"react";import P from"classnames";import{OptionItem as V}from"../../../helperComponents/OptionItem/OptionItem.js";import{useGetElemSizes as J}from"../../../hooks/useGetElemSizes.js";import"../../../consts/index.js";import"../../../context/types.js";import{useOnOutsideClick as K}from"../../../hooks/useOnOutsideClick.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import{noop as Q}from"../../../utils/helpers.js";import"../../Collapse/CollapseGroup/CollapseGroup.js";import"../SharedComponents/ContentTop.js";import{Loading as T}from"../SharedComponents/Loading.js";import"../../Input/Input.js";import{useIsMobile as U}from"../../../hooks/useGetIsMobile.js";import{ButtonSelectWrapper as X}from"../SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js";const Re=e=>{const{size:t,className:s,isLoading:r,options:l,name:i,setSelectedItem:p,setFieldValue:a,isRequiredField:m,selectedItem:c,labelLeftIconProps:d,tooltipAddons:u,dropdownWidth:f,labelRightIconComponent:h,optionRightIconComponent:I,align:C="left",value:j,placeHolder:S,offsets:b,dataId:R,type:g,isMobileFullScreen:k=!1}=e,O=j||c,[x,v]=n(!1),[L,z]=n(null),W=E(null),[w,y]=n(null),{scrollHeight:B}=J(W.current),F=()=>v(!1);K(L,F,x,G());const M=U(),_=e=>{p&&p(e),i&&a&&a(i,e),F()},H=e=>({value:o})=>{e?m||_(null):_(o)};/* @__PURE__ */
2
- return o(X,{applySelectedItems:Q,size:t,className:s,dropdownWidth:f,align:C,offsets:b,isOpen:x,setIsOpen:v,containerRef:L,setContainerRef:z,dropdownRef:w,setDropdownRef:y,placeHolder:S,dataId:R,type:g,isMobile:M&&k,children:r?/* @__PURE__ */o(T,{}):/* @__PURE__ */o(A,{children:/* @__PURE__ */o("div",{ref:W,className:P("select__options__scroll","scrollbar","scrollbar--vertical",{"mr-6":B>300}),children:l.map(e=>{const t=e.value===O;/* @__PURE__ */
3
- return o(V,{tooltipAddons:u,data:e,onClick:H(t),labelLeftIconProps:d,OptionRightIconComponent:I,LabelRightIconComponent:h,disabled:e.disabled,isSelected:t},e.value)})})})})};export{Re as ButtonSelect};
1
+ import{jsx as o,Fragment as A}from"react/jsx-runtime";import{useState as n,useRef as E,useId as G}from"react";import P from"classnames";import{OptionItem as V}from"../../../helperComponents/OptionItem/OptionItem.js";import{useGetElemSizes as J}from"../../../hooks/useGetElemSizes.js";import"../../../consts/index.js";import"../../../context/types.js";import{useOnOutsideClick as K}from"../../../hooks/useOnOutsideClick.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import{noop as Q}from"../../../utils/helpers.js";import"../../Collapse/CollapseGroup/CollapseGroup.js";import"../SharedComponents/ContentTop.js";import{Loading as T}from"../SharedComponents/Loading.js";import"../../Input/Input.js";import{useIsMobile as U}from"../../../hooks/useGetIsMobile.js";import{ButtonSelectWrapper as X}from"../SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js";const Re=e=>{const{size:t,className:s,isLoading:r,options:l,name:i,setSelectedItem:p,setFieldValue:a,isRequiredField:m,selectedItem:c,labelLeftIconProps:d,tooltipAddons:u,dropdownWidth:f,labelRightIconComponent:h,optionRightIconComponent:I,align:C="left",value:j,placeHolder:S,offsets:b,dataId:R,type:g,isMobileFullScreen:k=!1}=e,O=j||c,[x,v]=n(!1),[L,z]=n(null),W=E(null),[w,y]=n(null),{scrollHeight:B}=J(W.current),F=()=>v(!1);K(L,F,x,G());const M=U(),_=e=>{p&&p(e),i&&a&&a(i,e),F()},H=e=>({value:o})=>{e?m||_(null):_(o)};/* @__PURE__ */return o(X,{applySelectedItems:Q,size:t,className:s,dropdownWidth:f,align:C,offsets:b,isOpen:x,setIsOpen:v,containerRef:L,setContainerRef:z,dropdownRef:w,setDropdownRef:y,placeHolder:S,dataId:R,type:g,isMobile:M&&k,children:r?/* @__PURE__ */o(T,{}):/* @__PURE__ */o(A,{children:/* @__PURE__ */o("div",{ref:W,className:P("select__options__scroll","scrollbar","scrollbar--vertical",{"mr-6":B>300}),children:l.map(e=>{const t=e.value===O;/* @__PURE__ */return o(V,{tooltipAddons:u,data:e,onClick:H(t),labelLeftIconProps:d,OptionRightIconComponent:I,LabelRightIconComponent:h,disabled:e.disabled,isSelected:t},e.value)})})})})};export{Re as ButtonSelect};
@@ -1,3 +1 @@
1
- import{jsx as r,Fragment as u}from"react/jsx-runtime";import{useMemo as I}from"react";import{OptionItem as b}from"../../../helperComponents/OptionItem/OptionItem.js";const g=e=>{const{checkIsSelected:t,filterValue:o,options:n,onItemSelect:i,onItemDeselect:l,labelLeftIconProps:s,optionRightIconComponent:a,labelRightIconComponent:c}=e,m=I(()=>n.filter(e=>e.label.toString().includes(o)),[o,n]);/* @__PURE__ */
2
- return r(u,{children:m.map(e=>{const o=t(e.value);/* @__PURE__ */
3
- return r(b,{data:e,onClick:o?l:i,labelLeftIconProps:s,OptionRightIconComponent:a,LabelRightIconComponent:c,isCheckbox:!0,disabled:e.disabled,isSelected:o},e.value)})})};export{g as FilterDropdownContent};
1
+ import{jsx as r,Fragment as u}from"react/jsx-runtime";import{useMemo as I}from"react";import{OptionItem as b}from"../../../helperComponents/OptionItem/OptionItem.js";const g=e=>{const{checkIsSelected:t,filterValue:o,options:n,onItemSelect:i,onItemDeselect:l,labelLeftIconProps:s,optionRightIconComponent:a,labelRightIconComponent:c}=e,m=I(()=>n.filter(e=>e.label.toString().includes(o)),[o,n]);/* @__PURE__ */return r(u,{children:m.map(e=>{const o=t(e.value);/* @__PURE__ */return r(b,{data:e,onClick:o?l:i,labelLeftIconProps:s,OptionRightIconComponent:a,LabelRightIconComponent:c,isCheckbox:!0,disabled:e.disabled,isSelected:o},e.value)})})};export{g as FilterDropdownContent};
@@ -1,4 +1,3 @@
1
- import{jsx as r,Fragment as s,jsxs as i}from"react/jsx-runtime";import{FilterDropdownContent as c}from"./FilterDropdown.js";const d=o=>{const{options:t,...n}=o;/* @__PURE__ */
2
- return r(s,{children:t.map(({data:o,title:t})=>/* @__PURE__ */i("div",{className:"group_container",children:[
1
+ import{jsx as r,Fragment as s,jsxs as i}from"react/jsx-runtime";import{FilterDropdownContent as c}from"./FilterDropdown.js";const d=o=>{const{options:t,...n}=o;/* @__PURE__ */return r(s,{children:t.map(({data:o,title:t})=>/* @__PURE__ */i("div",{className:"group_container",children:[
3
2
  /* @__PURE__ */r("span",{children:t}),
4
3
  /* @__PURE__ */r(c,{options:o,...n})]},t))})};export{d as FilterGroupDropdownContent};
@@ -1,4 +1,4 @@
1
- import{jsx as t,Fragment as j,jsxs as w}from"react/jsx-runtime";import{useState as c,useId as z,useCallback as h}from"react";import{createPortal as G}from"react-dom";import{useHideOnScroll as H}from"../../../hooks/useHideOnScroll.js";import"../../../context/types.js";import{useOnOutsideClick as L}from"../../../hooks/useOnOutsideClick.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import{FilterDropdownContent as A}from"./FilterDropdown.js";import{FilterGroupDropdownContent as B}from"./FilterGroupDropdown.js";import{Footer as q}from"../SharedComponents/Footer.js";import"classnames";import"dayjs";import"../../../consts/index.js";import"../../../helperComponents/ErrorMessage/consts.js";import"../../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import"../../Checkbox/Checkbox.js";import"motion/react";import"../../Collapse/CollapseGroup/CollapseGroup.js";import"../SharedComponents/ContentTop.js";import{Loading as E}from"../SharedComponents/Loading.js";import{Input as J}from"../../Input/Input.js";import K from"../../SVGIcons/IconSearchFilled.js";import M from"../../SVGIcons/IconDismissFilled.js";const Se=o=>{const{isLoading:e,isGrouped:s,options:r,isOpen:l,setFieldValue:n,name:a,footerButtonProps:i,selectedItems:p,setSelectedItems:m,closeHandler:d,parentRef:u,language:f="en",...C}=o,[S,F]=c(null),[I,g]=c(p),[k,v]=c("");L(S,d,l,z()),H(d);const x=h(o=>{g(e=>[...e,o])},[]),D=o=>{m&&m(o),a&&n&&n(a,o),d()},_=o=>void 0!==I.find(e=>e.value===o),b=h(()=>{D(I),d()},[I]),O=({value:o})=>{g(e=>e.filter(e=>e.value!==o))};return l?/* @__PURE__ */t(j,{children:G(
1
+ import{jsx as t,Fragment as j,jsxs as w}from"react/jsx-runtime";import{useState as c,useId as z,useCallback as h}from"react";import{createPortal as G}from"react-dom";import{useHideOnScroll as H}from"../../../hooks/useHideOnScroll.js";import"../../../context/types.js";import{useOnOutsideClick as L}from"../../../hooks/useOnOutsideClick.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import{FilterDropdownContent as A}from"./FilterDropdown.js";import{FilterGroupDropdownContent as B}from"./FilterGroupDropdown.js";import{Footer as q}from"../SharedComponents/Footer.js";import"classnames";import"dayjs";import"../../../consts/index.js";import"../../../helperComponents/ErrorMessage/consts.js";import"../../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import"../../Checkbox/Checkbox.js";import"motion/react";import"../../Collapse/CollapseGroup/CollapseGroup.js";import"../SharedComponents/ContentTop.js";import{Loading as E}from"../SharedComponents/Loading.js";import{Input as J}from"../../Input/Input.js";import K from"../../SVGIcons/IconSearchFilled.js";import M from"../../SVGIcons/IconDismissFilled.js";const Se=o=>{const{isLoading:e,isGrouped:s,options:r,isOpen:l,setFieldValue:n,name:a,footerButtonProps:i,selectedItems:p,setSelectedItems:m,closeHandler:d,parentRef:u,language:f="en",...C}=o,[S,F]=c(null),[I,g]=c(p),[k,v]=c("");L(S,d,l,z()),H(d);const x=h(o=>{g(e=>[...e,o])},[]),D=o=>{m&&m(o),a&&n&&n(a,o),d()},_=h(()=>{D(I),d()},[I]);return l?/* @__PURE__ */t(j,{children:G(
2
2
  /* @__PURE__ */t("div",{className:"select filter",children:/* @__PURE__ */w("div",{className:"select__options",ref:F,children:[
3
3
  /* @__PURE__ */t(J,{onChange:o=>{o.preventDefault(),o.stopPropagation(),v(o.target.value)},className:"filter__input",size:"small",currentValue:k,rightIconProps:{size:""===k?"small":"xsmall",Component:""===k?K:M,onClick:()=>{v("")}}}),
4
- /* @__PURE__ */t("div",{className:"select__options__scroll scrollbar scrollbar--vertical ",children:e?/* @__PURE__ */t(E,{}):/* @__PURE__ */t(s?B:A,{checkIsSelected:_,onItemDeselect:O,filterValue:k,onItemSelect:x,options:r,...C})}),e?null:/* @__PURE__ */t(q,{buttonProps:i,onCancel:()=>{D(p),g(p),d()},onApply:b,language:f})]})}),document.body)}):null};export{Se as FilterSelect};
4
+ /* @__PURE__ */t("div",{className:"select__options__scroll scrollbar scrollbar--vertical ",children:e?/* @__PURE__ */t(E,{}):/* @__PURE__ */t(s?B:A,{checkIsSelected:o=>void 0!==I.find(e=>e.value===o),onItemDeselect:({value:o})=>{g(e=>e.filter(e=>e.value!==o))},filterValue:k,onItemSelect:x,options:r,...C})}),e?null:/* @__PURE__ */t(q,{buttonProps:i,onCancel:()=>{D(p),g(p),d()},onApply:_,language:f})]})}),document.body)}):null};export{Se as FilterSelect};
@@ -1,2 +1 @@
1
- import{jsx as m}from"react/jsx-runtime";import{Modal as l}from"../../Modal/Modal.js";import"react";import"classnames";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"dayjs";import"react-dom";const M=o=>{const{applySelectedItems:e,isOpen:t,closeDrodown:r,children:s,modalApplyButtonText:p="Apply"}=o;/* @__PURE__ */
2
- return m(l,{isOpen:t,onClose:r,onSubmit:()=>{e(!1)},isMobileFullScreen:!0,className:"select__modal",buttonProps:{confirm:{buttonText:p}},children:s})};export{M as MobileWrapper};
1
+ import{jsx as m}from"react/jsx-runtime";import{Modal as l}from"../../Modal/Modal.js";import"react";import"classnames";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"dayjs";import"react-dom";const M=o=>{const{applySelectedItems:e,isOpen:t,closeDrodown:r,children:s,modalApplyButtonText:p="Apply"}=o;/* @__PURE__ */return m(l,{isOpen:t,onClose:r,onSubmit:()=>{e(!1)},isMobileFullScreen:!0,className:"select__modal",buttonProps:{confirm:{buttonText:p}},children:s})};export{M as MobileWrapper};
@@ -1,5 +1,3 @@
1
- import{jsxs as $,Fragment as ee,jsx as c}from"react/jsx-runtime";import{useState as p,useRef as R,useEffect as T,useCallback as L,useMemo as N}from"react";import{Empty as te}from"../../../Empty/Empty.js";import{OptionItem as oe}from"../../../../helperComponents/OptionItem/OptionItem.js";import V from"classnames";import"../../../Checkbox/Checkbox.js";import"react-dom";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import"motion/react";import{noop as le}from"../../../../utils/helpers.js";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import{ContentTop as se}from"../../SharedComponents/ContentTop.js";import"../../../Input/Input.js";import{FixedSizeList as ne}from"react-window";import{DROPDOWN_WIDTH as re,ITEM_SIZE_MOBILE as ae,ITEM_SIZE as S,DROPDOWN_HEIGHT as P}from"../../constants.js";import{filterSearchData as ie}from"../../Select/helpers.js";const ke=e=>{const{isMobile:t,closeDropdown:o,scrollableContentStyle:s,options:a,helperText:l,translations:n,onItemSelect:r,onItemDeselect:i,isSearchAvailable:m,setSelectedValues:u,selectedValues:d,labelLeftIconProps:h,labelRightIconComponent:f,optionRightIconComponent:I,maxSelectCount:b,menuOptions:g,dataIdPrefix:x,dropdownWidth:C,applySelectedItems:w}=e,{emptyListMainMessage:y,emptyListSecondaryMessage:D}=n||{},[v,j]=p(!1),[k,_]=p(""),[M,E]=p(!1),[O,A]=p(0),z=R(null),W=R(null),H=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),A(e=>Math.min(e+1,B.length-1)),j(!0);break;case"ArrowUp":e.preventDefault(),A(e=>Math.max(e-1,0)),j(!0);break;case" ":if(v&&null!==O){e.preventDefault();const t=B[O];if(!t)return;Z(t.value)?K(t):r(t)}break;case"Enter":e.preventDefault(),w();break;case"Escape":o();break;default:j(!1)}};T(()=>{W.current&&W.current.scrollToItem(O,"smart")},[O]);const G=L(()=>{E(!1),u([])},[]),B=N(()=>{if(!k){const e=d.map(e=>e.value),t=a.filter(t=>-1===e.indexOf(t.value));return[...d,...t]}return ie(a,k)},[k,a,d]),F=L(()=>{E(!0);const e=B.filter(e=>!e.disabled).map(e=>{const{value:t,label:o,meta:s}=e;return{value:t,label:o,meta:s}});u(e)},[B]),K=e=>{E(!1),i(e)};T(()=>{z&&z.current&&!m&&z.current.focus()},[z.current]);const Z=e=>void 0!==d.find(t=>t.value===e),U=N(()=>({isCheckbox:!0,labelLeftIconProps:h,optionRightIconComponent:I,labelRightIconComponent:f}),[h,I,f]);/* @__PURE__ */
2
- return $(ee,{children:[
1
+ import{jsxs as $,Fragment as ee,jsx as c}from"react/jsx-runtime";import{useState as p,useRef as R,useEffect as T,useCallback as L,useMemo as N}from"react";import{Empty as te}from"../../../Empty/Empty.js";import{OptionItem as oe}from"../../../../helperComponents/OptionItem/OptionItem.js";import V from"classnames";import"../../../Checkbox/Checkbox.js";import"react-dom";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import"motion/react";import{noop as le}from"../../../../utils/helpers.js";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import{ContentTop as se}from"../../SharedComponents/ContentTop.js";import"../../../Input/Input.js";import{FixedSizeList as ne}from"react-window";import{DROPDOWN_WIDTH as re,ITEM_SIZE_MOBILE as ae,ITEM_SIZE as S,DROPDOWN_HEIGHT as P}from"../../constants.js";import{filterSearchData as ie}from"../../Select/helpers.js";const ke=e=>{const{isMobile:t,closeDropdown:o,scrollableContentStyle:s,options:a,helperText:l,translations:n,onItemSelect:r,onItemDeselect:i,isSearchAvailable:m,setSelectedValues:u,selectedValues:d,labelLeftIconProps:h,labelRightIconComponent:f,optionRightIconComponent:I,maxSelectCount:b,menuOptions:g,dataIdPrefix:x,dropdownWidth:C,applySelectedItems:w}=e,{emptyListMainMessage:y,emptyListSecondaryMessage:D}=n||{},[v,j]=p(!1),[k,_]=p(""),[M,E]=p(!1),[O,A]=p(0),z=R(null),W=R(null),H=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),A(e=>Math.min(e+1,B.length-1)),j(!0);break;case"ArrowUp":e.preventDefault(),A(e=>Math.max(e-1,0)),j(!0);break;case" ":if(v&&null!==O){e.preventDefault();const t=B[O];if(!t)return;Z(t.value)?K(t):r(t)}break;case"Enter":e.preventDefault(),w();break;case"Escape":o();break;default:j(!1)}};T(()=>{W.current&&W.current.scrollToItem(O,"smart")},[O]);const G=L(()=>{E(!1),u([])},[]),B=N(()=>{if(!k){const e=d.map(e=>e.value),t=a.filter(t=>-1===e.indexOf(t.value));return[...d,...t]}return ie(a,k)},[k,a,d]),F=L(()=>{E(!0);const e=B.filter(e=>!e.disabled).map(e=>{const{value:t,label:o,meta:s}=e;return{value:t,label:o,meta:s}});u(e)},[B]),K=e=>{E(!1),i(e)};T(()=>{z&&z.current&&!m&&z.current.focus()},[z.current]);const Z=e=>void 0!==d.find(t=>t.value===e),U=N(()=>({isCheckbox:!0,labelLeftIconProps:h,optionRightIconComponent:I,labelRightIconComponent:f}),[h,I,f]);/* @__PURE__ */return $(ee,{children:[
3
2
  /* @__PURE__ */c(se,{closeDropdown:o,dataIdPrefix:x,menuOptions:g,selectAll:F,clearAll:G,hasLimitation:!!b,isAnySelected:0!==d.length,helperText:l,isSearchAvailable:m,isSelectAllDisabled:M||0===B.length,setSearchValue:_,searchValue:k,translations:n,handleKeyDown:H}),
4
- /* @__PURE__ */c("div",{className:V("select__options__scroll scrollbar",{select__options__scroll_mobile:t}),style:s,ref:z,tabIndex:0,onKeyDown:m?le:H,children:B.length>0&&/* @__PURE__ */c(ne,{ref:W,height:t?window.innerHeight-80-73-24:B.length*S>P?P:B.length*S,itemCount:B.length,itemSize:t?ae:S,width:t?window.innerWidth:C||re,style:{width:C||"100%"},children:({index:e,style:o})=>{const s=B[e],a=Z(s.value),l=e===O;/* @__PURE__ */
5
- return c(oe,{size:t?"large":"small",data:s,dataId:s.dataId,onClick:a?K:r,disabled:s.disabled||!a&&d.length===b,isSelected:a,style:o,className:V("option",{"option--active":l}),...U})}})}),0===B.length?/* @__PURE__ */c(te,{size:"small",mainMessage:y,paragraphMessage:D}):null]})};export{ke as MultiBase};
3
+ /* @__PURE__ */c("div",{className:V("select__options__scroll scrollbar",{select__options__scroll_mobile:t}),style:s,ref:z,tabIndex:0,onKeyDown:m?le:H,children:B.length>0&&/* @__PURE__ */c(ne,{ref:W,height:t?window.innerHeight-80-73-24:B.length*S>P?P:B.length*S,itemCount:B.length,itemSize:t?ae:S,width:t?window.innerWidth:C||re,style:{width:C||"100%"},children:({index:e,style:o})=>{const s=B[e],a=Z(s.value),l=e===O;/* @__PURE__ */return c(oe,{size:t?"large":"small",data:s,dataId:s.dataId,onClick:a?K:r,disabled:s.disabled||!a&&d.length===b,isSelected:a,style:o,className:V("option",{"option--active":l}),...U})}})}),0===B.length?/* @__PURE__ */c(te,{size:"small",mainMessage:y,paragraphMessage:D}):null]})};export{ke as MultiBase};
@@ -1,3 +1,2 @@
1
- import{jsx as u,jsxs as U,Fragment as V}from"react/jsx-runtime";import{forwardRef as X,useState as l,useMemo as Y,useEffect as C,useId as Z}from"react";import{OptionsWrapper as $}from"./OptionsWrapper.js";import{Footer as ee}from"../SharedComponents/Footer.js";import"classnames";import"react-dom";import"../../../consts/index.js";import"../../../context/types.js";import{useOnOutsideClick as oe}from"../../../hooks/useOnOutsideClick.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"dayjs";import"../../../helperComponents/ErrorMessage/consts.js";import"../../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import"../../Checkbox/Checkbox.js";import"motion/react";import"../../Collapse/CollapseGroup/CollapseGroup.js";import"../SharedComponents/ContentTop.js";import{InputSelectWrapper as te}from"../SharedComponents/InputSelectWrapper/InputSelectWrapper.js";import{ButtonSelectWrapper as re}from"../SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js";import{useIsMobile as ne}from"../../../hooks/useGetIsMobile.js";import{SELECT_TRANSLATIONS as se}from"../localization.js";const le=X((e,o)=>{const{isMobileFullScreen:s=!0,options:t,footerButtonProps:r,selectedItems:n,setSelectedItems:a,name:p,setFieldValue:i,value:d,label:c,placeHolder:m,isRequiredField:f,labelAddons:h,className:S="",disabled:j,dropdownWidth:I,align:b="left",size:x,isButtonSelect:O,checkboxInfo:g,translations:F,hasError:W,language:k="en",hideSelectedOptions:w=!1,...R}=e,[v,M]=l(null),y=d||n||[],[z,E]=l(!1),[T,A]=l(y),[B,N]=l(null),D=()=>E(!1),G=Y(()=>(null==T?void 0:T.length)!==(null==y?void 0:y.length)||-1!==(null==T?void 0:T.findIndex(e=>-1===(null==y?void 0:y.findIndex(o=>o.value===e.value)))),[T,y]);C(()=>{A(d||[])},[d]),C(()=>{n&&A(n||[])},[n]);const q=()=>{A(y),D()};oe(B,q,z,Z());const H=(e=!1)=>{((e,o)=>{a&&a(e,o),p&&i&&i(p,e),D()})(T,e)},L=O?re:te,P={...se[k],...F},X=ne();/* @__PURE__ */
2
- return u(L,{dropdownRef:v,isOpen:z,setIsOpen:E,containerRef:B,setContainerRef:N,dropdownWidth:I,setDropdownRef:M,size:x,label:c,align:b,disabled:j,className:S,labelAddons:h,placeHolder:m,selectedValues:T,isRequiredField:f,overflowText:P.overflowText,hasError:W,applySelectedItems:H,isMobile:X&&s,hideSelectedOptions:w,children:/* @__PURE__ */U(V,{children:[
1
+ import{jsx as u,jsxs as U,Fragment as V}from"react/jsx-runtime";import{forwardRef as X,useState as l,useMemo as Y,useEffect as C,useId as Z}from"react";import{OptionsWrapper as $}from"./OptionsWrapper.js";import{Footer as ee}from"../SharedComponents/Footer.js";import"classnames";import"react-dom";import"../../../consts/index.js";import"../../../context/types.js";import{useOnOutsideClick as oe}from"../../../hooks/useOnOutsideClick.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"dayjs";import"../../../helperComponents/ErrorMessage/consts.js";import"../../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import"../../Checkbox/Checkbox.js";import"motion/react";import"../../Collapse/CollapseGroup/CollapseGroup.js";import"../SharedComponents/ContentTop.js";import{InputSelectWrapper as te}from"../SharedComponents/InputSelectWrapper/InputSelectWrapper.js";import{ButtonSelectWrapper as re}from"../SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js";import{useIsMobile as ne}from"../../../hooks/useGetIsMobile.js";import{SELECT_TRANSLATIONS as se}from"../localization.js";const le=X((e,o)=>{const{isMobileFullScreen:s=!0,options:t,footerButtonProps:r,selectedItems:n,setSelectedItems:a,name:p,setFieldValue:i,value:d,label:c,placeHolder:m,isRequiredField:f,labelAddons:h,className:S="",disabled:j,dropdownWidth:I,align:b="left",size:x,isButtonSelect:O,checkboxInfo:g,translations:F,hasError:W,language:k="en",hideSelectedOptions:w=!1,...R}=e,[v,M]=l(null),y=d||n||[],[z,E]=l(!1),[T,A]=l(y),[B,N]=l(null),D=()=>E(!1),G=Y(()=>(null==T?void 0:T.length)!==(null==y?void 0:y.length)||-1!==(null==T?void 0:T.findIndex(e=>-1===(null==y?void 0:y.findIndex(o=>o.value===e.value)))),[T,y]);C(()=>{A(d||[])},[d]),C(()=>{n&&A(n||[])},[n]);const q=()=>{A(y),D()};oe(B,q,z,Z());const H=(e=!1)=>{((e,o)=>{a&&a(e,o),p&&i&&i(p,e),D()})(T,e)},L=O?re:te,P={...se[k],...F},X=ne();/* @__PURE__ */return u(L,{dropdownRef:v,isOpen:z,setIsOpen:E,containerRef:B,setContainerRef:N,dropdownWidth:I,setDropdownRef:M,size:x,label:c,align:b,disabled:j,className:S,labelAddons:h,placeHolder:m,selectedValues:T,isRequiredField:f,overflowText:P.overflowText,hasError:W,applySelectedItems:H,isMobile:X&&s,hideSelectedOptions:w,children:/* @__PURE__ */U(V,{children:[
3
2
  /* @__PURE__ */u($,{options:t,isOpen:z,translations:P,setIsOpen:E,dropdownRef:v,openDropdown:()=>E(!0),selectedValues:T,setSelectedValues:A,containerRef:B,dropdownWidth:I,isMobileFullScreen:s,applySelectedItems:H,...R}),!t.length||X&&s?null:/* @__PURE__ */u(ee,{checkboxInfo:g,hasChange:G,buttonProps:r,onCancel:q,onApply:H,language:k})]})})});le.displayName="MultiSelect";export{le as MultiSelect};
@@ -1,7 +1,4 @@
1
- import{jsxs as p,Fragment as Q,jsx as t}from"react/jsx-runtime";import{useState as u,useMemo as g,useCallback as k}from"react";import{Text as Y}from"../../../Text/Text.js";import{Divider as Z}from"../../../Divider/Divider.js";import{Empty as ee}from"../../../Empty/Empty.js";import{useGetElemSizes as te}from"../../../../hooks/useGetElemSizes.js";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import{OptionItem as z}from"../../../../helperComponents/OptionItem/OptionItem.js";import"classnames";import"../../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import{ContentTop as le}from"../../SharedComponents/ContentTop.js";import"../../../Input/Input.js";import{DROPDOWN_MAX_HEIGHT as oe}from"../../constants.js";import re from"../../../SVGIcons/IconCaretUpFilled.js";import se from"../../../SVGIcons/IconCaretDownFilled.js";import{filterSearchData as ae}from"../../Select/helpers.js";const ze=e=>{const{isMobile:o,options:s,helperText:l,translations:a,selectedValues:r,onItemSelect:i,onItemDeselect:n,setSelectedValues:m,isSearchAvailable:c,labelLeftIconProps:d,scrollableContentStyle:h,optionRightIconComponent:I,labelRightIconComponent:x,maxSelectCount:S,menuOptions:f,dataIdPrefix:v,closeDropdown:C}=e,{emptyListMainMessage:b,emptyListSecondaryMessage:j}=a,[_,y]=u(""),[D,M]=u(0),[G,N]=u(!1),[T,A]=u(null),{scrollHeight:O}=te(T),E=g(()=>_?s.reduce((e,t)=>{const{data:o,title:s}=t,l=ae(o,_);return l.length?[...e,{title:s,data:l}]:e},[]):s,[_,s]),V=k(()=>{N(!1),m([])},[]),L=k(()=>{N(!0);const e=E.reduce((e,{data:t})=>[...e,...t.map(e=>({value:e.value,label:e.label}))],[]);m(e)},[E]),P=g(()=>s.reduce((e,t)=>{const{data:o}=t;return[...e,...o.filter(e=>-1!==r.findIndex(t=>t.value===e.value))]},[]),[s,r]),R=e=>{N(!1),n(e)},H=g(()=>({isCheckbox:!0,labelLeftIconProps:d,optionRightIconComponent:I,labelRightIconComponent:x,className:"group-item__option"}),[d,I,x]),w=c||l;/* @__PURE__ */
2
- return p(Q,{children:[w?/* @__PURE__ */t(le,{closeDropdown:C,dataIdPrefix:v,menuOptions:f,isSearchAvailable:c||o,hasLimitation:!!S,selectAll:L,clearAll:V,isAnySelected:0!==r.length,helperText:l,isSelectAllDisabled:G||0===E.length,setSearchValue:y,searchValue:_,translations:a}):null,
3
- /* @__PURE__ */t("div",{ref:A,className:"select__options__scroll scrollbar scrollbar--vertical "+(O>oe?"mr-6":""),style:h,children:/* @__PURE__ */p("div",{children:[c&&/* @__PURE__ */t("div",{className:"selected-items",children:P.map(e=>/* @__PURE__ */t(z,{isSelected:!0,data:e,onClick:R,disabled:e.disabled,...H},e.value))}),w?/* @__PURE__ */t(Z,{type:"primary",isHorizontal:!0}):null,E.map(({title:e,data:o},s)=>{var l;const a=s===D;/* @__PURE__ */
4
- return p("div",{className:"select__group group-item",children:[
1
+ import{jsxs as p,Fragment as Q,jsx as t}from"react/jsx-runtime";import{useState as u,useMemo as g,useCallback as k}from"react";import{Text as Y}from"../../../Text/Text.js";import{Divider as Z}from"../../../Divider/Divider.js";import{Empty as ee}from"../../../Empty/Empty.js";import{useGetElemSizes as te}from"../../../../hooks/useGetElemSizes.js";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import{OptionItem as z}from"../../../../helperComponents/OptionItem/OptionItem.js";import"classnames";import"../../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import{ContentTop as le}from"../../SharedComponents/ContentTop.js";import"../../../Input/Input.js";import{DROPDOWN_MAX_HEIGHT as oe}from"../../constants.js";import re from"../../../SVGIcons/IconCaretUpFilled.js";import se from"../../../SVGIcons/IconCaretDownFilled.js";import{filterSearchData as ae}from"../../Select/helpers.js";const ze=e=>{const{isMobile:o,options:s,helperText:l,translations:a,selectedValues:r,onItemSelect:i,onItemDeselect:n,setSelectedValues:m,isSearchAvailable:c,labelLeftIconProps:d,scrollableContentStyle:h,optionRightIconComponent:I,labelRightIconComponent:x,maxSelectCount:S,menuOptions:f,dataIdPrefix:v,closeDropdown:C}=e,{emptyListMainMessage:b,emptyListSecondaryMessage:j}=a,[_,y]=u(""),[D,M]=u(0),[G,N]=u(!1),[T,A]=u(null),{scrollHeight:O}=te(T),E=g(()=>_?s.reduce((e,t)=>{const{data:o,title:s}=t,l=ae(o,_);return l.length?[...e,{title:s,data:l}]:e},[]):s,[_,s]),V=k(()=>{N(!1),m([])},[]),L=k(()=>{N(!0);const e=E.reduce((e,{data:t})=>[...e,...t.map(e=>({value:e.value,label:e.label}))],[]);m(e)},[E]),P=g(()=>s.reduce((e,t)=>{const{data:o}=t;return[...e,...o.filter(e=>-1!==r.findIndex(t=>t.value===e.value))]},[]),[s,r]),R=e=>{N(!1),n(e)},H=g(()=>({isCheckbox:!0,labelLeftIconProps:d,optionRightIconComponent:I,labelRightIconComponent:x,className:"group-item__option"}),[d,I,x]),w=c||l;/* @__PURE__ */return p(Q,{children:[w?/* @__PURE__ */t(le,{closeDropdown:C,dataIdPrefix:v,menuOptions:f,isSearchAvailable:c||o,hasLimitation:!!S,selectAll:L,clearAll:V,isAnySelected:0!==r.length,helperText:l,isSelectAllDisabled:G||0===E.length,setSearchValue:y,searchValue:_,translations:a}):null,
2
+ /* @__PURE__ */t("div",{ref:A,className:"select__options__scroll scrollbar scrollbar--vertical "+(O>oe?"mr-6":""),style:h,children:/* @__PURE__ */p("div",{children:[c&&/* @__PURE__ */t("div",{className:"selected-items",children:P.map(e=>/* @__PURE__ */t(z,{isSelected:!0,data:e,onClick:R,disabled:e.disabled,...H},e.value))}),w?/* @__PURE__ */t(Z,{type:"primary",isHorizontal:!0}):null,E.map(({title:e,data:o},s)=>{var l;const a=s===D;/* @__PURE__ */return p("div",{className:"select__group group-item",children:[
5
3
  /* @__PURE__ */p("div",{onClick:()=>(e=>{M(D!=e?e:null)})(s),className:"group-item__top",children:[
6
- /* @__PURE__ */t(Y,{size:"xxsmall",type:"tertiary",className:"group-item__title pr-4",children:e}),/* @__PURE__ */t(a?re:se,{size:"xxsmall",className:"group-item__icon"})]}),a&&o.map(e=>{const o=-1!==r.findIndex(t=>t.value===e.value);/* @__PURE__ */
7
- return t(z,{data:e,dataId:e.dataId,isSelected:o,disabled:e.disabled||!o&&r.length===S,onClick:o?R:i,...H},e.value)})]},`${null==(l=o[0])?void 0:l.value}_${s}`)})]})}),0===E.length?/* @__PURE__ */t(ee,{size:"small",mainMessage:b,paragraphMessage:j}):null]})};export{ze as MultiSelectGrouped};
4
+ /* @__PURE__ */t(Y,{size:"xxsmall",type:"tertiary",className:"group-item__title pr-4",children:e}),/* @__PURE__ */t(a?re:se,{size:"xxsmall",className:"group-item__icon"})]}),a&&o.map(e=>{const o=-1!==r.findIndex(t=>t.value===e.value);/* @__PURE__ */return t(z,{data:e,dataId:e.dataId,isSelected:o,disabled:e.disabled||!o&&r.length===S,onClick:o?R:i,...H},e.value)})]},`${null==(l=o[0])?void 0:l.value}_${s}`)})]})}),0===E.length?/* @__PURE__ */t(ee,{size:"small",mainMessage:b,paragraphMessage:j}):null]})};export{ze as MultiSelectGrouped};
@@ -1,7 +1,5 @@
1
- import{jsxs as y,Fragment as K,jsx as a}from"react/jsx-runtime";import{useState as m,useMemo as p,useCallback as D}from"react";import{Divider as Q}from"../../../Divider/Divider.js";import{Empty as U}from"../../../Empty/Empty.js";import{Tab as Y}from"../../../Tab/Tab.js";import{useGetElemSizes as Z}from"../../../../hooks/useGetElemSizes.js";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import{OptionItem as A}from"../../../../helperComponents/OptionItem/OptionItem.js";import"classnames";import"../../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import{ContentTop as ee}from"../../SharedComponents/ContentTop.js";import"../../../Input/Input.js";import{DROPDOWN_MAX_HEIGHT as te}from"../../constants.js";import{filterSearchData as le}from"../../Select/helpers.js";const ye=e=>{const{options:t,scrollableContentStyle:s,selectedValues:l,onItemSelect:o,onItemDeselect:i,setSelectedValues:r,labelLeftIconProps:n,optionRightIconComponent:c,labelRightIconComponent:d,helperText:u,translations:h,isSearchAvailable:b,maxSelectCount:f,menuOptions:S,dataIdPrefix:I,closeDropdown:v}=e,{emptyListMainMessage:C,emptyListSecondaryMessage:j}=h,[x,g]=m(null),[k,T]=m(0),{scrollHeight:M}=Z(x),[O,_]=m(!1),[z,E]=m(""),G=t[k].data,L=p(()=>le(G,z),[z,G]),P=D(()=>{_(!1);const e=l.filter(e=>-1===G.map(e=>e.value).indexOf(e.value));r(e)},[l,k,G]),R=e=>{_(!1),i(e)},V=D(()=>{_(!0);const e=L.map(e=>{const{value:t,label:a}=e;return{value:t,label:a}});r(l.concat(e))},[k,l,L]),H=p(()=>t.map((e,t)=>({label:e.title,value:t})),[t]),N=p(()=>t.reduce((e,t)=>{const{data:a}=t;return[...e,...a.filter(e=>-1!==l.findIndex(t=>t.value===e.value))]},[]),[t,l]),w=p(()=>({isCheckbox:!0,labelLeftIconProps:n,optionRightIconComponent:c,labelRightIconComponent:d}),[n,c,d]);/* @__PURE__ */
2
- return y(K,{children:[
1
+ import{jsxs as y,Fragment as K,jsx as a}from"react/jsx-runtime";import{useState as m,useMemo as p,useCallback as D}from"react";import{Divider as Q}from"../../../Divider/Divider.js";import{Empty as U}from"../../../Empty/Empty.js";import{Tab as Y}from"../../../Tab/Tab.js";import{useGetElemSizes as Z}from"../../../../hooks/useGetElemSizes.js";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import{OptionItem as A}from"../../../../helperComponents/OptionItem/OptionItem.js";import"classnames";import"../../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import{ContentTop as ee}from"../../SharedComponents/ContentTop.js";import"../../../Input/Input.js";import{DROPDOWN_MAX_HEIGHT as te}from"../../constants.js";import{filterSearchData as le}from"../../Select/helpers.js";const ye=e=>{const{options:t,scrollableContentStyle:s,selectedValues:l,onItemSelect:o,onItemDeselect:i,setSelectedValues:r,labelLeftIconProps:n,optionRightIconComponent:c,labelRightIconComponent:d,helperText:u,translations:h,isSearchAvailable:b,maxSelectCount:f,menuOptions:S,dataIdPrefix:I,closeDropdown:v}=e,{emptyListMainMessage:C,emptyListSecondaryMessage:j}=h,[x,g]=m(null),[k,T]=m(0),{scrollHeight:M}=Z(x),[O,_]=m(!1),[z,E]=m(""),G=t[k].data,L=p(()=>le(G,z),[z,G]),P=D(()=>{_(!1);const e=l.filter(e=>-1===G.map(e=>e.value).indexOf(e.value));r(e)},[l,k,G]),R=e=>{_(!1),i(e)},V=D(()=>{_(!0);const e=L.map(e=>{const{value:t,label:a}=e;return{value:t,label:a}});r(l.concat(e))},[k,l,L]),H=p(()=>t.map((e,t)=>({label:e.title,value:t})),[t]),N=p(()=>t.reduce((e,t)=>{const{data:a}=t;return[...e,...a.filter(e=>-1!==l.findIndex(t=>t.value===e.value))]},[]),[t,l]),w=p(()=>({isCheckbox:!0,labelLeftIconProps:n,optionRightIconComponent:c,labelRightIconComponent:d}),[n,c,d]);/* @__PURE__ */return y(K,{children:[
3
2
  /* @__PURE__ */a("div",{className:"tab_container",style:{padding:"0 20px",width:"100%"},children:/* @__PURE__ */a(Y,{selectedValue:k,tabItems:H,onSelect:e=>{T(e),E("")},size:"small"})}),
4
3
  /* @__PURE__ */a(ee,{closeDropdown:v,dataIdPrefix:I,menuOptions:S,isSearchAvailable:b,clearAll:P,selectAll:V,helperText:u,searchValue:z,translations:h,setSearchValue:E,hasLimitation:!!f,isAnySelected:0===l.length,isSelectAllDisabled:O||0===L.length}),
5
4
  /* @__PURE__ */y("div",{ref:g,className:"select__options__scroll scrollbar scrollbar--vertical "+(M>te?"mr-6":""),style:s,children:[b&&/* @__PURE__ */a("div",{className:"selected_container",children:N.map(e=>/* @__PURE__ */a(A,{data:e,onClick:R,disabled:e.disabled,isSelected:!0,...w},e.value))}),
6
- /* @__PURE__ */a(Q,{type:"primary",isHorizontal:!0}),L.map(e=>{const t=-1!==l.findIndex(t=>t.value===e.value);/* @__PURE__ */
7
- return a(A,{data:e,dataId:e.dataId,onClick:t?R:o,disabled:e.disabled||!t&&l.length===f,isSelected:t,...w},e.value)}),0===L.length?/* @__PURE__ */a(U,{size:"small",mainMessage:C,paragraphMessage:j}):null]})]})};export{ye as MultiSelectWithTabs};
5
+ /* @__PURE__ */a(Q,{type:"primary",isHorizontal:!0}),L.map(e=>{const t=-1!==l.findIndex(t=>t.value===e.value);/* @__PURE__ */return a(A,{data:e,dataId:e.dataId,onClick:t?R:o,disabled:e.disabled||!t&&l.length===f,isSelected:t,...w},e.value)}),0===L.length?/* @__PURE__ */a(U,{size:"small",mainMessage:C,paragraphMessage:j}):null]})]})};export{ye as MultiSelectWithTabs};
@@ -1,4 +1,3 @@
1
1
  import{jsxs as j,jsx as r}from"react/jsx-runtime";import{useState as p,useRef as q,useId as A,useCallback as H}from"react";import{Input as M}from"../../Input/Input.js";import{OptionItem as T}from"../../../helperComponents/OptionItem/OptionItem.js";import{useGetElemSizes as U}from"../../../hooks/useGetElemSizes.js";import{useGetElemPositions as B}from"../../../hooks/useGetElemPositions.js";import"../../../consts/index.js";import"../../../context/types.js";import{useOnOutsideClick as J}from"../../../hooks/useOnOutsideClick.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import K from"../../SVGIcons/IconChevronUp.js";import v from"../../SVGIcons/IconChevronDown.js";const Q=10,ce=e=>{const{label:o,options:s,selected:t,placeHolder:l,isRequiredField:n,setSelectedValue:i,initialSelectedFolderIds:a,optionRightIconComponent:c,labelRightIconComponent:d,labelAddons:m}=e,[u,h]=p(!1),[f,I]=p(null),[b,C]=p(a||[]),S=q(null),{bottom:k,left:x}=B(S.current),{width:O}=U(f);J(f,()=>h(!1),u,A());const g=H((e,o)=>{const{value:s}=e;if(!o)return void i(s===(null==t?void 0:t.value)?null:e);const l=-1!==b.findIndex(e=>e===s);C(l?b.filter(e=>e!==s):[...b,s])},[t,b]),_=(e,o)=>e.reduce((e,s)=>{const{value:l,children:n,disabled:i}=s,a=-1!==b.indexOf(s.value),p=s.value===(null==t?void 0:t.value);return e.push(
2
- /* @__PURE__ */r("div",{style:{paddingLeft:Q*o},children:/* @__PURE__ */r(T,{data:s,isSelected:p,onClick:()=>g({value:l,label:s.label},!!n),disabled:i,OptionRightIconComponent:c,LabelRightIconComponent:d,labelLeftIconProps:n?{Component:v,size:"xsmall"}:void 0},l)})),a&&n&&e.push(..._(n,o+1)),e},[]);/* @__PURE__ */
3
- return j("div",{className:"select select--multi",ref:I,children:[
2
+ /* @__PURE__ */r("div",{style:{paddingLeft:Q*o},children:/* @__PURE__ */r(T,{data:s,isSelected:p,onClick:()=>g({value:l,label:s.label},!!n),disabled:i,OptionRightIconComponent:c,LabelRightIconComponent:d,labelLeftIconProps:n?{Component:v,size:"xsmall"}:void 0},l)})),a&&n&&e.push(..._(n,o+1)),e},[]);/* @__PURE__ */return j("div",{className:"select select--multi",ref:I,children:[
4
3
  /* @__PURE__ */r("div",{onClick:e=>{const o=null==e?void 0:e.target;e&&o.className&&-1!==o.className.indexOf("icon-")?(h(!u),e.preventDefault()):h(!0)},children:/* @__PURE__ */r(M,{ref:S,className:"select__input",label:o,required:n,rightIconProps:{Component:u?K:v,size:"small"},placeholder:l,currentValue:(null==t?void 0:t.label.toString())||"",readonly:!0,labelAddons:m})}),u&&/* @__PURE__ */r("div",{className:"select__options",style:{left:x,width:O,top:k},children:/* @__PURE__ */r("div",{className:"select__options__scroll scrollbar scrollbar--vertical",children:_(s,0)})})]})};export{ce as NestedSelect};
@@ -1,2 +1 @@
1
- import{jsx as e,Fragment as R,jsxs as K}from"react/jsx-runtime";import _ from"classnames";import{useRef as U,useState as X,useEffect as p,useId as Y}from"react";import{FixedSizeList as Z}from"react-window";import{DROPDOWN_AND_INPUT_GAP as $}from"../../../../consts/index.js";import{OptionItem as J}from"../../../../helperComponents/OptionItem/OptionItem.js";import{useGetElemSizes as Q}from"../../../../hooks/useGetElemSizes.js";import{useGetElemPositions as ee}from"../../../../hooks/useGetElemPositions.js";import"../../../../context/types.js";import{useOnOutsideClick as te}from"../../../../hooks/useOnOutsideClick.js";import"../../../../hooks/useScreenSize.js";import{useGetHasBottomSpace as oe,useGetHasTopSpace as ie}from"../../../../hooks/useGetHasBottomSpace.js";import"react-hook-form";import{useChangePositionsOnScroll as ne}from"../../../../hooks/useChangePositionsOnScroll.js";import{Empty as se}from"../../../Empty/Empty.js";import{Text as re}from"../../../Text/Text.js";import"../../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import"../../SharedComponents/ContentTop.js";import{Loading as le}from"../../SharedComponents/Loading.js";import"../../../Input/Input.js";import{DROPDOWN_WIDTH as ce,ITEM_SIZE as d,DROPDOWN_HEIGHT as D}from"../../constants.js";const ke=t=>{const{currentSelection:o,isLoading:s,dataId:n="",innerHelperText:i,isRequiredField:a,labelLeftIconProps:l,labelRightIconComponent:r,optionRightIconComponent:m,tooltipAddons:c,dropdownWidth:u,isOpen:h,closeDropdown:f,inputRef:I,containerRef:S,onItemSelect:j,onItemDeselect:C,searchValue:g,setSearchValue:x,translations:O,filteredData:k,activeIndex:b,setActiveIndex:w,setCurrentSelectedLabel:v}=t,y=U(null),[E,G]=X(null);p(()=>{y.current&&y.current.scrollToItem(b,"smart")},[b]),p(()=>{E&&h&&E&&h&&E.focus()},[E,h]),p(()=>{w(0)},[g]),te(S,()=>{!g&&a&&v(),f()},h,Y());const{bottom:P,left:T,top:N}=ee(I),{width:L}=Q(S),H=e=>({value:t})=>{x(""),e?a||C():j(t)},{hasBottomSpace:z}=oe({element:E,input:I}),A=ie({element:E,input:I});return ne(I,E,z),/* @__PURE__ */e(R,{children:h&&/* @__PURE__ */e("div",{className:"select__options",style:{left:T,width:L,...z||!A?{top:P}:{bottom:window.innerHeight-N+$}},ref:G,children:s?/* @__PURE__ */e(le,{}):/* @__PURE__ */e(R,{children:/* @__PURE__ */K("div",{"data-id":`${n}-options-content`,className:_("select__options__scroll","scrollbar"),children:[i?/* @__PURE__ */e("div",{className:"content-top",children:/* @__PURE__ */e(re,{size:"xsmall",type:"secondary",className:"content-top__label",children:i})}):null,k.length>0&&/* @__PURE__ */e(Z,{ref:y,height:k.length*d>D?D:k.length*d,itemCount:k.length,itemSize:d,width:u||ce,style:{width:u||"100%",overflowX:"hidden",overflowY:"auto",willChange:"auto"},children:({index:t,style:s})=>{const n=k[t],i=n.value===o,a=b===t;/* @__PURE__ */
2
- return e(J,{tooltipAddons:c,data:n,onClick:H(i),labelLeftIconProps:l,OptionRightIconComponent:m,LabelRightIconComponent:r,disabled:n.disabled,isSelected:i,dataId:n.dataId,style:s,className:_("option",{"option--active":a})},n.value)}}),0===k.length?/* @__PURE__ */e(se,{size:"small",mainMessage:null==O?void 0:O.emptyListMainMessage}):null]})})})})};export{ke as SelectDesktop};
1
+ import{jsx as e,Fragment as R,jsxs as K}from"react/jsx-runtime";import _ from"classnames";import{useRef as U,useState as X,useEffect as p,useId as Y}from"react";import{FixedSizeList as Z}from"react-window";import{DROPDOWN_AND_INPUT_GAP as $}from"../../../../consts/index.js";import{OptionItem as J}from"../../../../helperComponents/OptionItem/OptionItem.js";import{useGetElemSizes as Q}from"../../../../hooks/useGetElemSizes.js";import{useGetElemPositions as ee}from"../../../../hooks/useGetElemPositions.js";import"../../../../context/types.js";import{useOnOutsideClick as te}from"../../../../hooks/useOnOutsideClick.js";import"../../../../hooks/useScreenSize.js";import{useGetHasBottomSpace as oe,useGetHasTopSpace as ie}from"../../../../hooks/useGetHasBottomSpace.js";import"react-hook-form";import{useChangePositionsOnScroll as ne}from"../../../../hooks/useChangePositionsOnScroll.js";import{Empty as se}from"../../../Empty/Empty.js";import{Text as re}from"../../../Text/Text.js";import"../../../Checkbox/Checkbox.js";import"react-dom";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import"../../SharedComponents/ContentTop.js";import{Loading as le}from"../../SharedComponents/Loading.js";import"../../../Input/Input.js";import{DROPDOWN_WIDTH as ce,ITEM_SIZE as d,DROPDOWN_HEIGHT as D}from"../../constants.js";const ke=t=>{const{currentSelection:o,isLoading:s,dataId:n="",innerHelperText:i,isRequiredField:a,labelLeftIconProps:l,labelRightIconComponent:r,optionRightIconComponent:m,tooltipAddons:c,dropdownWidth:u,isOpen:h,closeDropdown:f,inputRef:I,containerRef:S,onItemSelect:j,onItemDeselect:C,searchValue:g,setSearchValue:x,translations:O,filteredData:k,activeIndex:b,setActiveIndex:w,setCurrentSelectedLabel:v}=t,y=U(null),[E,G]=X(null);p(()=>{y.current&&y.current.scrollToItem(b,"smart")},[b]),p(()=>{E&&h&&E&&h&&E.focus()},[E,h]),p(()=>{w(0)},[g]),te(S,()=>{!g&&a&&v(),f()},h,Y());const{bottom:P,left:T,top:N}=ee(I),{width:L}=Q(S),H=e=>({value:t})=>{x(""),e?a||C():j(t)},{hasBottomSpace:z}=oe({element:E,input:I}),A=ie({element:E,input:I});return ne(I,E,z),/* @__PURE__ */e(R,{children:h&&/* @__PURE__ */e("div",{className:"select__options",style:{left:T,width:L,...z||!A?{top:P}:{bottom:window.innerHeight-N+$}},ref:G,children:s?/* @__PURE__ */e(le,{}):/* @__PURE__ */e(R,{children:/* @__PURE__ */K("div",{"data-id":`${n}-options-content`,className:_("select__options__scroll","scrollbar"),children:[i?/* @__PURE__ */e("div",{className:"content-top",children:/* @__PURE__ */e(re,{size:"xsmall",type:"secondary",className:"content-top__label",children:i})}):null,k.length>0&&/* @__PURE__ */e(Z,{ref:y,height:k.length*d>D?D:k.length*d,itemCount:k.length,itemSize:d,width:u||ce,style:{width:u||"100%",overflowX:"hidden",overflowY:"auto",willChange:"auto"},children:({index:t,style:s})=>{const n=k[t],i=n.value===o,a=b===t;/* @__PURE__ */return e(J,{tooltipAddons:c,data:n,onClick:H(i),labelLeftIconProps:l,OptionRightIconComponent:m,LabelRightIconComponent:r,disabled:n.disabled,isSelected:i,dataId:n.dataId,style:s,className:_("option",{"option--active":a})},n.value)}}),0===k.length?/* @__PURE__ */e(se,{size:"small",mainMessage:null==O?void 0:O.emptyListMainMessage}):null]})})})})};export{ke as SelectDesktop};
@@ -1,5 +1,3 @@
1
- import{jsxs as m,jsx as e}from"react/jsx-runtime";import{OptionItem as R}from"../../../../helperComponents/OptionItem/OptionItem.js";import{Empty as E}from"../../../Empty/Empty.js";import{Modal as H}from"../../../Modal/Modal.js";import"react";import"classnames";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import{Text as O}from"../../../Text/Text.js";import"react-dom";import{ITEM_SIZE_MOBILE as T}from"../../constants.js";import"../../../Checkbox/Checkbox.js";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import"../../SharedComponents/ContentTop.js";import{Loading as k}from"../../SharedComponents/Loading.js";import"../../../Input/Input.js";import{MobileTopContent as D}from"./MobileTopContent.js";import{FixedSizeList as F}from"react-window";const re=o=>{const{translations:t,currentSelection:n,isOpen:i,closeDropdown:s,isLoading:a,dataId:r,innerHelperText:l,filteredData:p,isRequiredField:d,onItemSelect:c,onItemDeselect:h,tooltipAddons:u,labelLeftIconProps:C,optionRightIconComponent:I,labelRightIconComponent:j,withSearch:g,searchValue:S,setSearchValue:b}=o,f=e=>({value:o})=>{b(""),e?d||h():c(o)},x=window.innerHeight,w=window.innerWidth;/* @__PURE__ */
2
- return m(H,{isOpen:i,onClose:s,isMobileFullScreen:!0,children:[
1
+ import{jsxs as m,jsx as e}from"react/jsx-runtime";import{OptionItem as R}from"../../../../helperComponents/OptionItem/OptionItem.js";import{Empty as E}from"../../../Empty/Empty.js";import{Modal as H}from"../../../Modal/Modal.js";import"react";import"classnames";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import"react-hook-form";import{Text as O}from"../../../Text/Text.js";import"react-dom";import{ITEM_SIZE_MOBILE as T}from"../../constants.js";import"../../../Checkbox/Checkbox.js";import"motion/react";import"dayjs";import"../../../Collapse/CollapseGroup/CollapseGroup.js";import"../../SharedComponents/ContentTop.js";import{Loading as k}from"../../SharedComponents/Loading.js";import"../../../Input/Input.js";import{MobileTopContent as D}from"./MobileTopContent.js";import{FixedSizeList as F}from"react-window";const re=o=>{const{translations:t,currentSelection:n,isOpen:i,closeDropdown:s,isLoading:a,dataId:r,innerHelperText:l,filteredData:p,isRequiredField:d,onItemSelect:c,onItemDeselect:h,tooltipAddons:u,labelLeftIconProps:C,optionRightIconComponent:I,labelRightIconComponent:j,withSearch:g,searchValue:S,setSearchValue:b}=o,f=e=>({value:o})=>{b(""),e?d||h():c(o)},x=window.innerHeight,w=window.innerWidth;/* @__PURE__ */return m(H,{isOpen:i,onClose:s,isMobileFullScreen:!0,children:[
3
2
  /* @__PURE__ */e(D,{searchValue:S,setSearchValue:b,onBack:()=>{s(),b("")},withSearch:g,isOpen:i}),
4
- /* @__PURE__ */m("div",{className:"mobile_options_content",children:[l?/* @__PURE__ */e(O,{size:"xsmall",type:"secondary",className:"mobile_options_content__label",children:l}):null,a?/* @__PURE__ */e(k,{}):/* @__PURE__ */m("div",{"data-id":`${r}-options-content`,children:[p.length>0&&/* @__PURE__ */e(F,{height:x-30-32-24,itemCount:p.length,itemSize:T,width:w,style:{width:"100%",overflowX:"hidden",overflowY:"auto",willChange:"auto"},children:({index:o,style:t})=>{const i=p[o],s=i.value===n;/* @__PURE__ */
5
- return e(R,{size:"large",tooltipAddons:u,data:i,onClick:f(s),labelLeftIconProps:C,OptionRightIconComponent:I,LabelRightIconComponent:j,disabled:i.disabled,isSelected:s,dataId:i.dataId,style:t},i.value)}}),0===p.length?/* @__PURE__ */e(E,{size:"small",mainMessage:null==t?void 0:t.emptyListMainMessage}):null]})]})]})};export{re as SelectMobile};
3
+ /* @__PURE__ */m("div",{className:"mobile_options_content",children:[l?/* @__PURE__ */e(O,{size:"xsmall",type:"secondary",className:"mobile_options_content__label",children:l}):null,a?/* @__PURE__ */e(k,{}):/* @__PURE__ */m("div",{"data-id":`${r}-options-content`,children:[p.length>0&&/* @__PURE__ */e(F,{height:x-30-32-24,itemCount:p.length,itemSize:T,width:w,style:{width:"100%",overflowX:"hidden",overflowY:"auto",willChange:"auto"},children:({index:o,style:t})=>{const i=p[o],s=i.value===n;/* @__PURE__ */return e(R,{size:"large",tooltipAddons:u,data:i,onClick:f(s),labelLeftIconProps:C,OptionRightIconComponent:I,LabelRightIconComponent:j,disabled:i.disabled,isSelected:s,dataId:i.dataId,style:t},i.value)}}),0===p.length?/* @__PURE__ */e(E,{size:"small",mainMessage:null==t?void 0:t.emptyListMainMessage}):null]})]})]})};export{re as SelectMobile};
@@ -1,3 +1,2 @@
1
- import{jsx as t,jsxs as p,Fragment as f}from"react/jsx-runtime";import u from"classnames";import{Text as r}from"../../../../Text/Text.js";import x from"../../../../SVGIcons/IconChevronUp.js";import h from"../../../../SVGIcons/IconChevronDown.js";const z=e=>{const{type:s,buttonText:n,size:a="large",className:o="",isOpen:l,disabled:m,dataId:c="",onClick:i,refHandler:d=null,selectedItemsLabels:b}=e;/* @__PURE__ */
2
- return t("button",{type:"button",ref:d,"data-id":c,disabled:m,className:u("btn",`btn--${s}`,`btn--${a}`,`btn--${a}`,o),onClick:i,children:/* @__PURE__ */p(f,{children:[
1
+ import{jsx as t,jsxs as p,Fragment as f}from"react/jsx-runtime";import u from"classnames";import{Text as r}from"../../../../Text/Text.js";import x from"../../../../SVGIcons/IconChevronUp.js";import h from"../../../../SVGIcons/IconChevronDown.js";const z=e=>{const{type:s,buttonText:n,size:a="large",className:o="",isOpen:l,disabled:m,dataId:c="",onClick:i,refHandler:d=null,selectedItemsLabels:b}=e;/* @__PURE__ */return t("button",{type:"button",ref:d,"data-id":c,disabled:m,className:u("btn",`btn--${s}`,`btn--${a}`,`btn--${a}`,o),onClick:i,children:/* @__PURE__ */p(f,{children:[
3
2
  /* @__PURE__ */t(r,{className:"btn__text mr-4",type:b?"tertiary":"secondary",children:`${n}${b?" |":""}`}),b?/* @__PURE__ */t(r,{className:"btn__text ml-4 mr-4",children:b}):null,/* @__PURE__ */t(l?x:h,{size:"small"})]})})};export{z as Button};
@@ -1,5 +1,4 @@
1
- import{jsxs as r,jsx as l}from"react/jsx-runtime";import C from"react";import{Button as c}from"../../Button/Button.js";import{Checkbox as x}from"../../Checkbox/Checkbox.js";import{SELECT_TRANSLATIONS as s}from"../localization.js";const B=e=>{const{language:o,buttonProps:t,onApply:n,onCancel:i,hasChange:a=!0,checkboxInfo:m}=e,[u,d]=C.useState((null==m?void 0:m.isChecked)||!1),h={buttonText:s[o].confirmButtonText,...(null==t?void 0:t.confirm)||{}},p={buttonText:s[o].cancelButtonText,...(null==t?void 0:t.cancel)||{}};/* @__PURE__ */
2
- return r("div",{className:"select__footer",children:[
1
+ import{jsxs as r,jsx as l}from"react/jsx-runtime";import C from"react";import{Button as c}from"../../Button/Button.js";import{Checkbox as x}from"../../Checkbox/Checkbox.js";import{SELECT_TRANSLATIONS as s}from"../localization.js";const B=e=>{const{language:o,buttonProps:t,onApply:n,onCancel:i,hasChange:a=!0,checkboxInfo:m}=e,[u,d]=C.useState((null==m?void 0:m.isChecked)||!1),h={buttonText:s[o].confirmButtonText,...(null==t?void 0:t.confirm)||{}},p={buttonText:s[o].cancelButtonText,...(null==t?void 0:t.cancel)||{}};/* @__PURE__ */return r("div",{className:"select__footer",children:[
3
2
  /* @__PURE__ */l("div",{children:m?/* @__PURE__ */l(x,{label:m.label,selectedValue:u,onClick:d}):null}),
4
3
  /* @__PURE__ */r("div",{className:"select__footer__right flexbox",children:[
5
4
  /* @__PURE__ */l(c,{...p,type:"tertiary",size:"medium",className:"mr-12",onClick:i}),
@@ -1,3 +1,3 @@
1
- import{jsxs as A,jsx as n,Fragment as B}from"react/jsx-runtime";import{useRef as M,useCallback as T,useMemo as q}from"react";import F from"classnames";import{Input as G}from"../../../Input/Input.js";import{useGetElemSizes as H}from"../../../../hooks/useGetElemSizes.js";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import{useGetHasBottomSpace as P}from"../../../../hooks/useGetHasBottomSpace.js";import"react-hook-form";import{getStringWidth as _,setTranslationValue as E,noop as U}from"../../../../utils/helpers.js";import{useChangePositionsOnScroll as J}from"../../../../hooks/useChangePositionsOnScroll.js";import{MobileWrapper as K}from"../../MultiSelect/MobileWrapper.js";import{DesktopWrapper as Q}from"../../MultiSelect/DesktopWrapper.js";import X from"../../../SVGIcons/IconChevronUp.js";import Y from"../../../SVGIcons/IconChevronDown.js";const fe=e=>{const{isMobile:o,children:s,options:t,label:r,placeHolder:l,isRequiredField:i,labelAddons:a,disabled:p,className:c="",dropdownWidth:m,align:d="left",size:u="small",dropdownRef:f,setDropdownRef:h,containerRef:S,setIsOpen:j,isOpen:g,selectedValues:b,setContainerRef:I,overflowText:x,hasError:v,modalApplyButtonText:w,applySelectedItems:R,hideSelectedOptions:k=!1}=e,O=M(null),{width:C}=H(S),W=T(e=>_(e,14)>C-80,[C]),D=q(()=>{if(!b||!b.length)return"";const e=b.map(e=>e.label).join(", ");return W(e)?E(x||"",b.length):e},[t,b,W]),{hasBottomSpace:y}=P({element:f,input:O.current});return J(null==O?void 0:O.current,f,y),/* @__PURE__ */A("div",{className:F("select select--multi",c),ref:I,children:[
2
- /* @__PURE__ */n("div",{onClick:p?U:e=>{const o=null==e?void 0:e.target,s=null==o?void 0:o.getAttribute("class");e&&s&&(-1!==s.indexOf("icon-")||-1!==s.indexOf("svg-icon"))?(j(!g),e.preventDefault()):j(!0)},children:/* @__PURE__ */n(G,{readonly:!0,label:r,ref:O,hasError:v,className:"select__input",placeholder:l,required:i,currentValue:k?"":D,rightIconProps:{Component:g?X:Y,size:"small"},labelAddons:a,disabled:p,size:u})}),
3
- /* @__PURE__ */n(B,{children:o?/* @__PURE__ */n(K,{applySelectedItems:R,isOpen:g,closeDrodown:()=>j(!1),modalApplyButtonText:w,children:s}):/* @__PURE__ */n(Q,{setDropdownRef:h,isOpen:g,align:d,dropdownWidth:m,inputRef:O.current,dropdownRef:f,containerRef:S,children:s})})]})};export{fe as InputSelectWrapper};
1
+ import{jsxs as B,jsx as s,Fragment as M}from"react/jsx-runtime";import{useRef as q,useCallback as F,useMemo as h}from"react";import G from"classnames";import{Input as H}from"../../../Input/Input.js";import{useGetElemSizes as P}from"../../../../hooks/useGetElemSizes.js";import"../../../../consts/index.js";import"../../../../context/types.js";import"../../../../hooks/useScreenSize.js";import{useGetHasBottomSpace as _}from"../../../../hooks/useGetHasBottomSpace.js";import"react-hook-form";import{getStringWidth as E,setTranslationValue as U,noop as J}from"../../../../utils/helpers.js";import{useChangePositionsOnScroll as K}from"../../../../hooks/useChangePositionsOnScroll.js";import{MobileWrapper as Q}from"../../MultiSelect/MobileWrapper.js";import{DesktopWrapper as X}from"../../MultiSelect/DesktopWrapper.js";import Y from"../../../SVGIcons/IconChevronUp.js";import Z from"../../../SVGIcons/IconChevronDown.js";const he=e=>{const{isMobile:o,children:t,options:r,label:n,placeHolder:l,isRequiredField:i,labelAddons:a,disabled:p,className:c="",dropdownWidth:m,align:d="left",size:u="small",dropdownRef:f,setDropdownRef:S,containerRef:j,setIsOpen:g,isOpen:b,selectedValues:I,setContainerRef:v,overflowText:x,hasError:w,modalApplyButtonText:R,applySelectedItems:k,hideSelectedOptions:O=!1}=e,C=q(null),{width:W}=P(j),D=F(e=>E(e,14)>W-80,[W]),y=h(()=>{if(!I||!I.length)return"";const e=I.map(e=>e.label).join(", ");return D(e)?U(x||"",I.length):e},[r,I,D]),z=h(()=>I&&I.length>0?I.map(e=>e.label).join(", "):l&&D(l)?l:void 0,[I,l,D]),{hasBottomSpace:A}=_({element:f,input:C.current});return K(null==C?void 0:C.current,f,A),/* @__PURE__ */B("div",{className:G("select select--multi",c),ref:v,children:[
2
+ /* @__PURE__ */s("div",{onClick:p?J:e=>{const o=null==e?void 0:e.target,s=null==o?void 0:o.getAttribute("class");e&&s&&(-1!==s.indexOf("icon-")||-1!==s.indexOf("svg-icon"))?(g(!b),e.preventDefault()):g(!0)},children:/* @__PURE__ */s(H,{readonly:!0,label:n,ref:C,hasError:w,className:"select__input",placeholder:l,required:i,currentValue:O?"":y,rightIconProps:{Component:b?Y:Z,size:"small"},labelAddons:a,disabled:p,size:u,title:z})}),
3
+ /* @__PURE__ */s(M,{children:o?/* @__PURE__ */s(Q,{applySelectedItems:k,isOpen:b,closeDrodown:()=>g(!1),modalApplyButtonText:R,children:t}):/* @__PURE__ */s(X,{setDropdownRef:S,isOpen:b,align:d,dropdownWidth:m,inputRef:C.current,dropdownRef:f,containerRef:j,children:t})})]})};export{he as InputSelectWrapper};
@@ -1,2 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{Text as n}from"../../Text/Text.js";const e=e=>{const{loadingText:t="Results loading ..."}=e;/* @__PURE__ */
2
- return o("div",{style:{padding:20},children:/* @__PURE__ */o(n,{children:t})})};export{e as Loading};
1
+ import{jsx as o}from"react/jsx-runtime";import{Text as n}from"../../Text/Text.js";const e=e=>{const{loadingText:t="Results loading ..."}=e;/* @__PURE__ */return o("div",{style:{padding:20},children:/* @__PURE__ */o(n,{children:t})})};export{e as Loading};
@@ -1,5 +1,4 @@
1
- import{jsxs as i,jsx as s}from"react/jsx-runtime";import u,{useCallback as y}from"react";import{Button as t}from"../../Button/Button.js";import{Checkbox as C}from"../../Checkbox/Checkbox.js";const z=({isLoading:e,footerButtons:o,onClose:r,onSubmit:a,checkboxInfo:l})=>{const[n,c]=u.useState((null==l?void 0:l.isChecked)||!1),m=y(()=>{null==a||a(n)},[a,n]);if(!o)return null;const{extraButton:d,confirm:h,cancel:b}=o;/* @__PURE__ */
2
- return i("div",{className:"side-sheet__footer",children:[l?/* @__PURE__ */s("div",{className:"side-sheet__footer_checkbox",children:/* @__PURE__ */s(C,{label:l.label,selectedValue:n,onClick:c})}):null,
1
+ import{jsxs as i,jsx as s}from"react/jsx-runtime";import u,{useCallback as y}from"react";import{Button as t}from"../../Button/Button.js";import{Checkbox as C}from"../../Checkbox/Checkbox.js";const z=({isLoading:e,footerButtons:o,onClose:r,onSubmit:a,checkboxInfo:l})=>{const[n,c]=u.useState((null==l?void 0:l.isChecked)||!1),m=y(()=>{null==a||a(n)},[a,n]);if(!o)return null;const{extraButton:d,confirm:h,cancel:b}=o;/* @__PURE__ */return i("div",{className:"side-sheet__footer",children:[l?/* @__PURE__ */s("div",{className:"side-sheet__footer_checkbox",children:/* @__PURE__ */s(C,{label:l.label,selectedValue:n,onClick:c})}):null,
3
2
  /* @__PURE__ */i("div",{className:"side-sheet__footer_buttons",children:[d?/* @__PURE__ */s(t,{size:"large",type:"secondary",...o.extraButton,className:"mr-12"}):null,
4
3
  /* @__PURE__ */s(t,{type:"secondary",size:"large",className:"mr-12",onClick:r,...b}),
5
4
  /* @__PURE__ */s(t,{type:"primary",size:"large",onClick:m,disabled:e,...h})]})]})};export{z as Footer};
@@ -1,5 +1,4 @@
1
- import{jsx as i,jsxs as l}from"react/jsx-runtime";import{useState as f,useRef as P,useId as w,useEffect as F,useCallback as L}from"react";import{motion as _}from"motion/react";import $ from"classnames";import"../../consts/index.js";import"../../context/types.js";import{useOnOutsideClick as j}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import{useHideBodyScroll as D}from"../../hooks/useHideBodyScroll.js";import"react-hook-form";import{AnimatePresenceWrapper as H}from"../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js";import{Button as s}from"../Button/Button.js";import{Text as A}from"../Text/Text.js";import{useDispatchEventOnScroll as U}from"../../hooks/useDispatchEventOnScroll.js";import{Footer as W}from"./Footer/Footer.js";import q from"../SVGIcons/IconCaretUp.js";import G from"../SVGIcons/IconDismissFilled.js";const ae=e=>{const{size:t="small",isLoading:o,isOpen:r,onClose:a,onSubmit:n,title:c,position:m="right",shouldRemoveCallback:d,className:p="",headerButtons:h,footerButtons:u,scrollToTopOptions:k,children:y,closeOnOutsideClick:v=!0,checkboxInfo:x}=e,[C,S]=f(null),[b,g]=f(!1),N=P(null);j(C,a,r&&v,w(),d),D(r);const O=U();F(()=>{var e;if(r&&k){const s=e=>{O(),r&&g(e.currentTarget.scrollTop>k.onPixel)};null==(e=N.current)||e.addEventListener("scroll",s)}r||z()},[r,k]);const z=L(()=>{var e;g(!1),null==(e=N.current)||e.scrollTo({top:0,behavior:"smooth"})},[]),B="left"===m;/* @__PURE__ */
2
- return i(H,{children:r?/* @__PURE__ */i(_.div,{className:"side-sheet",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.1,delay:.3}},transition:{duration:.2},children:/* @__PURE__ */l(_.div,{initial:B?{left:"-100%"}:{right:"-100%"},animate:B?{left:0}:{right:0},exit:{...B?{left:"-100%"}:{right:"-100%"},transition:{duration:.5}},transition:{duration:.5},className:$("side-sheet__container",`side-sheet__${m}`,`side-sheet__container--${t}`,p),ref:S,children:[
1
+ import{jsx as i,jsxs as l}from"react/jsx-runtime";import{useState as f,useRef as P,useId as w,useEffect as F,useCallback as L}from"react";import{motion as _}from"motion/react";import $ from"classnames";import"../../consts/index.js";import"../../context/types.js";import{useOnOutsideClick as j}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import{useHideBodyScroll as D}from"../../hooks/useHideBodyScroll.js";import"react-hook-form";import{AnimatePresenceWrapper as H}from"../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js";import{Button as s}from"../Button/Button.js";import{Text as A}from"../Text/Text.js";import{useDispatchEventOnScroll as U}from"../../hooks/useDispatchEventOnScroll.js";import{Footer as W}from"./Footer/Footer.js";import q from"../SVGIcons/IconCaretUp.js";import G from"../SVGIcons/IconDismissFilled.js";const ae=e=>{const{size:t="small",isLoading:o,isOpen:r,onClose:a,onSubmit:n,title:c,position:m="right",shouldRemoveCallback:d,className:p="",headerButtons:h,footerButtons:u,scrollToTopOptions:k,children:y,closeOnOutsideClick:v=!0,checkboxInfo:x}=e,[C,S]=f(null),[b,g]=f(!1),N=P(null);j(C,a,r&&v,w(),d),D(r);const O=U();F(()=>{var e;if(r&&k){const s=e=>{O(),r&&g(e.currentTarget.scrollTop>k.onPixel)};null==(e=N.current)||e.addEventListener("scroll",s)}r||z()},[r,k]);const z=L(()=>{var e;g(!1),null==(e=N.current)||e.scrollTo({top:0,behavior:"smooth"})},[]),B="left"===m;/* @__PURE__ */return i(H,{children:r?/* @__PURE__ */i(_.div,{className:"side-sheet",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.1,delay:.3}},transition:{duration:.2},children:/* @__PURE__ */l(_.div,{initial:B?{left:"-100%"}:{right:"-100%"},animate:B?{left:0}:{right:0},exit:{...B?{left:"-100%"}:{right:"-100%"},transition:{duration:.5}},transition:{duration:.5},className:$("side-sheet__container",`side-sheet__${m}`,`side-sheet__container--${t}`,p),ref:S,children:[
3
2
  /* @__PURE__ */l("div",{className:"side-sheet__header",children:[
4
3
  /* @__PURE__ */l("div",{className:"side-sheet__header__left pr-16",children:[null!=h&&h.back?/* @__PURE__ */i(s,{size:"small",type:"tertiary",...h.back,className:"mr-8"}):null,
5
4
  /* @__PURE__ */i(A,{className:"side-sheet__title",weight:"bolder",lineHeight:"large",size:"medium",children:c})]}),
@@ -0,0 +1,3 @@
1
+ import { ReactElement } from 'react';
2
+ import { TSkeletonPropTypes } from './types';
3
+ export declare const Skeleton: (props: TSkeletonPropTypes) => ReactElement;
@@ -0,0 +1,4 @@
1
+ import{jsx as s}from"react/jsx-runtime";import v from"classnames";import{DEFAULT_VARIANT as g,DEFAULT_ANIMATION as y}from"./consts.js";const u=s=>{if(null!=s)return"number"==typeof s?`${s}px`:s},C=e=>{const{variant:a=g,animation:t=y,width:n,height:i,count:l=1,children:o,style:r,className:d="",dataId:c=""}=e,h=null!=o,m=l>1?l:1,p={...void 0!==n?{width:u(n)}:null,...void 0!==i?{height:u(i)}:null,...r},k=v("skeleton",`skeleton--${a}`,`skeleton--anim-${t}`,{"skeleton--has-children":h,"skeleton--auto-height":h&&void 0===i,"skeleton--auto-width":h&&void 0===n},d);if(h)/* @__PURE__ */
2
+ return s("span",{className:k,style:p,"data-id":c,children:/* @__PURE__ */s("span",{className:"skeleton__children","aria-hidden":"true",children:o})});if(1===m)/* @__PURE__ */
3
+ return s("span",{className:k,style:p,"data-id":c,role:"status","aria-label":"Loading"});const N=[];for(let e=0;e<m;e+=1)N.push(
4
+ /* @__PURE__ */s("span",{className:k,style:p,"data-id":c?`${c}-${e}`:"","aria-hidden":0!==e||void 0,role:0===e?"status":void 0,"aria-label":0===e?"Loading":void 0},e));/* @__PURE__ */return s("span",{className:"skeleton-group",children:N})};export{C as Skeleton};
@@ -0,0 +1,5 @@
1
+ import { TSkeletonAnimation, TSkeletonVariant } from './types';
2
+ export declare const SKELETON_VARIANTS: TSkeletonVariant[];
3
+ export declare const SKELETON_ANIMATIONS: TSkeletonAnimation[];
4
+ export declare const DEFAULT_VARIANT: TSkeletonVariant;
5
+ export declare const DEFAULT_ANIMATION: TSkeletonAnimation;
@@ -0,0 +1 @@
1
+ const t=["text","circular","rectangular","rounded"],A=["pulse","wave","none"],e="text",n="pulse";export{n as DEFAULT_ANIMATION,e as DEFAULT_VARIANT,A as SKELETON_ANIMATIONS,t as SKELETON_VARIANTS};
@@ -0,0 +1,2 @@
1
+ export * from './Skeleton';
2
+ export * from './types';
@@ -0,0 +1 @@
1
+ import{Skeleton as r}from"./Skeleton.js";export{r as Skeleton};
@@ -0,0 +1,24 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ export type TSkeletonVariant = 'text' | 'circular' | 'rectangular' | 'rounded';
3
+ export type TSkeletonAnimation = 'pulse' | 'wave' | 'none';
4
+ export interface TSkeletonPropTypes {
5
+ /** Visual shape of the placeholder. */
6
+ variant?: TSkeletonVariant;
7
+ /** Animation style. Pass `'none'` to disable. */
8
+ animation?: TSkeletonAnimation;
9
+ /** Width as a number (px) or any valid CSS length / percentage. */
10
+ width?: number | string;
11
+ /** Height as a number (px) or any valid CSS length / percentage. */
12
+ height?: number | string;
13
+ /** Render N stacked skeletons. Useful for placeholder paragraphs. */
14
+ count?: number;
15
+ /**
16
+ * If provided, the skeleton wraps the children and infers its size from them
17
+ * while the children remain invisible (used as a layout guide).
18
+ */
19
+ children?: ReactNode;
20
+ /** Inline style overrides applied to every rendered skeleton element. */
21
+ style?: CSSProperties;
22
+ className?: string;
23
+ dataId?: string;
24
+ }
File without changes
@@ -1,5 +1,4 @@
1
1
  import{jsx as s,jsxs as o}from"react/jsx-runtime";import{toast as m,ToastContainer as l,Slide as d}from"react-toastify";import{Text as c}from"../Text/Text.js";import{Button as u}from"../Button/Button.js";import{DEFAULT_DURATION as f,TYPE_MAPPING as C,ICONS_MAPPING as h}from"./consts.js";import{IconDynamicComponent as N}from"../../helperComponents/IconDynamicComponent/IconDynamicComponent.js";const g=({actionProps:t,toastId:a,type:n="information",text:e})=>/* @__PURE__ */o("div",{"data-id":`${n}-toast-message`,className:"snackbar",children:[
2
2
  /* @__PURE__ */o("div",{className:"snackbar__content",children:[
3
3
  /* @__PURE__ */s(N,{Component:h[n],type:C[n],size:"medium"}),
4
- /* @__PURE__ */s(c,{className:"snackbar__text pl-16 pr-8",type:"primary",size:"standard",weight:"regular",lineHeight:"large",children:e})]}),t?/* @__PURE__ */s(u,{size:"small",type:"tertiary",...t,onClick:s=>{var o;m.dismiss(a),null==(o=null==t?void 0:t.onClick)||o.call(t,s)}}):null]},a),I=t=>{const{toastId:s,closeSnackbar:o,actionProps:a,duration:n=f}=t;m(g(t),{className:"_container",toastId:s,autoClose:!a&&n}),m.onChange(t=>{"removed"===t.status&&(null==o||o(t.id))})},y=t=>{const{duration:o=1e3,position:a="bottom-center"}=t;/* @__PURE__ */
5
- return s(l,{className:"snackbar-wrapper",theme:"light",hideProgressBar:!0,transition:d,position:a,autoClose:o,closeButton:()=>null})};export{y as Snackbar,I as notify};
4
+ /* @__PURE__ */s(c,{className:"snackbar__text pl-16 pr-8",type:"primary",size:"standard",weight:"regular",lineHeight:"large",children:e})]}),t?/* @__PURE__ */s(u,{size:"small",type:"tertiary",...t,onClick:s=>{var o;m.dismiss(a),null==(o=null==t?void 0:t.onClick)||o.call(t,s)}}):null]},a),I=t=>{const{toastId:s,closeSnackbar:o,actionProps:a,duration:n=f}=t;m(g(t),{className:"_container",toastId:s,autoClose:!a&&n}),m.onChange(t=>{"removed"===t.status&&(null==o||o(t.id))})},y=t=>{const{duration:o=1e3,position:a="bottom-center"}=t;/* @__PURE__ */return s(l,{className:"snackbar-wrapper",theme:"light",hideProgressBar:!0,transition:d,position:a,autoClose:o,closeButton:()=>null})};export{y as Snackbar,I as notify};
@@ -1,4 +1,3 @@
1
- import{jsxs as i,jsx as e}from"react/jsx-runtime";import{Text as h}from"../Text/Text.js";import c from"classnames";var n=/* @__PURE__ */(s=>(s.large="standard",s.medium="small",s.small="xsmall",s))(n||{});const w=s=>{const{type:t="primary",size:a="large",text:l="",children:r,className:m="",leftIconProps:o,rightIconProps:u,withCircle:d=!0,withBackground:p=!1,dataId:x}=s;/* @__PURE__ */
2
- return i("div",{className:c(`status status--${a}`,m,{status__withBackground:p,[`status__withBackground--${t}`]:p}),children:[d?/* @__PURE__ */e("span",{className:c("status__circle","mr-6",{[`status__circle--${t}`]:!0})}):null,null!=o&&o.Component?/* @__PURE__ */e(o.Component,{size:"xsmall",type:t,className:"mr-6",...o}):null,
1
+ import{jsxs as i,jsx as e}from"react/jsx-runtime";import{Text as h}from"../Text/Text.js";import c from"classnames";var n=/* @__PURE__ */(s=>(s.large="standard",s.medium="small",s.small="xsmall",s))(n||{});const w=s=>{const{type:t="primary",size:a="large",text:l="",children:r,className:m="",leftIconProps:o,rightIconProps:u,withCircle:d=!0,withBackground:p=!1,dataId:x}=s;/* @__PURE__ */return i("div",{className:c(`status status--${a}`,m,{status__withBackground:p,[`status__withBackground--${t}`]:p}),children:[d?/* @__PURE__ */e("span",{className:c("status__circle","mr-6",{[`status__circle--${t}`]:!0})}):null,null!=o&&o.Component?/* @__PURE__ */e(o.Component,{size:"xsmall",type:t,className:"mr-6",...o}):null,
3
2
  /* @__PURE__ */i("div",{className:"status__label",children:[
4
3
  /* @__PURE__ */e(h,{className:"status__label-text",dataId:`${x}-text`,weight:p?"semibold":"regular",type:!d||p?t:"primary",size:n[a],children:l}),r]}),u]})};export{w as Status};
@@ -1,2 +1 @@
1
- import{jsx as x}from"react/jsx-runtime";import{useState as a,useEffect as l}from"react";const v=e=>{const{list:t,activeStep:s=0,setActiveStep:r}=e,[n,i]=a(s);l(()=>{s&&s!==n&&i(s)},[s,n]);const p=t[n];/* @__PURE__ */
2
- return x(p,{activeStepIndex:n,isNextDisabled:n===t.length-1,isPrevDisabled:0===n,prevHandler:()=>{let e=n;--e,i(e),r&&r(e)},nextHandler:()=>{let e=n;++e,i(e),r&&r(e)},stepCount:t.length})};export{v as Stepper};
1
+ import{jsx as x}from"react/jsx-runtime";import{useState as a,useEffect as l}from"react";const v=e=>{const{list:t,activeStep:s=0,setActiveStep:r}=e,[n,i]=a(s);l(()=>{s&&s!==n&&i(s)},[s,n]);const p=t[n];/* @__PURE__ */return x(p,{activeStepIndex:n,isNextDisabled:n===t.length-1,isPrevDisabled:0===n,prevHandler:()=>{let e=n;--e,i(e),r&&r(e)},nextHandler:()=>{let e=n;++e,i(e),r&&r(e)},stepCount:t.length})};export{v as Stepper};
@@ -1,5 +1,4 @@
1
- import{jsx as e,jsxs as h}from"react/jsx-runtime";import{forwardRef as k,useMemo as C}from"react";import p from"classnames";import{Label as y}from"../../helperComponents/Label/Label.js";const S=k((a,l)=>{const{onClick:s,id:r="",name:t,value:i,disabled:n,label:c,inlineType:o=!1,dataId:d,size:m="large",setFieldValue:b,selectedValue:w,className:_="",labelAddons:N,orientation:f="right",hasSpaceBetween:u=!0}=a,x=!!i||!!w,k=C(()=>/* @__PURE__ */e(y,{text:c,disabled:n,labelAddons:N,size:o?"standard":m,className:"switcher__label"}),[c,n,N,o,m]);/* @__PURE__ */
2
- return h("div",{className:p("switcher",{"switcher--inline":o,"switcher--space-between":u}),children:[c&&"right"===f&&k,
1
+ import{jsx as e,jsxs as h}from"react/jsx-runtime";import{forwardRef as k,useMemo as C}from"react";import p from"classnames";import{Label as y}from"../../helperComponents/Label/Label.js";const S=k((a,l)=>{const{onClick:s,id:r="",name:t,value:i,disabled:n,label:c,inlineType:o=!1,dataId:d,size:m="large",setFieldValue:b,selectedValue:w,className:_="",labelAddons:N,orientation:f="right",hasSpaceBetween:u=!0}=a,x=!!i||!!w,k=C(()=>/* @__PURE__ */e(y,{text:c,disabled:n,labelAddons:N,size:o?"standard":m,className:"switcher__label"}),[c,n,N,o,m]);/* @__PURE__ */return h("div",{className:p("switcher",{"switcher--inline":o,"switcher--space-between":u}),children:[c&&"right"===f&&k,
3
2
  /* @__PURE__ */h("label",{id:r,className:p("controller","controller--switch",`controller--switch-${m}`,_,{"controller--disabled":n}),children:[
4
3
  /* @__PURE__ */e("input",{"data-id":d,type:"checkbox",tabIndex:0,onChange:()=>{t&&b&&b(t,!x),s&&s(!x)},checked:x,disabled:n}),
5
4
  /* @__PURE__ */e("span",{className:"controller__icon",children:/* @__PURE__ */e("span",{className:"controller__icon__inner",children:/* @__PURE__ */e("span",{className:"controller__mark"})})})]}),c&&"left"===f&&k]})});S.displayName="Switcher";export{S as Switcher};
@@ -1,2 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{TabItem as m}from"./TabItem.js";import t from"classnames";const o=e=>{const{selectedValue:s,tabItems:l,onSelect:d,className:o,...r}=e;/* @__PURE__ */
2
- return a("div",{className:"tabs-container",children:/* @__PURE__ */a("div",{className:t("tabs-header-container",o),children:l.map(e=>/* @__PURE__ */a(m,{label:e.label,badgeProps:e.badgeProps,onClick:()=>d(e.value),val:e.value,isSelected:s===e.value,dataId:(null==e?void 0:e.dataId)||"",disabled:e.disabled,...r},e.value))})})};export{o as Tab};
1
+ import{jsx as a}from"react/jsx-runtime";import{TabItem as m}from"./TabItem.js";import t from"classnames";const o=e=>{const{selectedValue:s,tabItems:l,onSelect:d,className:o,...r}=e;/* @__PURE__ */return a("div",{className:"tabs-container",children:/* @__PURE__ */a("div",{className:t("tabs-header-container",o),children:l.map(e=>/* @__PURE__ */a(m,{label:e.label,badgeProps:e.badgeProps,onClick:()=>d(e.value),val:e.value,isSelected:s===e.value,dataId:(null==e?void 0:e.dataId)||"",disabled:e.disabled,...r},e.value))})})};export{o as Tab};
@@ -1,3 +1,2 @@
1
- import{jsxs as C,jsx as m}from"react/jsx-runtime";import{Badge as N}from"../Badge/Badge.js";import{noop as f}from"../../utils/helpers.js";import x from"classnames";const $=a=>{const{size:l="large",iconProps:s,badgeProps:e,label:o,className:n="",disabled:t=!1,isSelected:i,rightIconProps:c,val:r,onClick:d,dataId:p}=a;/* @__PURE__ */
2
- return C("div",{onClick:t?f:d,className:x("tab",{[`tab--${l}`]:l},{"tab--disabled":t},{"tab--selected":i},n),children:[null!=s&&s.Component?/* @__PURE__ */m(s.Component,{className:"tab__icon mr-8",size:""+("small"==l?"xsmall":"small"),...s}):null,
3
- /* @__PURE__ */m("span",{className:"tab__label","data-id":p,children:o}),null!=c&&c.Component?/* @__PURE__ */m(c.Component,{onClick:a=>{null!=c&&c.action&&(a.stopPropagation(),null==c||c.action(r))},className:"tab__icon ml-8",size:""+("small"==l?"xsmall":"small"),...c}):null,null!=e&&e.text?/* @__PURE__ */m(N,{className:"tab__badge ml-8",size:"small",type:"secondary",...e}):null]})};export{$ as TabItem};
1
+ import{jsxs as C,jsx as m}from"react/jsx-runtime";import{Badge as N}from"../Badge/Badge.js";import{noop as f}from"../../utils/helpers.js";import x from"classnames";const $=a=>{const{size:l="large",iconProps:s,badgeProps:e,label:o,className:n="",disabled:t=!1,isSelected:i,rightIconProps:c,val:r,onClick:d,dataId:p}=a;/* @__PURE__ */return C("div",{onClick:t?f:d,className:x("tab",{[`tab--${l}`]:l},{"tab--disabled":t},{"tab--selected":i},n),children:[null!=s&&s.Component?/* @__PURE__ */m(s.Component,{className:"tab__icon mr-8",size:"small"==l?"xsmall":"small",...s}):null,
2
+ /* @__PURE__ */m("span",{className:"tab__label","data-id":p,children:o}),null!=c&&c.Component?/* @__PURE__ */m(c.Component,{onClick:a=>{null!=c&&c.action&&(a.stopPropagation(),null==c||c.action(r))},className:"tab__icon ml-8",size:"small"==l?"xsmall":"small",...c}):null,null!=e&&e.text?/* @__PURE__ */m(N,{className:"tab__badge ml-8",size:"small",type:"secondary",...e}):null]})};export{$ as TabItem};
@@ -1,4 +1,2 @@
1
- import{jsx as t,jsxs as z}from"react/jsx-runtime";import c from"classnames";import{CHECKBOX_DEFAULT_WIDTH as x,calcColumnWidth as T,CHECKBOX_HEADER_ID as j}from"./utils.js";import{Text as v}from"../Text/Text.js";import o from"../SVGIcons/IconArrowDown.js";import B from"../SVGIcons/IconArrowUp.js";function L({headerGroup:e,tableWidth:r,withSelect:s,uniqueKey:i,fixedHeader:l=!1}){const{key:a,...d}=e.getHeaderGroupProps();/* @__PURE__ */
2
- return t("tr",{...d,className:c({fixed_header:l}),children:e.headers.map(({id:e,minWidth:l,maxWidth:a,width:d,widthInPercent:m,getHeaderProps:n,fixed:h,columnProps:f,render:u,isSorted:p,isSortedDesc:_,getSortByToggleProps:b},g,w)=>{var H;const I=e===j,N={width:I?x:T(m,r),left:!I&&s&&"left"===h?x:0,...!I&&l?{minWidth:l}:{},...!I&&a?{maxWidth:a}:{},...!I&&d?{width:d}:{}},{key:W,...D}=n(null!=f&&f.sortable?b():void 0);/* @__PURE__ */
3
- return t("th",{...D,className:c({fixed_column_left:"left"===h,fixed_column_right:"right"===h,fixed_checkbox:I&&"left"===(null==(H=w[g+1])?void 0:H.fixed),pointer:null==f?void 0:f.sortable}),style:N,children:/* @__PURE__ */z("div",{className:"flexbox align-items--center",children:[
1
+ import{jsx as t,jsxs as z}from"react/jsx-runtime";import c from"classnames";import{CHECKBOX_DEFAULT_WIDTH as x,calcColumnWidth as T,CHECKBOX_HEADER_ID as j}from"./utils.js";import{Text as v}from"../Text/Text.js";import o from"../SVGIcons/IconArrowDown.js";import B from"../SVGIcons/IconArrowUp.js";function L({headerGroup:e,tableWidth:r,withSelect:s,uniqueKey:i,fixedHeader:l=!1}){const{key:a,...d}=e.getHeaderGroupProps();/* @__PURE__ */return t("tr",{...d,className:c({fixed_header:l}),children:e.headers.map(({id:e,minWidth:l,maxWidth:a,width:d,widthInPercent:m,getHeaderProps:n,fixed:h,columnProps:f,render:u,isSorted:p,isSortedDesc:_,getSortByToggleProps:b},g,w)=>{var H;const I=e===j,N={width:I?x:T(m,r),left:!I&&s&&"left"===h?x:0,...!I&&l?{minWidth:l}:{},...!I&&a?{maxWidth:a}:{},...!I&&d?{width:d}:{}},{key:W,...D}=n(null!=f&&f.sortable?b():void 0);/* @__PURE__ */return t("th",{...D,className:c({fixed_column_left:"left"===h,fixed_column_right:"right"===h,fixed_checkbox:I&&"left"===(null==(H=w[g+1])?void 0:H.fixed),pointer:null==f?void 0:f.sortable}),style:N,children:/* @__PURE__ */z("div",{className:"flexbox align-items--center",children:[
4
2
  /* @__PURE__ */t(v,{weight:"bold",className:"table-header-title",children:u("Header")}),p&&_&&/* @__PURE__ */t(o,{size:"xsmall",className:"ml-4"}),p&&!_&&/* @__PURE__ */t(B,{size:"xsmall",className:"ml-4"}),!p&&(null==f?void 0:f.sortable)&&/* @__PURE__ */t(o,{size:"xsmall",className:"ml-4 unsorted__icon"})]})},`table_head_${i}_${g}`)})})}export{L as Header};
@@ -1,3 +1 @@
1
- import{jsx as x}from"react/jsx-runtime";import{useMemo as E}from"react";import l from"classnames";import{CHECKBOX_HEADER_ID as D,CHECKBOX_DEFAULT_WIDTH as H}from"./utils.js";function I({row:e,selectedFlatRows:o,withSelect:i,uniqueKey:t,handleRowClick:n}){const r=E(()=>o.find(l=>l.id===e.id),[o]),{key:s,...c}=e.getRowProps();/* @__PURE__ */
2
- return x("tr",{...c,className:l({selected:!!r}),onClick:()=>null==n?void 0:n(e.original),children:e.cells.map(({getCellProps:e,column:o,render:n},r,s)=>{var c;const d=o.id===D,{key:a,...f}=e();/* @__PURE__ */
3
- return x("td",{...f,style:{left:!d&&i&&"left"===(null==o?void 0:o.fixed)?H:0},className:l({fixed_column_left:"left"===(null==o?void 0:o.fixed),fixed_column_right:"right"===(null==o?void 0:o.fixed),fixed_checkbox:d&&"left"===(null==(c=s[r+1].column)?void 0:c.fixed)}),onClick:e=>{d&&e.stopPropagation(),f.onClick&&f.onClick(e)},children:n("Cell")},`table_cell_${t}_${r}`)})})}export{I as Row};
1
+ import{jsx as x}from"react/jsx-runtime";import{useMemo as E}from"react";import l from"classnames";import{CHECKBOX_HEADER_ID as D,CHECKBOX_DEFAULT_WIDTH as H}from"./utils.js";function I({row:e,selectedFlatRows:o,withSelect:i,uniqueKey:t,handleRowClick:n}){const r=E(()=>o.find(l=>l.id===e.id),[o]),{key:s,...c}=e.getRowProps();/* @__PURE__ */return x("tr",{...c,className:l({selected:!!r}),onClick:()=>null==n?void 0:n(e.original),children:e.cells.map(({getCellProps:e,column:o,render:n},r,s)=>{var c;const d=o.id===D,{key:a,...f}=e();/* @__PURE__ */return x("td",{...f,style:{left:!d&&i&&"left"===(null==o?void 0:o.fixed)?H:0},className:l({fixed_column_left:"left"===(null==o?void 0:o.fixed),fixed_column_right:"right"===(null==o?void 0:o.fixed),fixed_checkbox:d&&"left"===(null==(c=s[r+1].column)?void 0:c.fixed)}),onClick:e=>{d&&e.stopPropagation(),f.onClick&&f.onClick(e)},children:n("Cell")},`table_cell_${t}_${r}`)})})}export{I as Row};
@@ -1,5 +1,4 @@
1
- import{jsxs as u,jsx as s}from"react/jsx-runtime";import{useRef as W,useState as $,useId as j,useMemo as D,useCallback as T,useEffect as _}from"react";import{useTable as q,useSortBy as B,useRowSelect as F}from"react-table";import{setSelectedRows as G}from"./utils.js";import{Row as J}from"./Row.js";import{Header as K}from"./Header.js";import M from"classnames";import{useDispatchEventOnScroll as V}from"../../hooks/useDispatchEventOnScroll.js";import{Button as v}from"../Button/Button.js";import{TABLE_LOCALIZATION as Z}from"./localization.js";import{setTranslationValue as Q}from"../../utils/helpers.js";import U from"../SVGIcons/IconCheckmark.js";import X from"../SVGIcons/IconDismiss.js";function fe({columns:e,data:t,onChange:r,fixedHeader:o,withSelect:a=!1,handleRowClick:l,className:n,language:i="en",containerRefHandler:c,submitButtons:m}){const d=W(null),[p,f]=$(400),h=j(),w=V(),b=D(()=>{const t=e=>"left"===e.fixed,s=e=>"right"===e.fixed;return e.sort((e,r)=>t(e)&&!t(r)?-1:!t(e)&&t(r)||s(e)&&!s(r)?1:!s(e)&&s(r)?-1:0),[...e]},[e]),{getTableProps:g,getTableBodyProps:S,selectedFlatRows:x,headerGroups:y,rows:R,prepareRow:C,toggleAllRowsSelected:k,state:I}=q({columns:b,data:t},B,F,e=>G(e,a)),L=T(()=>{var e;d.current&&f(null==(e=d.current)?void 0:e.offsetWidth)},[d.current]);_(()=>{null==r||r(I)},[JSON.stringify(I)]),_(()=>{var e;return window.addEventListener("resize",L),d.current&&f(null==(e=d.current)?void 0:e.offsetWidth),()=>{window.removeEventListener("resize",L)}},[d.current]);const z=T(()=>{k(!1)},[]);/* @__PURE__ */
2
- return u("div",{ref:c,children:[a&&x.length>0&&/* @__PURE__ */u("div",{className:"table-wrapper__selected-rows",children:[
1
+ import{jsxs as u,jsx as s}from"react/jsx-runtime";import{useRef as W,useState as $,useId as j,useMemo as D,useCallback as T,useEffect as _}from"react";import{useTable as q,useSortBy as B,useRowSelect as F}from"react-table";import{setSelectedRows as G}from"./utils.js";import{Row as J}from"./Row.js";import{Header as K}from"./Header.js";import M from"classnames";import{useDispatchEventOnScroll as V}from"../../hooks/useDispatchEventOnScroll.js";import{Button as v}from"../Button/Button.js";import{TABLE_LOCALIZATION as Z}from"./localization.js";import{setTranslationValue as Q}from"../../utils/helpers.js";import U from"../SVGIcons/IconCheckmark.js";import X from"../SVGIcons/IconDismiss.js";function fe({columns:e,data:t,onChange:r,fixedHeader:o,withSelect:a=!1,handleRowClick:l,className:n,language:i="en",containerRefHandler:c,submitButtons:m}){const d=W(null),[p,f]=$(400),h=j(),w=V(),b=D(()=>{const t=e=>"left"===e.fixed,s=e=>"right"===e.fixed;return e.sort((e,r)=>t(e)&&!t(r)?-1:!t(e)&&t(r)||s(e)&&!s(r)?1:!s(e)&&s(r)?-1:0),[...e]},[e]),{getTableProps:g,getTableBodyProps:S,selectedFlatRows:x,headerGroups:y,rows:R,prepareRow:C,toggleAllRowsSelected:k,state:I}=q({columns:b,data:t},B,F,e=>G(e,a)),L=T(()=>{var e;d.current&&f(null==(e=d.current)?void 0:e.offsetWidth)},[d.current]);_(()=>{null==r||r(I)},[JSON.stringify(I)]),_(()=>{var e;return window.addEventListener("resize",L),d.current&&f(null==(e=d.current)?void 0:e.offsetWidth),()=>{window.removeEventListener("resize",L)}},[d.current]);const z=T(()=>{k(!1)},[]);/* @__PURE__ */return u("div",{ref:c,children:[a&&x.length>0&&/* @__PURE__ */u("div",{className:"table-wrapper__selected-rows",children:[
3
2
  /* @__PURE__ */s(v,{buttonText:Q(Z[i].n_selected||"",x.length),onClick:z,type:"tertiary",size:"medium",iconProps:{alignment:"left",Component:X}}),null==m?void 0:m.map(({buttonText:e,isLoading:t,onClick:r,iconProps:o})=>/* @__PURE__ */s(v,{iconProps:o||{alignment:"left",Component:U},onClick:e=>{r(e,I,z)},buttonText:e||"Submit",type:"secondary",size:"medium",className:"mr-8",isLoading:t}))]}),
4
3
  /* @__PURE__ */s("div",{onScroll:w,className:M("table-wrapper scrollbar scrollbar--horizontal scrollbar--vertical",n,{"table-row-clickable":!!l}),style:{maxHeight:null==o?void 0:o.y},children:/* @__PURE__ */u("table",{...g(),ref:d,children:[
5
4
  /* @__PURE__ */s("thead",{children:y.map((e,t)=>/* @__PURE__ */s(K,{withSelect:a,fixedHeader:!!o,headerGroup:e,tableWidth:p,uniqueKey:h},`table_head_${h}_${t}`))}),
@@ -1,3 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{IndeterminateCheckbox as r}from"./IndeterminateCheckbox.js";const u="selection",S=48;function E(e,t){t&&e.visibleColumns.push(e=>[{id:u,Header:({getToggleAllRowsSelectedProps:e,rows:t,state:o,toggleRowSelected:n})=>{const i=t.filter(e=>!("enableSelection"in e.original)||e.original.enableSelection),l=i.every(e=>o.selectedRowIds[e.id]),c=i.some(e=>o.selectedRowIds[e.id]);/* @__PURE__ */
2
- return s(r,{...e({checked:l,indeterminate:!l&&c,disabled:0===i.length}),onChange:e=>{const t=e.target.checked;i.forEach(e=>{n(e.id,t)})}})},Cell:({row:e})=>{const t="enableSelection"in e.original&&!e.original.enableSelection;/* @__PURE__ */
3
- return s(r,{...e.getToggleRowSelectedProps({disabled:t})})}},...e])}function R(e,t){return e*t/100}export{S as CHECKBOX_DEFAULT_WIDTH,u as CHECKBOX_HEADER_ID,R as calcColumnWidth,E as setSelectedRows};
1
+ import{jsx as s}from"react/jsx-runtime";import{IndeterminateCheckbox as r}from"./IndeterminateCheckbox.js";const u="selection",S=48;function E(e,t){t&&e.visibleColumns.push(e=>[{id:u,Header:({getToggleAllRowsSelectedProps:e,rows:t,state:o,toggleRowSelected:n})=>{const i=t.filter(e=>!("enableSelection"in e.original)||e.original.enableSelection),l=i.every(e=>o.selectedRowIds[e.id]),c=i.some(e=>o.selectedRowIds[e.id]);/* @__PURE__ */return s(r,{...e({checked:l,indeterminate:!l&&c,disabled:0===i.length}),onChange:e=>{const t=e.target.checked;i.forEach(e=>{n(e.id,t)})}})},Cell:({row:e})=>{const t="enableSelection"in e.original&&!e.original.enableSelection;/* @__PURE__ */return s(r,{...e.getToggleRowSelectedProps({disabled:t})})}},...e])}function R(e,t){return e*t/100}export{S as CHECKBOX_DEFAULT_WIDTH,u as CHECKBOX_HEADER_ID,R as calcColumnWidth,E as setSelectedRows};
@@ -1,5 +1,4 @@
1
- import{jsxs as i,jsx as t}from"react/jsx-runtime";import{flexRender as g}from"@tanstack/react-table";import{useSortable as u}from"@dnd-kit/sortable";import x from"../SVGIcons/IconArrowDown.js";import f from"../SVGIcons/IconArrowSort.js";import d from"../SVGIcons/IconArrowUp.js";import{Text as p}from"../Text/Text.js";import z from"classnames";function H({header:e,pinnedStyles:o}){const{attributes:n,listeners:s,setNodeRef:r,transform:a,transition:l,isDragging:c}=u({id:e.id}),m=a?{transform:`translate3d(${a.x}px, ${a.y}px, 0)`,transition:l,minWidth:e.getSize(),position:"relative",zIndex:c?1:0}:{minWidth:e.getSize(),position:"relative",zIndex:c?1:0};/* @__PURE__ */
2
- return i("th",{ref:r,style:{...m,...o},className:z("select-none",{"with-checkbox":"select"===e.column.id,"actions-header":"actions"===e.column.id,"cursor-pointer":e.column.getCanSort()}),...n,children:[
1
+ import{jsxs as i,jsx as t}from"react/jsx-runtime";import{flexRender as g}from"@tanstack/react-table";import{useSortable as u}from"@dnd-kit/sortable";import x from"../SVGIcons/IconArrowDown.js";import f from"../SVGIcons/IconArrowSort.js";import d from"../SVGIcons/IconArrowUp.js";import{Text as p}from"../Text/Text.js";import z from"classnames";function H({header:e,pinnedStyles:o}){const{attributes:n,listeners:s,setNodeRef:r,transform:a,transition:l,isDragging:c}=u({id:e.id}),m=a?{transform:`translate3d(${a.x}px, ${a.y}px, 0)`,transition:l,minWidth:e.getSize(),position:"relative",zIndex:c?1:0}:{minWidth:e.getSize(),position:"relative",zIndex:c?1:0};/* @__PURE__ */return i("th",{ref:r,style:{...m,...o},className:z("select-none",{"with-checkbox":"select"===e.column.id,"actions-header":"actions"===e.column.id,"cursor-pointer":e.column.getCanSort()}),...n,children:[
3
2
  /* @__PURE__ */i("div",{onClick:e.column.getToggleSortingHandler(),className:"flexbox align-items--center",children:[
4
3
  /* @__PURE__ */t("div",{...s,children:/* @__PURE__ */t(p,{className:"text-left",weight:"bold",children:g(e.column.columnDef.header,e.getContext())})}),
5
4
  /* @__PURE__ */t("span",{className:"ml-4",children:e.column.getCanSort()&&("asc"===e.column.getIsSorted()?/* @__PURE__ */t(d,{size:"xsmall"}):"desc"===e.column.getIsSorted()?/* @__PURE__ */t(x,{size:"xsmall"}):/* @__PURE__ */t(f,{size:"xsmall"}))})]}),
@@ -1,8 +1,6 @@
1
- import{jsxs as n,jsx as i}from"react/jsx-runtime";import{useState as d}from"react";import{Button as h}from"../Button/Button.js";import _ from"../SVGIcons/IconSettings.js";import{Switcher as a}from"../Switcher/Switcher.js";import{Menu as b}from"../Menu/Menu.js";import"react-dom";import{Positions as v}from"../Tooltip/types.js";import"../../consts/index.js";import"../../context/types.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import"classnames";import"motion/react";import"dayjs";import"../Collapse/CollapseGroup/CollapseGroup.js";import"../../helperComponents/ErrorMessage/consts.js";import"../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import{Tooltip as y}from"../Tooltip/Tooltip.js";import"../Checkbox/Checkbox.js";const N=["select","actions","expand"];function q({table:e,tooltipText:o,hiddenColumns:t=[],allToggleText:s="All"}){const[l,r]=d(null),[c,m]=d(!1),p=N.concat(t);/* @__PURE__ */
2
- return n("div",{ref:r,children:[
1
+ import{jsxs as n,jsx as i}from"react/jsx-runtime";import{useState as d}from"react";import{Button as h}from"../Button/Button.js";import _ from"../SVGIcons/IconSettings.js";import{Switcher as a}from"../Switcher/Switcher.js";import{Menu as b}from"../Menu/Menu.js";import"react-dom";import{Positions as v}from"../Tooltip/types.js";import"../../consts/index.js";import"../../context/types.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import"classnames";import"motion/react";import"dayjs";import"../Collapse/CollapseGroup/CollapseGroup.js";import"../../helperComponents/ErrorMessage/consts.js";import"../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import{Tooltip as y}from"../Tooltip/Tooltip.js";import"../Checkbox/Checkbox.js";const N=["select","actions","expand"];function q({table:e,tooltipText:o,hiddenColumns:t=[],allToggleText:s="All"}){const[l,r]=d(null),[c,m]=d(!1),p=N.concat(t);/* @__PURE__ */return n("div",{ref:r,children:[
3
2
  /* @__PURE__ */i(h,{type:"secondary",iconProps:{Component:_},onClick:()=>m(e=>!e)}),
4
3
  /* @__PURE__ */i(b,{className:"settings-menu",position:"top-left",onClose:()=>{m(!1)},isOpen:c,parentRef:l,children:/* @__PURE__ */n("div",{className:"settings-menu__dropdown",children:[
5
4
  /* @__PURE__ */i("div",{className:"relative",children:/* @__PURE__ */i("div",{className:"settings-menu__dropdown__option sticky",children:/* @__PURE__ */i(a,{label:s,selectedValue:e.getIsAllColumnsVisible(),onClick:()=>e.toggleAllColumnsVisible(),inlineType:!0,size:"small"})})}),
6
- /* @__PURE__ */i("div",{className:"scrollbar--content scrollbar scrollbar--vertical",children:e.getAllLeafColumns().map(e=>{if(null==p||!p.includes(e.id)){const t="string"==typeof e.columnDef.header?e.columnDef.header:e.columnDef.id;/* @__PURE__ */
7
- return n("div",{className:"settings-menu__dropdown__option",children:[o&&!e.getCanHide()&&/* @__PURE__ */i(y,{position:v.TOP_CENTER,text:o,id:e.columnDef.id}),
5
+ /* @__PURE__ */i("div",{className:"scrollbar--content scrollbar scrollbar--vertical",children:e.getAllLeafColumns().map(e=>{if(null==p||!p.includes(e.id)){const t="string"==typeof e.columnDef.header?e.columnDef.header:e.columnDef.id;/* @__PURE__ */return n("div",{className:"settings-menu__dropdown__option",children:[o&&!e.getCanHide()&&/* @__PURE__ */i(y,{position:v.TOP_CENTER,text:o,id:e.columnDef.id}),
8
6
  /* @__PURE__ */i(a,{label:t,id:e.columnDef.id,selectedValue:e.getIsVisible(),onClick:()=>(e=>{const o=e.getToggleVisibilityHandler();o&&o({target:{checked:!e.getIsVisible()}})})(e),disabled:!e.getCanHide(),inlineType:!0,size:"small"})]},e.id)}})})]})})]})}export{q as ColumnSettings};
@@ -1,2 +1,2 @@
1
- import{jsx as c}from"react/jsx-runtime";import{forwardRef as m,useRef as f,useEffect as d}from"react";import{Checkbox as h}from"../Checkbox/Checkbox.js";import u from"classnames";const x=m(({indeterminate:e,checked:a,onChange:t,disabled:s},r)=>{const o=f(null),i=r??o;d(()=>{i.current.indeterminate=e},[i,e]);/* @__PURE__ */
2
- return c("div",{className:"actions-list",children:/* @__PURE__ */c(h,{className:u("actions-list__checkbox",{"active-checkbox":a}),value:a,disabled:s,onClick:e=>{t({target:{checked:e}})},ref:i})})});x.displayName="IndeterminateCheckbox";export{x as IndeterminateCheckbox};
1
+ import{jsx as c}from"react/jsx-runtime";import{forwardRef as m,useRef as f,useEffect as d}from"react";import{Checkbox as h}from"../Checkbox/Checkbox.js";import u from"classnames";const x=m(({indeterminate:e,checked:a,onChange:t,disabled:s},r)=>{const o=f(null),i=r??o;/* @__PURE__ */
2
+ return d(()=>{i.current.indeterminate=e},[i,e]),c("div",{className:"actions-list",children:/* @__PURE__ */c(h,{className:u("actions-list__checkbox",{"active-checkbox":a}),value:a,disabled:s,onClick:e=>{t({target:{checked:e}})},ref:i})})});x.displayName="IndeterminateCheckbox";export{x as IndeterminateCheckbox};