@hitachivantara/uikit-react-lab 3.51.1 → 3.51.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NotificationPanel/NotificationPanel.js +27 -129
- package/dist/NotificationPanel/NotificationPanel.js.map +1 -1
- package/dist/Slider/Slider.js +11 -17
- package/dist/Slider/Slider.js.map +1 -1
- package/dist/Slider/base.js +260 -0
- package/dist/Slider/base.js.map +1 -0
- package/dist/Slider/styles.js +5 -2
- package/dist/Slider/styles.js.map +1 -1
- package/dist/legacy/NotificationPanel/NotificationPanel.js +20 -109
- package/dist/legacy/NotificationPanel/NotificationPanel.js.map +1 -1
- package/dist/legacy/Slider/Slider.js +11 -4
- package/dist/legacy/Slider/Slider.js.map +1 -1
- package/dist/legacy/Slider/base.js +252 -0
- package/dist/legacy/Slider/base.js.map +1 -0
- package/dist/legacy/Slider/styles.js +5 -2
- package/dist/legacy/Slider/styles.js.map +1 -1
- package/dist/modern/NotificationPanel/NotificationPanel.js +1 -45
- package/dist/modern/NotificationPanel/NotificationPanel.js.map +1 -1
- package/dist/modern/Slider/Slider.js +11 -3
- package/dist/modern/Slider/Slider.js.map +1 -1
- package/dist/modern/Slider/base.js +252 -0
- package/dist/modern/Slider/base.js.map +1 -0
- package/dist/modern/Slider/styles.js +4 -1
- package/dist/modern/Slider/styles.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationPanel.js","names":["React","useState","useEffect","PropTypes","clsx","dayjs","deprecatedPropType","withStyles","HvPanel","HvActionBar","HvDropDownMenu","setId","useLabels","useLocale","styles","Notification","EmptyStatePanel","NotificationsIndicator","DEFAULT_LABELS","notificationGroupHeader","newNotifications","olderNotifications","notificationIndicator","label","buttonLabel","getGenericLocale","locale","includes","substr","indexOf","importAndLoadLocale","then","catch","genericLocale","console","warn","HvNotificationPanel","id","className","classes","open","footer","notifications","hasNewNotifications","emptyStatePanelTitle","emptyStatePanelMessage","emptyStatePanelIcon","labels","labelsProp","newNotificationsButtonAction","localeProp","others","localeFromProvider","highlighted","setHighlighted","undefined","isExpanded","setIsExpanded","isLocaleLoaded","setIsLocaleLoaded","isMounted","generateNotificationsActions","notificationId","onToggle","actions","expand","dList","values","event","item","callback","s","dropDownMenuProps","notificationElementGenerator","notificationsToRender","map","notification","notificationIsHighlighted","title","isRead","icon","date","onClick","onKeyPress","hasNotifications","length","renderNotifications","root","closed","panel","emptyState","actionBarRoot","actionBar","propTypes","string","bool","shape","notificationsIndicator","isRequired","arrayOf","oneOfType","number","object","element","func","action","instanceOf","Object","node","name"],"sources":["../../../src/NotificationPanel/NotificationPanel.js"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport dayjs from \"dayjs\";\nimport { deprecatedPropType, withStyles } from \"@material-ui/core\";\nimport {\n HvPanel,\n HvActionBar,\n HvDropDownMenu,\n setId,\n useLabels,\n useLocale,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport styles from \"./styles\";\n\nimport Notification from \"./Notification\";\nimport EmptyStatePanel from \"./EmptyStatePanel\";\nimport NotificationsIndicator from \"./NotificationsIndicator\";\n\nconst DEFAULT_LABELS = {\n notificationGroupHeader: {\n newNotifications: \"New\",\n olderNotifications: \"Earlier\",\n },\n notificationIndicator: {\n label: \"You have new notifications\",\n buttonLabel: \"Update\",\n },\n};\n\n/**\n * Obtains a simplified locale, if possible, e.g: \"en-US\" returns \"en\".\n *\n * @param {string} locale - The locale to be used\n * @returns The more generic locale if found\n */\nexport const getGenericLocale = (locale) =>\n locale.includes(\"-\") && locale.substr(0, locale.indexOf(\"-\"));\n\n/**\n * Imports and load the received locale in order to be used by dayjs. If the provided locale or a generic one\n * obtained is not possible to load, then dayjs will fallback to its default.\n *\n * @param {string} locale - The locale to be used\n */\nconst importAndLoadLocale = async (locale) => {\n await import(`dayjs/locale/${locale}.js`)\n .then(() => {\n dayjs.locale(locale);\n })\n .catch(async () => {\n const genericLocale = getGenericLocale(locale);\n await import(`dayjs/locale/${genericLocale}.js`)\n .then(() => dayjs.locale(genericLocale))\n // eslint-disable-next-line no-console\n .catch(() => console.warn(`Unable to load locale: ${locale}. Falling back to the default`));\n });\n};\n\n/**\n * Notification Panel displays all of read and unread notifications. Still in development\n */\nconst HvNotificationPanel = ({\n id,\n className,\n classes,\n open,\n footer,\n notifications,\n hasNewNotifications = false,\n emptyStatePanelTitle = \"No notifications\",\n emptyStatePanelMessage = \"You currently have no notifications.\",\n emptyStatePanelIcon,\n labels: labelsProp,\n newNotificationsButtonAction,\n locale: localeProp,\n ...others\n}) => {\n const localeFromProvider = useLocale();\n\n const locale = localeProp || localeFromProvider;\n\n const [highlighted, setHighlighted] = useState(undefined);\n const [isExpanded, setIsExpanded] = useState(false);\n const [isLocaleLoaded, setIsLocaleLoaded] = useState(false);\n\n useEffect(() => {\n // We're using this mount logic to avoid potential memory leak problems.\n let isMounted = true;\n\n if (!isLocaleLoaded) {\n importAndLoadLocale(locale).then(() => {\n if (isMounted) {\n setIsLocaleLoaded(true);\n }\n });\n }\n return () => {\n isMounted = false;\n };\n });\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n\n const generateNotificationsActions = (notificationId, onToggle, actions) => {\n const expand = notificationId === highlighted;\n const dList = [...actions.values];\n return (\n <HvDropDownMenu\n expanded={expand}\n onClick={(event, item) => {\n setHighlighted(undefined);\n item?.callback?.(event, notificationId);\n }}\n dataList={dList}\n onToggle={(event, s) => {\n onToggle?.(event, s);\n if (s) {\n setHighlighted(notificationId);\n } else {\n setHighlighted(undefined);\n }\n setIsExpanded(!isExpanded);\n }}\n {...actions.dropDownMenuProps}\n />\n );\n };\n\n const notificationElementGenerator = (notificationsToRender) => {\n return notificationsToRender.map((notification) => {\n const notificationIsHighlighted = highlighted === notification.id;\n return (\n <Notification\n key={notification.id}\n notificationId={notification.id}\n title={notification.title}\n isRead={notification.isRead}\n icon={notification.icon}\n date={notification.date}\n onClick={notification.onClick}\n onKeyPress={notification.onKeyPress}\n rightContainer={generateNotificationsActions(\n notification.id,\n notification.onToggle,\n notification.actions\n )}\n isHighlighted={notificationIsHighlighted}\n locale={locale}\n />\n );\n });\n };\n\n const hasNotifications = notifications.length > 0;\n\n const renderNotifications = (notificationsToRender) =>\n notificationElementGenerator(notificationsToRender);\n\n return (\n <HvPanel\n id={id}\n className={clsx(className, classes.root, {\n [classes.closed]: open === false,\n [classes.open]: open,\n })}\n {...others}\n >\n {hasNewNotifications && (\n <NotificationsIndicator\n labels={labels.notificationIndicator}\n onClick={newNotificationsButtonAction}\n />\n )}\n {hasNotifications ? (\n <div className={classes.panel}>\n {notifications.length > 0 && renderNotifications(notifications)}\n </div>\n ) : (\n <EmptyStatePanel\n id={setId(id, \"empty-state\")}\n title={emptyStatePanelTitle}\n message={emptyStatePanelMessage}\n icon={emptyStatePanelIcon}\n className={classes.emptyState}\n />\n )}\n {footer && (\n <HvActionBar\n id={setId(id, \"action-bar\")}\n classes={{\n root: classes.actionBarRoot,\n }}\n className={classes.actionBar}\n >\n {footer}\n </HvActionBar>\n )}\n </HvPanel>\n );\n};\n\nHvNotificationPanel.propTypes = {\n /**\n * Id to be applied to the root node of the panel.\n */\n id: PropTypes.string,\n /**\n * Class names to be applied to the root element.\n */\n className: PropTypes.string,\n /**\n * 'true' if panel is open or 'false' if the panel is not open\n *\n * @deprecated This logic should be external, i.e. using the HvAppSwitcherPanel inside a Drawer component.\n */\n open: deprecatedPropType(PropTypes.bool),\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * styles object applied to the root\n */\n root: PropTypes.string,\n /**\n * styles object applied to the root when closed\n */\n closed: PropTypes.string,\n /**\n * styles object applied to the root when open\n */\n open: PropTypes.string,\n /**\n * styles object applied to the panel\n */\n panel: PropTypes.string,\n /**\n * styles object applied to the action bar\n */\n actionBar: PropTypes.string,\n /**\n * styles object applied to the root of the action bar\n */\n actionBarRoot: PropTypes.string,\n /**\n * styles object applied to the new notification indicator\n */\n notificationsIndicator: PropTypes.string,\n /**\n * styles object applied to the empty state panel\n */\n emptyState: PropTypes.string,\n }).isRequired,\n /**\n * The properties of the notifications to be rendered in the Panel.\n */\n notifications: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n isRead: PropTypes.bool.isRequired,\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n icon: PropTypes.element,\n onClick: PropTypes.func,\n onKeyPress: PropTypes.func,\n onToggle: PropTypes.func,\n actions: PropTypes.shape({\n label: PropTypes.bool,\n action: PropTypes.string,\n callback: PropTypes.func,\n dropDownMenuProps: PropTypes.instanceOf(Object),\n }),\n })\n ),\n /**\n * Whether to render the new notifications indicator\n */\n hasNewNotifications: PropTypes.bool,\n /**\n * Action buttons to render in footer\n */\n footer: PropTypes.node,\n /**\n * Title of the EmptyStatePanel\n */\n emptyStatePanelTitle: PropTypes.string,\n /**\n * Message of the EmptyStatePanel\n */\n emptyStatePanelMessage: PropTypes.string,\n /**\n * Empty Panel custom Icon\n */\n emptyStatePanelIcon: PropTypes.node,\n /**\n * Labels to apply to the Panel\n */\n labels: PropTypes.shape({\n /**\n * Labels to apply to the groups separating newer and older notifications\n */\n notificationGroupHeader: {\n olderNotifications: PropTypes.string,\n newNotifications: PropTypes.string,\n },\n /**\n * Labels to apply to the element of the New Notifications Indicator\n */\n notificationIndicator: {\n label: PropTypes.string,\n buttonLabel: PropTypes.string,\n },\n }),\n /**\n * Function to be supplied to the notification update button\n */\n newNotificationsButtonAction: PropTypes.func,\n /**\n * The locale to be used on the notification date, if undefined it will use the one from the HvProvider\n */\n locale: PropTypes.string,\n};\n\nexport default withStyles(styles, { name: \"HvNotificationPanel\" })(HvNotificationPanel);\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAOC,SA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vB,SAAS,CAAC2F;AAvHY,CAAhC;AA0HA,eAAevF,UAAU,CAACO,MAAD,EAAS;EAAE+F,IAAI,EAAE;AAAR,CAAT,CAAV,CAAoDzE,mBAApD,CAAf"}
|
|
1
|
+
{"version":3,"file":"NotificationPanel.js","names":["React","useState","PropTypes","clsx","deprecatedPropType","withStyles","HvPanel","HvActionBar","HvDropDownMenu","setId","useLabels","useLocale","styles","Notification","EmptyStatePanel","NotificationsIndicator","DEFAULT_LABELS","notificationGroupHeader","newNotifications","olderNotifications","notificationIndicator","label","buttonLabel","HvNotificationPanel","id","className","classes","open","footer","notifications","hasNewNotifications","emptyStatePanelTitle","emptyStatePanelMessage","emptyStatePanelIcon","labels","labelsProp","newNotificationsButtonAction","locale","localeProp","others","localeFromProvider","highlighted","setHighlighted","undefined","isExpanded","setIsExpanded","generateNotificationsActions","notificationId","onToggle","actions","expand","dList","values","event","item","callback","s","dropDownMenuProps","notificationElementGenerator","notificationsToRender","map","notification","notificationIsHighlighted","title","isRead","icon","date","onClick","onKeyPress","hasNotifications","length","renderNotifications","root","closed","panel","emptyState","actionBarRoot","actionBar","propTypes","string","bool","shape","notificationsIndicator","isRequired","arrayOf","oneOfType","number","object","element","func","action","instanceOf","Object","node","name"],"sources":["../../../src/NotificationPanel/NotificationPanel.js"],"sourcesContent":["import React, { useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { deprecatedPropType, withStyles } from \"@material-ui/core\";\nimport {\n HvPanel,\n HvActionBar,\n HvDropDownMenu,\n setId,\n useLabels,\n useLocale,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport styles from \"./styles\";\n\nimport Notification from \"./Notification\";\nimport EmptyStatePanel from \"./EmptyStatePanel\";\nimport NotificationsIndicator from \"./NotificationsIndicator\";\n\nconst DEFAULT_LABELS = {\n notificationGroupHeader: {\n newNotifications: \"New\",\n olderNotifications: \"Earlier\",\n },\n notificationIndicator: {\n label: \"You have new notifications\",\n buttonLabel: \"Update\",\n },\n};\n\n/**\n * Notification Panel displays all of read and unread notifications. Still in development\n */\nconst HvNotificationPanel = ({\n id,\n className,\n classes,\n open,\n footer,\n notifications,\n hasNewNotifications = false,\n emptyStatePanelTitle = \"No notifications\",\n emptyStatePanelMessage = \"You currently have no notifications.\",\n emptyStatePanelIcon,\n labels: labelsProp,\n newNotificationsButtonAction,\n locale: localeProp,\n ...others\n}) => {\n const localeFromProvider = useLocale();\n\n const locale = localeProp || localeFromProvider;\n\n const [highlighted, setHighlighted] = useState(undefined);\n const [isExpanded, setIsExpanded] = useState(false);\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n\n const generateNotificationsActions = (notificationId, onToggle, actions) => {\n const expand = notificationId === highlighted;\n const dList = [...actions.values];\n return (\n <HvDropDownMenu\n expanded={expand}\n onClick={(event, item) => {\n setHighlighted(undefined);\n item?.callback?.(event, notificationId);\n }}\n dataList={dList}\n onToggle={(event, s) => {\n onToggle?.(event, s);\n if (s) {\n setHighlighted(notificationId);\n } else {\n setHighlighted(undefined);\n }\n setIsExpanded(!isExpanded);\n }}\n {...actions.dropDownMenuProps}\n />\n );\n };\n\n const notificationElementGenerator = (notificationsToRender) => {\n return notificationsToRender.map((notification) => {\n const notificationIsHighlighted = highlighted === notification.id;\n return (\n <Notification\n key={notification.id}\n notificationId={notification.id}\n title={notification.title}\n isRead={notification.isRead}\n icon={notification.icon}\n date={notification.date}\n onClick={notification.onClick}\n onKeyPress={notification.onKeyPress}\n rightContainer={generateNotificationsActions(\n notification.id,\n notification.onToggle,\n notification.actions\n )}\n isHighlighted={notificationIsHighlighted}\n locale={locale}\n />\n );\n });\n };\n\n const hasNotifications = notifications.length > 0;\n\n const renderNotifications = (notificationsToRender) =>\n notificationElementGenerator(notificationsToRender);\n\n return (\n <HvPanel\n id={id}\n className={clsx(className, classes.root, {\n [classes.closed]: open === false,\n [classes.open]: open,\n })}\n {...others}\n >\n {hasNewNotifications && (\n <NotificationsIndicator\n labels={labels.notificationIndicator}\n onClick={newNotificationsButtonAction}\n />\n )}\n {hasNotifications ? (\n <div className={classes.panel}>\n {notifications.length > 0 && renderNotifications(notifications)}\n </div>\n ) : (\n <EmptyStatePanel\n id={setId(id, \"empty-state\")}\n title={emptyStatePanelTitle}\n message={emptyStatePanelMessage}\n icon={emptyStatePanelIcon}\n className={classes.emptyState}\n />\n )}\n {footer && (\n <HvActionBar\n id={setId(id, \"action-bar\")}\n classes={{\n root: classes.actionBarRoot,\n }}\n className={classes.actionBar}\n >\n {footer}\n </HvActionBar>\n )}\n </HvPanel>\n );\n};\n\nHvNotificationPanel.propTypes = {\n /**\n * Id to be applied to the root node of the panel.\n */\n id: PropTypes.string,\n /**\n * Class names to be applied to the root element.\n */\n className: PropTypes.string,\n /**\n * 'true' if panel is open or 'false' if the panel is not open\n *\n * @deprecated This logic should be external, i.e. using the HvAppSwitcherPanel inside a Drawer component.\n */\n open: deprecatedPropType(PropTypes.bool),\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * styles object applied to the root\n */\n root: PropTypes.string,\n /**\n * styles object applied to the root when closed\n */\n closed: PropTypes.string,\n /**\n * styles object applied to the root when open\n */\n open: PropTypes.string,\n /**\n * styles object applied to the panel\n */\n panel: PropTypes.string,\n /**\n * styles object applied to the action bar\n */\n actionBar: PropTypes.string,\n /**\n * styles object applied to the root of the action bar\n */\n actionBarRoot: PropTypes.string,\n /**\n * styles object applied to the new notification indicator\n */\n notificationsIndicator: PropTypes.string,\n /**\n * styles object applied to the empty state panel\n */\n emptyState: PropTypes.string,\n }).isRequired,\n /**\n * The properties of the notifications to be rendered in the Panel.\n */\n notifications: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n isRead: PropTypes.bool.isRequired,\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).isRequired,\n icon: PropTypes.element,\n onClick: PropTypes.func,\n onKeyPress: PropTypes.func,\n onToggle: PropTypes.func,\n actions: PropTypes.shape({\n label: PropTypes.bool,\n action: PropTypes.string,\n callback: PropTypes.func,\n dropDownMenuProps: PropTypes.instanceOf(Object),\n }),\n })\n ),\n /**\n * Whether to render the new notifications indicator\n */\n hasNewNotifications: PropTypes.bool,\n /**\n * Action buttons to render in footer\n */\n footer: PropTypes.node,\n /**\n * Title of the EmptyStatePanel\n */\n emptyStatePanelTitle: PropTypes.string,\n /**\n * Message of the EmptyStatePanel\n */\n emptyStatePanelMessage: PropTypes.string,\n /**\n * Empty Panel custom Icon\n */\n emptyStatePanelIcon: PropTypes.node,\n /**\n * Labels to apply to the Panel\n */\n labels: PropTypes.shape({\n /**\n * Labels to apply to the groups separating newer and older notifications\n */\n notificationGroupHeader: {\n olderNotifications: PropTypes.string,\n newNotifications: PropTypes.string,\n },\n /**\n * Labels to apply to the element of the New Notifications Indicator\n */\n notificationIndicator: {\n label: PropTypes.string,\n buttonLabel: PropTypes.string,\n },\n }),\n /**\n * Function to be supplied to the notification update button\n */\n newNotificationsButtonAction: PropTypes.func,\n /**\n * The locale to be used on the notification date, if undefined it will use the one from the HvProvider\n */\n locale: PropTypes.string,\n};\n\nexport default withStyles(styles, { name: \"HvNotificationPanel\" })(HvNotificationPanel);\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,kBAAT,EAA6BC,UAA7B,QAA+C,mBAA/C;AACA,SACEC,OADF,EAEEC,WAFF,EAGEC,cAHF,EAIEC,KAJF,EAKEC,SALF,EAMEC,SANF,QAOO,kCAPP;AASA,OAAOC,MAAP,MAAmB,UAAnB;AAEA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AAEA,MAAMC,cAAc,GAAG;EACrBC,uBAAuB,EAAE;IACvBC,gBA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BU,MAAM,EAAExF,SAAS,CAAC6E,MAFK;MAGvBxB,QAAQ,EAAErD,SAAS,CAACuF,IAHG;MAIvBhC,iBAAiB,EAAEvD,SAAS,CAACyF,UAAV,CAAqBC,MAArB;IAJI,CAAhB;EATK,CAAhB,CADa,CAvDe;;EAyE9B;AACF;AACA;EACE9D,mBAAmB,EAAE5B,SAAS,CAAC8E,IA5ED;;EA6E9B;AACF;AACA;EACEpD,MAAM,EAAE1B,SAAS,CAAC2F,IAhFY;;EAiF9B;AACF;AACA;EACE9D,oBAAoB,EAAE7B,SAAS,CAAC6E,MApFF;;EAqF9B;AACF;AACA;EACE/C,sBAAsB,EAAE9B,SAAS,CAAC6E,MAxFJ;;EAyF9B;AACF;AACA;EACE9C,mBAAmB,EAAE/B,SAAS,CAAC2F,IA5FD;;EA6F9B;AACF;AACA;EACE3D,MAAM,EAAEhC,SAAS,CAAC+E,KAAV,CAAgB;IACtB;AACJ;AACA;IACIhE,uBAAuB,EAAE;MACvBE,kBAAkB,EAAEjB,SAAS,CAAC6E,MADP;MAEvB7D,gBAAgB,EAAEhB,SAAS,CAAC6E;IAFL,CAJH;;IAQtB;AACJ;AACA;IACI3D,qBAAqB,EAAE;MACrBC,KAAK,EAAEnB,SAAS,CAAC6E,MADI;MAErBzD,WAAW,EAAEpB,SAAS,CAAC6E;IAFF;EAXD,CAAhB,CAhGsB;;EAgH9B;AACF;AACA;EACE3C,4BAA4B,EAAElC,SAAS,CAACuF,IAnHV;;EAoH9B;AACF;AACA;EACEpD,MAAM,EAAEnC,SAAS,CAAC6E;AAvHY,CAAhC;AA0HA,eAAe1E,UAAU,CAACO,MAAD,EAAS;EAAEkF,IAAI,EAAE;AAAR,CAAT,CAAV,CAAoDvE,mBAApD,CAAf"}
|
|
@@ -298,7 +298,6 @@ class HvSlider extends React.Component {
|
|
|
298
298
|
stepValue: _stepValue,
|
|
299
299
|
inverseStepValue: _inverseStepValue
|
|
300
300
|
};
|
|
301
|
-
import("rc-slider/assets/index.css");
|
|
302
301
|
}
|
|
303
302
|
|
|
304
303
|
static getDerivedStateFromProps(props, state) {
|
|
@@ -335,7 +334,9 @@ class HvSlider extends React.Component {
|
|
|
335
334
|
marks,
|
|
336
335
|
styles
|
|
337
336
|
} = this.state;
|
|
338
|
-
return /*#__PURE__*/React.createElement(
|
|
337
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
338
|
+
className: classes.sliderBase
|
|
339
|
+
}, /*#__PURE__*/React.createElement(Range, {
|
|
339
340
|
handle: this.createKnob,
|
|
340
341
|
className: classes.root,
|
|
341
342
|
min: 0,
|
|
@@ -353,7 +354,7 @@ class HvSlider extends React.Component {
|
|
|
353
354
|
railStyle: styles.rail,
|
|
354
355
|
handleStyle: knobStyles.knobInner,
|
|
355
356
|
trackStyle: trackStyles
|
|
356
|
-
});
|
|
357
|
+
}));
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
}
|
|
@@ -468,6 +469,13 @@ process.env.NODE_ENV !== "production" ? HvSlider.propTypes = {
|
|
|
468
469
|
* the classes object to be applied into the root object.
|
|
469
470
|
*/
|
|
470
471
|
classes: PropTypes.shape({
|
|
472
|
+
/**
|
|
473
|
+
* Base slider styles to avoid the css import from node_modules and enable SSR support.
|
|
474
|
+
* import("rc-slider/assets/index.css")
|
|
475
|
+
*/
|
|
476
|
+
sliderBase: PropTypes.string,
|
|
477
|
+
tooltipBase: PropTypes.string,
|
|
478
|
+
|
|
471
479
|
/**
|
|
472
480
|
* Style applied to the root of the component.
|
|
473
481
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","names":["React","PropTypes","Range","Handle","Tooltip","withStyles","KnobRing","styleCreator","scaledValueToKnobsPositionValue","scaledValue","minPointValue","inverseStepValue","Math","floor","transformKnobsPosition","values","knobsPositions","forEach","value","index","calculateStepValue","maxPointValue","divisionQuantity","abs","HvSlider","Component","constructor","props","sliderValue","stepValue","markProperties","markstep","markDigits","formatMark","styles","marks","length","markProperty","position","label","style","mark","roundedMarkStep","labelValue","knobsPositionToScaledValue","toFixed","knobProperties","trackStyles","knobProperty","track","color","backgroundColor","trackColor","knobInner","knobOuterStyle","lastItem","knobOuter","hidden","knobHidden","knobHiddenLast","knobsCurrentPosition","newKnobsPosition","slice","knobsValues","noOverlap","state","duplicatedValue","findDuplicated","filter","item","indexOf","array","newArray","newPosition","previousValue","knobsPosition","knobs","generateKnobsPositionAndValues","onChange","defaultValues","fixed","setState","onBeforeChange","onAfterChange","formatTooltip","classes","dragging","restProps","knobValue","dragColor","sliderTooltip","hoverColor","markStep","theme","createTrackStyles","knobStyles","createKnobStyles","rangesCount","createMark","defaultKnobsPositions","getDerivedStateFromProps","render","createKnob","root","dot","onChangeHandler","onBeforeChangeHandler","onAfterChangeHandler","undefined","rail","propTypes","arrayOf","number","isRequired","shape","string","defaultValue","bool","func","any","defaultProps","name","withTheme"],"sources":["../../../src/Slider/Slider.js"],"sourcesContent":["/**\n * Note: https://github.com/react-component/slider/issues/504\n * Version must remain in \"8.6.3\" until this bug is fixed\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Range, Handle } from \"rc-slider\";\nimport Tooltip from \"rc-tooltip\";\nimport { withStyles } from \"@material-ui/core\";\nimport KnobRing from \"./KnobRing\";\nimport styleCreator from \"./styles\";\n\n/**\n * Transform the scaled values into knobs positions.\n *\n * @param {*} scaledValue - the value of the slider to be scaled\n * @param {*} minPointValue - The value of the first point in\n * the slider from left to right.\n * @param {*} inverseStepValue - The inverse of calculated separation between\n * the value of the points that compose the slider.\n */\nconst scaledValueToKnobsPositionValue = (scaledValue, minPointValue, inverseStepValue) =>\n Math.floor((scaledValue - minPointValue) * inverseStepValue);\n\n/**\n * Transform the received knobs values into knob positions\n *\n * @param {Object} values - The values of the slider.\n * @param {Number} inverseStepValue - The inverse of calculated separation between\n * the value of the points that compose the slider.\n * @param {Integer} minPointValue - The value of the first point in the slider from\n * left to right.\n * @returns {Array} - The position of the knobs.\n */\nconst transformKnobsPosition = (values, inverseStepValue, minPointValue) => {\n const knobsPositions = [];\n values.forEach((value, index) => {\n knobsPositions[index] = scaledValueToKnobsPositionValue(value, minPointValue, inverseStepValue);\n });\n return knobsPositions;\n};\n\n/**\n * Calculates the separation between each value in the slider.\n *\n * @param {*} maxPointValue - The value of the last point in the slider from left to right.\n * @param {*} minPointValue - The value of the first point in the slider from left to right.\n * @param {*} divisionQuantity - How many subdivisions there are in the slider.\n */\nconst calculateStepValue = (maxPointValue, minPointValue, divisionQuantity) =>\n Math.abs(maxPointValue - minPointValue) / divisionQuantity;\n\n/**\n * Sliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, brightness, or applying image filters. Still in development\n */\nclass HvSlider extends React.Component {\n constructor(props) {\n super(props);\n\n const {\n markProperties,\n markStep,\n markDigits,\n knobProperties,\n values,\n defaultValues,\n theme,\n maxPointValue,\n minPointValue,\n divisionQuantity,\n formatMark,\n } = props;\n\n const styles = styleCreator(theme);\n const stepValue = calculateStepValue(maxPointValue, minPointValue, divisionQuantity);\n const inverseStepValue = 1 / stepValue;\n\n this.state = {\n knobsPositions: transformKnobsPosition(\n values.length > 0 ? values : defaultValues,\n inverseStepValue,\n minPointValue\n ),\n trackStyles: this.createTrackStyles(knobProperties, styles),\n knobStyles: this.createKnobStyles(knobProperties, styles),\n rangesCount: knobProperties.length - 1,\n marks: this.createMark(\n markProperties,\n markStep,\n divisionQuantity,\n minPointValue,\n stepValue,\n markDigits,\n formatMark,\n styles\n ),\n defaultKnobsPositions: transformKnobsPosition(defaultValues, inverseStepValue, minPointValue),\n styles,\n stepValue,\n inverseStepValue,\n };\n\n import(\"rc-slider/assets/index.css\");\n }\n\n static getDerivedStateFromProps(props, state) {\n const stepValue = calculateStepValue(\n props.maxPointValue,\n props.minPointValue,\n props.divisionQuantity\n );\n\n if (props.values.length > 0) {\n return {\n ...state,\n knobsPositions: transformKnobsPosition(\n props.values.length > 0 ? props.values : props.defaultValues,\n 1 / stepValue,\n props.minPointValue\n ),\n };\n }\n return null;\n }\n\n /**\n * Transform the scaled values into knobs positions.\n *\n * @param {*} sliderValue - the value of the slider to be scaled\n * @param {*} minPointValue - The value of the first point in the slider from left to right.\n * @param {*} stepValue - The calculated separation between the values of the slider.\n */\n knobsPositionToScaledValue = (sliderValue, minPointValue, stepValue) =>\n minPointValue + stepValue * sliderValue;\n\n /**\n * Generates the inline styles used for the track of each knob, applying colors if necessary.\n *\n * @param {Object} markProperties - The object provided by the user with\n * the desired configuration for the marks.\n * @param {Integer} markstep - The separation between marks.\n * @param {Integer} divisionQuantity - How many subdivisions there are in the slider.\n * @param {Integer} minPointValue - The value of the first point in the slider from\n * left to right.\n * @param {Integer} stepValue - The calculated separation between the values of the slider.\n * @param {Integer} markDigits - How many decimals the mark will show.\n * @param {Function} formatMark - A function provided by the user that is going to\n * be executed to format the mark text.\n * @param {Object} styles - the default styles for the marks.\n * @returns {Object} - An object with the for the marks.\n * @memberof HvSlider\n */\n createMark = (\n markProperties,\n markstep,\n divisionQuantity,\n minPointValue,\n stepValue,\n markDigits,\n formatMark,\n styles\n ) => {\n const marks = {};\n if (markProperties.length > 0) {\n markProperties.forEach((markProperty) => {\n marks[markProperty.position] = {\n label: `${markProperty.label}`,\n style: {\n ...styles.mark,\n },\n };\n });\n } else {\n const roundedMarkStep = Math.floor(markstep);\n for (let index = 0; index <= divisionQuantity; index += roundedMarkStep) {\n let labelValue = this.knobsPositionToScaledValue(index, minPointValue, stepValue).toFixed(\n markDigits\n );\n labelValue = formatMark(labelValue);\n marks[index] = {\n label: `${labelValue}`,\n style: {\n ...styles.mark,\n },\n };\n }\n }\n return marks;\n };\n\n /**\n * Generates the inline styles used for the track of each knob, applying colors if necessary.\n *\n * @param {Object} knobProperties - The object provided by the user with\n * the desired configuration for the knobs.\n * @param {Object} styles - the default styles for the tracks.\n * @returns {Object} - An object with the style for each track.\n * @memberof HvSlider\n */\n createTrackStyles = (knobProperties, styles) => {\n const trackStyles = [];\n if (knobProperties.length > 1) {\n knobProperties.forEach((knobProperty, index) => {\n trackStyles[index] = { ...styles.track };\n if (knobProperty.color) {\n trackStyles[index].backgroundColor = knobProperty.trackColor;\n }\n });\n }\n return trackStyles;\n };\n\n /**\n * Generates the inline styles used for each knob, applying colors if specified.\n *\n * @param {Object} knobProperties - The object provided by the user with\n * the desired configuration for the knobs.\n * @param {Object} styles - the default styles for the knobs.\n * @returns {Object} - An object with both the inner and outer styles for the knob.\n * @memberof HvSlider\n */\n createKnobStyles = (knobProperties, styles) => {\n const knobInner = [];\n const knobOuterStyle = [];\n\n const lastItem = knobProperties.length - 1;\n if (knobProperties.length > 1) {\n knobProperties.forEach((knobProperty, index) => {\n knobInner[index] = { ...styles.knobInner };\n knobOuterStyle[index] = { ...styles.knobOuter };\n\n if (knobProperty.color) {\n knobInner[index].backgroundColor = knobProperty.color;\n knobOuterStyle[index].backgroundColor = \"transparent\";\n }\n\n if (knobProperty.hidden) {\n knobInner[index] = styles.knobHidden;\n if (index === lastItem) {\n knobInner[index] = { ...styles.knobHiddenLast };\n knobInner[index].backgroundColor = knobProperty.color;\n knobOuterStyle[index] = { ...styles.knobHidden };\n knobOuterStyle[index].backgroundColor = knobProperty.color;\n }\n }\n });\n }\n\n return {\n knobInner,\n knobOuterStyle,\n };\n };\n\n /**\n * Generates an object which posses the current value and position of the knobs.\n *\n * @param {Array} knobsCurrentPosition - An array containing the current positions of the knobs.\n * @returns {Object} - An object with the positions and values of the knobs.\n * @memberof HvSlider\n */\n generateKnobsPositionAndValues = (knobsCurrentPosition) => {\n const newKnobsPosition = knobsCurrentPosition.slice();\n const knobsValues = [];\n const { minPointValue, noOverlap } = this.props;\n const { stepValue, knobsPositions } = this.state;\n\n let duplicatedValue = null;\n\n const findDuplicated = newKnobsPosition.filter(\n (item, index) => newKnobsPosition.indexOf(item) !== index\n );\n\n if (noOverlap && findDuplicated.length > 0) {\n [duplicatedValue] = findDuplicated;\n }\n newKnobsPosition.forEach((position, index, array) => {\n const newArray = array;\n let newPosition = position;\n\n if (noOverlap && newPosition === duplicatedValue) {\n const previousValue = knobsPositions[index];\n if (previousValue !== newPosition) {\n newPosition += newPosition > previousValue ? -1 : 1;\n newArray[index] = newPosition;\n }\n }\n\n knobsValues[index] = this.knobsPositionToScaledValue(newPosition, minPointValue, stepValue);\n }, this);\n\n return {\n knobsPosition: newKnobsPosition,\n knobsValues,\n };\n };\n\n /**\n * Function executed while the knobs changes.\n *\n * executes the callback provided by the user with the values and position of the knobs,\n * also lock the value of the knob in case one is fixed.\n *\n * @param {Array} knobsPosition - An array containing the current positions of the knobs.\n * @memberof HvSlider\n */\n onChangeHandler = (knobsPosition) => {\n const knobs = this.generateKnobsPositionAndValues(knobsPosition);\n const { knobProperties, onChange, minPointValue, defaultValues } = this.props;\n const { inverseStepValue } = this.state;\n knobProperties.forEach((knobProperty, index) => {\n if (knobProperty.fixed) {\n knobs.knobsPosition[index] = scaledValueToKnobsPositionValue(\n defaultValues[index],\n minPointValue,\n inverseStepValue\n );\n }\n });\n\n onChange(knobs);\n\n this.setState({\n knobsPositions: knobs.knobsPosition,\n });\n };\n\n /**\n * Function executed before a change.\n *\n * executes the callback provided by the user with the values and position of the knobs\n *\n * @param {Array} knobsPosition - An array containing the current positions of the knobs.\n * @memberof HvSlider\n */\n onBeforeChangeHandler = (knobsPosition) => {\n const { onBeforeChange } = this.props;\n const knobs = this.generateKnobsPositionAndValues(knobsPosition);\n onBeforeChange(knobs);\n };\n\n /**\n * Function executed after a change.\n *\n * executes the callback provided by the user with the values and position of the knobs\n *\n * @param {Array} knobsPosition - An array containing the current positions of the knobs.\n * @memberof HvSlider\n */\n onAfterChangeHandler = (knobsPosition) => {\n const { onAfterChange } = this.props;\n const knobs = this.generateKnobsPositionAndValues(knobsPosition);\n onAfterChange(knobs);\n };\n\n /**\n * Function used to create a custom knob for the slider.\n *\n * TODO: This should be isolated because is creating a sub component,\n * but there were some problems regarding the underlying component losing\n * references of the handlers disabling the focus.\n *\n * @param {Object} props - An object containing the properties of the knobs.\n * @memberof HvSlider\n */\n createKnob = (props) => {\n const { minPointValue, markDigits, knobProperties, formatTooltip, classes } = this.props;\n const { stepValue } = this.state;\n const { value, dragging, index, style, ...restProps } = props;\n\n const knobValue = this.knobsPositionToScaledValue(value, minPointValue, stepValue).toFixed(\n markDigits\n );\n if (dragging) {\n style.backgroundColor = knobProperties[index].dragColor;\n } else {\n style.backgroundColor = knobProperties[index].color;\n }\n\n return (\n <Tooltip\n prefixCls=\"rc-slider-tooltip\"\n overlay={formatTooltip(knobValue)}\n visible={dragging}\n placement=\"top\"\n key={index}\n overlayClassName={classes.sliderTooltip}\n >\n <Handle value={value} style={style} {...restProps}>\n <KnobRing hoverColor={knobProperties[index].hoverColor} dragging={dragging} />\n </Handle>\n </Tooltip>\n );\n };\n\n render() {\n const { divisionQuantity, classes } = this.props;\n\n const {\n knobsPositions,\n defaultKnobsPositions,\n rangesCount,\n knobStyles,\n trackStyles,\n marks,\n styles,\n } = this.state;\n\n return (\n <Range\n handle={this.createKnob}\n className={classes.root}\n min={0}\n max={divisionQuantity}\n step={1}\n marks={marks}\n dotStyle={styles.dot}\n onChange={this.onChangeHandler}\n onBeforeChange={this.onBeforeChangeHandler}\n onAfterChange={this.onAfterChangeHandler}\n value={knobsPositions.length > 0 ? knobsPositions : undefined}\n allowCross={false}\n defaultValue={defaultKnobsPositions}\n count={rangesCount}\n railStyle={styles.rail}\n handleStyle={knobStyles.knobInner}\n trackStyle={trackStyles}\n />\n );\n }\n}\n\nHvSlider.propTypes = {\n /**\n * The values array to apply to the component\n */\n values: PropTypes.arrayOf(PropTypes.number),\n /**\n * The default values array to apply to the component\n */\n defaultValues: PropTypes.arrayOf(PropTypes.number).isRequired,\n /**\n * The object used to set the knob properties,\n * for every item in the array a new knob will be created.\n */\n knobProperties: PropTypes.arrayOf(\n PropTypes.shape({\n color: PropTypes.string,\n defaultValue: PropTypes.number,\n hidden: PropTypes.bool,\n fixed: PropTypes.bool,\n hoverColor: PropTypes.string,\n trackColor: PropTypes.string,\n dragColor: PropTypes.string,\n })\n ).isRequired,\n /**\n * The object used to set the mark properties individually.\n */\n markProperties: PropTypes.arrayOf(\n PropTypes.shape({\n position: PropTypes.number,\n label: PropTypes.string,\n })\n ),\n /**\n * the function executed before a change will ocurr in the slider.\n * it will receive an object like\n * {\n * knobsPosition: [],\n * knobsValues: []\n * }\n */\n onBeforeChange: PropTypes.func,\n /**\n * the function executed while a change is ocurring in the slider.\n * it will receive an object like\n * {\n * knobsPosition: [],\n * knobsValues: []\n * }\n */\n onChange: PropTypes.func,\n /**\n * the function executed after a change ocurred in the slider.\n * it will receive an object like\n * {\n * knobsPosition: [],\n * knobsValues: []\n * }\n */\n onAfterChange: PropTypes.func,\n /**\n * the separation in points between marks.\n * example: if 10 divisions and a markstep of 2 there will be 5 marks.\n */\n markStep: PropTypes.number,\n /**\n * how many subdivisions there are in the slider.\n */\n divisionQuantity: PropTypes.number,\n /**\n * the value of the first point in the slider from left to right.\n */\n minPointValue: PropTypes.number,\n /**\n * the value of the last point in the slider from left to right.\n */\n maxPointValue: PropTypes.number,\n /**\n * the nax number of decimals if no format function is applied\n */\n markDigits: PropTypes.number,\n /**\n * a formatting function used to add format to the marks in the track,\n * the function receives the mark text\n */\n formatMark: PropTypes.func,\n /**\n * a formatting function used to add format to the tooltip in the track,\n * the function receives the mark text\n */\n formatTooltip: PropTypes.func,\n /**\n * if `true` the knobs can't have the same value, if `false` knobs can have the same value.\n */\n noOverlap: PropTypes.bool,\n /**\n * the classes object to be applied into the root object.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component.\n */\n root: PropTypes.string,\n /**\n * Style applied to the dot.\n */\n dot: PropTypes.string,\n /**\n * Style applied to the rail.\n */\n rail: PropTypes.string,\n /**\n * Style applied to the inner of the knob.\n */\n knobInner: PropTypes.string,\n /**\n * Style applied to the outside of the knob.\n */\n knobOuter: PropTypes.string,\n /**\n * Style applied when the knob is hidden.\n */\n knobHidden: PropTypes.string,\n /**\n * Style applied last hidden knob.\n */\n knobHiddenLast: PropTypes.string,\n /**\n * Style applied to the track.\n */\n track: PropTypes.string,\n /**\n * Style applied to the mark.\n */\n mark: PropTypes.string,\n /**\n * Style applied to the tooltip.\n */\n sliderTooltip: PropTypes.string,\n }).isRequired,\n\n theme: PropTypes.any.isRequired,\n};\n\nHvSlider.defaultProps = {\n markStep: 1,\n markDigits: 0,\n noOverlap: true,\n values: [],\n formatMark: (mark) => mark,\n formatTooltip: (mark) => mark,\n markProperties: [],\n divisionQuantity: 100,\n minPointValue: 0,\n maxPointValue: 100,\n onBeforeChange: () => {},\n onChange: () => {},\n onAfterChange: () => {},\n};\n\nexport default withStyles(styleCreator, { name: \"HvSlider\", withTheme: true })(HvSlider);\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,KAAT,EAAgBC,MAAhB,QAA8B,WAA9B;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,YAAP,MAAyB,UAAzB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,+BAA+B,GAAG,CAACC,WAAD,EAAcC,aAAd,EAA6BC,gBAA7B,KACtCC,IAAI,CAACC,KAAL,CAAW,CAACJ,WAAW,GAAGC,aAAf,IAAgCC,gBAA3C,CADF;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,sBAAsB,GAAG,CAACC,MAAD,EAASJ,gBAAT,EAA2BD,aAA3B,KAA6C;EAC1E,MAAMM,cAAc,GAAG,EAAvB;EACAD,MAAM,CAACE,OAAP,CAAe,CAACC,KAAD,EAAQC,KAAR,KAAkB;IAC/BH,cAAc,CAACG,KAAD,CAAd,GAAwBX,+BAA+B,CAACU,KAAD,EAAQR,aAAR,EAA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;EAxCF,CAAhB,EAyCNF,UA3IgB;EA6InBpB,KAAK,EAAE5F,SAAS,CAACsH,GAAV,CAAcN;AA7IF,CAArB;AAgJAzF,QAAQ,CAACgG,YAAT,GAAwB;EACtB5B,QAAQ,EAAE,CADY;EAEtB5D,UAAU,EAAE,CAFU;EAGtBgC,SAAS,EAAE,IAHW;EAItBjD,MAAM,EAAE,EAJc;EAKtBkB,UAAU,EAAGQ,IAAD,IAAUA,IALA;EAMtB2C,aAAa,EAAG3C,IAAD,IAAUA,IANH;EAOtBX,cAAc,EAAE,EAPM;EAQtBR,gBAAgB,EAAE,GARI;EAStBZ,aAAa,EAAE,CATO;EAUtBW,aAAa,EAAE,GAVO;EAWtB6D,cAAc,EAAE,MAAM,CAAE,CAXF;EAYtBJ,QAAQ,EAAE,MAAM,CAAE,CAZI;EAatBK,aAAa,EAAE,MAAM,CAAE;AAbD,CAAxB;AAgBA,eAAe9E,UAAU,CAACE,YAAD,EAAe;EAAEkH,IAAI,EAAE,UAAR;EAAoBC,SAAS,EAAE;AAA/B,CAAf,CAAV,CAAgElG,QAAhE,CAAf"}
|
|
1
|
+
{"version":3,"file":"Slider.js","names":["React","PropTypes","Range","Handle","Tooltip","withStyles","KnobRing","styleCreator","scaledValueToKnobsPositionValue","scaledValue","minPointValue","inverseStepValue","Math","floor","transformKnobsPosition","values","knobsPositions","forEach","value","index","calculateStepValue","maxPointValue","divisionQuantity","abs","HvSlider","Component","constructor","props","sliderValue","stepValue","markProperties","markstep","markDigits","formatMark","styles","marks","length","markProperty","position","label","style","mark","roundedMarkStep","labelValue","knobsPositionToScaledValue","toFixed","knobProperties","trackStyles","knobProperty","track","color","backgroundColor","trackColor","knobInner","knobOuterStyle","lastItem","knobOuter","hidden","knobHidden","knobHiddenLast","knobsCurrentPosition","newKnobsPosition","slice","knobsValues","noOverlap","state","duplicatedValue","findDuplicated","filter","item","indexOf","array","newArray","newPosition","previousValue","knobsPosition","knobs","generateKnobsPositionAndValues","onChange","defaultValues","fixed","setState","onBeforeChange","onAfterChange","formatTooltip","classes","dragging","restProps","knobValue","dragColor","sliderTooltip","hoverColor","markStep","theme","createTrackStyles","knobStyles","createKnobStyles","rangesCount","createMark","defaultKnobsPositions","getDerivedStateFromProps","render","sliderBase","createKnob","root","dot","onChangeHandler","onBeforeChangeHandler","onAfterChangeHandler","undefined","rail","propTypes","arrayOf","number","isRequired","shape","string","defaultValue","bool","func","tooltipBase","any","defaultProps","name","withTheme"],"sources":["../../../src/Slider/Slider.js"],"sourcesContent":["/**\n * Note: https://github.com/react-component/slider/issues/504\n * Version must remain in \"8.6.3\" until this bug is fixed\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Range, Handle } from \"rc-slider\";\nimport Tooltip from \"rc-tooltip\";\nimport { withStyles } from \"@material-ui/core\";\nimport KnobRing from \"./KnobRing\";\nimport styleCreator from \"./styles\";\n\n/**\n * Transform the scaled values into knobs positions.\n *\n * @param {*} scaledValue - the value of the slider to be scaled\n * @param {*} minPointValue - The value of the first point in\n * the slider from left to right.\n * @param {*} inverseStepValue - The inverse of calculated separation between\n * the value of the points that compose the slider.\n */\nconst scaledValueToKnobsPositionValue = (scaledValue, minPointValue, inverseStepValue) =>\n Math.floor((scaledValue - minPointValue) * inverseStepValue);\n\n/**\n * Transform the received knobs values into knob positions\n *\n * @param {Object} values - The values of the slider.\n * @param {Number} inverseStepValue - The inverse of calculated separation between\n * the value of the points that compose the slider.\n * @param {Integer} minPointValue - The value of the first point in the slider from\n * left to right.\n * @returns {Array} - The position of the knobs.\n */\nconst transformKnobsPosition = (values, inverseStepValue, minPointValue) => {\n const knobsPositions = [];\n values.forEach((value, index) => {\n knobsPositions[index] = scaledValueToKnobsPositionValue(value, minPointValue, inverseStepValue);\n });\n return knobsPositions;\n};\n\n/**\n * Calculates the separation between each value in the slider.\n *\n * @param {*} maxPointValue - The value of the last point in the slider from left to right.\n * @param {*} minPointValue - The value of the first point in the slider from left to right.\n * @param {*} divisionQuantity - How many subdivisions there are in the slider.\n */\nconst calculateStepValue = (maxPointValue, minPointValue, divisionQuantity) =>\n Math.abs(maxPointValue - minPointValue) / divisionQuantity;\n\n/**\n * Sliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, brightness, or applying image filters. Still in development\n */\nclass HvSlider extends React.Component {\n constructor(props) {\n super(props);\n\n const {\n markProperties,\n markStep,\n markDigits,\n knobProperties,\n values,\n defaultValues,\n theme,\n maxPointValue,\n minPointValue,\n divisionQuantity,\n formatMark,\n } = props;\n\n const styles = styleCreator(theme);\n const stepValue = calculateStepValue(maxPointValue, minPointValue, divisionQuantity);\n const inverseStepValue = 1 / stepValue;\n\n this.state = {\n knobsPositions: transformKnobsPosition(\n values.length > 0 ? values : defaultValues,\n inverseStepValue,\n minPointValue\n ),\n trackStyles: this.createTrackStyles(knobProperties, styles),\n knobStyles: this.createKnobStyles(knobProperties, styles),\n rangesCount: knobProperties.length - 1,\n marks: this.createMark(\n markProperties,\n markStep,\n divisionQuantity,\n minPointValue,\n stepValue,\n markDigits,\n formatMark,\n styles\n ),\n defaultKnobsPositions: transformKnobsPosition(defaultValues, inverseStepValue, minPointValue),\n styles,\n stepValue,\n inverseStepValue,\n };\n }\n\n static getDerivedStateFromProps(props, state) {\n const stepValue = calculateStepValue(\n props.maxPointValue,\n props.minPointValue,\n props.divisionQuantity\n );\n\n if (props.values.length > 0) {\n return {\n ...state,\n knobsPositions: transformKnobsPosition(\n props.values.length > 0 ? props.values : props.defaultValues,\n 1 / stepValue,\n props.minPointValue\n ),\n };\n }\n return null;\n }\n\n /**\n * Transform the scaled values into knobs positions.\n *\n * @param {*} sliderValue - the value of the slider to be scaled\n * @param {*} minPointValue - The value of the first point in the slider from left to right.\n * @param {*} stepValue - The calculated separation between the values of the slider.\n */\n knobsPositionToScaledValue = (sliderValue, minPointValue, stepValue) =>\n minPointValue + stepValue * sliderValue;\n\n /**\n * Generates the inline styles used for the track of each knob, applying colors if necessary.\n *\n * @param {Object} markProperties - The object provided by the user with\n * the desired configuration for the marks.\n * @param {Integer} markstep - The separation between marks.\n * @param {Integer} divisionQuantity - How many subdivisions there are in the slider.\n * @param {Integer} minPointValue - The value of the first point in the slider from\n * left to right.\n * @param {Integer} stepValue - The calculated separation between the values of the slider.\n * @param {Integer} markDigits - How many decimals the mark will show.\n * @param {Function} formatMark - A function provided by the user that is going to\n * be executed to format the mark text.\n * @param {Object} styles - the default styles for the marks.\n * @returns {Object} - An object with the for the marks.\n * @memberof HvSlider\n */\n createMark = (\n markProperties,\n markstep,\n divisionQuantity,\n minPointValue,\n stepValue,\n markDigits,\n formatMark,\n styles\n ) => {\n const marks = {};\n if (markProperties.length > 0) {\n markProperties.forEach((markProperty) => {\n marks[markProperty.position] = {\n label: `${markProperty.label}`,\n style: {\n ...styles.mark,\n },\n };\n });\n } else {\n const roundedMarkStep = Math.floor(markstep);\n for (let index = 0; index <= divisionQuantity; index += roundedMarkStep) {\n let labelValue = this.knobsPositionToScaledValue(index, minPointValue, stepValue).toFixed(\n markDigits\n );\n labelValue = formatMark(labelValue);\n marks[index] = {\n label: `${labelValue}`,\n style: {\n ...styles.mark,\n },\n };\n }\n }\n return marks;\n };\n\n /**\n * Generates the inline styles used for the track of each knob, applying colors if necessary.\n *\n * @param {Object} knobProperties - The object provided by the user with\n * the desired configuration for the knobs.\n * @param {Object} styles - the default styles for the tracks.\n * @returns {Object} - An object with the style for each track.\n * @memberof HvSlider\n */\n createTrackStyles = (knobProperties, styles) => {\n const trackStyles = [];\n if (knobProperties.length > 1) {\n knobProperties.forEach((knobProperty, index) => {\n trackStyles[index] = { ...styles.track };\n if (knobProperty.color) {\n trackStyles[index].backgroundColor = knobProperty.trackColor;\n }\n });\n }\n return trackStyles;\n };\n\n /**\n * Generates the inline styles used for each knob, applying colors if specified.\n *\n * @param {Object} knobProperties - The object provided by the user with\n * the desired configuration for the knobs.\n * @param {Object} styles - the default styles for the knobs.\n * @returns {Object} - An object with both the inner and outer styles for the knob.\n * @memberof HvSlider\n */\n createKnobStyles = (knobProperties, styles) => {\n const knobInner = [];\n const knobOuterStyle = [];\n\n const lastItem = knobProperties.length - 1;\n if (knobProperties.length > 1) {\n knobProperties.forEach((knobProperty, index) => {\n knobInner[index] = { ...styles.knobInner };\n knobOuterStyle[index] = { ...styles.knobOuter };\n\n if (knobProperty.color) {\n knobInner[index].backgroundColor = knobProperty.color;\n knobOuterStyle[index].backgroundColor = \"transparent\";\n }\n\n if (knobProperty.hidden) {\n knobInner[index] = styles.knobHidden;\n if (index === lastItem) {\n knobInner[index] = { ...styles.knobHiddenLast };\n knobInner[index].backgroundColor = knobProperty.color;\n knobOuterStyle[index] = { ...styles.knobHidden };\n knobOuterStyle[index].backgroundColor = knobProperty.color;\n }\n }\n });\n }\n\n return {\n knobInner,\n knobOuterStyle,\n };\n };\n\n /**\n * Generates an object which posses the current value and position of the knobs.\n *\n * @param {Array} knobsCurrentPosition - An array containing the current positions of the knobs.\n * @returns {Object} - An object with the positions and values of the knobs.\n * @memberof HvSlider\n */\n generateKnobsPositionAndValues = (knobsCurrentPosition) => {\n const newKnobsPosition = knobsCurrentPosition.slice();\n const knobsValues = [];\n const { minPointValue, noOverlap } = this.props;\n const { stepValue, knobsPositions } = this.state;\n\n let duplicatedValue = null;\n\n const findDuplicated = newKnobsPosition.filter(\n (item, index) => newKnobsPosition.indexOf(item) !== index\n );\n\n if (noOverlap && findDuplicated.length > 0) {\n [duplicatedValue] = findDuplicated;\n }\n newKnobsPosition.forEach((position, index, array) => {\n const newArray = array;\n let newPosition = position;\n\n if (noOverlap && newPosition === duplicatedValue) {\n const previousValue = knobsPositions[index];\n if (previousValue !== newPosition) {\n newPosition += newPosition > previousValue ? -1 : 1;\n newArray[index] = newPosition;\n }\n }\n\n knobsValues[index] = this.knobsPositionToScaledValue(newPosition, minPointValue, stepValue);\n }, this);\n\n return {\n knobsPosition: newKnobsPosition,\n knobsValues,\n };\n };\n\n /**\n * Function executed while the knobs changes.\n *\n * executes the callback provided by the user with the values and position of the knobs,\n * also lock the value of the knob in case one is fixed.\n *\n * @param {Array} knobsPosition - An array containing the current positions of the knobs.\n * @memberof HvSlider\n */\n onChangeHandler = (knobsPosition) => {\n const knobs = this.generateKnobsPositionAndValues(knobsPosition);\n const { knobProperties, onChange, minPointValue, defaultValues } = this.props;\n const { inverseStepValue } = this.state;\n knobProperties.forEach((knobProperty, index) => {\n if (knobProperty.fixed) {\n knobs.knobsPosition[index] = scaledValueToKnobsPositionValue(\n defaultValues[index],\n minPointValue,\n inverseStepValue\n );\n }\n });\n\n onChange(knobs);\n\n this.setState({\n knobsPositions: knobs.knobsPosition,\n });\n };\n\n /**\n * Function executed before a change.\n *\n * executes the callback provided by the user with the values and position of the knobs\n *\n * @param {Array} knobsPosition - An array containing the current positions of the knobs.\n * @memberof HvSlider\n */\n onBeforeChangeHandler = (knobsPosition) => {\n const { onBeforeChange } = this.props;\n const knobs = this.generateKnobsPositionAndValues(knobsPosition);\n onBeforeChange(knobs);\n };\n\n /**\n * Function executed after a change.\n *\n * executes the callback provided by the user with the values and position of the knobs\n *\n * @param {Array} knobsPosition - An array containing the current positions of the knobs.\n * @memberof HvSlider\n */\n onAfterChangeHandler = (knobsPosition) => {\n const { onAfterChange } = this.props;\n const knobs = this.generateKnobsPositionAndValues(knobsPosition);\n onAfterChange(knobs);\n };\n\n /**\n * Function used to create a custom knob for the slider.\n *\n * TODO: This should be isolated because is creating a sub component,\n * but there were some problems regarding the underlying component losing\n * references of the handlers disabling the focus.\n *\n * @param {Object} props - An object containing the properties of the knobs.\n * @memberof HvSlider\n */\n createKnob = (props) => {\n const { minPointValue, markDigits, knobProperties, formatTooltip, classes } = this.props;\n const { stepValue } = this.state;\n const { value, dragging, index, style, ...restProps } = props;\n\n const knobValue = this.knobsPositionToScaledValue(value, minPointValue, stepValue).toFixed(\n markDigits\n );\n if (dragging) {\n style.backgroundColor = knobProperties[index].dragColor;\n } else {\n style.backgroundColor = knobProperties[index].color;\n }\n\n return (\n <Tooltip\n prefixCls=\"rc-slider-tooltip\"\n overlay={formatTooltip(knobValue)}\n visible={dragging}\n placement=\"top\"\n key={index}\n overlayClassName={classes.sliderTooltip}\n >\n <Handle value={value} style={style} {...restProps}>\n <KnobRing hoverColor={knobProperties[index].hoverColor} dragging={dragging} />\n </Handle>\n </Tooltip>\n );\n };\n\n render() {\n const { divisionQuantity, classes } = this.props;\n\n const {\n knobsPositions,\n defaultKnobsPositions,\n rangesCount,\n knobStyles,\n trackStyles,\n marks,\n styles,\n } = this.state;\n\n return (\n <div className={classes.sliderBase}>\n <Range\n handle={this.createKnob}\n className={classes.root}\n min={0}\n max={divisionQuantity}\n step={1}\n marks={marks}\n dotStyle={styles.dot}\n onChange={this.onChangeHandler}\n onBeforeChange={this.onBeforeChangeHandler}\n onAfterChange={this.onAfterChangeHandler}\n value={knobsPositions.length > 0 ? knobsPositions : undefined}\n allowCross={false}\n defaultValue={defaultKnobsPositions}\n count={rangesCount}\n railStyle={styles.rail}\n handleStyle={knobStyles.knobInner}\n trackStyle={trackStyles}\n />\n </div>\n );\n }\n}\n\nHvSlider.propTypes = {\n /**\n * The values array to apply to the component\n */\n values: PropTypes.arrayOf(PropTypes.number),\n /**\n * The default values array to apply to the component\n */\n defaultValues: PropTypes.arrayOf(PropTypes.number).isRequired,\n /**\n * The object used to set the knob properties,\n * for every item in the array a new knob will be created.\n */\n knobProperties: PropTypes.arrayOf(\n PropTypes.shape({\n color: PropTypes.string,\n defaultValue: PropTypes.number,\n hidden: PropTypes.bool,\n fixed: PropTypes.bool,\n hoverColor: PropTypes.string,\n trackColor: PropTypes.string,\n dragColor: PropTypes.string,\n })\n ).isRequired,\n /**\n * The object used to set the mark properties individually.\n */\n markProperties: PropTypes.arrayOf(\n PropTypes.shape({\n position: PropTypes.number,\n label: PropTypes.string,\n })\n ),\n /**\n * the function executed before a change will ocurr in the slider.\n * it will receive an object like\n * {\n * knobsPosition: [],\n * knobsValues: []\n * }\n */\n onBeforeChange: PropTypes.func,\n /**\n * the function executed while a change is ocurring in the slider.\n * it will receive an object like\n * {\n * knobsPosition: [],\n * knobsValues: []\n * }\n */\n onChange: PropTypes.func,\n /**\n * the function executed after a change ocurred in the slider.\n * it will receive an object like\n * {\n * knobsPosition: [],\n * knobsValues: []\n * }\n */\n onAfterChange: PropTypes.func,\n /**\n * the separation in points between marks.\n * example: if 10 divisions and a markstep of 2 there will be 5 marks.\n */\n markStep: PropTypes.number,\n /**\n * how many subdivisions there are in the slider.\n */\n divisionQuantity: PropTypes.number,\n /**\n * the value of the first point in the slider from left to right.\n */\n minPointValue: PropTypes.number,\n /**\n * the value of the last point in the slider from left to right.\n */\n maxPointValue: PropTypes.number,\n /**\n * the nax number of decimals if no format function is applied\n */\n markDigits: PropTypes.number,\n /**\n * a formatting function used to add format to the marks in the track,\n * the function receives the mark text\n */\n formatMark: PropTypes.func,\n /**\n * a formatting function used to add format to the tooltip in the track,\n * the function receives the mark text\n */\n formatTooltip: PropTypes.func,\n /**\n * if `true` the knobs can't have the same value, if `false` knobs can have the same value.\n */\n noOverlap: PropTypes.bool,\n /**\n * the classes object to be applied into the root object.\n */\n classes: PropTypes.shape({\n /**\n * Base slider styles to avoid the css import from node_modules and enable SSR support.\n * import(\"rc-slider/assets/index.css\")\n */\n sliderBase: PropTypes.string,\n tooltipBase: PropTypes.string,\n /**\n * Style applied to the root of the component.\n */\n root: PropTypes.string,\n /**\n * Style applied to the dot.\n */\n dot: PropTypes.string,\n /**\n * Style applied to the rail.\n */\n rail: PropTypes.string,\n /**\n * Style applied to the inner of the knob.\n */\n knobInner: PropTypes.string,\n /**\n * Style applied to the outside of the knob.\n */\n knobOuter: PropTypes.string,\n /**\n * Style applied when the knob is hidden.\n */\n knobHidden: PropTypes.string,\n /**\n * Style applied last hidden knob.\n */\n knobHiddenLast: PropTypes.string,\n /**\n * Style applied to the track.\n */\n track: PropTypes.string,\n /**\n * Style applied to the mark.\n */\n mark: PropTypes.string,\n /**\n * Style applied to the tooltip.\n */\n sliderTooltip: PropTypes.string,\n }).isRequired,\n\n theme: PropTypes.any.isRequired,\n};\n\nHvSlider.defaultProps = {\n markStep: 1,\n markDigits: 0,\n noOverlap: true,\n values: [],\n formatMark: (mark) => mark,\n formatTooltip: (mark) => mark,\n markProperties: [],\n divisionQuantity: 100,\n minPointValue: 0,\n maxPointValue: 100,\n onBeforeChange: () => {},\n onChange: () => {},\n onAfterChange: () => {},\n};\n\nexport default withStyles(styleCreator, { name: \"HvSlider\", withTheme: true })(HvSlider);\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,KAAT,EAAgBC,MAAhB,QAA8B,WAA9B;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,YAAP,MAAyB,UAAzB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,+BAA+B,GAAG,CAACC,WAAD,EAAcC,aAAd,EAA6BC,gBAA7B,KACtCC,IAAI,CAACC,KAAL,CAAW,CAACJ,WAAW,GAAGC,aAAf,IAAgCC,gBAA3C,CADF;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,sBAAsB,GAAG,CAACC,MAAD,EAASJ,gBAAT,EAA2BD,aAA3B,KAA6C;EAC1E,MAAMM,cAAc,GAAG,EAAvB;EACAD,MAAM,CAACE,OAAP,CAAe,CAACC,KAAD,EAAQC,KAAR,KAAkB;IAC/BH,cAAc,CAACG,KAAD,CAAd,GAAwBX,+BAA+B,CAACU,KAAD,EAAQR,aAAR,EAAuBC,gBAAvB,CAAvD;EACD,CAFD;EAGA,OAAOK,cAAP;AACD,CAND;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMI,kBAAkB,GAAG,CAACC,aAAD,EAAgBX,aAAhB,EA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,UAjJgB;EAmJnBrB,KAAK,EAAE5F,SAAS,CAACwH,GAAV,CAAcP;AAnJF,CAArB;AAsJA1F,QAAQ,CAACkG,YAAT,GAAwB;EACtB9B,QAAQ,EAAE,CADY;EAEtB5D,UAAU,EAAE,CAFU;EAGtBgC,SAAS,EAAE,IAHW;EAItBjD,MAAM,EAAE,EAJc;EAKtBkB,UAAU,EAAGQ,IAAD,IAAUA,IALA;EAMtB2C,aAAa,EAAG3C,IAAD,IAAUA,IANH;EAOtBX,cAAc,EAAE,EAPM;EAQtBR,gBAAgB,EAAE,GARI;EAStBZ,aAAa,EAAE,CATO;EAUtBW,aAAa,EAAE,GAVO;EAWtB6D,cAAc,EAAE,MAAM,CAAE,CAXF;EAYtBJ,QAAQ,EAAE,MAAM,CAAE,CAZI;EAatBK,aAAa,EAAE,MAAM,CAAE;AAbD,CAAxB;AAgBA,eAAe9E,UAAU,CAACE,YAAD,EAAe;EAAEoH,IAAI,EAAE,UAAR;EAAoBC,SAAS,EAAE;AAA/B,CAAf,CAAV,CAAgEpG,QAAhE,CAAf"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
export const sliderBase = {
|
|
2
|
+
"& .rc-slider": {
|
|
3
|
+
position: "relative",
|
|
4
|
+
width: "100%",
|
|
5
|
+
height: "14px",
|
|
6
|
+
padding: " 5px 0",
|
|
7
|
+
borderRadius: "6px",
|
|
8
|
+
touchAction: "none",
|
|
9
|
+
boxSizing: "border-box",
|
|
10
|
+
"-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)"
|
|
11
|
+
},
|
|
12
|
+
"& .rc-slider *": {
|
|
13
|
+
boxSizing: "border-box",
|
|
14
|
+
"-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)"
|
|
15
|
+
},
|
|
16
|
+
"& .rc-slider-rail": {
|
|
17
|
+
position: "absolute",
|
|
18
|
+
width: "100%",
|
|
19
|
+
height: "4px",
|
|
20
|
+
backgroundColor: "#e9e9e9",
|
|
21
|
+
borderRadius: "6px"
|
|
22
|
+
},
|
|
23
|
+
"& .rc-slider-track": {
|
|
24
|
+
position: "absolute",
|
|
25
|
+
height: "4px",
|
|
26
|
+
backgroundColor: "#abe2fb",
|
|
27
|
+
borderRadius: "6px"
|
|
28
|
+
},
|
|
29
|
+
"& .rc-slider-handle": {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
width: "14px",
|
|
32
|
+
height: "14px",
|
|
33
|
+
marginTop: "-5px",
|
|
34
|
+
backgroundColor: "#fff",
|
|
35
|
+
border: "solid 2px #96dbfa",
|
|
36
|
+
borderRadius: "50%",
|
|
37
|
+
// cursor: "pointer",
|
|
38
|
+
// cursor: "-webkit-grab",
|
|
39
|
+
cursor: "grab",
|
|
40
|
+
opacity: 0.8,
|
|
41
|
+
touchAction: "pan-x"
|
|
42
|
+
},
|
|
43
|
+
"& .rc-slider-handle-dragging.rc-slider-handle-dragging.rc-slider-handle-dragging": {
|
|
44
|
+
borderColor: "#57c5f7",
|
|
45
|
+
boxShadow: "0 0 0 5px #96dbfa"
|
|
46
|
+
},
|
|
47
|
+
"& .rc-slider-handle:focus": {
|
|
48
|
+
outline: "none",
|
|
49
|
+
boxShadow: "none"
|
|
50
|
+
},
|
|
51
|
+
"& .rc-slider-handle:focus-visible": {
|
|
52
|
+
borderColor: "#2db7f5",
|
|
53
|
+
boxShadow: "0 0 0 3px #96dbfa"
|
|
54
|
+
},
|
|
55
|
+
"& .rc-slider-handle-click-focused:focus": {
|
|
56
|
+
borderColor: "#96dbfa",
|
|
57
|
+
boxShadow: "unset"
|
|
58
|
+
},
|
|
59
|
+
"& .rc-slider-handle:hover": {
|
|
60
|
+
borderColor: "#57c5f7"
|
|
61
|
+
},
|
|
62
|
+
"& .rc-slider-handle:active": {
|
|
63
|
+
borderColor: "#57c5f7",
|
|
64
|
+
boxShadow: "0 0 5px #57c5f7",
|
|
65
|
+
// cursor: "-webkit-grabbing",
|
|
66
|
+
cursor: "grabbing"
|
|
67
|
+
},
|
|
68
|
+
"& .rc-slider-mark": {
|
|
69
|
+
position: "absolute",
|
|
70
|
+
top: "18px",
|
|
71
|
+
left: 0,
|
|
72
|
+
width: "100%",
|
|
73
|
+
fontSize: "12px"
|
|
74
|
+
},
|
|
75
|
+
"& .rc-slider-mark-text": {
|
|
76
|
+
position: "absolute",
|
|
77
|
+
display: "inline-block",
|
|
78
|
+
color: "#999",
|
|
79
|
+
textAlign: "center",
|
|
80
|
+
verticalAlign: "middle",
|
|
81
|
+
cursor: "pointer"
|
|
82
|
+
},
|
|
83
|
+
"& .rc-slider-mark-text-active": {
|
|
84
|
+
color: "#666"
|
|
85
|
+
},
|
|
86
|
+
"& .rc-slider-step": {
|
|
87
|
+
position: "absolute",
|
|
88
|
+
width: "100%",
|
|
89
|
+
height: "4px",
|
|
90
|
+
background: "transparent",
|
|
91
|
+
pointerEvents: "none"
|
|
92
|
+
},
|
|
93
|
+
"& .rc-slider-dot": {
|
|
94
|
+
position: "absolute",
|
|
95
|
+
bottom: "-2px",
|
|
96
|
+
width: "8px",
|
|
97
|
+
height: "8px",
|
|
98
|
+
verticalAlign: "middle",
|
|
99
|
+
backgroundColor: "#fff",
|
|
100
|
+
border: "2px solid #e9e9e9",
|
|
101
|
+
borderRadius: "50%",
|
|
102
|
+
cursor: "pointer"
|
|
103
|
+
},
|
|
104
|
+
"& .rc-slider-dot-active": {
|
|
105
|
+
borderColor: "#96dbfa"
|
|
106
|
+
},
|
|
107
|
+
"& .rc-slider-dot-reverse": {
|
|
108
|
+
marginRight: "-4px"
|
|
109
|
+
},
|
|
110
|
+
"& .rc-slider-disabled": {
|
|
111
|
+
backgroundColor: "#e9e9e9"
|
|
112
|
+
},
|
|
113
|
+
"& .rc-slider-disabled .rc-slider-track": {
|
|
114
|
+
backgroundColor: "#ccc"
|
|
115
|
+
},
|
|
116
|
+
"& .rc-slider-disabled .rc-slider-handle": {
|
|
117
|
+
backgroundColor: "#fff",
|
|
118
|
+
borderColor: "#ccc",
|
|
119
|
+
boxShadow: "none",
|
|
120
|
+
cursor: "not-allowed"
|
|
121
|
+
},
|
|
122
|
+
"&.rc-slider-disabled .rc-slider-dot": {
|
|
123
|
+
backgroundColor: "#fff",
|
|
124
|
+
borderColor: "#ccc",
|
|
125
|
+
boxShadow: "none",
|
|
126
|
+
cursor: "not-allowed"
|
|
127
|
+
},
|
|
128
|
+
"& .rc-slider-disabled .rc-slider-mark-text": {
|
|
129
|
+
cursor: "not-allowed !important"
|
|
130
|
+
},
|
|
131
|
+
"& .rc-slider-disabled .rc-slider-dot": {
|
|
132
|
+
cursor: "not-allowed !important"
|
|
133
|
+
},
|
|
134
|
+
"& .rc-slider-vertical": {
|
|
135
|
+
width: "14px",
|
|
136
|
+
height: "100%",
|
|
137
|
+
padding: "0 5px"
|
|
138
|
+
},
|
|
139
|
+
"& .rc-slider-vertical .rc-slider-rail": {
|
|
140
|
+
width: "4px",
|
|
141
|
+
height: "100%"
|
|
142
|
+
},
|
|
143
|
+
"& .rc-slider-vertical .rc-slider-track": {
|
|
144
|
+
bottom: 0,
|
|
145
|
+
left: "5px",
|
|
146
|
+
width: "4px"
|
|
147
|
+
},
|
|
148
|
+
"& .rc-slider-vertical .rc-slider-handle": {
|
|
149
|
+
marginTop: 0,
|
|
150
|
+
marginLeft: "-5px",
|
|
151
|
+
touchAction: "pan-y"
|
|
152
|
+
},
|
|
153
|
+
"& .rc-slider-vertical .rc-slider-mark": {
|
|
154
|
+
top: 0,
|
|
155
|
+
left: "18px",
|
|
156
|
+
height: "100%"
|
|
157
|
+
},
|
|
158
|
+
"& .rc-slider-vertical .rc-slider-step": {
|
|
159
|
+
width: "4px",
|
|
160
|
+
height: "100%"
|
|
161
|
+
},
|
|
162
|
+
"& .rc-slider-vertical .rc-slider-dot": {
|
|
163
|
+
marginLeft: "-2px"
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
export const tooltipBase = {
|
|
167
|
+
"@global": {
|
|
168
|
+
".rc-slider-tooltip-zoom-down-enter": {
|
|
169
|
+
display: "block !important",
|
|
170
|
+
animationDuration: "0.3s",
|
|
171
|
+
animationFillMode: "both",
|
|
172
|
+
animationPlayState: "paused",
|
|
173
|
+
transform: "scale(0, 0)",
|
|
174
|
+
animationTimingFunction: "cubic-bezier(0.23, 1, 0.32, 1)"
|
|
175
|
+
},
|
|
176
|
+
".rc-slider-tooltip-zoom-down-appear": {
|
|
177
|
+
display: "block !important",
|
|
178
|
+
animationDuration: "0.3s",
|
|
179
|
+
animationFillMode: "both",
|
|
180
|
+
animationPlayState: "paused"
|
|
181
|
+
},
|
|
182
|
+
".rc-slider-tooltip-zoom-down-leave": {
|
|
183
|
+
display: "block !important",
|
|
184
|
+
animationDuration: "0.3s",
|
|
185
|
+
animationFillMode: "both",
|
|
186
|
+
animationPlayState: "paused",
|
|
187
|
+
animationTimingFunction: "cubic-bezier(0.755, 0.05, 0.855, 0.06)"
|
|
188
|
+
},
|
|
189
|
+
".rc-slider-tooltip-zoom-down-enter.rc-slider-tooltip-zoom-down-enter-active": {
|
|
190
|
+
animationName: "rcSliderTooltipZoomDownIn",
|
|
191
|
+
animationPlayState: "running"
|
|
192
|
+
},
|
|
193
|
+
".rc-slider-tooltip-zoom-down-appear.rc-slider-tooltip-zoom-down-appear-active": {
|
|
194
|
+
animationName: "rcSliderTooltipZoomDownIn",
|
|
195
|
+
animationPlayState: "running"
|
|
196
|
+
},
|
|
197
|
+
".rc-slider-tooltip-zoom-down-leave.rc-slider-tooltip-zoom-down-leave-active": {
|
|
198
|
+
animationName: "rcSliderTooltipZoomDownOut",
|
|
199
|
+
animationPlayState: "running"
|
|
200
|
+
},
|
|
201
|
+
" .rc-slider-tooltip-zoom-down-appear": {
|
|
202
|
+
transform: "scale(0, 0)",
|
|
203
|
+
animationTimingFunction: "cubic-bezier(0.23, 1, 0.32, 1)"
|
|
204
|
+
},
|
|
205
|
+
".rc-slider-tooltip": {
|
|
206
|
+
position: "absolute",
|
|
207
|
+
top: "-9999px",
|
|
208
|
+
left: "-9999px",
|
|
209
|
+
visibility: "visible",
|
|
210
|
+
boxSizing: "border-box",
|
|
211
|
+
"-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)"
|
|
212
|
+
},
|
|
213
|
+
".rc-slider-tooltip *": {
|
|
214
|
+
boxSizing: "border-box",
|
|
215
|
+
"-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)"
|
|
216
|
+
},
|
|
217
|
+
".rc-slider-tooltip-hidden": {
|
|
218
|
+
display: "none"
|
|
219
|
+
},
|
|
220
|
+
".rc-slider-tooltip-placement-top": {
|
|
221
|
+
padding: "4px 0 8px 0"
|
|
222
|
+
},
|
|
223
|
+
".rc-slider-tooltip-inner": {
|
|
224
|
+
minWidth: "24px",
|
|
225
|
+
height: "24px",
|
|
226
|
+
padding: "6px 2px",
|
|
227
|
+
color: "#fff",
|
|
228
|
+
fontSize: "12px",
|
|
229
|
+
lineHeight: 1,
|
|
230
|
+
textAlign: "center",
|
|
231
|
+
textDecoration: "none",
|
|
232
|
+
backgroundColor: "#6c6c6c",
|
|
233
|
+
borderRadius: "6px",
|
|
234
|
+
boxShadow: "0 0 4px #d9d9d9"
|
|
235
|
+
},
|
|
236
|
+
".rc-slider-tooltip-arrow": {
|
|
237
|
+
position: "absolute",
|
|
238
|
+
width: 0,
|
|
239
|
+
height: 0,
|
|
240
|
+
borderColor: "transparent",
|
|
241
|
+
borderStyle: "solid"
|
|
242
|
+
},
|
|
243
|
+
".rc-slider-tooltip-placement-top .rc-slider-tooltip-arrow": {
|
|
244
|
+
bottom: "4px",
|
|
245
|
+
left: "50%",
|
|
246
|
+
marginLeft: "-4px",
|
|
247
|
+
borderWidth: "4px 4px 0",
|
|
248
|
+
borderTopColor: "#6c6c6c"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","names":["sliderBase","position","width","height","padding","borderRadius","touchAction","boxSizing","backgroundColor","marginTop","border","cursor","opacity","borderColor","boxShadow","outline","top","left","fontSize","display","color","textAlign","verticalAlign","background","pointerEvents","bottom","marginRight","marginLeft","tooltipBase","animationDuration","animationFillMode","animationPlayState","transform","animationTimingFunction","animationName","visibility","minWidth","lineHeight","textDecoration","borderStyle","borderWidth","borderTopColor"],"sources":["../../../src/Slider/base.js"],"sourcesContent":["export const sliderBase = {\n \"& .rc-slider\": {\n position: \"relative\",\n width: \"100%\",\n height: \"14px\",\n padding: \" 5px 0\",\n borderRadius: \"6px\",\n touchAction: \"none\",\n boxSizing: \"border-box\",\n \"-webkit-tap-highlight-color\": \"rgba(0, 0, 0, 0)\",\n },\n \"& .rc-slider *\": {\n boxSizing: \"border-box\",\n \"-webkit-tap-highlight-color\": \"rgba(0, 0, 0, 0)\",\n },\n \"& .rc-slider-rail\": {\n position: \"absolute\",\n width: \"100%\",\n height: \"4px\",\n backgroundColor: \"#e9e9e9\",\n borderRadius: \"6px\",\n },\n \"& .rc-slider-track\": {\n position: \"absolute\",\n height: \"4px\",\n backgroundColor: \"#abe2fb\",\n borderRadius: \"6px\",\n },\n \"& .rc-slider-handle\": {\n position: \"absolute\",\n width: \"14px\",\n height: \"14px\",\n marginTop: \"-5px\",\n backgroundColor: \"#fff\",\n border: \"solid 2px #96dbfa\",\n borderRadius: \"50%\",\n // cursor: \"pointer\",\n // cursor: \"-webkit-grab\",\n cursor: \"grab\",\n opacity: 0.8,\n touchAction: \"pan-x\",\n },\n \"& .rc-slider-handle-dragging.rc-slider-handle-dragging.rc-slider-handle-dragging\": {\n borderColor: \"#57c5f7\",\n boxShadow: \"0 0 0 5px #96dbfa\",\n },\n \"& .rc-slider-handle:focus\": {\n outline: \"none\",\n boxShadow: \"none\",\n },\n \"& .rc-slider-handle:focus-visible\": {\n borderColor: \"#2db7f5\",\n boxShadow: \"0 0 0 3px #96dbfa\",\n },\n \"& .rc-slider-handle-click-focused:focus\": {\n borderColor: \"#96dbfa\",\n boxShadow: \"unset\",\n },\n \"& .rc-slider-handle:hover\": {\n borderColor: \"#57c5f7\",\n },\n \"& .rc-slider-handle:active\": {\n borderColor: \"#57c5f7\",\n boxShadow: \"0 0 5px #57c5f7\",\n // cursor: \"-webkit-grabbing\",\n cursor: \"grabbing\",\n },\n \"& .rc-slider-mark\": {\n position: \"absolute\",\n top: \"18px\",\n left: 0,\n width: \"100%\",\n fontSize: \"12px\",\n },\n \"& .rc-slider-mark-text\": {\n position: \"absolute\",\n display: \"inline-block\",\n color: \"#999\",\n textAlign: \"center\",\n verticalAlign: \"middle\",\n cursor: \"pointer\",\n },\n \"& .rc-slider-mark-text-active\": {\n color: \"#666\",\n },\n \"& .rc-slider-step\": {\n position: \"absolute\",\n width: \"100%\",\n height: \"4px\",\n background: \"transparent\",\n pointerEvents: \"none\",\n },\n \"& .rc-slider-dot\": {\n position: \"absolute\",\n bottom: \"-2px\",\n width: \"8px\",\n height: \"8px\",\n verticalAlign: \"middle\",\n backgroundColor: \"#fff\",\n border: \"2px solid #e9e9e9\",\n borderRadius: \"50%\",\n cursor: \"pointer\",\n },\n \"& .rc-slider-dot-active\": {\n borderColor: \"#96dbfa\",\n },\n \"& .rc-slider-dot-reverse\": {\n marginRight: \"-4px\",\n },\n \"& .rc-slider-disabled\": {\n backgroundColor: \"#e9e9e9\",\n },\n \"& .rc-slider-disabled .rc-slider-track\": {\n backgroundColor: \"#ccc\",\n },\n \"& .rc-slider-disabled .rc-slider-handle\": {\n backgroundColor: \"#fff\",\n borderColor: \"#ccc\",\n boxShadow: \"none\",\n cursor: \"not-allowed\",\n },\n \"&.rc-slider-disabled .rc-slider-dot\": {\n backgroundColor: \"#fff\",\n borderColor: \"#ccc\",\n boxShadow: \"none\",\n cursor: \"not-allowed\",\n },\n \"& .rc-slider-disabled .rc-slider-mark-text\": {\n cursor: \"not-allowed !important\",\n },\n \"& .rc-slider-disabled .rc-slider-dot\": {\n cursor: \"not-allowed !important\",\n },\n \"& .rc-slider-vertical\": {\n width: \"14px\",\n height: \"100%\",\n padding: \"0 5px\",\n },\n \"& .rc-slider-vertical .rc-slider-rail\": {\n width: \"4px\",\n height: \"100%\",\n },\n \"& .rc-slider-vertical .rc-slider-track\": {\n bottom: 0,\n left: \"5px\",\n width: \"4px\",\n },\n \"& .rc-slider-vertical .rc-slider-handle\": {\n marginTop: 0,\n marginLeft: \"-5px\",\n touchAction: \"pan-y\",\n },\n \"& .rc-slider-vertical .rc-slider-mark\": {\n top: 0,\n left: \"18px\",\n height: \"100%\",\n },\n \"& .rc-slider-vertical .rc-slider-step\": {\n width: \"4px\",\n height: \"100%\",\n },\n \"& .rc-slider-vertical .rc-slider-dot\": {\n marginLeft: \"-2px\",\n },\n};\n\nexport const tooltipBase = {\n \"@global\": {\n \".rc-slider-tooltip-zoom-down-enter\": {\n display: \"block !important\",\n animationDuration: \"0.3s\",\n animationFillMode: \"both\",\n animationPlayState: \"paused\",\n transform: \"scale(0, 0)\",\n animationTimingFunction: \"cubic-bezier(0.23, 1, 0.32, 1)\",\n },\n \".rc-slider-tooltip-zoom-down-appear\": {\n display: \"block !important\",\n animationDuration: \"0.3s\",\n animationFillMode: \"both\",\n animationPlayState: \"paused\",\n },\n \".rc-slider-tooltip-zoom-down-leave\": {\n display: \"block !important\",\n animationDuration: \"0.3s\",\n animationFillMode: \"both\",\n animationPlayState: \"paused\",\n animationTimingFunction: \"cubic-bezier(0.755, 0.05, 0.855, 0.06)\",\n },\n \".rc-slider-tooltip-zoom-down-enter.rc-slider-tooltip-zoom-down-enter-active\": {\n animationName: \"rcSliderTooltipZoomDownIn\",\n animationPlayState: \"running\",\n },\n \".rc-slider-tooltip-zoom-down-appear.rc-slider-tooltip-zoom-down-appear-active\": {\n animationName: \"rcSliderTooltipZoomDownIn\",\n animationPlayState: \"running\",\n },\n \".rc-slider-tooltip-zoom-down-leave.rc-slider-tooltip-zoom-down-leave-active\": {\n animationName: \"rcSliderTooltipZoomDownOut\",\n animationPlayState: \"running\",\n },\n \" .rc-slider-tooltip-zoom-down-appear\": {\n transform: \"scale(0, 0)\",\n animationTimingFunction: \"cubic-bezier(0.23, 1, 0.32, 1)\",\n },\n \".rc-slider-tooltip\": {\n position: \"absolute\",\n top: \"-9999px\",\n left: \"-9999px\",\n visibility: \"visible\",\n boxSizing: \"border-box\",\n \"-webkit-tap-highlight-color\": \"rgba(0, 0, 0, 0)\",\n },\n \".rc-slider-tooltip *\": {\n boxSizing: \"border-box\",\n \"-webkit-tap-highlight-color\": \"rgba(0, 0, 0, 0)\",\n },\n \".rc-slider-tooltip-hidden\": {\n display: \"none\",\n },\n \".rc-slider-tooltip-placement-top\": {\n padding: \"4px 0 8px 0\",\n },\n \".rc-slider-tooltip-inner\": {\n minWidth: \"24px\",\n height: \"24px\",\n padding: \"6px 2px\",\n color: \"#fff\",\n fontSize: \"12px\",\n lineHeight: 1,\n textAlign: \"center\",\n textDecoration: \"none\",\n backgroundColor: \"#6c6c6c\",\n borderRadius: \"6px\",\n boxShadow: \"0 0 4px #d9d9d9\",\n },\n \".rc-slider-tooltip-arrow\": {\n position: \"absolute\",\n width: 0,\n height: 0,\n borderColor: \"transparent\",\n borderStyle: \"solid\",\n },\n \".rc-slider-tooltip-placement-top .rc-slider-tooltip-arrow\": {\n bottom: \"4px\",\n left: \"50%\",\n marginLeft: \"-4px\",\n borderWidth: \"4px 4px 0\",\n borderTopColor: \"#6c6c6c\",\n },\n },\n};\n"],"mappings":"AAAA,OAAO,MAAMA,UAAU,GAAG;EACxB,gBAAgB;IACdC,QAAQ,EAAE,UADI;IAEdC,KAAK,EAAE,MAFO;IAGdC,MAAM,EAAE,MAHM;IAIdC,OAAO,EAAE,QAJK;IAKdC,YAAY,EAAE,KALA;IAMdC,WAAW,EAAE,MANC;IAOdC,SAAS,EAAE,YAPG;IAQd,+BAA+B;EARjB,CADQ;EAWxB,kBAAkB;IAChBA,SAAS,EAAE,YADK;IAEhB,+BAA+B;EAFf,CAXM;EAexB,qBAAqB;IACnBN,QAAQ,EAAE,UADS;IAEnBC,KAAK,EAAE,M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.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { sliderBase, tooltipBase } from "./base";
|
|
8
|
+
|
|
9
|
+
const styles = theme => _objectSpread(_objectSpread({}, tooltipBase), {}, {
|
|
10
|
+
sliderBase,
|
|
8
11
|
root: {
|
|
9
12
|
"& .rc-slider-handle": {
|
|
10
13
|
cursor: "pointer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","cursor","marginTop","zIndex","dot","position","bottom","marginLeft","width","height","border","borderRadius","backgroundColor","hv","palette","atmosphere","atmo4","verticalAlign","rail","knobInner","borderColor","boxShadow","accent","acce1","knobOuter","top","left","knobHidden","display","knobHiddenLast","touchAction","track","mark","typography","vizText","fontFamily","sliderTooltip","background","atmo1","maxWidth","padding","spacing","sm","normalText","visibility"],"sources":["../../../src/Slider/styles.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"styles.js","names":["sliderBase","tooltipBase","styles","theme","root","cursor","marginTop","zIndex","dot","position","bottom","marginLeft","width","height","border","borderRadius","backgroundColor","hv","palette","atmosphere","atmo4","verticalAlign","rail","knobInner","borderColor","boxShadow","accent","acce1","knobOuter","top","left","knobHidden","display","knobHiddenLast","touchAction","track","mark","typography","vizText","fontFamily","sliderTooltip","background","atmo1","maxWidth","padding","spacing","sm","normalText","visibility"],"sources":["../../../src/Slider/styles.js"],"sourcesContent":["import { sliderBase, tooltipBase } from \"./base\";\n\nconst styles = (theme) => ({\n ...tooltipBase,\n sliderBase,\n root: {\n \"& .rc-slider-handle\": {\n cursor: \"pointer\",\n marginTop: \"-8px\",\n \"&:active\": {\n cursor: \"grab\",\n },\n },\n zIndex: 0,\n },\n dot: {\n position: \"absolute\",\n bottom: \"-1px\",\n marginLeft: \"0px\",\n width: \"1px\",\n height: \"4px\",\n border: \"none\",\n borderRadius: \"0%\",\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n cursor: \"pointer\",\n verticalAlign: \"middle\",\n zIndex: \"-3\",\n },\n rail: {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n height: \"1px\",\n zIndex: \"-3\",\n },\n knobInner: {\n borderColor: \"transparent\",\n boxShadow: \"none\",\n backgroundColor: theme.hv.palette.accent.acce1,\n width: \"16px\",\n height: \"16px\",\n },\n knobOuter: {\n position: \"relative\",\n borderColor: \"transparent\",\n borderRadius: \"50%\",\n boxShadow: \"none\",\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n width: \"32px\",\n height: \"32px\",\n top: \"-80%\",\n left: \"-80%\",\n zIndex: \"-1\",\n },\n knobHidden: {\n display: \"none\",\n },\n knobHiddenLast: {\n borderColor: \"transparent\",\n height: \"3px\",\n width: \"2px\",\n marginLeft: \"-1px\",\n border: \"none\",\n borderRadius: \"0\",\n marginTop: \"0px\",\n left: \"100%\",\n touchAction: \"none\",\n cursor: \"default\",\n },\n track: {\n backgroundColor: theme.hv.palette.accent.acce1,\n height: \"3px\",\n zIndex: \"-1\",\n marginTop: \"-1px\",\n },\n mark: {\n ...theme.hv.typography.vizText,\n fontFamily: theme.hv.typography.fontFamily,\n top: \"-2px\",\n },\n sliderTooltip: {\n \"& .rc-slider-tooltip-inner\": {\n background: theme.hv.palette.atmosphere.atmo1,\n borderRadius: 0,\n maxWidth: \"532px\",\n height: \"100%\",\n padding: `${theme.hv.spacing.sm}px`,\n ...theme.hv.typography.normalText,\n fontFamily: theme.hv.typography.fontFamily,\n boxShadow: \"none\",\n },\n \"& .rc-slider-tooltip-arrow\": {\n visibility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