@rio-cloud/rio-uikit 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/actionBarItem/ActionBarItem.d.ts +2 -2
- package/components/actionBarItem/ActionBarItem.js.map +1 -1
- package/components/applicationHeader/ApplicationHeader.d.ts +6 -7
- package/components/applicationHeader/ApplicationHeader.js.map +1 -1
- package/components/applicationLayout/SubNavigation.d.ts +7 -0
- package/components/applicationLayout/SubNavigation.js.map +1 -1
- package/components/assetTree/AssetTree.d.ts +7 -0
- package/components/assetTree/AssetTree.js.map +1 -1
- package/components/assetTree/Tree.d.ts +15 -0
- package/components/assetTree/Tree.js.map +1 -1
- package/components/assetTree/TreeIcon.d.ts +30 -0
- package/components/assetTree/TreeIcon.js +16 -0
- package/components/assetTree/TreeIcon.js.map +1 -0
- package/components/assetTree/TreeLeaf.js +22 -22
- package/components/assetTree/TreeLeaf.js.map +1 -1
- package/components/assetTree/TreeNode.js +25 -25
- package/components/assetTree/TreeNode.js.map +1 -1
- package/components/assetTree/TreeSearch.d.ts +2 -0
- package/components/assetTree/TreeSearch.js.map +1 -1
- package/components/barList/BarList.d.ts +26 -0
- package/components/barList/BarList.js.map +1 -1
- package/components/bottomSheet/BottomSheet.d.ts +17 -3
- package/components/bottomSheet/BottomSheet.js.map +1 -1
- package/components/bottomSheet/TimedBottomSheet.d.ts +10 -0
- package/components/bottomSheet/TimedBottomSheet.js.map +1 -1
- package/components/calendarStripe/CalendarStripe.d.ts +1 -1
- package/components/calendarStripe/CalendarStripe.js +34 -36
- package/components/calendarStripe/CalendarStripe.js.map +1 -1
- package/components/charts/Area.d.ts +2 -2
- package/components/charts/Area.js.map +1 -1
- package/components/charts/Line.d.ts +2 -2
- package/components/charts/Line.js.map +1 -1
- package/components/checkbox/Checkbox.d.ts +0 -3
- package/components/checkbox/Checkbox.js.map +1 -1
- package/components/clearableInput/ClearableInput.d.ts +21 -20
- package/components/clearableInput/ClearableInput.js.map +1 -1
- package/components/collapse/Collapse.d.ts +3 -0
- package/components/collapse/Collapse.js +12 -12
- package/components/collapse/Collapse.js.map +1 -1
- package/components/contentLoader/ContentLoader.d.ts +10 -2
- package/components/contentLoader/ContentLoader.js.map +1 -1
- package/components/dataTabs/DataTabs.d.ts +6 -0
- package/components/dataTabs/DataTabs.js.map +1 -1
- package/components/datepicker/DatePicker.d.ts +2 -2
- package/components/datepicker/DatePicker.js +31 -31
- package/components/datepicker/DatePicker.js.map +1 -1
- package/components/dialog/ConfirmationDialog.d.ts +22 -0
- package/components/dialog/ConfirmationDialog.js.map +1 -1
- package/components/dialog/Dialog.d.ts +13 -1
- package/components/dialog/Dialog.js.map +1 -1
- package/components/dialog/ReleaseNotesDialog.d.ts +3 -3
- package/components/dialog/ReleaseNotesDialog.js.map +1 -1
- package/components/dropdown/ButtonDropdown.d.ts +4 -0
- package/components/dropdown/ButtonDropdown.js +51 -51
- package/components/dropdown/ButtonDropdown.js.map +1 -1
- package/components/dropdown/DropdownSubmenu.d.ts +4 -0
- package/components/dropdown/DropdownSubmenu.js.map +1 -1
- package/components/editableContent/EditableContent.d.ts +6 -0
- package/components/editableContent/EditableContent.js.map +1 -1
- package/components/expander/ExpanderList.d.ts +3 -0
- package/components/expander/ExpanderList.js.map +1 -1
- package/components/expander/ExpanderPanel.d.ts +14 -4
- package/components/expander/ExpanderPanel.js.map +1 -1
- package/components/fade/Fade.d.ts +1 -1
- package/components/fade/Fade.js.map +1 -1
- package/components/filepicker/FilePicker.d.ts +0 -2
- package/components/filepicker/FilePicker.js.map +1 -1
- package/components/groupedItemList/GroupedItemList.d.ts +10 -7
- package/components/groupedItemList/GroupedItemList.js.map +1 -1
- package/components/listMenu/ListMenu.js.map +1 -1
- package/components/listMenu/ListMenuGroup.d.ts +2 -1
- package/components/listMenu/ListMenuGroup.js.map +1 -1
- package/components/map/components/Map.js.map +1 -1
- package/components/map/components/constants.js.map +1 -1
- package/components/map/components/features/ContextMenuItem.d.ts +1 -1
- package/components/map/components/features/ContextMenuItem.js +2 -17
- package/components/map/components/features/ContextMenuItem.js.map +1 -1
- package/components/map/components/features/basics/Polyline.d.ts +4 -1
- package/components/map/components/features/basics/Polyline.js +1 -1
- package/components/map/components/features/basics/Polyline.js.map +1 -1
- package/components/map/components/features/layers/MarkerLayer.d.ts +3 -1
- package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
- package/components/map/components/features/layers/clustering/ClusterLayer.js +1 -1
- package/components/map/components/features/layers/clustering/ClusterLayer.js.map +1 -1
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.d.ts +3 -2
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
- package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js +7 -7
- package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js.map +1 -1
- package/components/map/components/features/layers/overlayLayers/TrafficLayer.js +4 -4
- package/components/map/components/features/layers/overlayLayers/TrafficLayer.js.map +1 -1
- package/components/map/utils/clustering.d.ts +6 -1
- package/components/map/utils/clustering.js +25 -19
- package/components/map/utils/clustering.js.map +1 -1
- package/components/map/utils/rendering.d.ts +1 -1
- package/components/map/utils/rendering.js +23 -23
- package/components/map/utils/rendering.js.map +1 -1
- package/components/menuItems/MenuItem.d.ts +23 -0
- package/components/menuItems/MenuItem.js.map +1 -1
- package/components/notification/Notification.js +4 -4
- package/components/notification/Notification.js.map +1 -1
- package/components/onboarding/OnboardingTip.d.ts +18 -12
- package/components/onboarding/OnboardingTip.js.map +1 -1
- package/components/overlay/OverlayTrigger.d.ts +43 -1
- package/components/overlay/OverlayTrigger.js.map +1 -1
- package/components/pager/Pager.d.ts +3 -0
- package/components/pager/Pager.js.map +1 -1
- package/components/popover/Popover.d.ts +1 -0
- package/components/popover/Popover.js.map +1 -1
- package/components/preloader/ImagePreloader.d.ts +1 -1
- package/components/preloader/ImagePreloader.js.map +1 -1
- package/components/radiobutton/RadioButton.d.ts +9 -5
- package/components/radiobutton/RadioButton.js.map +1 -1
- package/components/releaseNotes/ReleaseNotes.d.ts +0 -3
- package/components/releaseNotes/ReleaseNotes.js.map +1 -1
- package/components/resizer/Resizer.d.ts +17 -3
- package/components/resizer/Resizer.js.map +1 -1
- package/components/rioglyph/Rioglyph.d.ts +20 -8
- package/components/rioglyph/Rioglyph.js.map +1 -1
- package/components/rules/RulesWrapper.js +1 -1
- package/components/rules/RulesWrapper.js.map +1 -1
- package/components/saveableInput/SaveableDateInput.d.ts +20 -2
- package/components/saveableInput/SaveableDateInput.js.map +1 -1
- package/components/saveableInput/SaveableInput.d.ts +10 -2
- package/components/saveableInput/SaveableInput.js.map +1 -1
- package/components/selects/BaseSelectDropdown.js +90 -79
- package/components/selects/BaseSelectDropdown.js.map +1 -1
- package/components/selects/Select.d.ts +5 -0
- package/components/selects/Select.js +94 -94
- package/components/selects/Select.js.map +1 -1
- package/components/sidebars/Sidebar.d.ts +19 -3
- package/components/sidebars/Sidebar.js.map +1 -1
- package/components/slider/RangeSlider.d.ts +15 -0
- package/components/slider/RangeSlider.js.map +1 -1
- package/components/slider/Slider.d.ts +9 -0
- package/components/slider/Slider.js.map +1 -1
- package/components/smoothScrollbars/SmoothScrollbars.d.ts +44 -0
- package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
- package/components/spinner/Spinner.d.ts +3 -3
- package/components/spinner/Spinner.js.map +1 -1
- package/components/states/BaseStateProps.d.ts +6 -2
- package/components/states/StateIcon.d.ts +14 -1
- package/components/states/StateIcon.js.map +1 -1
- package/components/statsWidget/StatsWidget.d.ts +2 -0
- package/components/statsWidget/StatsWidget.js.map +1 -1
- package/components/statsWidget/StatsWidgetBody.d.ts +1 -0
- package/components/statsWidget/StatsWidgetBody.js.map +1 -1
- package/components/statsWidget/StatsWidgetNumber.d.ts +2 -0
- package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
- package/components/statusBar/StatusBar.d.ts +2 -31
- package/components/statusBar/StatusBar.js.map +1 -1
- package/components/statusBar/StatusBarIcon.d.ts +2 -2
- package/components/statusBar/StatusBarIcon.js.map +1 -1
- package/components/statusBar/StatusBarLabel.d.ts +2 -2
- package/components/statusBar/StatusBarLabel.js.map +1 -1
- package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
- package/components/statusBar/StatusBarProgressBar.js.map +1 -1
- package/components/statusBar/{StatusBar.types.d.ts → StatusBarProps.d.ts} +44 -2
- package/components/steppedProgressBar/SteppedProgressBar.d.ts +1 -1
- package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
- package/components/switch/Switch.d.ts +13 -1
- package/components/switch/Switch.js.map +1 -1
- package/components/table/SortArrowDown.d.ts +1 -1
- package/components/table/SortArrowDown.js.map +1 -1
- package/components/table/SortArrowUp.d.ts +1 -1
- package/components/table/SortArrowUp.js.map +1 -1
- package/components/table/TableSettingsDialog.d.ts +5 -0
- package/components/table/TableSettingsDialog.js +119 -109
- package/components/table/TableSettingsDialog.js.map +1 -1
- package/components/table/TableSettingsDialogFooter.js +9 -9
- package/components/table/TableSettingsDialogFooter.js.map +1 -1
- package/components/table/TableViewToggles.d.ts +21 -1
- package/components/table/TableViewToggles.js.map +1 -1
- package/components/tag/Tag.d.ts +7 -2
- package/components/tag/Tag.js.map +1 -1
- package/components/tagManager/TagManager.d.ts +15 -0
- package/components/tagManager/TagManager.js.map +1 -1
- package/components/tagManager/TagManagerTag.d.ts +9 -0
- package/components/teaser/Teaser.d.ts +57 -55
- package/components/teaser/Teaser.js.map +1 -1
- package/components/teaser/TeaserContainer.d.ts +1 -1
- package/components/teaser/TeaserContainer.js.map +1 -1
- package/components/tooltip/SimpleTooltip.d.ts +22 -4
- package/components/tooltip/SimpleTooltip.js.map +1 -1
- package/components/tooltip/Tooltip.d.ts +22 -2
- package/components/tooltip/Tooltip.js.map +1 -1
- package/components/video/ResponsiveVideo.d.ts +8 -3
- package/components/video/ResponsiveVideo.js.map +1 -1
- package/hooks/useKey.d.ts +1 -1
- package/hooks/useKey.js.map +1 -1
- package/hooks/useOnboarding.d.ts +86 -80
- package/hooks/useOnboarding.js.map +1 -1
- package/hooks/useTableExport.js.map +1 -1
- package/hooks/useUncontrollable.d.ts +1 -1
- package/hooks/useUncontrollable.js.map +1 -1
- package/package.json +12 -14
- package/utils/colorScheme.js +14 -13
- package/utils/colorScheme.js.map +1 -1
- package/utils/cssuseragent.js.map +1 -1
- package/utils/scrollItemIntoView.js +12 -11
- package/utils/scrollItemIntoView.js.map +1 -1
- package/utils/urlFeatureToggles.js +19 -20
- package/utils/urlFeatureToggles.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeSlider.js","sources":["../../../src/components/slider/RangeSlider.tsx"],"sourcesContent":["import React, { type ChangeEvent, type HTMLAttributes, type MouseEvent, useEffect, useState } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/compat';\n\nimport { getCurrentBackgroundColor, type CurrentColor } from '../../utils/currentColors';\n\nconst getRangeValues = (valueLeft: number, valueRight: number) => {\n const finalLeftValue = valueRight <= valueLeft ? valueRight : valueLeft;\n const finalRightValue = valueLeft >= valueRight ? valueLeft : valueRight;\n return [finalLeftValue, finalRightValue];\n};\n\nexport type RangeSliderProps = {\n /**\n * The current left value of the selected range.\n */\n leftValue?: number;\n\n /**\n * The current right value of the selected range.\n */\n rightValue?: number;\n\n /**\n * The lower limit.\n *\n * @default 0\n */\n minValue: number;\n\n /**\n * The upper limit.\n *\n * @default Number.MAX_VALUE\n */\n maxValue: number;\n\n /**\n * Whether to show the value labels.\n *\n * @default false\n */\n valueLabels?: boolean;\n\n /**\n * Additional unit used for the slider value labels.\n */\n valueLabelUnit?: string | React.ReactNode;\n\n /**\n * Selector step value.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Defines the color of the slider.\n *\n * @default 'primary'\n */\n color?: CurrentColor;\n\n /**\n * Disables all pointer events.\n *\n * @default false\n */\n disabled?: boolean;\n\n onChange?: (newLeftValue: number, newRightValue: number) => void;\n\n onDragEnd?: (newLeftValue: number, newRightValue: number) => void;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'disabled' | 'onChange' | 'onDragEnd' | 'className'>;\n\nconst RangeSlider = (props: RangeSliderProps) => {\n const {\n minValue = 0,\n maxValue = Number.MAX_VALUE,\n valueLabels = false,\n valueLabelUnit,\n step = 1,\n color = 'primary',\n leftValue,\n rightValue,\n className,\n disabled = false,\n onChange = noop,\n onDragEnd = noop,\n ...remainingProps\n } = props;\n\n const [activeLeft, setActiveLeft] = useState(false);\n const [activeRight, setActiveRight] = useState(false);\n const [valueLeft, setValueLeft] = useState(leftValue ? leftValue : minValue);\n const [valueRight, setValueRight] = useState(rightValue ? rightValue : maxValue);\n const [isChangingLeft, setIsChangingLeft] = useState(false);\n const [isChangingRight, setIsChangingRight] = useState(false);\n\n useEffect(() => {\n if (valueLeft >= minValue && valueLeft <= maxValue && valueRight >= minValue && valueRight <= maxValue) {\n setValueLeft(valueLeft);\n setValueRight(valueRight);\n }\n }, [valueLeft, valueRight, minValue, maxValue]);\n\n const changeValues = (newValues: { valueLeft?: number; valueRight?: number }) => {\n const newValueLeft = newValues.valueLeft ? newValues.valueLeft : valueLeft;\n const newValueRight = newValues.valueRight ? newValues.valueRight : valueRight;\n\n setValueLeft(newValueLeft);\n setValueRight(newValueRight);\n\n setIsChangingLeft(!!newValues.valueLeft);\n setIsChangingRight(!!newValues.valueRight);\n\n const [newLeftValue, newRightValue] = getRangeValues(newValueLeft, newValueRight);\n onChange(newLeftValue, newRightValue);\n };\n\n const handleChangeValueLeft = (event: ChangeEvent<HTMLInputElement>) => {\n changeValues({ valueLeft: Number.parseInt(event.target.value, 10) });\n };\n\n const handleChangeValueRight = (event: ChangeEvent<HTMLInputElement>) => {\n changeValues({ valueRight: Number.parseInt(event.target.value, 10) });\n };\n\n const onMouseDownLeft = () => {\n setIsChangingLeft(true);\n setIsChangingRight(false);\n };\n\n const onMouseDownRight = () => {\n setIsChangingLeft(false);\n setIsChangingRight(true);\n };\n\n const getTrackMiddlePosition = (targetWidth: number) => {\n const trackValueLeftRelative = (valueLeft - minValue) / (maxValue - minValue);\n const trackValueRightRelative = (valueRight - minValue) / (maxValue - minValue);\n const trackMiddleRelative = (trackValueLeftRelative + trackValueRightRelative) / 2;\n\n return trackMiddleRelative * targetWidth;\n };\n\n const onMouseMoveLeft = (event: MouseEvent<HTMLInputElement>) => {\n const target = event.target as HTMLInputElement;\n if (!isChangingLeft) {\n const clientRect = target.getBoundingClientRect();\n const mouseHover = event.clientX - clientRect.left;\n const targetWidth = target.offsetWidth;\n\n const trackMiddlePosition = getTrackMiddlePosition(targetWidth);\n\n if (valueRight > valueLeft && mouseHover > trackMiddlePosition) {\n setActiveLeft(false);\n setActiveRight(true);\n }\n\n if (valueRight < valueLeft && mouseHover < trackMiddlePosition) {\n setActiveLeft(false);\n setActiveRight(true);\n }\n }\n };\n\n const onMouseMoveRight = (event: MouseEvent<HTMLInputElement>) => {\n const target = event.target as HTMLInputElement;\n if (!isChangingRight) {\n const clientRect = target.getBoundingClientRect();\n const mouseHover = event.clientX - clientRect.left;\n const targetWidth = target.offsetWidth;\n\n const trackMiddlePosition = getTrackMiddlePosition(targetWidth);\n\n if (valueRight > valueLeft && mouseHover < trackMiddlePosition) {\n setActiveLeft(true);\n setActiveRight(false);\n }\n\n if (valueRight < valueLeft && mouseHover > trackMiddlePosition) {\n setActiveLeft(true);\n setActiveRight(false);\n }\n }\n };\n\n const onMouseUpLeft = () => {\n setIsChangingLeft(false);\n setIsChangingRight(false);\n\n const [newLeftValue, newRightValue] = getRangeValues(valueLeft, valueRight);\n onDragEnd(newLeftValue, newRightValue);\n };\n\n const onMouseUpRight = () => {\n setIsChangingLeft(false);\n setIsChangingRight(false);\n\n const [newLeftValue, newRightValue] = getRangeValues(valueLeft, valueRight);\n onDragEnd(newLeftValue, newRightValue);\n };\n\n const [finalLeftValue, finalRightValue] = getRangeValues(valueLeft, valueRight);\n\n const trackWidth = (100 * (finalRightValue - finalLeftValue)) / (maxValue - minValue);\n const trackLeft = (100 * (finalLeftValue - minValue)) / (maxValue - minValue);\n\n const wrapperClassNames = classNames(\n 'range-slider',\n disabled && 'disabled',\n valueLabels && 'show-value-labels',\n className && className\n );\n\n const sliderBackgroundColor = getCurrentBackgroundColor(color);\n\n return (\n <div {...remainingProps} className={wrapperClassNames} style={{ color: sliderBackgroundColor }}>\n <div className='range-whole-track' />\n <div className='range-track' style={{ width: `${trackWidth}%`, left: `${trackLeft}%` }}>\n {valueLabels && (\n <div className='user-select-none'>\n <div className='range-value'>\n <span>{valueLabelUnit ? `${finalLeftValue} ${valueLabelUnit}` : finalLeftValue}</span>\n </div>\n <div className='range-value'>\n <span>{valueLabelUnit ? `${finalRightValue} ${valueLabelUnit}` : finalRightValue}</span>\n </div>\n </div>\n )}\n </div>\n <input\n className={`${isChangingLeft ? 'changing' : ''}`}\n style={{ zIndex: activeLeft ? '6' : '5' }}\n value={valueLeft}\n min={minValue}\n max={maxValue}\n step={step}\n type='range'\n onChange={handleChangeValueLeft}\n onMouseDown={onMouseDownLeft}\n onMouseMove={onMouseMoveLeft}\n onMouseUp={onMouseUpLeft}\n />\n <input\n className={`${isChangingRight ? 'changing' : ''}`}\n style={{ zIndex: activeRight ? '6' : '5' }}\n value={valueRight}\n min={minValue}\n max={maxValue}\n step={step}\n type='range'\n onChange={handleChangeValueRight}\n onMouseDown={onMouseDownRight}\n onMouseMove={onMouseMoveRight}\n onMouseUp={onMouseUpRight}\n />\n </div>\n );\n};\n\nexport default RangeSlider;\n"],"names":["getRangeValues","valueLeft","valueRight","finalLeftValue","finalRightValue","RangeSlider","props","minValue","maxValue","valueLabels","valueLabelUnit","step","color","leftValue","rightValue","className","disabled","onChange","noop","onDragEnd","remainingProps","activeLeft","setActiveLeft","useState","activeRight","setActiveRight","setValueLeft","setValueRight","isChangingLeft","setIsChangingLeft","isChangingRight","setIsChangingRight","useEffect","changeValues","newValues","newValueLeft","newValueRight","newLeftValue","newRightValue","handleChangeValueLeft","event","handleChangeValueRight","onMouseDownLeft","onMouseDownRight","getTrackMiddlePosition","targetWidth","trackValueLeftRelative","trackValueRightRelative","onMouseMoveLeft","target","clientRect","mouseHover","trackMiddlePosition","onMouseMoveRight","onMouseUpLeft","onMouseUpRight","trackWidth","trackLeft","wrapperClassNames","classNames","sliderBackgroundColor","getCurrentBackgroundColor","jsxs","jsx"],"mappings":";;;;;AAMA,MAAMA,IAAiB,CAACC,GAAmBC,MAAuB;AAC9D,QAAMC,IAAiBD,KAAcD,IAAYC,IAAaD,GACxDG,IAAkBH,KAAaC,IAAaD,IAAYC;AAC9D,SAAO,CAACC,GAAgBC,CAAe;AAC3C,GAsEMC,KAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW,OAAO;AAAA,IAClB,aAAAC,IAAc;AAAA,IACd,gBAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAWC;AAAA,IACX,WAAAC,IAAYD;AAAA,IACZ,GAAGE;AAAA,EAAA,IACHd,GAEE,CAACe,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5C,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAK,GAC9C,CAACtB,GAAWyB,CAAY,IAAIH,EAASV,KAAwBN,CAAQ,GACrE,CAACL,GAAYyB,CAAa,IAAIJ,EAAST,KAA0BN,CAAQ,GACzE,CAACoB,GAAgBC,CAAiB,IAAIN,EAAS,EAAK,GACpD,CAACO,GAAiBC,CAAkB,IAAIR,EAAS,EAAK;AAE5D,EAAAS,EAAU,MAAM;AACZ,IAAI/B,KAAaM,KAAYN,KAAaO,KAAYN,KAAcK,KAAYL,KAAcM,MA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,MAAA;AAAA,IAAA;AAAA,EACf,GACJ;AAER;"}
|
|
1
|
+
{"version":3,"file":"RangeSlider.js","sources":["../../../src/components/slider/RangeSlider.tsx"],"sourcesContent":["import React, { type ChangeEvent, type HTMLAttributes, type MouseEvent, useEffect, useState } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/compat';\n\nimport { getCurrentBackgroundColor, type CurrentColor } from '../../utils/currentColors';\n\nconst getRangeValues = (valueLeft: number, valueRight: number) => {\n const finalLeftValue = valueRight <= valueLeft ? valueRight : valueLeft;\n const finalRightValue = valueLeft >= valueRight ? valueLeft : valueRight;\n return [finalLeftValue, finalRightValue];\n};\n\nexport type RangeSliderProps = {\n /**\n * The current left value of the selected range.\n */\n leftValue?: number;\n\n /**\n * The current right value of the selected range.\n */\n rightValue?: number;\n\n /**\n * The lower limit.\n *\n * @default 0\n */\n minValue: number;\n\n /**\n * The upper limit.\n *\n * @default Number.MAX_VALUE\n */\n maxValue: number;\n\n /**\n * Whether to show the value labels.\n *\n * @default false\n */\n valueLabels?: boolean;\n\n /**\n * Additional unit used for the slider value labels.\n */\n valueLabelUnit?: string | React.ReactNode;\n\n /**\n * Selector step value.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Defines the color of the slider.\n *\n * Possible values are:\n *\n * - `'primary'`\n * - `'secondary'`\n * - `'info'`\n * - `'warning'`\n * - `'danger'`\n * - `'success'`\n *\n * @default 'primary'\n */\n color?: CurrentColor;\n\n /**\n * Disables all pointer events.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback to get the new value every time it changes.\n */\n onChange?: (newLeftValue: number, newRightValue: number) => void;\n\n /**\n * Callback to get the value after the slider ended dragging.\n */\n onDragEnd?: (newLeftValue: number, newRightValue: number) => void;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'disabled' | 'onChange' | 'onDragEnd' | 'className'>;\n\nconst RangeSlider = (props: RangeSliderProps) => {\n const {\n minValue = 0,\n maxValue = Number.MAX_VALUE,\n valueLabels = false,\n valueLabelUnit,\n step = 1,\n color = 'primary',\n leftValue,\n rightValue,\n className,\n disabled = false,\n onChange = noop,\n onDragEnd = noop,\n ...remainingProps\n } = props;\n\n const [activeLeft, setActiveLeft] = useState(false);\n const [activeRight, setActiveRight] = useState(false);\n const [valueLeft, setValueLeft] = useState(leftValue ? leftValue : minValue);\n const [valueRight, setValueRight] = useState(rightValue ? rightValue : maxValue);\n const [isChangingLeft, setIsChangingLeft] = useState(false);\n const [isChangingRight, setIsChangingRight] = useState(false);\n\n useEffect(() => {\n if (valueLeft >= minValue && valueLeft <= maxValue && valueRight >= minValue && valueRight <= maxValue) {\n setValueLeft(valueLeft);\n setValueRight(valueRight);\n }\n }, [valueLeft, valueRight, minValue, maxValue]);\n\n const changeValues = (newValues: { valueLeft?: number; valueRight?: number }) => {\n const newValueLeft = newValues.valueLeft ? newValues.valueLeft : valueLeft;\n const newValueRight = newValues.valueRight ? newValues.valueRight : valueRight;\n\n setValueLeft(newValueLeft);\n setValueRight(newValueRight);\n\n setIsChangingLeft(!!newValues.valueLeft);\n setIsChangingRight(!!newValues.valueRight);\n\n const [newLeftValue, newRightValue] = getRangeValues(newValueLeft, newValueRight);\n onChange(newLeftValue, newRightValue);\n };\n\n const handleChangeValueLeft = (event: ChangeEvent<HTMLInputElement>) => {\n changeValues({ valueLeft: Number.parseInt(event.target.value, 10) });\n };\n\n const handleChangeValueRight = (event: ChangeEvent<HTMLInputElement>) => {\n changeValues({ valueRight: Number.parseInt(event.target.value, 10) });\n };\n\n const onMouseDownLeft = () => {\n setIsChangingLeft(true);\n setIsChangingRight(false);\n };\n\n const onMouseDownRight = () => {\n setIsChangingLeft(false);\n setIsChangingRight(true);\n };\n\n const getTrackMiddlePosition = (targetWidth: number) => {\n const trackValueLeftRelative = (valueLeft - minValue) / (maxValue - minValue);\n const trackValueRightRelative = (valueRight - minValue) / (maxValue - minValue);\n const trackMiddleRelative = (trackValueLeftRelative + trackValueRightRelative) / 2;\n\n return trackMiddleRelative * targetWidth;\n };\n\n const onMouseMoveLeft = (event: MouseEvent<HTMLInputElement>) => {\n const target = event.target as HTMLInputElement;\n if (!isChangingLeft) {\n const clientRect = target.getBoundingClientRect();\n const mouseHover = event.clientX - clientRect.left;\n const targetWidth = target.offsetWidth;\n\n const trackMiddlePosition = getTrackMiddlePosition(targetWidth);\n\n if (valueRight > valueLeft && mouseHover > trackMiddlePosition) {\n setActiveLeft(false);\n setActiveRight(true);\n }\n\n if (valueRight < valueLeft && mouseHover < trackMiddlePosition) {\n setActiveLeft(false);\n setActiveRight(true);\n }\n }\n };\n\n const onMouseMoveRight = (event: MouseEvent<HTMLInputElement>) => {\n const target = event.target as HTMLInputElement;\n if (!isChangingRight) {\n const clientRect = target.getBoundingClientRect();\n const mouseHover = event.clientX - clientRect.left;\n const targetWidth = target.offsetWidth;\n\n const trackMiddlePosition = getTrackMiddlePosition(targetWidth);\n\n if (valueRight > valueLeft && mouseHover < trackMiddlePosition) {\n setActiveLeft(true);\n setActiveRight(false);\n }\n\n if (valueRight < valueLeft && mouseHover > trackMiddlePosition) {\n setActiveLeft(true);\n setActiveRight(false);\n }\n }\n };\n\n const onMouseUpLeft = () => {\n setIsChangingLeft(false);\n setIsChangingRight(false);\n\n const [newLeftValue, newRightValue] = getRangeValues(valueLeft, valueRight);\n onDragEnd(newLeftValue, newRightValue);\n };\n\n const onMouseUpRight = () => {\n setIsChangingLeft(false);\n setIsChangingRight(false);\n\n const [newLeftValue, newRightValue] = getRangeValues(valueLeft, valueRight);\n onDragEnd(newLeftValue, newRightValue);\n };\n\n const [finalLeftValue, finalRightValue] = getRangeValues(valueLeft, valueRight);\n\n const trackWidth = (100 * (finalRightValue - finalLeftValue)) / (maxValue - minValue);\n const trackLeft = (100 * (finalLeftValue - minValue)) / (maxValue - minValue);\n\n const wrapperClassNames = classNames(\n 'range-slider',\n disabled && 'disabled',\n valueLabels && 'show-value-labels',\n className && className\n );\n\n const sliderBackgroundColor = getCurrentBackgroundColor(color);\n\n return (\n <div {...remainingProps} className={wrapperClassNames} style={{ color: sliderBackgroundColor }}>\n <div className='range-whole-track' />\n <div className='range-track' style={{ width: `${trackWidth}%`, left: `${trackLeft}%` }}>\n {valueLabels && (\n <div className='user-select-none'>\n <div className='range-value'>\n <span>{valueLabelUnit ? `${finalLeftValue} ${valueLabelUnit}` : finalLeftValue}</span>\n </div>\n <div className='range-value'>\n <span>{valueLabelUnit ? `${finalRightValue} ${valueLabelUnit}` : finalRightValue}</span>\n </div>\n </div>\n )}\n </div>\n <input\n className={`${isChangingLeft ? 'changing' : ''}`}\n style={{ zIndex: activeLeft ? '6' : '5' }}\n value={valueLeft}\n min={minValue}\n max={maxValue}\n step={step}\n type='range'\n onChange={handleChangeValueLeft}\n onMouseDown={onMouseDownLeft}\n onMouseMove={onMouseMoveLeft}\n onMouseUp={onMouseUpLeft}\n />\n <input\n className={`${isChangingRight ? 'changing' : ''}`}\n style={{ zIndex: activeRight ? '6' : '5' }}\n value={valueRight}\n min={minValue}\n max={maxValue}\n step={step}\n type='range'\n onChange={handleChangeValueRight}\n onMouseDown={onMouseDownRight}\n onMouseMove={onMouseMoveRight}\n onMouseUp={onMouseUpRight}\n />\n </div>\n );\n};\n\nexport default RangeSlider;\n"],"names":["getRangeValues","valueLeft","valueRight","finalLeftValue","finalRightValue","RangeSlider","props","minValue","maxValue","valueLabels","valueLabelUnit","step","color","leftValue","rightValue","className","disabled","onChange","noop","onDragEnd","remainingProps","activeLeft","setActiveLeft","useState","activeRight","setActiveRight","setValueLeft","setValueRight","isChangingLeft","setIsChangingLeft","isChangingRight","setIsChangingRight","useEffect","changeValues","newValues","newValueLeft","newValueRight","newLeftValue","newRightValue","handleChangeValueLeft","event","handleChangeValueRight","onMouseDownLeft","onMouseDownRight","getTrackMiddlePosition","targetWidth","trackValueLeftRelative","trackValueRightRelative","onMouseMoveLeft","target","clientRect","mouseHover","trackMiddlePosition","onMouseMoveRight","onMouseUpLeft","onMouseUpRight","trackWidth","trackLeft","wrapperClassNames","classNames","sliderBackgroundColor","getCurrentBackgroundColor","jsxs","jsx"],"mappings":";;;;;AAMA,MAAMA,IAAiB,CAACC,GAAmBC,MAAuB;AAC9D,QAAMC,IAAiBD,KAAcD,IAAYC,IAAaD,GACxDG,IAAkBH,KAAaC,IAAaD,IAAYC;AAC9D,SAAO,CAACC,GAAgBC,CAAe;AAC3C,GAqFMC,KAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW,OAAO;AAAA,IAClB,aAAAC,IAAc;AAAA,IACd,gBAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAWC;AAAA,IACX,WAAAC,IAAYD;AAAA,IACZ,GAAGE;AAAA,EAAA,IACHd,GAEE,CAACe,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5C,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAK,GAC9C,CAACtB,GAAWyB,CAAY,IAAIH,EAASV,KAAwBN,CAAQ,GACrE,CAACL,GAAYyB,CAAa,IAAIJ,EAAST,KAA0BN,CAAQ,GACzE,CAACoB,GAAgBC,CAAiB,IAAIN,EAAS,EAAK,GACpD,CAACO,GAAiBC,CAAkB,IAAIR,EAAS,EAAK;AAE5D,EAAAS,EAAU,MAAM;AACZ,IAAI/B,KAAaM,KAAYN,KAAaO,KAAYN,KAAcK,KAAYL,KAAcM,MAC1FkB,EAAazB,CAAS,GACtB0B,EAAczB,CAAU;AAAA,EAEhC,GAAG,CAACD,GAAWC,GAAYK,GAAUC,CAAQ,CAAC;AAE9C,QAAMyB,IAAe,CAACC,MAA2D;AAC7E,UAAMC,IAAeD,EAAU,YAAYA,EAAU,YAAYjC,GAC3DmC,IAAgBF,EAAU,aA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eACG,gBAAAK,EAAC,OAAA,EAAI,WAAU,oBACX,UAAA;AAAA,MAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,eACX,UAAA,gBAAAA,EAAC,QAAA,EAAM,UAAArD,IAAiB,GAAGP,CAAc,IAAIO,CAAc,KAAKP,EAAA,CAAe,GACnF;AAAA,MACA,gBAAA4D,EAAC,OAAA,EAAI,WAAU,eACX,UAAA,gBAAAA,EAAC,QAAA,EAAM,UAAArD,IAAiB,GAAGN,CAAe,IAAIM,CAAc,KAAKN,GAAgB,EAAA,CACrF;AAAA,IAAA,EAAA,CACJ,EAAA,CAER;AAAA,IACA,gBAAA2D;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAW,GAAGnC,IAAiB,aAAa,EAAE;AAAA,QAC9C,OAAO,EAAE,QAAQP,IAAa,MAAM,IAAA;AAAA,QACpC,OAAOpB;AAAA,QACP,KAAKM;AAAA,QACL,KAAKC;AAAA,QACL,MAAAG;AAAA,QACA,MAAK;AAAA,QACL,UAAU4B;AAAA,QACV,aAAaG;AAAA,QACb,aAAaM;AAAA,QACb,WAAWM;AAAA,MAAA;AAAA,IAAA;AAAA,IAEf,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAW,GAAGjC,IAAkB,aAAa,EAAE;AAAA,QAC/C,OAAO,EAAE,QAAQN,IAAc,MAAM,IAAA;AAAA,QACrC,OAAOtB;AAAA,QACP,KAAKK;AAAA,QACL,KAAKC;AAAA,QACL,MAAAG;AAAA,QACA,MAAK;AAAA,QACL,UAAU8B;AAAA,QACV,aAAaE;AAAA,QACb,aAAaU;AAAA,QACb,WAAWE;AAAA,MAAA;AAAA,IAAA;AAAA,EACf,GACJ;AAER;"}
|
|
@@ -50,6 +50,15 @@ export type SliderProps = {
|
|
|
50
50
|
/**
|
|
51
51
|
* Defines the color of the slider.
|
|
52
52
|
*
|
|
53
|
+
* Possible values are:
|
|
54
|
+
*
|
|
55
|
+
* - `'primary'`
|
|
56
|
+
* - `'secondary'`
|
|
57
|
+
* - `'info'`
|
|
58
|
+
* - `'warning'`
|
|
59
|
+
* - `'danger'`
|
|
60
|
+
* - `'success'`
|
|
61
|
+
*
|
|
53
62
|
* @default 'primary'
|
|
54
63
|
*/
|
|
55
64
|
color?: CurrentColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","sources":["../../../src/components/slider/Slider.tsx"],"sourcesContent":["import React, { type ChangeEvent, type HTMLAttributes, useEffect, useState } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/compat';\n\nimport { getCurrentBackgroundColor, type CurrentColor } from '../../utils/currentColors';\n\nexport type SliderProps = {\n /**\n * The current value.\n *\n * @default 0\n */\n value?: number;\n\n /**\n * The lower limit.\n *\n * @default 0\n */\n minValue?: number;\n\n /**\n * The upper limit.\n *\n * @default Number.MAX_VALUE\n */\n maxValue?: number;\n\n /**\n * Whether to show the value labels.\n *\n * @default false\n */\n valueLabels?: boolean;\n\n /**\n * Additional unit used for the slider value label.\n */\n valueLabelUnit?: string | React.ReactNode;\n\n /**\n * Whether to hide the dark-colored value bar.\n *\n * @default false\n */\n hideValueBar?: boolean;\n\n /**\n * Whether to show larger value labels instead of the normal ones.\n *\n * @default false\n */\n largeValueLabels?: boolean;\n\n /**\n * Selector step value.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Defines the color of the slider.\n *\n * @default 'primary'\n */\n color?: CurrentColor;\n\n /**\n * Disables all pointer events.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback to get the new value every time it changes.\n */\n onChange?: (newValue: number) => void;\n\n /**\n * Callback to get the value after the slider ended dragging.\n */\n onDragEnd?: (newValue: number) => void;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'disabled' | 'onChange' | 'onDragEnd' | 'className'>;\n\nconst Slider = (props: SliderProps) => {\n const {\n value = 0,\n minValue = 0,\n maxValue = Number.MAX_VALUE,\n valueLabels = false,\n valueLabelUnit,\n largeValueLabels = false,\n hideValueBar = false,\n color = 'primary',\n step = 1,\n onChange = noop,\n onDragEnd = noop,\n className,\n disabled = false,\n ...remainingProps\n } = props;\n\n const [currentValue, setCurrentValue] = useState(value ? value : minValue);\n const [isChanging, setIsChanging] = useState(false);\n\n useEffect(() => {\n if (value >= minValue && value <= maxValue) {\n setCurrentValue(value);\n }\n }, [value, minValue, maxValue]);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const newValue = Number.parseInt(event.target.value, 10);\n setCurrentValue(newValue);\n setIsChanging(true);\n onChange(newValue);\n };\n\n const onMouseUp = () => {\n setIsChanging(false);\n onDragEnd(currentValue);\n };\n\n const onMouseDown = () => {\n setIsChanging(true);\n };\n\n const wrapperClassNames = classNames(\n 'range-slider',\n disabled && 'disabled',\n valueLabels && 'show-value-labels',\n hideValueBar && 'hide-value-bar',\n largeValueLabels && 'large-value-labels',\n className && className\n );\n\n const trackWidth = (100 * (currentValue - minValue)) / (maxValue - minValue);\n\n const sliderBackgroundColor = getCurrentBackgroundColor(color);\n\n return (\n <div {...remainingProps} className={wrapperClassNames} style={{ color: sliderBackgroundColor }}>\n <div className='range-whole-track' />\n <div className='range-track' style={{ width: `${trackWidth}%` }}>\n {valueLabels && (\n <div className='range-value'>\n <span>{valueLabelUnit ? `${currentValue} ${valueLabelUnit}` : currentValue}</span>\n </div>\n )}\n </div>\n <input\n className={`${isChanging ? 'changing' : ''}`}\n value={currentValue}\n min={minValue}\n max={maxValue}\n step={step}\n type='range'\n onChange={handleChange}\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n />\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["Slider","props","value","minValue","maxValue","valueLabels","valueLabelUnit","largeValueLabels","hideValueBar","color","step","onChange","noop","onDragEnd","className","disabled","remainingProps","currentValue","setCurrentValue","useState","isChanging","setIsChanging","useEffect","handleChange","event","newValue","onMouseUp","onMouseDown","wrapperClassNames","classNames","trackWidth","sliderBackgroundColor","getCurrentBackgroundColor","jsxs","jsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Slider.js","sources":["../../../src/components/slider/Slider.tsx"],"sourcesContent":["import React, { type ChangeEvent, type HTMLAttributes, useEffect, useState } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/compat';\n\nimport { getCurrentBackgroundColor, type CurrentColor } from '../../utils/currentColors';\n\nexport type SliderProps = {\n /**\n * The current value.\n *\n * @default 0\n */\n value?: number;\n\n /**\n * The lower limit.\n *\n * @default 0\n */\n minValue?: number;\n\n /**\n * The upper limit.\n *\n * @default Number.MAX_VALUE\n */\n maxValue?: number;\n\n /**\n * Whether to show the value labels.\n *\n * @default false\n */\n valueLabels?: boolean;\n\n /**\n * Additional unit used for the slider value label.\n */\n valueLabelUnit?: string | React.ReactNode;\n\n /**\n * Whether to hide the dark-colored value bar.\n *\n * @default false\n */\n hideValueBar?: boolean;\n\n /**\n * Whether to show larger value labels instead of the normal ones.\n *\n * @default false\n */\n largeValueLabels?: boolean;\n\n /**\n * Selector step value.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Defines the color of the slider.\n *\n * Possible values are:\n *\n * - `'primary'`\n * - `'secondary'`\n * - `'info'`\n * - `'warning'`\n * - `'danger'`\n * - `'success'`\n *\n * @default 'primary'\n */\n color?: CurrentColor;\n\n /**\n * Disables all pointer events.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback to get the new value every time it changes.\n */\n onChange?: (newValue: number) => void;\n\n /**\n * Callback to get the value after the slider ended dragging.\n */\n onDragEnd?: (newValue: number) => void;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'disabled' | 'onChange' | 'onDragEnd' | 'className'>;\n\nconst Slider = (props: SliderProps) => {\n const {\n value = 0,\n minValue = 0,\n maxValue = Number.MAX_VALUE,\n valueLabels = false,\n valueLabelUnit,\n largeValueLabels = false,\n hideValueBar = false,\n color = 'primary',\n step = 1,\n onChange = noop,\n onDragEnd = noop,\n className,\n disabled = false,\n ...remainingProps\n } = props;\n\n const [currentValue, setCurrentValue] = useState(value ? value : minValue);\n const [isChanging, setIsChanging] = useState(false);\n\n useEffect(() => {\n if (value >= minValue && value <= maxValue) {\n setCurrentValue(value);\n }\n }, [value, minValue, maxValue]);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const newValue = Number.parseInt(event.target.value, 10);\n setCurrentValue(newValue);\n setIsChanging(true);\n onChange(newValue);\n };\n\n const onMouseUp = () => {\n setIsChanging(false);\n onDragEnd(currentValue);\n };\n\n const onMouseDown = () => {\n setIsChanging(true);\n };\n\n const wrapperClassNames = classNames(\n 'range-slider',\n disabled && 'disabled',\n valueLabels && 'show-value-labels',\n hideValueBar && 'hide-value-bar',\n largeValueLabels && 'large-value-labels',\n className && className\n );\n\n const trackWidth = (100 * (currentValue - minValue)) / (maxValue - minValue);\n\n const sliderBackgroundColor = getCurrentBackgroundColor(color);\n\n return (\n <div {...remainingProps} className={wrapperClassNames} style={{ color: sliderBackgroundColor }}>\n <div className='range-whole-track' />\n <div className='range-track' style={{ width: `${trackWidth}%` }}>\n {valueLabels && (\n <div className='range-value'>\n <span>{valueLabelUnit ? `${currentValue} ${valueLabelUnit}` : currentValue}</span>\n </div>\n )}\n </div>\n <input\n className={`${isChanging ? 'changing' : ''}`}\n value={currentValue}\n min={minValue}\n max={maxValue}\n step={step}\n type='range'\n onChange={handleChange}\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n />\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["Slider","props","value","minValue","maxValue","valueLabels","valueLabelUnit","largeValueLabels","hideValueBar","color","step","onChange","noop","onDragEnd","className","disabled","remainingProps","currentValue","setCurrentValue","useState","isChanging","setIsChanging","useEffect","handleChange","event","newValue","onMouseUp","onMouseDown","wrapperClassNames","classNames","trackWidth","sliderBackgroundColor","getCurrentBackgroundColor","jsxs","jsx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AWY,GAAmB,OAAO,EAAE,OAAOG,EAAA,GACnE,UAAA;AAAA,IAAA,gBAAAG,EAAC,OAAA,EAAI,WAAU,oBAAA,CAAoB;AAAA,IACnC,gBAAAA,EAAC,OAAA,EAAI,WAAU,eAAc,OAAO,EAAE,OAAO,GAAGJ,CAAU,IAAA,GACrD,UAAAzB,KACG,gBAAA6B,EAAC,SAAI,WAAU,eACX,UAAA,gBAAAA,EAAC,QAAA,EAAM,UAAA5B,IAAiB,GAAGW,CAAY,IAAIX,CAAc,KAAKW,EAAA,CAAa,EAAA,CAC/E,GAER;AAAA,IACA,gBAAAiB;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAW,GAAGd,IAAa,aAAa,EAAE;AAAA,QAC1C,OAAOH;AAAA,QACP,KAAKd;AAAA,QACL,KAAKC;AAAA,QACL,MAAAM;AAAA,QACA,MAAK;AAAA,QACL,UAAUa;AAAA,QACV,aAAAI;AAAA,QACA,WAAAD;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GACJ;AAER;"}
|
|
@@ -1,14 +1,58 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export type SmoothScrollbarsProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Defines whether the scrollbars should slide in on hover.
|
|
5
|
+
*
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
3
8
|
slideIn?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Defines whether the scrollbars should be slightly larger.
|
|
11
|
+
*
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
4
14
|
largeTrack?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Defines whether the scrollbars should have an offset.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
5
20
|
trackOffset?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Additional classes to be set on the wrapper element.
|
|
23
|
+
*/
|
|
6
24
|
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Tag name used for the scroll container.
|
|
27
|
+
*
|
|
28
|
+
* @default 'div'
|
|
29
|
+
*/
|
|
7
30
|
tagName?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Enable auto-height behavior.
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
8
36
|
autoHeight?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Minimum height when auto-height is enabled.
|
|
39
|
+
*
|
|
40
|
+
* @default 0
|
|
41
|
+
*/
|
|
9
42
|
autoHeightMin?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Maximum height when auto-height is enabled.
|
|
45
|
+
*
|
|
46
|
+
* @default 200
|
|
47
|
+
*/
|
|
10
48
|
autoHeightMax?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Scroll callback, forwarded to the underlying scrollbars instance.
|
|
51
|
+
*/
|
|
11
52
|
onScroll?: (event: React.UIEvent<any> | undefined) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Inline styles for the scroll container.
|
|
55
|
+
*/
|
|
12
56
|
style?: React.CSSProperties;
|
|
13
57
|
};
|
|
14
58
|
declare const SmoothScrollbars: React.ForwardRefExoticComponent<SmoothScrollbarsProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmoothScrollbars.js","sources":["../../../src/components/smoothScrollbars/SmoothScrollbars.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n type ForwardedRef,\n type PropsWithChildren,\n} from 'react';\nimport { Scrollbars } from 'react-custom-scrollbars-4';\nimport classNames from 'classnames';\nimport { debounce, noop } from 'es-toolkit/function';\n\nexport type SmoothScrollbarsProps = {\n slideIn?: boolean;\n largeTrack?: boolean;\n trackOffset?: boolean;\n className?: string;\n tagName?: string;\n autoHeight?: boolean;\n autoHeightMin?: number;\n autoHeightMax?: number;\n onScroll?: (event: React.UIEvent<any> | undefined) => void;\n style?: React.CSSProperties;\n};\n\ntype ScrollbarsWithUpdate = Scrollbars & {\n update: () => void;\n};\n\nconst RESIZE_THROTTLING = 100;\n\nconst SmoothScrollbars = forwardRef(\n (componentProps: PropsWithChildren<SmoothScrollbarsProps>, ref: ForwardedRef<any>) => {\n const {\n slideIn = false,\n largeTrack = false,\n trackOffset = false,\n className = '',\n onScroll = noop,\n tagName = 'div',\n autoHeight = false,\n autoHeightMin = 0,\n autoHeightMax = 200,\n children,\n style,\n ...remainingProps\n } = componentProps;\n\n const scrollbarsRef = useRef<Scrollbars>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => scrollbarsRef.current as Scrollbars);\n\n useEffect(() => {\n if (!contentRef.current || !scrollbarsRef.current) {\n return;\n }\n\n const updateScrollbars = debounce(() => {\n if (scrollbarsRef.current) {\n // Trigger a update for the scrollbars.\n // This is needed since the lib does not automatically update on content height changes\n // See: https://github.com/RobPethick/react-custom-scrollbars-2/issues/12\n\n // Use type assertion to tell TypeScript that 'update' exists\n (scrollbarsRef.current as ScrollbarsWithUpdate).update();\n }\n }, RESIZE_THROTTLING);\n\n const resizeObserver = new ResizeObserver(updateScrollbars);\n resizeObserver.observe(contentRef.current);\n\n return () => {\n resizeObserver.disconnect();\n updateScrollbars.cancel();\n };\n }, []);\n\n const wrapperClassNames = classNames(className, slideIn && 'scrollbar-fly-in', 'smooth-scrollbar-wrapper');\n\n const renderTrackVerticalNames = classNames(\n 'scrollbar-track-vertical',\n largeTrack && 'scrollbar-track-size-large',\n trackOffset && 'scrollbar-track-offset'\n );\n\n const renderThumbVerticalNames = classNames(\n 'scrollbar-thumb-vertical',\n largeTrack && 'scrollbar-thumb-size-large'\n );\n\n const renderTrackHorizontalNames = classNames(\n 'scrollbar-track-horizontal',\n largeTrack && 'scrollbar-track-size-large',\n trackOffset && 'scrollbar-track-offset'\n );\n\n const renderThumbHorizontalNames = classNames(\n 'scrollbar-thumb-horizontal',\n largeTrack && 'scrollbar-thumb-size-large'\n );\n\n return (\n <Scrollbars\n {...remainingProps}\n ref={scrollbarsRef}\n tagName={tagName}\n onScroll={onScroll}\n className={wrapperClassNames}\n hideTracksWhenNotNeeded\n autoHeight={autoHeight}\n autoHeightMin={autoHeightMin}\n autoHeightMax={autoHeightMax}\n renderView={props => {\n return <div {...props} className='scrollbar-view' />;\n }}\n renderTrackVertical={props => {\n return <div {...props} className={renderTrackVerticalNames} />;\n }}\n renderThumbVertical={props => {\n return <div {...props} className={renderThumbVerticalNames} />;\n }}\n renderTrackHorizontal={props => {\n return <div {...props} className={renderTrackHorizontalNames} />;\n }}\n renderThumbHorizontal={props => {\n return <div {...props} className={renderThumbHorizontalNames} />;\n }}\n >\n <div className='scrollbar-content-wrapper' ref={contentRef}>\n {children}\n </div>\n </Scrollbars>\n );\n }\n);\n\nexport default SmoothScrollbars;\n"],"names":["RESIZE_THROTTLING","SmoothScrollbars","forwardRef","componentProps","ref","slideIn","largeTrack","trackOffset","className","onScroll","noop","tagName","autoHeight","autoHeightMin","autoHeightMax","children","style","remainingProps","scrollbarsRef","useRef","contentRef","useImperativeHandle","useEffect","updateScrollbars","debounce","resizeObserver","wrapperClassNames","classNames","renderTrackVerticalNames","renderThumbVerticalNames","renderTrackHorizontalNames","renderThumbHorizontalNames","jsx","Scrollbars","props"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"SmoothScrollbars.js","sources":["../../../src/components/smoothScrollbars/SmoothScrollbars.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n type ForwardedRef,\n type PropsWithChildren,\n} from 'react';\nimport { Scrollbars } from 'react-custom-scrollbars-4';\nimport classNames from 'classnames';\nimport { debounce, noop } from 'es-toolkit/function';\n\nexport type SmoothScrollbarsProps = {\n /**\n * Defines whether the scrollbars should slide in on hover.\n *\n * @default false\n */\n slideIn?: boolean;\n\n /**\n * Defines whether the scrollbars should be slightly larger.\n *\n * @default false\n */\n largeTrack?: boolean;\n\n /**\n * Defines whether the scrollbars should have an offset.\n *\n * @default false\n */\n trackOffset?: boolean;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n\n /**\n * Tag name used for the scroll container.\n *\n * @default 'div'\n */\n tagName?: string;\n\n /**\n * Enable auto-height behavior.\n *\n * @default false\n */\n autoHeight?: boolean;\n\n /**\n * Minimum height when auto-height is enabled.\n *\n * @default 0\n */\n autoHeightMin?: number;\n\n /**\n * Maximum height when auto-height is enabled.\n *\n * @default 200\n */\n autoHeightMax?: number;\n\n /**\n * Scroll callback, forwarded to the underlying scrollbars instance.\n */\n onScroll?: (event: React.UIEvent<any> | undefined) => void;\n\n /**\n * Inline styles for the scroll container.\n */\n style?: React.CSSProperties;\n};\n\ntype ScrollbarsWithUpdate = Scrollbars & {\n update: () => void;\n};\n\nconst RESIZE_THROTTLING = 100;\n\nconst SmoothScrollbars = forwardRef(\n (componentProps: PropsWithChildren<SmoothScrollbarsProps>, ref: ForwardedRef<any>) => {\n const {\n slideIn = false,\n largeTrack = false,\n trackOffset = false,\n className = '',\n onScroll = noop,\n tagName = 'div',\n autoHeight = false,\n autoHeightMin = 0,\n autoHeightMax = 200,\n children,\n style,\n ...remainingProps\n } = componentProps;\n\n const scrollbarsRef = useRef<Scrollbars>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => scrollbarsRef.current as Scrollbars);\n\n useEffect(() => {\n if (!contentRef.current || !scrollbarsRef.current) {\n return;\n }\n\n const updateScrollbars = debounce(() => {\n if (scrollbarsRef.current) {\n // Trigger a update for the scrollbars.\n // This is needed since the lib does not automatically update on content height changes\n // See: https://github.com/RobPethick/react-custom-scrollbars-2/issues/12\n\n // Use type assertion to tell TypeScript that 'update' exists\n (scrollbarsRef.current as ScrollbarsWithUpdate).update();\n }\n }, RESIZE_THROTTLING);\n\n const resizeObserver = new ResizeObserver(updateScrollbars);\n resizeObserver.observe(contentRef.current);\n\n return () => {\n resizeObserver.disconnect();\n updateScrollbars.cancel();\n };\n }, []);\n\n const wrapperClassNames = classNames(className, slideIn && 'scrollbar-fly-in', 'smooth-scrollbar-wrapper');\n\n const renderTrackVerticalNames = classNames(\n 'scrollbar-track-vertical',\n largeTrack && 'scrollbar-track-size-large',\n trackOffset && 'scrollbar-track-offset'\n );\n\n const renderThumbVerticalNames = classNames(\n 'scrollbar-thumb-vertical',\n largeTrack && 'scrollbar-thumb-size-large'\n );\n\n const renderTrackHorizontalNames = classNames(\n 'scrollbar-track-horizontal',\n largeTrack && 'scrollbar-track-size-large',\n trackOffset && 'scrollbar-track-offset'\n );\n\n const renderThumbHorizontalNames = classNames(\n 'scrollbar-thumb-horizontal',\n largeTrack && 'scrollbar-thumb-size-large'\n );\n\n return (\n <Scrollbars\n {...remainingProps}\n ref={scrollbarsRef}\n tagName={tagName}\n onScroll={onScroll}\n className={wrapperClassNames}\n hideTracksWhenNotNeeded\n autoHeight={autoHeight}\n autoHeightMin={autoHeightMin}\n autoHeightMax={autoHeightMax}\n renderView={props => {\n return <div {...props} className='scrollbar-view' />;\n }}\n renderTrackVertical={props => {\n return <div {...props} className={renderTrackVerticalNames} />;\n }}\n renderThumbVertical={props => {\n return <div {...props} className={renderThumbVerticalNames} />;\n }}\n renderTrackHorizontal={props => {\n return <div {...props} className={renderTrackHorizontalNames} />;\n }}\n renderThumbHorizontal={props => {\n return <div {...props} className={renderThumbHorizontalNames} />;\n }}\n >\n <div className='scrollbar-content-wrapper' ref={contentRef}>\n {children}\n </div>\n </Scrollbars>\n );\n }\n);\n\nexport default SmoothScrollbars;\n"],"names":["RESIZE_THROTTLING","SmoothScrollbars","forwardRef","componentProps","ref","slideIn","largeTrack","trackOffset","className","onScroll","noop","tagName","autoHeight","autoHeightMin","autoHeightMax","children","style","remainingProps","scrollbarsRef","useRef","contentRef","useImperativeHandle","useEffect","updateScrollbars","debounce","resizeObserver","wrapperClassNames","classNames","renderTrackVerticalNames","renderThumbVerticalNames","renderTrackHorizontalNames","renderThumbHorizontalNames","jsx","Scrollbars","props"],"mappings":";;;;;AAkFA,MAAMA,IAAoB,KAEpBC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AAA,QACL,SAAAP;AAAA,QACA,UAAAF;AAAA,QACA,WAAWiB;AAAA,QACX,yBAAuB;AAAA,QACvB,YAAAd;AAAA,QACA,eAAAC;AAAA,QACA,eAAAC;AAAA,QACA,YAAY,CAAAoB,MACD,gBAAAF,EAAC,OAAA,EAAK,GAAGE,GAAO,WAAU,kBAAiB;AAAA,QAEtD,qBAAqB,CAAAA,MACV,gBAAAF,EAAC,OAAA,EAAK,GAAGE,GAAO,WAAWN,GAA0B;AAAA,QAEhE,qBAAqB,CAAAM,MACV,gBAAAF,EAAC,OAAA,EAAK,GAAGE,GAAO,WAAWL,GAA0B;AAAA,QAEhE,uBAAuB,CAAAK,MACZ,gBAAAF,EAAC,OAAA,EAAK,GAAGE,GAAO,WAAWJ,GAA4B;AAAA,QAElE,uBAAuB,CAAAI,MACZ,gBAAAF,EAAC,OAAA,EAAK,GAAGE,GAAO,WAAWH,GAA4B;AAAA,QAGlE,4BAAC,OAAA,EAAI,WAAU,6BAA4B,KAAKX,GAC3C,UAAAL,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAGZ;AACJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type SpinnerProps = {
|
|
3
3
|
/**
|
|
4
4
|
* Defines whether the spinner is shown on bright or dark background.
|
|
5
5
|
*
|
|
@@ -35,7 +35,7 @@ export interface SpinnerProps {
|
|
|
35
35
|
/**
|
|
36
36
|
* Flag to control the visibility of the spinner.
|
|
37
37
|
*
|
|
38
|
-
* Only relevant in combination with
|
|
38
|
+
* Only relevant in combination with `isFullSized` or `isFullScreen`.
|
|
39
39
|
*
|
|
40
40
|
* @default false
|
|
41
41
|
*/
|
|
@@ -44,6 +44,6 @@ export interface SpinnerProps {
|
|
|
44
44
|
* The text shown next to the spinner icon.
|
|
45
45
|
*/
|
|
46
46
|
text?: string | React.ReactNode;
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
declare const Spinner: (props: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
49
|
export default Spinner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.js","sources":["../../../src/components/spinner/Spinner.tsx"],"sourcesContent":["import type React from 'react';\nimport classNames from 'classnames';\n\nimport Fade from '../fade/Fade';\n\ntype BaseSpinnerProps = {\n isInverse?: boolean;\n isDoubleSized?: boolean;\n};\n\nconst BaseSpinner = (props: BaseSpinnerProps) => {\n const { isInverse, isDoubleSized, ...remainingProps } = props;\n const className = classNames('spinner', { inverse: isInverse, double: isDoubleSized });\n return (\n <div {...remainingProps} className={className}>\n <div />\n <div />\n <div />\n <div />\n </div>\n );\n};\n\nexport
|
|
1
|
+
{"version":3,"file":"Spinner.js","sources":["../../../src/components/spinner/Spinner.tsx"],"sourcesContent":["import type React from 'react';\nimport classNames from 'classnames';\n\nimport Fade from '../fade/Fade';\n\ntype BaseSpinnerProps = {\n isInverse?: boolean;\n isDoubleSized?: boolean;\n};\n\nconst BaseSpinner = (props: BaseSpinnerProps) => {\n const { isInverse, isDoubleSized, ...remainingProps } = props;\n const className = classNames('spinner', { inverse: isInverse, double: isDoubleSized });\n return (\n <div {...remainingProps} className={className}>\n <div />\n <div />\n <div />\n <div />\n </div>\n );\n};\n\nexport type SpinnerProps = {\n /**\n * Defines whether the spinner is shown on bright or dark background.\n *\n * @default false\n */\n isInverse?: boolean;\n\n /**\n * If set to \"true\" the spinner will be rendered twice as big.\n *\n * @default false\n */\n isDoubleSized?: boolean;\n\n /**\n * Renders the spinner as overlay in full-size mode.\n *\n * This will be relative to the parent container. Set the parent element to \"position-relative\" in this case.\n *\n * @default false\n */\n isFullSized?: boolean;\n\n /**\n * Renders the spinner in fullscreen mode, relative to the body.\n *\n * @default false\n */\n isFullScreen?: boolean;\n\n /**\n * Renders the spinner without centered wrapper.\n *\n * @default false\n */\n isInline?: boolean;\n\n /**\n * Flag to control the visibility of the spinner.\n *\n * Only relevant in combination with `isFullSized` or `isFullScreen`.\n *\n * @default false\n */\n show?: boolean;\n\n /**\n * The text shown next to the spinner icon.\n */\n text?: string | React.ReactNode;\n};\n\nconst Spinner = (props: SpinnerProps) => {\n const {\n isInverse = false,\n isFullSized = false,\n isFullScreen = false,\n isDoubleSized = false,\n isInline = false,\n show = false,\n text,\n ...remainingProps\n } = props;\n\n const baseSpinner = <BaseSpinner isDoubleSized={isDoubleSized} isInverse={isInverse} {...remainingProps} />;\n\n if (isInline) {\n return baseSpinner;\n }\n\n const classes = classNames(\n ['spinnerInfoBox', 'display-flex', 'justify-content-center', 'align-items-center', 'height-100pct'],\n { fullsized: isFullSized, fullscreen: isFullScreen }\n );\n\n const wrappedSpinner = (\n <div className={classes}>\n {baseSpinner}\n {text && <div className='spinnerText'>{text}</div>}\n </div>\n );\n\n if (isFullScreen || isFullSized) {\n return (\n <Fade show={show} duration={0.1}>\n {wrappedSpinner}\n </Fade>\n );\n }\n\n return wrappedSpinner;\n};\n\nexport default Spinner;\n"],"names":["BaseSpinner","props","isInverse","isDoubleSized","remainingProps","className","classNames","jsxs","jsx","Spinner","isFullSized","isFullScreen","isInline","show","text","baseSpinner","classes","wrappedSpinner","Fade"],"mappings":";;;AAUA,MAAMA,IAAc,CAACC,MAA4B;AAC7C,QAAM,EAAE,WAAAC,GAAW,eAAAC,GAAe,GAAGC,MAAmBH,GAClDI,IAAYC,EAAW,WAAW,EAAE,SAASJ,GAAW,QAAQC,GAAe;AACrF,SACI,gBAAAI,EAAC,OAAA,EAAK,GAAGH,GAAgB,WAAAC,GACrB,UAAA;AAAA,IAAA,gBAAAG,EAAC,OAAA,EAAI;AAAA,sBACJ,OAAA,EAAI;AAAA,sBACJ,OAAA,EAAI;AAAA,sBACJ,OAAA,CAAA,CAAI;AAAA,EAAA,GACT;AAER,GAuDMC,IAAU,CAACR,MAAwB;AACrC,QAAM;AAAA,IACF,WAAAC,IAAY;AAAA,IACZ,aAAAQ,IAAc;AAAA,IACd,cAAAC,IAAe;AAAA,IACf,eAAAR,IAAgB;AAAA,IAChB,UAAAS,IAAW;AAAA,IACX,MAAAC,IAAO;AAAA,IACP,MAAAC;AAAA,IACA,GAAGV;AAAA,EAAA,IACHH,GAEEc,IAAc,gBAAAP,EAACR,GAAA,EAAY,eAAAG,GAA8B,WAAAD,GAAuB,GAAGE,GAAgB;AAEzG,MAAIQ;AACA,WAAOG;AAGX,QAAMC,IAAUV;AAAA,IACZ,CAAC,kBAAkB,gBAAgB,0BAA0B,sBAAsB,eAAe;AAAA,IAClG,EAAE,WAAWI,GAAa,YAAYC,EAAA;AAAA,EAAa,GAGjDM,IACF,gBAAAV,EAAC,OAAA,EAAI,WAAWS,GACX,UAAA;AAAA,IAAAD;AAAA,IACAD,KAAQ,gBAAAN,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAM,EAAA,CAAK;AAAA,EAAA,GAChD;AAGJ,SAAIH,KAAgBD,IAEZ,gBAAAF,EAACU,GAAA,EAAK,MAAAL,GAAY,UAAU,KACvB,UAAAI,GACL,IAIDA;AACX;"}
|
|
@@ -36,7 +36,7 @@ export type BaseStateProps = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Defines whether to use 100% width or default width.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
39
|
+
* __Note:__ Only to be used for special cases on the CustomState component.
|
|
40
40
|
*
|
|
41
41
|
* @default false
|
|
42
42
|
*/
|
|
@@ -50,7 +50,11 @@ export type BaseStateProps = {
|
|
|
50
50
|
/**
|
|
51
51
|
* Defines where the panel is aligned.
|
|
52
52
|
*
|
|
53
|
-
* Possible values are:
|
|
53
|
+
* Possible values are:
|
|
54
|
+
*
|
|
55
|
+
* - `'left'`
|
|
56
|
+
* - `'center'`
|
|
57
|
+
* - `'right'`
|
|
54
58
|
*
|
|
55
59
|
* @default 'center'
|
|
56
60
|
*/
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
export type StateIconProps = {
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The name of the icon
|
|
4
|
+
*/
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* Optional class names for this icon.
|
|
8
|
+
*
|
|
9
|
+
* @default 'text-size-300pct'
|
|
10
|
+
*/
|
|
3
11
|
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional color class name for the icon.
|
|
14
|
+
*
|
|
15
|
+
* @default 'text-color-light'
|
|
16
|
+
*/
|
|
4
17
|
color?: string;
|
|
5
18
|
};
|
|
6
19
|
declare const StateIcon: ({ name, color, className }: StateIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateIcon.js","sources":["../../../src/components/states/StateIcon.tsx"],"sourcesContent":["export type StateIconProps = {\n name
|
|
1
|
+
{"version":3,"file":"StateIcon.js","sources":["../../../src/components/states/StateIcon.tsx"],"sourcesContent":["export type StateIconProps = {\n /**\n * The name of the icon\n */\n name: string;\n\n /**\n * Optional class names for this icon.\n *\n * @default 'text-size-300pct'\n */\n className?: string;\n\n /**\n * Optional color class name for the icon.\n *\n * @default 'text-color-light'\n */\n color?: string;\n};\n\nconst StateIcon = ({ name, color = 'text-color-light', className = 'text-size-300pct' }: StateIconProps) => (\n <span className={`rioglyph ${name} ${color} ${className}`} />\n);\n\nexport default StateIcon;\n"],"names":["StateIcon","name","color","className","jsx"],"mappings":";AAqBA,MAAMA,IAAY,CAAC,EAAE,MAAAC,GAAM,OAAAC,IAAQ,oBAAoB,WAAAC,IAAY,mBAAA,MAC/D,gBAAAC,EAAC,QAAA,EAAK,WAAW,YAAYH,CAAI,IAAIC,CAAK,IAAIC,CAAS,GAAA,CAAI;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsWidget.js","sources":["../../../src/components/statsWidget/StatsWidget.tsx"],"sourcesContent":["import type { ComponentProps, MouseEventHandler, PropsWithChildren } from 'react';\nimport classNames from 'classnames';\n\nimport StatsWidgetHeader, { type StatsWidgetHeaderProps } from './StatsWidgetHeader';\nimport StatsWidgetBody, { type StatsWidgetBodyProps } from './StatsWidgetBody';\nimport StatsWidgetFooter, { type StatsWidgetFooterProps } from './StatsWidgetFooter';\n\nexport type StatsWidgetProps = ComponentProps<'div'> & {\n /**\n * Callback to reset the filter.\n */\n onFilterReset?: MouseEventHandler;\n\n /**\n * Defines whether a filter is active for this widget.\n */\n hasFilter?: boolean;\n\n /**\n * Additional class names to be added to the element.\n */\n className?: string;\n};\n\n// re-export these because they're not exposed on root directly\nexport type { StatsWidgetHeaderProps, StatsWidgetBodyProps, StatsWidgetFooterProps };\n\nconst StatsWidget = (props: PropsWithChildren<StatsWidgetProps>) => {\n const { children, hasFilter = false, onFilterReset = () => {}, className, ...remainingProps } = props;\n const wrapperClasses = classNames('StatsWidget', className);\n\n return (\n <div {...remainingProps} className={wrapperClasses}>\n {hasFilter && (\n <span\n className={\n 'bg-light hover-bg-highlight display-flex justify-content-center align-items-center padding-2' +\n ' rounded-circle position-absolute top-15 right-15 display-block height-20 width-20' +\n ' cursor-pointer'\n }\n onClick={onFilterReset}\n >\n <span className='rioglyph rioglyph-revert text-color-white text-size-12' />\n </span>\n )}\n {children}\n </div>\n );\n};\n\nStatsWidget.Header = StatsWidgetHeader;\nStatsWidget.Body = StatsWidgetBody;\nStatsWidget.Footer = StatsWidgetFooter;\n\nexport default StatsWidget;\n"],"names":["StatsWidget","props","children","hasFilter","onFilterReset","className","remainingProps","wrapperClasses","classNames","jsxs","jsx","StatsWidgetHeader","StatsWidgetBody","StatsWidgetFooter"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"StatsWidget.js","sources":["../../../src/components/statsWidget/StatsWidget.tsx"],"sourcesContent":["import type { ComponentProps, MouseEventHandler, PropsWithChildren } from 'react';\nimport classNames from 'classnames';\n\nimport StatsWidgetHeader, { type StatsWidgetHeaderProps } from './StatsWidgetHeader';\nimport StatsWidgetBody, { type StatsWidgetBodyProps } from './StatsWidgetBody';\nimport StatsWidgetFooter, { type StatsWidgetFooterProps } from './StatsWidgetFooter';\n\nexport type StatsWidgetProps = ComponentProps<'div'> & {\n /**\n * Callback to reset the filter.\n */\n onFilterReset?: MouseEventHandler;\n\n /**\n * Defines whether a filter is active for this widget.\n *\n * @default false\n */\n hasFilter?: boolean;\n\n /**\n * Additional class names to be added to the element.\n */\n className?: string;\n};\n\n// re-export these because they're not exposed on root directly\nexport type { StatsWidgetHeaderProps, StatsWidgetBodyProps, StatsWidgetFooterProps };\n\nconst StatsWidget = (props: PropsWithChildren<StatsWidgetProps>) => {\n const { children, hasFilter = false, onFilterReset = () => {}, className, ...remainingProps } = props;\n\n const wrapperClasses = classNames('StatsWidget', className);\n\n return (\n <div {...remainingProps} className={wrapperClasses}>\n {hasFilter && (\n <span\n className={\n 'bg-light hover-bg-highlight display-flex justify-content-center align-items-center padding-2' +\n ' rounded-circle position-absolute top-15 right-15 display-block height-20 width-20' +\n ' cursor-pointer'\n }\n onClick={onFilterReset}\n >\n <span className='rioglyph rioglyph-revert text-color-white text-size-12' />\n </span>\n )}\n {children}\n </div>\n );\n};\n\nStatsWidget.Header = StatsWidgetHeader;\nStatsWidget.Body = StatsWidgetBody;\nStatsWidget.Footer = StatsWidgetFooter;\n\nexport default StatsWidget;\n"],"names":["StatsWidget","props","children","hasFilter","onFilterReset","className","remainingProps","wrapperClasses","classNames","jsxs","jsx","StatsWidgetHeader","StatsWidgetBody","StatsWidgetFooter"],"mappings":";;;;;AA6BA,MAAMA,IAAc,CAACC,MAA+C;AAChE,QAAM,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAO,eAAAC,IAAgB,MAAM;AAAA,EAAC,GAAG,WAAAC,GAAW,GAAGC,EAAA,IAAmBL,GAE1FM,IAAiBC,EAAW,eAAeH,CAAS;AAE1D,SACI,gBAAAI,EAAC,OAAA,EAAK,GAAGH,GAAgB,WAAWC,GAC/B,UAAA;AAAA,IAAAJ,KACG,gBAAAO;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WACI;AAAA,QAIJ,SAASN;AAAA,QAET,UAAA,gBAAAM,EAAC,QAAA,EAAK,WAAU,yDAAA,CAAyD;AAAA,MAAA;AAAA,IAAA;AAAA,IAGhFR;AAAA,EAAA,GACL;AAER;AAEAF,EAAY,SAASW;AACrBX,EAAY,OAAOY;AACnBZ,EAAY,SAASa;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsWidgetBody.js","sources":["../../../src/components/statsWidget/StatsWidgetBody.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport classNames from 'classnames';\n\nexport type StatsWidgetBodyProps = {\n /**\n * Whether to use flex space-between for StatsWidgetNumbers.\n * @default false\n */\n fullWidth?: boolean;\n\n /**\n * Additional class names to be added to the element.\n */\n className?: string;\n};\n\nconst StatsWidgetBody = (props: PropsWithChildren<StatsWidgetBodyProps>) => {\n const { children, fullWidth = false, className, ...remainingProps } = props;\n\n const wrapperClasses = classNames('StatsWidget-body', fullWidth && 'full-width', className);\n\n return (\n <div {...remainingProps} className={wrapperClasses}>\n {fullWidth && <div className='StatsWidget-body-column-spacer invisible' />}\n {children}\n {fullWidth && <div className='StatsWidget-body-column-spacer invisible' />}\n </div>\n );\n};\n\nexport default StatsWidgetBody;\n"],"names":["StatsWidgetBody","props","children","fullWidth","className","remainingProps","wrapperClasses","classNames","jsxs","jsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"StatsWidgetBody.js","sources":["../../../src/components/statsWidget/StatsWidgetBody.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport classNames from 'classnames';\n\nexport type StatsWidgetBodyProps = {\n /**\n * Whether to use flex space-between for StatsWidgetNumbers.\n *\n * @default false\n */\n fullWidth?: boolean;\n\n /**\n * Additional class names to be added to the element.\n */\n className?: string;\n};\n\nconst StatsWidgetBody = (props: PropsWithChildren<StatsWidgetBodyProps>) => {\n const { children, fullWidth = false, className, ...remainingProps } = props;\n\n const wrapperClasses = classNames('StatsWidget-body', fullWidth && 'full-width', className);\n\n return (\n <div {...remainingProps} className={wrapperClasses}>\n {fullWidth && <div className='StatsWidget-body-column-spacer invisible' />}\n {children}\n {fullWidth && <div className='StatsWidget-body-column-spacer invisible' />}\n </div>\n );\n};\n\nexport default StatsWidgetBody;\n"],"names":["StatsWidgetBody","props","children","fullWidth","className","remainingProps","wrapperClasses","classNames","jsxs","jsx"],"mappings":";;AAiBA,MAAMA,IAAkB,CAACC,MAAmD;AACxE,QAAM,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAO,WAAAC,GAAW,GAAGC,MAAmBJ,GAEhEK,IAAiBC,EAAW,oBAAoBJ,KAAa,cAAcC,CAAS;AAE1F,SACI,gBAAAI,EAAC,OAAA,EAAK,GAAGH,GAAgB,WAAWC,GAC/B,UAAA;AAAA,IAAAH,KAAa,gBAAAM,EAAC,OAAA,EAAI,WAAU,2CAAA,CAA2C;AAAA,IACvEP;AAAA,IACAC,KAAa,gBAAAM,EAAC,OAAA,EAAI,WAAU,2CAAA,CAA2C;AAAA,EAAA,GAC5E;AAER;"}
|
|
@@ -2,6 +2,7 @@ import { ReactNode, MouseEventHandler } from 'react';
|
|
|
2
2
|
export type StatsWidgetNumberProps = {
|
|
3
3
|
/**
|
|
4
4
|
* The value to be shown.
|
|
5
|
+
*
|
|
5
6
|
* @default 0
|
|
6
7
|
*/
|
|
7
8
|
value: string | number | ReactNode;
|
|
@@ -15,6 +16,7 @@ export type StatsWidgetNumberProps = {
|
|
|
15
16
|
label?: string | ReactNode;
|
|
16
17
|
/**
|
|
17
18
|
* Defines whether the number is clickable i.e. in combination with a filter.
|
|
19
|
+
*
|
|
18
20
|
* @default false
|
|
19
21
|
*/
|
|
20
22
|
clickable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsWidgetNumber.js","sources":["../../../src/components/statsWidget/StatsWidgetNumber.tsx"],"sourcesContent":["import type { ReactNode, MouseEventHandler } from 'react';\nimport classNames from 'classnames';\n\nexport type StatsWidgetNumberProps = {\n /**\n * The value to be shown.\n * @default 0\n */\n value: string | number | ReactNode;\n\n /**\n * The total value to be shown i.e. in combination with an active filter.\n */\n total?: string | number | ReactNode;\n\n /**\n * The label shown below the number.\n */\n label?: string | ReactNode;\n\n /**\n * Defines whether the number is clickable i.e. in combination with a filter.\n * @default false\n */\n clickable?: boolean;\n\n /**\n * Callback for when the user clicks the number widget.\n */\n onClick?: MouseEventHandler;\n\n /**\n * Additional class names to be added to the element.\n */\n className?: string;\n};\n\nconst StatsWidgetNumber = (props: StatsWidgetNumberProps) => {\n const { value = 0, total, label, className, clickable = false, onClick = () => {}, ...remainingProps } = props;\n\n const wrapperClasses = classNames('StatsWidgetNumber', { 'cursor-pointer': clickable }, className);\n\n return (\n <div {...remainingProps} onClick={onClick} className={wrapperClasses}>\n <div className='StatsWidgetNumber-counter'>\n <div className='StatsWidgetNumber-value'>{value}</div>\n {(total || total === 0) && <div className='StatsWidgetNumber-total'>{total}</div>}\n </div>\n {label && <div className='StatsWidgetNumber-label'>{label}</div>}\n </div>\n );\n};\n\nexport default StatsWidgetNumber;\n"],"names":["StatsWidgetNumber","props","value","total","label","className","clickable","onClick","remainingProps","wrapperClasses","classNames","jsxs","jsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"StatsWidgetNumber.js","sources":["../../../src/components/statsWidget/StatsWidgetNumber.tsx"],"sourcesContent":["import type { ReactNode, MouseEventHandler } from 'react';\nimport classNames from 'classnames';\n\nexport type StatsWidgetNumberProps = {\n /**\n * The value to be shown.\n *\n * @default 0\n */\n value: string | number | ReactNode;\n\n /**\n * The total value to be shown i.e. in combination with an active filter.\n */\n total?: string | number | ReactNode;\n\n /**\n * The label shown below the number.\n */\n label?: string | ReactNode;\n\n /**\n * Defines whether the number is clickable i.e. in combination with a filter.\n *\n * @default false\n */\n clickable?: boolean;\n\n /**\n * Callback for when the user clicks the number widget.\n */\n onClick?: MouseEventHandler;\n\n /**\n * Additional class names to be added to the element.\n */\n className?: string;\n};\n\nconst StatsWidgetNumber = (props: StatsWidgetNumberProps) => {\n const { value = 0, total, label, className, clickable = false, onClick = () => {}, ...remainingProps } = props;\n\n const wrapperClasses = classNames('StatsWidgetNumber', { 'cursor-pointer': clickable }, className);\n\n return (\n <div {...remainingProps} onClick={onClick} className={wrapperClasses}>\n <div className='StatsWidgetNumber-counter'>\n <div className='StatsWidgetNumber-value'>{value}</div>\n {(total || total === 0) && <div className='StatsWidgetNumber-total'>{total}</div>}\n </div>\n {label && <div className='StatsWidgetNumber-label'>{label}</div>}\n </div>\n );\n};\n\nexport default StatsWidgetNumber;\n"],"names":["StatsWidgetNumber","props","value","total","label","className","clickable","onClick","remainingProps","wrapperClasses","classNames","jsxs","jsx"],"mappings":";;AAuCA,MAAMA,IAAoB,CAACC,MAAkC;AACzD,QAAM,EAAE,OAAAC,IAAQ,GAAG,OAAAC,GAAO,OAAAC,GAAO,WAAAC,GAAW,WAAAC,IAAY,IAAO,SAAAC,IAAU,MAAM;AAAA,EAAC,GAAG,GAAGC,EAAA,IAAmBP,GAEnGQ,IAAiBC,EAAW,qBAAqB,EAAE,kBAAkBJ,EAAA,GAAaD,CAAS;AAEjG,2BACK,OAAA,EAAK,GAAGG,GAAgB,SAAAD,GAAkB,WAAWE,GAClD,UAAA;AAAA,IAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,6BACX,UAAA;AAAA,MAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,2BAA2B,UAAAV,GAAM;AAAA,OAC9CC,KAASA,MAAU,wBAAO,OAAA,EAAI,WAAU,2BAA2B,UAAAA,EAAA,CAAM;AAAA,IAAA,GAC/E;AAAA,IACCC,KAAS,gBAAAQ,EAAC,OAAA,EAAI,WAAU,2BAA2B,UAAAR,EAAA,CAAM;AAAA,EAAA,GAC9D;AAER;"}
|
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type StatusBarProps
|
|
3
|
-
/**
|
|
4
|
-
* The icon to be shown next to the progress bar.
|
|
5
|
-
*/
|
|
6
|
-
icon?: StatusBarIconSpec;
|
|
7
|
-
/**
|
|
8
|
-
* The label to be shown for the progress bar.
|
|
9
|
-
*/
|
|
10
|
-
label?: StatusBarLabelSpec;
|
|
11
|
-
/**
|
|
12
|
-
* List of progress bars which will be stacked in given order if there are multiple.
|
|
13
|
-
*/
|
|
14
|
-
progress?: StatusBarProgress[];
|
|
15
|
-
/**
|
|
16
|
-
* The size of the icon and progress bar.
|
|
17
|
-
*
|
|
18
|
-
* @default 'small'
|
|
19
|
-
*/
|
|
20
|
-
size?: 'small' | 'large';
|
|
21
|
-
/**
|
|
22
|
-
* Uses a divider for multiple progress bars when defined.
|
|
23
|
-
*
|
|
24
|
-
* @default true
|
|
25
|
-
*/
|
|
26
|
-
useProgressDivider?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Optional class names for the wrapper element.
|
|
29
|
-
*/
|
|
30
|
-
className?: string;
|
|
31
|
-
};
|
|
1
|
+
import { StatusBarProps } from './StatusBarProps';
|
|
2
|
+
export type { StatusBarProps };
|
|
32
3
|
declare const StatusBar: (props: StatusBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
4
|
export default StatusBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.js","sources":["../../../src/components/statusBar/StatusBar.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport { BOLD, LARGE, LEFT, RIGHT, SMALL, TOP } from './StatusBarConstants';\nimport StatusBarProgressBar from './StatusBarProgressBar';\nimport type {
|
|
1
|
+
{"version":3,"file":"StatusBar.js","sources":["../../../src/components/statusBar/StatusBar.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport { BOLD, LARGE, LEFT, RIGHT, SMALL, TOP } from './StatusBarConstants';\nimport StatusBarProgressBar from './StatusBarProgressBar';\nimport type { StatusBarProps, IconWithDefaults, LabelWithDefaults } from './StatusBarProps';\nimport StatusBarIcon from './StatusBarIcon';\nimport StatusBarLabel from './StatusBarLabel';\n\nexport type { StatusBarProps };\n\nconst iconDefaults: IconWithDefaults = { name: '', alignment: LEFT };\nconst labelDefaults: LabelWithDefaults = { value: '', alignment: RIGHT, weight: BOLD };\n\nconst StatusBar = (props: StatusBarProps) => {\n const { progress = [], size = SMALL, className = '', useProgressDivider = true } = props;\n\n // deep destructuring with merging default props don't work\n const icon: IconWithDefaults = { ...iconDefaults, ...props.icon };\n const label: LabelWithDefaults = { ...labelDefaults, ...props.label };\n\n const hasIcon = !!icon.name;\n const iconIsLeft = icon.alignment === LEFT;\n const iconIsRight = icon.alignment === RIGHT;\n\n const hasLabel = !!label.value;\n const labelIsLeft = label.alignment === LEFT;\n const labelIsTop = label.alignment === TOP;\n const labelIsRight = label.alignment === RIGHT;\n\n const hasOnlyIcon = hasIcon && !hasLabel;\n const hasOnlyLabel = !hasIcon && hasLabel;\n const hasIconAndLabel = hasIcon && hasLabel;\n\n const isIconLeftAndLabelRight = hasIconAndLabel && iconIsLeft && labelIsRight;\n const isIconRightAndLabelLeft = hasIconAndLabel && iconIsRight && labelIsLeft;\n const isIconAndLabelLeft = hasIconAndLabel && iconIsLeft && labelIsLeft;\n const isIconAndLabelRight = hasIconAndLabel && iconIsRight && labelIsRight;\n\n const isIconOnlyLeft = hasOnlyIcon && iconIsLeft;\n const isIconOnlyRight = hasOnlyIcon && iconIsRight;\n\n const isLabelOnlyLeft = hasOnlyLabel && labelIsLeft;\n const isLabelOnlyRight = hasOnlyLabel && labelIsRight;\n\n const wrapperClasses = classNames(\n 'StatusBar',\n 'width-100pct',\n 'display-flex',\n labelIsTop ? 'align-items-end' : 'align-items-center',\n className\n );\n\n const progressLabelWrapperClasses = classNames('display-flex', 'flex-1-0', {\n 'flex-order-1 flex-column margin-bottom-10': labelIsTop,\n 'flex-order-1 align-items-center': isIconAndLabelRight || isIconRightAndLabelLeft || isIconOnlyRight,\n 'flex-order-2 align-items-center': isIconAndLabelLeft || isIconLeftAndLabelRight || isIconOnlyLeft,\n 'align-items-center': isLabelOnlyLeft || isLabelOnlyRight,\n });\n\n const labelWrapperClasses = classNames({\n 'display-flex justify-content-center': labelIsTop,\n 'flex-order-1 margin-right-10': isIconAndLabelLeft || isIconRightAndLabelLeft || isLabelOnlyLeft,\n 'flex-order-2 margin-left-10': isIconAndLabelRight || isIconLeftAndLabelRight || isLabelOnlyRight,\n });\n\n const progressOuterWrapperClasses = classNames('display-flex', 'flex-1-0', {\n 'flex-order-2': isIconAndLabelLeft || isIconRightAndLabelLeft || isLabelOnlyLeft,\n 'flex-order-1': isIconAndLabelRight || isIconLeftAndLabelRight || isLabelOnlyRight,\n });\n\n const progressWrapperClasses = classNames('progress', 'margin-0', 'flex-1-0', {\n 'height-5': size === SMALL,\n 'height-10': size === LARGE,\n });\n\n return (\n <div className={wrapperClasses}>\n <StatusBarIcon icon={icon} size={size} />\n\n <div className={progressLabelWrapperClasses}>\n <StatusBarLabel label={label} size={size} className={labelWrapperClasses} />\n\n <div className={progressOuterWrapperClasses}>\n <div className={progressWrapperClasses}>\n {progress.map((item, index) => (\n <StatusBarProgressBar\n key={index}\n progress={item}\n index={index}\n useProgressDivider={useProgressDivider}\n />\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default StatusBar;\n"],"names":["iconDefaults","LEFT","labelDefaults","RIGHT","BOLD","StatusBar","props","progress","size","SMALL","className","useProgressDivider","icon","label","hasIcon","iconIsLeft","iconIsRight","hasLabel","labelIsLeft","labelIsTop","TOP","labelIsRight","hasOnlyIcon","hasOnlyLabel","hasIconAndLabel","isIconLeftAndLabelRight","isIconRightAndLabelLeft","isIconAndLabelLeft","isIconAndLabelRight","isIconOnlyLeft","isIconOnlyRight","isLabelOnlyLeft","isLabelOnlyRight","wrapperClasses","classNames","progressLabelWrapperClasses","labelWrapperClasses","progressOuterWrapperClasses","progressWrapperClasses","LARGE","jsxs","jsx","StatusBarIcon","StatusBarLabel","item","index","StatusBarProgressBar"],"mappings":";;;;;;AAUA,MAAMA,IAAiC,EAAE,MAAM,IAAI,WA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BH,KAA2BO;AAAA,EAAA,CACpF,GAEKK,IAA8BH,EAAW,gBAAgB,YAAY;AAAA,IACvE,gBAAgBP,KAAsBD,KAA2BK;AAAA,IACjE,gBAAgBH,KAAuBH,KAA2BO;AAAA,EAAA,CACrE,GAEKM,IAAyBJ,EAAW,YAAY,YAAY,YAAY;AAAA,IAC1E,YAAY1B,MAASC;AAAA,IACrB,aAAaD,MAAS+B;AAAA,EAAA,CACzB;AAED,SACI,gBAAAC,EAAC,OAAA,EAAI,WAAWP,GACZ,UAAA;AAAA,IAAA,gBAAAQ,EAACC,GAAA,EAAc,MAAA9B,GAAY,MAAAJ,EAAA,CAAY;AAAA,IAEvC,gBAAAgC,EAAC,OAAA,EAAI,WAAWL,GACZ,UAAA;AAAA,MAAA,gBAAAM,EAACE,GAAA,EAAe,OAAA9B,GAAc,MAAAL,GAAY,WAAW4B,GAAqB;AAAA,MAE1E,gBAAAK,EAAC,OAAA,EAAI,WAAWJ,GACZ,UAAA,gBAAAI,EAAC,OAAA,EAAI,WAAWH,GACX,UAAA/B,EAAS,IAAI,CAACqC,GAAMC,MACjB,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UAEG,UAAUF;AAAA,UACV,OAAAC;AAAA,UACA,oBAAAlC;AAAA,QAAA;AAAA,QAHKkC;AAAA,MAAA,CAKZ,GACL,EAAA,CACJ;AAAA,IAAA,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StatusBarIcon as StatusBarIconIcon } from './StatusBarProps';
|
|
2
2
|
type StatusBarIconProps = {
|
|
3
|
-
icon:
|
|
3
|
+
icon: StatusBarIconIcon;
|
|
4
4
|
size: 'small' | 'large';
|
|
5
5
|
};
|
|
6
6
|
declare const StatusBarIcon: (props: StatusBarIconProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBarIcon.js","sources":["../../../src/components/statusBar/StatusBarIcon.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"StatusBarIcon.js","sources":["../../../src/components/statusBar/StatusBarIcon.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport type { StatusBarIcon as StatusBarIconIcon } from './StatusBarProps';\nimport { LARGE, LEFT, SMALL } from './StatusBarConstants';\n\ntype StatusBarIconProps = {\n icon: StatusBarIconIcon;\n size: 'small' | 'large';\n};\n\nconst StatusBarIcon = (props: StatusBarIconProps) => {\n const { icon, size } = props;\n\n if (!icon.name) {\n return null;\n }\n\n const wrapperClasses = icon.alignment === LEFT ? 'flex-order-1 margin-right-5' : 'flex-order-2 margin-left-5';\n\n const iconClasses = classNames(\n 'rioglyph',\n icon.name,\n icon.color ?? 'text-color-gray',\n size === SMALL && 'text-size-h3',\n size === LARGE && 'text-size-h2',\n icon.className\n );\n\n return (\n <div className={wrapperClasses}>\n <span className={iconClasses} />\n </div>\n );\n};\n\nexport default StatusBarIcon;\n"],"names":["StatusBarIcon","props","icon","size","wrapperClasses","LEFT","iconClasses","classNames","SMALL","LARGE","jsx"],"mappings":";;;AAUA,MAAMA,IAAgB,CAACC,MAA8B;AACjD,QAAM,EAAE,MAAAC,GAAM,MAAAC,EAAA,IAASF;AAEvB,MAAI,CAACC,EAAK;AACN,WAAO;AAGX,QAAME,IAAiBF,EAAK,cAAcG,IAAO,gCAAgC,8BAE3EC,IAAcC;AAAA,IAChB;AAAA,IACAL,EAAK;AAAA,IACLA,EAAK,SAAS;AAAA,IACdC,MAASK,KAAS;AAAA,IAClBL,MAASM,KAAS;AAAA,IAClBP,EAAK;AAAA,EAAA;AAGT,SACI,gBAAAQ,EAAC,SAAI,WAAWN,GACZ,4BAAC,QAAA,EAAK,WAAWE,GAAa,EAAA,CAClC;AAER;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StatusBarLabel as StatusBarLabelLabel } from './StatusBarProps';
|
|
2
2
|
type StatusBarLabelProps = {
|
|
3
|
-
label:
|
|
3
|
+
label: StatusBarLabelLabel;
|
|
4
4
|
size: 'small' | 'large';
|
|
5
5
|
className?: string;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBarLabel.js","sources":["../../../src/components/statusBar/StatusBarLabel.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"StatusBarLabel.js","sources":["../../../src/components/statusBar/StatusBarLabel.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport type { StatusBarLabel as StatusBarLabelLabel } from './StatusBarProps';\nimport { LARGE, LIGHT, SMALL, TOP } from './StatusBarConstants';\n\ntype StatusBarLabelProps = {\n label: StatusBarLabelLabel;\n size: 'small' | 'large';\n className?: string;\n};\n\nconst StatusBarLabel = (props: StatusBarLabelProps) => {\n const { label, size, className = '' } = props;\n\n if (!label.value) {\n return null;\n }\n\n const labelClasses = classNames(\n 'display-flex',\n 'ellipsis-1',\n 'flex-1-0',\n 'justify-content-center',\n label.color ?? 'text-color-dark',\n {\n 'width-0': label.alignment === TOP,\n 'text-size-16': size === SMALL,\n 'text-size-h3': size === LARGE,\n 'text-bold': label.weight !== LIGHT,\n },\n label.className\n );\n\n return (\n <div className={className}>\n <span className={labelClasses}>{label.value}</span>\n </div>\n );\n};\n\nexport default StatusBarLabel;\n"],"names":["StatusBarLabel","props","label","size","className","labelClasses","classNames","TOP","SMALL","LARGE","LIGHT","jsx"],"mappings":";;;AAWA,MAAMA,IAAiB,CAACC,MAA+B;AACnD,QAAM,EAAE,OAAAC,GAAO,MAAAC,GAAM,WAAAC,IAAY,OAAOH;AAExC,MAAI,CAACC,EAAM;AACP,WAAO;AAGX,QAAMG,IAAeC;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAJ,EAAM,SAAS;AAAA,IACf;AAAA,MACI,WAAWA,EAAM,cAAcK;AAAA,MAC/B,gBAAgBJ,MAASK;AAAA,MACzB,gBAAgBL,MAASM;AAAA,MACzB,aAAaP,EAAM,WAAWQ;AAAA,IAAA;AAAA,IAElCR,EAAM;AAAA,EAAA;AAGV,SACI,gBAAAS,EAAC,SAAI,WAAAP,GACD,UAAA,gBAAAO,EAAC,UAAK,WAAWN,GAAe,UAAAH,EAAM,MAAA,CAAM,EAAA,CAChD;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBarProgressBar.js","sources":["../../../src/components/statusBar/StatusBarProgressBar.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport Tooltip from '../tooltip/Tooltip';\nimport OverlayTrigger from '../overlay/OverlayTrigger';\nimport type { StatusBarProgress } from './
|
|
1
|
+
{"version":3,"file":"StatusBarProgressBar.js","sources":["../../../src/components/statusBar/StatusBarProgressBar.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport Tooltip from '../tooltip/Tooltip';\nimport OverlayTrigger from '../overlay/OverlayTrigger';\nimport type { StatusBarProgress } from './StatusBarProps';\nimport { TOP } from './StatusBarConstants';\n\ntype StatusBarProgressBarProps = {\n index: number;\n progress: StatusBarProgress;\n useProgressDivider: boolean;\n};\n\nexport const StatusBarProgressBar = (props: StatusBarProgressBarProps) => {\n const {\n index,\n progress: { className, color, percentage = 0, tooltip, tooltipDelay = 50, tooltipPosition = TOP },\n useProgressDivider,\n } = props;\n\n const progressBarClasses = classNames(\n 'progress-bar',\n color ?? 'progress-bar-info',\n useProgressDivider && 'progress-divider',\n className\n );\n\n const progressBar = <div className={progressBarClasses} style={{ width: `${percentage}%` }} />;\n\n if (!tooltip) {\n return progressBar;\n }\n\n return (\n <OverlayTrigger\n placement={tooltipPosition}\n overlay={\n <Tooltip id={`tooltip-${index}`} width='auto'>\n {tooltip}\n </Tooltip>\n }\n delay={tooltipDelay}\n >\n {progressBar}\n </OverlayTrigger>\n );\n};\n\nexport default StatusBarProgressBar;\n"],"names":["StatusBarProgressBar","props","index","className","color","percentage","tooltip","tooltipDelay","tooltipPosition","TOP","useProgressDivider","progressBarClasses","classNames","progressBar","jsx","OverlayTrigger","Tooltip"],"mappings":";;;;;AAaO,MAAMA,IAAuB,CAACC,MAAqC;AACtE,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,UAAU,EAAE,WAAAC,GAAW,OAAAC,GAAO,YAAAC,IAAa,GAAG,SAAAC,GAAS,cAAAC,IAAe,IAAI,iBAAAC,IAAkBC,EAAA;AAAA,IAC5F,oBAAAC;AAAA,EAAA,IACAT,GAEEU,IAAqBC;AAAA,IACvB;AAAA,IACAR,KAAS;AAAA,IACTM,KAAsB;AAAA,IACtBP;AAAA,EAAA,GAGEU,IAAc,gBAAAC,EAAC,OAAA,EAAI,WAAWH,GAAoB,OAAO,EAAE,OAAO,GAAGN,CAAU,IAAA,EAAI,CAAG;AAE5F,SAAKC,IAKD,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,WAAWP;AAAA,MACX,2BACKQ,GAAA,EAAQ,IAAI,WAAWd,CAAK,IAAI,OAAM,QAClC,UAAAI,EAAA,CACL;AAAA,MAEJ,OAAOC;AAAA,MAEN,UAAAM;AAAA,IAAA;AAAA,EAAA,IAbEA;AAgBf;"}
|