@chayns-components/core 5.0.24 → 5.0.26

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 (114) hide show
  1. package/lib/cjs/components/accordion/accordion-body/AccordionBody.js +1 -6
  2. package/lib/cjs/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  3. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js +0 -27
  4. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  5. package/lib/cjs/components/accordion/accordion-content/AccordionContent.js +6 -13
  6. package/lib/cjs/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  7. package/lib/cjs/components/accordion/accordion-content/AccordionContent.styles.js +0 -27
  8. package/lib/cjs/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  9. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +5 -1
  10. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  11. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +37 -0
  12. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  13. package/lib/cjs/components/combobox/ComboBox.js +6 -13
  14. package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
  15. package/lib/cjs/components/combobox/ComboBox.styles.js +1 -36
  16. package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
  17. package/lib/cjs/components/combobox/ComboBox.types.js +12 -0
  18. package/lib/cjs/components/combobox/ComboBox.types.js.map +1 -0
  19. package/lib/cjs/components/combobox/combobox-item/ComboBoxItem.js.map +1 -1
  20. package/lib/cjs/components/filter/filter-content/FIlterContent.js.map +1 -1
  21. package/lib/cjs/components/list/List.js +97 -37
  22. package/lib/cjs/components/list/List.js.map +1 -1
  23. package/lib/cjs/components/list/list-item/ListItem.js +0 -9
  24. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  25. package/lib/cjs/components/number-input/NumberInput.js +213 -132
  26. package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
  27. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.js +1 -4
  28. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.js.map +1 -1
  29. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js +0 -34
  30. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js.map +1 -1
  31. package/lib/cjs/components/scroll-view/ScrollView.js +10 -16
  32. package/lib/cjs/components/scroll-view/ScrollView.js.map +1 -1
  33. package/lib/cjs/components/scroll-view/ScrollView.styles.js +3 -38
  34. package/lib/cjs/components/scroll-view/ScrollView.styles.js.map +1 -1
  35. package/lib/cjs/components/search-box/SearchBox.styles.js +2 -29
  36. package/lib/cjs/components/search-box/SearchBox.styles.js.map +1 -1
  37. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js +2 -6
  38. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
  39. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js +0 -27
  40. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  41. package/lib/cjs/components/text-area/TextArea.js +2 -6
  42. package/lib/cjs/components/text-area/TextArea.js.map +1 -1
  43. package/lib/cjs/components/text-area/TextArea.styles.js +2 -31
  44. package/lib/cjs/components/text-area/TextArea.styles.js.map +1 -1
  45. package/lib/cjs/index.js +3 -2
  46. package/lib/cjs/index.js.map +1 -1
  47. package/lib/cjs/utils/calculate.js.map +1 -1
  48. package/lib/cjs/utils/numberInput.js +1 -0
  49. package/lib/cjs/utils/numberInput.js.map +1 -1
  50. package/lib/esm/components/accordion/accordion-body/AccordionBody.js +1 -6
  51. package/lib/esm/components/accordion/accordion-body/AccordionBody.js.map +1 -1
  52. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +0 -27
  53. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  54. package/lib/esm/components/accordion/accordion-content/AccordionContent.js +6 -13
  55. package/lib/esm/components/accordion/accordion-content/AccordionContent.js.map +1 -1
  56. package/lib/esm/components/accordion/accordion-content/AccordionContent.styles.js +0 -27
  57. package/lib/esm/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
  58. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +6 -2
  59. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  60. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +38 -1
  61. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  62. package/lib/esm/components/combobox/ComboBox.js +5 -12
  63. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  64. package/lib/esm/components/combobox/ComboBox.styles.js +1 -36
  65. package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
  66. package/lib/esm/components/combobox/ComboBox.types.js +6 -0
  67. package/lib/esm/components/combobox/ComboBox.types.js.map +1 -0
  68. package/lib/esm/components/combobox/combobox-item/ComboBoxItem.js.map +1 -1
  69. package/lib/esm/components/filter/filter-content/FIlterContent.js.map +1 -1
  70. package/lib/esm/components/list/List.js +97 -37
  71. package/lib/esm/components/list/List.js.map +1 -1
  72. package/lib/esm/components/list/list-item/ListItem.js +0 -9
  73. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  74. package/lib/esm/components/number-input/NumberInput.js +213 -132
  75. package/lib/esm/components/number-input/NumberInput.js.map +1 -1
  76. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.js +2 -5
  77. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.js.map +1 -1
  78. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js +0 -34
  79. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js.map +1 -1
  80. package/lib/esm/components/scroll-view/ScrollView.js +10 -16
  81. package/lib/esm/components/scroll-view/ScrollView.js.map +1 -1
  82. package/lib/esm/components/scroll-view/ScrollView.styles.js +3 -38
  83. package/lib/esm/components/scroll-view/ScrollView.styles.js.map +1 -1
  84. package/lib/esm/components/search-box/SearchBox.styles.js +1 -28
  85. package/lib/esm/components/search-box/SearchBox.styles.js.map +1 -1
  86. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js +2 -6
  87. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.js.map +1 -1
  88. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js +0 -27
  89. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  90. package/lib/esm/components/text-area/TextArea.js +2 -6
  91. package/lib/esm/components/text-area/TextArea.js.map +1 -1
  92. package/lib/esm/components/text-area/TextArea.styles.js +1 -30
  93. package/lib/esm/components/text-area/TextArea.styles.js.map +1 -1
  94. package/lib/esm/index.js +2 -1
  95. package/lib/esm/index.js.map +1 -1
  96. package/lib/esm/utils/calculate.js.map +1 -1
  97. package/lib/esm/utils/numberInput.js +1 -0
  98. package/lib/esm/utils/numberInput.js.map +1 -1
  99. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +0 -2
  100. package/lib/types/components/accordion/accordion-content/AccordionContent.styles.d.ts +0 -2
  101. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.styles.d.ts +7 -3
  102. package/lib/types/components/combobox/ComboBox.d.ts +2 -139
  103. package/lib/types/components/combobox/ComboBox.styles.d.ts +1 -3
  104. package/lib/types/components/combobox/ComboBox.types.d.ts +139 -0
  105. package/lib/types/components/combobox/combobox-item/ComboBoxItem.d.ts +1 -1
  106. package/lib/types/components/list/List.d.ts +0 -1
  107. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +0 -2
  108. package/lib/types/components/scroll-view/ScrollView.styles.d.ts +0 -2
  109. package/lib/types/components/search-box/SearchBox.styles.d.ts +0 -2
  110. package/lib/types/components/search-box/search-box-body/SearchBoxBody.styles.d.ts +0 -2
  111. package/lib/types/components/text-area/TextArea.styles.d.ts +0 -2
  112. package/lib/types/index.d.ts +3 -1
  113. package/lib/types/utils/calculate.d.ts +1 -1
  114. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.styles.js","names":["styled","css","StyledTextArea","div","$isDisabled","StyledTextAreaContentWrapper","theme","$shouldChangeColor","colorMode","$isInvalid","wrong","StyledTextAreaContent","StyledTextAreaInput","textarea","text","$isOverflowing","$maxHeight","$minHeight","$browser","StyledTextAreaLabelWrapper","label","StyledTextAreaLabel"],"sources":["../../../../src/components/text-area/TextArea.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport { BrowserName } from '../../types/chayns';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { TextAreaProps } from './TextArea';\n\ntype StyledTextAreaProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledTextArea = styled.div<StyledTextAreaProps>`\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n position: relative;\n`;\n\ntype StyledTextAreaContentWrapperProps = WithTheme<{\n $isInvalid: TextAreaProps['isInvalid'];\n $shouldChangeColor: boolean;\n}>;\n\nexport const StyledTextAreaContentWrapper = styled.div<StyledTextAreaContentWrapperProps>`\n background-color: ${({ theme, $shouldChangeColor }: StyledTextAreaContentWrapperProps) =>\n theme.colorMode === 'classic' || $shouldChangeColor ? theme['000'] : theme['100']};\n border-radius: 3px;\n border: 1px solid\n ${({ theme, $isInvalid }: StyledTextAreaContentWrapperProps) =>\n $isInvalid ? theme.wrong : 'rgba(160, 160, 160, 0.3)'};\n width: 100%;\n display: flex;\n`;\n\nexport const StyledTextAreaContent = styled.div`\n position: relative;\n display: flex;\n width: 100%;\n`;\n\ntype StyledTextAreaInputProps = WithTheme<{\n $browser: BrowserName;\n $isInvalid: TextAreaProps['isInvalid'];\n $isOverflowing: boolean;\n $maxHeight: CSSProperties['maxHeight'];\n $minHeight: CSSProperties['minHeight'];\n}>;\n\nexport const StyledTextAreaInput = styled.textarea<StyledTextAreaInputProps>`\n color: ${({ theme, $isInvalid }: StyledTextAreaInputProps) =>\n $isInvalid ? theme.wrong : theme.text};\n background: none;\n border: none;\n resize: none;\n overflow-y: ${({ $isOverflowing }) => ($isOverflowing ? 'scroll' : 'hidden')};\n max-height: ${({ $maxHeight }: StyledTextAreaInputProps) =>\n typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n min-height: ${({ $minHeight }: StyledTextAreaInputProps) =>\n typeof $minHeight === 'number' ? `${$minHeight}px` : $minHeight};\n width: 100%;\n padding: 8px 10px;\n cursor: text;\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledTextAreaInputProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n background-clip: padding-box;\n border: solid 3px transparent;\n }\n `}\n`;\n\nexport const StyledTextAreaLabelWrapper = styled.label`\n left: 10px;\n top: 12px;\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n line-height: 1.3;\n pointer-events: none;\n position: absolute;\n user-select: none;\n width: calc(100% - 20px);\n cursor: text;\n`;\n\ntype StyledTextAreaLabelProps = WithTheme<{ $isInvalid?: TextAreaProps['isInvalid'] }>;\n\nexport const StyledTextAreaLabel = styled.label<StyledTextAreaLabelProps>`\n color: ${({ theme, $isInvalid }: StyledTextAreaLabelProps) =>\n $isInvalid ? theme.wrong : `rgba(${theme['text-rgb'] ?? ''}, 0.45)`};\n line-height: 1.3;\n width: 100%;\n white-space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AAM,CAAC;EAAEC,QAAQ;EAAEZ;AAAgC,CAAC,KAC5CY,QAAQ,KAAK,SAAS,GAChBjB,GAAG;AACjB,0CAA0CK,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDL,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CK,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA;AACA;AACA,eAAe;AACf,CAAC;AAED,OAAO,MAAMa,0BAA0B,GAAGnB,MAAM,CAACoB,KAAK;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAID,OAAO,MAAMC,mBAAmB,GAAGrB,MAAM,CAACoB,KAA+B;AACzE,aAAa,CAAC;EAAEd,KAAK;EAAEG;AAAqC,CAAC,KACrDA,UAAU,GAAGH,KAAK,CAACI,KAAK,GAAG,QAAQJ,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"TextArea.styles.js","names":["styled","StyledTextArea","div","$isDisabled","StyledTextAreaContentWrapper","theme","$shouldChangeColor","colorMode","$isInvalid","wrong","StyledTextAreaContent","StyledTextAreaInput","textarea","text","$isOverflowing","$maxHeight","$minHeight","StyledTextAreaLabelWrapper","label","StyledTextAreaLabel"],"sources":["../../../../src/components/text-area/TextArea.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { TextAreaProps } from './TextArea';\n\ntype StyledTextAreaProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledTextArea = styled.div<StyledTextAreaProps>`\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n position: relative;\n`;\n\ntype StyledTextAreaContentWrapperProps = WithTheme<{\n $isInvalid: TextAreaProps['isInvalid'];\n $shouldChangeColor: boolean;\n}>;\n\nexport const StyledTextAreaContentWrapper = styled.div<StyledTextAreaContentWrapperProps>`\n background-color: ${({ theme, $shouldChangeColor }: StyledTextAreaContentWrapperProps) =>\n theme.colorMode === 'classic' || $shouldChangeColor ? theme['000'] : theme['100']};\n border-radius: 3px;\n border: 1px solid\n ${({ theme, $isInvalid }: StyledTextAreaContentWrapperProps) =>\n $isInvalid ? theme.wrong : 'rgba(160, 160, 160, 0.3)'};\n width: 100%;\n display: flex;\n`;\n\nexport const StyledTextAreaContent = styled.div`\n position: relative;\n display: flex;\n width: 100%;\n`;\n\ntype StyledTextAreaInputProps = WithTheme<{\n $isInvalid: TextAreaProps['isInvalid'];\n $isOverflowing: boolean;\n $maxHeight: CSSProperties['maxHeight'];\n $minHeight: CSSProperties['minHeight'];\n}>;\n\nexport const StyledTextAreaInput = styled.textarea<StyledTextAreaInputProps>`\n color: ${({ theme, $isInvalid }: StyledTextAreaInputProps) =>\n $isInvalid ? theme.wrong : theme.text};\n background: none;\n border: none;\n resize: none;\n overflow-y: ${({ $isOverflowing }) => ($isOverflowing ? 'scroll' : 'hidden')};\n max-height: ${({ $maxHeight }: StyledTextAreaInputProps) =>\n typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n min-height: ${({ $minHeight }: StyledTextAreaInputProps) =>\n typeof $minHeight === 'number' ? `${$minHeight}px` : $minHeight};\n width: 100%;\n padding: 8px 10px;\n cursor: text;\n`;\n\nexport const StyledTextAreaLabelWrapper = styled.label`\n left: 10px;\n top: 12px;\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n line-height: 1.3;\n pointer-events: none;\n position: absolute;\n user-select: none;\n width: calc(100% - 20px);\n cursor: text;\n`;\n\ntype StyledTextAreaLabelProps = WithTheme<{ $isInvalid?: TextAreaProps['isInvalid'] }>;\n\nexport const StyledTextAreaLabel = styled.label<StyledTextAreaLabelProps>`\n color: ${({ theme, $isInvalid }: StyledTextAreaLabelProps) =>\n $isInvalid ? theme.wrong : `rgba(${theme['text-rgb'] ?? ''}, 0.45)`};\n line-height: 1.3;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n cursor: text;\n text-overflow: ellipsis;\n`;\n"],"mappings":"AACA,OAAOA,MAAM,MAAM,mBAAmB;AAMtC,OAAO,MAAMC,cAAc,GAAGD,MAAM,CAACE,GAAwB;AAC7D;AACA;AACA;AACA,eAAe,CAAC;EAAEC;AAAY,CAAC,KAAMA,WAAW,GAAG,GAAG,GAAG,CAAE;AAC3D;AACA,CAAC;AAOD,OAAO,MAAMC,4BAA4B,GAAGJ,MAAM,CAACE,GAAsC;AACzF,wBAAwB,CAAC;EAAEG,KAAK;EAAEC;AAAsD,CAAC,KACjFD,KAAK,CAACE,SAAS,KAAK,SAAS,IAAID,kBAAkB,GAAGD,KAAK,CAAC,KAAK,CAAC,GAAGA,KAAK,CAAC,KAAK,CAAC;AACzF;AACA;AACA,UAAU,CAAC;EAAEA,KAAK;EAAEG;AAA8C,CAAC,KACvDA,UAAU,GAAGH,KAAK,CAACI,KAAK,GAAG,0BAA0B;AACjE;AACA;AACA,CAAC;AAED,OAAO,MAAMC,qBAAqB,GAAGV,MAAM,CAACE,GAAG;AAC/C;AACA;AACA;AACA,CAAC;AASD,OAAO,MAAMS,mBAAmB,GAAGX,MAAM,CAACY,QAAkC;AAC5E,aAAa,CAAC;EAAEP,KAAK;EAAEG;AAAqC,CAAC,KACrDA,UAAU,GAAGH,KAAK,CAACI,KAAK,GAAGJ,KAAK,CAACQ,IAAI;AAC7C;AACA;AACA;AACA,kBAAkB,CAAC;EAAEC;AAAe,CAAC,KAAMA,cAAc,GAAG,QAAQ,GAAG,QAAS;AAChF,kBAAkB,CAAC;EAAEC;AAAqC,CAAC,KACnD,OAAOA,UAAU,KAAK,QAAQ,GAAG,GAAGA,UAAU,IAAI,GAAGA,UAAU;AACvE,kBAAkB,CAAC;EAAEC;AAAqC,CAAC,KACnD,OAAOA,UAAU,KAAK,QAAQ,GAAG,GAAGA,UAAU,IAAI,GAAGA,UAAU;AACvE;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,0BAA0B,GAAGjB,MAAM,CAACkB,KAAK;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAID,OAAO,MAAMC,mBAAmB,GAAGnB,MAAM,CAACkB,KAA+B;AACzE,aAAa,CAAC;EAAEb,KAAK;EAAEG;AAAqC,CAAC,KACrDA,UAAU,GAAGH,KAAK,CAACI,KAAK,GAAG,QAAQJ,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
