@monolith-forensics/monolith-ui 1.3.30 → 1.3.31

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.
@@ -1,5 +1,5 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled, { useTheme } from "styled-components";
2
+ import { useTheme } from "styled-components";
3
3
  import { useFloating, flip, offset, FloatingPortal, autoUpdate, } from "@floating-ui/react";
4
4
  import { useCallback, useEffect, useRef, useState } from "react";
5
5
  import { Input, FieldLabel, Tooltip, Loader } from "..";
@@ -9,12 +9,6 @@ import { DEFAULT_DROPDOWN_HEIGHT, DROPDOWN_OFFSET, getEmptyMessage, KEYBOARD_KEY
9
9
  import { StyledInputContainer, StyledInnerItemContainer, EmptyComponent, GroupTitle, ActionMenu, StyledItem, StyledContainer, } from "./select-box.styled-components";
10
10
  // Re-export for backward compatibility
11
11
  export { StyledInputContainer };
12
- const StyledInput = styled(Input) `
13
- &[disabled] {
14
- opacity: 1;
15
- pointer-events: none;
16
- }
17
- `;
18
12
  export const SelectBox = ({ className, data = [], placeholder = "Select...", arrow = true, onChange, onSearch, searchFn, onScroll, loading, defaultValue, value, size = "sm", variant = "outlined", width = "100%", allowCustomValue = false, searchable = false, clearable = false, label, description, required = false, error, openOnFocus = true, renderOption, actionComponent, focused, grouped, OptionTooltip, // Custom tooltip component for search menu items
19
13
  DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
20
14
  var _a, _b, _c, _d, _e, _f;
@@ -361,7 +355,7 @@ DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
361
355
  // ============================================================================
362
356
  // Render
363
357
  // ============================================================================
364
- return (_jsxs(StyledContainer, { className: className, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { ref: refs.setReference, onMouseDown: () => setIsOpen(true), width: width, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, tabIndex: disabled ? -1 : 0, children: [_jsx(StyledInput, { ref: inputRef, value: inputValue, onChange: handleInputChange, onFocus: handleFocus, autoFocus: focused, disabled: disabled, tabIndex: disabled ? -1 : 0, placeholder: placeholder, size: size, readOnly: !searchable && !allowCustomValue, "data-button-right": arrow || clearable, style: isOpen ? { borderColor: theme.palette.primary.main } : {} }), renderActionButton()] }), isOpen && (_jsx(FloatingPortal, { preserveTabOrder: true, children: _jsx(StyledFloatContainer, { ref: (ref) => {
358
+ return (_jsxs(StyledContainer, { className: className, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { ref: refs.setReference, onMouseDown: () => setIsOpen(true), width: width, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, tabIndex: disabled ? -1 : 0, children: [_jsx(Input, { ref: inputRef, value: inputValue, onChange: handleInputChange, onFocus: handleFocus, autoFocus: focused, disabled: disabled, tabIndex: disabled ? -1 : 0, placeholder: placeholder, size: size, readOnly: !searchable && !allowCustomValue, "data-button-right": arrow || clearable, style: isOpen ? { borderColor: theme.palette.primary.main } : {} }), renderActionButton()] }), isOpen && (_jsx(FloatingPortal, { preserveTabOrder: true, children: _jsx(StyledFloatContainer, { ref: (ref) => {
365
359
  containerRef.current = ref;
366
360
  refs.setFloating(ref);
367
361
  }, style: floatingStyles, className: "mfFloating", children: _jsxs(StyledContent, Object.assign({ className: "mfFloatingContent", style: {
@@ -40,6 +40,11 @@ export const StyledInputContainer = styled.div `
40
40
  pointer-events: none;
41
41
  }
42
42
  }
43
+
44
+ input[disabled] {
45
+ opacity: 1 !important;
46
+ pointer-events: none !important;
47
+ }
43
48
  `;
44
49
  export const StyledInnerItemContainer = styled.div `
45
50
  overflow-y: auto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.3.30",
3
+ "version": "1.3.31",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",