@geoinsight/react-components 0.6.2 → 0.6.4
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/index.css +2 -1
- package/dist/cjs/index.js +6 -3
- package/dist/esm/index.css +2 -1
- package/dist/esm/index.js +6 -3
- package/package.json +1 -1
package/dist/cjs/index.css
CHANGED
|
@@ -474,6 +474,7 @@ transition: var(--transition-bg-cubic-bezier), var(--transition-box-shadow-cubic
|
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
.select__box {
|
|
477
|
+
background-color: var(--color-white);
|
|
477
478
|
border-radius: var(--spacing-8);
|
|
478
479
|
border: 2px solid var(--color-primary);
|
|
479
480
|
box-sizing: border-box;
|
|
@@ -482,6 +483,7 @@ transition: var(--transition-bg-cubic-bezier), var(--transition-box-shadow-cubic
|
|
|
482
483
|
position: absolute;
|
|
483
484
|
top: 100%;
|
|
484
485
|
width: 100%;
|
|
486
|
+
z-index: 2;
|
|
485
487
|
}
|
|
486
488
|
|
|
487
489
|
.select__option.button {
|
|
@@ -489,7 +491,6 @@ transition: var(--transition-bg-cubic-bezier), var(--transition-box-shadow-cubic
|
|
|
489
491
|
border: none;
|
|
490
492
|
border-radius: 0;
|
|
491
493
|
width: 100%;
|
|
492
|
-
z-index: 999;
|
|
493
494
|
}
|
|
494
495
|
|
|
495
496
|
.select__option.button:last-child {
|
package/dist/cjs/index.js
CHANGED
|
@@ -237,11 +237,11 @@ function Modal({ modalref, children, title, subtitle, footer, hasCloseButton = t
|
|
|
237
237
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "modal-overlay" }), jsxRuntime.jsxs("div", { ref: modalref, className: "modal", children: [hasCloseButton && (jsxRuntime.jsx(Button, { mode: "secondary", className: "modal__close", size: "small", onClick: handleClose, children: jsxRuntime.jsx(io5.IoClose, {}) })), jsxRuntime.jsxs("div", { className: "modal__content", children: [title && (jsxRuntime.jsxs("div", { className: "modal__header", children: [jsxRuntime.jsx("h3", { children: title }), jsxRuntime.jsx("h6", { children: subtitle })] })), jsxRuntime.jsx("div", { className: "modal__children", children: children }), footer && jsxRuntime.jsx("div", { className: "modal__footer", children: footer })] })] })] }));
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
function Select({ inputClassName = "", classNameGroup = "", options, styleGroup, defaultValue, inputProps, setFormSelected, onFormBlur, ...rest }) {
|
|
240
|
+
function Select({ inputClassName = "", classNameGroup = "", options, styleGroup, defaultValue, inputProps, setFormSelected, onFormBlur, handleSelect, ...rest }) {
|
|
241
241
|
const [isOpen, setIsOpen] = react.useState(false);
|
|
242
242
|
const [value, setValue] = react.useState(defaultValue || (options && options[0]));
|
|
243
243
|
const [filteredOptions, setFilteredOptions] = react.useState(options);
|
|
244
|
-
const { name
|
|
244
|
+
const { name } = rest;
|
|
245
245
|
const handleOpen = () => {
|
|
246
246
|
setIsOpen(true);
|
|
247
247
|
};
|
|
@@ -273,6 +273,9 @@ function Select({ inputClassName = "", classNameGroup = "", options, styleGroup,
|
|
|
273
273
|
else {
|
|
274
274
|
setValue(value);
|
|
275
275
|
}
|
|
276
|
+
if (handleSelect) {
|
|
277
|
+
handleSelect(value);
|
|
278
|
+
}
|
|
276
279
|
handleClose();
|
|
277
280
|
};
|
|
278
281
|
// for autocomplete
|
|
@@ -290,7 +293,7 @@ function Select({ inputClassName = "", classNameGroup = "", options, styleGroup,
|
|
|
290
293
|
return (jsxRuntime.jsxs("div", { className: clsx("select-group", classNameGroup), style: styleGroup, children: [jsxRuntime.jsx(Input, { inputClassName: clsx("select", inputClassName), value: value, placeholder: "Select a value", icon: {
|
|
291
294
|
className: "select__arrow",
|
|
292
295
|
element: (jsxRuntime.jsx(Button, { type: "button", mode: "icon", className: "select__arrow-button", onClick: handleToggle, onBlur: handleClose, children: jsxRuntime.jsx(tfi.TfiAngleDown, { size: 24, color: "var(--color-black)" }) })),
|
|
293
|
-
}, onFocus: handleOpen, onBlur: handleInputClose, onChange: handleValueChange, ...rest }), isOpen && (jsxRuntime.jsx("div", { className: "select__box", children: filteredOptions.map((option, index) => (jsxRuntime.jsx(Button, { type: "button", mode: "secondary", className: "select__option", name: option, onMouseDown: handleSelectChange, children: option }, `index-${index}`))) }))] }));
|
|
296
|
+
}, onFocus: handleOpen, onBlur: handleInputClose, onChange: handleValueChange, autoComplete: "off", ...rest }), isOpen && (jsxRuntime.jsx("div", { className: "select__box", children: filteredOptions.map((option, index) => (jsxRuntime.jsx(Button, { type: "button", mode: "secondary", className: "select__option", name: option, onMouseDown: handleSelectChange, children: option }, `index-${index}`))) }))] }));
|
|
294
297
|
}
|
|
295
298
|
|
|
296
299
|
function TextArea({ className = "", disabled = true, hasToggleButton = true, hideHeight = "5rem", placeholder = "Insert value", showHeight = "10rem", style = {}, textareaClassName = "", label, labelClass, ...rest }) {
|
package/dist/esm/index.css
CHANGED
|
@@ -474,6 +474,7 @@ transition: var(--transition-bg-cubic-bezier), var(--transition-box-shadow-cubic
|
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
.select__box {
|
|
477
|
+
background-color: var(--color-white);
|
|
477
478
|
border-radius: var(--spacing-8);
|
|
478
479
|
border: 2px solid var(--color-primary);
|
|
479
480
|
box-sizing: border-box;
|
|
@@ -482,6 +483,7 @@ transition: var(--transition-bg-cubic-bezier), var(--transition-box-shadow-cubic
|
|
|
482
483
|
position: absolute;
|
|
483
484
|
top: 100%;
|
|
484
485
|
width: 100%;
|
|
486
|
+
z-index: 2;
|
|
485
487
|
}
|
|
486
488
|
|
|
487
489
|
.select__option.button {
|
|
@@ -489,7 +491,6 @@ transition: var(--transition-bg-cubic-bezier), var(--transition-box-shadow-cubic
|
|
|
489
491
|
border: none;
|
|
490
492
|
border-radius: 0;
|
|
491
493
|
width: 100%;
|
|
492
|
-
z-index: 999;
|
|
493
494
|
}
|
|
494
495
|
|
|
495
496
|
.select__option.button:last-child {
|
package/dist/esm/index.js
CHANGED
|
@@ -235,11 +235,11 @@ function Modal({ modalref, children, title, subtitle, footer, hasCloseButton = t
|
|
|
235
235
|
return (jsxs(Fragment, { children: [jsx("div", { className: "modal-overlay" }), jsxs("div", { ref: modalref, className: "modal", children: [hasCloseButton && (jsx(Button, { mode: "secondary", className: "modal__close", size: "small", onClick: handleClose, children: jsx(IoClose, {}) })), jsxs("div", { className: "modal__content", children: [title && (jsxs("div", { className: "modal__header", children: [jsx("h3", { children: title }), jsx("h6", { children: subtitle })] })), jsx("div", { className: "modal__children", children: children }), footer && jsx("div", { className: "modal__footer", children: footer })] })] })] }));
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
function Select({ inputClassName = "", classNameGroup = "", options, styleGroup, defaultValue, inputProps, setFormSelected, onFormBlur, ...rest }) {
|
|
238
|
+
function Select({ inputClassName = "", classNameGroup = "", options, styleGroup, defaultValue, inputProps, setFormSelected, onFormBlur, handleSelect, ...rest }) {
|
|
239
239
|
const [isOpen, setIsOpen] = useState(false);
|
|
240
240
|
const [value, setValue] = useState(defaultValue || (options && options[0]));
|
|
241
241
|
const [filteredOptions, setFilteredOptions] = useState(options);
|
|
242
|
-
const { name
|
|
242
|
+
const { name } = rest;
|
|
243
243
|
const handleOpen = () => {
|
|
244
244
|
setIsOpen(true);
|
|
245
245
|
};
|
|
@@ -271,6 +271,9 @@ function Select({ inputClassName = "", classNameGroup = "", options, styleGroup,
|
|
|
271
271
|
else {
|
|
272
272
|
setValue(value);
|
|
273
273
|
}
|
|
274
|
+
if (handleSelect) {
|
|
275
|
+
handleSelect(value);
|
|
276
|
+
}
|
|
274
277
|
handleClose();
|
|
275
278
|
};
|
|
276
279
|
// for autocomplete
|
|
@@ -288,7 +291,7 @@ function Select({ inputClassName = "", classNameGroup = "", options, styleGroup,
|
|
|
288
291
|
return (jsxs("div", { className: clsx("select-group", classNameGroup), style: styleGroup, children: [jsx(Input, { inputClassName: clsx("select", inputClassName), value: value, placeholder: "Select a value", icon: {
|
|
289
292
|
className: "select__arrow",
|
|
290
293
|
element: (jsx(Button, { type: "button", mode: "icon", className: "select__arrow-button", onClick: handleToggle, onBlur: handleClose, children: jsx(TfiAngleDown, { size: 24, color: "var(--color-black)" }) })),
|
|
291
|
-
}, onFocus: handleOpen, onBlur: handleInputClose, onChange: handleValueChange, ...rest }), isOpen && (jsx("div", { className: "select__box", children: filteredOptions.map((option, index) => (jsx(Button, { type: "button", mode: "secondary", className: "select__option", name: option, onMouseDown: handleSelectChange, children: option }, `index-${index}`))) }))] }));
|
|
294
|
+
}, onFocus: handleOpen, onBlur: handleInputClose, onChange: handleValueChange, autoComplete: "off", ...rest }), isOpen && (jsx("div", { className: "select__box", children: filteredOptions.map((option, index) => (jsx(Button, { type: "button", mode: "secondary", className: "select__option", name: option, onMouseDown: handleSelectChange, children: option }, `index-${index}`))) }))] }));
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
function TextArea({ className = "", disabled = true, hasToggleButton = true, hideHeight = "5rem", placeholder = "Insert value", showHeight = "10rem", style = {}, textareaClassName = "", label, labelClass, ...rest }) {
|