@pareto-engineering/design-system 4.0.0-alpha.62 → 4.0.0-alpha.64
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/f/common/Description/Description.js +6 -5
- package/dist/cjs/f/common/Label/Label.js +9 -22
- package/dist/cjs/f/common/Label/styles.scss +0 -5
- package/dist/cjs/f/common/index.js +1 -9
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +16 -21
- package/dist/cjs/f/fields/Checkbox/styles.scss +7 -5
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +13 -23
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +44 -41
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +11 -39
- package/dist/cjs/f/fields/EditorInput/styles.scss +92 -90
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +14 -20
- package/dist/cjs/f/fields/LinkInput/styles.scss +52 -51
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +2 -26
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +4 -30
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +7 -16
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +9 -17
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +38 -37
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +2 -10
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +14 -38
- package/dist/cjs/f/fields/RatingsInput/styles.scss +5 -1
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +14 -36
- package/dist/cjs/f/fields/SelectInput/styles.scss +5 -2
- package/dist/cjs/f/fields/TextInput/TextInput.js +19 -37
- package/dist/cjs/f/fields/TextInput/styles.scss +37 -30
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +15 -37
- package/dist/cjs/f/fields/TextareaInput/styles.scss +30 -27
- package/dist/es/f/common/Description/Description.js +4 -1
- package/dist/es/f/common/Label/Label.js +15 -24
- package/dist/es/f/common/Label/styles.scss +0 -5
- package/dist/es/f/common/index.js +0 -1
- package/dist/es/f/fields/Checkbox/Checkbox.js +14 -19
- package/dist/es/f/fields/Checkbox/styles.scss +7 -5
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +31 -39
- package/dist/es/f/fields/ChoicesInput/styles.scss +44 -41
- package/dist/es/f/fields/EditorInput/EditorInput.js +12 -35
- package/dist/es/f/fields/EditorInput/styles.scss +92 -90
- package/dist/es/f/fields/LinkInput/LinkInput.js +14 -20
- package/dist/es/f/fields/LinkInput/styles.scss +52 -51
- package/dist/es/f/fields/QueryChoices/QueryChoices.js +2 -26
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +4 -26
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +8 -17
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +10 -18
- package/dist/es/f/fields/QueryCombobox/styles.scss +38 -37
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +2 -10
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +15 -35
- package/dist/es/f/fields/RatingsInput/styles.scss +5 -1
- package/dist/es/f/fields/SelectInput/SelectInput.js +14 -36
- package/dist/es/f/fields/SelectInput/styles.scss +5 -2
- package/dist/es/f/fields/TextInput/TextInput.js +19 -37
- package/dist/es/f/fields/TextInput/styles.scss +37 -30
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +15 -37
- package/dist/es/f/fields/TextareaInput/styles.scss +30 -27
- package/package.json +3 -3
- package/src/stories/f/Checkbox.stories.jsx +13 -21
- package/src/stories/f/ChoicesInput.stories.jsx +12 -27
- package/src/stories/f/EditorInput.stories.jsx +7 -14
- package/src/stories/f/LinkInput.stories.jsx +15 -22
- package/src/stories/f/QueryChoices.stories.jsx +12 -19
- package/src/stories/f/QueryCombobox.stories.jsx +16 -24
- package/src/stories/f/QuerySelect.stories.jsx +12 -19
- package/src/stories/f/RatingsInput.stories.jsx +7 -14
- package/src/stories/f/SelectInput.stories.jsx +12 -19
- package/src/stories/f/TextInput.stories.jsx +16 -23
- package/src/stories/f/TextareaInput.stories.jsx +7 -14
- package/src/ui/f/common/Description/Description.jsx +6 -2
- package/src/ui/f/common/Label/Label.jsx +27 -37
- package/src/ui/f/common/Label/styles.scss +0 -5
- package/src/ui/f/common/index.js +0 -1
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +27 -33
- package/src/ui/f/fields/Checkbox/styles.scss +7 -5
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +29 -38
- package/src/ui/f/fields/ChoicesInput/styles.scss +44 -41
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +16 -41
- package/src/ui/f/fields/EditorInput/styles.scss +92 -90
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +38 -45
- package/src/ui/f/fields/LinkInput/styles.scss +52 -51
- package/src/ui/f/fields/QueryChoices/QueryChoices.jsx +0 -28
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +5 -31
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +35 -46
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +63 -73
- package/src/ui/f/fields/QueryCombobox/styles.scss +38 -37
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +0 -8
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +20 -47
- package/src/ui/f/fields/RatingsInput/styles.scss +5 -1
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +33 -61
- package/src/ui/f/fields/SelectInput/styles.scss +5 -2
- package/src/ui/f/fields/TextInput/TextInput.jsx +27 -50
- package/src/ui/f/fields/TextInput/styles.scss +37 -30
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +32 -59
- package/src/ui/f/fields/TextareaInput/styles.scss +30 -27
- package/tests/__snapshots__/Storyshots.test.js.snap +5909 -0
- package/dist/cjs/f/common/InputWrapper/InputWrapper.js +0 -73
- package/dist/cjs/f/common/InputWrapper/index.js +0 -13
- package/dist/cjs/f/common/InputWrapper/styles.scss +0 -13
- package/dist/es/f/common/InputWrapper/InputWrapper.js +0 -61
- package/dist/es/f/common/InputWrapper/index.js +0 -2
- package/dist/es/f/common/InputWrapper/styles.scss +0 -13
- package/src/ui/f/common/InputWrapper/InputWrapper.jsx +0 -83
- package/src/ui/f/common/InputWrapper/index.js +0 -2
- package/src/ui/f/common/InputWrapper/styles.scss +0 -13
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
/* stylelint-disable max-nesting-depth -- required here */
|
|
3
2
|
|
|
4
3
|
@use "@pareto-engineering/bem";
|
|
5
4
|
@use "@pareto-engineering/styles/src/mixins";
|
|
@@ -18,124 +17,127 @@ $disabled-background: var(--background-inputs-30);
|
|
|
18
17
|
$default-color-menu-padding: .5em .25em;
|
|
19
18
|
|
|
20
19
|
.#{bem.$base}.editor-input {
|
|
21
|
-
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
|
|
23
|
+
> .#{bem.$base}.form-label {
|
|
24
|
+
margin-bottom: var(--gap);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
> .#{bem.$base}.toolbar {
|
|
22
28
|
display: flex;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
color: $
|
|
35
|
-
padding: $default-padding;
|
|
36
|
-
|
|
37
|
-
&.active {
|
|
38
|
-
background-color: $active-background;
|
|
39
|
-
}
|
|
29
|
+
gap: $default-gap;
|
|
30
|
+
margin-bottom: .25em;
|
|
31
|
+
|
|
32
|
+
> .group {
|
|
33
|
+
> button {
|
|
34
|
+
background: $default-background;
|
|
35
|
+
border: $default-border;
|
|
36
|
+
color: $default-icon-color;
|
|
37
|
+
padding: $default-padding;
|
|
38
|
+
|
|
39
|
+
&.active {
|
|
40
|
+
background-color: $active-background;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
.flip {
|
|
44
|
-
transform: scaleX(-1);
|
|
45
|
-
}
|
|
46
43
|
}
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
&:focus,
|
|
51
|
-
&:active {
|
|
52
|
-
> .textarea {
|
|
53
|
-
border: $focus-border;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
45
|
+
.flip {
|
|
46
|
+
transform: scaleX(-1);
|
|
56
47
|
}
|
|
48
|
+
}
|
|
57
49
|
|
|
58
|
-
|
|
50
|
+
&:not(.disabled) {
|
|
51
|
+
&:hover,
|
|
52
|
+
&:focus,
|
|
53
|
+
&:active {
|
|
59
54
|
> .textarea {
|
|
60
|
-
|
|
61
|
-
color: var(--metadata);
|
|
62
|
-
cursor: not-allowed;
|
|
55
|
+
border: $focus-border;
|
|
63
56
|
}
|
|
64
57
|
}
|
|
58
|
+
}
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
&.disabled {
|
|
61
|
+
> .textarea {
|
|
62
|
+
background: $disabled-background;
|
|
63
|
+
color: var(--metadata);
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
72
67
|
|
|
68
|
+
.color-menu-button {
|
|
69
|
+
&:hover {
|
|
73
70
|
> .#{bem.$base}.popover {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.color-menu {
|
|
77
|
-
display: flex;
|
|
78
|
-
flex-wrap: wrap;
|
|
79
|
-
gap: calc($default-gap / 2);
|
|
80
|
-
justify-content: center;
|
|
81
|
-
max-width: 10em;
|
|
82
|
-
min-width: 5em;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.color-option:hover {
|
|
86
|
-
opacity: .5;
|
|
87
|
-
}
|
|
71
|
+
display: block;
|
|
88
72
|
}
|
|
89
73
|
}
|
|
90
74
|
|
|
91
|
-
> .
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
width: 100%;
|
|
102
|
-
|
|
103
|
-
li:has(ol, ul) {
|
|
104
|
-
list-style-type: none;
|
|
75
|
+
> .#{bem.$base}.popover {
|
|
76
|
+
padding: $default-color-menu-padding;
|
|
77
|
+
|
|
78
|
+
.color-menu {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-wrap: wrap;
|
|
81
|
+
gap: calc($default-gap / 2);
|
|
82
|
+
justify-content: center;
|
|
83
|
+
max-width: 10em;
|
|
84
|
+
min-width: 5em;
|
|
105
85
|
}
|
|
106
86
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
&.underlined {
|
|
113
|
-
text-decoration: underline;
|
|
114
|
-
|
|
115
|
-
&.strikethrough {
|
|
116
|
-
text-decoration: underline line-through;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
87
|
+
.color-option:hover {
|
|
88
|
+
opacity: .5;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
119
92
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
93
|
+
> .content-editable {
|
|
94
|
+
background: $default-background;
|
|
95
|
+
border: $default-border;
|
|
96
|
+
border-radius: $default-input-border-radius;
|
|
97
|
+
color: var(--y);
|
|
98
|
+
height: var(--rows);
|
|
99
|
+
outline: none;
|
|
100
|
+
overflow: auto;
|
|
101
|
+
padding: $default-padding;
|
|
102
|
+
resize: var(--resize);
|
|
103
|
+
width: 100%;
|
|
123
104
|
|
|
124
|
-
|
|
125
|
-
|
|
105
|
+
li:has(ol, ul) {
|
|
106
|
+
list-style-type: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
p,
|
|
110
|
+
span,
|
|
111
|
+
strong,
|
|
112
|
+
em,
|
|
113
|
+
li {
|
|
114
|
+
&.underlined {
|
|
115
|
+
text-decoration: underline;
|
|
116
|
+
|
|
117
|
+
&.strikethrough {
|
|
118
|
+
text-decoration: underline line-through;
|
|
126
119
|
}
|
|
127
120
|
}
|
|
128
121
|
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
&.strikethrough {
|
|
123
|
+
text-decoration: line-through;
|
|
131
124
|
}
|
|
132
125
|
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
&.italic {
|
|
127
|
+
font-style: italic;
|
|
135
128
|
}
|
|
136
129
|
}
|
|
130
|
+
|
|
131
|
+
:first-child {
|
|
132
|
+
margin-top: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&::placeholder {
|
|
136
|
+
color: var(--metadata);
|
|
137
|
+
}
|
|
137
138
|
}
|
|
138
139
|
|
|
140
|
+
|
|
139
141
|
> .tree-view-output {
|
|
140
142
|
background: $default-background;
|
|
141
143
|
border: $default-border;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { memo } from 'react';
|
|
4
|
+
import { useInsertionEffect, memo } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import styleNames from '@pareto-engineering/bem/exports';
|
|
7
7
|
import { useField } from 'formik';
|
|
8
|
-
import { FormLabel, FormDescription
|
|
9
|
-
import "./styles.scss";
|
|
8
|
+
import { FormLabel, FormDescription } from "../../common";
|
|
10
9
|
|
|
11
10
|
// Local Definitions
|
|
12
11
|
|
|
@@ -29,31 +28,26 @@ const LinkInput = ({
|
|
|
29
28
|
disabled,
|
|
30
29
|
placeholder,
|
|
31
30
|
optional,
|
|
32
|
-
autoComplete
|
|
33
|
-
labelSpan,
|
|
34
|
-
desktopLabelSpan,
|
|
35
|
-
inputSpan,
|
|
36
|
-
desktopInputSpan
|
|
31
|
+
autoComplete
|
|
37
32
|
// ...otherProps
|
|
38
33
|
}) => {
|
|
34
|
+
useInsertionEffect(() => {
|
|
35
|
+
import("./styles.scss");
|
|
36
|
+
}, []);
|
|
39
37
|
const [field] = useField({
|
|
40
38
|
name,
|
|
41
39
|
validate
|
|
42
40
|
});
|
|
43
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
id: id,
|
|
43
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
44
|
+
style: style
|
|
45
|
+
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
44
46
|
name: name,
|
|
45
47
|
color: labelColor,
|
|
46
|
-
optional: optional
|
|
47
|
-
columnSpan: labelSpan,
|
|
48
|
-
desktopColumnSpan: desktopLabelSpan
|
|
48
|
+
optional: optional
|
|
49
49
|
// {...otherProps}
|
|
50
|
-
}, label), /*#__PURE__*/React.createElement(
|
|
51
|
-
id: id,
|
|
52
|
-
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
53
|
-
style: style,
|
|
54
|
-
columnSpan: inputSpan,
|
|
55
|
-
desktopColumnSpan: desktopInputSpan
|
|
56
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
}, label), /*#__PURE__*/React.createElement("div", {
|
|
57
51
|
className: "input-link-wrapper"
|
|
58
52
|
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
59
53
|
id: name,
|
|
@@ -70,7 +64,7 @@ const LinkInput = ({
|
|
|
70
64
|
className: "s-1",
|
|
71
65
|
description: description,
|
|
72
66
|
name: name
|
|
73
|
-
}))
|
|
67
|
+
}));
|
|
74
68
|
};
|
|
75
69
|
LinkInput.propTypes = {
|
|
76
70
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
/* stylelint-disable max-nesting-depth -- required here */
|
|
3
2
|
|
|
4
3
|
@use "@pareto-engineering/bem";
|
|
5
4
|
@use "@pareto-engineering/styles/src/mixins";
|
|
@@ -20,68 +19,70 @@ $default-background: var(--background-inputs);
|
|
|
20
19
|
$disabled-background: var(--background-inputs-30);
|
|
21
20
|
|
|
22
21
|
.#{bem.$base}.link-input {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
position: relative;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
position: relative;
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
content: var(--symbol);
|
|
32
|
-
left: $default-symbol-left;
|
|
33
|
-
position: absolute;
|
|
34
|
-
top: 50%;
|
|
35
|
-
transform: translate(-50%, -50%);
|
|
36
|
-
}
|
|
26
|
+
> .#{bem.$base}.form-label {
|
|
27
|
+
margin-bottom: var(--gap);
|
|
28
|
+
}
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
&.has-symbol {
|
|
31
|
+
&::before {
|
|
32
|
+
color: var(--y);
|
|
33
|
+
content: var(--symbol);
|
|
34
|
+
left: $default-symbol-left;
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 50%;
|
|
37
|
+
transform: translate(-50%, -50%);
|
|
41
38
|
}
|
|
42
39
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
input {
|
|
41
|
+
padding: $default-padding-with-symbol;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
border-radius: var(--theme-default-input-border-radius);
|
|
51
|
-
padding: .5em;
|
|
45
|
+
> .input-link-wrapper {
|
|
46
|
+
display: flex;
|
|
47
|
+
gap: calc(var(--gap) / 2);
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
> a {
|
|
50
|
+
align-self: center;
|
|
51
|
+
border: 1px solid var(--interactive);
|
|
52
|
+
border-radius: var(--theme-default-input-border-radius);
|
|
53
|
+
padding: .5em;
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
background-color: var(--interactive);
|
|
57
|
+
color: var(--on-interactive);
|
|
57
58
|
}
|
|
59
|
+
}
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
> input {
|
|
62
|
+
background-color: $default-background;
|
|
63
|
+
border: $default-border;
|
|
64
|
+
border-radius: $default-input-border-radius;
|
|
65
|
+
color: var(--y);
|
|
66
|
+
outline: none;
|
|
67
|
+
padding: $default-padding;
|
|
68
|
+
width: 100%;
|
|
67
69
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
&::placeholder {
|
|
71
|
+
color: var(--metadata);
|
|
72
|
+
}
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
&:disabled {
|
|
75
|
+
background-color: $disabled-background;
|
|
76
|
+
}
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
&:not(:disabled) {
|
|
79
|
+
&:hover,
|
|
80
|
+
&:active {
|
|
81
|
+
border: $hover-border;
|
|
82
|
+
}
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
84
|
+
&:focus {
|
|
85
|
+
border: $focus-border;
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
}
|
|
@@ -18,10 +18,6 @@ const QueryChoices = ({
|
|
|
18
18
|
validate,
|
|
19
19
|
loadingOption,
|
|
20
20
|
extraVariables,
|
|
21
|
-
labelSpan,
|
|
22
|
-
desktopLabelSpan,
|
|
23
|
-
inputSpan,
|
|
24
|
-
desktopInputSpan,
|
|
25
21
|
...otherProps
|
|
26
22
|
}) => {
|
|
27
23
|
const [,, helpers] = useField({
|
|
@@ -74,11 +70,7 @@ const QueryChoices = ({
|
|
|
74
70
|
return /*#__PURE__*/React.createElement(ChoicesInput, _extends({
|
|
75
71
|
name: name,
|
|
76
72
|
validate: validate,
|
|
77
|
-
options: options
|
|
78
|
-
labelSpan: labelSpan,
|
|
79
|
-
desktopLabelSpan: desktopLabelSpan,
|
|
80
|
-
inputSpan: inputSpan,
|
|
81
|
-
desktopInputSpan: desktopInputSpan
|
|
73
|
+
options: options
|
|
82
74
|
}, otherProps));
|
|
83
75
|
};
|
|
84
76
|
QueryChoices.propTypes = {
|
|
@@ -122,23 +114,7 @@ QueryChoices.propTypes = {
|
|
|
122
114
|
* The extra variables that might be required to be used in the query to fetch
|
|
123
115
|
* select options.
|
|
124
116
|
*/
|
|
125
|
-
extraVariables: PropTypes.objectOf(PropTypes.string)
|
|
126
|
-
/**
|
|
127
|
-
* The number of columns the label should span
|
|
128
|
-
*/
|
|
129
|
-
labelSpan: PropTypes.number,
|
|
130
|
-
/**
|
|
131
|
-
* The number of columns the input should span
|
|
132
|
-
*/
|
|
133
|
-
inputSpan: PropTypes.number,
|
|
134
|
-
/**
|
|
135
|
-
* The number of columns the label should span on desktop
|
|
136
|
-
*/
|
|
137
|
-
desktopLabelSpan: PropTypes.number,
|
|
138
|
-
/**
|
|
139
|
-
* The number of columns the input should span on desktop
|
|
140
|
-
*/
|
|
141
|
-
desktopInputSpan: PropTypes.number
|
|
117
|
+
extraVariables: PropTypes.objectOf(PropTypes.string)
|
|
142
118
|
};
|
|
143
119
|
QueryChoices.defaultProps = {
|
|
144
120
|
loadingOption: {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useState } from 'react';
|
|
3
|
+
import { useState, useInsertionEffect } from 'react';
|
|
4
4
|
import { useField } from 'formik';
|
|
5
5
|
import { useRelayEnvironment, fetchQuery } from 'react-relay';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import "./styles.scss";
|
|
8
7
|
|
|
9
8
|
// Local Definitions
|
|
10
9
|
|
|
@@ -33,14 +32,13 @@ const QueryCombobox = ({
|
|
|
33
32
|
minLength,
|
|
34
33
|
transformSearch,
|
|
35
34
|
validate,
|
|
36
|
-
labelSpan,
|
|
37
|
-
desktopLabelSpan,
|
|
38
|
-
inputSpan,
|
|
39
|
-
desktopInputSpan,
|
|
40
35
|
placeholder,
|
|
41
36
|
promptCreateNewOption
|
|
42
37
|
// ...otherProps
|
|
43
38
|
}) => {
|
|
39
|
+
useInsertionEffect(() => {
|
|
40
|
+
import("./styles.scss");
|
|
41
|
+
}, []);
|
|
44
42
|
const [, meta, helpers] = useField({
|
|
45
43
|
name,
|
|
46
44
|
validate
|
|
@@ -111,10 +109,6 @@ const QueryCombobox = ({
|
|
|
111
109
|
className,
|
|
112
110
|
minLength,
|
|
113
111
|
transformSearch,
|
|
114
|
-
labelSpan,
|
|
115
|
-
desktopLabelSpan,
|
|
116
|
-
inputSpan,
|
|
117
|
-
desktopInputSpan,
|
|
118
112
|
placeholder,
|
|
119
113
|
promptCreateNewOption
|
|
120
114
|
};
|
|
@@ -205,22 +199,6 @@ QueryCombobox.propTypes = {
|
|
|
205
199
|
* Whether the input is optional or not
|
|
206
200
|
*/
|
|
207
201
|
optional: PropTypes.bool,
|
|
208
|
-
/**
|
|
209
|
-
* The number of columns the label should span
|
|
210
|
-
*/
|
|
211
|
-
labelSpan: PropTypes.number,
|
|
212
|
-
/**
|
|
213
|
-
* The number of columns the input should span
|
|
214
|
-
*/
|
|
215
|
-
inputSpan: PropTypes.number,
|
|
216
|
-
/**
|
|
217
|
-
* The number of columns the label should span on desktop
|
|
218
|
-
*/
|
|
219
|
-
desktopLabelSpan: PropTypes.number,
|
|
220
|
-
/**
|
|
221
|
-
* The number of columns the input should span on desktop
|
|
222
|
-
*/
|
|
223
|
-
desktopInputSpan: PropTypes.number,
|
|
224
202
|
/**
|
|
225
203
|
* Whether to prompt the user to create a new option if the search input
|
|
226
204
|
* does not match any of the options
|
|
@@ -8,7 +8,7 @@ import styleNames from '@pareto-engineering/bem/exports';
|
|
|
8
8
|
import { FormLabel, FormDescription } from "../../../..";
|
|
9
9
|
import { Popover, LoadingCircle } from "../../../../../a";
|
|
10
10
|
import { Button } from "../../../../../b";
|
|
11
|
-
import {
|
|
11
|
+
import { lookUpInputValueFromFetchedOptions } from "../../../../common";
|
|
12
12
|
|
|
13
13
|
// Local Definitions
|
|
14
14
|
|
|
@@ -38,10 +38,6 @@ const Combobox = ({
|
|
|
38
38
|
transformSearch,
|
|
39
39
|
disabled,
|
|
40
40
|
optional,
|
|
41
|
-
labelSpan,
|
|
42
|
-
desktopLabelSpan,
|
|
43
|
-
inputSpan,
|
|
44
|
-
desktopInputSpan,
|
|
45
41
|
placeholder,
|
|
46
42
|
promptCreateNewOption
|
|
47
43
|
// ...otherProps
|
|
@@ -98,21 +94,16 @@ const Combobox = ({
|
|
|
98
94
|
}, [value]);
|
|
99
95
|
const parentRef = useRef(null);
|
|
100
96
|
const resetInputValue = () => setInputValue('');
|
|
101
|
-
return /*#__PURE__*/React.createElement(
|
|
102
|
-
name: name,
|
|
103
|
-
optional: optional,
|
|
104
|
-
color: labelColor,
|
|
105
|
-
columnSpan: labelSpan,
|
|
106
|
-
desktopColumnSpan: desktopLabelSpan
|
|
107
|
-
}), label), /*#__PURE__*/React.createElement(InputWrapper, _extends({
|
|
97
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
108
98
|
id: id,
|
|
109
99
|
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
110
100
|
style: style,
|
|
111
101
|
ref: parentRef
|
|
112
|
-
}, getComboboxProps(), {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
}, getComboboxProps()), /*#__PURE__*/React.createElement(FormLabel, _extends({}, getLabelProps(), {
|
|
103
|
+
name: name,
|
|
104
|
+
optional: optional,
|
|
105
|
+
color: labelColor
|
|
106
|
+
}), label), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(), {
|
|
116
107
|
className: "input",
|
|
117
108
|
disabled: disabled,
|
|
118
109
|
placeholder: placeholder
|
|
@@ -138,7 +129,7 @@ const Combobox = ({
|
|
|
138
129
|
getItemProps: getItemProps,
|
|
139
130
|
highlightedIndex: highlightedIndex,
|
|
140
131
|
items: items
|
|
141
|
-
}, getMenuProps()))))
|
|
132
|
+
}, getMenuProps()))));
|
|
142
133
|
};
|
|
143
134
|
Combobox.propTypes = {
|
|
144
135
|
/**
|
|
@@ -8,7 +8,7 @@ import { useCombobox, useMultipleSelection } from 'downshift';
|
|
|
8
8
|
import { Button } from "../../../../../b";
|
|
9
9
|
import { Popover, LoadingCircle } from "../../../../../a";
|
|
10
10
|
import { FormDescription, FormLabel } from "../../../..";
|
|
11
|
-
import {
|
|
11
|
+
import { lookUpInputValueFromFetchedOptions } from "../../../../common";
|
|
12
12
|
|
|
13
13
|
// Local Definitions
|
|
14
14
|
|
|
@@ -45,11 +45,7 @@ const MultipleCombobox = ({
|
|
|
45
45
|
minLength,
|
|
46
46
|
transformSearch,
|
|
47
47
|
disabled,
|
|
48
|
-
labelSpan,
|
|
49
|
-
desktopLabelSpan,
|
|
50
|
-
inputSpan,
|
|
51
48
|
placeholder,
|
|
52
|
-
desktopInputSpan,
|
|
53
49
|
setOptions,
|
|
54
50
|
promptCreateNewOption
|
|
55
51
|
// ...otherProps
|
|
@@ -156,22 +152,18 @@ const MultipleCombobox = ({
|
|
|
156
152
|
}, [value]);
|
|
157
153
|
const parentRef = useRef(null);
|
|
158
154
|
const resetInputValue = () => setInputValue('');
|
|
159
|
-
return /*#__PURE__*/React.createElement(
|
|
155
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
156
|
+
id: id,
|
|
157
|
+
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
158
|
+
style: style,
|
|
159
|
+
ref: parentRef
|
|
160
|
+
}, getComboboxProps()), /*#__PURE__*/React.createElement(FormLabel, _extends({
|
|
160
161
|
className: [baseClassName, componentClassName].filter(e => e).join(' ')
|
|
161
162
|
}, getLabelProps(), {
|
|
162
163
|
name: name,
|
|
163
164
|
optional: optional,
|
|
164
|
-
color: labelColor
|
|
165
|
-
|
|
166
|
-
desktopColumnSpan: desktopLabelSpan
|
|
167
|
-
}), label), /*#__PURE__*/React.createElement(InputWrapper, _extends({
|
|
168
|
-
id: id,
|
|
169
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
170
|
-
style: style,
|
|
171
|
-
ref: parentRef,
|
|
172
|
-
columnSpan: inputSpan,
|
|
173
|
-
desktopColumnSpan: desktopInputSpan
|
|
174
|
-
}, getComboboxProps()), selectedItems?.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
165
|
+
color: labelColor
|
|
166
|
+
}), label), selectedItems?.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
175
167
|
className: "selected-items"
|
|
176
168
|
}, selectedItems.map((selectedItem, index) => /*#__PURE__*/React.createElement("div", _extends({
|
|
177
169
|
key: selectedItem.label
|
|
@@ -217,7 +209,7 @@ const MultipleCombobox = ({
|
|
|
217
209
|
getItemProps: getItemProps,
|
|
218
210
|
highlightedIndex: highlightedIndex,
|
|
219
211
|
items: getFilteredItems()
|
|
220
|
-
}, getMenuProps()))))
|
|
212
|
+
}, getMenuProps()))));
|
|
221
213
|
};
|
|
222
214
|
MultipleCombobox.propTypes = {
|
|
223
215
|
/**
|