@hitachivantara/uikit-react-core 3.67.4 → 3.67.7
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/AppSwitcher/styles.js +1 -1
- package/dist/AppSwitcher/styles.js.map +1 -1
- package/dist/BaseInput/styles.js +32 -6
- package/dist/BaseInput/styles.js.map +1 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DialogActions/styles.js +3 -1
- package/dist/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/Dialog/DialogContent/styles.js +3 -1
- package/dist/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/Dialog/DialogTitle/DialogTitle.js +3 -2
- package/dist/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/Dialog/DialogTitle/styles.js +3 -2
- package/dist/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/Dialog/styles.js +3 -1
- package/dist/Dialog/styles.js.map +1 -1
- package/dist/Forms/WarningText/WarningText.d.ts +1 -2
- package/dist/Forms/WarningText/WarningText.js +1 -6
- package/dist/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/Forms/WarningText/styles.js +0 -6
- package/dist/Forms/WarningText/styles.js.map +1 -1
- package/dist/Input/styles.js +0 -6
- package/dist/Input/styles.js.map +1 -1
- package/dist/Provider/Provider.d.ts +15 -0
- package/dist/Provider/Provider.js +34 -6
- package/dist/Provider/Provider.js.map +1 -1
- package/dist/VerticalNavigation/TreeView/TreeViewItem.js +3 -1
- package/dist/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy/AppSwitcher/styles.js +1 -1
- package/dist/legacy/AppSwitcher/styles.js.map +1 -1
- package/dist/legacy/BaseInput/styles.js +32 -6
- package/dist/legacy/BaseInput/styles.js.map +1 -1
- package/dist/legacy/Dialog/Dialog.js +3 -3
- package/dist/legacy/Dialog/Dialog.js.map +1 -1
- package/dist/legacy/Dialog/DialogActions/styles.js +3 -1
- package/dist/legacy/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/legacy/Dialog/DialogContent/styles.js +3 -1
- package/dist/legacy/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/legacy/Dialog/DialogTitle/DialogTitle.js +3 -2
- package/dist/legacy/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/legacy/Dialog/DialogTitle/styles.js +3 -2
- package/dist/legacy/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/legacy/Dialog/styles.js +3 -1
- package/dist/legacy/Dialog/styles.js.map +1 -1
- package/dist/legacy/Forms/WarningText/WarningText.d.ts +1 -2
- package/dist/legacy/Forms/WarningText/WarningText.js +1 -6
- package/dist/legacy/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/legacy/Forms/WarningText/styles.js +0 -6
- package/dist/legacy/Forms/WarningText/styles.js.map +1 -1
- package/dist/legacy/Input/styles.js +0 -6
- package/dist/legacy/Input/styles.js.map +1 -1
- package/dist/legacy/Provider/Provider.d.ts +15 -0
- package/dist/legacy/Provider/Provider.js +34 -7
- package/dist/legacy/Provider/Provider.js.map +1 -1
- package/dist/legacy/VerticalNavigation/TreeView/TreeViewItem.js +3 -1
- package/dist/legacy/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/legacy/index.js +2 -1
- package/dist/legacy/index.js.map +1 -1
- package/dist/legacy/theme/CssBaseline.d.ts +1 -0
- package/dist/legacy/theme/CssBaseline.js +11 -32
- package/dist/legacy/theme/CssBaseline.js.map +1 -1
- package/dist/legacy/theme/ScopedCssBaseline.d.ts +13 -0
- package/dist/legacy/theme/ScopedCssBaseline.js +67 -0
- package/dist/legacy/theme/ScopedCssBaseline.js.map +1 -0
- package/dist/legacy/theme/index.d.ts +2 -1
- package/dist/legacy/theme/index.js +2 -1
- package/dist/legacy/theme/index.js.map +1 -1
- package/dist/modern/AppSwitcher/styles.js +1 -1
- package/dist/modern/AppSwitcher/styles.js.map +1 -1
- package/dist/modern/BaseInput/styles.js +32 -6
- package/dist/modern/BaseInput/styles.js.map +1 -1
- package/dist/modern/Dialog/Dialog.js +3 -3
- package/dist/modern/Dialog/Dialog.js.map +1 -1
- package/dist/modern/Dialog/DialogActions/styles.js +3 -1
- package/dist/modern/Dialog/DialogActions/styles.js.map +1 -1
- package/dist/modern/Dialog/DialogContent/styles.js +3 -1
- package/dist/modern/Dialog/DialogContent/styles.js.map +1 -1
- package/dist/modern/Dialog/DialogTitle/DialogTitle.js +5 -2
- package/dist/modern/Dialog/DialogTitle/DialogTitle.js.map +1 -1
- package/dist/modern/Dialog/DialogTitle/styles.js +3 -2
- package/dist/modern/Dialog/DialogTitle/styles.js.map +1 -1
- package/dist/modern/Dialog/styles.js +3 -1
- package/dist/modern/Dialog/styles.js.map +1 -1
- package/dist/modern/Forms/WarningText/WarningText.d.ts +1 -2
- package/dist/modern/Forms/WarningText/WarningText.js +1 -6
- package/dist/modern/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/modern/Forms/WarningText/styles.js +0 -6
- package/dist/modern/Forms/WarningText/styles.js.map +1 -1
- package/dist/modern/Input/styles.js +0 -6
- package/dist/modern/Input/styles.js.map +1 -1
- package/dist/modern/Provider/Provider.d.ts +15 -0
- package/dist/modern/Provider/Provider.js +32 -7
- package/dist/modern/Provider/Provider.js.map +1 -1
- package/dist/modern/VerticalNavigation/TreeView/TreeViewItem.js +3 -1
- package/dist/modern/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/modern/index.js +2 -1
- package/dist/modern/index.js.map +1 -1
- package/dist/modern/theme/CssBaseline.d.ts +1 -0
- package/dist/modern/theme/CssBaseline.js +11 -32
- package/dist/modern/theme/CssBaseline.js.map +1 -1
- package/dist/modern/theme/ScopedCssBaseline.d.ts +13 -0
- package/dist/modern/theme/ScopedCssBaseline.js +59 -0
- package/dist/modern/theme/ScopedCssBaseline.js.map +1 -0
- package/dist/modern/theme/index.d.ts +2 -1
- package/dist/modern/theme/index.js +2 -1
- package/dist/modern/theme/index.js.map +1 -1
- package/dist/theme/CssBaseline.d.ts +1 -0
- package/dist/theme/CssBaseline.js +12 -29
- package/dist/theme/CssBaseline.js.map +1 -1
- package/dist/theme/ScopedCssBaseline.d.ts +13 -0
- package/dist/theme/ScopedCssBaseline.js +105 -0
- package/dist/theme/ScopedCssBaseline.js.map +1 -0
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.js +9 -1
- package/dist/theme/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -47,12 +47,13 @@ var _theme = require("../theme");
|
|
|
47
47
|
|
|
48
48
|
var _context = _interopRequireDefault(require("./context"));
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _HvCssBaseline;
|
|
51
51
|
|
|
52
52
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
53
53
|
|
|
54
54
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
55
55
|
|
|
56
|
+
var warnedOnce = false;
|
|
56
57
|
/**
|
|
57
58
|
* Augments the target theme with the differences found in the source theme.
|
|
58
59
|
*
|
|
@@ -60,6 +61,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
60
61
|
* @param {Object} InputSourceTheme - A material UI Theme to apply on top.
|
|
61
62
|
* @returns {Object} - A new modified material UI theme.
|
|
62
63
|
*/
|
|
64
|
+
|
|
63
65
|
var applyCustomTheme = function applyCustomTheme(InputTargetTheme, InputSourceTheme) {
|
|
64
66
|
var muiDefaultTheme = (0, _styles.createTheme)();
|
|
65
67
|
var targetTheme = (0, _cloneDeep.default)(InputTargetTheme);
|
|
@@ -94,8 +96,8 @@ var applyCustomTheme = function applyCustomTheme(InputTargetTheme, InputSourceTh
|
|
|
94
96
|
* <HvProvider/>
|
|
95
97
|
* ```
|
|
96
98
|
*
|
|
97
|
-
* If several `HvProvider`'s are used, either nested or in
|
|
98
|
-
* must be tweaked to avoid CSS classnames
|
|
99
|
+
* If several `HvProvider`'s are used, either nested or in parallel, the `generateClassNameOptions`
|
|
100
|
+
* must be tweaked to avoid CSS classnames collision. Or a custom JSS's class name generator can
|
|
99
101
|
* be provided via the `generateClassName` property.
|
|
100
102
|
*
|
|
101
103
|
* **UI Kit components will not work at all if the `HvProvider` is not configured correctly**,
|
|
@@ -120,7 +122,18 @@ var HvProvider = function HvProvider(_ref) {
|
|
|
120
122
|
_ref$injectStylesFirs = _ref.injectStylesFirst,
|
|
121
123
|
injectStylesFirst = _ref$injectStylesFirs === void 0 ? false : _ref$injectStylesFirs,
|
|
122
124
|
_ref$disableStylesGen = _ref.disableStylesGeneration,
|
|
123
|
-
disableStylesGeneration = _ref$disableStylesGen === void 0 ? false : _ref$disableStylesGen
|
|
125
|
+
disableStylesGeneration = _ref$disableStylesGen === void 0 ? false : _ref$disableStylesGen,
|
|
126
|
+
_ref$disableCssBaseli = _ref.disableCssBaseline,
|
|
127
|
+
disableCssBaseline = _ref$disableCssBaseli === void 0 ? false : _ref$disableCssBaseli;
|
|
128
|
+
|
|
129
|
+
if (process.env.NODE_ENV !== "production") {
|
|
130
|
+
if (!warnedOnce && !disableCssBaseline) {
|
|
131
|
+
warnedOnce = true; // eslint-disable-next-line no-console
|
|
132
|
+
|
|
133
|
+
console.warn("UI Kit HvProvider's automatic definition of a css styles baseline will be removed in the next major version.\n" + "You can use the `disableCssBaseline` property to disable it already.\n" + "See https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
124
137
|
var localeSetting = locale || ((_navigator$language = (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.language) !== null && _navigator$language !== void 0 ? _navigator$language : "en-US");
|
|
125
138
|
var rawUiKitTheme = (0, _theme.getTheme)(uiKitTheme);
|
|
126
139
|
var customTheme = applyCustomTheme((0, _theme.themeBuilder)(rawUiKitTheme), theme);
|
|
@@ -137,7 +150,7 @@ var HvProvider = function HvProvider(_ref) {
|
|
|
137
150
|
disableGeneration: disableStylesGeneration
|
|
138
151
|
}, /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
|
|
139
152
|
theme: customTheme
|
|
140
|
-
},
|
|
153
|
+
}, !disableCssBaseline && (_HvCssBaseline || (_HvCssBaseline = /*#__PURE__*/_react.default.createElement(_theme.HvCssBaseline, null))), /*#__PURE__*/_react.default.createElement(_context.default.Provider, {
|
|
141
154
|
value: pConfig
|
|
142
155
|
}, children)));
|
|
143
156
|
};
|
|
@@ -215,7 +228,22 @@ process.env.NODE_ENV !== "production" ? HvProvider.propTypes = {
|
|
|
215
228
|
/**
|
|
216
229
|
* Disables the generation of the styles.
|
|
217
230
|
*/
|
|
218
|
-
disableStylesGeneration: _propTypes.default.bool
|
|
231
|
+
disableStylesGeneration: _propTypes.default.bool,
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Disables the generation of the baseline css styles.
|
|
235
|
+
*
|
|
236
|
+
* This will be the default behavior in the future.
|
|
237
|
+
*
|
|
238
|
+
* The application using UI Kit should be responsible for adding the baseline css styles, by
|
|
239
|
+
* either using the `<HvCssBaseline />` component, using the `<HvScopedCssBaseline />` component,
|
|
240
|
+
* or ensuring that the necessary base styles are applied.
|
|
241
|
+
*
|
|
242
|
+
* Defaults to `false`. Will be removed in the next major release.
|
|
243
|
+
*
|
|
244
|
+
* @see https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main
|
|
245
|
+
*/
|
|
246
|
+
disableCssBaseline: _propTypes.default.bool
|
|
219
247
|
} : void 0;
|
|
220
248
|
var _default = HvProvider;
|
|
221
249
|
exports.default = _default;
|
|
@@ -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","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":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA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AEa,mBAAUO,MAxBG;;EA0BrB;AACF;AACA;EACElB,iBAAiB,EAAEW,mBAAUM,IA7BR;;EA8BrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEhB,wBAAwB,EAAEU,mBAAUQ,KAAV,CAAgB;IACxC;AACJ;AACA;IACIC,aAAa,EAAET,mBAAUU,IAJe;;IAKxC;AACJ;AACA;IACIC,gBAAgB,EAAEX,mBAAUO,MARY;;IASxC;AACJ;AACA;AACA;IACIK,IAAI,EAAEZ,mBAAUO;EAbwB,CAAhB,CAzCL;;EAwDrB;AACF;AACA;AACA;AACA;AACA;EACEhB,iBAAiB,EAAES,mBAAUU,IA9DR;;EA+DrB;AACF;AACA;EACElB,uBAAuB,EAAEQ,mBAAUU;AAlEd,CAAvB;eAqEe5B,U"}
|
|
1
|
+
{"version":3,"file":"Provider.js","names":["warnedOnce","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","disableCssBaseline","process","env","NODE_ENV","console","warn","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, HvCssBaseline, getTheme } from \"../theme\";\n\nimport ConfigContext from \"./context\";\n\nlet warnedOnce = false;\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 parallel, the `generateClassNameOptions`\n * must be tweaked to avoid CSS classnames collision. 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 disableCssBaseline = false,\n}) => {\n if (process.env.NODE_ENV !== \"production\") {\n if (!warnedOnce && !disableCssBaseline) {\n warnedOnce = true;\n // eslint-disable-next-line no-console\n console.warn(\n \"UI Kit HvProvider's automatic definition of a css styles baseline will be removed in the next major version.\\n\" +\n \"You can use the `disableCssBaseline` property to disable it already.\\n\" +\n \"See https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main\"\n );\n }\n }\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 {!disableCssBaseline && <HvCssBaseline />}\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 /**\n * Disables the generation of the baseline css styles.\n *\n * This will be the default behavior in the future.\n *\n * The application using UI Kit should be responsible for adding the baseline css styles, by\n * either using the `<HvCssBaseline />` component, using the `<HvScopedCssBaseline />` component,\n * or ensuring that the necessary base styles are applied.\n *\n * Defaults to `false`. Will be removed in the next major release.\n *\n * @see https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main\n */\n disableCssBaseline: PropTypes.bool,\n};\n\nexport default HvProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AAIA;;AAEA;;AAEA;;;;;;;;AAEA,IAAIA,UAAU,GAAG,KAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,gBAAD,EAAmBC,gBAAnB,EAAwC;EAC/D,IAAMC,eAAe,GAAG,0BAAxB;EACA,IAAMC,WAAW,GAAG,wBAAUH,gBAAV,CAApB;EACA,IAAMI,WAAW,GAAG,wBAAUH,gBAAV,CAApB;EACA,IAAMI,gBAAgB,GAAG,GAAzB;;EACA,IAAI,CAAC,sBAAQF,WAAR,CAAD,IAAyB,CAAC,sBAAQC,WAAR,CAA9B,EAAoD;IAClDE,kBAAK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A;AACA;EACEtB,wBAAwB,EAAEgB,mBAAUQ,KAAV,CAAgB;IACxC;AACJ;AACA;IACIC,aAAa,EAAET,mBAAUU,IAJe;;IAKxC;AACJ;AACA;IACIC,gBAAgB,EAAEX,mBAAUO,MARY;;IASxC;AACJ;AACA;AACA;IACIK,IAAI,EAAEZ,mBAAUO;EAbwB,CAAhB,CAzCL;;EAwDrB;AACF;AACA;AACA;AACA;AACA;EACEtB,iBAAiB,EAAEe,mBAAUU,IA9DR;;EA+DrB;AACF;AACA;EACExB,uBAAuB,EAAEc,mBAAUU,IAlEd;;EAoErB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEvB,kBAAkB,EAAEa,mBAAUU;AAjFT,CAAvB;eAoFelC,U"}
|
|
@@ -159,7 +159,9 @@ var TreeViewItem = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
159
159
|
}, [registerNode, unregisterNode, parentId, index, nodeId, expandable, disabledProp, id, selectable, onFocus, payload]);
|
|
160
160
|
(0, _react.useEffect)(function () {
|
|
161
161
|
if (mapFirstChar && unMapFirstChar && label) {
|
|
162
|
-
|
|
162
|
+
var _contentRef$current;
|
|
163
|
+
|
|
164
|
+
mapFirstChar(nodeId, (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.textContent.substring(0, 1).toLowerCase());
|
|
163
165
|
return function () {
|
|
164
166
|
unMapFirstChar(nodeId);
|
|
165
167
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeViewItem.js","names":["preventSelection","event","disabled","shiftKey","ctrlKey","metaKey","preventDefault","TreeViewItem","React","forwardRef","props","ref","idProp","id","className","classes","disabledProp","selectableProp","selectable","nodeId","icon","label","payload","onClick","onMouseDown","onFocus","children","others","treeViewControlContext","TreeViewControlContext","TreeViewStateContext","isExpanded","isSelected","isFocused","isDisabled","treeId","mode","collapsible","toggleExpansion","multiSelect","selectNode","selectRange","disabledItemsFocusable","registerNode","unregisterNode","mapFirstChar","unMapFirstChar","focus","treeviewMode","treeitemElement","setTreeitemElement","contentRef","handleRef","descendant","element","index","parentId","level","expandable","Boolean","Array","isArray","length","expanded","focused","selected","idAttribute","undefined","current","textContent","substring","toLowerCase","ariaSelected","handleFocus","target","currentTarget","ownerDocument","document","getElementById","preventScroll","unfocusable","handleExpansion","multiple","handleSelection","end","handleMouseDown","handleClick","handleKeyDown","isEventHandled","key","altKey","stopPropagation","renderedContent","content","paddingLeft","role","tabIndex","onKeyDown","renderedChildren","group","node","unselected","unselectable","collapsed","propTypes","PropTypes","string","shape","isRequired","bool","any","func","styles","name"],"sources":["../../../src/VerticalNavigation/TreeView/TreeViewItem.js"],"sourcesContent":["import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@material-ui/core\";\n\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport HvTypography from \"../../Typography\";\n\nimport { TreeViewControlContext, TreeViewStateContext } from \"./TreeViewContexts\";\n\nimport { setId, useForkRef } from \"../../utils\";\n\nimport { DescendantProvider, useDescendant } from \"./descendants\";\n\nimport styles from \"./styles\";\n\nconst preventSelection = (event, disabled) => {\n if (event.shiftKey || event.ctrlKey || event.metaKey || disabled) {\n // Prevent text selection\n event.preventDefault();\n }\n};\n\nconst TreeViewItem = React.forwardRef((props, ref) => {\n const {\n id: idProp,\n className,\n classes,\n\n disabled: disabledProp = false,\n\n selectable: selectableProp,\n\n nodeId,\n icon = null,\n label,\n payload,\n\n onClick,\n onMouseDown,\n onFocus,\n\n children,\n\n ...others\n } = props;\n\n const treeViewControlContext = useContext(TreeViewControlContext);\n const { isExpanded, isSelected, isFocused, isDisabled } = useContext(TreeViewStateContext);\n\n const {\n treeId,\n mode,\n collapsible,\n toggleExpansion,\n multiSelect,\n selectNode,\n selectRange,\n disabledItemsFocusable,\n registerNode,\n unregisterNode,\n mapFirstChar,\n unMapFirstChar,\n focus,\n } = treeViewControlContext;\n\n const treeviewMode = mode === \"treeview\";\n\n let id = null;\n\n if (idProp != null) {\n id = idProp;\n } else if (treeId && nodeId) {\n id = `${treeId}-${nodeId}`;\n }\n\n const [treeitemElement, setTreeitemElement] = useState(null);\n const contentRef = useRef(null);\n const handleRef = useForkRef(setTreeitemElement, ref);\n\n const descendant = useMemo(\n () => ({\n element: treeitemElement,\n id: nodeId,\n }),\n [nodeId, treeitemElement]\n );\n\n const { index, parentId, level } = useDescendant(descendant);\n\n const expandable = collapsible && Boolean(Array.isArray(children) ? children.length : children);\n const expanded = isExpanded ? isExpanded(nodeId) : false;\n const focused = isFocused ? isFocused(nodeId) : false;\n const selected = isSelected ? isSelected(nodeId) : false;\n const disabled = isDisabled ? isDisabled(nodeId) : false;\n\n const selectable = selectableProp != null ? selectableProp : !collapsible || !expandable;\n\n useEffect(() => {\n // On the first render a node's index will be -1. We want to wait for the real index.\n if (registerNode && unregisterNode && index !== -1) {\n registerNode({\n id: nodeId,\n idAttribute: id,\n index,\n parentId,\n selectable,\n expandable,\n disabled: disabledProp,\n onFocus,\n payload,\n });\n\n return () => {\n unregisterNode(nodeId);\n };\n }\n\n return undefined;\n }, [\n registerNode,\n unregisterNode,\n parentId,\n index,\n nodeId,\n expandable,\n disabledProp,\n id,\n selectable,\n onFocus,\n payload,\n ]);\n\n useEffect(() => {\n if (mapFirstChar && unMapFirstChar && label) {\n mapFirstChar(nodeId, contentRef.current.textContent.substring(0, 1).toLowerCase());\n\n return () => {\n unMapFirstChar(nodeId);\n };\n }\n return undefined;\n }, [mapFirstChar, unMapFirstChar, nodeId, label]);\n\n let ariaSelected;\n if (multiSelect) {\n ariaSelected = selected;\n } else if (selected) {\n /* single-selection trees unset aria-selected on un-selected items.\n *\n * If the tree does not support multiple selection, aria-selected\n * is set to true for the selected node and it is not present on any other node in the tree.\n * Source: https://www.w3.org/TR/wai-aria-practices/#TreeView\n */\n ariaSelected = true;\n }\n\n const handleFocus = useCallback(\n (event) => {\n // DOM focus stays on the tree which manages focus with aria-activedescendant\n if (event.target === event.currentTarget) {\n (event.target.ownerDocument || document)\n .getElementById(treeId)\n .focus({ preventScroll: true });\n }\n\n const unfocusable = !disabledItemsFocusable && disabled;\n if (!focused && event.currentTarget === event.target && !unfocusable) {\n focus(event, nodeId);\n }\n },\n [disabled, disabledItemsFocusable, focus, focused, nodeId, treeId]\n );\n\n const handleExpansion = useCallback(\n (event) => {\n if (!disabled) {\n if (treeviewMode && !focused) {\n focus(event, nodeId);\n }\n\n const multiple = multiSelect && (event.shiftKey || event.ctrlKey || event.metaKey);\n\n // If already expanded and trying to toggle selection don't close\n if (expandable && !(multiple && isExpanded(nodeId))) {\n toggleExpansion(event, nodeId);\n }\n }\n },\n [\n disabled,\n expandable,\n focus,\n focused,\n isExpanded,\n multiSelect,\n nodeId,\n toggleExpansion,\n treeviewMode,\n ]\n );\n\n const handleSelection = useCallback(\n (event) => {\n if (selectable && !disabled) {\n if (treeviewMode && !focused) {\n focus(event, nodeId);\n }\n\n const multiple = multiSelect && (event.shiftKey || event.ctrlKey || event.metaKey);\n\n if (multiple) {\n if (event.shiftKey) {\n selectRange(event, { end: nodeId });\n } else {\n selectNode(event, nodeId, true);\n }\n } else {\n selectNode(event, nodeId);\n }\n }\n },\n [\n disabled,\n focus,\n focused,\n multiSelect,\n nodeId,\n selectNode,\n selectRange,\n selectable,\n treeviewMode,\n ]\n );\n\n const handleMouseDown = useCallback(\n (event) => {\n preventSelection(event, disabled);\n\n if (onMouseDown) {\n onMouseDown(event);\n }\n },\n [disabled, onMouseDown]\n );\n\n const handleClick = useCallback(\n (event) => {\n if (!disabled) {\n if (expandable) {\n handleExpansion(event);\n }\n\n if (selectable) {\n handleSelection(event);\n }\n }\n\n if (onClick) {\n onClick(event);\n }\n },\n [disabled, expandable, handleExpansion, handleSelection, onClick, selectable]\n );\n\n const handleKeyDown = useCallback(\n (event) => {\n let isEventHandled = false;\n const { key } = event;\n\n if (event.altKey || event.ctrlKey || event.metaKey || event.currentTarget !== event.target) {\n return;\n }\n if (contentRef.current === event.currentTarget) {\n if (key === \"Enter\" || key === \" \") {\n if (expandable) {\n isEventHandled = handleExpansion(event);\n }\n\n if (selectable) {\n isEventHandled = handleSelection(event);\n }\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n },\n [expandable, handleExpansion, handleSelection, selectable]\n );\n\n const renderedContent = useMemo(\n () => (\n <HvTypography\n id={setId(id, \"button\")}\n component=\"div\"\n innerRef={contentRef}\n className={classes.content}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n style={{\n paddingLeft: (expandable || icon != null ? 0 : 10) + level * (collapsible ? 32 : 10),\n }}\n {...(treeviewMode\n ? {\n role: \"button\",\n tabIndex: -1,\n onFocus: handleFocus,\n }\n : {\n role: \"button\",\n tabIndex: selectable || expandable ? 0 : -1,\n onKeyDown: handleKeyDown,\n \"aria-current\": selectable && selected ? \"page\" : undefined,\n \"aria-expanded\": expandable ? expanded : undefined,\n \"aria-controls\": expandable ? setId(id, \"group\") : undefined,\n })}\n >\n {expandable && (expanded ? <DropUpXS /> : <DropDownXS />)}\n {icon}\n {label}\n </HvTypography>\n ),\n [\n id,\n classes.content,\n handleClick,\n handleMouseDown,\n expandable,\n level,\n collapsible,\n treeviewMode,\n handleFocus,\n handleKeyDown,\n selectable,\n selected,\n expanded,\n icon,\n label,\n ]\n );\n\n const renderedChildren = useMemo(\n () =>\n children && (\n <ul\n id={setId(id, \"group\")}\n className={classes.group}\n role={treeviewMode ? \"group\" : undefined}\n >\n {children}\n </ul>\n ),\n [children, classes.group, id, treeviewMode]\n );\n\n return (\n <li\n ref={handleRef}\n id={id}\n className={clsx(classes.node, className, {\n [classes.disabled]: disabled,\n [classes.expandable]: expandable,\n [classes.collapsed]: expandable && !expanded,\n [classes.expanded]: expandable && expanded,\n [classes.selectable]: !disabled && selectable,\n [classes.unselectable]: !disabled && !selectable,\n [classes.selected]: !disabled && selectable && selected,\n [classes.unselected]: !disabled && selectable && !selected,\n [classes.focused]: focused,\n })}\n data-hasicon={icon != null ? true : undefined}\n {...(mode === \"treeview\" && {\n role: \"treeitem\",\n \"aria-selected\": ariaSelected,\n \"aria-expanded\": expandable ? expanded : undefined,\n \"aria-disabled\": disabled ? true : undefined,\n })}\n {...others}\n >\n {renderedContent}\n <DescendantProvider id={nodeId} level={level + 1}>\n {renderedChildren}\n </DescendantProvider>\n </li>\n );\n});\n\nTreeViewItem.propTypes = {\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied to the Radio button.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component.\n */\n node: PropTypes.string,\n /**\n * Style applied to the content.\n */\n content: PropTypes.string,\n /**\n * Style applied to the group.\n */\n group: PropTypes.string,\n /**\n * Style applied when item is disabled.\n */\n disabled: PropTypes.string,\n /**\n * Style applied when item is expandable.\n */\n expandable: PropTypes.string,\n /**\n * Style applied when item is collapsed.\n */\n collapsed: PropTypes.string,\n /**\n * Style applied when item is expanded.\n */\n expanded: PropTypes.string,\n /**\n * Style applied when item is selectable.\n */\n selectable: PropTypes.string,\n /**\n * Style applied when item is unselectable.\n */\n unselectable: PropTypes.string,\n /**\n * Style applied when item is selected.\n */\n selected: PropTypes.string,\n /**\n * Style applied when item is unselectable.\n */\n unselected: PropTypes.string,\n /**\n * Style applied when item is focused.\n */\n focused: PropTypes.string,\n }).isRequired,\n /**\n * Is the node disabled.\n */\n disabled: PropTypes.bool,\n /**\n * Can the node be selected.\n */\n selectable: PropTypes.bool,\n /**\n * The id of the node.\n */\n nodeId: PropTypes.string.isRequired,\n /**\n * The icon to display next to the node's label.\n */\n icon: PropTypes.node,\n /**\n * The item label.\n */\n label: PropTypes.node.isRequired,\n /**\n * The node payload.\n */\n // eslint-disable-next-line react/forbid-prop-types\n payload: PropTypes.any,\n /**\n * @ignore\n */\n onClick: PropTypes.func,\n /**\n * @ignore\n */\n onMouseDown: PropTypes.func,\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n};\n\nexport default withStyles(styles, {\n name: \"HvVerticalNavigationTreeViewItem\",\n})(TreeViewItem);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAQC,QAAR,EAAqB;EAC5C,IAAID,KAAK,CAACE,QAAN,IAAkBF,KAAK,CAACG,OAAxB,IAAmCH,KAAK,CAACI,OAAzC,IAAoDH,QAAxD,EAAkE;IAChE;IACAD,KAAK,CAACK,cAAN;EACD;AACF,CALD;;AAOA,IAAMC,YAAY,gBAAGC,eAAMC,UAAN,CAAiB,UAACC,KAAD,EAAQC,GAAR,EAAgB;EACpD,IACMC,MADN,GAqBIF,KArBJ,CACEG,EADF;EAAA,IAEEC,SAFF,GAqBIJ,KArBJ,CAEEI,SAFF;EAAA,IAGEC,OAHF,GAqBIL,KArBJ,CAGEK,OAHF;EAAA,sBAqBIL,KArBJ,CAKER,QALF;EAAA,IAKYc,YALZ,gCAK2B,KAL3B;EAAA,IAOcC,cAPd,GAqBIP,KArBJ,CAOEQ,UAPF;EAAA,IASEC,MATF,GAqBIT,KArBJ,CASES,MATF;EAAA,kBAqBIT,KArBJ,CAUEU,IAVF;EAAA,IAUEA,IAVF,4BAUS,IAVT;EAAA,IAWEC,KAXF,GAqBIX,KArBJ,CAWEW,KAXF;EAAA,IAYEC,OAZF,GAqBIZ,KArBJ,CAYEY,OAZF;EAAA,IAcEC,OAdF,GAqBIb,KArBJ,CAcEa,OAdF;EAAA,IAeEC,WAfF,GAqBId,KArBJ,CAeEc,WAfF;EAAA,IAgBEC,OAhBF,GAqBIf,K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C,mBAAUC,MApBC;;IAqBvB;AACJ;AACA;IACIH,SAAS,EAAEE,mBAAUC,MAxBE;;IAyBvB;AACJ;AACA;IACI3C,QAAQ,EAAE0C,mBAAUC,MA5BG;;IA6BvB;AACJ;AACA;IACIxF,UAAU,EAAEuF,mBAAUC,MAhCC;;IAiCvB;AACJ;AACA;IACIJ,YAAY,EAAEG,mBAAUC,MApCD;;IAqCvB;AACJ;AACA;IACIzC,QAAQ,EAAEwC,mBAAUC,MAxCG;;IAyCvB;AACJ;AACA;IACIL,UAAU,EAAEI,mBAAUC,MA5CC;;IA6CvB;AACJ;AACA;IACI1C,OAAO,EAAEyC,mBAAUC;EAhDI,CAAhB,EAiDNE,UA7DoB;;EA8DvB;AACF;AACA;EACE1G,QAAQ,EAAEuG,mBAAUI,IAjEG;;EAkEvB;AACF;AACA;EACE3F,UAAU,EAAEuF,mBAAUI,IArEC;;EAsEvB;AACF;AACA;EACE1F,MAAM,EAAEsF,mBAAUC,MAAV,CAAiBE,UAzEF;;EA0EvB;AACF;AACA;EACExF,IAAI,EAAEqF,mBAAUL,IA7EO;;EA8EvB;AACF;AACA;EACE/E,KAAK,EAAEoF,mBAAUL,IAAV,CAAeQ,UAjFC;;EAkFvB;AACF;AACA;EACE;EACAtF,OAAO,EAAEmF,mBAAUK,GAtFI;;EAuFvB;AACF;AACA;EACEvF,OAAO,EAAEkF,mBAAUM,IA1FI;;EA2FvB;AACF;AACA;EACEvF,WAAW,EAAEiF,mBAAUM,IA9FA;;EA+FvB;AACF;AACA;EACEtF,OAAO,EAAEgF,mBAAUM,IAlGI;;EAmGvB;AACF;AACA;EACErF,QAAQ,EAAE+E,mBAAUL;AAtGG,CAAzB;;eAyGe,sBAAWY,eAAX,EAAmB;EAChCC,IAAI,EAAE;AAD0B,CAAnB,EAEZ1G,YAFY,C"}
|
|
1
|
+
{"version":3,"file":"TreeViewItem.js","names":["preventSelection","event","disabled","shiftKey","ctrlKey","metaKey","preventDefault","TreeViewItem","React","forwardRef","props","ref","idProp","id","className","classes","disabledProp","selectableProp","selectable","nodeId","icon","label","payload","onClick","onMouseDown","onFocus","children","others","treeViewControlContext","TreeViewControlContext","TreeViewStateContext","isExpanded","isSelected","isFocused","isDisabled","treeId","mode","collapsible","toggleExpansion","multiSelect","selectNode","selectRange","disabledItemsFocusable","registerNode","unregisterNode","mapFirstChar","unMapFirstChar","focus","treeviewMode","treeitemElement","setTreeitemElement","contentRef","handleRef","descendant","element","index","parentId","level","expandable","Boolean","Array","isArray","length","expanded","focused","selected","idAttribute","undefined","current","textContent","substring","toLowerCase","ariaSelected","handleFocus","target","currentTarget","ownerDocument","document","getElementById","preventScroll","unfocusable","handleExpansion","multiple","handleSelection","end","handleMouseDown","handleClick","handleKeyDown","isEventHandled","key","altKey","stopPropagation","renderedContent","content","paddingLeft","role","tabIndex","onKeyDown","renderedChildren","group","node","unselected","unselectable","collapsed","propTypes","PropTypes","string","shape","isRequired","bool","any","func","styles","name"],"sources":["../../../src/VerticalNavigation/TreeView/TreeViewItem.js"],"sourcesContent":["import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@material-ui/core\";\n\nimport { DropDownXS, DropUpXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport HvTypography from \"../../Typography\";\n\nimport { TreeViewControlContext, TreeViewStateContext } from \"./TreeViewContexts\";\n\nimport { setId, useForkRef } from \"../../utils\";\n\nimport { DescendantProvider, useDescendant } from \"./descendants\";\n\nimport styles from \"./styles\";\n\nconst preventSelection = (event, disabled) => {\n if (event.shiftKey || event.ctrlKey || event.metaKey || disabled) {\n // Prevent text selection\n event.preventDefault();\n }\n};\n\nconst TreeViewItem = React.forwardRef((props, ref) => {\n const {\n id: idProp,\n className,\n classes,\n\n disabled: disabledProp = false,\n\n selectable: selectableProp,\n\n nodeId,\n icon = null,\n label,\n payload,\n\n onClick,\n onMouseDown,\n onFocus,\n\n children,\n\n ...others\n } = props;\n\n const treeViewControlContext = useContext(TreeViewControlContext);\n const { isExpanded, isSelected, isFocused, isDisabled } = useContext(TreeViewStateContext);\n\n const {\n treeId,\n mode,\n collapsible,\n toggleExpansion,\n multiSelect,\n selectNode,\n selectRange,\n disabledItemsFocusable,\n registerNode,\n unregisterNode,\n mapFirstChar,\n unMapFirstChar,\n focus,\n } = treeViewControlContext;\n\n const treeviewMode = mode === \"treeview\";\n\n let id = null;\n\n if (idProp != null) {\n id = idProp;\n } else if (treeId && nodeId) {\n id = `${treeId}-${nodeId}`;\n }\n\n const [treeitemElement, setTreeitemElement] = useState(null);\n const contentRef = useRef(null);\n const handleRef = useForkRef(setTreeitemElement, ref);\n\n const descendant = useMemo(\n () => ({\n element: treeitemElement,\n id: nodeId,\n }),\n [nodeId, treeitemElement]\n );\n\n const { index, parentId, level } = useDescendant(descendant);\n\n const expandable = collapsible && Boolean(Array.isArray(children) ? children.length : children);\n const expanded = isExpanded ? isExpanded(nodeId) : false;\n const focused = isFocused ? isFocused(nodeId) : false;\n const selected = isSelected ? isSelected(nodeId) : false;\n const disabled = isDisabled ? isDisabled(nodeId) : false;\n\n const selectable = selectableProp != null ? selectableProp : !collapsible || !expandable;\n\n useEffect(() => {\n // On the first render a node's index will be -1. We want to wait for the real index.\n if (registerNode && unregisterNode && index !== -1) {\n registerNode({\n id: nodeId,\n idAttribute: id,\n index,\n parentId,\n selectable,\n expandable,\n disabled: disabledProp,\n onFocus,\n payload,\n });\n\n return () => {\n unregisterNode(nodeId);\n };\n }\n\n return undefined;\n }, [\n registerNode,\n unregisterNode,\n parentId,\n index,\n nodeId,\n expandable,\n disabledProp,\n id,\n selectable,\n onFocus,\n payload,\n ]);\n\n useEffect(() => {\n if (mapFirstChar && unMapFirstChar && label) {\n mapFirstChar(nodeId, contentRef.current?.textContent.substring(0, 1).toLowerCase());\n\n return () => {\n unMapFirstChar(nodeId);\n };\n }\n return undefined;\n }, [mapFirstChar, unMapFirstChar, nodeId, label]);\n\n let ariaSelected;\n if (multiSelect) {\n ariaSelected = selected;\n } else if (selected) {\n /* single-selection trees unset aria-selected on un-selected items.\n *\n * If the tree does not support multiple selection, aria-selected\n * is set to true for the selected node and it is not present on any other node in the tree.\n * Source: https://www.w3.org/TR/wai-aria-practices/#TreeView\n */\n ariaSelected = true;\n }\n\n const handleFocus = useCallback(\n (event) => {\n // DOM focus stays on the tree which manages focus with aria-activedescendant\n if (event.target === event.currentTarget) {\n (event.target.ownerDocument || document)\n .getElementById(treeId)\n .focus({ preventScroll: true });\n }\n\n const unfocusable = !disabledItemsFocusable && disabled;\n if (!focused && event.currentTarget === event.target && !unfocusable) {\n focus(event, nodeId);\n }\n },\n [disabled, disabledItemsFocusable, focus, focused, nodeId, treeId]\n );\n\n const handleExpansion = useCallback(\n (event) => {\n if (!disabled) {\n if (treeviewMode && !focused) {\n focus(event, nodeId);\n }\n\n const multiple = multiSelect && (event.shiftKey || event.ctrlKey || event.metaKey);\n\n // If already expanded and trying to toggle selection don't close\n if (expandable && !(multiple && isExpanded(nodeId))) {\n toggleExpansion(event, nodeId);\n }\n }\n },\n [\n disabled,\n expandable,\n focus,\n focused,\n isExpanded,\n multiSelect,\n nodeId,\n toggleExpansion,\n treeviewMode,\n ]\n );\n\n const handleSelection = useCallback(\n (event) => {\n if (selectable && !disabled) {\n if (treeviewMode && !focused) {\n focus(event, nodeId);\n }\n\n const multiple = multiSelect && (event.shiftKey || event.ctrlKey || event.metaKey);\n\n if (multiple) {\n if (event.shiftKey) {\n selectRange(event, { end: nodeId });\n } else {\n selectNode(event, nodeId, true);\n }\n } else {\n selectNode(event, nodeId);\n }\n }\n },\n [\n disabled,\n focus,\n focused,\n multiSelect,\n nodeId,\n selectNode,\n selectRange,\n selectable,\n treeviewMode,\n ]\n );\n\n const handleMouseDown = useCallback(\n (event) => {\n preventSelection(event, disabled);\n\n if (onMouseDown) {\n onMouseDown(event);\n }\n },\n [disabled, onMouseDown]\n );\n\n const handleClick = useCallback(\n (event) => {\n if (!disabled) {\n if (expandable) {\n handleExpansion(event);\n }\n\n if (selectable) {\n handleSelection(event);\n }\n }\n\n if (onClick) {\n onClick(event);\n }\n },\n [disabled, expandable, handleExpansion, handleSelection, onClick, selectable]\n );\n\n const handleKeyDown = useCallback(\n (event) => {\n let isEventHandled = false;\n const { key } = event;\n\n if (event.altKey || event.ctrlKey || event.metaKey || event.currentTarget !== event.target) {\n return;\n }\n if (contentRef.current === event.currentTarget) {\n if (key === \"Enter\" || key === \" \") {\n if (expandable) {\n isEventHandled = handleExpansion(event);\n }\n\n if (selectable) {\n isEventHandled = handleSelection(event);\n }\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n },\n [expandable, handleExpansion, handleSelection, selectable]\n );\n\n const renderedContent = useMemo(\n () => (\n <HvTypography\n id={setId(id, \"button\")}\n component=\"div\"\n innerRef={contentRef}\n className={classes.content}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n style={{\n paddingLeft: (expandable || icon != null ? 0 : 10) + level * (collapsible ? 32 : 10),\n }}\n {...(treeviewMode\n ? {\n role: \"button\",\n tabIndex: -1,\n onFocus: handleFocus,\n }\n : {\n role: \"button\",\n tabIndex: selectable || expandable ? 0 : -1,\n onKeyDown: handleKeyDown,\n \"aria-current\": selectable && selected ? \"page\" : undefined,\n \"aria-expanded\": expandable ? expanded : undefined,\n \"aria-controls\": expandable ? setId(id, \"group\") : undefined,\n })}\n >\n {expandable && (expanded ? <DropUpXS /> : <DropDownXS />)}\n {icon}\n {label}\n </HvTypography>\n ),\n [\n id,\n classes.content,\n handleClick,\n handleMouseDown,\n expandable,\n level,\n collapsible,\n treeviewMode,\n handleFocus,\n handleKeyDown,\n selectable,\n selected,\n expanded,\n icon,\n label,\n ]\n );\n\n const renderedChildren = useMemo(\n () =>\n children && (\n <ul\n id={setId(id, \"group\")}\n className={classes.group}\n role={treeviewMode ? \"group\" : undefined}\n >\n {children}\n </ul>\n ),\n [children, classes.group, id, treeviewMode]\n );\n\n return (\n <li\n ref={handleRef}\n id={id}\n className={clsx(classes.node, className, {\n [classes.disabled]: disabled,\n [classes.expandable]: expandable,\n [classes.collapsed]: expandable && !expanded,\n [classes.expanded]: expandable && expanded,\n [classes.selectable]: !disabled && selectable,\n [classes.unselectable]: !disabled && !selectable,\n [classes.selected]: !disabled && selectable && selected,\n [classes.unselected]: !disabled && selectable && !selected,\n [classes.focused]: focused,\n })}\n data-hasicon={icon != null ? true : undefined}\n {...(mode === \"treeview\" && {\n role: \"treeitem\",\n \"aria-selected\": ariaSelected,\n \"aria-expanded\": expandable ? expanded : undefined,\n \"aria-disabled\": disabled ? true : undefined,\n })}\n {...others}\n >\n {renderedContent}\n <DescendantProvider id={nodeId} level={level + 1}>\n {renderedChildren}\n </DescendantProvider>\n </li>\n );\n});\n\nTreeViewItem.propTypes = {\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied to the Radio button.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the root of the component.\n */\n node: PropTypes.string,\n /**\n * Style applied to the content.\n */\n content: PropTypes.string,\n /**\n * Style applied to the group.\n */\n group: PropTypes.string,\n /**\n * Style applied when item is disabled.\n */\n disabled: PropTypes.string,\n /**\n * Style applied when item is expandable.\n */\n expandable: PropTypes.string,\n /**\n * Style applied when item is collapsed.\n */\n collapsed: PropTypes.string,\n /**\n * Style applied when item is expanded.\n */\n expanded: PropTypes.string,\n /**\n * Style applied when item is selectable.\n */\n selectable: PropTypes.string,\n /**\n * Style applied when item is unselectable.\n */\n unselectable: PropTypes.string,\n /**\n * Style applied when item is selected.\n */\n selected: PropTypes.string,\n /**\n * Style applied when item is unselectable.\n */\n unselected: PropTypes.string,\n /**\n * Style applied when item is focused.\n */\n focused: PropTypes.string,\n }).isRequired,\n /**\n * Is the node disabled.\n */\n disabled: PropTypes.bool,\n /**\n * Can the node be selected.\n */\n selectable: PropTypes.bool,\n /**\n * The id of the node.\n */\n nodeId: PropTypes.string.isRequired,\n /**\n * The icon to display next to the node's label.\n */\n icon: PropTypes.node,\n /**\n * The item label.\n */\n label: PropTypes.node.isRequired,\n /**\n * The node payload.\n */\n // eslint-disable-next-line react/forbid-prop-types\n payload: PropTypes.any,\n /**\n * @ignore\n */\n onClick: PropTypes.func,\n /**\n * @ignore\n */\n onMouseDown: PropTypes.func,\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n};\n\nexport default withStyles(styles, {\n name: \"HvVerticalNavigationTreeViewItem\",\n})(TreeViewItem);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAQC,QAAR,EAAqB;EAC5C,IAAID,KAAK,CAACE,QAAN,IAAkBF,KAAK,CAACG,OAAxB,IAAmCH,KAAK,CAACI,OAAzC,IAAoDH,QAAxD,EAAkE;IAChE;IACAD,KAAK,CAACK,cAAN;EACD;AACF,CALD;;AAOA,IAAMC,YAAY,gBAAGC,eAAMC,UAAN,CAAiB,UAACC,KAAD,EAAQC,GAAR,EAAgB;EACpD,IACMC,MADN,GAqBIF,KArBJ,CACEG,EADF;EAAA,IAEEC,SAFF,GAqBIJ,KArBJ,CAEEI,SAFF;EAAA,IAGEC,OAHF,GAqBIL,KArBJ,CAGEK,OAHF;EAAA,sBAqBIL,KArBJ,CAKER,QALF;EAAA,IAKYc,YALZ,gCAK2B,KAL3B;EAAA,IAOcC,cAPd,GAqBIP,KArBJ,CAOEQ,UAPF;EAAA,IASEC,MATF,GAqBIT,KArBJ,CASES,MATF;EAAA,kBAqBIT,KArBJ,CAUEU,IAVF;EAAA,IAUEA,IAVF,4BAUS,IAVT;EAAA,IAWEC,KAXF,GAqBIX,KArBJ,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UL;AAtGG,CAAzB;;eAyGe,sBAAWY,eAAX,EAAmB;EAChCC,IAAI,EAAE;AAD0B,CAAnB,EAEZ1G,YAFY,C"}
|
package/dist/index.js
CHANGED
|
@@ -110,6 +110,8 @@ var _exportNames = {
|
|
|
110
110
|
hvTheme: true,
|
|
111
111
|
themeBuilder: true,
|
|
112
112
|
getTheme: true,
|
|
113
|
+
HvCssBaseline: true,
|
|
114
|
+
HvScopedCssBaseline: true,
|
|
113
115
|
HvProvider: true
|
|
114
116
|
};
|
|
115
117
|
Object.defineProperty(exports, "HvAccordion", {
|
|
@@ -238,6 +240,12 @@ Object.defineProperty(exports, "HvContainer", {
|
|
|
238
240
|
return _Container.default;
|
|
239
241
|
}
|
|
240
242
|
});
|
|
243
|
+
Object.defineProperty(exports, "HvCssBaseline", {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function get() {
|
|
246
|
+
return _theme.HvCssBaseline;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
241
249
|
Object.defineProperty(exports, "HvDatePicker", {
|
|
242
250
|
enumerable: true,
|
|
243
251
|
get: function get() {
|
|
@@ -400,6 +408,12 @@ Object.defineProperty(exports, "HvRadioGroup", {
|
|
|
400
408
|
return _RadioGroup.default;
|
|
401
409
|
}
|
|
402
410
|
});
|
|
411
|
+
Object.defineProperty(exports, "HvScopedCssBaseline", {
|
|
412
|
+
enumerable: true,
|
|
413
|
+
get: function get() {
|
|
414
|
+
return _theme.HvScopedCssBaseline;
|
|
415
|
+
}
|
|
416
|
+
});
|
|
403
417
|
Object.defineProperty(exports, "HvScrollToHorizontal", {
|
|
404
418
|
enumerable: true,
|
|
405
419
|
get: function get() {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.js"],"sourcesContent":["// components\nexport { default as HvAccordion } from \"./Accordion\";\nexport { default as HvActionsGeneric } from \"./ActionsGeneric\";\nexport { default as HvActionBar } from \"./ActionBar\";\nexport { default as HvAppSwitcher } from \"./AppSwitcher\";\nexport { default as HvAssetInventory } from \"./AssetInventory\";\nexport * from \"./AssetInventory\";\nexport { default as HvAvatar } from \"./Avatar\";\nexport { default as HvBadge } from \"./Badge\";\nexport { default as HvBanner } from \"./Banner\";\nexport * from \"./Banner\";\nexport { default as HvBarchart } from \"./Barchart\";\nexport { default as HvBaseDropdown } from \"./BaseDropdown\";\nexport { default as HvBreadcrumb } from \"./BreadCrumb\";\nexport { default as HvBulkActions } from \"./BulkActions\";\nexport { default as HvButton } from \"./Button\";\nexport { default as HvCard } from \"./Card\";\nexport * from \"./Card\";\nexport * from \"./Calendar\";\nexport { default as HvContainer } from \"./Container\";\nexport { default as HvDatePicker } from \"./DatePicker\";\nexport { default as HvDonutchart } from \"./Donutchart\";\nexport { default as HvDropdown } from \"./Dropdown\";\nexport { default as HvDropDownMenu } from \"./DropDownMenu\";\nexport { default as HvEmptyState } from \"./EmptyState\";\nexport { default as HvFilterGroup } from \"./FilterGroup\";\nexport { default as HvFileUploader } from \"./FileUploader\";\nexport * from \"./FileUploader\";\nexport { default as HvFooter } from \"./Footer\";\nexport * from \"./Forms\";\n\nexport { default as HvGrid } from \"./Grid\";\nexport { default as HvGlobalActions } from \"./GlobalActions\";\n\nexport { default as HvHeader } from \"./Header\";\nexport * from \"./Header\";\n\nexport { default as HvBaseInput } from \"./BaseInput\";\nexport { default as HvInput } from \"./Input\";\n\nexport { default as HvSlider } from \"./Slider\";\n\nexport { default as HvKpi } from \"./Kpi\";\n\nexport { default as HvLinechart } from \"./Linechart\";\nexport { default as HvLink } from \"./Link\";\nexport { default as HvListContainer } from \"./ListContainer\";\nexport * from \"./ListContainer\";\n\nexport { default as HvList } from \"./List\";\n\nexport { default as HvSelectionList } from \"./SelectionList\";\n\nexport { default as HvLoading } from \"./Loading\";\nexport { default as HvLogin } from \"./Login\";\nexport { default as HvDialog } from \"./Dialog\";\nexport * from \"./Dialog\";\nexport { default as HvMultiButton } from \"./MultiButton\";\nexport { default as HvPagination } from \"./Pagination\";\n\nexport { default as HvBaseCheckBox } from \"./BaseCheckBox\";\nexport { default as HvCheckBox } from \"./CheckBox\";\nexport { default as HvCheckBoxGroup } from \"./CheckBoxGroup\";\n\nexport { default as HvBaseRadio } from \"./BaseRadio\";\nexport { default as HvRadio } from \"./Radio\";\nexport { default as HvRadioGroup } from \"./RadioGroup\";\n\nexport { default as HvBaseSwitch } from \"./BaseSwitch\";\nexport { default as HvSwitch } from \"./Switch\";\n\nexport { default as HvSnackbar } from \"./Snackbar\";\nexport { default as HvSnackbarContent } from \"./Snackbar/SnackbarContentWrapper\";\nexport { default as HvSnackbarProvider, useHvSnackbar } from \"./Snackbar/SnackbarProvider\";\nexport { default as HvStack } from \"./Stack\";\n\nexport { default as HvTab } from \"./Tab\";\nexport { default as HvTag } from \"./Tag\";\nexport { default as HvTable } from \"./Table\";\nexport { default as HvTabs } from \"./Tabs\";\nexport { default as HvTextArea } from \"./TextArea\";\nexport { default as HvTagsInput } from \"./TagsInput\";\nexport { default as HvToggleButton } from \"./ToggleButton\";\nexport { default as HvTooltip } from \"./Tooltip\";\nexport { default as HvOverflowTooltip } from \"./OverflowTooltip\";\nexport { default as HvTypography } from \"./Typography\";\nexport { default as HvUserPreferences } from \"./UserPreferences\";\n// TODO refactor the HvUserPreferences subcomponents' names\nexport {\n Actions as HvUserPreferencesActions,\n Action as HvUserPreferencesAction,\n} from \"./UserPreferences\";\nexport {\n Options as HvUserPreferencesOptions,\n Option as HvUserPreferencesOption,\n Group as HvUserPreferencesOptionsGroup,\n Label as HvUserPreferencesOptionsGroupLabel,\n} from \"./UserPreferences\";\n\nexport { default as HvScrollToHorizontal } from \"./ScrollTo/Horizontal\";\nexport { default as HvScrollToVertical } from \"./ScrollTo/Vertical\";\nexport { default as useScrollTo } from \"./ScrollTo/useScrollTo\";\n\nexport { default as HvVerticalNavigation } from \"./VerticalNavigation\";\n// TODO refactor the HvVerticalNavigation subcomponents' names\nexport { Navigation as HvVerticalNavigationTree } from \"./VerticalNavigation\";\nexport { TreeView as HvTreeView, TreeViewItem as HvTreeViewItem } from \"./VerticalNavigation\";\nexport {\n Actions as HvVerticalNavigationActions,\n Action as HvVerticalNavigationAction,\n} from \"./VerticalNavigation\";\n\nexport { default as HvPanel } from \"./Panel\";\n\n// HOCs\nexport { default as withId } from \"./withId\";\nexport { default as withTooltip } from \"./withTooltip\";\n\n// Hooks\nexport { default as useUniqueId } from \"./useUniqueId\";\n\n// theme\nexport { default as hvTheme } from \"./theme\";\nexport { themeBuilder, getTheme } from \"./theme\";\n\n// provider\nexport { default as HvProvider } from \"./Provider\";\nexport * from \"./Provider\";\n\n// utils\nexport * from \"./utils\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.js"],"sourcesContent":["// components\nexport { default as HvAccordion } from \"./Accordion\";\nexport { default as HvActionsGeneric } from \"./ActionsGeneric\";\nexport { default as HvActionBar } from \"./ActionBar\";\nexport { default as HvAppSwitcher } from \"./AppSwitcher\";\nexport { default as HvAssetInventory } from \"./AssetInventory\";\nexport * from \"./AssetInventory\";\nexport { default as HvAvatar } from \"./Avatar\";\nexport { default as HvBadge } from \"./Badge\";\nexport { default as HvBanner } from \"./Banner\";\nexport * from \"./Banner\";\nexport { default as HvBarchart } from \"./Barchart\";\nexport { default as HvBaseDropdown } from \"./BaseDropdown\";\nexport { default as HvBreadcrumb } from \"./BreadCrumb\";\nexport { default as HvBulkActions } from \"./BulkActions\";\nexport { default as HvButton } from \"./Button\";\nexport { default as HvCard } from \"./Card\";\nexport * from \"./Card\";\nexport * from \"./Calendar\";\nexport { default as HvContainer } from \"./Container\";\nexport { default as HvDatePicker } from \"./DatePicker\";\nexport { default as HvDonutchart } from \"./Donutchart\";\nexport { default as HvDropdown } from \"./Dropdown\";\nexport { default as HvDropDownMenu } from \"./DropDownMenu\";\nexport { default as HvEmptyState } from \"./EmptyState\";\nexport { default as HvFilterGroup } from \"./FilterGroup\";\nexport { default as HvFileUploader } from \"./FileUploader\";\nexport * from \"./FileUploader\";\nexport { default as HvFooter } from \"./Footer\";\nexport * from \"./Forms\";\n\nexport { default as HvGrid } from \"./Grid\";\nexport { default as HvGlobalActions } from \"./GlobalActions\";\n\nexport { default as HvHeader } from \"./Header\";\nexport * from \"./Header\";\n\nexport { default as HvBaseInput } from \"./BaseInput\";\nexport { default as HvInput } from \"./Input\";\n\nexport { default as HvSlider } from \"./Slider\";\n\nexport { default as HvKpi } from \"./Kpi\";\n\nexport { default as HvLinechart } from \"./Linechart\";\nexport { default as HvLink } from \"./Link\";\nexport { default as HvListContainer } from \"./ListContainer\";\nexport * from \"./ListContainer\";\n\nexport { default as HvList } from \"./List\";\n\nexport { default as HvSelectionList } from \"./SelectionList\";\n\nexport { default as HvLoading } from \"./Loading\";\nexport { default as HvLogin } from \"./Login\";\nexport { default as HvDialog } from \"./Dialog\";\nexport * from \"./Dialog\";\nexport { default as HvMultiButton } from \"./MultiButton\";\nexport { default as HvPagination } from \"./Pagination\";\n\nexport { default as HvBaseCheckBox } from \"./BaseCheckBox\";\nexport { default as HvCheckBox } from \"./CheckBox\";\nexport { default as HvCheckBoxGroup } from \"./CheckBoxGroup\";\n\nexport { default as HvBaseRadio } from \"./BaseRadio\";\nexport { default as HvRadio } from \"./Radio\";\nexport { default as HvRadioGroup } from \"./RadioGroup\";\n\nexport { default as HvBaseSwitch } from \"./BaseSwitch\";\nexport { default as HvSwitch } from \"./Switch\";\n\nexport { default as HvSnackbar } from \"./Snackbar\";\nexport { default as HvSnackbarContent } from \"./Snackbar/SnackbarContentWrapper\";\nexport { default as HvSnackbarProvider, useHvSnackbar } from \"./Snackbar/SnackbarProvider\";\nexport { default as HvStack } from \"./Stack\";\n\nexport { default as HvTab } from \"./Tab\";\nexport { default as HvTag } from \"./Tag\";\nexport { default as HvTable } from \"./Table\";\nexport { default as HvTabs } from \"./Tabs\";\nexport { default as HvTextArea } from \"./TextArea\";\nexport { default as HvTagsInput } from \"./TagsInput\";\nexport { default as HvToggleButton } from \"./ToggleButton\";\nexport { default as HvTooltip } from \"./Tooltip\";\nexport { default as HvOverflowTooltip } from \"./OverflowTooltip\";\nexport { default as HvTypography } from \"./Typography\";\nexport { default as HvUserPreferences } from \"./UserPreferences\";\n// TODO refactor the HvUserPreferences subcomponents' names\nexport {\n Actions as HvUserPreferencesActions,\n Action as HvUserPreferencesAction,\n} from \"./UserPreferences\";\nexport {\n Options as HvUserPreferencesOptions,\n Option as HvUserPreferencesOption,\n Group as HvUserPreferencesOptionsGroup,\n Label as HvUserPreferencesOptionsGroupLabel,\n} from \"./UserPreferences\";\n\nexport { default as HvScrollToHorizontal } from \"./ScrollTo/Horizontal\";\nexport { default as HvScrollToVertical } from \"./ScrollTo/Vertical\";\nexport { default as useScrollTo } from \"./ScrollTo/useScrollTo\";\n\nexport { default as HvVerticalNavigation } from \"./VerticalNavigation\";\n// TODO refactor the HvVerticalNavigation subcomponents' names\nexport { Navigation as HvVerticalNavigationTree } from \"./VerticalNavigation\";\nexport { TreeView as HvTreeView, TreeViewItem as HvTreeViewItem } from \"./VerticalNavigation\";\nexport {\n Actions as HvVerticalNavigationActions,\n Action as HvVerticalNavigationAction,\n} from \"./VerticalNavigation\";\n\nexport { default as HvPanel } from \"./Panel\";\n\n// HOCs\nexport { default as withId } from \"./withId\";\nexport { default as withTooltip } from \"./withTooltip\";\n\n// Hooks\nexport { default as useUniqueId } from \"./useUniqueId\";\n\n// theme\nexport { default as hvTheme } from \"./theme\";\nexport { themeBuilder, getTheme } from \"./theme\";\nexport { HvCssBaseline, HvScopedCssBaseline } from \"./theme\";\n\n// provider\nexport { default as HvProvider } from \"./Provider\";\nexport * from \"./Provider\";\n\n// utils\nexport * from \"./utils\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;IAAA;MAAA;IAAA;EAAA;AAAA;;AAEA;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AACA;;AACA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AAEA;;AAEA;;AAEA;;AACA;;AACA;;AACA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAaA;;AACA;;AACA;;AAEA;;AASA;;AAGA;;AACA;;AAGA;;AAGA;;AAKA;;AACA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AAGA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","display","flexDirection","overflow","padding","hv","spacing","sm","backgroundColor","palette","atmosphere","atmo1","single","width","dual","fluid","closed","open","zIndex","position","top","overflowX","boxShadow","shadows","title","minHeight","whiteSpace","textOverflow","actionsContainer","flexWrap","justifyContent","overflowY","footerContainer","alignItems","marginTop","height","typography","highlightText","item","itemSelected","itemDisabled","itemTypography","itemIcon","itemTitle","itemInfo"],"sources":["../../../src/AppSwitcher/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n\n overflow: \"hidden\",\n\n // we need to play with the 4px because of the focus ring\n padding: `${theme.hv.spacing.sm - 4}px 0 ${theme.hv.spacing.sm - 4}px ${\n theme.hv.spacing.sm - 4\n }px`,\n\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n },\n\n single: {\n width: 320,\n },\n dual: {\n width:
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","display","flexDirection","overflow","padding","hv","spacing","sm","backgroundColor","palette","atmosphere","atmo1","single","width","dual","fluid","closed","open","zIndex","position","top","overflowX","boxShadow","shadows","title","minHeight","whiteSpace","textOverflow","actionsContainer","flexWrap","justifyContent","overflowY","footerContainer","alignItems","marginTop","height","typography","highlightText","item","itemSelected","itemDisabled","itemTypography","itemIcon","itemTitle","itemInfo"],"sources":["../../../src/AppSwitcher/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n\n overflow: \"hidden\",\n\n // we need to play with the 4px because of the focus ring\n padding: `${theme.hv.spacing.sm - 4}px 0 ${theme.hv.spacing.sm - 4}px ${\n theme.hv.spacing.sm - 4\n }px`,\n\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n },\n\n single: {\n width: 320,\n },\n dual: {\n width: 640,\n },\n fluid: {},\n\n closed: {\n display: \"none\",\n },\n open: {\n zIndex: \"1200\",\n position: \"absolute\",\n top: \"50px\",\n overflowX: \"hidden\",\n boxShadow: theme.hv.shadows[1],\n },\n\n title: {\n minHeight: 36,\n\n // we need to play with the 4px because of the focus ring\n padding: `4px ${theme.hv.spacing.sm}px ${theme.hv.spacing.sm - 4}px 4px`,\n\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n },\n\n actionsContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n justifyContent: \"flex-start\",\n\n overflowY: \"auto\",\n\n // we need to play with the 4px because of the focus ring\n padding: \"4px 0 4px 4px\",\n },\n\n footerContainer: {\n display: \"flex\",\n alignItems: \"center\",\n\n marginTop: \"auto\",\n\n height: 52,\n\n // we need to play with the 4px because of the focus ring\n padding: `${theme.hv.spacing.sm - 4}px ${theme.hv.spacing.sm + 4}px 4px 4px`,\n\n ...theme.hv.typography.highlightText,\n },\n\n item: {},\n itemSelected: {},\n itemDisabled: {},\n itemTypography: {},\n itemIcon: {},\n itemTitle: {},\n itemInfo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MAEhB4B,QAAQ,EAAE,MAFM;MAGhBC,cAAc,EAAE,YAHA;MAKhBC,SAAS,EAAE,MALK;MAOhB;MACA3B,OAAO,EAAE;IARO,CA7CO;IAwDzB4B,eAAe;MACb/B,OAAO,EAAE,MADI;MAEbgC,UAAU,EAAE,QAFC;MAIbC,SAAS,EAAE,MAJE;MAMbC,MAAM,EAAE,EANK;MAQb;MACA/B,OAAO,YAAKL,KAAK,CAACM,EAAN,CAASC,OAAT,CAAiBC,EAAjB,GAAsB,CAA3B,gBAAkCR,KAAK,CAACM,EAAN,CAASC,OAAT,CAAiBC,EAAjB,GAAsB,CAAxD;IATM,GAWVR,KAAK,CAACM,EAAN,CAAS+B,UAAT,CAAoBC,aAXV,CAxDU;IAsEzBC,IAAI,EAAE,EAtEmB;IAuEzBC,YAAY,EAAE,EAvEW;IAwEzBC,YAAY,EAAE,EAxEW;IAyEzBC,cAAc,EAAE,EAzES;IA0EzBC,QAAQ,EAAE,EA1Ee;IA2EzBC,SAAS,EAAE,EA3Ec;IA4EzBC,QAAQ,EAAE;EA5Ee,CAAZ;AAAA,CAAf;;AA+EA,eAAe9C,MAAf"}
|
|
@@ -48,6 +48,38 @@ var styles = function styles(theme) {
|
|
|
48
48
|
"& $input": {
|
|
49
49
|
border: "1px solid ".concat(theme.hv.palette.accent.acce1)
|
|
50
50
|
}
|
|
51
|
+
},
|
|
52
|
+
"@global": {
|
|
53
|
+
"input:-webkit-autofill": {
|
|
54
|
+
"-webkit-box-shadow": "0 0 0px 1000px ".concat(theme.hv.palette.atmosphere.atmo1, " inset"),
|
|
55
|
+
"-webkit-text-fill-color": theme.hv.typography.normalText.color
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
/* clears input's clear and reveal buttons from IE */
|
|
59
|
+
"input[type=search]::-ms-clear": {
|
|
60
|
+
display: "none",
|
|
61
|
+
width: 0,
|
|
62
|
+
height: 0
|
|
63
|
+
},
|
|
64
|
+
"input[type=search]::-ms-reveal": {
|
|
65
|
+
display: "none",
|
|
66
|
+
width: 0,
|
|
67
|
+
height: 0
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
/* clears input's clear button from Chrome */
|
|
71
|
+
"input[type=search]::-webkit-search-decoration": {
|
|
72
|
+
display: "none"
|
|
73
|
+
},
|
|
74
|
+
"input[type=search]::-webkit-search-cancel-button": {
|
|
75
|
+
display: "none"
|
|
76
|
+
},
|
|
77
|
+
"input[type=search]::-webkit-search-results-button": {
|
|
78
|
+
display: "none"
|
|
79
|
+
},
|
|
80
|
+
"input[type=search]::-webkit-search-results-decoration": {
|
|
81
|
+
display: "none"
|
|
82
|
+
}
|
|
51
83
|
}
|
|
52
84
|
},
|
|
53
85
|
resizable: {
|
|
@@ -199,12 +231,6 @@ var styles = function styles(theme) {
|
|
|
199
231
|
top: "31px",
|
|
200
232
|
left: "2px",
|
|
201
233
|
backgroundColor: theme.hv.palette.atmosphere.atmo4
|
|
202
|
-
},
|
|
203
|
-
"@global": {
|
|
204
|
-
"input:-webkit-autofill": {
|
|
205
|
-
"-webkit-box-shadow": "0 0 0px 1000px ".concat(theme.hv.palette.atmosphere.atmo1, " inset"),
|
|
206
|
-
"-webkit-text-fill-color": theme.hv.typography.normalText.color
|
|
207
|
-
}
|
|
208
234
|
}
|
|
209
235
|
};
|
|
210
236
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["outlineStyles","styles","theme","root","display","width","position","overflow","border","hv","palette","accent","acce1","backgroundColor","resizable","readOnly","disabled","atmosphere","atmo4","atmo3","invalid","semantic","sema4","inputRoot","margin","borderRadius","atmo1","inputRootFocused","background","inputRootDisabled","cursor","inputRootMultiline","padding","height","minHeight","marginLeft","marginRight","input","spacing","xs","typography","normalText","textOverflow","outline","placeholderText","opacity","flexGrow","inputDisabled","color","atmo5","inputResizable","resize","inputBorderContainer","top","left"],"sources":["../../../src/BaseInput/styles.js"],"sourcesContent":["import { outlineStyles } from \"../Focus/styles\";\n\nconst styles = (theme) => ({\n root: {\n display: \"inline-block\",\n width: \"100%\",\n position: \"relative\",\n \"& $inputRootMultiline\": {\n overflow: \"auto\",\n border: \"none\",\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n },\n resizable: {\n width: \"auto\",\n },\n readOnly: {\n \"& $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n\n // multiline\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n },\n disabled: {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n \"& $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n },\n },\n invalid: {\n \"&:not($disabled)\": {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.semantic.sema4,\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.semantic.sema4,\n },\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n },\n },\n\n inputRoot: {\n margin: 0,\n width: \"100%\",\n borderRadius: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n },\n inputRootFocused: {\n background: theme.hv.palette.atmosphere.atmo1,\n ...outlineStyles,\n \"&:hover\": {\n background: theme.hv.palette.atmosphere.atmo1,\n },\n },\n inputRootDisabled: {\n background: theme.hv.palette.atmosphere.atmo3,\n \"&:hover\": {\n background: theme.hv.palette.atmosphere.atmo3,\n cursor: \"not-allowed\",\n },\n cursor: \"not-allowed\",\n },\n inputRootMultiline: {\n padding: 0,\n backgroundColor: \"transparent\",\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n borderRadius: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n height: \"auto\",\n minHeight: \"21px\",\n padding: \"5px 10px\",\n overflow: \"auto\",\n marginLeft: \"0px\",\n marginRight: \"0px\",\n },\n },\n\n input: {\n height: \"21px\",\n marginLeft: theme.hv.spacing.xs,\n marginRight: theme.hv.spacing.xs,\n padding: \"6px 0 5px\",\n ...theme.hv.typography.normalText,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n outline: \"none\",\n \"&::placeholder\": {\n ...theme.hv.typography.placeholderText,\n opacity: 1,\n },\n \"&::-ms-clear\": {\n display: \"none\",\n },\n width: \"initial\",\n flexGrow: 1,\n },\n inputDisabled: {\n color: theme.hv.palette.atmosphere.atmo5,\n },\n inputResizable: {\n resize: \"both\",\n width: \"100%\",\n },\n\n inputBorderContainer: {\n position: \"absolute\",\n width: \"calc(100% - 4px)\",\n height: \"1px\",\n top: \"31px\",\n left: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n\n \"@global\": {\n \"input:-webkit-autofill\": {\n \"-webkit-box-shadow\": `0 0 0px 1000px ${theme.hv.palette.atmosphere.atmo1} inset`,\n \"-webkit-text-fill-color\": theme.hv.typography.normalText.color,\n },\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,aAAT,QAA8B,iBAA9B;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE;MACJC,OAAO,EAAE,cADL;MAEJC,KAAK,EAAE,MAFH;MAGJC,QAAQ,EAAE,UAHN;MAIJ,yBAAyB;QACvBC,QAAQ,EAAE,MADa;QAEvBC,MAAM,EAAE;MAFe,CAJrB;MAQJ,+BAA+B;QAC7B,YAAY;UACVA,MAAM,sBAAeN,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBC,MAAjB,CAAwBC,KAAvC;QADI;MADiB,CAR3B;MAaJ,iCAAiC;QAC/BC,eAAe,EAAEX,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBC,MAAjB,CAAwBC;MADV,CAb7B;MAgBJ,wCAAwC;QACtCC,eAAe,EAAEX,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBC,MAAjB,CAAwBC;MADH,CAhBpC;MAmBJ;MACA,wCAAwC;QACtCC,eAAe,EAAEX,KAAK,CAACO,EAAN,CAAS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aH,gBAAgB;QACdzC,OAAO,EAAE;MADK,CAbb;MAgBHC,KAAK,EAAE,SAhBJ;MAiBHyC,QAAQ,EAAE;IAjBP,EA5JoB;IA+KzBC,aAAa,EAAE;MACbC,KAAK,EAAE9C,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBO,UAAjB,CAA4BgC;IADtB,CA/KU;IAkLzBC,cAAc,EAAE;MACdC,MAAM,EAAE,MADM;MAEd9C,KAAK,EAAE;IAFO,CAlLS;IAuLzB+C,oBAAoB,EAAE;MACpB9C,QAAQ,EAAE,UADU;MAEpBD,KAAK,EAAE,kBAFa;MAGpB4B,MAAM,EAAE,KAHY;MAIpBoB,GAAG,EAAE,MAJe;MAKpBC,IAAI,EAAE,KALc;MAMpBzC,eAAe,EAAEX,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBO,UAAjB,CAA4BC;IANzB,CAvLG;IAgMzB,WAAW;MACT,0BAA0B;QACxB,+CAAwChB,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBO,UAAjB,CAA4BS,KAApE,WADwB;QAExB,2BAA2BxB,KAAK,CAACO,EAAN,CAAS+B,UAAT,CAAoBC,UAApB,CAA+BO;MAFlC;IADjB;EAhMc,CAAZ;AAAA,CAAf;;AAwMA,eAAe/C,MAAf"}
|
|
1
|
+
{"version":3,"file":"styles.js","names":["outlineStyles","styles","theme","root","display","width","position","overflow","border","hv","palette","accent","acce1","backgroundColor","atmosphere","atmo1","typography","normalText","color","height","resizable","readOnly","disabled","atmo4","atmo3","invalid","semantic","sema4","inputRoot","margin","borderRadius","inputRootFocused","background","inputRootDisabled","cursor","inputRootMultiline","padding","minHeight","marginLeft","marginRight","input","spacing","xs","textOverflow","outline","placeholderText","opacity","flexGrow","inputDisabled","atmo5","inputResizable","resize","inputBorderContainer","top","left"],"sources":["../../../src/BaseInput/styles.js"],"sourcesContent":["import { outlineStyles } from \"../Focus/styles\";\n\nconst styles = (theme) => ({\n root: {\n display: \"inline-block\",\n width: \"100%\",\n position: \"relative\",\n \"& $inputRootMultiline\": {\n overflow: \"auto\",\n border: \"none\",\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.accent.acce1,\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.accent.acce1}`,\n },\n },\n\n \"@global\": {\n \"input:-webkit-autofill\": {\n \"-webkit-box-shadow\": `0 0 0px 1000px ${theme.hv.palette.atmosphere.atmo1} inset`,\n \"-webkit-text-fill-color\": theme.hv.typography.normalText.color,\n },\n\n /* clears input's clear and reveal buttons from IE */\n \"input[type=search]::-ms-clear\": { display: \"none\", width: 0, height: 0 },\n \"input[type=search]::-ms-reveal\": { display: \"none\", width: 0, height: 0 },\n\n /* clears input's clear button from Chrome */\n \"input[type=search]::-webkit-search-decoration\": { display: \"none\" },\n \"input[type=search]::-webkit-search-cancel-button\": { display: \"none\" },\n \"input[type=search]::-webkit-search-results-button\": { display: \"none\" },\n \"input[type=search]::-webkit-search-results-decoration\": { display: \"none\" },\n },\n },\n resizable: {\n width: \"auto\",\n },\n readOnly: {\n \"& $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n\n // multiline\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: \"1px solid transparent\",\n },\n },\n },\n disabled: {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n \"& $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n },\n },\n invalid: {\n \"&:not($disabled)\": {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.semantic.sema4,\n },\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.hv.palette.semantic.sema4,\n },\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.semantic.sema4}`,\n },\n },\n },\n },\n\n inputRoot: {\n margin: 0,\n width: \"100%\",\n borderRadius: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n },\n inputRootFocused: {\n background: theme.hv.palette.atmosphere.atmo1,\n ...outlineStyles,\n \"&:hover\": {\n background: theme.hv.palette.atmosphere.atmo1,\n },\n },\n inputRootDisabled: {\n background: theme.hv.palette.atmosphere.atmo3,\n \"&:hover\": {\n background: theme.hv.palette.atmosphere.atmo3,\n cursor: \"not-allowed\",\n },\n cursor: \"not-allowed\",\n },\n inputRootMultiline: {\n padding: 0,\n backgroundColor: \"transparent\",\n \"& $input\": {\n border: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n borderRadius: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n height: \"auto\",\n minHeight: \"21px\",\n padding: \"5px 10px\",\n overflow: \"auto\",\n marginLeft: \"0px\",\n marginRight: \"0px\",\n },\n },\n\n input: {\n height: \"21px\",\n marginLeft: theme.hv.spacing.xs,\n marginRight: theme.hv.spacing.xs,\n padding: \"6px 0 5px\",\n ...theme.hv.typography.normalText,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n outline: \"none\",\n \"&::placeholder\": {\n ...theme.hv.typography.placeholderText,\n opacity: 1,\n },\n \"&::-ms-clear\": {\n display: \"none\",\n },\n width: \"initial\",\n flexGrow: 1,\n },\n inputDisabled: {\n color: theme.hv.palette.atmosphere.atmo5,\n },\n inputResizable: {\n resize: \"both\",\n width: \"100%\",\n },\n\n inputBorderContainer: {\n position: \"absolute\",\n width: \"calc(100% - 4px)\",\n height: \"1px\",\n top: \"31px\",\n left: \"2px\",\n backgroundColor: theme.hv.palette.atmosphere.atmo4,\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,aAAT,QAA8B,iBAA9B;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE;MACJC,OAAO,EAAE,cADL;MAEJC,KAAK,EAAE,MAFH;MAGJC,QAAQ,EAAE,UAHN;MAIJ,yBAAyB;QACvBC,QAAQ,EAAE,MADa;QAEvBC,MAAM,EAAE;MAFe,CAJrB;MAQJ,+BAA+B;QAC7B,YAAY;UACVA,MAAM,sBAAeN,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBC,MAAjB,CAAwBC,KAAvC;QADI;MADiB,CAR3B;MAaJ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UADU;MAEpBD,KAAK,EAAE,kBAFa;MAGpBc,MAAM,EAAE,KAHY;MAIpBkC,GAAG,EAAE,MAJe;MAKpBC,IAAI,EAAE,KALc;MAMpBzC,eAAe,EAAEX,KAAK,CAACO,EAAN,CAASC,OAAT,CAAiBI,UAAjB,CAA4BS;IANzB;EAxMG,CAAZ;AAAA,CAAf;;AAkNA,eAAetB,MAAf"}
|
|
@@ -115,9 +115,9 @@ var HvDialog = function HvDialog(_ref) {
|
|
|
115
115
|
return _onClose(event, reason);
|
|
116
116
|
},
|
|
117
117
|
onKeyDown: keyDownHandler
|
|
118
|
-
}, others
|
|
118
|
+
}, others, {
|
|
119
119
|
"aria-modal": true
|
|
120
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
120
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
121
121
|
id: setId(id, "close"),
|
|
122
122
|
className: classes.closeButton,
|
|
123
123
|
category: "ghost",
|
|
@@ -129,7 +129,7 @@ var HvDialog = function HvDialog(_ref) {
|
|
|
129
129
|
return /*#__PURE__*/React.cloneElement(c, {
|
|
130
130
|
fullscreen: fullscreen
|
|
131
131
|
});
|
|
132
|
-
}) : children)
|
|
132
|
+
}) : children);
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
process.env.NODE_ENV !== "production" ? HvDialog.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":["React","useCallback","useState","clsx","PropTypes","Dialog","withStyles","Close","isNil","Button","isKeypress","KeyboardCodes","setId","styles","withTooltip","getFocusableList","HvDialog","classes","className","id","children","open","onClose","firstFocusable","buttonTitle","fullscreen","others","focusableQueue","setFocusableQueue","measuredRef","node","focusableList","first","last","length","focus","element","document","getElementById","console","warn","keyDownHandler","event","Tab","target","shiftKey","preventDefault","Esc","onEscapeKeyDown","disableEscapeKeyDown","stopPropagation","closeButtonDisplay","CloseButtonTooltipWrapper","root","paper","background","reason","closeButton","Children","map","c","cloneElement","propTypes","string","shape","isRequired","bool","func","name"],"sources":["../../../src/Dialog/Dialog.js"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { Dialog, withStyles } from \"@material-ui/core\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport isNil from \"lodash/isNil\";\nimport Button from \"../Button\";\nimport { isKeypress, KeyboardCodes, setId } from \"../utils\";\nimport styles from \"./styles\";\nimport withTooltip from \"../withTooltip\";\nimport { getFocusableList } from \"../utils/focusableElementFinder\";\n\n/**\n * The Dialog component provides a solid foundation for creating dialogs, popovers, lightboxes, etc.\n * It is created by the composition of DialogTitle, DialogContent and DialogActions components, passed as child elements.\n */\nconst HvDialog = ({\n classes,\n className,\n id,\n children,\n open,\n onClose,\n firstFocusable,\n buttonTitle = \"Close\",\n fullscreen = false,\n ...others\n}) => {\n const [focusableQueue, setFocusableQueue] = useState(null);\n\n const measuredRef = useCallback(\n (node) => {\n if (node) {\n const focusableList = getFocusableList(node);\n setFocusableQueue({\n first: focusableList[1],\n last: focusableList[focusableList.length - 2],\n });\n if (isNil(firstFocusable)) focusableList[1].focus();\n else {\n const element = document.getElementById(firstFocusable);\n if (element) element.focus();\n else {\n // eslint-disable-next-line no-console\n console.warn(`firstFocusable element ${firstFocusable} not found.`);\n focusableList[1].focus();\n }\n }\n }\n },\n [firstFocusable]\n );\n\n const keyDownHandler = (event) => {\n if (isKeypress(event, KeyboardCodes.Tab) && !isNil(event.target) && !isNil(focusableQueue)) {\n if (event.shiftKey && event.target === focusableQueue.first) {\n focusableQueue.last.focus();\n event.preventDefault();\n }\n if (!event.shiftKey && event.target === focusableQueue.last) {\n focusableQueue.first.focus();\n event.preventDefault();\n }\n }\n // Needed as this handler overrides the one in the material ui Modal.\n else if (isKeypress(event, KeyboardCodes.Esc)) {\n if (others.onEscapeKeyDown) {\n others.onEscapeKeyDown(event);\n }\n\n if (!others.disableEscapeKeyDown) {\n // Swallow the event, in case someone is listening for the escape key on the body.\n event.stopPropagation();\n\n if (onClose) {\n onClose(event, \"escapeKeyDown\");\n }\n }\n }\n };\n\n const closeButtonDisplay = () => <Close role=\"presentation\" />;\n\n const CloseButtonTooltipWrapper = buttonTitle\n ? withTooltip(closeButtonDisplay, buttonTitle, \"top\")\n : closeButtonDisplay;\n\n return (\n <Dialog\n className={clsx(classes.root, className)}\n id={id}\n ref={measuredRef}\n open={open}\n PaperProps={{\n classes: {\n root: clsx(classes.paper, fullscreen ? \"fullscreen\" : \"\"),\n },\n }}\n fullScreen={fullscreen}\n BackdropProps={{\n classes: {\n root: classes.background,\n },\n }}\n onClose={(event, reason) => onClose(event, reason)}\n onKeyDown={keyDownHandler}\n {...others}\n >\n <div aria-modal>\n <Button\n id={setId(id, \"close\")}\n className={classes.closeButton}\n category=\"ghost\"\n onClick={(event) => onClose(event)}\n aria-label={buttonTitle}\n >\n <CloseButtonTooltipWrapper />\n </Button>\n {children && typeof children === \"object\"\n ? React.Children.map(children, (c) => React.cloneElement(c, { fullscreen }))\n : children}\n </div>\n </Dialog>\n );\n};\n\nHvDialog.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\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 background (outside) of the component.\n */\n background: PropTypes.string,\n /**\n * Style applied to the component (root).\n */\n paper: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Components of the Dialog.\n */\n children: PropTypes.node.isRequired,\n /**\n * Current state of the Dialog.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n onClose: PropTypes.func.isRequired,\n /**\n * Element id that should be focus when the Dialog opens.\n */\n firstFocusable: PropTypes.string,\n /**\n * Title for the button close.\n */\n buttonTitle: PropTypes.string,\n /**\n * Set the dialog to fullscreen mode.\n */\n fullscreen: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvDialog\" })(HvDialog);\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,QAA7B,QAA6C,OAA7C;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,MAAT,EAAiBC,UAAjB,QAAmC,mBAAnC;AACA,SAASC,KAAT,QAAsB,mCAAtB;AACA,OAAOC,KAAP,MAAkB,cAAlB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,SAASC,UAAT,EAAqBC,aAArB,EAAoCC,KAApC,QAAiD,UAAjD;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,SAASC,gBAAT,QAAiC,iCAAjC;AAEA;AACA;AACA;AACA;;AACA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,OAWX;EAAA,IAVJC,OAUI,QAVJA,OAUI;EAAA,IATJC,SASI,QATJA,SASI;EAAA,IARJC,EAQI,QARJA,EAQI;EAAA,IAPJC,QAOI,QAPJA,QAOI;EAAA,IANJC,IAMI,QANJA,IAMI;EAAA,IALJC,QAKI,QALJA,OAKI;EAAA,IAJJC,cAII,QAJJA,cAII;EAAA,4BAHJC,WAGI;EAAA,IAHJA,WAGI,iCAHU,OAGV;EAAA,2BAFJC,UAEI;EAAA,IAFJA,UAEI,gCAFS,KAET;EAAA,IADDC,MACC;;EACJ,gBAA4CxB,QAAQ,CAAC,IAAD,CAApD;EAAA;EAAA,IAAOyB,cAAP;EAAA,IAAuBC,iBAAvB;;EAEA,IAAMC,WAAW,GAAG5B,WAAW,CAC7B,UAAC6B,IAAD,EAAU;IACR,IAAIA,IAAJ,EAAU;MACR,IAAMC,aAAa,GAAGhB,gBAAgB,CAACe,IAAD,CAAtC;MACAF,iBAAiB,CAAC;QAChBI,KAAK,EAAED,aAAa,CAAC,CAAD,CADJ;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AwDA,eAAe5D,UAAU,CAACO,MAAD,EAAS;EAAEuD,IAAI,EAAE;AAAR,CAAT,CAAV,CAAyCpD,QAAzC,CAAf"}
|
|
1
|
+
{"version":3,"file":"Dialog.js","names":["React","useCallback","useState","clsx","PropTypes","Dialog","withStyles","Close","isNil","Button","isKeypress","KeyboardCodes","setId","styles","withTooltip","getFocusableList","HvDialog","classes","className","id","children","open","onClose","firstFocusable","buttonTitle","fullscreen","others","focusableQueue","setFocusableQueue","measuredRef","node","focusableList","first","last","length","focus","element","document","getElementById","console","warn","keyDownHandler","event","Tab","target","shiftKey","preventDefault","Esc","onEscapeKeyDown","disableEscapeKeyDown","stopPropagation","closeButtonDisplay","CloseButtonTooltipWrapper","root","paper","background","reason","closeButton","Children","map","c","cloneElement","propTypes","string","shape","isRequired","bool","func","name"],"sources":["../../../src/Dialog/Dialog.js"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport { Dialog, withStyles } from \"@material-ui/core\";\nimport { Close } from \"@hitachivantara/uikit-react-icons\";\nimport isNil from \"lodash/isNil\";\nimport Button from \"../Button\";\nimport { isKeypress, KeyboardCodes, setId } from \"../utils\";\nimport styles from \"./styles\";\nimport withTooltip from \"../withTooltip\";\nimport { getFocusableList } from \"../utils/focusableElementFinder\";\n\n/**\n * The Dialog component provides a solid foundation for creating dialogs, popovers, lightboxes, etc.\n * It is created by the composition of DialogTitle, DialogContent and DialogActions components, passed as child elements.\n */\nconst HvDialog = ({\n classes,\n className,\n id,\n children,\n open,\n onClose,\n firstFocusable,\n buttonTitle = \"Close\",\n fullscreen = false,\n ...others\n}) => {\n const [focusableQueue, setFocusableQueue] = useState(null);\n\n const measuredRef = useCallback(\n (node) => {\n if (node) {\n const focusableList = getFocusableList(node);\n setFocusableQueue({\n first: focusableList[1],\n last: focusableList[focusableList.length - 2],\n });\n if (isNil(firstFocusable)) focusableList[1].focus();\n else {\n const element = document.getElementById(firstFocusable);\n if (element) element.focus();\n else {\n // eslint-disable-next-line no-console\n console.warn(`firstFocusable element ${firstFocusable} not found.`);\n focusableList[1].focus();\n }\n }\n }\n },\n [firstFocusable]\n );\n\n const keyDownHandler = (event) => {\n if (isKeypress(event, KeyboardCodes.Tab) && !isNil(event.target) && !isNil(focusableQueue)) {\n if (event.shiftKey && event.target === focusableQueue.first) {\n focusableQueue.last.focus();\n event.preventDefault();\n }\n if (!event.shiftKey && event.target === focusableQueue.last) {\n focusableQueue.first.focus();\n event.preventDefault();\n }\n }\n // Needed as this handler overrides the one in the material ui Modal.\n else if (isKeypress(event, KeyboardCodes.Esc)) {\n if (others.onEscapeKeyDown) {\n others.onEscapeKeyDown(event);\n }\n\n if (!others.disableEscapeKeyDown) {\n // Swallow the event, in case someone is listening for the escape key on the body.\n event.stopPropagation();\n\n if (onClose) {\n onClose(event, \"escapeKeyDown\");\n }\n }\n }\n };\n\n const closeButtonDisplay = () => <Close role=\"presentation\" />;\n\n const CloseButtonTooltipWrapper = buttonTitle\n ? withTooltip(closeButtonDisplay, buttonTitle, \"top\")\n : closeButtonDisplay;\n\n return (\n <Dialog\n className={clsx(classes.root, className)}\n id={id}\n ref={measuredRef}\n open={open}\n PaperProps={{\n classes: {\n root: clsx(classes.paper, fullscreen ? \"fullscreen\" : \"\"),\n },\n }}\n fullScreen={fullscreen}\n BackdropProps={{\n classes: {\n root: classes.background,\n },\n }}\n onClose={(event, reason) => onClose(event, reason)}\n onKeyDown={keyDownHandler}\n {...others}\n aria-modal\n >\n <Button\n id={setId(id, \"close\")}\n className={classes.closeButton}\n category=\"ghost\"\n onClick={(event) => onClose(event)}\n aria-label={buttonTitle}\n >\n <CloseButtonTooltipWrapper />\n </Button>\n {children && typeof children === \"object\"\n ? React.Children.map(children, (c) => React.cloneElement(c, { fullscreen }))\n : children}\n </Dialog>\n );\n};\n\nHvDialog.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\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 background (outside) of the component.\n */\n background: PropTypes.string,\n /**\n * Style applied to the component (root).\n */\n paper: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Components of the Dialog.\n */\n children: PropTypes.node.isRequired,\n /**\n * Current state of the Dialog.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n onClose: PropTypes.func.isRequired,\n /**\n * Element id that should be focus when the Dialog opens.\n */\n firstFocusable: PropTypes.string,\n /**\n * Title for the button close.\n */\n buttonTitle: PropTypes.string,\n /**\n * Set the dialog to fullscreen mode.\n */\n fullscreen: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvDialog\" })(HvDialog);\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,QAA7B,QAA6C,OAA7C;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,MAAT,EAAiBC,UAAjB,QAAmC,mBAAnC;AACA,SAASC,KAAT,QAAsB,mCAAtB;AACA,OAAOC,KAAP,MAAkB,cAAlB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,SAASC,UAAT,EAAqBC,aAArB,EAAoCC,KAApC,QAAiD,UAAjD;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,SAASC,gBAAT,QAAiC,iCAAjC;AAEA;AACA;AACA;AACA;;AACA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,OAWX;EAAA,IAVJC,OAUI,QAVJA,OAUI;EAAA,IATJC,SASI,QATJA,SASI;EAAA,IARJC,EAQI,QARJA,EAQI;EAAA,IAPJC,QAOI,QAPJA,QAOI;EAAA,IANJC,IAMI,QANJA,IAMI;E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EAAErD,SAAS,CAAC2D;EAhBA,CAAhB,EAiBNE,UA7BgB;;EA8BnB;AACF;AACA;EACE7C,QAAQ,EAAEhB,SAAS,CAAC0B,IAAV,CAAemC,UAjCN;;EAkCnB;AACF;AACA;EACE5C,IAAI,EAAEjB,SAAS,CAAC8D,IAAV,CAAeD,UArCF;;EAsCnB;AACF;AACA;EACE3C,OAAO,EAAElB,SAAS,CAAC+D,IAAV,CAAeF,UAzCL;;EA0CnB;AACF;AACA;EACE1C,cAAc,EAAEnB,SAAS,CAAC2D,MA7CP;;EA8CnB;AACF;AACA;EACEvC,WAAW,EAAEpB,SAAS,CAAC2D,MAjDJ;;EAkDnB;AACF;AACA;EACEtC,UAAU,EAAErB,SAAS,CAAC8D;AArDH,CAArB;AAwDA,eAAe5D,UAAU,CAACO,MAAD,EAAS;EAAEuD,IAAI,EAAE;AAAR,CAAT,CAAV,CAAyCpD,QAAzC,CAAf"}
|
|
@@ -3,7 +3,9 @@ var styles = function styles(theme) {
|
|
|
3
3
|
root: {
|
|
4
4
|
margin: "0",
|
|
5
5
|
padding: theme.hv.spacing.sm,
|
|
6
|
-
borderTop: "3px solid ".concat(theme.hv.palette.atmosphere.atmo2)
|
|
6
|
+
borderTop: "3px solid ".concat(theme.hv.palette.atmosphere.atmo2),
|
|
7
|
+
height: 100,
|
|
8
|
+
flex: 1
|
|
7
9
|
},
|
|
8
10
|
spacing: {
|
|
9
11
|
"& > :not(:first-child)": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","margin","padding","hv","spacing","sm","borderTop","palette","atmosphere","atmo2","marginLeft","xs","fullscreen","position","width","bottom","left"],"sources":["../../../../src/Dialog/DialogActions/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n margin: \"0\",\n padding: theme.hv.spacing.sm,\n borderTop: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n },\n spacing: {\n \"& > :not(:first-child)\": {\n marginLeft: theme.hv.spacing.xs,\n },\n },\n fullscreen: {\n position: \"fixed\",\n width: \"100%\",\n bottom: 0,\n left: 0,\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE;MACJC,MAAM,EAAE,GADJ;MAEJC,OAAO,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,EAFtB;MAGJC,SAAS,sBAAeP,KAAK,CAACI,EAAN,CAASI,OAAT,CAAiBC,UAAjB,CAA4BC,KAA3C;
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","margin","padding","hv","spacing","sm","borderTop","palette","atmosphere","atmo2","height","flex","marginLeft","xs","fullscreen","position","width","bottom","left"],"sources":["../../../../src/Dialog/DialogActions/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n margin: \"0\",\n padding: theme.hv.spacing.sm,\n borderTop: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n height: 100,\n flex: 1,\n },\n spacing: {\n \"& > :not(:first-child)\": {\n marginLeft: theme.hv.spacing.xs,\n },\n },\n fullscreen: {\n position: \"fixed\",\n width: \"100%\",\n bottom: 0,\n left: 0,\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE;MACJC,MAAM,EAAE,GADJ;MAEJC,OAAO,EAAEH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,EAFtB;MAGJC,SAAS,sBAAeP,KAAK,CAACI,EAAN,CAASI,OAAT,CAAiBC,UAAjB,CAA4BC,KAA3C,CAHL;MAIJC,MAAM,EAAE,GAJJ;MAKJC,IAAI,EAAE;IALF,CADmB;IAQzBP,OAAO,EAAE;MACP,0BAA0B;QACxBQ,UAAU,EAAEb,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBS;MADL;IADnB,CARgB;IAazBC,UAAU,EAAE;MACVC,QAAQ,EAAE,OADA;MAEVC,KAAK,EAAE,MAFG;MAGVC,MAAM,EAAE,CAHE;MAIVC,IAAI,EAAE;IAJI;EAba,CAAZ;AAAA,CAAf;;AAqBA,eAAepB,MAAf"}
|