armtek-uikit-react 1.0.140 → 1.0.141
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.141","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
package/ui/Button/Button.js
CHANGED
|
@@ -3,10 +3,6 @@ import { fixedForwardRef } from "../../lib/helpers";
|
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
|
-
const ButtonClasses = ['Arm-button', 'button', 'button_contained', 'button_transparent', 'button_outlined', 'button_primary', 'button_secondary', 'button_neutral', 'button_black', 'button__adornment', 'button__adornment_end', 'button__adornment_start', 'button_large', 'button_medium', 'button_small', 'button_icon', 'button_group', 'button_group_inline', 'button_group_column', 'button_grouped_inline', 'button_grouped_column'];
|
|
7
|
-
|
|
8
|
-
// const css = getCssPrefix(ButtonClasses)
|
|
9
|
-
|
|
10
6
|
const Button = (props, ref) => {
|
|
11
7
|
let {
|
|
12
8
|
size = 'extraLarge',
|
|
@@ -12,6 +12,8 @@ type SelectBaseProps = {
|
|
|
12
12
|
onSelectAll?: () => void;
|
|
13
13
|
onClearAll?: () => void;
|
|
14
14
|
onSubmit?: () => void;
|
|
15
|
+
defaultQuery?: string;
|
|
16
|
+
query?: string;
|
|
15
17
|
};
|
|
16
18
|
type MultipleType<M extends boolean = false> = {
|
|
17
19
|
multiple?: M;
|
|
@@ -27,7 +29,6 @@ export type SelectChangeEvent<Value = string> = (Event & {
|
|
|
27
29
|
name: string;
|
|
28
30
|
};
|
|
29
31
|
});
|
|
30
|
-
declare function Select<M extends boolean = false>(props: SelectProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
type SelectOptionsType<T extends boolean> = {
|
|
32
33
|
options: OptionType[];
|
|
33
34
|
value?: T extends true ? string[] : string;
|
|
@@ -40,4 +41,5 @@ type SelectOptionsType<T extends boolean> = {
|
|
|
40
41
|
onSubmit?: () => void;
|
|
41
42
|
disabled?: boolean;
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
+
declare const _default: <M extends boolean = false>(props: SelectBaseProps & MultipleType<M> & Omit<TextFieldProps, keyof SelectBaseProps | keyof MultipleType<M_1>> & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactNode;
|
|
45
|
+
export default _default;
|
package/ui/Form/Select/Select.js
CHANGED
|
@@ -9,6 +9,7 @@ import ButtonIcon from "../../ButtonIcon";
|
|
|
9
9
|
import Adornment from "../../Adornment";
|
|
10
10
|
import { SelectSummary, SelectSummaryChips } from "./SelectSummary";
|
|
11
11
|
import Popover from "../../Popover/Popover";
|
|
12
|
+
import { fixedForwardRef } from "../../../lib/helpers";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -16,7 +17,7 @@ export const getOptionValue = option => option.value || option.text;
|
|
|
16
17
|
|
|
17
18
|
// let selectEl!: HTMLSelectElement
|
|
18
19
|
|
|
19
|
-
function Select(props) {
|
|
20
|
+
function Select(props, ref) {
|
|
20
21
|
var _options$find;
|
|
21
22
|
let {
|
|
22
23
|
options,
|
|
@@ -35,13 +36,14 @@ function Select(props) {
|
|
|
35
36
|
onClose,
|
|
36
37
|
onClearAll,
|
|
37
38
|
onSelectAll,
|
|
39
|
+
defaultQuery,
|
|
40
|
+
query,
|
|
38
41
|
...inputProps
|
|
39
42
|
} = props;
|
|
40
43
|
let [active, setActive] = useState(!!defaultOpen);
|
|
41
44
|
let [selected, setSelected] = useState(defaultValue || (multiple ? [] : ''));
|
|
42
45
|
let [focused, setFocused] = useState(false);
|
|
43
46
|
let [q, setQ] = useState('');
|
|
44
|
-
// const [anchorEl, setAnchorEl] = useState<HTMLDivElement | null>(null)
|
|
45
47
|
const anchorEl = useRef(null);
|
|
46
48
|
const inlineOptRef = useClickOutside(handleClose);
|
|
47
49
|
const handleOpen = e => {
|
|
@@ -154,13 +156,14 @@ function Select(props) {
|
|
|
154
156
|
focused: focused,
|
|
155
157
|
onFocus: handleFocus,
|
|
156
158
|
onBlur: handleBlur,
|
|
157
|
-
value: !search ? selectedText : q,
|
|
159
|
+
value: !search ? selectedText : value !== undefined && !q ? selectedText : query !== undefined ? query : q,
|
|
158
160
|
className: clsx('arm-select__input'),
|
|
159
161
|
endAdornment: selectEndAdornment,
|
|
160
162
|
style: {
|
|
161
163
|
pointerEvents: 'none'
|
|
162
164
|
},
|
|
163
|
-
editable: !!search
|
|
165
|
+
editable: !!search,
|
|
166
|
+
ref: ref
|
|
164
167
|
})
|
|
165
168
|
}), multiple && !realActive && /*#__PURE__*/_jsx(SelectSummaryChips, {
|
|
166
169
|
options: selectedOptions,
|
|
@@ -262,4 +265,4 @@ const SelectOptions = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
262
265
|
// },]} />
|
|
263
266
|
// }
|
|
264
267
|
|
|
265
|
-
export default Select;
|
|
268
|
+
export default fixedForwardRef(Select);
|