react-restyle-components 0.3.42 → 0.3.44

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,13 +1,13 @@
1
1
  import React from 'react';
2
2
  interface TextInputDropdownProps {
3
- placeholder: string;
3
+ placeholder?: string;
4
4
  items: Array<string>;
5
5
  hasError?: boolean;
6
6
  className?: string;
7
7
  value?: string;
8
8
  defaultValue?: string;
9
9
  onChange?: (item: string) => void;
10
- onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
10
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>, value?: string) => void;
11
11
  disabled?: boolean;
12
12
  allowCustomInput?: boolean;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-dropdown.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/atoms/text-input-dropdown/text-input-dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,UAAU,sBAAsB;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,qIAW3B,sBAAsB,4CA8PxB,CAAC"}
1
+ {"version":3,"file":"text-input-dropdown.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/atoms/text-input-dropdown/text-input-dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,UAAU,sBAAsB;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,qIAW3B,sBAAsB,4CA0PxB,CAAC"}
@@ -73,14 +73,14 @@ export const TextInputDropdown = ({ items, className, hasError, placeholder = 'S
73
73
  setTimeout(() => {
74
74
  setIsEditing(false);
75
75
  }, 150);
76
- onBlur && onBlur(event);
76
+ onBlur && onBlur(event, internalValue);
77
77
  };
78
78
  const wrapperRef = useRef(null);
79
79
  useOutsideAlerter(wrapperRef);
80
80
  return (_jsxs("div", { className: cn(className, s['relative']), children: [_jsxs("div", { className: cn(s['flex'], s['flex-row'], s['items-center'], s['leading-4'], s['p-2'], s['dark:bg-boxdark'], s['focus:outline-none'], s['focus:ring'], s['block'], s['w-full'], s['shadow-sm'], s['sm:text-base'], s['border'], s['rounded-md'], {
81
81
  [s['border-red']]: hasError,
82
82
  [s['border-gray-300']]: !hasError,
83
- }), children: [_jsx("input", { type: "text", name: "name", placeholder: placeholder, value: value, disabled: disabled, className: cn(s['w-full'], s['bg-transparent'], s['border-0'], s['appearance-none'], s['focus:outline-none'], s['focus:ring-0'], s['font-arimaRegular'], s['text-md'], disabled && s['cursor-not-allowed'], disabled && s['opacity-50']), onClick: handleInputClick, onChange: allowCustomInput ? handleInputChange : undefined, onFocus: handleInputFocus, onBlur: handleInputBlur, readOnly: !allowCustomInput }), !disabled && (_jsx(Icon, { nameIcon: isOpen ? 'MdKeyboardArrowUp' : 'MdKeyboardArrowDown', propsIcon: { size: '24', color: '#000000' }, onClick: handleInputClick }))] }), isOpen && !disabled && (_jsx("div", { className: cn(s['z-10'], s['w-full'], s['absolute'], s['text-base'], s['list-none'], s['bg-white'], s['rounded'], s['divide-y'], s['divide-gray-100'], s['shadow'], s['dark:bg-gray-700'], s['max-h-60'], s['overflow-y-auto']), ref: wrapperRef, children: _jsxs("ul", { className: s['py-1'], children: [filteredItems.length > 0 ? (filteredItems.map((item, index) => (_jsx("li", { className: cn(s['block'], s['py-2'], s['px-4'], s['text-md'], s['hover:bg-gray-100'], s['dark:hover:bg-gray-600'], s['dark:text-gray-200'], s['font-arimaRegular'], s['cursor-pointer'],
83
+ }), children: [_jsx("input", { type: "text", name: "name", placeholder: placeholder, value: value, disabled: disabled, className: cn(s['w-full'], s['bg-transparent'], s['border-0'], s['appearance-none'], s['focus:outline-none'], s['focus:ring-0'], s['font-arimaRegular'], s['text-md'], disabled && s['cursor-not-allowed'], disabled && s['opacity-50']), onClick: handleInputClick, onChange: allowCustomInput ? handleInputChange : undefined, onFocus: handleInputFocus, onBlur: handleInputBlur, readOnly: !allowCustomInput }), !disabled && (_jsx(Icon, { nameIcon: isOpen ? 'MdKeyboardArrowUp' : 'MdKeyboardArrowDown', propsIcon: { size: '16', color: '#000000' }, onClick: handleInputClick }))] }), isOpen && !disabled && (_jsx("div", { className: cn(s['z-10'], s['w-full'], s['absolute'], s['text-base'], s['list-none'], s['bg-white'], s['rounded'], s['divide-y'], s['divide-gray-100'], s['shadow'], s['dark:bg-gray-700'], s['max-h-60'], s['overflow-y-auto']), ref: wrapperRef, children: _jsxs("ul", { className: s['py-1'], children: [filteredItems.length > 0 ? (filteredItems.map((item, index) => (_jsx("li", { className: cn(s['block'], s['py-2'], s['px-4'], s['text-md'], s['hover:bg-gray-100'], s['dark:hover:bg-gray-600'], s['dark:text-gray-200'], s['font-arimaRegular'], s['cursor-pointer'],
84
84
  // Highlight if this item matches current value
85
85
  value === item && s['bg-blue-50'], value === item && s['text-blue-700']), onClick: () => handleItemSelect(item), children: item }, index)))) : (_jsx("li", { className: cn(s['block'], s['py-2'], s['px-4'], s['text-md'], s['text-gray-500'], s['font-arimaRegular']), children: allowCustomInput ? 'No matches found' : 'No options available' })), allowCustomInput &&
86
86
  value &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.3.42",
3
+ "version": "0.3.44",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {