pixelize-design-library 2.0.15 → 2.0.17
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/Components/Input/TextInput.js +2 -2
- package/dist/Components/Input/TextInput.styles.js +10 -1
- package/dist/Components/Input/TextInputProps.d.ts +2 -0
- package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelect.js +39 -21
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +2 -0
- package/dist/Components/SearchSelect/SelectTruncatedLabel.d.ts +6 -0
- package/dist/Components/SearchSelect/SelectTruncatedLabel.js +45 -0
- package/dist/Pages/input.js +4 -2
- package/dist/Pages/searchSelect.js +15 -2
- package/package.json +1 -1
|
@@ -54,8 +54,8 @@ var FormLabel_1 = require("../Common/FormLabel");
|
|
|
54
54
|
var HelperText_1 = __importDefault(require("../Common/HelperText"));
|
|
55
55
|
var ErrorMessage_1 = __importDefault(require("../Common/ErrorMessage"));
|
|
56
56
|
var TextInput = (0, react_1.forwardRef)(function (_a, ref) {
|
|
57
|
-
var label = _a.label, _b = _a.type, type = _b === void 0 ? "text" : _b, id = _a.id, name = _a.name, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isReadOnly, isReadOnly = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, value = _a.value, _f = _a.placeholder, placeholder = _f === void 0 ? "Placeholder" : _f, _g = _a.width, width = _g === void 0 ? "
|
|
58
|
-
return (react_1.default.createElement(react_2.FormControl, { w: width },
|
|
57
|
+
var label = _a.label, _b = _a.type, type = _b === void 0 ? "text" : _b, id = _a.id, name = _a.name, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isReadOnly, isReadOnly = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, value = _a.value, _f = _a.placeholder, placeholder = _f === void 0 ? "Placeholder" : _f, _g = _a.width, width = _g === void 0 ? "100%" : _g, _h = _a.height, height = _h === void 0 ? "2.75rem" : _h, error = _a.error, errorMessage = _a.errorMessage, helperText = _a.helperText, onRightIconclick = _a.onRightIconclick, inputRightIcon = _a.inputRightIcon, inputLeftIcon = _a.inputLeftIcon, onLeftIconClick = _a.onLeftIconClick, inputGroupStyle = _a.inputGroupStyle, inputStyle = _a.inputStyle, _j = _a.size, size = _j === void 0 ? "md" : _j, _k = _a.isInformation, isInformation = _k === void 0 ? false : _k, informationMessage = _a.informationMessage, leftElementStyle = _a.leftElementStyle, rightElementStyle = _a.rightElementStyle, autoComplete = _a.autoComplete, minW = _a.minW, maxW = _a.maxW, props = __rest(_a, ["label", "type", "id", "name", "onChange", "onBlur", "onFocus", "isDisabled", "isReadOnly", "isRequired", "value", "placeholder", "width", "height", "error", "errorMessage", "helperText", "onRightIconclick", "inputRightIcon", "inputLeftIcon", "onLeftIconClick", "inputGroupStyle", "inputStyle", "size", "isInformation", "informationMessage", "leftElementStyle", "rightElementStyle", "autoComplete", "minW", "maxW"]);
|
|
58
|
+
return (react_1.default.createElement(react_2.FormControl, { w: width, minW: minW, maxW: maxW },
|
|
59
59
|
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, id: id, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })),
|
|
60
60
|
react_1.default.createElement(react_2.InputGroup, { style: inputGroupStyle, height: height },
|
|
61
61
|
inputLeftIcon && (react_1.default.createElement(react_2.InputLeftElement, __assign({ onClick: onLeftIconClick, pointerEvents: onLeftIconClick ? "auto" : "none" }, leftElementStyle), inputLeftIcon)),
|
|
@@ -25,7 +25,7 @@ exports.Input = {
|
|
|
25
25
|
},
|
|
26
26
|
variants: {
|
|
27
27
|
outline: function (props) {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
29
29
|
var theme = props.theme;
|
|
30
30
|
var errorColor = (_c = (_b = (_a = theme.colors.semantic) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b[500]) !== null && _c !== void 0 ? _c : "red.500";
|
|
31
31
|
var borderColor = (_e = (_d = theme.colors.boxborder) === null || _d === void 0 ? void 0 : _d[500]) !== null && _e !== void 0 ? _e : "gray.300";
|
|
@@ -64,6 +64,15 @@ exports.Input = {
|
|
|
64
64
|
_readOnly: {
|
|
65
65
|
boxShadow: 'inherit',
|
|
66
66
|
},
|
|
67
|
+
_disabled: {
|
|
68
|
+
bg: (_q = (_p = theme.colors.gray) === null || _p === void 0 ? void 0 : _p[100]) !== null && _q !== void 0 ? _q : "gray.100",
|
|
69
|
+
opacity: 1,
|
|
70
|
+
cursor: "not-allowed",
|
|
71
|
+
_hover: {
|
|
72
|
+
border: "0.063rem solid",
|
|
73
|
+
borderColor: borderColor,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
67
76
|
},
|
|
68
77
|
};
|
|
69
78
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SearchSelectProps } from './SearchSelectProps';
|
|
3
|
-
declare const SearchSelect: ({ id, label, options, onSelect, onSearch, isOptionLoading, isLoading, loadingText, placeholder, value, searchQuery, isMultiple, isRequired, error, errorMessage, helperText, width, size, chip, information, rightIcon, addNew, isSelectAll, pagination, insideSelect }: SearchSelectProps) => React.JSX.Element;
|
|
3
|
+
declare const SearchSelect: ({ id, label, options, onSelect, onSearch, isOptionLoading, isLoading, loadingText, placeholder, value, searchQuery, isMultiple, isRequired, error, errorMessage, helperText, width, height, size, chip, information, rightIcon, addNew, isSelectAll, pagination, insideSelect }: SearchSelectProps) => React.JSX.Element;
|
|
4
4
|
export default SearchSelect;
|
|
@@ -44,22 +44,24 @@ var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
|
44
44
|
var ErrorMessage_1 = __importDefault(require("../Common/ErrorMessage"));
|
|
45
45
|
var HelperText_1 = __importDefault(require("../Common/HelperText"));
|
|
46
46
|
var ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
47
|
+
var SelectTruncatedLabel_1 = __importDefault(require("./SelectTruncatedLabel"));
|
|
47
48
|
var SearchSelect = function (_a) {
|
|
48
|
-
var _b, _c, _d, _e;
|
|
49
|
-
var id = _a.id, label = _a.label, options = _a.options, onSelect = _a.onSelect, onSearch = _a.onSearch,
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
49
|
+
var _b, _c, _d, _e, _f;
|
|
50
|
+
var id = _a.id, label = _a.label, options = _a.options, onSelect = _a.onSelect, onSearch = _a.onSearch, _g = _a.isOptionLoading, isOptionLoading = _g === void 0 ? false : _g, _h = _a.isLoading, isLoading = _h === void 0 ? false : _h, _j = _a.loadingText, loadingText = _j === void 0 ? 'Loading...' : _j, _k = _a.placeholder, placeholder = _k === void 0 ? 'Select' : _k, value = _a.value, _l = _a.searchQuery, searchQuery = _l === void 0 ? '' : _l, _m = _a.isMultiple, isMultiple = _m === void 0 ? false : _m, _o = _a.isRequired, isRequired = _o === void 0 ? false : _o, _p = _a.error, error = _p === void 0 ? false : _p, errorMessage = _a.errorMessage, helperText = _a.helperText, _q = _a.width, width = _q === void 0 ? '100%' : _q, _r = _a.height, height = _r === void 0 ? "2.75rem" : _r, _s = _a.size, size = _s === void 0 ? 'md' : _s, chip = _a.chip, information = _a.information, rightIcon = _a.rightIcon, addNew = _a.addNew, _t = _a.isSelectAll, isSelectAll = _t === void 0 ? false : _t, pagination = _a.pagination, insideSelect = _a.insideSelect;
|
|
51
|
+
var _u = (0, react_1.useState)(searchQuery), inputValue = _u[0], setInputValue = _u[1];
|
|
52
|
+
var _v = (0, react_1.useState)(false), isOpen = _v[0], setIsOpen = _v[1];
|
|
53
|
+
var _w = (0, react_1.useState)(true), hasMore = _w[0], setHasMore = _w[1];
|
|
53
54
|
var inputRef = (0, react_1.useRef)(null);
|
|
54
55
|
var containerRef = (0, react_1.useRef)(null);
|
|
55
56
|
var scrollTimeoutRef = (0, react_1.useRef)(null);
|
|
56
|
-
var
|
|
57
|
-
var
|
|
57
|
+
var _x = (0, react_1.useState)(false), focused = _x[0], setFocused = _x[1];
|
|
58
|
+
var _y = (0, react_1.useState)(false), customSelectOpen = _y[0], setCustomSelectOpen = _y[1];
|
|
58
59
|
var customSelectRef = (0, react_1.useRef)(null);
|
|
60
|
+
var _z = (0, react_1.useState)({ top: 0, left: 0, width: 0 }), customSelectPos = _z[0], setCustomSelectPos = _z[1];
|
|
59
61
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
60
62
|
(0, react_2.useOutsideClick)({
|
|
61
63
|
ref: containerRef,
|
|
62
|
-
handler: function () {
|
|
64
|
+
handler: function () { setIsOpen(false); setCustomSelectOpen(false); },
|
|
63
65
|
});
|
|
64
66
|
var selectedValues = isMultiple
|
|
65
67
|
? Array.isArray(value)
|
|
@@ -143,25 +145,41 @@ var SearchSelect = function (_a) {
|
|
|
143
145
|
}, 200);
|
|
144
146
|
}
|
|
145
147
|
}, [pagination, options.length, inputValue, hasMore]);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
150
|
-
var handleCustomSelect =
|
|
151
|
-
setCustomSelectOpen(false);
|
|
148
|
+
// useOutsideClick({
|
|
149
|
+
// ref: customSelectRef,
|
|
150
|
+
// handler: () => setCustomSelectOpen(false),
|
|
151
|
+
// });
|
|
152
|
+
var handleCustomSelect = function (item) {
|
|
152
153
|
if (typeof (insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.onSelect) === 'function') {
|
|
153
154
|
insideSelect.onSelect(item);
|
|
154
155
|
}
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
setCustomSelectOpen(false);
|
|
157
|
+
};
|
|
158
|
+
(0, react_1.useEffect)(function () {
|
|
159
|
+
if (customSelectOpen && customSelectRef.current) {
|
|
160
|
+
var rect = customSelectRef.current.getBoundingClientRect();
|
|
161
|
+
setCustomSelectPos({
|
|
162
|
+
top: rect.bottom + window.scrollY,
|
|
163
|
+
left: rect.left + window.scrollX,
|
|
164
|
+
width: rect.width + 30,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}, [customSelectOpen]);
|
|
168
|
+
return (react_1.default.createElement(react_2.Box, { ref: containerRef, width: width, position: "relative", height: height },
|
|
157
169
|
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, id: id, isRequired: isRequired, isInformation: information === null || information === void 0 ? void 0 : information.isInformation, informationMessage: information === null || information === void 0 ? void 0 : information.informationMessage })),
|
|
158
170
|
react_1.default.createElement(react_2.InputGroup, { size: size },
|
|
159
171
|
react_1.default.createElement(react_2.Box, { as: "div", w: "100%", minH: "2.375rem", px: 3, display: "flex", alignItems: "center", flexWrap: "wrap", gap: "0.375rem", border: "0.063rem solid", borderColor: error ? theme.colors.semantic.error[500] : theme.colors.primary[500], borderRadius: "0.25rem", bg: "white", boxShadow: focused ? error ? "0 0 0 0.125rem ".concat((_b = theme.colors.boxShadow) === null || _b === void 0 ? void 0 : _b.error) : "0 0 0 0.125rem ".concat((_c = theme.colors.boxShadow) === null || _c === void 0 ? void 0 : _c.primary) : 'none', transition: "box-shadow 0.2s, border-color 0.2s" },
|
|
160
|
-
insideSelect && (react_1.default.createElement(react_2.Box, { position: "relative",
|
|
161
|
-
react_1.default.createElement(react_2.Box, { minW: "
|
|
162
|
-
react_1.default.createElement(
|
|
172
|
+
insideSelect && (react_1.default.createElement(react_2.Box, { position: "relative", ref: customSelectRef, backgroundColor: theme.colors.gray[200], ml: "-0.75rem", h: "-webkit-fill-available", borderRadius: "0.25rem 0 0 0.25rem", onClick: function () { return setCustomSelectOpen(function (prev) { return !prev; }); } },
|
|
173
|
+
react_1.default.createElement(react_2.Box, { minW: "5rem", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", width: insideSelect.width, height: height, pl: "0.5rem", pr: "0.5rem" },
|
|
174
|
+
react_1.default.createElement(SelectTruncatedLabel_1.default, { label: (_e = (_d = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.value) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : "", maxWidth: (insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.width) || "6rem" }),
|
|
163
175
|
customSelectOpen ? react_1.default.createElement(lucide_react_1.ChevronUp, { size: 16 }) : react_1.default.createElement(lucide_react_1.ChevronDown, { size: 16 })),
|
|
164
|
-
customSelectOpen && (react_1.default.createElement(react_2.
|
|
176
|
+
customSelectOpen && (react_1.default.createElement(react_2.Portal, null,
|
|
177
|
+
react_1.default.createElement(react_2.Box, { position: "absolute", top: "".concat(customSelectPos.top, "px"), left: "".concat(customSelectPos.left, "px"), zIndex: 20, bg: theme.colors.white, border: "0.063rem solid", borderColor: theme.colors.gray[300], borderRadius: "md", boxShadow: "md", minW: "10rem", maxW: "38rem" }, (_f = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.option) === null || _f === void 0 ? void 0 : _f.map(function (item) { return (react_1.default.createElement(react_2.Box, { key: item.id, display: "flex", alignItems: "center", height: "2.5rem" // height instead of vertical padding
|
|
178
|
+
, px: "0.75rem" // light internal spacing
|
|
179
|
+
, fontSize: "sm", _hover: { bg: theme.colors.gray[100] }, cursor: "pointer", onClick: function (e) {
|
|
180
|
+
e.stopPropagation();
|
|
181
|
+
handleCustomSelect(item);
|
|
182
|
+
} }, item.label)); })))))),
|
|
165
183
|
isMultiple
|
|
166
184
|
? selectedValues.slice(0, (chip === null || chip === void 0 ? void 0 : chip.maxChips) || selectedValues.length).map(function (item) { return (react_1.default.createElement(Tag_1.default, { key: item.id, label: (chip === null || chip === void 0 ? void 0 : chip.maxText) && item.label.length > chip.maxText
|
|
167
185
|
? item.label.slice(0, chip.maxText) + '…'
|
|
@@ -183,7 +201,7 @@ var SearchSelect = function (_a) {
|
|
|
183
201
|
_active: { bg: 'transparent' },
|
|
184
202
|
_focus: { boxShadow: 'none', bg: 'transparent' },
|
|
185
203
|
} }))),
|
|
186
|
-
isLoading ? (react_1.default.createElement(react_2.Spinner, { size: "sm" })) : isValidIcon(rightIcon === null || rightIcon === void 0 ? void 0 : rightIcon.icon) ? (react_1.default.createElement(react_2.IconButton, { icon: rightIcon === null || rightIcon === void 0 ? void 0 : rightIcon.icon, "aria-label": "right-icon", variant: "ghost", size: "sm", onClick: rightIcon === null || rightIcon === void 0 ? void 0 : rightIcon.onClick })) : (react_1.default.createElement(react_2.Box, { as: "button", onClick: function () { return setIsOpen(function (prev) { return !prev; }); }, "aria-label": "toggle-dropdown", display: "flex", alignItems: "center" }, isOpen ? react_1.default.createElement(lucide_react_1.ChevronUp, { size:
|
|
204
|
+
isLoading ? (react_1.default.createElement(react_2.Spinner, { size: "sm" })) : isValidIcon(rightIcon === null || rightIcon === void 0 ? void 0 : rightIcon.icon) ? (react_1.default.createElement(react_2.IconButton, { icon: rightIcon === null || rightIcon === void 0 ? void 0 : rightIcon.icon, "aria-label": "right-icon", variant: "ghost", size: "sm", onClick: rightIcon === null || rightIcon === void 0 ? void 0 : rightIcon.onClick })) : (react_1.default.createElement(react_2.Box, { as: "button", onClick: function () { return setIsOpen(function (prev) { return !prev; }); }, "aria-label": "toggle-dropdown", display: "flex", alignItems: "center" }, isOpen ? react_1.default.createElement(lucide_react_1.ChevronUp, { size: 16 }) : react_1.default.createElement(lucide_react_1.ChevronDown, { size: 16 })))))),
|
|
187
205
|
isOpen && (react_1.default.createElement(react_2.Box, { position: "absolute", zIndex: 10, width: "100%", maxH: "20rem", borderWidth: 1, borderRadius: "sm", bg: "white", boxShadow: "md", display: "flex", flexDirection: "column" },
|
|
188
206
|
isMultiple && isSelectAll && (react_1.default.createElement(react_2.Box, { p: 2, px: 3, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: 2, borderBottom: "0.063rem solid ".concat(theme.colors.gray[100]) },
|
|
189
207
|
react_1.default.createElement(react_2.Checkbox, { isChecked: allFilteredSelected, pointerEvents: "none" }),
|
|
@@ -17,6 +17,7 @@ export type SearchSelectProps = {
|
|
|
17
17
|
errorMessage?: string;
|
|
18
18
|
helperText?: string;
|
|
19
19
|
width?: string | number;
|
|
20
|
+
height?: string | number;
|
|
20
21
|
size?: "xs" | "sm" | "md" | "lg";
|
|
21
22
|
chip?: {
|
|
22
23
|
maxChips?: number;
|
|
@@ -49,6 +50,7 @@ export type SearchSelectProps = {
|
|
|
49
50
|
onSelect?: (options: Options) => void;
|
|
50
51
|
value?: Options;
|
|
51
52
|
option?: Options[];
|
|
53
|
+
width?: string;
|
|
52
54
|
};
|
|
53
55
|
};
|
|
54
56
|
export type Options = {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var react_1 = require("@chakra-ui/react");
|
|
30
|
+
var react_2 = __importStar(require("react"));
|
|
31
|
+
var ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
32
|
+
var SelectTruncatedLabel = function (_a) {
|
|
33
|
+
var label = _a.label, _b = _a.maxWidth, maxWidth = _b === void 0 ? "6rem" : _b;
|
|
34
|
+
var textRef = (0, react_2.useRef)(null);
|
|
35
|
+
var _c = (0, react_2.useState)(false), isOverflowing = _c[0], setIsOverflowing = _c[1];
|
|
36
|
+
(0, react_2.useEffect)(function () {
|
|
37
|
+
var el = textRef.current;
|
|
38
|
+
if (el) {
|
|
39
|
+
setIsOverflowing(el.scrollWidth > el.clientWidth);
|
|
40
|
+
}
|
|
41
|
+
}, [label, maxWidth]);
|
|
42
|
+
var textElement = (react_2.default.createElement(react_1.Text, { ref: textRef, maxW: maxWidth, isTruncated: true, whiteSpace: "nowrap", fontWeight: 500, fontSize: "0.875rem", letterSpacing: "0.044rem" }, label));
|
|
43
|
+
return isOverflowing ? react_2.default.createElement(ToolTip_1.default, { label: label, placement: "top" }, textElement) : textElement;
|
|
44
|
+
};
|
|
45
|
+
exports.default = SelectTruncatedLabel;
|
package/dist/Pages/input.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var TextInput_1 = __importDefault(require("../Components/Input/TextInput"));
|
|
8
8
|
var InputPage = function () {
|
|
9
|
-
return (react_1.default.createElement("div",
|
|
9
|
+
return (react_1.default.createElement("div", { style: { width: "500px" } },
|
|
10
10
|
react_1.default.createElement(TextInput_1.default, { label: "My Label", id: "input1", name: "hello",
|
|
11
11
|
//helperText="Hello"
|
|
12
12
|
//errorMessage="Required"
|
|
@@ -35,6 +35,8 @@ var InputPage = function () {
|
|
|
35
35
|
console.log("blur");
|
|
36
36
|
},
|
|
37
37
|
// helperText="sometibg"
|
|
38
|
-
isRequired: true, informationMessage: "This is information", isInformation: true
|
|
38
|
+
isRequired: true, informationMessage: "This is information", isInformation: true,
|
|
39
|
+
// isDisabled
|
|
40
|
+
minW: "200px", maxW: "300px" })));
|
|
39
41
|
};
|
|
40
42
|
exports.default = InputPage;
|
|
@@ -89,10 +89,10 @@ var SearchSelect = function () {
|
|
|
89
89
|
var _d = (0, react_1.useState)(false), paginationLoading = _d[0], setpaginationLoading = _d[1];
|
|
90
90
|
var _e = (0, react_1.useState)({ id: "3", label: "Hariharan J" }), customSelectValue = _e[0], setCustomSelectValue = _e[1];
|
|
91
91
|
return (react_1.default.createElement("div", null,
|
|
92
|
-
react_1.default.createElement(SearchSelect_1.default, { label: "Users", id: "user-select", options: soptions, value: selectedOptions, isMultiple: true, onSelect: function (val) {
|
|
92
|
+
react_1.default.createElement(SearchSelect_1.default, { width: "250px", label: "Users", id: "user-select", options: soptions, value: selectedOptions, isMultiple: true, onSelect: function (val) {
|
|
93
93
|
console.log("val", val);
|
|
94
94
|
setselectedOptions(val);
|
|
95
|
-
}, onSearch: function (query) { return setSearch(query); }, isOptionLoading: false, placeholder: "Search users...",
|
|
95
|
+
}, onSearch: function (query) { return setSearch(query); }, searchQuery: search, isOptionLoading: false, placeholder: "Search users...", chip: {
|
|
96
96
|
maxChips: 3,
|
|
97
97
|
onClick: function () { return console.log("chip removed"); },
|
|
98
98
|
}, isSelectAll: true, pagination: {
|
|
@@ -137,6 +137,7 @@ var SearchSelect = function () {
|
|
|
137
137
|
// error={true}
|
|
138
138
|
// errorMessage="hello"
|
|
139
139
|
virtualization: true, insideSelect: {
|
|
140
|
+
width: "50px",
|
|
140
141
|
onSelect: function (val) { return setCustomSelectValue(val); },
|
|
141
142
|
value: customSelectValue,
|
|
142
143
|
option: [
|
|
@@ -152,6 +153,18 @@ var SearchSelect = function () {
|
|
|
152
153
|
"id": 2,
|
|
153
154
|
"label": "SasiKumar M",
|
|
154
155
|
},
|
|
156
|
+
{
|
|
157
|
+
"id": 4,
|
|
158
|
+
"label": "Hariharan Jeganathan",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": 1,
|
|
162
|
+
"label": "Karuppusamy S",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": 2,
|
|
166
|
+
"label": "SasiKumar M",
|
|
167
|
+
},
|
|
155
168
|
{
|
|
156
169
|
"id": 4,
|
|
157
170
|
"label": "Hariharan Jeganathan",
|