hrm_ui_lib 0.0.1-beta.2 → 0.0.1-beta.21

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 (67) hide show
  1. package/assets/styles/styles.css +1 -1
  2. package/components/Avatar/Avatar.d.ts +1 -1
  3. package/components/Avatar/Avatar.js +2 -1
  4. package/components/Avatar/types.d.ts +1 -0
  5. package/components/Copy/Copy.js +1 -1
  6. package/components/DarkModeSwitcher/DarkModeSwitcher.d.ts +10 -2
  7. package/components/DarkModeSwitcher/DarkModeSwitcher.js +5 -6
  8. package/components/DatePicker/CustomHeader/CustomHeader.js +5 -5
  9. package/components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js +5 -5
  10. package/components/DatePicker/SimpleDatePicker/SimpleDatePickerMobile.js +3 -3
  11. package/components/DatePicker/TimePicker/MobileModalContent.js +2 -2
  12. package/components/FileUpload/DropzoneFileUpload/PreviewItem.js +2 -2
  13. package/components/FileUpload/DropzoneFileUpload/helpers.js +1 -1
  14. package/components/LineChart/LineChart.d.ts +3 -0
  15. package/components/LineChart/LineChart.js +9 -0
  16. package/components/LineChart/index.d.ts +2 -0
  17. package/components/LineChart/index.js +1 -0
  18. package/components/LineChart/types.d.ts +14 -0
  19. package/components/LineChart/types.js +0 -0
  20. package/components/Link/Link.js +2 -2
  21. package/components/Link/types.d.ts +3 -0
  22. package/components/Menu/Menu.js +3 -3
  23. package/components/Menu/NestedMenu.js +3 -3
  24. package/components/Modal/Modal.js +2 -1
  25. package/components/Modal/ModalConfirmation.js +3 -2
  26. package/components/Popover/PopoverMobile.js +2 -2
  27. package/components/SVGIcons/IconBudgetTransfer.d.ts +4 -0
  28. package/components/SVGIcons/IconBudgetTransfer.js +7 -0
  29. package/components/SVGIcons/IconMoon.js +1 -1
  30. package/components/SVGIcons/IconRibbon.d.ts +4 -0
  31. package/components/SVGIcons/IconRibbon.js +1 -0
  32. package/components/SVGIcons/IconSun.js +10 -10
  33. package/components/SVGIcons/IconVacation.d.ts +4 -0
  34. package/components/SVGIcons/IconVacation.js +1 -0
  35. package/components/Select/FilterSelect/FilterSelect.js +4 -4
  36. package/components/Select/MultiSelect/MobileWrapper.js +2 -2
  37. package/components/Select/MultiSelect/MultiBase/MultiBase.js +4 -4
  38. package/components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js +7 -7
  39. package/components/Select/MultiSelect/MultiSelectWithTabs/MultiSelectWithTabs.js +7 -7
  40. package/components/Select/Select/Select.js +1 -1
  41. package/components/Select/Select/SelectMobile/MobileTopContent.d.ts +2 -1
  42. package/components/Select/Select/SelectMobile/MobileTopContent.js +2 -2
  43. package/components/Select/Select/SelectMobile/index.js +2 -2
  44. package/components/Select/Select/helpers.d.ts +1 -1
  45. package/components/Select/Select/helpers.js +1 -1
  46. package/components/Select/SharedComponents/InputSelectWrapper/InputSelectWrapper.js +3 -3
  47. package/components/Skeleton/Skeleton.d.ts +3 -0
  48. package/components/Skeleton/Skeleton.js +5 -0
  49. package/components/Skeleton/consts.d.ts +5 -0
  50. package/components/Skeleton/consts.js +1 -0
  51. package/components/Skeleton/index.d.ts +2 -0
  52. package/components/Skeleton/index.js +1 -0
  53. package/components/Skeleton/types.d.ts +24 -0
  54. package/components/Skeleton/types.js +0 -0
  55. package/components/Snackbar/Snackbar.d.ts +0 -1
  56. package/components/Snackbar/Snackbar.js +3 -3
  57. package/components/TableV2/AdvancedPagination.js +1 -1
  58. package/components/Tooltip/Tooltip.js +2 -1
  59. package/consts/index.d.ts +1 -2
  60. package/consts/index.js +1 -1
  61. package/helpers/current-week-work-days-range.d.ts +1 -0
  62. package/helpers/current-week-work-days-range.js +1 -0
  63. package/helpers/format-date.d.ts +3 -0
  64. package/helpers/format-date.js +1 -1
  65. package/package.json +1 -1
  66. package/utils/helpers.d.ts +2 -1
  67. package/utils/helpers.js +1 -1
@@ -1,3 +1,3 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { TAvatarProps } from './types';
3
- export declare const Avatar: ({ dataId, id, color, size, type, imagePath, initials, className, isEditable, allowedTypes, onError, fileAllowedSize, onAvatarChange }: TAvatarProps) => ReactElement;
3
+ export declare const Avatar: ({ dataId, id, color, size, type, imagePath, initials, className, isEditable, allowedTypes, onError, fileAllowedSize, onAvatarChange, onAvatarClick }: TAvatarProps) => ReactElement;
@@ -1 +1,2 @@
1
- import{jsxs as F,jsx as U}from"react/jsx-runtime";import{useState as $,useEffect as x}from"react";import w from"classnames";import{FileUpload as I}from"../FileUpload/FileUpload.js";import"../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import{FileUploadMode as L}from"../FileUpload/types.js";const O=({dataId:a,id:e,color:l="default",size:i="medium",type:o,imagePath:t="",initials:r="",className:s="",isEditable:d=!1,allowedTypes:p=".png, .jpg, .jpeg, image/jpeg, image/png, image/jpg",onError:m,fileAllowedSize:n,onAvatarChange:g})=>{const[c,j]=$(t),u={backgroundImage:c?`url(${c})`:"none"};return x(()=>{j(t)},[t]),/* @__PURE__ */F("div",{id:e,"data-id":a,className:w(`avatar avatar--${l} avatar--${o} avatar--${i}`,s,{"avatar--image":c,"avatar--edit":d}),style:u,children:[c?null:r,d&&/* @__PURE__ */U(I,{onError:m,fileAllowedSize:n,multiple:!1,withFilePreview:!1,getFiles:a=>{a&&a[0]&&(j(URL.createObjectURL(a[0])),null==g||g(a[0]))},allowedTypes:p,mode:L.edit})]})};export{O as Avatar};
1
+ import{jsxs as x,jsx as o}from"react/jsx-runtime";import{useState as N,useEffect as k}from"react";import s from"classnames";import{FileUpload as w}from"../FileUpload/FileUpload.js";import"../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import{FileUploadMode as I}from"../FileUpload/types.js";const S=({dataId:a,id:e,color:l="default",size:i="medium",type:t,imagePath:r="",initials:d="",className:p="",isEditable:m=!1,allowedTypes:n=".png, .jpg, .jpeg, image/jpeg, image/png, image/jpg",onError:c,fileAllowedSize:g,onAvatarChange:v,onAvatarClick:j})=>{const[u,f]=N(r),F={backgroundImage:u?`url(${u})`:"none"};return k(()=>{f(r)},[r]),/* @__PURE__ */x("div",{id:e,"data-id":a,className:s(`avatar avatar--${l} avatar--${t} avatar--${i}`,p,{"avatar--edit":m}),children:[
2
+ /* @__PURE__ */o("div",{className:s({"avatar--image":u}),onClick:j,style:F}),u?null:d,m&&/* @__PURE__ */o(w,{onError:c,fileAllowedSize:g,multiple:!1,withFilePreview:!1,getFiles:a=>{a&&a[0]&&(f(URL.createObjectURL(a[0])),null==v||v(a[0]))},allowedTypes:n,mode:I.edit})]})};export{S as Avatar};
@@ -15,6 +15,7 @@ export interface TAvatarProps extends IFormCompProps {
15
15
  tooltipContent?: string | ReactElement;
16
16
  onError?: (type: FILE_UPLOAD_ERRORS) => void;
17
17
  fileAllowedSize?: number;
18
+ onAvatarClick?: () => void;
18
19
  }
19
20
  export interface TAvatarGroupProps {
20
21
  dataId?: string;
@@ -1,3 +1,3 @@
1
1
  import{jsxs as l,jsx as e}from"react/jsx-runtime";import{useState as m,useRef as a}from"react";import{Button as f}from"../Button/Button.js";import{Popover as u}from"../Popover/Popover.js";import y from"../SVGIcons/IconCopy.js";const P=({textAfterCopy:o,className:t="",text:r,dataId:s})=>{const[i,n]=m(!1),p=a(null);/* @__PURE__ */
2
2
  return l("div",{ref:p,className:"copy-icon",children:[
3
- /* @__PURE__ */e(f,{dataId:s,type:"tertiary",iconProps:{Component:y},size:"small",className:t,onClick:o=>{o.stopPropagation(),navigator.clipboard.writeText(r),n(!0),setTimeout(()=>n(!1),3e3)}}),i?/* @__PURE__ */e(u,{clicked:!0,elemRef:p.current,text:o||"Copied",position:"top-center"}):null]})};export{P as Copy};
3
+ /* @__PURE__ */e(f,{dataId:s,type:"tertiary",iconProps:{Component:y},size:"small",className:t,onClick:o=>{o.stopPropagation(),navigator.clipboard.writeText(r),n(!0),setTimeout(()=>n(!1),1e3)}}),i?/* @__PURE__ */e(u,{clicked:!0,elemRef:p.current,text:o||"Copied",position:"top-center"}):null]})};export{P as Copy};
@@ -1,3 +1,11 @@
1
1
  import React from 'react';
