@hitachivantara/uikit-react-core 3.66.1-next.4 → 3.67.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/dist/Barchart/Barchart.d.ts +14 -0
- package/dist/Barchart/Barchart.js +239 -0
- package/dist/Barchart/Barchart.js.map +1 -0
- package/dist/Barchart/barchartPlotlyOverrides.js +59 -0
- package/dist/Barchart/barchartPlotlyOverrides.js.map +1 -0
- package/dist/Barchart/index.d.ts +2 -0
- package/dist/Barchart/index.js +16 -0
- package/dist/Barchart/index.js.map +1 -0
- package/dist/Barchart/styles.js +10 -0
- package/dist/Barchart/styles.js.map +1 -0
- package/dist/BaseInput/BaseInput.js +6 -1
- package/dist/BaseInput/BaseInput.js.map +1 -1
- package/dist/BaseInput/styles.js +3 -0
- package/dist/BaseInput/styles.js.map +1 -1
- package/dist/Chart/Chart.d.ts +25 -0
- package/dist/Chart/Chart.js +215 -0
- package/dist/Chart/Chart.js.map +1 -0
- package/dist/Chart/Plot/Plot.d.ts +43 -0
- package/dist/Chart/Plot/Plot.js +131 -0
- package/dist/Chart/Plot/Plot.js.map +1 -0
- package/dist/Chart/Plot/index.d.ts +2 -0
- package/dist/Chart/Plot/index.js +16 -0
- package/dist/Chart/Plot/index.js.map +1 -0
- package/dist/Chart/Plot/styles.js +10 -0
- package/dist/Chart/Plot/styles.js.map +1 -0
- package/dist/Chart/Tooltip/MultiTooltip/MultiTooltip.js +162 -0
- package/dist/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -0
- package/dist/Chart/Tooltip/MultiTooltip/index.js +16 -0
- package/dist/Chart/Tooltip/MultiTooltip/index.js.map +1 -0
- package/dist/Chart/Tooltip/MultiTooltip/styles.js +51 -0
- package/dist/Chart/Tooltip/MultiTooltip/styles.js.map +1 -0
- package/dist/Chart/Tooltip/SingleTooltip/SingleTooltip.js +87 -0
- package/dist/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -0
- package/dist/Chart/Tooltip/SingleTooltip/index.js +16 -0
- package/dist/Chart/Tooltip/SingleTooltip/index.js.map +1 -0
- package/dist/Chart/Tooltip/SingleTooltip/styles.js +26 -0
- package/dist/Chart/Tooltip/SingleTooltip/styles.js.map +1 -0
- package/dist/Chart/Tooltip/Tooltip.js +165 -0
- package/dist/Chart/Tooltip/Tooltip.js.map +1 -0
- package/dist/Chart/Tooltip/index.js +16 -0
- package/dist/Chart/Tooltip/index.js.map +1 -0
- package/dist/Chart/Tooltip/styles.js +16 -0
- package/dist/Chart/Tooltip/styles.js.map +1 -0
- package/dist/Chart/chartPlotlyOverrides.js +169 -0
- package/dist/Chart/chartPlotlyOverrides.js.map +1 -0
- package/dist/Chart/index.d.ts +5 -0
- package/dist/Chart/index.js +16 -0
- package/dist/Chart/index.js.map +1 -0
- package/dist/Chart/styles.js +49 -0
- package/dist/Chart/styles.js.map +1 -0
- package/dist/Donutchart/Donutchart.d.ts +10 -0
- package/dist/Donutchart/Donutchart.js +124 -0
- package/dist/Donutchart/Donutchart.js.map +1 -0
- package/dist/Donutchart/donutchartPlotlyOverrides.js +56 -0
- package/dist/Donutchart/donutchartPlotlyOverrides.js.map +1 -0
- package/dist/Donutchart/index.d.ts +2 -0
- package/dist/Donutchart/index.js +16 -0
- package/dist/Donutchart/index.js.map +1 -0
- package/dist/Donutchart/styles.js +10 -0
- package/dist/Donutchart/styles.js.map +1 -0
- package/dist/FilterGroup/FilterGroup.d.ts +3 -3
- package/dist/Forms/FormElement/index.d.ts +4 -0
- package/dist/Forms/FormElement/index.js +14 -0
- package/dist/Forms/FormElement/index.js.map +1 -1
- package/dist/Linechart/Linechart.d.ts +14 -0
- package/dist/Linechart/Linechart.js +130 -0
- package/dist/Linechart/Linechart.js.map +1 -0
- package/dist/Linechart/index.d.ts +2 -0
- package/dist/Linechart/index.js +16 -0
- package/dist/Linechart/index.js.map +1 -0
- package/dist/Linechart/lineChartPlotlyOverrides.js +79 -0
- package/dist/Linechart/lineChartPlotlyOverrides.js.map +1 -0
- package/dist/Linechart/styles.js +10 -0
- package/dist/Linechart/styles.js.map +1 -0
- package/dist/Provider/Provider.js +3 -14
- package/dist/Provider/Provider.js.map +1 -1
- package/dist/Slider/Slider.d.ts +185 -0
- package/dist/Slider/Slider.js +803 -0
- package/dist/Slider/Slider.js.map +1 -0
- package/dist/Slider/SliderInput/SliderInput.js +194 -0
- package/dist/Slider/SliderInput/SliderInput.js.map +1 -0
- package/dist/Slider/SliderInput/index.d.ts +1 -0
- package/dist/Slider/SliderInput/index.js +16 -0
- package/dist/Slider/SliderInput/index.js.map +1 -0
- package/dist/Slider/SliderInput/styles.js +24 -0
- package/dist/Slider/SliderInput/styles.js.map +1 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/index.js +16 -0
- package/dist/Slider/index.js.map +1 -0
- package/dist/Slider/styles.js +238 -0
- package/dist/Slider/styles.js.map +1 -0
- package/dist/Slider/utils.js +413 -0
- package/dist/Slider/utils.js.map +1 -0
- package/dist/Stack/Stack.js +14 -14
- package/dist/Stack/Stack.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy/Barchart/Barchart.d.ts +14 -0
- package/dist/legacy/Barchart/Barchart.js +195 -0
- package/dist/legacy/Barchart/Barchart.js.map +1 -0
- package/dist/legacy/Barchart/barchartPlotlyOverrides.js +43 -0
- package/dist/legacy/Barchart/barchartPlotlyOverrides.js.map +1 -0
- package/dist/legacy/Barchart/index.d.ts +2 -0
- package/dist/legacy/Barchart/index.js +2 -0
- package/dist/legacy/Barchart/index.js.map +1 -0
- package/dist/legacy/Barchart/styles.js +3 -0
- package/dist/legacy/Barchart/styles.js.map +1 -0
- package/dist/legacy/BaseInput/BaseInput.js +6 -1
- package/dist/legacy/BaseInput/BaseInput.js.map +1 -1
- package/dist/legacy/BaseInput/styles.js +3 -0
- package/dist/legacy/BaseInput/styles.js.map +1 -1
- package/dist/legacy/Chart/Chart.d.ts +25 -0
- package/dist/legacy/Chart/Chart.js +174 -0
- package/dist/legacy/Chart/Chart.js.map +1 -0
- package/dist/legacy/Chart/Plot/Plot.d.ts +43 -0
- package/dist/legacy/Chart/Plot/Plot.js +93 -0
- package/dist/legacy/Chart/Plot/Plot.js.map +1 -0
- package/dist/legacy/Chart/Plot/index.d.ts +2 -0
- package/dist/legacy/Chart/Plot/index.js +2 -0
- package/dist/legacy/Chart/Plot/index.js.map +1 -0
- package/dist/legacy/Chart/Plot/styles.js +3 -0
- package/dist/legacy/Chart/Plot/styles.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/MultiTooltip/MultiTooltip.js +130 -0
- package/dist/legacy/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/MultiTooltip/index.js +2 -0
- package/dist/legacy/Chart/Tooltip/MultiTooltip/index.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/MultiTooltip/styles.js +43 -0
- package/dist/legacy/Chart/Tooltip/MultiTooltip/styles.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/SingleTooltip/SingleTooltip.js +54 -0
- package/dist/legacy/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/SingleTooltip/index.js +2 -0
- package/dist/legacy/Chart/Tooltip/SingleTooltip/index.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/SingleTooltip/styles.js +18 -0
- package/dist/legacy/Chart/Tooltip/SingleTooltip/styles.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/Tooltip.js +128 -0
- package/dist/legacy/Chart/Tooltip/Tooltip.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/index.js +2 -0
- package/dist/legacy/Chart/Tooltip/index.js.map +1 -0
- package/dist/legacy/Chart/Tooltip/styles.js +9 -0
- package/dist/legacy/Chart/Tooltip/styles.js.map +1 -0
- package/dist/legacy/Chart/chartPlotlyOverrides.js +147 -0
- package/dist/legacy/Chart/chartPlotlyOverrides.js.map +1 -0
- package/dist/legacy/Chart/index.d.ts +5 -0
- package/dist/legacy/Chart/index.js +2 -0
- package/dist/legacy/Chart/index.js.map +1 -0
- package/dist/legacy/Chart/styles.js +32 -0
- package/dist/legacy/Chart/styles.js.map +1 -0
- package/dist/legacy/Donutchart/Donutchart.d.ts +10 -0
- package/dist/legacy/Donutchart/Donutchart.js +86 -0
- package/dist/legacy/Donutchart/Donutchart.js.map +1 -0
- package/dist/legacy/Donutchart/donutchartPlotlyOverrides.js +40 -0
- package/dist/legacy/Donutchart/donutchartPlotlyOverrides.js.map +1 -0
- package/dist/legacy/Donutchart/index.d.ts +2 -0
- package/dist/legacy/Donutchart/index.js +2 -0
- package/dist/legacy/Donutchart/index.js.map +1 -0
- package/dist/legacy/Donutchart/styles.js +3 -0
- package/dist/legacy/Donutchart/styles.js.map +1 -0
- package/dist/legacy/FilterGroup/FilterGroup.d.ts +3 -3
- package/dist/legacy/Forms/FormElement/index.d.ts +4 -0
- package/dist/legacy/Forms/FormElement/index.js +1 -0
- package/dist/legacy/Forms/FormElement/index.js.map +1 -1
- package/dist/legacy/Linechart/Linechart.d.ts +14 -0
- package/dist/legacy/Linechart/Linechart.js +92 -0
- package/dist/legacy/Linechart/Linechart.js.map +1 -0
- package/dist/legacy/Linechart/index.d.ts +2 -0
- package/dist/legacy/Linechart/index.js +2 -0
- package/dist/legacy/Linechart/index.js.map +1 -0
- package/dist/legacy/Linechart/lineChartPlotlyOverrides.js +63 -0
- package/dist/legacy/Linechart/lineChartPlotlyOverrides.js.map +1 -0
- package/dist/legacy/Linechart/styles.js +3 -0
- package/dist/legacy/Linechart/styles.js.map +1 -0
- package/dist/legacy/Provider/Provider.js +4 -15
- package/dist/legacy/Provider/Provider.js.map +1 -1
- package/dist/legacy/Slider/Slider.d.ts +185 -0
- package/dist/legacy/Slider/Slider.js +752 -0
- package/dist/legacy/Slider/Slider.js.map +1 -0
- package/dist/legacy/Slider/SliderInput/SliderInput.js +151 -0
- package/dist/legacy/Slider/SliderInput/SliderInput.js.map +1 -0
- package/dist/legacy/Slider/SliderInput/index.d.ts +1 -0
- package/dist/legacy/Slider/SliderInput/index.js +2 -0
- package/dist/legacy/Slider/SliderInput/index.js.map +1 -0
- package/dist/legacy/Slider/SliderInput/styles.js +16 -0
- package/dist/legacy/Slider/SliderInput/styles.js.map +1 -0
- package/dist/legacy/Slider/index.d.ts +2 -0
- package/dist/legacy/Slider/index.js +2 -0
- package/dist/legacy/Slider/index.js.map +1 -0
- package/dist/legacy/Slider/styles.js +221 -0
- package/dist/legacy/Slider/styles.js.map +1 -0
- package/dist/legacy/Slider/utils.js +347 -0
- package/dist/legacy/Slider/utils.js.map +1 -0
- package/dist/legacy/Stack/Stack.js +14 -14
- package/dist/legacy/Stack/Stack.js.map +1 -1
- package/dist/legacy/index.d.ts +12 -0
- package/dist/legacy/index.js +4 -0
- package/dist/legacy/index.js.map +1 -1
- package/dist/modern/Barchart/Barchart.d.ts +14 -0
- package/dist/modern/Barchart/Barchart.js +176 -0
- package/dist/modern/Barchart/Barchart.js.map +1 -0
- package/dist/modern/Barchart/barchartPlotlyOverrides.js +41 -0
- package/dist/modern/Barchart/barchartPlotlyOverrides.js.map +1 -0
- package/dist/modern/Barchart/index.d.ts +2 -0
- package/dist/modern/Barchart/index.js +2 -0
- package/dist/modern/Barchart/index.js.map +1 -0
- package/dist/modern/Barchart/styles.js +3 -0
- package/dist/modern/Barchart/styles.js.map +1 -0
- package/dist/modern/BaseInput/BaseInput.js +6 -1
- package/dist/modern/BaseInput/BaseInput.js.map +1 -1
- package/dist/modern/BaseInput/styles.js +3 -0
- package/dist/modern/BaseInput/styles.js.map +1 -1
- package/dist/modern/Chart/Chart.d.ts +25 -0
- package/dist/modern/Chart/Chart.js +158 -0
- package/dist/modern/Chart/Chart.js.map +1 -0
- package/dist/modern/Chart/Plot/Plot.d.ts +43 -0
- package/dist/modern/Chart/Plot/Plot.js +94 -0
- package/dist/modern/Chart/Plot/Plot.js.map +1 -0
- package/dist/modern/Chart/Plot/index.d.ts +2 -0
- package/dist/modern/Chart/Plot/index.js +2 -0
- package/dist/modern/Chart/Plot/index.js.map +1 -0
- package/dist/modern/Chart/Plot/styles.js +3 -0
- package/dist/modern/Chart/Plot/styles.js.map +1 -0
- package/dist/modern/Chart/Tooltip/MultiTooltip/MultiTooltip.js +123 -0
- package/dist/modern/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -0
- package/dist/modern/Chart/Tooltip/MultiTooltip/index.js +2 -0
- package/dist/modern/Chart/Tooltip/MultiTooltip/index.js.map +1 -0
- package/dist/modern/Chart/Tooltip/MultiTooltip/styles.js +41 -0
- package/dist/modern/Chart/Tooltip/MultiTooltip/styles.js.map +1 -0
- package/dist/modern/Chart/Tooltip/SingleTooltip/SingleTooltip.js +51 -0
- package/dist/modern/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -0
- package/dist/modern/Chart/Tooltip/SingleTooltip/index.js +2 -0
- package/dist/modern/Chart/Tooltip/SingleTooltip/index.js.map +1 -0
- package/dist/modern/Chart/Tooltip/SingleTooltip/styles.js +16 -0
- package/dist/modern/Chart/Tooltip/SingleTooltip/styles.js.map +1 -0
- package/dist/modern/Chart/Tooltip/Tooltip.js +125 -0
- package/dist/modern/Chart/Tooltip/Tooltip.js.map +1 -0
- package/dist/modern/Chart/Tooltip/index.js +2 -0
- package/dist/modern/Chart/Tooltip/index.js.map +1 -0
- package/dist/modern/Chart/Tooltip/styles.js +9 -0
- package/dist/modern/Chart/Tooltip/styles.js.map +1 -0
- package/dist/modern/Chart/chartPlotlyOverrides.js +137 -0
- package/dist/modern/Chart/chartPlotlyOverrides.js.map +1 -0
- package/dist/modern/Chart/index.d.ts +5 -0
- package/dist/modern/Chart/index.js +2 -0
- package/dist/modern/Chart/index.js.map +1 -0
- package/dist/modern/Chart/styles.js +23 -0
- package/dist/modern/Chart/styles.js.map +1 -0
- package/dist/modern/Donutchart/Donutchart.d.ts +10 -0
- package/dist/modern/Donutchart/Donutchart.js +82 -0
- package/dist/modern/Donutchart/Donutchart.js.map +1 -0
- package/dist/modern/Donutchart/donutchartPlotlyOverrides.js +38 -0
- package/dist/modern/Donutchart/donutchartPlotlyOverrides.js.map +1 -0
- package/dist/modern/Donutchart/index.d.ts +2 -0
- package/dist/modern/Donutchart/index.js +2 -0
- package/dist/modern/Donutchart/index.js.map +1 -0
- package/dist/modern/Donutchart/styles.js +3 -0
- package/dist/modern/Donutchart/styles.js.map +1 -0
- package/dist/modern/FilterGroup/FilterGroup.d.ts +3 -3
- package/dist/modern/Forms/FormElement/index.d.ts +4 -0
- package/dist/modern/Forms/FormElement/index.js +1 -0
- package/dist/modern/Forms/FormElement/index.js.map +1 -1
- package/dist/modern/Linechart/Linechart.d.ts +14 -0
- package/dist/modern/Linechart/Linechart.js +87 -0
- package/dist/modern/Linechart/Linechart.js.map +1 -0
- package/dist/modern/Linechart/index.d.ts +2 -0
- package/dist/modern/Linechart/index.js +2 -0
- package/dist/modern/Linechart/index.js.map +1 -0
- package/dist/modern/Linechart/lineChartPlotlyOverrides.js +59 -0
- package/dist/modern/Linechart/lineChartPlotlyOverrides.js.map +1 -0
- package/dist/modern/Linechart/styles.js +3 -0
- package/dist/modern/Linechart/styles.js.map +1 -0
- package/dist/modern/Provider/Provider.js +3 -8
- package/dist/modern/Provider/Provider.js.map +1 -1
- package/dist/modern/Slider/Slider.d.ts +185 -0
- package/dist/modern/Slider/Slider.js +689 -0
- package/dist/modern/Slider/Slider.js.map +1 -0
- package/dist/modern/Slider/SliderInput/SliderInput.js +129 -0
- package/dist/modern/Slider/SliderInput/SliderInput.js.map +1 -0
- package/dist/modern/Slider/SliderInput/index.d.ts +1 -0
- package/dist/modern/Slider/SliderInput/index.js +2 -0
- package/dist/modern/Slider/SliderInput/index.js.map +1 -0
- package/dist/modern/Slider/SliderInput/styles.js +16 -0
- package/dist/modern/Slider/SliderInput/styles.js.map +1 -0
- package/dist/modern/Slider/index.d.ts +2 -0
- package/dist/modern/Slider/index.js +2 -0
- package/dist/modern/Slider/index.js.map +1 -0
- package/dist/modern/Slider/styles.js +214 -0
- package/dist/modern/Slider/styles.js.map +1 -0
- package/dist/modern/Slider/utils.js +302 -0
- package/dist/modern/Slider/utils.js.map +1 -0
- package/dist/modern/Stack/Stack.js +4 -4
- package/dist/modern/Stack/Stack.js.map +1 -1
- package/dist/modern/index.d.ts +12 -0
- package/dist/modern/index.js +4 -0
- package/dist/modern/index.js.map +1 -1
- package/package.json +9 -6
|
@@ -21,8 +21,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
});
|
|
22
22
|
exports.default = void 0;
|
|
23
23
|
|
|
24
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
25
|
-
|
|
26
24
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
25
|
|
|
28
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -107,6 +105,8 @@ var applyCustomTheme = function applyCustomTheme(InputTargetTheme, InputSourceTh
|
|
|
107
105
|
|
|
108
106
|
|
|
109
107
|
var HvProvider = function HvProvider(_ref) {
|
|
108
|
+
var _navigator$language, _navigator;
|
|
109
|
+
|
|
110
110
|
var children = _ref.children,
|
|
111
111
|
_ref$uiKitTheme = _ref.uiKitTheme,
|
|
112
112
|
uiKitTheme = _ref$uiKitTheme === void 0 ? "dawn" : _ref$uiKitTheme,
|
|
@@ -121,18 +121,7 @@ var HvProvider = function HvProvider(_ref) {
|
|
|
121
121
|
injectStylesFirst = _ref$injectStylesFirs === void 0 ? false : _ref$injectStylesFirs,
|
|
122
122
|
_ref$disableStylesGen = _ref.disableStylesGeneration,
|
|
123
123
|
disableStylesGeneration = _ref$disableStylesGen === void 0 ? false : _ref$disableStylesGen;
|
|
124
|
-
|
|
125
|
-
var _useState = (0, _react.useState)(),
|
|
126
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
127
|
-
localeSetting = _useState2[0],
|
|
128
|
-
setLocaleStting = _useState2[1];
|
|
129
|
-
|
|
130
|
-
(0, _react.useEffect)(function () {
|
|
131
|
-
var _navigator$language, _navigator;
|
|
132
|
-
|
|
133
|
-
// ssr - only runs at the rendering phase, so it won't run on the server
|
|
134
|
-
setLocaleStting(locale || ((_navigator$language = (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.language) !== null && _navigator$language !== void 0 ? _navigator$language : "en-US"));
|
|
135
|
-
}, [locale]);
|
|
124
|
+
var localeSetting = locale || ((_navigator$language = (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.language) !== null && _navigator$language !== void 0 ? _navigator$language : "en-US");
|
|
136
125
|
var rawUiKitTheme = (0, _theme.getTheme)(uiKitTheme);
|
|
137
126
|
var customTheme = applyCustomTheme((0, _theme.themeBuilder)(rawUiKitTheme), theme);
|
|
138
127
|
var generateClassName = generateClassNameProp || (0, _theme.createGenerateClassName)(generateClassNameOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","names":["applyCustomTheme","InputTargetTheme","InputSourceTheme","muiDefaultTheme","targetTheme","sourceTheme","deleteDifference","diff","observableDiff","difference","partialCustomTheme","path","rhs","kind","HvProvider","children","uiKitTheme","theme","changeTheme","locale","generateClassNameProp","generateClassName","generateClassNameOptions","injectStylesFirst","disableStylesGeneration","localeSetting","
|
|
1
|
+
{"version":3,"file":"Provider.js","names":["applyCustomTheme","InputTargetTheme","InputSourceTheme","muiDefaultTheme","targetTheme","sourceTheme","deleteDifference","diff","observableDiff","difference","partialCustomTheme","path","rhs","kind","HvProvider","children","uiKitTheme","theme","changeTheme","locale","generateClassNameProp","generateClassName","generateClassNameOptions","injectStylesFirst","disableStylesGeneration","localeSetting","navigator","language","rawUiKitTheme","customTheme","pConfig","propTypes","PropTypes","node","isRequired","oneOf","instanceOf","Object","func","string","shape","disableGlobal","bool","productionPrefix","seed"],"sources":["../../src/Provider/Provider.js"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport set from \"lodash/set\";\nimport merge from \"lodash/merge\";\nimport isEmpty from \"lodash/isEmpty\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport diff from \"deep-diff\";\n\nimport \"focus-within-polyfill\";\nimport \"focus-visible\";\n\nimport {\n ThemeProvider as MuiThemeProvider,\n StylesProvider as MuiStylesProvider,\n} from \"@material-ui/core\";\nimport { createTheme } from \"@material-ui/core/styles\";\n\nimport { themeBuilder, createGenerateClassName, CssBaseline, getTheme } from \"../theme\";\n\nimport ConfigContext from \"./context\";\n\n/**\n * Augments the target theme with the differences found in the source theme.\n *\n * @param {Object} InputTargetTheme - A material UI Theme to be changed.\n * @param {Object} InputSourceTheme - A material UI Theme to apply on top.\n * @returns {Object} - A new modified material UI theme.\n */\nconst applyCustomTheme = (InputTargetTheme, InputSourceTheme) => {\n const muiDefaultTheme = createTheme();\n const targetTheme = cloneDeep(InputTargetTheme);\n const sourceTheme = cloneDeep(InputSourceTheme);\n const deleteDifference = \"D\";\n if (!isEmpty(targetTheme) && !isEmpty(sourceTheme)) {\n diff.observableDiff(muiDefaultTheme, sourceTheme, (difference) => {\n const partialCustomTheme = set({}, difference.path, difference.rhs);\n if (difference.kind !== deleteDifference) {\n // Do not include the differences of type \"delete\"\n merge(targetTheme, partialCustomTheme);\n }\n });\n return targetTheme;\n }\n return targetTheme;\n};\n\n/**\n * This component makes cross-component properties, like the active `theme` and `locale`,\n * available down the React tree thanks to React context.\n *\n * This component should preferably be used at **the root of your component tree** and\n * be unique in the App in most cases.\n *\n * ```jsx\n * <HvProvider>\n * <MyApp />\n * <HvProvider/>\n * ```\n *\n * If several `HvProvider`'s are used, either nested or in paralel, the `generateClassNameOptions`\n * must be tweaked to avoid CSS classnames colision. Or a custom JSS's class name generator can\n * be provided via the `generateClassName` property.\n *\n * **UI Kit components will not work at all if the `HvProvider` is not configured correctly**,\n * as they will not be able to access the properties of the active theme..\n *\n */\nconst HvProvider = ({\n children,\n\n uiKitTheme = \"dawn\",\n theme = null,\n changeTheme = () => {},\n\n locale,\n\n generateClassName: generateClassNameProp,\n generateClassNameOptions,\n injectStylesFirst = false,\n disableStylesGeneration = false,\n}) => {\n const localeSetting = locale || (navigator?.language ?? \"en-US\");\n\n const rawUiKitTheme = getTheme(uiKitTheme);\n const customTheme = applyCustomTheme(themeBuilder(rawUiKitTheme), theme);\n\n const generateClassName =\n generateClassNameProp || createGenerateClassName(generateClassNameOptions);\n\n const pConfig = useMemo(\n () => ({ changeTheme, locale: localeSetting }),\n [changeTheme, localeSetting]\n );\n\n return (\n <MuiStylesProvider\n generateClassName={generateClassName}\n injectFirst={injectStylesFirst}\n disableGeneration={disableStylesGeneration}\n >\n <MuiThemeProvider theme={customTheme}>\n <CssBaseline />\n <ConfigContext.Provider value={pConfig}>{children}</ConfigContext.Provider>\n </MuiThemeProvider>\n </MuiStylesProvider>\n );\n};\n\nHvProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node.isRequired,\n\n /**\n * The Design System base theme in use. Defaults to `\"dawn\"`.\n */\n uiKitTheme: PropTypes.oneOf([\"dawn\", \"wicked\"]),\n /**\n * The UI Kit theme object to be applied on top of the base theme.\n */\n theme: PropTypes.instanceOf(Object),\n /**\n * Function stored in the provider's context to allow runtime switching of the active theme.\n * The implementation is up to each App.\n */\n changeTheme: PropTypes.func,\n\n /**\n * The locale to be used.\n * Defaults to the browser's configured locale or \"en-US\" if not available.\n */\n locale: PropTypes.string,\n\n /**\n * Custom JSS's class name generator.\n */\n generateClassName: PropTypes.func,\n /**\n * Built-in JSS's class name generator options.\n * Ignored if a custom `generateClassName` is provided.\n *\n * `disableGlobal`: Disable the generation of deterministic class names. Defaults to `false`.\n *\n * `productionPrefix`: The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n *\n * `seed`: The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n generateClassNameOptions: PropTypes.shape({\n /**\n * Disable the generation of deterministic class names. Defaults to `false`.\n */\n disableGlobal: PropTypes.bool,\n /**\n * The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n */\n productionPrefix: PropTypes.string,\n /**\n * The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n seed: PropTypes.string,\n }),\n /**\n * Injects the generated stylesheets at the top of the `<head>` element of the page.\n * This can ease the override of UI Kit components styles.\n *\n * By default, the styles are injected last in the `<head>` element of the page.\n */\n injectStylesFirst: PropTypes.bool,\n /**\n * Disables the generation of the styles.\n */\n disableStylesGeneration: PropTypes.bool,\n};\n\nexport default HvProvider;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StandardProps } from "@material-ui/core";
|
|
3
|
+
import { SliderProps, RangeProps } from "rc-slider";
|
|
4
|
+
import { HvFormStatus } from "../Forms/FormElement";
|
|
5
|
+
import { HvInputProps } from "..";
|
|
6
|
+
|
|
7
|
+
export interface KnobProperty {
|
|
8
|
+
color?: string;
|
|
9
|
+
defaultValue?: number;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
fixed?: boolean;
|
|
12
|
+
hoverColor?: string;
|
|
13
|
+
trackColor?: string;
|
|
14
|
+
dragColor?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface MarkProperty {
|
|
18
|
+
position?: number;
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type HvSliderClassKey =
|
|
23
|
+
| "root"
|
|
24
|
+
| "rootRange"
|
|
25
|
+
| "labelContainer"
|
|
26
|
+
| "label"
|
|
27
|
+
| "handleContainer"
|
|
28
|
+
| "sliderRoot"
|
|
29
|
+
| "trackDragging"
|
|
30
|
+
| "rootDisabled"
|
|
31
|
+
| "trackStandBy"
|
|
32
|
+
| "error"
|
|
33
|
+
| "handleHiddenContainer"
|
|
34
|
+
| "handleContainerDisabled"
|
|
35
|
+
| "labelIncluded"
|
|
36
|
+
| "onlyInput"
|
|
37
|
+
| "dot"
|
|
38
|
+
| "rail"
|
|
39
|
+
| "knobInner"
|
|
40
|
+
| "knobOuter"
|
|
41
|
+
| "knobHidden"
|
|
42
|
+
| "knobHiddenLast"
|
|
43
|
+
| "track"
|
|
44
|
+
| "mark"
|
|
45
|
+
| "sliderTooltip"
|
|
46
|
+
| "sliderContainer";
|
|
47
|
+
|
|
48
|
+
export interface HvSliderProps
|
|
49
|
+
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvSliderClassKey, "onChange"> {
|
|
50
|
+
/**
|
|
51
|
+
* The label of the slider element.
|
|
52
|
+
*
|
|
53
|
+
* The form element must be labeled for accessibility reasons.
|
|
54
|
+
* If not provided, an aria-label or aria-labelledby must be provided instead.
|
|
55
|
+
*/
|
|
56
|
+
label?: React.ReactNode;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The status of the slider element.
|
|
60
|
+
*
|
|
61
|
+
* Valid is correct, invalid is incorrect and standBy means no validations have run.
|
|
62
|
+
*
|
|
63
|
+
* When uncontrolled and unspecified it will default to "standBy" and change to either "valid"
|
|
64
|
+
* or "invalid" after any change to the state.
|
|
65
|
+
*/
|
|
66
|
+
status?: HvFormStatus;
|
|
67
|
+
/**
|
|
68
|
+
* The error message to show when `status` is "invalid".
|
|
69
|
+
*/
|
|
70
|
+
statusMessage?: React.ReactNode;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Whether the slider is disabled.
|
|
74
|
+
*/
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The object created by material to apply to the component.
|
|
79
|
+
*/
|
|
80
|
+
theme?: any;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Name of the form element.
|
|
84
|
+
*
|
|
85
|
+
* Part of a name/value pair, should be the name property of the undelying native input.
|
|
86
|
+
*/
|
|
87
|
+
name?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The values array to apply to the component
|
|
91
|
+
*/
|
|
92
|
+
values?: number[];
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The default values array to apply to the component
|
|
96
|
+
*/
|
|
97
|
+
defaultValues?: number[];
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The object used to set the knob properties,
|
|
101
|
+
* for every item in the array a new knob will be created.
|
|
102
|
+
*/
|
|
103
|
+
knobProperties?: KnobProperty[];
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The object used to set the mark properties individually.
|
|
107
|
+
*/
|
|
108
|
+
markProperties?: MarkProperty[];
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* the function executed before a change will occur in the slider.
|
|
112
|
+
*/
|
|
113
|
+
onBeforeChange?: (value: number[]) => any;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* the function executed while a change is occurring in the slider.
|
|
117
|
+
*/
|
|
118
|
+
onChange?: (value: number[]) => any;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* the function executed after a change ocurred in the slider.
|
|
122
|
+
*/
|
|
123
|
+
onAfterChange?: (value: number[]) => any;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* the separation in points between marks.
|
|
127
|
+
* example: if 10 divisions and a markstep of 2 there will be 5 marks.
|
|
128
|
+
*/
|
|
129
|
+
markStep?: number;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* how many subdivisions there are in the slider.
|
|
133
|
+
*/
|
|
134
|
+
divisionQuantity?: number;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* the value of the first point in the slider from left to right.
|
|
138
|
+
*/
|
|
139
|
+
minPointValue?: number;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* the value of the last point in the slider from left to right.
|
|
143
|
+
*/
|
|
144
|
+
maxPointValue?: number;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* the nax number of decimals if no format function is applied
|
|
148
|
+
*/
|
|
149
|
+
markDigits?: number;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* a formatting function used to add format to the marks in the track,
|
|
153
|
+
* the function receives the mark text
|
|
154
|
+
*/
|
|
155
|
+
formatMark?: (label: React.ReactNode | string) => React.ReactNode | string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* a formatting function used to add format to the tooltip in the track,
|
|
159
|
+
* the function receives the mark text
|
|
160
|
+
*/
|
|
161
|
+
formatTooltip?: (label: React.ReactNode | string) => React.ReactNode | string;
|
|
162
|
+
/**
|
|
163
|
+
* if `true` the input that controls the slider is hidden.
|
|
164
|
+
*/
|
|
165
|
+
hideInput?: boolean;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* if `true` the knobs can't have the same value, if `false` knobs can have the same value.
|
|
169
|
+
*/
|
|
170
|
+
noOverlap?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Attributes applied to the input element.
|
|
173
|
+
*/
|
|
174
|
+
inputProps?: HvInputProps[];
|
|
175
|
+
/**
|
|
176
|
+
* Attributes applied to the knob element.
|
|
177
|
+
*/
|
|
178
|
+
knobProps?: React.HTMLAttributes<HTMLDivElement>[];
|
|
179
|
+
/**
|
|
180
|
+
* Attributes applied to the input element.
|
|
181
|
+
*/
|
|
182
|
+
sliderProps?: RangeProps | SliderProps;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export default function HvSlider(props: HvSliderProps): JSX.Element | null;
|