@reltio/components 1.4.2275 → 1.4.2276

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/HOCs/withReactSelectMuiSkin/helpers.d.ts +2 -0
  2. package/HOCs/withReactSelectMuiSkin/styles.d.ts +1 -1
  3. package/HOCs/withReactSelectMuiSkin/styles.js +3 -0
  4. package/ReactSelectOption/ReactSelectOption.d.ts +2 -0
  5. package/ReactSelectOption/ReactSelectOption.js +8 -3
  6. package/SimpleDropDownSelector/SimpleDropDownSelector.d.ts +1 -1
  7. package/SimpleDropDownSelector/SimpleDropDownSelector.js +16 -2
  8. package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -2
  9. package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.module.css.js +9 -0
  10. package/SimpleDropDownSelector/index.d.ts +1 -0
  11. package/SimpleDropDownSelector/index.js +1 -0
  12. package/cjs/HOCs/withReactSelectMuiSkin/helpers.d.ts +2 -0
  13. package/cjs/HOCs/withReactSelectMuiSkin/styles.d.ts +1 -1
  14. package/cjs/HOCs/withReactSelectMuiSkin/styles.js +3 -0
  15. package/cjs/ReactSelectOption/ReactSelectOption.d.ts +2 -0
  16. package/cjs/ReactSelectOption/ReactSelectOption.js +8 -3
  17. package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.d.ts +1 -1
  18. package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.js +16 -2
  19. package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +2 -3
  20. package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.module.css.js +9 -0
  21. package/cjs/SimpleDropDownSelector/index.d.ts +1 -0
  22. package/cjs/SimpleDropDownSelector/index.js +3 -1
  23. package/package.json +1 -1
  24. package/SimpleDropDownSelector/components/DropDownValue/styles.d.ts +0 -1
  25. package/SimpleDropDownSelector/components/DropDownValue/styles.js +0 -6
  26. package/cjs/SimpleDropDownSelector/components/DropDownValue/styles.d.ts +0 -1
  27. package/cjs/SimpleDropDownSelector/components/DropDownValue/styles.js +0 -9
@@ -38,11 +38,13 @@ export declare const reactSelectComponents: {
38
38
  innerRef: import("prop-types").Requireable<any>;
39
39
  isFocused: import("prop-types").Validator<boolean>;
40
40
  isSelected: import("prop-types").Validator<boolean>;
41
+ isDisabled: import("prop-types").Requireable<boolean>;
41
42
  label: import("prop-types").Requireable<string>;
42
43
  selectProps: import("prop-types").Requireable<import("prop-types").InferProps<{
43
44
  classes: import("prop-types").Requireable<import("prop-types").InferProps<{
44
45
  option: import("prop-types").Requireable<string>;
45
46
  'option--selected': import("prop-types").Requireable<string>;
47
+ 'option--disabled': import("prop-types").Requireable<string>;
46
48
  }>>;
47
49
  }>>;
48
50
  };
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"menu" | "option" | "placeholder" | "singleValue" | "dropdownIndicator" | "clearIndicator" | "control" | "groupHeading" | "multiValue" | "noOptionsMessage" | "valueContainer" | "multiValue__label" | "option--selected" | "option--item" | "valueContainer--multi">;
1
+ export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"menu" | "option" | "placeholder" | "singleValue" | "dropdownIndicator" | "clearIndicator" | "control" | "groupHeading" | "multiValue" | "noOptionsMessage" | "valueContainer" | "multiValue__label" | "option--selected" | "option--disabled" | "option--item" | "valueContainer--multi">;
@@ -58,6 +58,9 @@ export var useStyles = makeStyles(function (theme) { return ({
58
58
  'option--selected': {
59
59
  fontWeight: 400
60
60
  },
61
+ // Always defined so the dynamic class key is never `undefined`. Consumers supply the actual
62
+ // disabled-option styling per-instance via the `classes` prop (merged on top of this).
63
+ 'option--disabled': {},
61
64
  'option--item': {
62
65
  display: 'block',
63
66
  width: '100%',
@@ -13,11 +13,13 @@ export namespace ReactSelectOption {
13
13
  let innerRef: PropTypes.Requireable<any>;
14
14
  let isFocused: PropTypes.Validator<boolean>;
15
15
  let isSelected: PropTypes.Validator<boolean>;
16
+ let isDisabled: PropTypes.Requireable<boolean>;
16
17
  let label: PropTypes.Requireable<string>;
17
18
  let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
18
19
  classes: PropTypes.Requireable<PropTypes.InferProps<{
19
20
  option: PropTypes.Requireable<string>;
20
21
  'option--selected': PropTypes.Requireable<string>;
22
+ 'option--disabled': PropTypes.Requireable<string>;
21
23
  }>>;
22
24
  }>>;
23
25
  }
@@ -16,8 +16,11 @@ import MenuItem from '@mui/material/MenuItem';
16
16
  import { ExpandedValueTooltip } from '../ExpandedValueTooltip';
17
17
  export var ReactSelectOption = function (props) {
18
18
  var _a;
19
- var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, label = props.label, classes = props.selectProps.classes;
20
- return (React.createElement(MenuItem, __assign({ className: classNames(classes.option, (_a = {}, _a[classes['option--selected']] = isSelected, _a)), ref: innerRef, selected: isFocused, component: "div" }, innerProps),
19
+ var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, isDisabled = props.isDisabled, label = props.label, classes = props.selectProps.classes;
20
+ return (React.createElement(MenuItem, __assign({ className: classNames(classes.option, (_a = {},
21
+ _a[classes['option--selected']] = isSelected,
22
+ _a[classes['option--disabled']] = isDisabled,
23
+ _a)), ref: innerRef, selected: isFocused, disabled: isDisabled, component: "div" }, innerProps),
21
24
  React.createElement(ExpandedValueTooltip, { value: label },
22
25
  React.createElement("div", { className: classes['option--item'] }, children))));
23
26
  };
@@ -40,11 +43,13 @@ ReactSelectOption.propTypes = {
40
43
  ]),
41
44
  isFocused: PropTypes.bool.isRequired,
42
45
  isSelected: PropTypes.bool.isRequired,
46
+ isDisabled: PropTypes.bool,
43
47
  label: PropTypes.string,
44
48
  selectProps: PropTypes.shape({
45
49
  classes: PropTypes.shape({
46
50
  option: PropTypes.string,
47
- 'option--selected': PropTypes.string
51
+ 'option--selected': PropTypes.string,
52
+ 'option--disabled': PropTypes.string
48
53
  })
49
54
  })
50
55
  };
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { DropDownSelector } from '../DropDownSelector';
3
- declare const _default: React.MemoExoticComponent<(props: React.ComponentProps<typeof DropDownSelector>) => React.JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ components, ...props }: React.ComponentProps<typeof DropDownSelector>) => React.JSX.Element>;
4
4
  export default _default;
@@ -9,13 +9,27 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import React, { memo } from 'react';
13
24
  import { DropDownSelector } from '../DropDownSelector';
14
25
  import { DropDownValue } from './components/DropDownValue';
15
26
  import { DropDownPlaceholder } from './components/DropDownPlaceholder';
16
- var components = {
27
+ var defaultComponents = {
17
28
  SingleValue: DropDownValue,
18
29
  Placeholder: DropDownPlaceholder
19
30
  };
20
- var SimpleDropDownSelector = function (props) { return (React.createElement(DropDownSelector, __assign({ components: components }, props))); };
31
+ var SimpleDropDownSelector = function (_a) {
32
+ var components = _a.components, props = __rest(_a, ["components"]);
33
+ return (React.createElement(DropDownSelector, __assign({ components: __assign(__assign({}, defaultComponents), components) }, props)));
34
+ };
21
35
  export default memo(SimpleDropDownSelector);
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import Typography from '@mui/material/Typography';
3
- import { useStyles } from './styles';
3
+ import styles from './DropDownValue.module.css';
4
4
  export var DropDownValue = function (_a) {
5
5
  var menuIsOpen = _a.selectProps.menuIsOpen, label = _a.data.label;
6
- var styles = useStyles();
7
6
  return (!menuIsOpen && (React.createElement(Typography, { "data-reltio-id": "simple-drop-down-value", variant: "body2", classes: { root: styles.value } }, label)));
8
7
  };
@@ -0,0 +1,9 @@
1
+ const styles = {"value":"DropDownValue-value--DA2jT"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.DropDownValue-value--DA2jT{color:var(--mui-palette-text-primary)}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -1 +1,2 @@
1
1
  export { default as SimpleDropDownSelector } from './SimpleDropDownSelector';
2
+ export { DropDownValue } from './components/DropDownValue';
@@ -1 +1,2 @@
1
1
  export { default as SimpleDropDownSelector } from './SimpleDropDownSelector';
2
+ export { DropDownValue } from './components/DropDownValue';
@@ -38,11 +38,13 @@ export declare const reactSelectComponents: {
38
38
  innerRef: import("prop-types").Requireable<any>;
39
39
  isFocused: import("prop-types").Validator<boolean>;
40
40
  isSelected: import("prop-types").Validator<boolean>;
41
+ isDisabled: import("prop-types").Requireable<boolean>;
41
42
  label: import("prop-types").Requireable<string>;
42
43
  selectProps: import("prop-types").Requireable<import("prop-types").InferProps<{
43
44
  classes: import("prop-types").Requireable<import("prop-types").InferProps<{
44
45
  option: import("prop-types").Requireable<string>;
45
46
  'option--selected': import("prop-types").Requireable<string>;
47
+ 'option--disabled': import("prop-types").Requireable<string>;
46
48
  }>>;
47
49
  }>>;
48
50
  };
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"menu" | "option" | "placeholder" | "singleValue" | "dropdownIndicator" | "clearIndicator" | "control" | "groupHeading" | "multiValue" | "noOptionsMessage" | "valueContainer" | "multiValue__label" | "option--selected" | "option--item" | "valueContainer--multi">;
1
+ export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"menu" | "option" | "placeholder" | "singleValue" | "dropdownIndicator" | "clearIndicator" | "control" | "groupHeading" | "multiValue" | "noOptionsMessage" | "valueContainer" | "multiValue__label" | "option--selected" | "option--disabled" | "option--item" | "valueContainer--multi">;
@@ -61,6 +61,9 @@ exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
61
61
  'option--selected': {
62
62
  fontWeight: 400
63
63
  },
64
+ // Always defined so the dynamic class key is never `undefined`. Consumers supply the actual
65
+ // disabled-option styling per-instance via the `classes` prop (merged on top of this).
66
+ 'option--disabled': {},
64
67
  'option--item': {
65
68
  display: 'block',
66
69
  width: '100%',
@@ -13,11 +13,13 @@ export namespace ReactSelectOption {
13
13
  let innerRef: PropTypes.Requireable<any>;
14
14
  let isFocused: PropTypes.Validator<boolean>;
15
15
  let isSelected: PropTypes.Validator<boolean>;
16
+ let isDisabled: PropTypes.Requireable<boolean>;
16
17
  let label: PropTypes.Requireable<string>;
17
18
  let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
18
19
  classes: PropTypes.Requireable<PropTypes.InferProps<{
19
20
  option: PropTypes.Requireable<string>;
20
21
  'option--selected': PropTypes.Requireable<string>;
22
+ 'option--disabled': PropTypes.Requireable<string>;
21
23
  }>>;
22
24
  }>>;
23
25
  }
@@ -22,8 +22,11 @@ var MenuItem_1 = __importDefault(require("@mui/material/MenuItem"));
22
22
  var ExpandedValueTooltip_1 = require("../ExpandedValueTooltip");
23
23
  var ReactSelectOption = function (props) {
24
24
  var _a;
25
- var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, label = props.label, classes = props.selectProps.classes;
26
- return (react_1.default.createElement(MenuItem_1.default, __assign({ className: (0, classnames_1.default)(classes.option, (_a = {}, _a[classes['option--selected']] = isSelected, _a)), ref: innerRef, selected: isFocused, component: "div" }, innerProps),
25
+ var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, isDisabled = props.isDisabled, label = props.label, classes = props.selectProps.classes;
26
+ return (react_1.default.createElement(MenuItem_1.default, __assign({ className: (0, classnames_1.default)(classes.option, (_a = {},
27
+ _a[classes['option--selected']] = isSelected,
28
+ _a[classes['option--disabled']] = isDisabled,
29
+ _a)), ref: innerRef, selected: isFocused, disabled: isDisabled, component: "div" }, innerProps),
27
30
  react_1.default.createElement(ExpandedValueTooltip_1.ExpandedValueTooltip, { value: label },
28
31
  react_1.default.createElement("div", { className: classes['option--item'] }, children))));
29
32
  };
@@ -47,11 +50,13 @@ exports.ReactSelectOption.propTypes = {
47
50
  ]),
48
51
  isFocused: prop_types_1.default.bool.isRequired,
49
52
  isSelected: prop_types_1.default.bool.isRequired,
53
+ isDisabled: prop_types_1.default.bool,
50
54
  label: prop_types_1.default.string,
51
55
  selectProps: prop_types_1.default.shape({
52
56
  classes: prop_types_1.default.shape({
53
57
  option: prop_types_1.default.string,
54
- 'option--selected': prop_types_1.default.string
58
+ 'option--selected': prop_types_1.default.string,
59
+ 'option--disabled': prop_types_1.default.string
55
60
  })
56
61
  })
57
62
  };
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { DropDownSelector } from '../DropDownSelector';
3
- declare const _default: React.MemoExoticComponent<(props: React.ComponentProps<typeof DropDownSelector>) => React.JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ components, ...props }: React.ComponentProps<typeof DropDownSelector>) => React.JSX.Element>;
4
4
  export default _default;
@@ -33,14 +33,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
33
33
  __setModuleDefault(result, mod);
34
34
  return result;
35
35
  };
36
+ var __rest = (this && this.__rest) || function (s, e) {
37
+ var t = {};
38
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
39
+ t[p] = s[p];
40
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
41
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
42
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
43
+ t[p[i]] = s[p[i]];
44
+ }
45
+ return t;
46
+ };
36
47
  Object.defineProperty(exports, "__esModule", { value: true });