2
- import { TSwitcherProps } from './types';
3
- export declare const DarkModeSwitcher: React.ForwardRefExoticComponent<TSwitcherProps & React.RefAttributes<unknown>>;
2
+ type DarkModeSwitcherProps = {
3
+ checked: boolean;
4
+ onChange: (checked: boolean) => void;
5
+ disabled?: boolean;
6
+ id?: string;
7
+ name?: string;
8
+ className?: string;
9
+ };
10
+ export declare const DarkModeSwitcher: React.ForwardRefExoticComponent<DarkModeSwitcherProps & React.RefAttributes<HTMLInputElement>>;
11
+ export {};
@@ -1,6 +1,5 @@
1
- import{jsx as e,jsxs as n}from"react/jsx-runtime";import{forwardRef as y,useMemo as z}from"react";import w from"classnames";import{Label as S}from"../../helperComponents/Label/Label.js";import C from"../SVGIcons/IconMoon.js";import I from"../SVGIcons/IconSun.js";const M=y((a,s)=>{const{onClick:l,id:r="",name:o,value:t,disabled:i,label:c,inlineType:d=!1,dataId:m,size:h="small",setFieldValue:p,selectedValue:b,className:f="",labelAddons:k,orientation:u="right",hasSpaceBetween:x=!0}=a,_=!!t||!!b,M=z(()=>/* @__PURE__ */e(S,{text:c,disabled:i,labelAddons:k,size:d?"standard":h,className:"switcher__label"}),[c,i,k,d,h]),N="small"===h?"xsmall":"small";/* @__PURE__ */
2
- return n("div",{className:w("dark-mode-switcher",{"dark-mode-switcher--inline":d,"dark-mode-switcher--space-between":x}),children:[c&&"right"===u&&M,
3
- /* @__PURE__ */n("label",{id:r,className:w("controller","controller--switch",`controller--switch-${h}`,f,{"controller--disabled":i}),children:[
4
- /* @__PURE__ */e("input",{"data-id":m,type:"checkbox",tabIndex:0,onChange:()=>{o&&p&&p(o,!_),l&&l(!_)},checked:_,disabled:i}),
5
- /* @__PURE__ */n("span",{className:"controller__icon",children:[/* @__PURE__ */e(b?I:C,{type:"warning",size:N}),
6
- /* @__PURE__ */e("span",{className:"controller__icon__inner"})]})]}),c&&"left"===u&&M]})});M.displayName="DarkModeSwitcher";export{M as DarkModeSwitcher};
1
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import{forwardRef as _}from"react";import i from"classnames";import d from"../SVGIcons/IconMoon.js";import p from"../SVGIcons/IconSun.js";const w=_(({checked:s,onChange:a,disabled:c=!1,id:t="dark-mode-switcher",name:m,className:r},h)=>/* @__PURE__ */e("label",{className:i("theme-switch",r,{"is-disabled":c}),htmlFor:t,children:/* @__PURE__ */l("span",{className:i("theme-switch__track",{"is-checked":s}),children:[
2
+ /* @__PURE__ */e("span",{className:"theme-switch__icon theme-switch__icon--sun","aria-hidden":"true",children:/* @__PURE__ */e(p,{size:"xsmall"})}),
3
+ /* @__PURE__ */e("input",{ref:h,id:t,name:m,type:"checkbox",checked:s,disabled:c,onChange:e=>{c||a(e.target.checked)},className:"theme-switch__input"}),
4
+ /* @__PURE__ */e("span",{className:"theme-switch__thumb","aria-hidden":"true"}),
5
+ /* @__PURE__ */e("span",{className:"theme-switch__icon theme-switch__icon--moon","aria-hidden":"true",children:/* @__PURE__ */e(d,{size:"xsmall"})})]})}));w.displayName="DarkModeSwitcher";export{w as DarkModeSwitcher};
@@ -1,7 +1,7 @@
1
- import{jsxs as p,jsx as r}from"react/jsx-runtime";import"../../Select/Select/Select.js";import"../../Select/MultiSelect/MultiSelect.js";import"react";import"../../Input/Input.js";import"classnames";import{noop as d,getYearOptions as N}from"../../../utils/helpers.js";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"../../../helperComponents/ErrorMessage/consts.js";import"../../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import"../../Checkbox/Checkbox.js";import{ButtonSelect as h}from"../../Select/ButtonSelect/ButtonSelect.js";import C from"../../SVGIcons/IconChevronLeft.js";import S from"../../SVGIcons/IconChevronRight.js";import{generateMonthOptions as Y}from"./helpers.js";const J=e=>{const{date:t,dataPrefix:o,changeYear:s,changeMonth:l,decreaseMonth:a,increaseMonth:i,startYear:n,endYear:c,prevMonthButtonDisabled:m,nextMonthButtonDisabled:u,locale:f,isMobile:j=!1}=e,I=Y(f),x=null==t?void 0:t.getMonth(),b=null==t?void 0:t.getFullYear();/* @__PURE__ */
2
- return p("div",{className:"flexbox custom_header_container",children:[
1
+ import{jsxs as c,jsx as r}from"react/jsx-runtime";import"../../Select/Select/Select.js";import"../../Select/MultiSelect/MultiSelect.js";import"react";import"../../Input/Input.js";import"classnames";import{noop as d,getYearOptions as N}from"../../../utils/helpers.js";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"../../../helperComponents/ErrorMessage/consts.js";import"../../FileUpload/DropzoneFileUpload/DropzoneFileUpload.js";import"react-dom";import"../../Checkbox/Checkbox.js";import{ButtonSelect as h}from"../../Select/ButtonSelect/ButtonSelect.js";import C from"../../SVGIcons/IconChevronLeft.js";import S from"../../SVGIcons/IconChevronRight.js";import{generateMonthOptions as Y}from"./helpers.js";const K=e=>{const{date:t,dataPrefix:o,changeYear:s,changeMonth:l,decreaseMonth:a,increaseMonth:i,startYear:n,endYear:p,prevMonthButtonDisabled:m,nextMonthButtonDisabled:u,locale:f,isMobile:j=!1}=e,I=Y(f),x=null==t?void 0:t.getMonth(),b=null==t?void 0:t.getFullYear();/* @__PURE__ */
2
+ return c("div",{className:"flexbox custom_header_container",children:[
3
3
  /* @__PURE__ */r(C,{size:"small",className:"cursor-pointer",dataId:o?`${o}-prev-month-button`:"",onClick:m?d:a,type:m?"disabled":"primary"}),
4
- /* @__PURE__ */p("div",{className:"selects_container",children:[
4
+ /* @__PURE__ */c("div",{className:"selects_container",children:[
5
5
  /* @__PURE__ */r(h,{size:"small",type:"tertiary",className:"date_picker_select",offsets:j?{}:{top:42,left:48},placeHolder:(e=>{const t=I.find(t=>t.value===e);return null==t?void 0:t.label.toString()})(x),dataId:o?`${o}-month-select`:"",options:I,selectedItem:x,setSelectedItem:e=>l(e),dropdownWidth:150,isRequiredField:!0}),
6
- /* @__PURE__ */r(h,{type:"tertiary",className:"date_picker_select",offsets:j?{}:{top:42,left:138},placeHolder:b.toString(),dataId:o?`${o}-year-select`:"",size:"small",options:N(n,c),selectedItem:b,setSelectedItem:e=>s(e),dropdownWidth:100,isRequiredField:!0})]}),
7
- /* @__PURE__ */r(S,{size:"small",className:"cursor-pointer",dataId:o?`${o}-next-month-button`:"",onClick:u?d:i,type:u?"disabled":"primary"})]})};export{J as CustomHeader};
6
+ /* @__PURE__ */r(h,{type:"tertiary",className:"date_picker_select",offsets:j?{}:{top:42,left:138},placeHolder:b.toString(),dataId:o?`${o}-year-select`:"",size:"small",options:N(n,p),selectedItem:b,setSelectedItem:e=>s(e),dropdownWidth:100,isRequiredField:!0})]}),
7
+ /* @__PURE__ */r(S,{size:"small",className:"cursor-pointer",dataId:o?`${o}-next-month-button`:"",onClick:u?d:i,type:u?"disabled":"primary"})]})};export{K as CustomHeader};
@@ -1,8 +1,8 @@
1
- import{jsxs as f,Fragment as q,jsx as a}from"react/jsx-runtime";import{forwardRef as z,useState as D,useEffect as B}from"react";import G from"react-datepicker";import{Input as y}from"../../Input/Input.js";import{DateFormat as J}from"../types.js";import{useImportFilesDynamically as K}from"../hooks.js";import{isSameDay as Q}from"../../../utils/helpers.js";import U from"../../SVGIcons/IconCalendarRight.js";import{Modal as W}from"../../Modal/Modal.js";import"classnames";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import{CustomHeader as X}from"../CustomHeader/CustomHeader.js";import{formatDate as i}from"../../../helpers/format-date.js";import"react-toastify";import"../../Snackbar/consts.js";import"react-toastify/dist/ReactToastify.css";const Z=z((e,t)=>{const{value:r,currentDates:o=[],setFieldValue:s,name:n,changeHandler:l,dataId:m,format:c=J.LongDate,maxDate:d,minDate:p,locale:u="hy",disabled:x,placeholderText:j,dataIdPrefix:b,modalOptions:h,...C}=e;K(u);const g=p?p.getFullYear():1900,k=d?d.getFullYear():/* @__PURE__ */(new Date).getFullYear()+5,I=void 0!==r&&Array.isArray(r)?r:o,[v,F]=D(I),[A,M]=D(!1),[O,P]=D(!1),R=e=>{e&&Array.isArray(e)&&F(e)};if(B(()=>{F(I)},[I]),!Array.isArray(v))return null;const S=()=>{M(!0)},T=()=>{M(!1)},[H,Y]=v;/* @__PURE__ */
1
+ import{jsxs as f,Fragment as q,jsx as a}from"react/jsx-runtime";import{forwardRef as z,useState as D,useEffect as B}from"react";import G from"react-datepicker";import{Input as y}from"../../Input/Input.js";import{DateFormat as J}from"../types.js";import{useImportFilesDynamically as K}from"../hooks.js";import{isSameDay as Q}from"../../../utils/helpers.js";import U from"../../SVGIcons/IconCalendarRight.js";import{Modal as W}from"../../Modal/Modal.js";import"classnames";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"react-dom";import{CustomHeader as X}from"../CustomHeader/CustomHeader.js";import{formatDate as i}from"../../../helpers/format-date.js";import"react-toastify";import"../../Snackbar/consts.js";const Z=z((e,t)=>{const{value:r,currentDates:o=[],setFieldValue:s,name:n,changeHandler:l,dataId:m,format:c=J.LongDate,maxDate:d,minDate:p,locale:u="hy",disabled:x,placeholderText:j,dataIdPrefix:b,modalOptions:h,...C}=e;K(u);const g=p?p.getFullYear():1900,k=d?d.getFullYear():/* @__PURE__ */(new Date).getFullYear()+5,I=void 0!==r&&Array.isArray(r)?r:o,[v,F]=D(I),[A,M]=D(!1),[O,P]=D(!1),S=e=>{e&&Array.isArray(e)&&F(e)};if(B(()=>{F(I)},[I]),!Array.isArray(v))return null;const H=()=>{M(!0)},R=()=>{M(!1)},[T,Y]=v;/* @__PURE__ */
2
2
  return f(q,{children:[
3
- /* @__PURE__ */a(y,{readOnly:!0,onClick:S,dataId:m,disabled:x,placeholder:j,currentValue:(e=>{if(A&&!O)return;const[a,t]=e,r=i(a,c),o=i(t,c);return Q(a,t)||!t?r:`${r} - ${o}`})(v),rightIconProps:{Component:U,onClick:S}}),
4
- /* @__PURE__ */f(W,{isOpen:A,title:null==h?void 0:h.title,onClose:T,buttonProps:{confirm:{buttonText:null==h?void 0:h.btnConfirmText,onClick:()=>{l&&l(v),s&&n&&s(n,v),P(!0),T()}},cancel:{buttonText:null==h?void 0:h.btnCancelText,onClick:T}},closeIcon:!0,children:[
3
+ /* @__PURE__ */a(y,{readOnly:!0,onClick:H,dataId:m,disabled:x,placeholder:j,currentValue:(e=>{if(A&&!O)return;const[a,t]=e,r=i(a,c),o=i(t,c);return Q(a,t)||!t?r:`${r} - ${o}`})(v),rightIconProps:{Component:U,onClick:H}}),
4
+ /* @__PURE__ */f(W,{isOpen:A,title:null==h?void 0:h.title,onClose:R,buttonProps:{confirm:{buttonText:null==h?void 0:h.btnConfirmText,onClick:()=>{l&&l(v),s&&n&&s(n,v),P(!0),R()}},cancel:{buttonText:null==h?void 0:h.btnCancelText,onClick:R}},closeIcon:!0,children:[
5
5
  /* @__PURE__ */f("div",{className:"flexbox justify-content--between mb-16 gap-16",children:[
6
- /* @__PURE__ */a(y,{readOnly:!0,value:i(H,c)}),
6
+ /* @__PURE__ */a(y,{readOnly:!0,value:i(T,c)}),
7
7
  /* @__PURE__ */a(y,{readOnly:!0,value:i(Y,c)})]}),
8
- /* @__PURE__ */a(G,{...C,inline:!0,locale:u,minDate:p,maxDate:d,startDate:H,endDate:Y,selectsRange:!0,disabled:x,onChange:R,onClickOutside:()=>{const[e,a]=v;(!e||!a)&&R([null,null])},renderCustomHeader:e=>/* @__PURE__ */a(X,{...e,locale:u,startYear:g,endYear:k,dataPrefix:b,isMobile:!0})})]})]})});Z.displayName="RangeDatePickerMobile";export{Z as RangeDatePickerMobile};
8
+ /* @__PURE__ */a(G,{...C,inline:!0,locale:u,minDate:p,maxDate:d,startDate:T,endDate:Y,selectsRange:!0,disabled:x,onChange:S,onClickOutside:()=>{const[e,a]=v;(!e||!a)&&S([null,null])},renderCustomHeader:e=>/* @__PURE__ */a(X,{...e,locale:u,startYear:g,endYear:k,dataPrefix:b,isMobile:!0})})]})]})});Z.displayName="RangeDatePickerMobile";export{Z as RangeDatePickerMobile};
@@ -1,5 +1,5 @@
1
- import{jsxs as S,Fragment as v,jsx as e}from"react/jsx-runtime";import T from"react";import{Input as V}from"../../Input/Input.js";import w from"../../SVGIcons/IconCalendarRight.js";import D from"dayjs";import{useImportFilesDynamically as R}from"../hooks.js";import{Modal as q}from"../../Modal/Modal.js";import"classnames";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import{CustomHeader as z}from"../CustomHeader/CustomHeader.js";import E from"react-datepicker";import{Label as L}from"../../../helperComponents/Label/Label.js";const re=t=>{const{size:r,dataId:o,helperText:a,label:l,placeholderText:s,format:i="M/D/YYYY",value:n,currentDate:m,minDate:d,maxDate:c,locale:p="hy",dataIdPrefix:u,modalOptions:h,name:f,changeHandler:j,setFieldValue:x,required:C,hasError:I,...g}=t,Y=d?d.getFullYear():1900,b=c?c.getFullYear():/* @__PURE__ */(new Date).getFullYear()+5,[k,y]=T.useState(!1);R(p);const F=void 0!==n&&"[object Date]"===Object.prototype.toString.call(n)?n:m,H=()=>{y(!0)},M=()=>{y(!1)};/* @__PURE__ */
1
+ import{jsxs as S,Fragment as v,jsx as e}from"react/jsx-runtime";import T from"react";import{Input as V}from"../../Input/Input.js";import w from"../../SVGIcons/IconCalendarRight.js";import D from"dayjs";import{useImportFilesDynamically as R}from"../hooks.js";import{Modal as q}from"../../Modal/Modal.js";import"classnames";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"react-dom";import{CustomHeader as z}from"../CustomHeader/CustomHeader.js";import E from"react-datepicker";import{Label as L}from"../../../helperComponents/Label/Label.js";const oe=t=>{const{size:o,dataId:r,helperText:a,label:l,placeholderText:i,format:s="M/D/YYYY",value:n,currentDate:m,minDate:d,maxDate:c,locale:p="hy",dataIdPrefix:u,modalOptions:h,name:f,changeHandler:j,setFieldValue:x,required:C,hasError:I,...g}=t,Y=d?d.getFullYear():1900,b=c?c.getFullYear():/* @__PURE__ */(new Date).getFullYear()+5,[k,y]=T.useState(!1);R(p);const F=void 0!==n&&"[object Date]"===Object.prototype.toString.call(n)?n:m,H=()=>{y(!0)},M=()=>{y(!1)};/* @__PURE__ */
2
2
  return S(v,{children:[
3
3
  /* @__PURE__ */e(L,{text:l,required:C,invalid:I}),
4
- /* @__PURE__ */e(V,{size:r,onClick:H,dataId:o,readOnly:!0,helperText:a,datePlaceHolderText:l?"":s,rightIconProps:{Component:w,onClick:H},currentValue:F?D(F.toString()).format(i):""}),
5
- /* @__PURE__ */e(q,{isOpen:k,title:null==h?void 0:h.title,onClose:M,withFooter:!1,closeIcon:!0,children:/* @__PURE__ */e(E,{minDate:d,maxDate:c,selected:D(F).isValid()?F:null,locale:p,inline:!0,...g,onChange:e=>{x&&f&&x(f,e),j&&j(e),M()},renderCustomHeader:t=>/* @__PURE__ */e(z,{...t,locale:p,startYear:Y,endYear:b,dataPrefix:u,isMobile:!0})})})]})};export{re as SimpleDatePickerMobile};
4
+ /* @__PURE__ */e(V,{size:o,onClick:H,dataId:r,readOnly:!0,helperText:a,datePlaceHolderText:l?"":i,rightIconProps:{Component:w,onClick:H},currentValue:F?D(F.toString()).format(s):""}),
5
+ /* @__PURE__ */e(q,{isOpen:k,title:null==h?void 0:h.title,onClose:M,withFooter:!1,closeIcon:!0,children:/* @__PURE__ */e(E,{minDate:d,maxDate:c,selected:D(F).isValid()?F:null,locale:p,inline:!0,...g,onChange:e=>{x&&f&&x(f,e),j&&j(e),M()},renderCustomHeader:t=>/* @__PURE__ */e(z,{...t,locale:p,startYear:Y,endYear:b,dataPrefix:u,isMobile:!0})})})]})};export{oe as SimpleDatePickerMobile};
@@ -1,4 +1,4 @@
1
- import{jsx as i,jsxs as k}from"react/jsx-runtime";import{useState as m}from"react";import{Modal as u}from"../../Modal/Modal.js";import"classnames";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"dayjs";import{HOUR_OPTIONS as g,MINUTE_OPTIONS as b}from"./consts.js";import{WheelPickerWrapper as w,WheelPicker as l}from"@ncdai/react-wheel-picker";import"@ncdai/react-wheel-picker/style.css";const y=({onApply:e,isOpen:t,mobileTitle:o,modalApplyButtonText:r="Apply",closeTimePicker:s,dateInitialValue:p=/* @__PURE__ */new Date})=>{const[c,a]=m(`${p.getHours()}`),[n,h]=m(`${p.getMinutes()}`);/* @__PURE__ */
1
+ import{jsx as i,jsxs as k}from"react/jsx-runtime";import{useState as m}from"react";import{Modal as u}from"../../Modal/Modal.js";import"classnames";import"../../../consts/index.js";import"../../../context/types.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import"dayjs";import"react-dom";import{HOUR_OPTIONS as g,MINUTE_OPTIONS as b}from"./consts.js";import{WheelPickerWrapper as w,WheelPicker as l}from"@ncdai/react-wheel-picker";import"@ncdai/react-wheel-picker/style.css";const T=({onApply:e,isOpen:t,mobileTitle:o,modalApplyButtonText:r="Apply",closeTimePicker:s,dateInitialValue:p=/* @__PURE__ */new Date})=>{const[c,a]=m(`${p.getHours()}`),[n,h]=m(`${p.getMinutes()}`);/* @__PURE__ */
2
2
  return i(u,{isOpen:t,title:o,onClose:s,className:"time-picker-mobile",buttonProps:{confirm:{buttonText:r,onClick:()=>{const i=/* @__PURE__ */new Date;i.setHours(+c,+n,0),e(i)},className:"time_apply_button"}},closeIcon:!0,children:/* @__PURE__ */i("div",{className:"mobile_time_picker",children:/* @__PURE__ */k(w,{className:"mobile_time_picker-wheel-picker",children:[
3
3
  /* @__PURE__ */i(l,{value:`${c}`,options:g,infinite:!0,classNames:{optionItem:"mobile_time_picker-wheel-picker-item mobile_time_picker-wheel-picker-item__hour",highlightWrapper:"mobile_time_picker-wheel-picker-highlight",highlightItem:"mobile_time_picker-wheel-picker-highlight-item__hour"},onValueChange:e=>{a(e)}}),
4
- /* @__PURE__ */i(l,{value:`${n}`,options:b,infinite:!0,classNames:{optionItem:"mobile_time_picker-wheel-picker-item mobile_time_picker-wheel-picker-item__minute",highlightWrapper:"mobile_time_picker-wheel-picker-highlight",highlightItem:"mobile_time_picker-wheel-picker-highlight-item__minute"},onValueChange:e=>{h(e)}})]})})})};export{y as MobileModalContent};
4
+ /* @__PURE__ */i(l,{value:`${n}`,options:b,infinite:!0,classNames:{optionItem:"mobile_time_picker-wheel-picker-item mobile_time_picker-wheel-picker-item__minute",highlightWrapper:"mobile_time_picker-wheel-picker-highlight",highlightItem:"mobile_time_picker-wheel-picker-highlight-item__minute"},onValueChange:e=>{h(e)}})]})})})};export{T as MobileModalContent};
@@ -1,7 +1,7 @@
1
- import{jsxs as l,jsx as e}from"react/jsx-runtime";import{Text as n}from"../../Text/Text.js";import{Button as s}from"../../Button/Button.js";import f from"../../SVGIcons/IconDelete.js";import{useMemo as _}from"react";import{FileUploadMode as t}from"../types.js";import{FilePreview as w}from"./FilePreview.js";import{shortenFileName as v,formatFileSize as z}from"./helpers.js";import h from"../../SVGIcons/IconArrowDownloadFilled.js";import u from"classnames";import"../../../helpers/format-date.js";import{downloadFile as F}from"../../../helpers/download-file.js";import"react-toastify";import"../../Snackbar/consts.js";import"react-toastify/dist/ReactToastify.css";import"dayjs";import"../../../consts/index.js";const O=({file:i,onRemove:o,mode:r})=>{const a=i.type.split("/")[0],m=_(()=>URL.createObjectURL(i),[i.name]);/* @__PURE__ */
1
+ import{jsxs as l,jsx as e}from"react/jsx-runtime";import{Text as n}from"../../Text/Text.js";import{Button as s}from"../../Button/Button.js";import f from"../../SVGIcons/IconDelete.js";import{useMemo as _}from"react";import{FileUploadMode as t}from"../types.js";import{FilePreview as w}from"./FilePreview.js";import{shortenFileName as v,formatFileSize as z}from"./helpers.js";import h from"../../SVGIcons/IconArrowDownloadFilled.js";import u from"classnames";import"../../../helpers/format-date.js";import{downloadFile as F}from"../../../helpers/download-file.js";import"react-toastify";import"../../Snackbar/consts.js";import"dayjs";import"../../../consts/index.js";const B=({file:i,onRemove:o,mode:r})=>{const a=i.type.split("/")[0],m=_(()=>URL.createObjectURL(i),[i.name]);/* @__PURE__ */
2
2
  return l("div",{className:u("dz-file-upload__files--item",{"dz-file-upload__files--item--view":r===t.view}),onClick:()=>{r===t.view&&window.open(m,"_blank")},children:[
3
3
  /* @__PURE__ */e("div",{className:"dz-file-upload__files--item__preview",children:/* @__PURE__ */e(w,{preview:m,type:a})}),
4
4
  /* @__PURE__ */l("div",{className:"dz-file-upload__files--item__info",children:[
5
5
  /* @__PURE__ */l("div",{className:"dz-file-upload__files--item__info-title",children:[
6
6
  /* @__PURE__ */e(n,{weight:"semibold",children:v(i.name,40)}),r===t.attach&&/* @__PURE__ */e(s,{size:"small",type:"tertiary",onClick:o,iconProps:{Component:f}}),r===t.view&&/* @__PURE__ */e(s,{size:"small",type:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),F(m,i.name)},iconProps:{Component:h}})]}),
7
- /* @__PURE__ */e("div",{className:"dz-file-upload__files--item__info-size",children:/* @__PURE__ */e(n,{size:"small",children:z(i.size)})})]})]})};export{O as PreviewItem};
7
+ /* @__PURE__ */e("div",{className:"dz-file-upload__files--item__info-size",children:/* @__PURE__ */e(n,{size:"small",children:z(i.size)})})]})]})};export{B as PreviewItem};
@@ -1 +1 @@
1
- import{FILE_ACCEPT_TYPE as p}from"../../../consts/index.js";import"../../../helpers/format-date.js";import{getTranslationLocale as $}from"../../../helpers/locale.js";import"react/jsx-runtime";import"react-toastify";import"classnames";import"dayjs";import"../../Snackbar/consts.js";import"react";import"react-toastify/dist/ReactToastify.css";const C=(e,o)=>e.length>o?e.replace(/^(.{10}).*?(.{10}\.[^.]*)$/,"$1...$2"):e,s=(e,o=0)=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(o)} KB`:e<1073741824?`${(e/1048576).toFixed(o)} MB`:`${(e/1073741824).toFixed(o)} GB`,v=({allowedTypes:e,maxSize:o,locale:t})=>{const a=e.map(e=>p[e]).flat(),r=c(t),i=1===e.length?e[0]:e.reduce((e,o,t,a)=>t===a.length-1?`${e} ${r.or} ${o}`:e?`${e}, ${o}`:o,"");return{acceptTypes:a,maxSizeFormatted:s(o),acceptTypesMessage:i}},c=e=>{const o={en:{title:"Choose a file or drop it here",format:"format",formats:"formats",maxSize:"Maximum size up to $1.",fileInvalidType:"The file type should be $1",fileTooLarge:"The file is too large (Max $1)",tooManyFiles:"Too many files. Please select one file.",or:"or"},ru:{title:"Выберите файл или перетащите его сюда",format:"формат",formats:"форматы",maxSize:"Максимальный размер до $1",fileInvalidType:"Тип файла должен быть $1",fileTooLarge:"Файл слишком большой (Максимум $1)",tooManyFiles:"Слишком много файлов. Пожалуйста, выберите один файл.",or:"или"},hy:{title:"Ընտրեք ֆայլ կամ քաշեք այն այստեղ",format:"ֆորմատ",formats:"ֆորմատներ",maxSize:"Առավելագույն չափը՝ մինչև $1",fileInvalidType:"Ֆայլի տեսակը պետք է լինի $1",fileTooLarge:"Ֆայլը չափազանց մեծ է (Առավելագույնը $1)",tooManyFiles:"Չափազանց շատ ֆայլեր։ Խնդրում ենք ընտրել միայն մեկ ֆայլ։",or:"կամ"}};return o[e||$()]||o.en};export{s as formatFileSize,v as generateAreaContent,c as getDropzoneLocale,C as shortenFileName};
1
+ import{FILE_ACCEPT_TYPE as $}from"../../../consts/index.js";import"../../../helpers/format-date.js";import{getTranslationLocale as p}from"../../../helpers/locale.js";import"react/jsx-runtime";import"react-toastify";import"classnames";import"dayjs";import"../../Snackbar/consts.js";import"react";const S=(e,o)=>e.length>o?e.replace(/^(.{10}).*?(.{10}\.[^.]*)$/,"$1...$2"):e,s=(e,o=0)=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(o)} KB`:e<1073741824?`${(e/1048576).toFixed(o)} MB`:`${(e/1073741824).toFixed(o)} GB`,C=({allowedTypes:e,maxSize:o,locale:t})=>{const a=e.map(e=>$[e]).flat(),r=c(t),i=1===e.length?e[0]:e.reduce((e,o,t,a)=>t===a.length-1?`${e} ${r.or} ${o}`:e?`${e}, ${o}`:o,"");return{acceptTypes:a,maxSizeFormatted:s(o),acceptTypesMessage:i}},c=e=>{const o={en:{title:"Choose a file or drop it here",format:"format",formats:"formats",maxSize:"Maximum size up to $1.",fileInvalidType:"The file type should be $1",fileTooLarge:"The file is too large (Max $1)",tooManyFiles:"Too many files. Please select one file.",or:"or"},ru:{title:"Выберите файл или перетащите его сюда",format:"формат",formats:"форматы",maxSize:"Максимальный размер до $1",fileInvalidType:"Тип файла должен быть $1",fileTooLarge:"Файл слишком большой (Максимум $1)",tooManyFiles:"Слишком много файлов. Пожалуйста, выберите один файл.",or:"или"},hy:{title:"Ընտրեք ֆայլ կամ քաշեք այն այստեղ",format:"ֆորմատ",formats:"ֆորմատներ",maxSize:"Առավելագույն չափը՝ մինչև $1",fileInvalidType:"Ֆայլի տեսակը պետք է լինի $1",fileTooLarge:"Ֆայլը չափազանց մեծ է (Առավելագույնը $1)",tooManyFiles:"Չափազանց շատ ֆայլեր։ Խնդրում ենք ընտրել միայն մեկ ֆայլ։",or:"կամ"}};return o[e||p()]||o.en};export{s as formatFileSize,C as generateAreaContent,c as getDropzoneLocale,S as shortenFileName};
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { TLineChartProps } from './types';
3
+ export declare const LineChart: ({ data }: TLineChartProps) => React.ReactElement;
@@ -0,0 +1,9 @@
1
+ import{jsxs as a,jsx as r,Fragment as d}from"react/jsx-runtime";import c from"classnames";import{Text as m}from"../Text/Text.js";import{Divider as p}from"../Divider/Divider.js";const g=e=>{if(!e||0===e.length)return[];const r=e.reduce((e,{quantity:r})=>e+r,0);return e.map(e=>({...e,percentage:e.quantity/r*100}))},x=({data:e})=>{const t=g(e);/* @__PURE__ */
2
+ return a("div",{children:[
3
+ /* @__PURE__ */r("div",{className:"bar",children:t.map(({percentage:e,color:a},s)=>/* @__PURE__ */r("div",{className:c("bar__segment",`bar__segment--color-${a}`,{"bar__segment--first":0===s,"bar__segment--last":s===t.length-1}),style:{flexBasis:`${e}%`}},`line-chart-segment-${s}`))}),
4
+ /* @__PURE__ */r("div",{className:"line-chart-status",children:t.map(({label:e,dataCurrency:s,color:i,quantity:n,isHidden:l},o)=>!l&&/* @__PURE__ */a(d,{children:[
5
+ /* @__PURE__ */a("div",{className:"flexbox justify-content--between pt-6 pb-6",children:[
6
+ /* @__PURE__ */a("div",{className:"flexbox align-items--center",children:[
7
+ /* @__PURE__ */r("span",{className:c("status__circle",`status__circle--${i}`)}),
8
+ /* @__PURE__ */r(m,{type:"disabled",children:e})]}),
9
+ /* @__PURE__ */r("div",{children:/* @__PURE__ */a(m,{children:[n," ",s]})})]},`line-chart-status-${o}`),o!==t.length-1&&/* @__PURE__ */r(p,{type:"primary",isHorizontal:!0,color:"grey"})]}))})]})};export{x as LineChart};
@@ -0,0 +1,2 @@
1
+ export * from './LineChart';
2
+ export * from './types';
@@ -0,0 +1 @@
1
+ import{LineChart as o}from"./LineChart.js";export{o as LineChart};
@@ -0,0 +1,14 @@
1
+ export type TLineChartColor = 'blue' | 'purple' | 'yellow' | 'pink' | 'green' | 'grey' | 'red';
2
+ export type TLineChartDataItem = {
3
+ quantity: number;
4
+ dataCurrency?: string;
5
+ label: string;
6
+ color: TLineChartColor;
7
+ isHidden?: boolean;
8
+ };
9
+ export interface TLineChartDataItemWithPercentage extends TLineChartDataItem {
10
+ percentage: number;
11
+ }
12
+ export type TLineChartProps = {
13
+ data: Array<TLineChartDataItem>;
14
+ };
File without changes
@@ -1,2 +1,2 @@
1
- import{jsxs as k,jsx as o}from"react/jsx-runtime";import d from"classnames";const h=a=>{const{children:e,afterLink:r,beforeLink:n,className:t="",url:s,dataId:i="",target:l,onclick:c}=a;return n||r?/* @__PURE__ */k("span",{className:t,children:[n,
2
- /* @__PURE__ */o("a",{onClick:a=>{c&&(a.preventDefault(),c())},href:s,className:"link","data-id":i?`${i}-link`:"",target:l,children:e}),r]}):/* @__PURE__ */o("a",{onClick:a=>{c&&(a.preventDefault(),c())},href:s,className:d(`link ${t}`),"data-id":i?`${i}-link`:"",target:l,children:e})};export{h as Link};
1
+ import{jsxs as d,jsx as o}from"react/jsx-runtime";import m from"classnames";const h=a=>{const{children:e,afterLink:n,beforeLink:r,className:t="",url:i,dataId:l="",target:s,type:c="brand",onclick:k}=a;return r||n?/* @__PURE__ */d("span",{className:t,children:[r,
2
+ /* @__PURE__ */o("a",{onClick:a=>{k&&(a.preventDefault(),k())},href:i,className:`link link-${c}`,"data-id":l?`${l}-link`:"",target:s,children:e}),n]}):/* @__PURE__ */o("a",{onClick:a=>{k&&(a.preventDefault(),k())},href:i,className:m(`link ${t} link-${c}`),"data-id":l?`${l}-link`:"",target:s,children:e})};export{h as Link};
@@ -1,6 +1,8 @@
1
+ type TLinkTypes = 'primary' | 'secondary' | 'tertiary' | 'disabled' | 'inverse' | 'selected' | 'brand' | 'danger' | 'warning' | 'success' | 'information' | 'discovery';
1
2
  export interface LinkPropTypes {
2
3
  children?: string | React.ReactElement;
3
4
  className?: string;
5
+ type?: TLinkTypes;
4
6
  url?: string;
5
7
  dataId?: string;
6
8
  target?: string;
@@ -8,3 +10,4 @@ export interface LinkPropTypes {
8
10
  afterLink?: string | React.ReactElement;
9
11
  onclick?: () => void;
10
12
  }
13
+ export {};
@@ -1,3 +1,3 @@
1
- import{jsx as n,Fragment as c,jsxs as k}from"react/jsx-runtime";import{useState as w,useId as y,useMemo as E}from"react";import{createPortal as H}from"react-dom";import{useGetElemSizes as g}from"../../hooks/useGetElemSizes.js";import{useGetElemPositions as I}from"../../hooks/useGetElemPositions.js";import{useGetTooltipPosition as T}from"../../hooks/useGetTooltipPosition.js";import{useHideOnScroll as z}from"../../hooks/useHideOnScroll.js";import"../../context/types.js";import{useOnOutsideClick as F}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import{OptionItem as L}from"../../helperComponents/OptionItem/OptionItem.js";import W from"classnames";const _=e=>{const{menuItems:t=[],parentRef:o,onClose:s,isOpen:i,position:l="bottom-right",className:r="",children:a=null}=e,[m,p]=w(null);F(m,s,i,y()),z(s);const{left:u,top:d}=I(o),{width:f,height:h}=g(o),{width:j,height:O}=g(m),b=T({tooltipRef:m,elemRef:o,initialPosition:l,hasTriangle:!1}),P=E(()=>"bottom-right"===b?{left:u+4,top:d+4+h}:"bottom-left"===b?{left:u-j+f,top:d+4+h}:"top-right"===b?{left:u+4,top:d-O-4}:"top-left"===b?{left:u-j+f,top:d-O-4}:{left:u,top:d+4+h},[u,d,f,b,j,h,O]);return o&&i?/* @__PURE__ */n(c,{children:H(
2
- /* @__PURE__ */n("div",{className:W("select","select--menu",r),style:P,ref:p,children:/* @__PURE__ */k(c,{children:[a,
3
- /* @__PURE__ */n(c,{children:null==t?void 0:t.map(({label:e,meta:t,value:o,handler:i,iconProps:l,disabled:r,dataId:a})=>/* @__PURE__ */n(L,{dataId:a,disabled:r,data:{label:e,value:o,meta:t},labelLeftIconProps:l,onClick:()=>{s(),i&&i()}},o))})]})}),o)}):null};export{_ as Menu};
1
+ import{jsx as n,Fragment as c,jsxs as j}from"react/jsx-runtime";import{useState as k,useId as w,useMemo as E}from"react";import{createPortal as H}from"react-dom";import{useGetElemSizes as g}from"../../hooks/useGetElemSizes.js";import{useGetElemPositions as I}from"../../hooks/useGetElemPositions.js";import{useGetTooltipPosition as T}from"../../hooks/useGetTooltipPosition.js";import{useHideOnScroll as z}from"../../hooks/useHideOnScroll.js";import"../../context/types.js";import{useOnOutsideClick as F}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import{OptionItem as L}from"../../helperComponents/OptionItem/OptionItem.js";import W from"classnames";const _=e=>{const{menuItems:t=[],parentRef:o,onClose:s,isOpen:i,position:l="bottom-right",className:r="",children:m=null}=e,[a,p]=k(null);F(a,s,i,w()),z(s);const{left:u,top:d}=I(o),{width:f,height:h}=g(o),{width:O,height:b}=g(a),P=T({tooltipRef:a,elemRef:o,initialPosition:l,hasTriangle:!1}),S=E(()=>"bottom-right"===P?{left:u+4,top:d+4+h}:"bottom-left"===P?{left:u-O+f,top:d+4+h}:"top-right"===P?{left:u+4,top:d-b-4}:"top-left"===P?{left:u-O+f,top:d-b-4}:{left:u,top:d+4+h},[u,d,f,P,O,h,b]);return o&&i?/* @__PURE__ */n(c,{children:H(
2
+ /* @__PURE__ */n("div",{className:W("select","select--menu",r),style:S,ref:p,children:/* @__PURE__ */j(c,{children:[m,
3
+ /* @__PURE__ */n(c,{children:null==t?void 0:t.map(({label:e,meta:t,value:o,handler:i,iconProps:l,disabled:r,dataId:m})=>/* @__PURE__ */n(L,{dataId:m,disabled:r,data:{label:e,value:o,meta:t},labelLeftIconProps:l,onClick:()=>{s(),i&&i()}},o))})]})}),document.body)}):null};export{_ as Menu};
@@ -1,3 +1,3 @@
1
- import{jsx as m,Fragment as x}from"react/jsx-runtime";import{useState as y,useId as E,useMemo as H}from"react";import{createPortal as T}from"react-dom";import{useGetElemSizes as h}from"../../hooks/useGetElemSizes.js";import{useGetElemPositions as $}from"../../hooks/useGetElemPositions.js";import{useGetTooltipPosition as j}from"../../hooks/useGetTooltipPosition.js";import{useHideOnScroll as v}from"../../hooks/useHideOnScroll.js";import"../../context/types.js";import{useOnOutsideClick as z}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import C from"classnames";import"motion/react";import"dayjs";import"../../consts/index.js";import{CollapseGroup as F}from"../Collapse/CollapseGroup/CollapseGroup.js";import{OptionItem as L}from"../../helperComponents/OptionItem/OptionItem.js";const it=({menuItems:e=[],parentRef:t,onClose:o,isOpen:s,position:i="bottom-right",className:l=""})=>{const[r,a]=y(null);z(r,o,!!s,E()),v(o);const{left:n,top:p}=$(t),{width:u,height:c}=h(t),{width:d,height:f}=h(r),b=j({tooltipRef:r,elemRef:t,initialPosition:i,hasTriangle:!1}),k=H(()=>"bottom-right"===b?{left:n+4,top:p+4+c}:"bottom-left"===b?{right:0,top:p+4+c}:"top-right"===b?{left:n+4,top:p-f-4}:"top-left"===b?{left:n-d+u,top:p-f-4}:{left:n,top:p+4+c},[n,p,u,b,d,c,f]);if(!t||!s)return null;const I=e.map((e,t)=>({...e,content:e.subItems?/* @__PURE__ */m("div",{className:"nested-menu__sub-items select",children:e.subItems.map(({label:e,meta:s,value:i,handler:l,iconProps:r,disabled:a,dataId:n})=>/* @__PURE__ */m(L,{dataId:n,disabled:a,data:{label:e,value:i,meta:s},labelLeftIconProps:r,onClick:()=>{o(),null==l||l()},className:"nested-menu__sub-item"},`${t}-${i}`))}):null}));/* @__PURE__ */
2
- return m(x,{children:T(
3
- /* @__PURE__ */m("div",{className:C("nested-menu",l),style:k,ref:a,children:/* @__PURE__ */m(F,{items:I})}),t)})};export{it as NestedMenu};
1
+ import{jsx as i,Fragment as w}from"react/jsx-runtime";import{useState as x,useId as E,useMemo as H}from"react";import{createPortal as T}from"react-dom";import{useGetElemSizes as h}from"../../hooks/useGetElemSizes.js";import{useGetElemPositions as $}from"../../hooks/useGetElemPositions.js";import{useGetTooltipPosition as j}from"../../hooks/useGetTooltipPosition.js";import{useHideOnScroll as v}from"../../hooks/useHideOnScroll.js";import"../../context/types.js";import{useOnOutsideClick as z}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import"react-hook-form";import C from"classnames";import"motion/react";import"dayjs";import"../../consts/index.js";import{CollapseGroup as F}from"../Collapse/CollapseGroup/CollapseGroup.js";import{OptionItem as L}from"../../helperComponents/OptionItem/OptionItem.js";const it=({menuItems:e=[],parentRef:t,onClose:o,isOpen:s,position:m="bottom-right",className:l=""})=>{const[r,a]=x(null);z(r,o,!!s,E()),v(o);const{left:n,top:p}=$(t),{width:u,height:c}=h(t),{width:d,height:f}=h(r),b=j({tooltipRef:r,elemRef:t,initialPosition:m,hasTriangle:!1}),k=H(()=>"bottom-right"===b?{left:n+4,top:p+4+c}:"bottom-left"===b?{right:0,top:p+4+c}:"top-right"===b?{left:n+4,top:p-f-4}:"top-left"===b?{left:n-d+u,top:p-f-4}:{left:n,top:p+4+c},[n,p,u,b,d,c,f]);if(!t||!s)return null;const I=e.map((e,t)=>({...e,content:e.subItems?/* @__PURE__ */i("div",{className:"nested-menu__sub-items select",children:e.subItems.map(({label:e,meta:s,value:m,handler:l,iconProps:r,disabled:a,dataId:n})=>/* @__PURE__ */i(L,{dataId:n,disabled:a,data:{label:e,value:m,meta:s},labelLeftIconProps:r,onClick:()=>{o(),null==l||l()},className:"nested-menu__sub-item"},`${t}-${m}`))}):null}));/* @__PURE__ */
2
+ return i(w,{children:T(
3
+ /* @__PURE__ */i("div",{className:C("nested-menu",l),style:k,ref:a,children:/* @__PURE__ */i(F,{items:I})}),document.body)})};export{it as NestedMenu};
@@ -1 +1,2 @@
1
- import{jsx as m}from"react/jsx-runtime";import{useState as p,useId as _}from"react";import a from"classnames";import"../../consts/index.js";import"../../context/types.js";import{useOnOutsideClick as S}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import{useHideBodyScroll as $}from"../../hooks/useHideBodyScroll.js";import"react-hook-form";import{useAnimation as h}from"../../hooks/useAnimation.js";import{ModalContent as x}from"./ModalContent.js";import{useIsMobile as M}from"../../hooks/useGetIsMobile.js";import{useEscapeKey as N}from"../../hooks/useEscapeKey.js";const K=({isOpen:o,onClose:e,className:s="",size:i="medium",closeOnOutsideClick:t=!0,isMobileFullScreen:r,...n})=>{const l=M(),{animationState:c,shouldRender:d}=h({isOpen:o,enterDuration:l?0:400,exitDuration:200}),[u,f]=p(null);return S(u,e,t&&o,_()),$(o),N(e,{enabled:o}),d?/* @__PURE__ */m("div",{className:a("modal",`modal--${i}`,`modal--${c}`,s),children:/* @__PURE__ */m("div",{className:a("modal__container",`modal__container--${c}`,{modal__container_fullScreen:l&&r,[`modal__container_fullScreen--${c}`]:l&&r}),ref:f,children:/* @__PURE__ */m(x,{...n,onClose:e})})}):null};export{K as Modal};
1
+ import{jsx as m}from"react/jsx-runtime";import{useState as p,useId as _}from"react";import a from"classnames";import"../../consts/index.js";import"../../context/types.js";import{useOnOutsideClick as S}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import{useHideBodyScroll as $}from"../../hooks/useHideBodyScroll.js";import"react-hook-form";import{useAnimation as b}from"../../hooks/useAnimation.js";import{ModalContent as h}from"./ModalContent.js";import{useIsMobile as x}from"../../hooks/useGetIsMobile.js";import{useEscapeKey as y}from"../../hooks/useEscapeKey.js";import{createPortal as M}from"react-dom";const g=({isOpen:o,onClose:e,className:s="",size:t="medium",closeOnOutsideClick:r=!0,isMobileFullScreen:i,...n})=>{const l=x(),{animationState:c,shouldRender:d}=b({isOpen:o,enterDuration:l?0:400,exitDuration:200}),[u,f]=p(null);return S(u,e,r&&o,_()),$(o),y(e,{enabled:o}),d?M(
2
+ /* @__PURE__ */m("div",{className:a("modal",`modal--${t}`,`modal--${c}`,s),children:/* @__PURE__ */m("div",{className:a("modal__container",`modal__container--${c}`,{modal__container_fullScreen:l&&i,[`modal__container_fullScreen--${c}`]:l&&i}),ref:f,children:/* @__PURE__ */m(h,{...n,onClose:e})})}),document.body):null};export{g as Modal};
@@ -1,3 +1,4 @@
1
- import{jsx as e,jsxs as c}from"react/jsx-runtime";import{useState as v,useId as y}from"react";import d from"classnames";import"../../consts/index.js";import"../../context/types.js";import{useOnOutsideClick as C}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import{useHideBodyScroll as b}from"../../hooks/useHideBodyScroll.js";import"react-hook-form";import{useAnimation as k}from"../../hooks/useAnimation.js";import{Button as s}from"../Button/Button.js";import{Text as u}from"../Text/Text.js";import{useEscapeKey as R}from"../../hooks/useEscapeKey.js";const q=({isOpen:o,onClose:t,onSubmit:a,title:n,className:l="",size:i="small",buttonProps:r,dataIdPrefix:m,closeOnOutsideClick:p=!0,iconProps:f,subtitle:_})=>{const{animationState:h,shouldRender:x}=k({isOpen:o,enterDuration:400,exitDuration:200}),[j,N]=v(null);return C(j,t,p&&o,y()),b(o),R(t,{enabled:o}),x?/* @__PURE__ */e("div",{className:d("modal modal--confirmation",`modal--${i}`,`modal--${h}`,l),children:/* @__PURE__ */e("div",{className:d("modal__container","text-center",`modal__container--${h}`),ref:N,children:/* @__PURE__ */c("div",{className:"modal__content",children:[null!=f&&f.Component?/* @__PURE__ */e("div",{className:"modal__icon mb-32",children:/* @__PURE__ */e(f.Component,{size:"xlarge"})}):null,n?/* @__PURE__ */e(u,{weight:"bolder",lineHeight:"large",size:"large",dataId:m?`${m}-modal-title`:"",children:n}):null,_?/* @__PURE__ */e(u,{className:"mt-12",children:_}):null,r?/* @__PURE__ */c("div",{className:"modal__footer mt-32",children:[
1
+ import{jsx as e,jsxs as c}from"react/jsx-runtime";import{useState as $,useId as b}from"react";import d from"classnames";import"../../consts/index.js";import"../../context/types.js";import{useOnOutsideClick as v}from"../../hooks/useOnOutsideClick.js";import"../../hooks/useScreenSize.js";import{useHideBodyScroll as C}from"../../hooks/useHideBodyScroll.js";import"react-hook-form";import{useAnimation as k}from"../../hooks/useAnimation.js";import{Button as s}from"../Button/Button.js";import{Text as u}from"../Text/Text.js";import{useEscapeKey as R}from"../../hooks/useEscapeKey.js";import{createPortal as S}from"react-dom";const G=({isOpen:o,onClose:t,onSubmit:a,title:n,className:l="",size:i="small",buttonProps:r,dataIdPrefix:m,closeOnOutsideClick:p=!0,iconProps:f,subtitle:_})=>{const{animationState:h,shouldRender:x}=k({isOpen:o,enterDuration:400,exitDuration:200}),[j,y]=$(null);return v(j,t,p&&o,b()),C(o),R(t,{enabled:o}),x?S(
2
+ /* @__PURE__ */e("div",{className:d("modal modal--confirmation",`modal--${i}`,`modal--${h}`,l),children:/* @__PURE__ */e("div",{className:d("modal__container","text-center",`modal__container--${h}`),ref:y,children:/* @__PURE__ */c("div",{className:"modal__content",children:[null!=f&&f.Component?/* @__PURE__ */e("div",{className:"modal__icon mb-32",children:/* @__PURE__ */e(f.Component,{size:"xlarge"})}):null,n?/* @__PURE__ */e(u,{weight:"bolder",lineHeight:"large",size:"large",dataId:m?`${m}-modal-title`:"",children:n}):null,_?/* @__PURE__ */e(u,{className:"mt-12",children:_}):null,r?/* @__PURE__ */c("div",{className:"modal__footer mt-32",children:[
2
3
  /* @__PURE__ */e(s,{type:"secondary",className:"modal__footer__btn mr-16",onClick:t,dataId:m?`${m}-modal-cancel-button`:"",...r.cancel||{}}),
3
- /* @__PURE__ */e(s,{type:"danger",className:"modal__footer__btn",onClick:a,dataId:m?`${m}-modal-confirm-button`:"",...r.confirm})]}):null]})})}):null};export{q as ModalConfirmation};
4
+ /* @__PURE__ */e(s,{type:"danger",className:"modal__footer__btn",onClick:a,dataId:m?`${m}-modal-confirm-button`:"",...r.confirm})]}):null]})})}),document.body):null};export{G as ModalConfirmation};
@@ -1,3 +1,3 @@
1
- import{jsxs as p,Fragment as l,jsx as r}from"react/jsx-runtime";import{Modal as s}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 c}from"../Text/Text.js";import{Link as f}from"../Link/Link.js";const j=e=>{const{dataId:t,text:o,linkAddons:i,mobileTitle:a,hideMessage:n,clicked:m=!1,children:d}=e;/* @__PURE__ */
1
+ import{jsxs as p,Fragment as l,jsx as r}from"react/jsx-runtime";import{Modal as s}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 c}from"../Text/Text.js";import"react-dom";import{Link as f}from"../Link/Link.js";const y=e=>{const{dataId:t,text:o,linkAddons:i,mobileTitle:a,hideMessage:n,clicked:m=!1,children:d}=e;/* @__PURE__ */
2
2
  return p(l,{children:[
3
- /* @__PURE__ */r(s,{closeIcon:!0,title:a,onClose:n,isOpen:m,children:m&&/* @__PURE__ */r(l,{children:i?/* @__PURE__ */r(f,{dataId:i.dataId,url:i.url,beforeLink:i.beforeLink,afterLink:i.afterLink,target:i.target,className:"popover__link",children:o}):/* @__PURE__ */r(c,{dataId:t?`${t}-popover-text`:"",type:"primary",weight:"regular",lineHeight:"medium",size:"small",children:o})})}),d]})};export{j as PopoverMobile};
3
+ /* @__PURE__ */r(s,{closeIcon:!0,title:a,onClose:n,isOpen:m,children:m&&/* @__PURE__ */r(l,{children:i?/* @__PURE__ */r(f,{dataId:i.dataId,url:i.url,beforeLink:i.beforeLink,afterLink:i.afterLink,target:i.target,className:"popover__link",children:o}):/* @__PURE__ */r(c,{dataId:t?`${t}-popover-text`:"",type:"primary",weight:"regular",lineHeight:"medium",size:"small",children:o})})}),d]})};export{y as PopoverMobile};
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ import { ISVGIconProps } from '../../type';
3
+ declare const IconBudgetTransfer: ({ size, type, className, onClick, refHandler, id, dataId }: ISVGIconProps) => ReactElement;
4
+ export default IconBudgetTransfer;
@@ -0,0 +1,7 @@
1
+ import{jsxs as i,jsx as C}from"react/jsx-runtime";import V from"classnames";const p=({size:s,type:e,className:a="",onClick:H,refHandler:d,id:t,dataId:o})=>/* @__PURE__ */i("svg",{xmlns:"http://www.w3.org/2000/svg",className:V("svg-icon",{[`svg-icon__size-${s}`]:s,[`svg-icon__type-${e}`]:e,[a]:a}),viewBox:"0 0 24 24",fill:"none",onClick:H,ref:d,id:t,"data-id":o?`${o}-svg-icon`:"",children:[
2
+ /* @__PURE__ */C("path",{d:"M5.16353 5C4.81836 5 4.53853 5.27982 4.53853 5.625C4.53853 5.97018 4.81836 6.25 5.16353 6.25H5.91353C6.25871 6.25 6.53853 5.97018 6.53853 5.625C6.53853 5.27982 6.25871 5 5.91353 5H5.16353Z"}),
3
+ /* @__PURE__ */C("path",{d:"M4.53853 8.49426C4.53853 8.14908 4.81836 7.86926 5.16353 7.86926H5.91353C6.25871 7.86926 6.53853 8.14908 6.53853 8.49426C6.53853 8.83944 6.25871 9.11926 5.91353 9.11926H5.16353C4.81836 9.11926 4.53853 8.83944 4.53853 8.49426Z"}),
4
+ /* @__PURE__ */C("path",{d:"M7.62508 8.49426C7.62508 8.14908 7.9049 7.86926 8.25008 7.86926H9.00008C9.34526 7.86926 9.62508 8.14908 9.62508 8.49426C9.62508 8.83944 9.34526 9.11926 9.00008 9.11926H8.25008C7.9049 9.11926 7.62508 8.83944 7.62508 8.49426Z"}),
5
+ /* @__PURE__ */C("path",{d:"M7.62508 5.625C7.62508 5.27982 7.9049 5 8.25008 5H9.00008C9.34526 5 9.62508 5.27982 9.62508 5.625C9.62508 5.97018 9.34526 6.25 9.00008 6.25H8.25008C7.9049 6.25 7.62508 5.97018 7.62508 5.625Z"}),
6
+ /* @__PURE__ */C("path",{d:"M13.5352 11.4583C13.5352 11.1132 13.815 10.8333 14.1602 10.8333H15.4122C15.7573 10.8333 16.0372 11.1132 16.0372 11.4583C16.0372 11.8035 15.7573 12.0833 15.4122 12.0833H14.1602C13.815 12.0833 13.5352 11.8035 13.5352 11.4583Z"}),
7
+ /* @__PURE__ */C("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4977 4.1687V8.27671C12.8647 8.06516 13.2905 7.94413 13.7445 7.94413H15.8313C17.212 7.94413 18.3313 9.06342 18.3313 10.4441V15.8333C18.3313 17.214 17.212 18.3333 15.8313 18.3333H4.16602C2.7853 18.3333 1.66602 17.214 1.66602 15.8333V4.1687C1.66602 2.78799 2.7853 1.6687 4.16602 1.6687H9.99772C11.3784 1.6687 12.4977 2.78799 12.4977 4.1687ZM4.16602 2.9187H9.99772C10.6881 2.9187 11.2477 3.47835 11.2477 4.1687V10.3154C11.2456 10.3581 11.2445 10.401 11.2445 10.4441V17.0833H9.35756V14.3186C9.35756 13.6283 8.79792 13.0686 8.10756 13.0686H6.05607C5.36572 13.0686 4.80607 13.6283 4.80607 14.3186V17.0833H4.16602C3.47566 17.0833 2.91602 16.5237 2.91602 15.8333V4.1687C2.91602 3.47835 3.47566 2.9187 4.16602 2.9187ZM12.4977 10.3532V17.0833H15.8313C16.5216 17.0833 17.0813 16.5237 17.0813 15.8333V10.4441C17.0813 9.75378 16.5216 9.19413 15.8313 9.19413H13.7445C13.0847 9.19413 12.5443 9.70531 12.4977 10.3532ZM6.05607 17.0833H8.10756V14.3186H6.05607V17.0833Z"})]});export{p as default};
@@ -1 +1 @@
1
- import{jsx as c}from"react/jsx-runtime";import g from"classnames";const m=({size:s,type:e,className:i="",onClick:a,refHandler:o,id:n,dataId:t})=>/* @__PURE__ */c("svg",{xmlns:"http://www.w3.org/2000/svg",className:g("svg-icon",{[`svg-icon__size-${s}`]:s,[`svg-icon__type-${e}`]:e,[i]:i}),viewBox:"0 0 24 24",fill:"none",onClick:a,ref:o,id:n,"data-id":t?`${t}-svg-icon`:"",children:/* @__PURE__ */c("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});export{m as default};
1
+ import{jsx as e}from"react/jsx-runtime";import a from"classnames";const l=({size:s,type:o,className:i="",onClick:r,refHandler:n,id:t,dataId:c})=>/* @__PURE__ */e("svg",{xmlns:"http://www.w3.org/2000/svg",className:a("svg-icon",{[`svg-icon__size-${s}`]:s,[`svg-icon__type-${o}`]:o,[i]:i}),viewBox:"0 0 24 24",fill:"none",onClick:r,ref:n,id:t,"data-id":c?`${c}-svg-icon`:"",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */e("path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"})});export{l as default};
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ import { ISVGIconProps } from '../../type';
3
+ declare const IconRibbon: ({ size, type, className, onClick, refHandler, id, dataId }: ISVGIconProps) => ReactElement;
4
+ export default IconRibbon;
@@ -0,0 +1 @@
1
+ import{jsx as i}from"react/jsx-runtime";import t from"classnames";const v=({size:s,type:e,className:a="",onClick:o,refHandler:C,id:n,dataId:L})=>/* @__PURE__ */i("svg",{xmlns:"http://www.w3.org/2000/svg",className:t("svg-icon",{[`svg-icon__size-${s}`]:s,[`svg-icon__type-${e}`]:e,[a]:a}),viewBox:"0 0 24 24",fill:"none",onClick:o,ref:C,id:n,"data-id":L?`${L}-svg-icon`:"",children:/* @__PURE__ */i("path",{d:"M9.99935 1.66663C13.221 1.66663 15.8327 4.2783 15.8327 7.49996C15.8327 9.08911 15.1972 10.5298 14.1665 11.5819L14.1653 17.7085C14.1653 18.185 13.6598 18.4754 13.2551 18.2649L13.1806 18.2195L9.99856 15.9797L6.81822 18.2195C6.42851 18.4939 5.89996 18.2477 5.83913 17.7956L5.83335 17.7085L5.83216 11.5819C4.80148 10.5298 4.16602 9.08911 4.16602 7.49996C4.16602 4.2783 6.77769 1.66663 9.99935 1.66663ZM12.9153 16.5042L12.9155 12.5532C12.0576 13.0493 11.0617 13.3333 9.99935 13.3333C8.93705 13.3333 7.94107 13.0493 7.08317 12.5532L7.08335 16.5039L9.6386 14.7043C9.82742 14.5714 10.0715 14.5547 10.2742 14.6544L10.3582 14.7043L12.9153 16.5042L12.9155 12.5532L12.9153 16.5042ZM9.99935 2.91663C7.46804 2.91663 5.41602 4.96865 5.41602 7.49996C5.41602 10.0313 7.46804 12.0833 9.99935 12.0833C12.5307 12.0833 14.5827 10.0313 14.5827 7.49996C14.5827 4.96865 12.5307 2.91663 9.99935 2.91663Z"})});export{v as default};
@@ -1,10 +1,10 @@
1
- import{jsxs as c,jsx as x}from"react/jsx-runtime";import r from"classnames";const v=({size:e,type:i,className:s="",onClick:n,refHandler:l,id:y,dataId:a})=>/* @__PURE__ */c("svg",{xmlns:"http://www.w3.org/2000/svg",className:r("svg-icon",{[`svg-icon__size-${e}`]:e,[`svg-icon__type-${i}`]:i,[s]:s}),viewBox:"0 0 24 24",fill:"none",onClick:n,ref:l,id:y,"data-id":a?`${a}-svg-icon`:"",children:[
2
- /* @__PURE__ */x("circle",{cx:"12",cy:"12",r:"5"})," ",
3
- /* @__PURE__ */x("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),
4
- /* @__PURE__ */x("line",{x1:"12",y1:"21",x2:"12",y2:"23"})," ",
5
- /* @__PURE__ */x("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),
6
- /* @__PURE__ */x("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"})," ",
7
- /* @__PURE__ */x("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),
8
- /* @__PURE__ */x("line",{x1:"21",y1:"12",x2:"23",y2:"12"})," ",
9
- /* @__PURE__ */x("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),
10
- /* @__PURE__ */x("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]});export{v as default};
1
+ import{jsxs as d,jsx as o}from"react/jsx-runtime";import c from"classnames";const m=({size:s,type:t,className:a="",onClick:e,refHandler:r,id:i,dataId:n})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",className:c("svg-icon",{[`svg-icon__size-${s}`]:s,[`svg-icon__type-${t}`]:t,[a]:a}),viewBox:"0 0 24 24",fill:"none",onClick:e,ref:r,id:i,"data-id":n?`${n}-svg-icon`:"",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
2
+ /* @__PURE__ */o("circle",{cx:"12",cy:"12",r:"4"}),
3
+ /* @__PURE__ */o("path",{d:"M12 2v2"}),
4
+ /* @__PURE__ */o("path",{d:"M12 20v2"}),
5
+ /* @__PURE__ */o("path",{d:"m4.93 4.93 1.41 1.41"}),
6
+ /* @__PURE__ */o("path",{d:"m17.66 17.66 1.41 1.41"}),
7
+ /* @__PURE__ */o("path",{d:"M2 12h2"}),
8
+ /* @__PURE__ */o("path",{d:"M20 12h2"}),
9
+ /* @__PURE__ */o("path",{d:"m6.34 17.66-1.41 1.41"}),
10
+ /* @__PURE__ */o("path",{d:"m19.07 4.93-1.41 1.41"})]});export{m as default};
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ import { ISVGIconProps } from '../../type';
3
+ declare const IconVacation: ({ size, type, className, onClick, refHandler, id, dataId }: ISVGIconProps) => ReactElement;
4
+ export default IconVacation;
@@ -0,0 +1 @@
1
+ import{jsx as i}from"react/jsx-runtime";import r from"classnames";const g=({size:L,type:C,className:s="",onClick:e,refHandler:a,id:o,dataId:n})=>/* @__PURE__ */i("svg",{xmlns:"http://www.w3.org/2000/svg",className:r("svg-icon",{[`svg-icon__size-${L}`]:L,[`svg-icon__type-${C}`]:C,[s]:s}),viewBox:"0 0 24 24",fill:"none",onClick:e,ref:a,id:o,"data-id":n?`${n}-svg-icon`:"",children:/* @__PURE__ */i("path",{d:"M4.6381 6.43812L0.77304 2.67828L0.729516 2.62721C0.219912 1.99775 0.317072 1.07436 0.94653 0.564757C1.51518 0.104379 2.2821 -0.0244014 2.99846 0.233786L3.15177 0.298076L8.7297 2.92244L11.4663 0.571064C12.4577 -0.280919 13.9521 -0.167922 14.8105 0.831109L14.8486 0.876814C15.6711 1.89286 15.5143 3.38335 14.4825 4.21829L11.6079 6.40945L13.0374 12.5087C13.2204 13.2893 12.9408 14.1057 12.3176 14.6102C11.6882 15.1198 10.7648 15.0227 10.2426 14.3772L10.1795 14.2899L7.292 9.69936L5.74603 10.878L5.97745 11.5533C6.21878 12.2577 5.99438 13.0378 5.41567 13.5064C4.7952 14.0087 3.88499 13.9129 3.38246 13.2922L2.94712 12.7539L2.81878 12.82C2.08181 13.1988 1.1802 13.0087 0.658807 12.3647C0.137344 11.7206 0.139499 10.799 0.663856 10.1574L0.754848 10.0461L0.318349 9.50743C-0.141596 8.93931 -0.10376 8.11971 0.429608 7.56686L0.532264 7.47442C1.05995 7.04722 1.78398 6.9596 2.42846 7.26088L2.55906 7.33121L3.17208 7.69786L4.6381 6.43812ZM1.80675 1.62729C1.76411 1.66181 1.75753 1.72436 1.77898 1.75134L6.66323 6.50043L3.31584 9.37682L1.88774 8.52161L1.81934 8.48426C1.67933 8.41903 1.51333 8.43912 1.42459 8.50927L1.38458 8.54419C1.3581 8.57173 1.35603 8.61652 1.38067 8.64696L2.5173 10.0495L1.72246 11.0225C1.60794 11.1626 1.60747 11.3639 1.72134 11.5045C1.83539 11.6454 2.03263 11.687 2.19351 11.6043L3.31055 11.0294L4.44519 12.4322C4.47244 12.4659 4.5218 12.4711 4.55545 12.4438C4.68803 12.3365 4.73944 12.1578 4.68416 11.9964L4.13317 10.3885L7.65274 7.70528L11.302 13.5119L11.3177 13.533C11.3522 13.5756 11.4148 13.5822 11.4574 13.5477C11.673 13.3732 11.7697 13.0907 11.7064 12.8207L10.0748 5.8591L13.638 3.1434C14.0673 2.79591 14.1336 2.16621 13.7924 1.74478L13.7672 1.71449C13.4073 1.29574 12.7761 1.24801 12.3573 1.60793L8.94897 4.53646L2.59934 1.54816L2.50591 1.50865C2.26884 1.42348 2.00344 1.46805 1.80675 1.62729Z"})});export{g as default};
@@ -1,4 +1,4 @@
1
- import{jsx as t,Fragment as y,jsxs as z}from"react/jsx-runtime";import{useState as c,useId as G,useCallback as h}from"react";import{createPortal as H}from"react-dom";import{useHideOnScroll as L}from"../../../hooks/useHideOnScroll.js";import"../../../context/types.js";import{useOnOutsideClick as A}from"../../../hooks/useOnOutsideClick.js";import"../../../hooks/useScreenSize.js";import"react-hook-form";import{FilterDropdownContent as B}from"./FilterDropdown.js";import{FilterGroupDropdownContent as q}from"./FilterGroupDropdown.js";import{Footer as E}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 J}from"../SharedComponents/Loading.js";import{Input as K}from"../../Input/Input.js";import M from"../../SVGIcons/IconSearchFilled.js";import Q from"../../SVGIcons/IconDismissFilled.js";const Se=e=>{const{isLoading:o,isGrouped:s,options:r,isOpen:l,setFieldValue:n,name:a,footerButtonProps:i,selectedItems:p,setSelectedItems:m,closeHandler:d,parentRef:u,language:f="en",...j}=e,[C,S]=c(null),[F,I]=c(p),[g,k]=c("");A(C,d,l,G()),L(d);const v=h(e=>{I(o=>[...o,e])},[]),x=e=>{m&&m(e),a&&n&&n(a,e),d()},D=e=>void 0!==F.find(o=>o.value===e),_=h(()=>{x(F),d()},[F]),O=({value:e})=>{I(o=>o.filter(o=>o.value!==e))};return l?/* @__PURE__ */t(y,{children:H(
2
- /* @__PURE__ */t("div",{className:"select filter",children:/* @__PURE__ */z("div",{className:"select__options",ref:S,children:[
3
- /* @__PURE__ */t(K,{onChange:e=>{e.preventDefault(),e.stopPropagation(),k(e.target.value)},className:"filter__input",size:"small",currentValue:g,rightIconProps:{size:""===g?"small":"xsmall",Component:""===g?M:Q,onClick:()=>{k("")}}}),
4
- /* @__PURE__ */t("div",{className:"select__options__scroll scrollbar scrollbar--vertical ",children:o?/* @__PURE__ */t(J,{}):/* @__PURE__ */t(s?q:B,{checkIsSelected:D,onItemDeselect:O,filterValue:g,onItemSelect:v,options:r,...j})}),o?null:/* @__PURE__ */t(E,{buttonProps:i,onCancel:()=>{x(p),I(p),d()},onApply:_,language:f})]})}),u)}):null};export{Se as FilterSelect};
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(
2
+ /* @__PURE__ */t("div",{className:"select filter",children:/* @__PURE__ */w("div",{className:"select__options",ref:F,children:[
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};
@@ -1,2 +1,2 @@
1
- import{jsx as l}from"react/jsx-runtime";import{Modal as m}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";const y=o=>{const{applySelectedItems:e,isOpen:t,closeDrodown:s,children:r,modalApplyButtonText:p="Apply"}=o;/* @__PURE__ */
2
- return l(m,{isOpen:t,onClose:s,onSubmit:()=>{e(!1)},isMobileFullScreen:!0,className:"select__modal",buttonProps:{confirm:{buttonText:p}},children:r})};export{y 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__ */
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,5 +1,5 @@
1
- import{jsxs as $,Fragment as ee,jsx as c}from"react/jsx-runtime";import{useState as p,useRef as O,useEffect as R,useCallback as T,useMemo as N}from"react";import{Empty as te}from"../../../Empty/Empty.js";import{OptionItem as le}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 oe}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 I,DROPDOWN_HEIGHT as P}from"../../constants.js";const xe=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:b,maxSelectCount:g,menuOptions:x,dataIdPrefix:C,dropdownWidth:S,applySelectedItems:w}=e,{emptyListMainMessage:y,emptyListSecondaryMessage:v}=n||{},[D,j]=p(!1),[_,k]=p(""),[M,E]=p(!1),[L,A]=p(0),z=O(null),W=O(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(D&&null!==L){e.preventDefault();const t=B[L];if(!t)return;Z(t.value)?K(t):r(t)}break;case"Enter":e.preventDefault(),w();break;case"Escape":o();break;default:j(!1)}};R(()=>{W.current&&W.current.scrollToItem(L,"smart")},[L]);const G=T(()=>{E(!1),u([])},[]),B=N(()=>{if(!_){const e=d.map(e=>e.value),t=a.filter(t=>-1===e.indexOf(t.value));return[...d,...t]}return a.filter(e=>"string"==typeof e.label&&e.label.toLocaleLowerCase().includes(_.toLocaleLowerCase()))},[_,a,d]),F=T(()=>{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)};R(()=>{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:b,labelRightIconComponent:f}),[h,b,f]);/* @__PURE__ */
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
2
  return $(ee,{children:[
3
- /* @__PURE__ */c(se,{closeDropdown:o,dataIdPrefix:C,menuOptions:x,selectAll:F,clearAll:G,hasLimitation:!!g,isAnySelected:0!==d.length,helperText:l,isSearchAvailable:m,isSelectAllDisabled:M||0===B.length,setSearchValue:k,searchValue:_,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?oe:H,children:B.length>0&&/* @__PURE__ */c(ne,{ref:W,height:t?window.innerHeight-80-73-24:B.length*I>P?P:B.length*I,itemCount:B.length,itemSize:t?ae:I,width:t?window.innerWidth:S||re,style:{width:S||"100%"},children:({index:e,style:o})=>{const s=B[e],a=Z(s.value),l=e===L;/* @__PURE__ */
5
- return c(le,{size:t?"large":"small",data:s,dataId:s.dataId,onClick:a?K:r,disabled:s.disabled||!a&&d.length===g,isSelected:a,style:o,className:V("option",{"option--active":l}),...U})}})}),0===B.length?/* @__PURE__ */c(te,{size:"small",mainMessage:y,paragraphMessage:v}):null]})};export{xe as MultiBase};
3
+ /* @__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};
@@ -1,7 +1,7 @@
1
- import{jsxs as m,Fragment as Q,jsx as l}from"react/jsx-runtime";import{useState as u,useMemo as g,useCallback as L}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 k}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";const Ne=e=>{const{isMobile:t,options:o,helperText:s,translations:a,selectedValues:r,onItemSelect:i,onItemDeselect:n,setSelectedValues:c,isSearchAvailable:p,labelLeftIconProps:d,scrollableContentStyle:h,optionRightIconComponent:C,labelRightIconComponent:I,maxSelectCount:b,menuOptions:x,dataIdPrefix:f,closeDropdown:v}=e,{emptyListMainMessage:S,emptyListSecondaryMessage:j}=a,[_,y]=u(""),[D,N]=u(0),[M,G]=u(!1),[T,z]=u(null),{scrollHeight:A}=te(T),O=g(()=>_?o.reduce((e,t)=>{const{data:l,title:o}=t,s=l.filter(e=>"string"==typeof e.label&&e.label.toLocaleLowerCase().includes(_.toLocaleLowerCase()));return s.length?[...e,{title:o,data:s}]:e},[]):o,[_,o]),E=L(()=>{G(!1),c([])},[]),V=L(()=>{G(!0);const e=O.reduce((e,{data:t})=>[...e,...t.map(e=>({value:e.value,label:e.label}))],[]);c(e)},[O]),w=g(()=>o.reduce((e,t)=>{const{data:l}=t;return[...e,...l.filter(e=>-1!==r.findIndex(t=>t.value===e.value))]},[]),[o,r]),P=e=>{G(!1),n(e)},R=g(()=>({isCheckbox:!0,labelLeftIconProps:d,optionRightIconComponent:C,labelRightIconComponent:I,className:"group-item__option"}),[d,C,I]),H=p||s;/* @__PURE__ */
2
- return m(Q,{children:[H?/* @__PURE__ */l(le,{closeDropdown:v,dataIdPrefix:f,menuOptions:x,isSearchAvailable:p||t,hasLimitation:!!b,selectAll:V,clearAll:E,isAnySelected:0!==r.length,helperText:s,isSelectAllDisabled:M||0===O.length,setSearchValue:y,searchValue:_,translations:a}):null,
3
- /* @__PURE__ */l("div",{ref:z,className:"select__options__scroll scrollbar scrollbar--vertical "+(A>oe?"mr-6":""),style:h,children:/* @__PURE__ */m("div",{children:[p&&/* @__PURE__ */l("div",{className:"selected-items",children:w.map(e=>/* @__PURE__ */l(k,{isSelected:!0,data:e,onClick:P,disabled:e.disabled,...R},e.value))}),H?/* @__PURE__ */l(Z,{type:"primary",isHorizontal:!0}):null,O.map(({title:e,data:t},o)=>{var s;const a=o===D;/* @__PURE__ */
4
- return m("div",{className:"select__group group-item",children:[
5
- /* @__PURE__ */m("div",{onClick:()=>(e=>{N(D!=e?e:null)})(o),className:"group-item__top",children:[
6
- /* @__PURE__ */l(Y,{size:"xxsmall",type:"tertiary",className:"group-item__title pr-4",children:e}),/* @__PURE__ */l(a?re:se,{size:"xxsmall",className:"group-item__icon"})]}),a&&t.map(e=>{const t=-1!==r.findIndex(t=>t.value===e.value);/* @__PURE__ */
7
- return l(k,{data:e,dataId:e.dataId,isSelected:t,disabled:e.disabled||!t&&r.length===b,onClick:t?P:i,...R},e.value)})]},`${null==(s=t[0])?void 0:s.value}_${o}`)})]})}),0===O.length?/* @__PURE__ */l(ee,{size:"small",mainMessage:S,paragraphMessage:j}):null]})};export{Ne as MultiSelectGrouped};
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:[
5
+ /* @__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};
@@ -1,7 +1,7 @@
1
- import{jsxs as T,Fragment as K,jsx as a}from"react/jsx-runtime";import{useState as p,useMemo as u,useCallback as A}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 D}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";const ye=e=>{const{options:t,scrollableContentStyle:s,selectedValues:o,onItemSelect:l,onItemDeselect:i,setSelectedValues:n,labelLeftIconProps:r,optionRightIconComponent:c,labelRightIconComponent:m,helperText:d,translations:h,isSearchAvailable:b,maxSelectCount:f,menuOptions:C,dataIdPrefix:I,closeDropdown:v}=e,{emptyListMainMessage:S,emptyListSecondaryMessage:x}=h,[g,j]=p(null),[y,k]=p(0),{scrollHeight:L}=Z(g),[M,O]=p(!1),[_,z]=p(""),E=t[y].data,w=u(()=>_?E.filter(e=>"string"==typeof e.label&&e.label.toLocaleLowerCase().includes(_.toLocaleLowerCase())):E,[_,E]),G=A(()=>{O(!1);const e=o.filter(e=>-1===E.map(e=>e.value).indexOf(e.value));n(e)},[o,y,E]),P=e=>{O(!1),i(e)},R=A(()=>{O(!0);const e=w.map(e=>{const{value:t,label:a}=e;return{value:t,label:a}});n(o.concat(e))},[y,o,w]),V=u(()=>t.map((e,t)=>({label:e.title,value:t})),[t]),H=u(()=>t.reduce((e,t)=>{const{data:a}=t;return[...e,...a.filter(e=>-1!==o.findIndex(t=>t.value===e.value))]},[]),[t,o]),N=u(()=>({isCheckbox:!0,labelLeftIconProps:r,optionRightIconComponent:c,labelRightIconComponent:m}),[r,c,m]);/* @__PURE__ */
2
- return T(K,{children:[
3
- /* @__PURE__ */a("div",{className:"tab_container",style:{padding:"0 20px",width:"100%"},children:/* @__PURE__ */a(Y,{selectedValue:y,tabItems:V,onSelect:e=>{k(e),z("")},size:"small"})}),
4
- /* @__PURE__ */a(ee,{closeDropdown:v,dataIdPrefix:I,menuOptions:C,isSearchAvailable:b,clearAll:G,selectAll:R,helperText:d,searchValue:_,translations:h,setSearchValue:z,hasLimitation:!!f,isAnySelected:0===o.length,isSelectAllDisabled:M||0===w.length}),
5
- /* @__PURE__ */T("div",{ref:j,className:"select__options__scroll scrollbar scrollbar--vertical "+(L>te?"mr-6":""),style:s,children:[b&&/* @__PURE__ */a("div",{className:"selected_container",children:H.map(e=>/* @__PURE__ */a(D,{data:e,onClick:P,disabled:e.disabled,isSelected:!0,...N},e.value))}),
6
- /* @__PURE__ */a(Q,{type:"primary",isHorizontal:!0}),w.map(e=>{const t=-1!==o.findIndex(t=>t.value===e.value);/* @__PURE__ */
7
- return a(D,{data:e,dataId:e.dataId,onClick:t?P:l,disabled:e.disabled||!t&&o.length===f,isSelected:t,...N},e.value)}),0===w.length?/* @__PURE__ */a(U,{size:"small",mainMessage:S,paragraphMessage:x}):null]})]})};export{ye as MultiSelectWithTabs};
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:[
3
+ /* @__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
+ /* @__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
+ /* @__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};