@pareto-engineering/design-system 4.0.0-alpha.59 → 4.0.0-alpha.61
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/cjs/a/AnimatedBlobs/AnimatedBlobs.js +6 -7
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +9 -9
- package/dist/cjs/a/AppContext/Context.js +3 -4
- package/dist/cjs/a/AppContext/ContextProvider.js +6 -6
- package/dist/cjs/a/AppContext/useTheme.js +2 -3
- package/dist/cjs/a/BlurOverlay/BlurOverlay.js +6 -7
- package/dist/cjs/a/ContentTree/ContentTree.js +8 -7
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +8 -8
- package/dist/cjs/a/ContentTree/common/useContentTree.js +1 -2
- package/dist/cjs/a/ContentTree/common/useFirstVisibleNode.js +1 -2
- package/dist/cjs/a/Conversation/Context.js +3 -4
- package/dist/cjs/a/Conversation/Conversation.js +8 -7
- package/dist/cjs/a/Conversation/common/Message/Message.js +3 -4
- package/dist/cjs/a/DotInfo/DotInfo.js +6 -7
- package/dist/cjs/a/Figure/Figure.js +6 -7
- package/dist/cjs/a/HamburgerButton/HamburgerButton.js +5 -8
- package/dist/cjs/a/IconList/IconList.js +5 -8
- package/dist/cjs/a/IconList/common/Item/Item.js +3 -4
- package/dist/cjs/a/Label/Label.js +5 -8
- package/dist/cjs/a/LoadingCircle/LoadingCircle.js +6 -7
- package/dist/cjs/a/MetaCard/MetaCard.js +6 -7
- package/dist/cjs/a/People/People.js +8 -7
- package/dist/cjs/a/People/common/Person/Person.js +3 -4
- package/dist/cjs/a/Popover/Popover.js +11 -9
- package/dist/cjs/a/ProgressBar/ProgressBar.js +6 -7
- package/dist/cjs/a/Quote/Quote.js +6 -7
- package/dist/cjs/a/Removable/Removable.js +6 -7
- package/dist/cjs/a/SVG/SVG.js +8 -10
- package/dist/cjs/a/SVG/common/UseSVG/UseSVG.js +3 -4
- package/dist/cjs/a/SnapScroller/SnapScroller.js +12 -12
- package/dist/cjs/a/Spinner/Spinner.js +6 -7
- package/dist/cjs/a/TextSteps/TextSteps.js +4 -7
- package/dist/cjs/a/Timestamp/Timestamp.js +12 -12
- package/dist/cjs/a/Tip/Tip.js +6 -7
- package/dist/cjs/a/ToggleSwitch/ToggleSwitch.js +10 -11
- package/dist/cjs/b/Button/Button.js +4 -8
- package/dist/cjs/b/Button/common/Group/Group.js +5 -8
- package/dist/cjs/b/Card/Card.js +6 -7
- package/dist/cjs/b/Card/common/Group/Group.js +5 -8
- package/dist/cjs/b/Card/common/Section/Section.js +3 -4
- package/dist/cjs/b/Logo/Logo.js +9 -9
- package/dist/cjs/b/Page/Context.js +3 -4
- package/dist/cjs/b/Page/Page.js +8 -11
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +6 -6
- package/dist/cjs/b/Page/common/Section/Section.js +3 -4
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +5 -8
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +10 -10
- package/dist/cjs/b/Title/Title.js +4 -10
- package/dist/cjs/c/ContentSlides/ContentSlides.js +10 -10
- package/dist/cjs/c/ContentSlides/Context.js +3 -4
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +3 -4
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +3 -4
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +3 -4
- package/dist/cjs/c/ContentSlides/common/Slide/Slide.js +3 -4
- package/dist/cjs/c/Modal/Modal.js +6 -7
- package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +3 -4
- package/dist/cjs/c/Shortener/Shortener.js +11 -9
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +6 -7
- package/dist/cjs/f/FormInput/FormInput.js +7 -9
- package/dist/cjs/f/common/Debugger/Debugger.js +10 -10
- package/dist/cjs/f/common/Description/Description.js +6 -7
- package/dist/cjs/f/common/InputWrapper/InputWrapper.js +6 -7
- package/dist/cjs/f/common/Label/Label.js +6 -7
- package/dist/cjs/f/common/index.js +19 -1
- package/dist/cjs/f/common/utils/index.js +12 -0
- package/dist/cjs/f/common/utils/lookUpInputValueFromFetchedOptions.js +29 -0
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +5 -8
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +7 -9
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +3 -4
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +11 -8
- package/dist/cjs/f/fields/EditorInput/common/Toolbar.js +17 -17
- package/dist/cjs/f/fields/EditorInput/common/TreeViewPlugin.js +1 -2
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +7 -9
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +8 -8
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +27 -14
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +29 -11
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +3 -4
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +30 -12
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +8 -8
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +11 -9
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +3 -4
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +7 -9
- package/dist/cjs/f/fields/TextInput/TextInput.js +7 -9
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +7 -9
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +3 -4
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +6 -6
- package/dist/cjs/test/QueryLoader/QueryLoader.js +7 -7
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +3 -4
- package/dist/cjs/utils/hooks/useDynamicPosition.js +1 -2
- package/dist/cjs/utils/hooks/useWindowSize.js +1 -2
- package/dist/es/a/AnimatedBlobs/AnimatedBlobs.js +18 -23
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +2 -4
- package/dist/es/a/BlurOverlay/BlurOverlay.js +6 -11
- package/dist/es/a/ContentTree/ContentTree.js +1 -4
- package/dist/es/a/Conversation/Conversation.js +11 -16
- package/dist/es/a/DotInfo/DotInfo.js +9 -14
- package/dist/es/a/Figure/Figure.js +10 -15
- package/dist/es/a/HamburgerButton/HamburgerButton.js +13 -18
- package/dist/es/a/IconList/IconList.js +10 -15
- package/dist/es/a/Label/Label.js +6 -11
- package/dist/es/a/LoadingCircle/LoadingCircle.js +32 -37
- package/dist/es/a/MetaCard/MetaCard.js +6 -11
- package/dist/es/a/People/People.js +11 -16
- package/dist/es/a/Popover/Popover.js +2 -4
- package/dist/es/a/ProgressBar/ProgressBar.js +12 -17
- package/dist/es/a/Quote/Quote.js +14 -19
- package/dist/es/a/Removable/Removable.js +13 -18
- package/dist/es/a/SVG/SVG.js +2 -4
- package/dist/es/a/SnapScroller/SnapScroller.js +2 -4
- package/dist/es/a/Spinner/Spinner.js +9 -14
- package/dist/es/a/TextSteps/TextSteps.js +12 -17
- package/dist/es/a/Timestamp/Timestamp.js +3 -5
- package/dist/es/a/Tip/Tip.js +9 -14
- package/dist/es/a/ToggleSwitch/ToggleSwitch.js +20 -25
- package/dist/es/b/Button/Button.js +0 -4
- package/dist/es/b/Button/common/Group/Group.js +6 -11
- package/dist/es/b/Card/Card.js +11 -16
- package/dist/es/b/Card/common/Group/Group.js +1 -4
- package/dist/es/b/Logo/Logo.js +2 -4
- package/dist/es/b/Page/Page.js +2 -6
- package/dist/es/b/SocialMediaButton/SocialMediaButton.js +1 -4
- package/dist/es/b/ThemeSelector/ThemeSelector.js +3 -5
- package/dist/es/b/Title/Title.js +11 -20
- package/dist/es/c/ContentSlides/ContentSlides.js +1 -3
- package/dist/es/c/Modal/Modal.js +13 -18
- package/dist/es/c/Shortener/Shortener.js +2 -4
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +1 -4
- package/dist/es/f/FormInput/FormInput.js +2 -4
- package/dist/es/f/common/Debugger/Debugger.js +2 -4
- package/dist/es/f/common/Description/Description.js +1 -4
- package/dist/es/f/common/InputWrapper/InputWrapper.js +10 -15
- package/dist/es/f/common/Label/Label.js +12 -17
- package/dist/es/f/common/index.js +2 -1
- package/dist/es/f/common/utils/index.js +1 -0
- package/dist/es/f/common/utils/lookUpInputValueFromFetchedOptions.js +20 -0
- package/dist/es/f/fields/Checkbox/Checkbox.js +1 -4
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +30 -34
- package/dist/es/f/fields/EditorInput/EditorInput.js +2 -4
- package/dist/es/f/fields/LinkInput/LinkInput.js +2 -4
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +17 -8
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +22 -4
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +22 -4
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +2 -4
- package/dist/es/f/fields/SelectInput/SelectInput.js +2 -4
- package/dist/es/f/fields/TextInput/TextInput.js +2 -4
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +2 -4
- package/package.json +4 -3
- package/src/stories/f/QueryCombobox.stories.jsx +18 -0
- package/src/ui/a/AnimatedBlobs/AnimatedBlobs.jsx +25 -31
- package/src/ui/a/AnimatedGradient/AnimatedGradient.jsx +2 -5
- package/src/ui/a/BlurOverlay/BlurOverlay.jsx +18 -24
- package/src/ui/a/ContentTree/ContentTree.jsx +2 -6
- package/src/ui/a/Conversation/Conversation.jsx +26 -32
- package/src/ui/a/DotInfo/DotInfo.jsx +23 -29
- package/src/ui/a/Figure/Figure.jsx +21 -27
- package/src/ui/a/HamburgerButton/HamburgerButton.jsx +27 -33
- package/src/ui/a/IconList/IconList.jsx +22 -28
- package/src/ui/a/Label/Label.jsx +21 -27
- package/src/ui/a/LoadingCircle/LoadingCircle.jsx +43 -49
- package/src/ui/a/MetaCard/MetaCard.jsx +19 -25
- package/src/ui/a/People/People.jsx +25 -31
- package/src/ui/a/Popover/Popover.jsx +3 -5
- package/src/ui/a/ProgressBar/ProgressBar.jsx +25 -31
- package/src/ui/a/Quote/Quote.jsx +26 -32
- package/src/ui/a/Removable/Removable.jsx +22 -29
- package/src/ui/a/SVG/SVG.jsx +3 -5
- package/src/ui/a/SnapScroller/SnapScroller.jsx +2 -4
- package/src/ui/a/Spinner/Spinner.jsx +19 -25
- package/src/ui/a/TextSteps/TextSteps.jsx +27 -34
- package/src/ui/a/Timestamp/Timestamp.jsx +5 -7
- package/src/ui/a/Tip/Tip.jsx +22 -28
- package/src/ui/a/ToggleSwitch/ToggleSwitch.jsx +33 -35
- package/src/ui/b/Button/Button.jsx +0 -5
- package/src/ui/b/Button/common/Group/Group.jsx +18 -24
- package/src/ui/b/Card/Card.jsx +25 -31
- package/src/ui/b/Card/common/Group/Group.jsx +2 -5
- package/src/ui/b/Logo/Logo.jsx +3 -5
- package/src/ui/b/Page/Page.jsx +2 -7
- package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +2 -7
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +4 -6
- package/src/ui/b/Title/Title.jsx +36 -46
- package/src/ui/c/ContentSlides/ContentSlides.jsx +2 -4
- package/src/ui/c/Modal/Modal.jsx +24 -30
- package/src/ui/c/Shortener/Shortener.jsx +3 -5
- package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +2 -6
- package/src/ui/f/FormInput/FormInput.jsx +3 -5
- package/src/ui/f/common/Debugger/Debugger.jsx +3 -5
- package/src/ui/f/common/Description/Description.jsx +2 -6
- package/src/ui/f/common/InputWrapper/InputWrapper.jsx +21 -27
- package/src/ui/f/common/Label/Label.jsx +25 -31
- package/src/ui/f/common/index.js +1 -0
- package/src/ui/f/common/utils/index.js +1 -0
- package/src/ui/f/common/utils/lookUpInputValueFromFetchedOptions.js +23 -0
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +2 -6
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +48 -52
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +2 -5
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +2 -5
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +21 -11
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +18 -2
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +18 -1
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +3 -5
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +3 -5
- package/src/ui/f/fields/TextInput/TextInput.jsx +3 -5
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +3 -5
- package/tests/__snapshots__/Storyshots.test.js.snap +269 -20
- package/dist/cjs/b/Title/styles.scss +0 -16
- package/dist/es/b/Title/styles.scss +0 -16
- package/src/ui/b/Title/styles.scss +0 -16
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
Navigator,
|
|
19
19
|
} from './common'
|
|
20
20
|
|
|
21
|
+
import './styles.scss'
|
|
22
|
+
|
|
21
23
|
// Local Definitions
|
|
22
24
|
|
|
23
25
|
const baseClassName = styleNames.base
|
|
@@ -64,10 +66,6 @@ const ContentSlides = ({
|
|
|
64
66
|
isDebug,
|
|
65
67
|
// ...otherProps
|
|
66
68
|
}) => {
|
|
67
|
-
useInsertionEffect(() => {
|
|
68
|
-
import('./styles.scss')
|
|
69
|
-
}, [])
|
|
70
|
-
|
|
71
69
|
const history = useHistory()
|
|
72
70
|
|
|
73
71
|
const [state, dispatch] = useReducer(reducer, {
|
package/src/ui/c/Modal/Modal.jsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { useInsertionEffect } from 'react'
|
|
5
|
-
|
|
6
4
|
import PropTypes from 'prop-types'
|
|
7
5
|
|
|
8
6
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
7
|
|
|
10
8
|
import { ModalHeader } from './common'
|
|
11
9
|
|
|
10
|
+
import './styles.scss'
|
|
11
|
+
|
|
12
12
|
// Local Definitions
|
|
13
13
|
|
|
14
14
|
const baseClassName = styleNames.base
|
|
@@ -27,35 +27,29 @@ const Modal = ({
|
|
|
27
27
|
color,
|
|
28
28
|
close,
|
|
29
29
|
// ...otherProps
|
|
30
|
-
}) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
close={close}
|
|
51
|
-
color={color}
|
|
52
|
-
/>
|
|
53
|
-
<div className="modal-body">
|
|
54
|
-
{children}
|
|
55
|
-
</div>
|
|
30
|
+
}) => (
|
|
31
|
+
<div
|
|
32
|
+
id={id}
|
|
33
|
+
className={[
|
|
34
|
+
baseClassName,
|
|
35
|
+
componentClassName,
|
|
36
|
+
userClassName,
|
|
37
|
+
]
|
|
38
|
+
.filter((e) => e)
|
|
39
|
+
.join(' ')}
|
|
40
|
+
style={style}
|
|
41
|
+
// {...otherProps}
|
|
42
|
+
>
|
|
43
|
+
<ModalHeader
|
|
44
|
+
title={title}
|
|
45
|
+
close={close}
|
|
46
|
+
color={color}
|
|
47
|
+
/>
|
|
48
|
+
<div className="modal-body">
|
|
49
|
+
{children}
|
|
56
50
|
</div>
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
59
53
|
|
|
60
54
|
Modal.propTypes = {
|
|
61
55
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { useState } from 'react'
|
|
5
5
|
|
|
6
6
|
import PropTypes from 'prop-types'
|
|
7
7
|
|
|
@@ -10,6 +10,8 @@ import styleNames from '@pareto-engineering/bem/exports'
|
|
|
10
10
|
// Local Definitions
|
|
11
11
|
import { Button } from 'ui/b'
|
|
12
12
|
|
|
13
|
+
import './styles.scss'
|
|
14
|
+
|
|
13
15
|
const baseClassName = styleNames.base
|
|
14
16
|
|
|
15
17
|
const componentClassName = 'shortener'
|
|
@@ -31,10 +33,6 @@ const Shortener = ({
|
|
|
31
33
|
|
|
32
34
|
countLetters,
|
|
33
35
|
}) => {
|
|
34
|
-
useInsertionEffect(() => {
|
|
35
|
-
import('./styles.scss')
|
|
36
|
-
}, [])
|
|
37
|
-
|
|
38
36
|
const [displayFull, setDisplayFull] = useState(false)
|
|
39
37
|
|
|
40
38
|
const text = children || ''
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { useInsertionEffect } from 'react'
|
|
5
|
-
|
|
6
4
|
import PropTypes from 'prop-types'
|
|
7
5
|
|
|
8
6
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
7
|
|
|
8
|
+
import './styles.scss'
|
|
9
|
+
|
|
10
10
|
// Local Definitions
|
|
11
11
|
|
|
12
12
|
const baseClassName = styleNames.base
|
|
@@ -25,10 +25,6 @@ const SocialMediaShareButton = ({
|
|
|
25
25
|
type,
|
|
26
26
|
color,
|
|
27
27
|
}) => {
|
|
28
|
-
useInsertionEffect(() => {
|
|
29
|
-
import('./styles.scss')
|
|
30
|
-
}, [])
|
|
31
|
-
|
|
32
28
|
const isServer = typeof window === 'undefined'
|
|
33
29
|
|
|
34
30
|
const link = isServer ? '' : window.location.href
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { memo
|
|
4
|
+
import { memo } from 'react'
|
|
5
5
|
|
|
6
6
|
import PropTypes from 'prop-types'
|
|
7
7
|
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
EditorInput,
|
|
20
20
|
} from '../fields'
|
|
21
21
|
|
|
22
|
+
import './styles.scss'
|
|
23
|
+
|
|
22
24
|
// Local Definitions
|
|
23
25
|
|
|
24
26
|
// const baseClassName = styleNames.base
|
|
@@ -35,10 +37,6 @@ const FormInput = ({
|
|
|
35
37
|
disabled,
|
|
36
38
|
...otherProps
|
|
37
39
|
}) => {
|
|
38
|
-
useInsertionEffect(() => {
|
|
39
|
-
import('./styles.scss')
|
|
40
|
-
}, [])
|
|
41
|
-
|
|
42
40
|
const newClassName = [
|
|
43
41
|
className,
|
|
44
42
|
componentClassName,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { useState,
|
|
3
|
+
import { useState, useContext } from 'react'
|
|
4
4
|
|
|
5
5
|
import PropTypes from 'prop-types'
|
|
6
6
|
|
|
7
7
|
import { Button } from 'ui/b'
|
|
8
8
|
import { FormikContext } from 'formik'
|
|
9
9
|
|
|
10
|
+
import './styles.scss'
|
|
11
|
+
|
|
10
12
|
// Local Definitions
|
|
11
13
|
|
|
12
14
|
const componentClassName = 'debugger'
|
|
@@ -21,10 +23,6 @@ const Debugger = ({
|
|
|
21
23
|
initialIsOpen,
|
|
22
24
|
// ...otherProps
|
|
23
25
|
}) => {
|
|
24
|
-
useInsertionEffect(() => {
|
|
25
|
-
import('./styles.scss')
|
|
26
|
-
}, [])
|
|
27
|
-
|
|
28
26
|
const [isOpen, setIsOpen] = useState(initialIsOpen)
|
|
29
27
|
|
|
30
28
|
const toggleDebugger = () => setIsOpen(!isOpen)
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { useInsertionEffect } from 'react'
|
|
5
|
-
|
|
6
4
|
import { useField } from 'formik'
|
|
7
5
|
|
|
8
6
|
import PropTypes from 'prop-types'
|
|
9
7
|
|
|
10
8
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
11
9
|
|
|
10
|
+
import './styles.scss'
|
|
11
|
+
|
|
12
12
|
// Local Definitions
|
|
13
13
|
|
|
14
14
|
const baseClassName = styleNames.base
|
|
@@ -27,10 +27,6 @@ const Description = ({
|
|
|
27
27
|
color,
|
|
28
28
|
// ...otherProps
|
|
29
29
|
}) => {
|
|
30
|
-
useInsertionEffect(() => {
|
|
31
|
-
import('./styles.scss')
|
|
32
|
-
}, [])
|
|
33
|
-
|
|
34
30
|
const [, meta] = useField(name)
|
|
35
31
|
const hasError = meta.touched && meta.error
|
|
36
32
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { useInsertionEffect } from 'react'
|
|
5
|
-
|
|
6
4
|
import PropTypes from 'prop-types'
|
|
7
5
|
|
|
8
6
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
7
|
|
|
8
|
+
import './styles.scss'
|
|
9
|
+
|
|
10
10
|
// Local Definitions
|
|
11
11
|
|
|
12
12
|
const baseClassName = styleNames.base
|
|
@@ -24,31 +24,25 @@ const InputWrapper = ({
|
|
|
24
24
|
columnSpan,
|
|
25
25
|
desktopColumnSpan,
|
|
26
26
|
// ...otherProps
|
|
27
|
-
}) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}}
|
|
47
|
-
>
|
|
48
|
-
{children}
|
|
49
|
-
</div>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
27
|
+
}) => (
|
|
28
|
+
<div
|
|
29
|
+
id={id}
|
|
30
|
+
className={[
|
|
31
|
+
baseClassName,
|
|
32
|
+
componentClassName,
|
|
33
|
+
userClassName,
|
|
34
|
+
]
|
|
35
|
+
.filter((e) => e)
|
|
36
|
+
.join(' ')}
|
|
37
|
+
style={{
|
|
38
|
+
...style,
|
|
39
|
+
'--column-span' :columnSpan || 'var(--columns)',
|
|
40
|
+
'--column-span-md':desktopColumnSpan || 'var(--columns)',
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
52
46
|
|
|
53
47
|
InputWrapper.propTypes = {
|
|
54
48
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { useInsertionEffect } from 'react'
|
|
5
|
-
|
|
6
4
|
import PropTypes from 'prop-types'
|
|
7
5
|
|
|
8
6
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
7
|
|
|
8
|
+
import './styles.scss'
|
|
9
|
+
|
|
10
10
|
// Local Definitions
|
|
11
11
|
|
|
12
12
|
const baseClassName = styleNames.base
|
|
@@ -28,35 +28,29 @@ const Label = ({
|
|
|
28
28
|
columnSpan,
|
|
29
29
|
desktopColumnSpan,
|
|
30
30
|
// ...otherProps
|
|
31
|
-
}) =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
>
|
|
55
|
-
{children}
|
|
56
|
-
{optional && ' (Optional)'}
|
|
57
|
-
</Wrapper>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
31
|
+
}) => (
|
|
32
|
+
<Wrapper
|
|
33
|
+
htmlFor={Wrapper === 'label' ? name : undefined}
|
|
34
|
+
id={id}
|
|
35
|
+
className={[
|
|
36
|
+
baseClassName,
|
|
37
|
+
componentClassName,
|
|
38
|
+
userClassName,
|
|
39
|
+
`x-${color}`,
|
|
40
|
+
]
|
|
41
|
+
.filter((e) => e)
|
|
42
|
+
.join(' ')}
|
|
43
|
+
style={{
|
|
44
|
+
...style,
|
|
45
|
+
'--column-span' :columnSpan || 'var(--columns)',
|
|
46
|
+
'--column-span-md':desktopColumnSpan || 'var(--columns)',
|
|
47
|
+
}}
|
|
48
|
+
// {...otherProps}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
{optional && ' (Optional)'}
|
|
52
|
+
</Wrapper>
|
|
53
|
+
)
|
|
60
54
|
|
|
61
55
|
Label.propTypes = {
|
|
62
56
|
/**
|
package/src/ui/f/common/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { lookUpInputValueFromFetchedOptions } from './lookUpInputValueFromFetchedOptions'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Fuse from 'fuse.js'
|
|
2
|
+
|
|
3
|
+
const fuseOptions = {
|
|
4
|
+
findAllMatches:true,
|
|
5
|
+
keys :['label'],
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const lookUpInputValueFromFetchedOptions = ({
|
|
9
|
+
items, inputValue, setOptions, minLength,
|
|
10
|
+
}) => {
|
|
11
|
+
const fuseSearch = new Fuse(items, fuseOptions)
|
|
12
|
+
const result = fuseSearch.search(inputValue)
|
|
13
|
+
|
|
14
|
+
if (result.length === 0 && inputValue.length > minLength) {
|
|
15
|
+
setOptions((prevItems) => [
|
|
16
|
+
...prevItems,
|
|
17
|
+
{
|
|
18
|
+
label:`${inputValue} (Create new)`,
|
|
19
|
+
value:inputValue,
|
|
20
|
+
},
|
|
21
|
+
])
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { useInsertionEffect } from 'react'
|
|
5
|
-
|
|
6
4
|
import PropTypes from 'prop-types'
|
|
7
5
|
|
|
8
6
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
@@ -11,6 +9,8 @@ import { useField } from 'formik'
|
|
|
11
9
|
|
|
12
10
|
import { FormLabel, FormDescription, InputWrapper } from '../../common'
|
|
13
11
|
|
|
12
|
+
import './styles.scss'
|
|
13
|
+
|
|
14
14
|
// Local Definitions
|
|
15
15
|
|
|
16
16
|
const baseClassName = styleNames.base
|
|
@@ -36,10 +36,6 @@ const Checkbox = ({
|
|
|
36
36
|
desktopInputSpan,
|
|
37
37
|
// ...otherProps
|
|
38
38
|
}) => {
|
|
39
|
-
useInsertionEffect(() => {
|
|
40
|
-
import('./styles.scss')
|
|
41
|
-
}, [])
|
|
42
|
-
|
|
43
39
|
const [field] = useField({ name, type: 'checkbox' })
|
|
44
40
|
|
|
45
41
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { memo } from 'react'
|
|
5
5
|
|
|
6
6
|
import PropTypes from 'prop-types'
|
|
7
7
|
|
|
@@ -13,6 +13,8 @@ import { Choice } from './common'
|
|
|
13
13
|
|
|
14
14
|
import { FormDescription, FormLabel, InputWrapper } from '../../common'
|
|
15
15
|
|
|
16
|
+
import './styles.scss'
|
|
17
|
+
|
|
16
18
|
const baseClassName = styleNames.base
|
|
17
19
|
|
|
18
20
|
const componentClassName = 'choices-input'
|
|
@@ -40,58 +42,52 @@ const ChoicesInput = ({
|
|
|
40
42
|
inputSpan,
|
|
41
43
|
desktopInputSpan,
|
|
42
44
|
...otherProps
|
|
43
|
-
}) =>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
color={labelColor}
|
|
54
|
-
optional={optional}
|
|
55
|
-
columnSpan={labelSpan}
|
|
56
|
-
desktopColumnSpan={desktopLabelSpan}
|
|
57
|
-
// {...otherProps}
|
|
58
|
-
>
|
|
59
|
-
{label}
|
|
60
|
-
</FormLabel>
|
|
61
|
-
)}
|
|
62
|
-
<InputWrapper
|
|
63
|
-
id={id}
|
|
64
|
-
className={[
|
|
65
|
-
baseClassName,
|
|
66
|
-
componentClassName,
|
|
67
|
-
userClassName,
|
|
68
|
-
]
|
|
69
|
-
.filter((e) => e)
|
|
70
|
-
.join(' ')}
|
|
71
|
-
style={style}
|
|
72
|
-
columnSpan={inputSpan}
|
|
73
|
-
desktopColumnSpan={desktopInputSpan}
|
|
45
|
+
}) => (
|
|
46
|
+
<>
|
|
47
|
+
{label && (
|
|
48
|
+
<FormLabel
|
|
49
|
+
name={name}
|
|
50
|
+
color={labelColor}
|
|
51
|
+
optional={optional}
|
|
52
|
+
columnSpan={labelSpan}
|
|
53
|
+
desktopColumnSpan={desktopLabelSpan}
|
|
54
|
+
// {...otherProps}
|
|
74
55
|
>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
56
|
+
{label}
|
|
57
|
+
</FormLabel>
|
|
58
|
+
)}
|
|
59
|
+
<InputWrapper
|
|
60
|
+
id={id}
|
|
61
|
+
className={[
|
|
62
|
+
baseClassName,
|
|
63
|
+
componentClassName,
|
|
64
|
+
userClassName,
|
|
65
|
+
]
|
|
66
|
+
.filter((e) => e)
|
|
67
|
+
.join(' ')}
|
|
68
|
+
style={style}
|
|
69
|
+
columnSpan={inputSpan}
|
|
70
|
+
desktopColumnSpan={desktopInputSpan}
|
|
71
|
+
>
|
|
72
|
+
<div className={['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')}>
|
|
73
|
+
{ options.map((choice) => (
|
|
74
|
+
<Choice
|
|
75
|
+
className={`x-${color}`}
|
|
76
|
+
key={choice.value}
|
|
77
|
+
name={name}
|
|
78
|
+
id={`${name}-${choice.value}`}
|
|
79
|
+
multiple={multiple}
|
|
80
|
+
validate={validate}
|
|
81
|
+
disabled={disabled}
|
|
82
|
+
{...otherProps}
|
|
83
|
+
{...choice}
|
|
84
|
+
/>
|
|
85
|
+
))}
|
|
86
|
+
</div>
|
|
87
|
+
<FormDescription className="s-1" description={description} name={name} />
|
|
88
|
+
</InputWrapper>
|
|
89
|
+
</>
|
|
90
|
+
)
|
|
95
91
|
|
|
96
92
|
ChoicesInput.propTypes = {
|
|
97
93
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
3
3
|
import * as React from 'react'
|
|
4
|
-
import {
|
|
4
|
+
import { memo } from 'react'
|
|
5
5
|
import { useFormikContext } from 'formik'
|
|
6
6
|
import { LexicalComposer } from '@lexical/react/LexicalComposer'
|
|
7
7
|
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
|
|
@@ -16,6 +16,7 @@ import { ListItemNode, ListNode } from '@lexical/list'
|
|
|
16
16
|
|
|
17
17
|
import PropTypes from 'prop-types'
|
|
18
18
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
19
|
+
import './styles.scss'
|
|
19
20
|
|
|
20
21
|
// Local Definitions
|
|
21
22
|
|
|
@@ -49,10 +50,6 @@ const EditorInput = ({
|
|
|
49
50
|
showDebugger,
|
|
50
51
|
// ...otherProps
|
|
51
52
|
}) => {
|
|
52
|
-
useInsertionEffect(() => {
|
|
53
|
-
import('./styles.scss')
|
|
54
|
-
}, [])
|
|
55
|
-
|
|
56
53
|
const formik = useFormikContext()
|
|
57
54
|
|
|
58
55
|
const setInitialValue = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { memo } from 'react'
|
|
5
5
|
|
|
6
6
|
import PropTypes from 'prop-types'
|
|
7
7
|
|
|
@@ -10,6 +10,7 @@ import styleNames from '@pareto-engineering/bem/exports'
|
|
|
10
10
|
import { useField } from 'formik'
|
|
11
11
|
|
|
12
12
|
import { FormLabel, FormDescription, InputWrapper } from '../../common'
|
|
13
|
+
import './styles.scss'
|
|
13
14
|
|
|
14
15
|
// Local Definitions
|
|
15
16
|
|
|
@@ -40,10 +41,6 @@ const LinkInput = ({
|
|
|
40
41
|
desktopInputSpan,
|
|
41
42
|
// ...otherProps
|
|
42
43
|
}) => {
|
|
43
|
-
useInsertionEffect(() => {
|
|
44
|
-
import('./styles.scss')
|
|
45
|
-
}, [])
|
|
46
|
-
|
|
47
44
|
const [field] = useField({ name, validate })
|
|
48
45
|
|
|
49
46
|
return (
|