@pareto-engineering/design-system 4.0.0-alpha.3 → 4.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.js +24 -16
- package/dist/cjs/a/AppContext/Context.js +1 -1
- package/dist/cjs/a/AppContext/ContextProvider.js +19 -15
- package/dist/cjs/a/AppContext/index.js +4 -4
- package/dist/cjs/a/AppContext/useTheme.js +7 -7
- package/dist/cjs/a/ContentTree/ContentTree.js +6 -6
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +12 -12
- package/dist/cjs/a/ContentTree/common/Tree/index.js +1 -1
- package/dist/cjs/a/ContentTree/common/index.js +3 -3
- package/dist/cjs/a/ContentTree/common/useContentTree.js +14 -14
- package/dist/cjs/a/ContentTree/common/useFirstVisibleNode.js +10 -11
- package/dist/cjs/a/ContentTree/index.js +1 -1
- package/dist/cjs/a/Conversation/Context.js +1 -1
- package/dist/cjs/a/Conversation/Conversation.js +6 -6
- package/dist/cjs/a/Conversation/common/Message/Message.js +8 -8
- package/dist/cjs/a/Conversation/common/Message/index.js +1 -1
- package/dist/cjs/a/Conversation/common/index.js +1 -1
- package/dist/cjs/a/Conversation/index.js +3 -3
- package/dist/cjs/a/DotInfo/DotInfo.js +10 -14
- package/dist/cjs/a/DotInfo/index.js +1 -1
- package/dist/cjs/a/Figure/Figure.js +5 -5
- package/dist/cjs/a/Figure/index.js +1 -1
- package/dist/cjs/a/HamburgerButton/HamburgerButton.js +16 -19
- package/dist/cjs/a/HamburgerButton/index.js +1 -1
- package/dist/cjs/a/IconList/IconList.js +18 -25
- package/dist/cjs/a/IconList/common/Item/Item.js +17 -24
- package/dist/cjs/a/IconList/common/Item/index.js +1 -1
- package/dist/cjs/a/IconList/common/index.js +1 -1
- package/dist/cjs/a/IconList/index.js +1 -1
- package/dist/cjs/a/Label/Label.js +6 -6
- package/dist/cjs/a/Label/index.js +1 -1
- package/dist/cjs/a/LoadingCircle/LoadingCircle.js +10 -14
- package/dist/cjs/a/LoadingCircle/index.js +1 -1
- package/dist/cjs/a/People/People.js +8 -12
- package/dist/cjs/a/People/common/Person/Person.js +7 -7
- package/dist/cjs/a/People/common/Person/index.js +1 -1
- package/dist/cjs/a/People/common/index.js +1 -1
- package/dist/cjs/a/People/index.js +1 -1
- package/dist/cjs/a/Popover/Popover.js +8 -8
- package/dist/cjs/a/Popover/index.js +1 -1
- package/dist/cjs/a/ProgressBar/ProgressBar.js +10 -14
- package/dist/cjs/a/ProgressBar/index.js +1 -1
- package/dist/cjs/a/Quote/Quote.js +6 -6
- package/dist/cjs/a/Quote/index.js +1 -1
- package/dist/cjs/a/SVG/SVG.js +22 -25
- package/dist/cjs/a/SVG/common/UseSVG/UseSVG.js +9 -11
- package/dist/cjs/a/SVG/common/UseSVG/index.js +1 -1
- package/dist/cjs/a/SVG/common/index.js +1 -1
- package/dist/cjs/a/SVG/index.js +1 -1
- package/dist/cjs/a/SnapScroller/SnapScroller.js +5 -5
- package/dist/cjs/a/SnapScroller/index.js +1 -1
- package/dist/cjs/a/Spinner/Spinner.js +6 -6
- package/dist/cjs/a/Spinner/index.js +1 -1
- package/dist/cjs/a/Timestamp/Timestamp.js +11 -11
- package/dist/cjs/a/Timestamp/index.js +1 -1
- package/dist/cjs/a/index.js +20 -20
- package/dist/cjs/b/Button/Button.js +18 -21
- package/dist/cjs/b/Button/index.js +1 -1
- package/dist/cjs/b/Logo/Logo.js +12 -12
- package/dist/cjs/b/Logo/index.js +1 -1
- package/dist/cjs/b/Page/Context.js +1 -1
- package/dist/cjs/b/Page/Page.js +15 -18
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +39 -43
- package/dist/cjs/b/Page/common/PageHelmet/index.js +1 -1
- package/dist/cjs/b/Page/common/Section/Section.js +13 -16
- package/dist/cjs/b/Page/common/Section/index.js +1 -1
- package/dist/cjs/b/Page/common/index.js +2 -2
- package/dist/cjs/b/Page/index.js +3 -3
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +20 -24
- package/dist/cjs/b/SocialMediaButton/index.js +1 -1
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +8 -8
- package/dist/cjs/b/ThemeSelector/index.js +1 -1
- package/dist/cjs/b/Title/Title.js +5 -5
- package/dist/cjs/b/Title/index.js +1 -1
- package/dist/cjs/b/index.js +6 -6
- package/dist/cjs/c/ContentSlides/ContentSlides.js +31 -28
- package/dist/cjs/c/ContentSlides/Context.js +1 -1
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +8 -8
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/index.js +1 -1
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +7 -7
- package/dist/cjs/c/ContentSlides/common/Navigator/index.js +1 -1
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +5 -5
- package/dist/cjs/c/ContentSlides/common/Sidebar/index.js +1 -1
- package/dist/cjs/c/ContentSlides/common/Slide/Slide.js +6 -6
- package/dist/cjs/c/ContentSlides/common/Slide/index.js +1 -1
- package/dist/cjs/c/ContentSlides/common/index.js +4 -4
- package/dist/cjs/c/ContentSlides/index.js +3 -3
- package/dist/cjs/c/Modal/Modal.js +5 -5
- package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +5 -5
- package/dist/cjs/c/Modal/common/ModalHeader/index.js +1 -1
- package/dist/cjs/c/Modal/common/index.js +1 -1
- package/dist/cjs/c/Modal/index.js +1 -1
- package/dist/cjs/c/Shortener/Shortener.js +9 -9
- package/dist/cjs/c/Shortener/index.js +1 -1
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +11 -11
- package/dist/cjs/c/SocialMediaShareButton/index.js +1 -1
- package/dist/cjs/c/index.js +5 -5
- package/dist/cjs/f/FormInput/FormInput.js +13 -16
- package/dist/cjs/f/FormInput/index.js +1 -1
- package/dist/cjs/f/common/Debugger/Debugger.js +7 -7
- package/dist/cjs/f/common/Debugger/index.js +1 -1
- package/dist/cjs/f/common/Description/Description.js +7 -7
- package/dist/cjs/f/common/Description/index.js +1 -1
- package/dist/cjs/f/common/Label/Label.js +6 -6
- package/dist/cjs/f/common/Label/index.js +1 -1
- package/dist/cjs/f/common/index.js +3 -3
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +6 -6
- package/dist/cjs/f/fields/Checkbox/index.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +11 -15
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +7 -7
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/index.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/common/index.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/index.js +1 -1
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +25 -30
- package/dist/cjs/f/fields/QueryChoices/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +19 -21
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +12 -12
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +14 -17
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +22 -26
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/index.js +3 -3
- package/dist/cjs/f/fields/QueryCombobox/index.js +1 -1
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +11 -11
- package/dist/cjs/f/fields/QuerySelect/index.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +8 -8
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +7 -7
- package/dist/cjs/f/fields/RatingsInput/common/Rating/index.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/common/index.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/index.js +1 -1
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +9 -9
- package/dist/cjs/f/fields/SelectInput/index.js +1 -1
- package/dist/cjs/f/fields/TextInput/TextInput.js +7 -7
- package/dist/cjs/f/fields/TextInput/index.js +1 -1
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +7 -7
- package/dist/cjs/f/fields/TextareaInput/index.js +1 -1
- package/dist/cjs/f/fields/index.js +9 -9
- package/dist/cjs/f/index.js +3 -3
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +7 -10
- package/dist/cjs/r/SwitchRouteMap/index.js +1 -1
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +13 -16
- package/dist/cjs/r/common/PrivateRoute/index.js +1 -1
- package/dist/cjs/r/common/index.js +1 -1
- package/dist/cjs/r/index.js +2 -2
- package/dist/cjs/test/QueryLoader/QueryLoader.js +4 -4
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +1 -1
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +4 -4
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/index.js +1 -1
- package/dist/cjs/test/QueryLoader/common/index.js +1 -1
- package/dist/cjs/test/QueryLoader/index.js +1 -1
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/utils/hooks/index.js +2 -2
- package/dist/cjs/utils/hooks/useDynamicPosition.js +24 -24
- package/dist/cjs/utils/hooks/useWindowSize.js +6 -6
- package/dist/cjs/utils/index.js +2 -2
- package/package.json +2 -2
package/dist/cjs/c/index.js
CHANGED
|
@@ -5,31 +5,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "ContentSlides", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _ContentSlides.ContentSlides;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "Modal", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _Modal.Modal;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "Shortener", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _Shortener.Shortener;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "SocialMediaShareButton", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
26
|
+
get: function () {
|
|
27
27
|
return _SocialMediaShareButton.SocialMediaShareButton;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "useContentSlides", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function
|
|
32
|
+
get: function () {
|
|
33
33
|
return _ContentSlides.useContentSlides;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
@@ -7,34 +7,31 @@ exports.default = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _fields = require("../fields");
|
|
10
|
-
var _excluded = ["className", "type", "extraTypes", "disabled"];
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
11
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
13
|
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; }
|
|
15
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
14
|
// Local Definitions
|
|
18
15
|
|
|
19
16
|
// const baseClassName = styleNames.base
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
const componentClassName = 'form-input';
|
|
22
19
|
|
|
23
20
|
/**
|
|
24
21
|
* This is the component description.
|
|
25
22
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
const FormInput = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
className,
|
|
26
|
+
type,
|
|
27
|
+
extraTypes,
|
|
28
|
+
disabled,
|
|
29
|
+
...otherProps
|
|
30
|
+
} = _ref;
|
|
34
31
|
(0, React.useLayoutEffect)(() => {
|
|
35
32
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
36
33
|
}, []);
|
|
37
|
-
|
|
34
|
+
const newClassName = [className, componentClassName].filter(Boolean).join(' ');
|
|
38
35
|
if (type === 'textarea') {
|
|
39
36
|
return /*#__PURE__*/React.createElement(_fields.TextareaInput, _extends({
|
|
40
37
|
className: newClassName,
|
|
@@ -82,8 +79,8 @@ var FormInput = _ref => {
|
|
|
82
79
|
disabled: disabled
|
|
83
80
|
}, otherProps));
|
|
84
81
|
}
|
|
85
|
-
if (extraTypes
|
|
86
|
-
|
|
82
|
+
if (extraTypes?.[type]) {
|
|
83
|
+
const Component = extraTypes[type];
|
|
87
84
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
88
85
|
className: newClassName,
|
|
89
86
|
disabled: disabled
|
|
@@ -9,17 +9,17 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _b = require("../../../b");
|
|
10
10
|
var _formik = require("formik");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
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; }
|
|
14
14
|
// Local Definitions
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const componentClassName = 'debugger';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* This is the component description.
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const Debugger = _ref => {
|
|
22
|
+
let {
|
|
23
23
|
id,
|
|
24
24
|
className: userClassName,
|
|
25
25
|
style,
|
|
@@ -29,9 +29,9 @@ var Debugger = _ref => {
|
|
|
29
29
|
(0, React.useLayoutEffect)(() => {
|
|
30
30
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
31
31
|
}, []);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const [isOpen, setIsOpen] = (0, React.useState)(initialIsOpen);
|
|
33
|
+
const toggleDebugger = () => setIsOpen(!isOpen);
|
|
34
|
+
const formikContext = (0, React.useContext)(_formik.FormikContext);
|
|
35
35
|
return /*#__PURE__*/React.createElement("div", {
|
|
36
36
|
id: id,
|
|
37
37
|
className: [componentClassName, userClassName].filter(e => e).join(' '),
|
|
@@ -9,18 +9,18 @@ var _formik = require("formik");
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
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; }
|
|
14
14
|
// Local Definitions
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const baseClassName = _exports.default.base;
|
|
17
|
+
const componentClassName = 'description';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* This is the component description.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const Description = _ref => {
|
|
23
|
+
let {
|
|
24
24
|
id,
|
|
25
25
|
className: userClassName,
|
|
26
26
|
style,
|
|
@@ -32,11 +32,11 @@ var Description = _ref => {
|
|
|
32
32
|
(0, React.useLayoutEffect)(() => {
|
|
33
33
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
34
34
|
}, []);
|
|
35
|
-
|
|
35
|
+
const [field, meta] = (0, _formik.useField)(name);
|
|
36
36
|
if (description || (meta.touched || field.value) && meta.error) {
|
|
37
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
38
38
|
id: id,
|
|
39
|
-
className: [baseClassName, componentClassName, userClassName, meta.error ? 'x-error' :
|
|
39
|
+
className: [baseClassName, componentClassName, userClassName, meta.error ? 'x-error' : `x-${color}`].filter(e => e).join(' '),
|
|
40
40
|
style: style
|
|
41
41
|
}, meta.error || description);
|
|
42
42
|
}
|
|
@@ -8,18 +8,18 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
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; }
|
|
13
13
|
// Local Definitions
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const baseClassName = _exports.default.base;
|
|
16
|
+
const componentClassName = 'form-label';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* This is the component description.
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const Label = _ref => {
|
|
22
|
+
let {
|
|
23
23
|
id,
|
|
24
24
|
className: userClassName,
|
|
25
25
|
style,
|
|
@@ -36,7 +36,7 @@ var Label = _ref => {
|
|
|
36
36
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
37
37
|
htmlFor: Wrapper === 'label' ? name : undefined,
|
|
38
38
|
id: id,
|
|
39
|
-
className: [baseClassName, componentClassName, userClassName,
|
|
39
|
+
className: [baseClassName, componentClassName, userClassName, `x-${color}`].filter(e => e).join(' '),
|
|
40
40
|
style: style
|
|
41
41
|
// {...otherProps}
|
|
42
42
|
}, children, optional && ' (Optional)');
|
|
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "FormDebugger", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _Debugger.Debugger;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "FormDescription", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _Description.Description;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "FormLabel", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _Label.Label;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
@@ -11,18 +11,18 @@ var _formik = require("formik");
|
|
|
11
11
|
var _common = require("../../common");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
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; }
|
|
16
16
|
// Local Definitions
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const baseClassName = _exports.default.base;
|
|
19
|
+
const componentClassName = 'checkbox';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* This is the component description.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const Checkbox = _ref => {
|
|
25
|
+
let {
|
|
26
26
|
id,
|
|
27
27
|
className: userClassName,
|
|
28
28
|
style,
|
|
@@ -36,7 +36,7 @@ var Checkbox = _ref => {
|
|
|
36
36
|
(0, React.useLayoutEffect)(() => {
|
|
37
37
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
38
38
|
}, []);
|
|
39
|
-
|
|
39
|
+
const [field] = (0, _formik.useField)({
|
|
40
40
|
name,
|
|
41
41
|
type: 'checkbox'
|
|
42
42
|
});
|
|
@@ -11,21 +11,16 @@ var _common = require("./common");
|
|
|
11
11
|
var _common2 = require("../../common");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
function
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
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); }
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
15
|
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; }
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
const baseClassName = _exports.default.base;
|
|
17
|
+
const componentClassName = 'choices-input';
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
20
|
* This is the component description.
|
|
26
21
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const ChoicesInput = _ref => {
|
|
23
|
+
let {
|
|
29
24
|
id,
|
|
30
25
|
className: userClassName,
|
|
31
26
|
style,
|
|
@@ -47,11 +42,12 @@ var ChoicesInput = _ref => {
|
|
|
47
42
|
}, []);
|
|
48
43
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
44
|
id: id,
|
|
50
|
-
className: [baseClassName, componentClassName, userClassName, multiple && 'multiple', color &&
|
|
51
|
-
style:
|
|
45
|
+
className: [baseClassName, componentClassName, userClassName, multiple && 'multiple', color && `x-${color}`, colorChecked && `y-${colorChecked}`].filter(e => e).join(' '),
|
|
46
|
+
style: {
|
|
52
47
|
'--grid-columns-desktop': gridColumnsDesktop,
|
|
53
|
-
'--grid-columns-mobile': gridColumnsMobile
|
|
54
|
-
|
|
48
|
+
'--grid-columns-mobile': gridColumnsMobile,
|
|
49
|
+
...style
|
|
50
|
+
}
|
|
55
51
|
// {...otherProps}
|
|
56
52
|
}, label && /*#__PURE__*/React.createElement(_common2.FormLabel, {
|
|
57
53
|
as: "p",
|
|
@@ -61,7 +57,7 @@ var ChoicesInput = _ref => {
|
|
|
61
57
|
}, options.map(choice => /*#__PURE__*/React.createElement(_common.Choice, _extends({
|
|
62
58
|
key: choice.value,
|
|
63
59
|
name: name,
|
|
64
|
-
id:
|
|
60
|
+
id: `${name}-${choice.value}`,
|
|
65
61
|
multiple: multiple,
|
|
66
62
|
validate: validate,
|
|
67
63
|
disabled: disabled
|
|
@@ -9,17 +9,17 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _formik = require("formik");
|
|
10
10
|
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
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; }
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const baseClassName = _exports.default.base;
|
|
16
|
+
const componentClassName = 'choice';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* This is the component description.
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const Choice = _ref => {
|
|
22
|
+
let {
|
|
23
23
|
id,
|
|
24
24
|
className: userClassName,
|
|
25
25
|
style,
|
|
@@ -32,8 +32,8 @@ var Choice = _ref => {
|
|
|
32
32
|
validate,
|
|
33
33
|
disabled
|
|
34
34
|
} = _ref;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const type = multiple ? 'checkbox' : 'radio';
|
|
36
|
+
const [field] = (0, _formik.useField)({
|
|
37
37
|
name,
|
|
38
38
|
validate,
|
|
39
39
|
type,
|
|
@@ -9,51 +9,46 @@ var _reactRelay = require("react-relay");
|
|
|
9
9
|
var _formik = require("formik");
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _ChoicesInput = require("../ChoicesInput");
|
|
12
|
-
var _excluded = ["name", "optionsKeyMap", "query", "variables", "validate", "loadingOption", "extraVariables"];
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
14
|
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; }
|
|
16
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
24
16
|
/**
|
|
25
17
|
* This is the component description.
|
|
26
18
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
const QueryChoices = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
name,
|
|
22
|
+
optionsKeyMap,
|
|
23
|
+
query,
|
|
24
|
+
variables,
|
|
25
|
+
validate,
|
|
26
|
+
loadingOption,
|
|
27
|
+
extraVariables,
|
|
28
|
+
...otherProps
|
|
29
|
+
} = _ref;
|
|
30
|
+
const [,, helpers] = (0, _formik.useField)({
|
|
39
31
|
name,
|
|
40
32
|
validate
|
|
41
33
|
});
|
|
42
|
-
|
|
34
|
+
const {
|
|
43
35
|
setError
|
|
44
36
|
} = helpers;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
38
|
+
const [isFetching, setIsFetching] = (0, React.useState)(false);
|
|
39
|
+
const [options, setOptions] = (0, React.useState)([loadingOption]);
|
|
40
|
+
const {
|
|
49
41
|
graphql,
|
|
50
42
|
accessor
|
|
51
43
|
} = query;
|
|
52
|
-
|
|
44
|
+
const getOptions = () => {
|
|
53
45
|
if (isFetching) return;
|
|
54
|
-
|
|
46
|
+
let searchVariables = variables;
|
|
55
47
|
if (extraVariables) {
|
|
56
|
-
searchVariables =
|
|
48
|
+
searchVariables = {
|
|
49
|
+
...variables,
|
|
50
|
+
...extraVariables
|
|
51
|
+
};
|
|
57
52
|
}
|
|
58
53
|
(0, _reactRelay.fetchQuery)(environment, graphql, searchVariables).subscribe({
|
|
59
54
|
start: () => {
|
|
@@ -68,7 +63,7 @@ var QueryChoices = _ref => {
|
|
|
68
63
|
},
|
|
69
64
|
next: data => {
|
|
70
65
|
setOptions([...data[accessor].edges.map(_ref2 => {
|
|
71
|
-
|
|
66
|
+
let {
|
|
72
67
|
node
|
|
73
68
|
} = _ref2;
|
|
74
69
|
return {
|