package/lib/esm/index.js CHANGED
@@ -22,7 +22,7 @@ export { default as AnimatedNumber } from './components/animated-number/Animated
22
22
  export { default as FileList } from './components/file-list/FileList';
23
23
  export { default as FileSelect } from './components/file-select/FileSelect';
24
24
  export { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';
25
- export { default as ComboBox, ComboBoxSize } from './components/combobox/ComboBox';
25
+ export { default as ComboBox } from './components/combobox/ComboBox';
26
26
  export { default as ContentCard } from './components/content-card/ContentCard';
27
27
  export { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';
28
28
  export { default as ContextMenu } from './components/context-menu/ContextMenu';
@@ -77,4 +77,5 @@ export { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './util
77
77
  export { isTobitEmployee } from './utils/isTobitEmployee';
78
78
  export { getUsableHeight } from './utils/pageProvider';
79
79
  export { uploadFile } from './utils/uploadFile';
80
+ export { ComboBoxSize } from './components/combobox/ComboBox.types';
80
81
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","VerificationBadge","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","useColorScheme","BadgeSize","BadgeDesign","useContainer","ContainerAnchor","DropdownDirection","useIsMeasuredClone","useCombinedRefs","Filter","AnimatedNumber","FileList","FileSelect","DropdownBodyWrapper","ComboBox","ComboBoxSize","ContentCard","HighlightSlider","ContextMenu","ContextMenuAlignment","ExpandableContent","FileInput","STREAMINGSERVICE_FILE_TYPES","TSIMG_FILE_TYPES","FilterButton","FilterButtons","GridImage","GroupedImage","Icon","Input","InputSize","List","ListItemContent","ListItem","MentionFinder","MultiActionButton","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","PopupAlignment","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingContextMenu","SharingBar","SharingButton","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ContentCardType","isValidFileType","FilterButtonItemShape","FilterButtonSize","MultiActionButtonHeight","MultiActionButtonStatusType","ClampPosition","useIsTouch","filterFilesByMimeType","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport {\n default as ComboBox,\n type ComboBoxTextStyles,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n type ComboBoxRef,\n ComboBoxSize,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\n"],"mappings":"AAAA;;AAEA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,O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ccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","VerificationBadge","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","useColorScheme","BadgeSize","BadgeDesign","useContainer","ContainerAnchor","DropdownDirection","useIsMeasuredClone","useCombinedRefs","Filter","AnimatedNumber","FileList","FileSelect","DropdownBodyWrapper","ComboBox","ContentCard","HighlightSlider","ContextMenu","ContextMenuAlignment","ExpandableContent","FileInput","STREAMINGSERVICE_FILE_TYPES","TSIMG_FILE_TYPES","FilterButton","FilterButtons","GridImage","GroupedImage","Icon","Input","InputSize","List","ListItemContent","ListItem","MentionFinder","MultiActionButton","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","PopupAlignment","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingContextMenu","SharingBar","SharingButton","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ContentCardType","isValidFileType","FilterButtonItemShape","FilterButtonSize","MultiActionButtonHeight","MultiActionButtonStatusType","ClampPosition","useIsTouch","filterFilesByMimeType","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile","ComboBoxSize"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { ComboBoxSize } from './components/combobox/ComboBox.types';\nexport type {\n IComboBoxItem as ComboBoxItem,\n ComboBoxTextStyles,\n IComboBoxItems as ComboBoxItems,\n ComboBoxRef,\n} from './components/combobox/ComboBox.types';\n"],"mappings":"AAAA;;AAEA,SAASA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sBAAsB;AACtD,SAASC,UAAU,QAAQ,oBAAoB;AAE/C,SAASC,YAAY,QAAQ,sCAAsC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"calculate.js","names":["ChaynsProvider","React","renderToString","ColorSchemeProvider","calculateMaxComboBoxItemWidth","functions","list","shouldShowBigImage","values","length","forEach","icons","imageUrl","rightElement","subtext","suffixElement","text","textStyles","tagName","styles","div","document","createElement","Object","assign","style","display","gap","position","visibility","whiteSpace","width","body","appendChild","innerText","innerHTML","data","isModule","offsetWidth","trim","push","removeChild","Math","max","apply","calculateBiggestWidth","elements","container","padding","id","element","accessKey","calculateContentHeight","heights","offsetHeight","reduce","partialSum","a","getHeightOfSingleTextLine","height","getBoundingClientRect","getMaxHeightInPixels","maxHeight","rootElement","tempElement"],"sources":["../../../src/utils/calculate.tsx"],"sourcesContent":["import { ChaynsProvider, ChaynsReactFunctions, ChaynsReactValues } from 'chayns-api';\nimport React, { type CSSProperties } from 'react';\nimport { renderToString } from 'react-dom/server';\nimport ColorSchemeProvider from '../components/color-scheme-provider/ColorSchemeProvider';\nimport type { IComboBoxItem } from '../components/combobox/ComboBox';\nimport type { SliderButtonItem } from '../types/slider-button';\n\ninterface CalculateMaxComboBoxItemWidthOptions {\n functions: ChaynsReactFunctions;\n list: IComboBoxItem[];\n shouldShowBigImage?: boolean;\n values: ChaynsReactValues;\n}\n\nexport const calculateMaxComboBoxItemWidth = ({\n functions,\n list,\n shouldShowBigImage,\n values,\n}: CalculateMaxComboBoxItemWidthOptions) => {\n const length: number[] = [];\n\n list.forEach(({ icons, imageUrl, rightElement, subtext, suffixElement, text, textStyles }) => {\n const tagName = textStyles?.tagName ?? 'div';\n const styles = textStyles?.styles;\n\n const div = document.createElement(tagName);\n\n if (styles) {\n Object.assign(div.style, styles);\n }\n\n div.style.display = 'flex';\n div.style.gap = '10px';\n div.style.position = 'absolute';\n div.style.visibility = 'hidden';\n div.style.whiteSpace = 'nowrap';\n div.style.width = 'auto';\n\n document.body.appendChild(div);\n\n div.innerText = text;\n\n if (rightElement) {\n // ColorSchemeProvider is used to prevent missing scheme context error.\n // Due to the fact that the element is never rendered visible, the values are irrelevant.\n div.innerHTML += renderToString(\n <ChaynsProvider data={values} functions={functions} isModule>\n <ColorSchemeProvider>{rightElement}</ColorSchemeProvider>\n </ChaynsProvider>,\n );\n }\n\n if (suffixElement) {\n // ColorSchemeProvider is used to prevent missing scheme context error.\n // Due to the fact that the element is never rendered visible, the values are irrelevant.\n div.innerHTML += renderToString(\n <ChaynsProvider data={values} functions={functions} isModule>\n <ColorSchemeProvider>{suffixElement}</ColorSchemeProvider>\n </ChaynsProvider>,\n );\n }\n\n let width = div.offsetWidth;\n\n if (icons && icons.length > 0) {\n width += 20 + 10; // icon width + gap\n }\n\n if (imageUrl) {\n width +=\n (shouldShowBigImage || (typeof subtext === 'string' && subtext.trim() !== '')\n ? 40\n : 22) + 10; // image width + gap\n }\n\n length.push(width);\n\n document.body.removeChild(div);\n });\n\n return Math.max.apply(null, length);\n};\n\nexport const calculateBiggestWidth = (elements: SliderButtonItem[]) => {\n const container = document.createElement('div');\n\n container.style.visibility = 'hidden';\n container.style.position = 'absolute';\n container.style.width = 'auto';\n container.style.whiteSpace = 'nowrap';\n container.style.padding = '7px 12px';\n container.style.display = 'block';\n\n elements.forEach(({ text, id }) => {\n const element = document.createElement('div');\n\n element.accessKey = `slider-button-pseudo--${id}`;\n element.innerText = text;\n\n container.appendChild(element);\n });\n\n document.body.appendChild(container);\n\n const width = container.offsetWidth;\n\n document.body.removeChild(container);\n\n return width;\n};\n\nexport const calculateContentHeight = (elements: string[]) => {\n const heights: number[] = [];\n\n elements.forEach((element: string) => {\n const div = document.createElement('div');\n\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.width = 'auto';\n div.style.padding = '4px 10px';\n div.style.whiteSpace = 'nowrap';\n\n document.body.appendChild(div);\n\n div.innerText = element;\n\n heights.push(div.offsetHeight);\n\n document.body.removeChild(div);\n });\n\n return heights.reduce((partialSum, a) => partialSum + a, 0);\n};\n\ninterface GetHeightOfSingleTextLineOptions {\n container: Element;\n}\n\nexport const getHeightOfSingleTextLine = ({ container }: GetHeightOfSingleTextLineOptions) => {\n const div = document.createElement('div');\n\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.whiteSpace = 'nowrap';\n\n div.innerText = 'Single text line';\n\n container.appendChild(div);\n\n const { height } = div.getBoundingClientRect();\n\n container.removeChild(div);\n\n return height;\n};\n\nexport const getMaxHeightInPixels = (\n maxHeight: CSSProperties['maxHeight'],\n rootElement: Element,\n): number => {\n const tempElement = document.createElement('div');\n\n tempElement.style.position = 'absolute';\n tempElement.style.visibility = 'hidden';\n tempElement.style.height = '100vh';\n tempElement.style.maxHeight = maxHeight as string;\n\n rootElement.appendChild(tempElement);\n\n const { height } = tempElement.getBoundingClientRect();\n\n rootElement.removeChild(tempElement);\n\n return height;\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAiD,YAAY;AACpF,OAAOC,KAAK,MAA8B,OAAO;AACjD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,OAAOC,mBAAmB,MAAM,yDAAyD;AAWzF,OAAO,MAAMC,6BAA6B,GAAGA,CAAC;EAC1CC,SAAS;EACTC,IAAI;EACJC,kBAAkB;EAClBC;AACkC,CAAC,KAAK;EACxC,MAAMC,MAAgB,GAAG,EAAE;EAE3BH,IAAI,CAACI,OAAO,CAAC,CAAC;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,YAAY;IAAEC,OAAO;IAAEC,aAAa;IAAEC,IAAI;IAAEC;EAAW,CAAC,KAAK;IAC1F,MAAMC,OAAO,GAAGD,UAAU,EAAEC,OAAO,IAAI,KAAK;IAC5C,MAAMC,MAAM,GAAGF,UAAU,EAAEE,MAAM;IAEjC,MAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAa,CAACJ,OAAO,CAAC;IAE3C,IAAIC,MAAM,EAAE;MACRI,MAAM,CAACC,MAAM,CAACJ,GA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AAM;IAAEuC;EAAO,CAAC,GAAGvC,GAAG,CAACwC,qBAAqB,CAAC,CAAC;EAE9Cb,SAAS,CAACN,WAAW,CAACrB,GAAG,CAAC;EAE1B,OAAOuC,MAAM;AACjB,CAAC;AAED,OAAO,MAAME,oBAAoB,GAAGA,CAChCC,SAAqC,EACrCC,WAAoB,KACX;EACT,MAAMC,WAAW,GAAG3C,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAEjD0C,WAAW,CAACvC,KAAK,CAACG,QAAQ,GAAG,UAAU;EACvCoC,WAAW,CAACvC,KAAK,CAACI,UAAU,GAAG,QAAQ;EACvCmC,WAAW,CAACvC,KAAK,CAACkC,MAAM,GAAG,OAAO;EAClCK,WAAW,CAACvC,KAAK,CAACqC,SAAS,GAAGA,SAAmB;EAEjDC,WAAW,CAAC9B,WAAW,CAAC+B,WAAW,CAAC;EAEpC,MAAM;IAAEL;EAAO,CAAC,GAAGK,WAAW,CAACJ,qBAAqB,CAAC,CAAC;EAEtDG,WAAW,CAACtB,WAAW,CAACuB,WAAW,CAAC;EAEpC,OAAOL,MAAM;AACjB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"calculate.js","names":["ChaynsProvider","React","renderToString","ColorSchemeProvider","calculateMaxComboBoxItemWidth","functions","list","shouldShowBigImage","values","length","forEach","icons","imageUrl","rightElement","subtext","suffixElement","text","textStyles","tagName","styles","div","document","createElement","Object","assign","style","display","gap","position","visibility","whiteSpace","width","body","appendChild","innerText","innerHTML","data","isModule","offsetWidth","trim","push","removeChild","Math","max","apply","calculateBiggestWidth","elements","container","padding","id","element","accessKey","calculateContentHeight","heights","offsetHeight","reduce","partialSum","a","getHeightOfSingleTextLine","height","getBoundingClientRect","getMaxHeightInPixels","maxHeight","rootElement","tempElement"],"sources":["../../../src/utils/calculate.tsx"],"sourcesContent":["import { ChaynsProvider, ChaynsReactFunctions, ChaynsReactValues } from 'chayns-api';\nimport React, { type CSSProperties } from 'react';\nimport { renderToString } from 'react-dom/server';\nimport ColorSchemeProvider from '../components/color-scheme-provider/ColorSchemeProvider';\nimport type { SliderButtonItem } from '../types/slider-button';\nimport { IComboBoxItem } from '../components/combobox/ComboBox.types';\n\ninterface CalculateMaxComboBoxItemWidthOptions {\n functions: ChaynsReactFunctions;\n list: IComboBoxItem[];\n shouldShowBigImage?: boolean;\n values: ChaynsReactValues;\n}\n\nexport const calculateMaxComboBoxItemWidth = ({\n functions,\n list,\n shouldShowBigImage,\n values,\n}: CalculateMaxComboBoxItemWidthOptions) => {\n const length: number[] = [];\n\n list.forEach(({ icons, imageUrl, rightElement, subtext, suffixElement, text, textStyles }) => {\n const tagName = textStyles?.tagName ?? 'div';\n const styles = textStyles?.styles;\n\n const div = document.createElement(tagName);\n\n if (styles) {\n Object.assign(div.style, styles);\n }\n\n div.style.display = 'flex';\n div.style.gap = '10px';\n div.style.position = 'absolute';\n div.style.visibility = 'hidden';\n div.style.whiteSpace = 'nowrap';\n div.style.width = 'auto';\n\n document.body.appendChild(div);\n\n div.innerText = text;\n\n if (rightElement) {\n // ColorSchemeProvider is used to prevent missing scheme context error.\n // Due to the fact that the element is never rendered visible, the values are irrelevant.\n div.innerHTML += renderToString(\n <ChaynsProvider data={values} functions={functions} isModule>\n <ColorSchemeProvider>{rightElement}</ColorSchemeProvider>\n </ChaynsProvider>,\n );\n }\n\n if (suffixElement) {\n // ColorSchemeProvider is used to prevent missing scheme context error.\n // Due to the fact that the element is never rendered visible, the values are irrelevant.\n div.innerHTML += renderToString(\n <ChaynsProvider data={values} functions={functions} isModule>\n <ColorSchemeProvider>{suffixElement}</ColorSchemeProvider>\n </ChaynsProvider>,\n );\n }\n\n let width = div.offsetWidth;\n\n if (icons && icons.length > 0) {\n width += 20 + 10; // icon width + gap\n }\n\n if (imageUrl) {\n width +=\n (shouldShowBigImage || (typeof subtext === 'string' && subtext.trim() !== '')\n ? 40\n : 22) + 10; // image width + gap\n }\n\n length.push(width);\n\n document.body.removeChild(div);\n });\n\n return Math.max.apply(null, length);\n};\n\nexport const calculateBiggestWidth = (elements: SliderButtonItem[]) => {\n const container = document.createElement('div');\n\n container.style.visibility = 'hidden';\n container.style.position = 'absolute';\n container.style.width = 'auto';\n container.style.whiteSpace = 'nowrap';\n container.style.padding = '7px 12px';\n container.style.display = 'block';\n\n elements.forEach(({ text, id }) => {\n const element = document.createElement('div');\n\n element.accessKey = `slider-button-pseudo--${id}`;\n element.innerText = text;\n\n container.appendChild(element);\n });\n\n document.body.appendChild(container);\n\n const width = container.offsetWidth;\n\n document.body.removeChild(container);\n\n return width;\n};\n\nexport const calculateContentHeight = (elements: string[]) => {\n const heights: number[] = [];\n\n elements.forEach((element: string) => {\n const div = document.createElement('div');\n\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.width = 'auto';\n div.style.padding = '4px 10px';\n div.style.whiteSpace = 'nowrap';\n\n document.body.appendChild(div);\n\n div.innerText = element;\n\n heights.push(div.offsetHeight);\n\n document.body.removeChild(div);\n });\n\n return heights.reduce((partialSum, a) => partialSum + a, 0);\n};\n\ninterface GetHeightOfSingleTextLineOptions {\n container: Element;\n}\n\nexport const getHeightOfSingleTextLine = ({ container }: GetHeightOfSingleTextLineOptions) => {\n const div = document.createElement('div');\n\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.whiteSpace = 'nowrap';\n\n div.innerText = 'Single text line';\n\n container.appendChild(div);\n\n const { height } = div.getBoundingClientRect();\n\n container.removeChild(div);\n\n return height;\n};\n\nexport const getMaxHeightInPixels = (\n maxHeight: CSSProperties['maxHeight'],\n rootElement: Element,\n): number => {\n const tempElement = document.createElement('div');\n\n tempElement.style.position = 'absolute';\n tempElement.style.visibility = 'hidden';\n tempElement.style.height = '100vh';\n tempElement.style.maxHeight = maxHeight as string;\n\n rootElement.appendChild(tempElement);\n\n const { height } = tempElement.getBoundingClientRect();\n\n rootElement.removeChild(tempElement);\n\n return height;\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAiD,YAAY;AACpF,OAAOC,K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W,CAACtB,WAAW,CAACuB,WAAW,CAAC;EAEpC,OAAOL,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -17,6 +17,7 @@ export const formateNumber = ({
17
17
  isMoneyInput,
18
18
  isTimeInput
19
19
  }) => {
20
+ if (Number.isNaN(number)) return '';
20
21
  if (isTimeInput && typeof number === 'string') {
21
22
  let hours = 0;
22
23
  let minutes = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"numberInput.js","names":["DECIMAL_TEST","INTEGER_TEST","MONEY_TEST","TIME_TEST","parseFloatWithDecimals","stringValue","decimals","parsed","parseFloat","toFixed","formateNumber","number","isMoneyInput","isTimeInput","hours","minutes","firstTwoDigits","substring","includes","replace","firstTwoNumbers","Number","lastTwoNumbers","lastTwoNumbersLength","length","hoursStr","minutesStr","toLocaleString","useGrouping","minimumFractionDigits","undefined","maximumFractionDigits","maximumSignificantDigits","isValidString","isDecimalInput","string","isValid","test","startsWith"],"sources":["../../../src/utils/numberInput.ts"],"sourcesContent":["import { DECIMAL_TEST, INTEGER_TEST, MONEY_TEST, TIME_TEST } from '../constants/numberInput';\n\ninterface ParseFloatWithDecimals {\n ({ stringValue, decimals }: { stringValue: string; decimals?: number }): number | null;\n}\n\nexport const parseFloatWithDecimals: ParseFloatWithDecimals = ({ stringValue, decimals }) => {\n if (stringValue === '') {\n return null;\n }\n\n const parsed = parseFloat(stringValue);\n\n if (decimals) {\n return parseFloat(parsed.toFixed(decimals));\n }\n\n return parsed;\n};\n\ninterface FormateNumberOptions {\n number: number | string | null;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n}\n\nexport const formateNumber = ({ number, isMoneyInput, isTimeInput }: FormateNumberOptions) => {\n if (isTimeInput && typeof number === 'string') {\n let hours = 0;\n let minutes = 0;\n\n let firstTwoDigits = number.substring(0, 2);\n\n if (firstTwoDigits.includes(':')) {\n firstTwoDigits = firstTwoDigits.replace(':', '');\n\n firstTwoDigits = `0${firstTwoDigits}`;\n }\n\n const firstTwoNumbers = Number(firstTwoDigits);\n let lastTwoNumbers = 0;\n let lastTwoNumbersLength = 0;\n\n if (number.includes(':')) {\n lastTwoNumbers = Number(number.substring(3, 5));\n lastTwoNumbersLength = number.substring(3, 5).length;\n } else {\n lastTwoNumbers = Number(number.substring(2, 4));\n lastTwoNumbersLength = number.substring(2, 4).length;\n }\n\n hours = firstTwoNumbers > 23 ? 23 : firstTwoNumbers;\n\n if (lastTwoNumbers < 7 && lastTwoNumbersLength === 1) {\n minutes = lastTwoNumbers * 10;\n } else {\n minutes = lastTwoNumbers > 59 ? 59 : lastTwoNumbers;\n }\n\n const hoursStr = hours < 10 ? `0${hours}` : `${hours}`;\n const minutesStr = minutes < 10 ? `0${minutes}` : `${minutes}`;\n\n return `${hoursStr}:${minutesStr}`;\n }\n\n if (typeof number !== 'number') {\n return '';\n }\n\n return number.toLocaleString('de-DE', {\n useGrouping: true,\n minimumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumSignificantDigits: !isMoneyInput ? 20 : undefined,\n });\n};\n\ninterface IsValidString {\n (config: {\n string: string;\n isDecimalInput?: boolean;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n }): boolean;\n}\n\nexport const isValidString: IsValidString = ({\n isDecimalInput,\n isMoneyInput,\n isTimeInput,\n string,\n}) => {\n let isValid = false;\n\n // Allows numbers, one (comma/point) and any number of decimal places\n if (isDecimalInput && DECIMAL_TEST.test(string)) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (isMoneyInput && MONEY_TEST.test(string)) {\n isValid = true;\n }\n\n if (isTimeInput && TIME_TEST) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (!isDecimalInput && !isMoneyInput && !isTimeInput && INTEGER_TEST.test(string)) {\n isValid = true;\n }\n\n if (string.length === 0) {\n isValid = true;\n }\n\n if (string.startsWith('0')) {\n isValid = true;\n }\n\n return isValid;\n};\n"],"mappings":"AAAA,SAASA,YAA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ClB;;EAEA;EACA,IAAIxB,YAAY,IAAIV,UAAU,CAACmC,IAAI,CAACF,MAAM,CAAC,EAAE;IACzCC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAIvB,WAAW,IAAIV,SAAS,EAAE;IAC1BiC,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAI,CAACF,cAAc,IAAI,CAACtB,YAAY,IAAI,CAACC,WAAW,IAAIZ,YAAY,CAACoC,IAAI,CAACF,MAAM,CAAC,EAAE;IAC/EC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAID,MAAM,CAACX,MAAM,KAAK,CAAC,EAAE;IACrBY,OAAO,GAAG,IAAI;EAClB;EAEA,IAAID,MAAM,CAACG,UAAU,CAAC,GAAG,CAAC,EAAE;IACxBF,OAAO,GAAG,IAAI;EAClB;EAEA,OAAOA,OAAO;AAClB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"numberInput.js","names":["DECIMAL_TEST","INTEGER_TEST","MONEY_TEST","TIME_TEST","parseFloatWithDecimals","stringValue","decimals","parsed","parseFloat","toFixed","formateNumber","number","isMoneyInput","isTimeInput","Number","isNaN","hours","minutes","firstTwoDigits","substring","includes","replace","firstTwoNumbers","lastTwoNumbers","lastTwoNumbersLength","length","hoursStr","minutesStr","toLocaleString","useGrouping","minimumFractionDigits","undefined","maximumFractionDigits","maximumSignificantDigits","isValidString","isDecimalInput","string","isValid","test","startsWith"],"sources":["../../../src/utils/numberInput.ts"],"sourcesContent":["import { DECIMAL_TEST, INTEGER_TEST, MONEY_TEST, TIME_TEST } from '../constants/numberInput';\n\ninterface ParseFloatWithDecimals {\n ({ stringValue, decimals }: { stringValue: string; decimals?: number }): number | null;\n}\n\nexport const parseFloatWithDecimals: ParseFloatWithDecimals = ({ stringValue, decimals }) => {\n if (stringValue === '') {\n return null;\n }\n\n const parsed = parseFloat(stringValue);\n\n if (decimals) {\n return parseFloat(parsed.toFixed(decimals));\n }\n\n return parsed;\n};\n\ninterface FormateNumberOptions {\n number: number | string | null;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n}\n\nexport const formateNumber = ({ number, isMoneyInput, isTimeInput }: FormateNumberOptions) => {\n if (Number.isNaN(number)) return '';\n if (isTimeInput && typeof number === 'string') {\n let hours = 0;\n let minutes = 0;\n\n let firstTwoDigits = number.substring(0, 2);\n\n if (firstTwoDigits.includes(':')) {\n firstTwoDigits = firstTwoDigits.replace(':', '');\n\n firstTwoDigits = `0${firstTwoDigits}`;\n }\n\n const firstTwoNumbers = Number(firstTwoDigits);\n let lastTwoNumbers = 0;\n let lastTwoNumbersLength = 0;\n\n if (number.includes(':')) {\n lastTwoNumbers = Number(number.substring(3, 5));\n lastTwoNumbersLength = number.substring(3, 5).length;\n } else {\n lastTwoNumbers = Number(number.substring(2, 4));\n lastTwoNumbersLength = number.substring(2, 4).length;\n }\n\n hours = firstTwoNumbers > 23 ? 23 : firstTwoNumbers;\n\n if (lastTwoNumbers < 7 && lastTwoNumbersLength === 1) {\n minutes = lastTwoNumbers * 10;\n } else {\n minutes = lastTwoNumbers > 59 ? 59 : lastTwoNumbers;\n }\n\n const hoursStr = hours < 10 ? `0${hours}` : `${hours}`;\n const minutesStr = minutes < 10 ? `0${minutes}` : `${minutes}`;\n\n return `${hoursStr}:${minutesStr}`;\n }\n\n if (typeof number !== 'number') {\n return '';\n }\n\n return number.toLocaleString('de-DE', {\n useGrouping: true,\n minimumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumSignificantDigits: !isMoneyInput ? 20 : undefined,\n });\n};\n\ninterface IsValidString {\n (config: {\n string: string;\n isDecimalInput?: boolean;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n }): boolean;\n}\n\nexport const isValidString: IsValidString = ({\n isDecimalInput,\n isMoneyInput,\n isTimeInput,\n string,\n}) => {\n let isValid = false;\n\n // Allows numbers, one (comma/point) and any number of decimal places\n if (isDecimalInput && DECIMAL_TEST.test(string)) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (isMoneyInput && MONEY_TEST.test(string)) {\n isValid = true;\n }\n\n if (isTimeInput && TIME_TEST) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (!isDecimalInput && !isMoneyInput && !isTimeInput && INTEGER_TEST.test(string)) {\n isValid = true;\n }\n\n if (string.length === 0) {\n isValid = true;\n }\n\n if (string.startsWith('0')) {\n isValid = true;\n }\n\n return isValid;\n};\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAQ,0BAA0B;AAM5F,OAAO,MAAMC,sBAA8C,GAAGA,CAAC;EAAEC,WAAW;EAAEC;AAAS,CAAC,KAAK;EACzF,IAAID,WAAW,KAAK,EAAE,EAAE;IACpB,OAAO,IAAI;EACf;EAEA,MAAME,MAAM,GAAGC,UAAU,CAACH,WAAW,CAAC;EAEtC,IAAIC,QAAQ,EAAE;IACV,OAAOE,UAAU,CAACD,MAAM,CAACE,OAAO,CAACH,QAAQ,CAAC,CAAC;EAC/C;EAEA,OAAOC,MAAM;AACjB,CAAC;AAQD,OAAO,MAAMG,aAAa,GAAGA,CAAC;EAAEC,MAAM;EAAEC,YAAY;EAAEC;AAAkC,CAAC,KAAK;EAC1F,IAAIC,MAAM,CAACC,KAAK,CAACJ,MAAM,CAAC,EAAE,OAAO,EAAE;EACnC,IAAIE,WAAW,IAAI,OAAOF,MAAM,KAAK,QAAQ,EAAE;IAC3C,IAAIK,KAAK,GAAG,CAAC;IACb,IAAIC,OAAO,GAAG,CAAC;IAEf,IAAIC,cAAc,GAAGP,MAAM,CAACQ,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IAE3C,IAAID,cAAc,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;MAC9BF,cAAc,GAAGA,cAAc,CAACG,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;MAEhDH,cAAc,GAAG,IAAIA,cAAc,EAAE;IACzC;IAEA,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SAAS;IACnDC,qBAAqB,EAAEpB,YAAY,GAAG,CAAC,GAAGmB,SAAS;IACnDE,wBAAwB,EAAE,CAACrB,YAAY,GAAG,EAAE,GAAGmB;EACnD,CAAC,CAAC;AACN,CAAC;AAWD,OAAO,MAAMG,aAA4B,GAAGA,CAAC;EACzCC,cAAc;EACdvB,YAAY;EACZC,WAAW;EACXuB;AACJ,CAAC,KAAK;EACF,IAAIC,OAAO,GAAG,KAAK;;EAEnB;EACA,IAAIF,cAAc,IAAInC,YAAY,CAACsC,IAAI,CAACF,MAAM,CAAC,EAAE;IAC7CC,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAIzB,YAAY,IAAIV,UAAU,CAACoC,IAAI,CAACF,MAAM,CAAC,EAAE;IACzCC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAIxB,WAAW,IAAIV,SAAS,EAAE;IAC1BkC,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAI,CAACF,cAAc,IAAI,CAACvB,YAAY,IAAI,CAACC,WAAW,IAAIZ,YAAY,CAACqC,IAAI,CAACF,MAAM,CAAC,EAAE;IAC/EC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAID,MAAM,CAACX,MAAM,KAAK,CAAC,EAAE;IACrBY,OAAO,GAAG,IAAI;EAClB;EAEA,IAAID,MAAM,CAACG,UAAU,CAAC,GAAG,CAAC,EAAE;IACxBF,OAAO,GAAG,IAAI;EAClB;EAEA,OAAOA,OAAO;AAClB,CAAC","ignoreList":[]}
@@ -1,8 +1,6 @@
1
- import { BrowserName } from '../../../types/chayns';
2
1
  import type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';
3
2
  type StyledMotionAccordionBodyProps = WithTheme<{
4
3
  $maxHeight?: number;
5
- $browser: BrowserName;
6
4
  }>;
7
5
  export declare const StyledMotionAccordionBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
8
6
  ref?: React.RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
@@ -1,8 +1,6 @@
1
- import { BrowserName } from '../../../types/chayns';
2
1
  import type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';
3
2
  type StyledAccordionContentProps = WithTheme<{
4
3
  $maxHeight?: number;
5
- $browser: BrowserName;
6
4
  $shouldPreventBottomSpace: boolean;
7
5
  }>;
8
6
  export declare const StyledAccordionContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledAccordionContentProps>> & string;
@@ -1,3 +1,7 @@
1
- export declare const StyledColorSchemeProvider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
- theme: import("./ColorSchemeProvider").Theme;
3
- }>> & string;
1
+ import type { WithTheme } from './ColorSchemeProvider';
2
+ import { BrowserName } from '../../types/chayns';
3
+ type ColorSchemeProviderProps = WithTheme<{
4
+ $browser: BrowserName;
5
+ }>;
6
+ export declare const StyledColorSchemeProvider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ColorSchemeProviderProps>> & string;
7
+ export {};
@@ -1,141 +1,4 @@
1
- import React, { ChangeEventHandler, type CSSProperties, FocusEventHandler, ReactHTML, type ReactNode } from 'react';
2
- import { CSSPropertiesWithVars } from 'styled-components/dist/types';
3
- import { DropdownDirection } from '../../types/dropdown';
4
- export interface ComboBoxRef {
5
- hide: VoidFunction;
6
- show: VoidFunction;
7
- }
8
- export interface IComboBoxItems {
9
- groupName?: string;
10
- list: Array<IComboBoxItem>;
11
- shouldShowRoundImage?: boolean;
12
- }
13
- export interface ComboBoxTextStyles {
14
- tagName?: keyof ReactHTML;
15
- styles?: CSSPropertiesWithVars;
16
- className?: string;
17
- }
18
- export interface IComboBoxItem {
19
- icons?: string[];
20
- imageBackground?: CSSProperties['background'];
21
- imageUrl?: string;
22
- isDisabled?: boolean;
23
- rightElement?: ReactNode;
24
- subtext?: string;
25
- suffixElement?: ReactNode;
26
- text: string;
27
- value: string | number;
28
- textStyles?: ComboBoxTextStyles;
29
- }
30
- export declare enum ComboBoxSize {
31
- NORMAL = "normal",
32
- SMALL = "small"
33
- }
34
- export type ComboBoxProps = {
35
- /**
36
- * The width of the body.
37
- */
38
- bodyWidth?: number;
39
- /**
40
- * The element where the content of the `ComboBox` should be rendered via React Portal.
41
- */
42
- container?: Element;
43
- /**
44
- * The direction in which the combobox should open.
45
- */
46
- direction?: DropdownDirection;
47
- /**
48
- * The value of the optional input.
49
- */
50
- inputValue?: string;
51
- /**
52
- * Whether the combobox should be disabled.
53
- */
54
- isDisabled?: boolean;
55
- /**
56
- * The list of the items that should be displayed.
57
- */
58
- lists: IComboBoxItems[];
59
- /**
60
- * The maximum height of the combobox content.
61
- */
62
- maxHeight?: number;
63
- /**
64
- * Function to be executed when the value of the optional input is changed.
65
- */
66
- onInputChange?: ChangeEventHandler<HTMLInputElement>;
67
- /**
68
- * Function to be executed when the optional input lost its focus.
69
- */
70
- onInputBlur?: FocusEventHandler<HTMLInputElement>;
71
- /**
72
- * Function to be executed when the optional input gets its focus.
73
- */
74
- onInputFocus?: FocusEventHandler<HTMLInputElement>;
75
- /**
76
- * Function that should be executed when an item is selected. If the function returns false, the item will not be selected.
77
- */
78
- onSelect?: (comboboxItem?: IComboBoxItem) => Promise<boolean> | boolean | void;
79
- /**
80
- * Function to be executed when the content of the `ComboBox` is shown.
81
- */
82
- onShow?: () => void;
83
- /**
84
- * Function to be executed when the content of the `ComboBox` is hidden.
85
- */
86
- onHide?: () => void;
87
- /**
88
- * A text that should be displayed when no item is selected.
89
- */
90
- placeholder: string;
91
- /**
92
- * A prefix that should be displayed before the placeholder.
93
- */
94
- prefix?: string;
95
- /**
96
- * An item that should be preselected.
97
- */
98
- selectedItem?: IComboBoxItem;
99
- /**
100
- * If true, the images of the items are displayed in a bigger shape. This prop will automatically be set to true if the subtext of an item is given.
101
- */
102
- shouldShowBigImage?: boolean;
103
- /**
104
- * If true, a clear icon is displayed at the end of the combo box if an item is selected.
105
- */
106
- shouldShowClearIcon?: boolean;
107
- /**
108
- * Whether the background should be transparent.
109
- */
110
- shouldShowTransparentBackground?: boolean;
111
- /**
112
- * If true, the images of the items are displayed in a round shape.
113
- */
114
- shouldShowRoundImage?: boolean;
115
- /**
116
- * Whether the width of the ComboBox should be the width of the current item.
117
- */
118
- shouldUseCurrentItemWidth?: boolean;
119
- /**
120
- * Whether the width of the 'ComboBox' should be the width of the parent or of the widest item.
121
- */
122
- shouldUseFullWidth?: boolean;
123
- /**
124
- * If true, the dropdown will use the maximum width of the items.
125
- */
126
- shouldDropDownUseMaxItemWidth?: boolean;
127
- /**
128
- * Whether the outside events should be captured.
129
- */
130
- shouldCaptureEvents?: boolean;
131
- /**
132
- * The size of the ComboBox.
133
- */
134
- size?: ComboBoxSize;
135
- /**
136
- * Optional min width for the prefix element.
137
- */
138
- prefixMinWidth?: number;
139
- };
1
+ import React from 'react';
2
+ import { ComboBoxProps, ComboBoxRef } from './ComboBox.types';
140
3
  declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<ComboBoxRef>>;
141
4
  export default ComboBox;
@@ -1,7 +1,6 @@
1
- import { BrowserName } from '../../types/chayns';
2
1
  import type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';
3
- import { ComboBoxProps, ComboBoxSize } from './ComboBox';
4
2
  import { DropdownDirection } from '../../types/dropdown';
3
+ import { ComboBoxProps, ComboBoxSize } from './ComboBox.types';
5
4
  type StyledComboBoxProps = WithTheme<{
6
5
  $minWidth?: number;
7
6
  $shouldUseFullWidth: ComboBoxProps['shouldUseFullWidth'];
@@ -47,7 +46,6 @@ type StyledComboBoxIconWrapperProps = {
47
46
  export declare const StyledComboBoxIconWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledComboBoxIconWrapperProps>> & string;
48
47
  type StyledComboBoxBodyProps = WithTheme<{
49
48
  $shouldUseCurrentItemWidth: boolean;
50
- $browser: BrowserName;
51
49
  $maxHeight: number;
52
50
  $minWidth: number;
53
51
  }>;
@@ -0,0 +1,139 @@
1
+ import { ChangeEventHandler, CSSProperties, FocusEventHandler, ReactHTML, ReactNode } from 'react';
2
+ import { CSSPropertiesWithVars } from 'styled-components/dist/types';
3
+ import { DropdownDirection } from '../../types/dropdown';
4
+ export interface ComboBoxRef {
5
+ hide: VoidFunction;
6
+ show: VoidFunction;
7
+ }
8
+ export interface IComboBoxItems {
9
+ groupName?: string;
10
+ list: Array<IComboBoxItem>;
11
+ shouldShowRoundImage?: boolean;
12
+ }
13
+ export interface ComboBoxTextStyles {
14
+ tagName?: keyof ReactHTML;
15
+ styles?: CSSPropertiesWithVars;
16
+ className?: string;
17
+ }
18
+ export interface IComboBoxItem {
19
+ icons?: string[];
20
+ imageBackground?: CSSProperties['background'];
21
+ imageUrl?: string;
22
+ isDisabled?: boolean;
23
+ rightElement?: ReactNode;
24
+ subtext?: string;
25
+ suffixElement?: ReactNode;
26
+ text: string;
27
+ value: string | number;
28
+ textStyles?: ComboBoxTextStyles;
29
+ }
30
+ export declare enum ComboBoxSize {
31
+ NORMAL = "normal",
32
+ SMALL = "small"
33
+ }
34
+ export type ComboBoxProps = {
35
+ /**
36
+ * The width of the body.
37
+ */
38
+ bodyWidth?: number;
39
+ /**
40
+ * The element where the content of the `ComboBox` should be rendered via React Portal.
41
+ */
42
+ container?: Element;
43
+ /**
44
+ * The direction in which the combobox should open.
45
+ */
46
+ direction?: DropdownDirection;
47
+ /**
48
+ * The value of the optional input.
49
+ */
50
+ inputValue?: string;
51
+ /**
52
+ * Whether the combobox should be disabled.
53
+ */
54
+ isDisabled?: boolean;
55
+ /**
56
+ * The list of the items that should be displayed.
57
+ */
58
+ lists: IComboBoxItems[];
59
+ /**
60
+ * The maximum height of the combobox content.
61
+ */
62
+ maxHeight?: number;
63
+ /**
64
+ * Function to be executed when the value of the optional input is changed.
65
+ */
66
+ onInputChange?: ChangeEventHandler<HTMLInputElement>;
67
+ /**
68
+ * Function to be executed when the optional input lost its focus.
69
+ */
70
+ onInputBlur?: FocusEventHandler<HTMLInputElement>;
71
+ /**
72
+ * Function to be executed when the optional input gets its focus.
73
+ */
74
+ onInputFocus?: FocusEventHandler<HTMLInputElement>;
75
+ /**
76
+ * Function that should be executed when an item is selected. If the function returns false, the item will not be selected.
77
+ */
78
+ onSelect?: (comboboxItem?: IComboBoxItem) => Promise<boolean> | boolean | void;
79
+ /**
80
+ * Function to be executed when the content of the `ComboBox` is shown.
81
+ */
82
+ onShow?: () => void;
83
+ /**
84
+ * Function to be executed when the content of the `ComboBox` is hidden.
85
+ */
86
+ onHide?: () => void;
87
+ /**
88
+ * A text that should be displayed when no item is selected.
89
+ */
90
+ placeholder: string;
91
+ /**
92
+ * A prefix that should be displayed before the placeholder.
93
+ */
94
+ prefix?: string;
95
+ /**
96
+ * An item that should be preselected.
97
+ */
98
+ selectedItem?: IComboBoxItem;
99
+ /**
100
+ * If true, the images of the items are displayed in a bigger shape. This prop will automatically be set to true if the subtext of an item is given.
101
+ */
102
+ shouldShowBigImage?: boolean;
103
+ /**
104
+ * If true, a clear icon is displayed at the end of the combo box if an item is selected.
105
+ */
106
+ shouldShowClearIcon?: boolean;
107
+ /**
108
+ * Whether the background should be transparent.
109
+ */
110
+ shouldShowTransparentBackground?: boolean;
111
+ /**
112
+ * If true, the images of the items are displayed in a round shape.
113
+ */
114
+ shouldShowRoundImage?: boolean;
115
+ /**
116
+ * Whether the width of the ComboBox should be the width of the current item.
117
+ */
118
+ shouldUseCurrentItemWidth?: boolean;
119
+ /**
120
+ * Whether the width of the 'ComboBox' should be the width of the parent or of the widest item.
121
+ */
122
+ shouldUseFullWidth?: boolean;
123
+ /**
124
+ * If true, the dropdown will use the maximum width of the items.
125
+ */
126
+ shouldDropDownUseMaxItemWidth?: boolean;
127
+ /**
128
+ * Whether the outside events should be captured.
129
+ */
130
+ shouldCaptureEvents?: boolean;
131
+ /**
132
+ * The size of the ComboBox.
133
+ */
134
+ size?: ComboBoxSize;
135
+ /**
136
+ * Optional min width for the prefix element.
137
+ */
138
+ prefixMinWidth?: number;
139
+ };
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import type { ComboBoxProps, IComboBoxItem } from '../ComboBox';
2
+ import { ComboBoxProps, IComboBoxItem } from '../ComboBox.types';
3
3
  export type ComboBoxItemProps = {
4
4
  item: IComboBoxItem;
5
5
  isSelected: boolean;
@@ -1,6 +1,5 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  interface IListContext {
3
- incrementExpandableItemCount: () => () => void;
4
3
  isAnyItemExpandable: boolean;
5
4
  isWrapped: boolean;
6
5
  openItemUuid: string | undefined;
@@ -1,7 +1,6 @@
1
1
  import { ColorMode } from 'chayns-api';
2
2
  import { PopupAlignment } from '../../../types/popup';
3
3
  import type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';
4
- import { BrowserName } from '../../../types/chayns';
5
4
  type StyledMotionPopupContentWrapperProps = WithTheme<{
6
5
  $position: PopupAlignment;
7
6
  $colorMode: ColorMode;
@@ -12,7 +11,6 @@ export declare const StyledMotionPopupContentWrapper: import("styled-components/
12
11
  ref?: React.RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
13
12
  }, StyledMotionPopupContentWrapperProps>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof React.Component<any, {}, any>>;
14
13
  type StyledPopupContentWrapperContentProps = WithTheme<{
15
- $browser: BrowserName;
16
14
  $maxHeight?: number;
17
15
  }>;
18
16
  export declare const StyledPopupContentWrapperContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledPopupContentWrapperContentProps>> & string;
@@ -1,5 +1,4 @@
1
1
  import type { CSSProperties } from 'react';
2
- import { BrowserName } from '../../types/chayns';
3
2
  import type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';
4
3
  type StyledScrollViewProps = WithTheme<{
5
4
  $maxHeight?: CSSProperties['height'] | null;
@@ -8,7 +7,6 @@ type StyledScrollViewProps = WithTheme<{
8
7
  $width?: CSSProperties['width'];
9
8
  $overflowX: 'scroll' | 'auto';
10
9
  $overflowY: 'scroll' | 'auto';
11
- $browser: BrowserName;
12
10
  }>;
13
11
  export declare const StyledScrollView: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledScrollViewProps>> & string;
14
12
  export {};
@@ -1,10 +1,8 @@
1
- import { BrowserName } from '../../types/chayns';
2
1
  import type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';
3
2
  export declare const StyledSearchBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
3
  type StyledMotionSearchBoxBodyProps = WithTheme<{
5
4
  $height: number;
6
5
  $width: number;
7
- $browser: BrowserName;
8
6
  }>;
9
7
  export declare const StyledMotionSearchBoxBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
8
  ref?: React.RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;