37
48
  var react_1 = __importStar(require("react"));
38
49
  var DropDownSelector_1 = require("../DropDownSelector");
39
50
  var DropDownValue_1 = require("./components/DropDownValue");
40
51
  var DropDownPlaceholder_1 = require("./components/DropDownPlaceholder");
41
- var components = {
52
+ var defaultComponents = {
42
53
  SingleValue: DropDownValue_1.DropDownValue,
43
54
  Placeholder: DropDownPlaceholder_1.DropDownPlaceholder
44
55
  };
45
- var SimpleDropDownSelector = function (props) { return (react_1.default.createElement(DropDownSelector_1.DropDownSelector, __assign({ components: components }, props))); };
56
+ var SimpleDropDownSelector = function (_a) {
57
+ var components = _a.components, props = __rest(_a, ["components"]);
58
+ return (react_1.default.createElement(DropDownSelector_1.DropDownSelector, __assign({ components: __assign(__assign({}, defaultComponents), components) }, props)));
59
+ };
46
60
  exports.default = (0, react_1.memo)(SimpleDropDownSelector);
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.DropDownValue = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
8
  var Typography_1 = __importDefault(require("@mui/material/Typography"));
9
- var styles_1 = require("./styles");
9
+ var DropDownValue_module_css_1 = __importDefault(require("./DropDownValue.module.css"));
10
10
  var DropDownValue = function (_a) {
11
11
  var menuIsOpen = _a.selectProps.menuIsOpen, label = _a.data.label;
12
- var styles = (0, styles_1.useStyles)();
13
- return (!menuIsOpen && (react_1.default.createElement(Typography_1.default, { "data-reltio-id": "simple-drop-down-value", variant: "body2", classes: { root: styles.value } }, label)));
12
+ return (!menuIsOpen && (react_1.default.createElement(Typography_1.default, { "data-reltio-id": "simple-drop-down-value", variant: "body2", classes: { root: DropDownValue_module_css_1.default.value } }, label)));
14
13
  };
15
14
  exports.DropDownValue = DropDownValue;
@@ -0,0 +1,9 @@
1
+ const styles = {"value":"DropDownValue-value--DA2jT"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.DropDownValue-value--DA2jT{color:var(--mui-palette-text-primary)}`;
7
+ head.appendChild(style);
8
+ }
9
+ module.exports = styles;
@@ -1 +1,2 @@
1
1
  export { default as SimpleDropDownSelector } from './SimpleDropDownSelector';
2
+ export { DropDownValue } from './components/DropDownValue';
@@ -3,6 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SimpleDropDownSelector = void 0;
6
+ exports.DropDownValue = exports.SimpleDropDownSelector = void 0;
7
7
  var SimpleDropDownSelector_1 = require("./SimpleDropDownSelector");
8
8
  Object.defineProperty(exports, "SimpleDropDownSelector", { enumerable: true, get: function () { return __importDefault(SimpleDropDownSelector_1).default; } });
9
+ var DropDownValue_1 = require("./components/DropDownValue");
10
+ Object.defineProperty(exports, "DropDownValue", { enumerable: true, get: function () { return DropDownValue_1.DropDownValue; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.2275",
3
+ "version": "1.4.2276",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"value">;
@@ -1,6 +0,0 @@
1
- import { makeStyles } from '@mui/styles';
2
- export var useStyles = makeStyles({
3
- value: {
4
- color: 'rgba(0, 0, 0, 0.87)'
5
- }
6
- });
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"value">;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useStyles = void 0;
4
- var styles_1 = require("@mui/styles");
5
- exports.useStyles = (0, styles_1.makeStyles)({
6
- value: {
7
- color: 'rgba(0, 0, 0, 0.87)'
8
- }
9
- });