linear-react-components-ui 1.1.2-beta.6 → 1.1.2-beta.8
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/lib/assets/styles/colors.scss +1 -1
- package/lib/assets/styles/radio.scss +37 -35
- package/lib/dialog/base/index.js +0 -23
- package/lib/inputs/select/ActionButtons.js +2 -2
- package/lib/inputs/select/multiple/index.js +6 -1
- package/lib/inputs/select/simple/index.js +5 -1
- package/lib/inputs/select/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -74,42 +74,44 @@ $radio-button-ripple-size: 15px;
|
|
|
74
74
|
background: $default-color;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
77
|
+
.radio-button {
|
|
78
|
+
.-small:before{
|
|
79
|
+
width: 16px;
|
|
80
|
+
height: 16px;
|
|
81
|
+
top: 0.225rem;
|
|
82
|
+
left: 0.265rem;
|
|
83
|
+
}
|
|
84
|
+
.-medium:before{
|
|
85
|
+
width: 20px;
|
|
86
|
+
height: 20px;
|
|
87
|
+
top: 0.245rem;
|
|
88
|
+
left: 0.285rem;
|
|
89
|
+
}
|
|
90
|
+
.-large:before{
|
|
91
|
+
width: 24px;
|
|
92
|
+
height: 24px;
|
|
93
|
+
top: 0.245rem;
|
|
94
|
+
left: 0.285rem;
|
|
95
|
+
}
|
|
95
96
|
|
|
96
|
-
.-small:after{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
.-medium:after{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
.-large:after{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
97
|
+
.-small:after{
|
|
98
|
+
width: 8px;
|
|
99
|
+
height: 8px;
|
|
100
|
+
top: 0.23rem;
|
|
101
|
+
left: 0.27rem;
|
|
102
|
+
}
|
|
103
|
+
.-medium:after{
|
|
104
|
+
width: 12px;
|
|
105
|
+
height: 12px;
|
|
106
|
+
top: 0.24rem;
|
|
107
|
+
left: 0.26rem;
|
|
108
|
+
}
|
|
109
|
+
.-large:after{
|
|
110
|
+
width: 16px;
|
|
111
|
+
height: 16px;
|
|
112
|
+
top: 0.245rem;
|
|
113
|
+
left: 0.285rem;
|
|
114
|
+
}
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
.radio-component:checked + .description:after,
|
package/lib/dialog/base/index.js
CHANGED
|
@@ -121,32 +121,9 @@ const BaseDialog = props => {
|
|
|
121
121
|
}, children)));
|
|
122
122
|
(0, _react.useEffect)(() => {
|
|
123
123
|
if (open) {
|
|
124
|
-
var _wrapperEl$current;
|
|
125
124
|
if (closeOnEsc) {
|
|
126
125
|
document.addEventListener('keydown', handleCloseOnEsc);
|
|
127
126
|
}
|
|
128
|
-
const modalContent = (_wrapperEl$current = wrapperEl.current) === null || _wrapperEl$current === void 0 ? void 0 : _wrapperEl$current.querySelector('#modal-dialog-content');
|
|
129
|
-
const modalElementsForTrapFocus = (modalContent === null || modalContent === void 0 ? void 0 : modalContent.querySelectorAll('[href], select, textarea, button, input:not([disabled]), [tabindex]:not([tabindex="-1"])')) || [];
|
|
130
|
-
if (wrapperEl && wrapperEl.current && modalElementsForTrapFocus.length) {
|
|
131
|
-
const firstElementInModal = modalElementsForTrapFocus[0];
|
|
132
|
-
let lastElementInModal = modalElementsForTrapFocus[modalElementsForTrapFocus.length - 1];
|
|
133
|
-
const handleTabKeyPress = event => {
|
|
134
|
-
if (event.key === 'Tab') {
|
|
135
|
-
if (event.shiftKey && document.activeElement === firstElementInModal) {
|
|
136
|
-
event.preventDefault();
|
|
137
|
-
lastElementInModal.focus();
|
|
138
|
-
} else if (!event.shiftKey && document.activeElement === lastElementInModal) {
|
|
139
|
-
event.preventDefault();
|
|
140
|
-
firstElementInModal.focus();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
wrapperEl.current.addEventListener('keydown', handleTabKeyPress);
|
|
145
|
-
return () => {
|
|
146
|
-
var _wrapperEl$current2;
|
|
147
|
-
(_wrapperEl$current2 = wrapperEl.current) === null || _wrapperEl$current2 === void 0 ? void 0 : _wrapperEl$current2.removeEventListener('keydown', handleTabKeyPress);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
127
|
}
|
|
151
128
|
return () => {
|
|
152
129
|
document.removeEventListener('keydown', handleCloseOnEsc);
|
|
@@ -20,7 +20,7 @@ const ActionButtons = props => {
|
|
|
20
20
|
}, showClearButton && /*#__PURE__*/_react.default.createElement("button", {
|
|
21
21
|
disabled: disabled,
|
|
22
22
|
tabIndex: -1,
|
|
23
|
-
className: "actionbutton",
|
|
23
|
+
className: "actionbutton buttonclear",
|
|
24
24
|
onClick: handlerClear
|
|
25
25
|
}, /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
26
26
|
name: "cancel",
|
|
@@ -28,7 +28,7 @@ const ActionButtons = props => {
|
|
|
28
28
|
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
29
29
|
disabled: disabled,
|
|
30
30
|
tabIndex: -1,
|
|
31
|
-
className: "actionbutton",
|
|
31
|
+
className: "actionbutton buttonopenclose",
|
|
32
32
|
onClick: handlerOpenClose
|
|
33
33
|
}, /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
34
34
|
pointerEvents: "none",
|
|
@@ -128,6 +128,8 @@ const MultipleSelect = props => {
|
|
|
128
128
|
const onInputKeyDown = e => {
|
|
129
129
|
if (e.keyCode) {
|
|
130
130
|
if (e.keyCode === constants.keyCodes.ENTER && selected) {
|
|
131
|
+
var _e$preventDefault;
|
|
132
|
+
(_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 ? void 0 : _e$preventDefault.call(e);
|
|
131
133
|
if (!currents.includes(selected)) onSelect(selected);
|
|
132
134
|
} else if ([constants.keyCodes.ARROW_UP, constants.keyCodes.ARROW_DOWN].includes(e.keyCode)) {
|
|
133
135
|
if (!opened) setOpened(true);
|
|
@@ -198,7 +200,10 @@ const MultipleSelect = props => {
|
|
|
198
200
|
ref: componentRef,
|
|
199
201
|
className: "select-component"
|
|
200
202
|
}, /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
|
|
201
|
-
inputRef:
|
|
203
|
+
inputRef: ref => {
|
|
204
|
+
if (props.inputRef) props.inputRef(ref);
|
|
205
|
+
inputTextRef.current = ref;
|
|
206
|
+
},
|
|
202
207
|
autoComplete: "off",
|
|
203
208
|
value: inputValue.toString(),
|
|
204
209
|
readOnly: shouldBeReadOnly(),
|
|
@@ -99,6 +99,7 @@ const SimpleSelect = props => {
|
|
|
99
99
|
});
|
|
100
100
|
if (dataComboFilter && dataComboFilter.length > 0) {
|
|
101
101
|
selectedFilter = dataComboFilter[0];
|
|
102
|
+
setSelected(selectedFilter);
|
|
102
103
|
}
|
|
103
104
|
setDataCombo(dataComboFilter);
|
|
104
105
|
}
|
|
@@ -245,7 +246,10 @@ const SimpleSelect = props => {
|
|
|
245
246
|
ref: componentRef,
|
|
246
247
|
className: "select-component"
|
|
247
248
|
}, /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
|
|
248
|
-
inputRef:
|
|
249
|
+
inputRef: ref => {
|
|
250
|
+
if (props.inputRef) props.inputRef(ref);
|
|
251
|
+
inputTextRef.current = ref;
|
|
252
|
+
},
|
|
249
253
|
autoComplete: "off",
|
|
250
254
|
readOnly: undigitable || shouldBeReadOnly(),
|
|
251
255
|
value: inputText,
|
|
@@ -47,6 +47,7 @@ interface ISimpleSelectProps {
|
|
|
47
47
|
autoFocus?: boolean;
|
|
48
48
|
onFocus?: () => void;
|
|
49
49
|
allOptions?: AllOptions;
|
|
50
|
+
inputRef?: ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
|
|
50
51
|
}
|
|
51
52
|
interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'> {
|
|
52
53
|
multiple?: boolean;
|