hplx-react-elements-dev 1.0.35 → 1.0.36
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.
|
@@ -9,6 +9,7 @@ export interface DatePickerProps {
|
|
|
9
9
|
isborderRequired?: boolean;
|
|
10
10
|
minDate?: Date;
|
|
11
11
|
maxDate?: Date;
|
|
12
|
+
fieldColor?: string;
|
|
12
13
|
}
|
|
13
|
-
declare const DatePicker: ({ disabledDates, selectDate, dateVar, minDate, maxDate, isborderRequired, }: DatePickerProps) => JSX.Element;
|
|
14
|
+
declare const DatePicker: ({ disabledDates, selectDate, dateVar, minDate, maxDate, fieldColor, isborderRequired, }: DatePickerProps) => JSX.Element;
|
|
14
15
|
export default DatePicker;
|
package/dist/esm/index.js
CHANGED
|
@@ -2126,30 +2126,30 @@ var InputField = function InputField(_a) {
|
|
|
2126
2126
|
_g = _a.isSuffixEditable,
|
|
2127
2127
|
isSuffixEditable = _g === void 0 ? false : _g,
|
|
2128
2128
|
suffixPlaceholder = _a.suffixPlaceholder,
|
|
2129
|
+
fieldColor = _a.fieldColor,
|
|
2129
2130
|
_h = _a.handleSuffixClick,
|
|
2130
2131
|
handleSuffixClick = _h === void 0 ? function (_) {} : _h;
|
|
2131
|
-
_a.handleSuffixValChange;
|
|
2132
2132
|
|
|
2133
|
-
var
|
|
2134
|
-
disabled =
|
|
2135
|
-
onFocus =
|
|
2136
|
-
onBlur =
|
|
2133
|
+
var _j = inputProps || {},
|
|
2134
|
+
disabled = _j.disabled,
|
|
2135
|
+
onFocus = _j.onFocus,
|
|
2136
|
+
onBlur = _j.onBlur;
|
|
2137
2137
|
|
|
2138
|
-
var
|
|
2139
|
-
active =
|
|
2140
|
-
setActive =
|
|
2138
|
+
var _k = useState(false),
|
|
2139
|
+
active = _k[0],
|
|
2140
|
+
setActive = _k[1];
|
|
2141
2141
|
|
|
2142
|
-
var
|
|
2143
|
-
showSuffixDropdown =
|
|
2144
|
-
setShowSuffixDropdown =
|
|
2142
|
+
var _l = useState(false),
|
|
2143
|
+
showSuffixDropdown = _l[0],
|
|
2144
|
+
setShowSuffixDropdown = _l[1];
|
|
2145
2145
|
|
|
2146
|
-
var
|
|
2147
|
-
suffixValue =
|
|
2148
|
-
setSuffixValue =
|
|
2146
|
+
var _m = useState(""),
|
|
2147
|
+
suffixValue = _m[0],
|
|
2148
|
+
setSuffixValue = _m[1];
|
|
2149
2149
|
|
|
2150
|
-
var
|
|
2151
|
-
suffixFilterList =
|
|
2152
|
-
setSuffixFilterList =
|
|
2150
|
+
var _o = useState([]),
|
|
2151
|
+
suffixFilterList = _o[0],
|
|
2152
|
+
setSuffixFilterList = _o[1];
|
|
2153
2153
|
|
|
2154
2154
|
var wrapperRef = useRef(null);
|
|
2155
2155
|
useEffect(function () {
|
|
@@ -2198,7 +2198,7 @@ var InputField = function InputField(_a) {
|
|
|
2198
2198
|
}); // console.log("Input Field",suffixDropdown)
|
|
2199
2199
|
|
|
2200
2200
|
return jsxRuntime.exports.jsxs("div", __assign({
|
|
2201
|
-
className: "inputfield
|
|
2201
|
+
className: "inputfield "
|
|
2202
2202
|
}, {
|
|
2203
2203
|
children: [jsxRuntime.exports.jsxs("div", __assign({
|
|
2204
2204
|
className: "flex justify-between"
|
|
@@ -2228,11 +2228,11 @@ var InputField = function InputField(_a) {
|
|
|
2228
2228
|
}, {
|
|
2229
2229
|
children: jsxRuntime.exports.jsxs("div", __assign({
|
|
2230
2230
|
"data-setid": "error-msg",
|
|
2231
|
-
className: "flex ".concat(isborderRequired ? "border-1 shadow-xs rounded-lg" : "", " overflow-hidden placeholder:text-Gray-500 ").concat(errorMsg ? "border-Error-300" : "border-Gray-300", " ").concat(height ? height : "h-10", " ").concat(disabled ? "bg-Gray-50" : "bg-White ".concat(errorMsg ? "hover:shadow-xs-error ".concat(active && "shadow-xs-error") : " ".concat(isborderRequired ? "hover:border-Primary-300 hover:shadow-xs-primary ".concat(active && "border-Primary-300 shadow-xs-primary") : " ")))
|
|
2231
|
+
className: "flex ".concat(isborderRequired ? "border-1 shadow-xs rounded-lg" : "", " overflow-hidden placeholder:text-Gray-500 ").concat(errorMsg ? "border-Error-300" : "border-Gray-300", " ").concat(height ? height : "h-10", " ").concat(disabled ? "bg-Gray-50" : "".concat(fieldColor ? fieldColor : "bg-White", " ").concat(errorMsg ? "hover:shadow-xs-error ".concat(active && "shadow-xs-error") : " ".concat(isborderRequired ? "hover:border-Primary-300 hover:shadow-xs-primary ".concat(active && "border-Primary-300 shadow-xs-primary") : " ")))
|
|
2232
2232
|
}, {
|
|
2233
2233
|
children: [Boolean(prefix) && jsxRuntime.exports.jsx("div", __assign({
|
|
2234
2234
|
"data-testid": "input-prefix",
|
|
2235
|
-
className: "bg-Gray-50 border-r-1 border-r-Gray-300 text-Gray-500 flex items-center px-3"
|
|
2235
|
+
className: "".concat(fieldColor ? fieldColor : "bg-Gray-50", " border-r-1 border-r-Gray-300 text-Gray-500 flex items-center px-3")
|
|
2236
2236
|
}, {
|
|
2237
2237
|
children: jsxRuntime.exports.jsx(Typography, __assign({
|
|
2238
2238
|
type: "Text md",
|
|
@@ -2248,7 +2248,10 @@ var InputField = function InputField(_a) {
|
|
|
2248
2248
|
})
|
|
2249
2249
|
})), jsxRuntime.exports.jsx("input", __assign({
|
|
2250
2250
|
type: "text",
|
|
2251
|
-
|
|
2251
|
+
style: {
|
|
2252
|
+
background: "".concat(fieldColor === null || fieldColor === void 0 ? void 0 : fieldColor.split("-")[1])
|
|
2253
|
+
},
|
|
2254
|
+
className: "flex-1 pl-[14px] ".concat(fieldColor, " pr-[12px] py-1 focus-visible:outline-0 border-0 focus:border-0"),
|
|
2252
2255
|
"data-testid": "text-input"
|
|
2253
2256
|
}, inputProps, {
|
|
2254
2257
|
onFocus: handleFocus,
|
|
@@ -2261,7 +2264,7 @@ var InputField = function InputField(_a) {
|
|
|
2261
2264
|
})
|
|
2262
2265
|
})), Boolean(suffix) && !isSuffixEditable && jsxRuntime.exports.jsx("div", __assign({
|
|
2263
2266
|
"data-testid": "input-suffix",
|
|
2264
|
-
className: "bg-Gray-50 border-l-1 border-l-Gray-300 text-Gray-500 flex items-center pr-3 pl-[14px]",
|
|
2267
|
+
className: "".concat(fieldColor ? fieldColor : "bg-Gray-50", " border-l-1 border-l-Gray-300 text-Gray-500 flex items-center pr-3 pl-[14px]"),
|
|
2265
2268
|
onClick: function onClick() {
|
|
2266
2269
|
return setShowSuffixDropdown(true);
|
|
2267
2270
|
}
|
|
@@ -2275,7 +2278,7 @@ var InputField = function InputField(_a) {
|
|
|
2275
2278
|
})), isSuffixEditable && jsxRuntime.exports.jsxs("div", {
|
|
2276
2279
|
children: [jsxRuntime.exports.jsx("div", __assign({
|
|
2277
2280
|
"data-testid": "input-suffix",
|
|
2278
|
-
className: "bg-Gray-50 border-l-1 border-l-Gray-300 text-Gray-500 flex items-center pr-3 pl-[14px]",
|
|
2281
|
+
className: "".concat(fieldColor ? fieldColor : "bg-Gray-50", " bg-none border-l-1 border-l-Gray-300 text-Gray-500 flex items-center pr-3 pl-[14px]"),
|
|
2279
2282
|
onClick: function onClick() {
|
|
2280
2283
|
return setShowSuffixDropdown(true);
|
|
2281
2284
|
}
|
|
@@ -2293,20 +2296,19 @@ var InputField = function InputField(_a) {
|
|
|
2293
2296
|
}))
|
|
2294
2297
|
})), showSuffixDropdown && jsxRuntime.exports.jsx("div", __assign({
|
|
2295
2298
|
ref: wrapperRef,
|
|
2296
|
-
className: "absolute mt-1 min-w-max rounded-lg bg-White overflow-y-auto shadow-md z-10 max-h-80 "
|
|
2299
|
+
className: "absolute mt-1 min-w-max rounded-lg ".concat(fieldColor ? fieldColor : "bg-White", " overflow-y-auto shadow-md z-10 max-h-80 ")
|
|
2297
2300
|
}, {
|
|
2298
2301
|
children: suffixFilterList && suffixFilterList.length > 0 && jsxRuntime.exports.jsx("div", {
|
|
2299
2302
|
children: (suffixFilterList === null || suffixFilterList === void 0 ? void 0 : suffixFilterList.constructor) === Array && suffixFilterList.length ? suffixFilterList.map(function (option) {
|
|
2300
|
-
|
|
2301
|
-
|
|
2303
|
+
// const { ...restOptions } = option || {}
|
|
2302
2304
|
return jsxRuntime.exports.jsx(DropdownItems, __assign({
|
|
2303
|
-
label: option["label"],
|
|
2304
2305
|
className: "text-Primary-700"
|
|
2305
|
-
},
|
|
2306
|
+
}, option, {
|
|
2307
|
+
label: option["label"],
|
|
2306
2308
|
onSelect: function onSelect() {
|
|
2307
|
-
setSuffixValue(
|
|
2309
|
+
setSuffixValue(option.label);
|
|
2308
2310
|
setShowSuffixDropdown(false);
|
|
2309
|
-
handleSuffixClick(
|
|
2311
|
+
handleSuffixClick(option);
|
|
2310
2312
|
}
|
|
2311
2313
|
}));
|
|
2312
2314
|
}) : null
|
|
@@ -16883,6 +16885,7 @@ var DatePicker = function DatePicker(_a) {
|
|
|
16883
16885
|
dateVar = _a.dateVar,
|
|
16884
16886
|
minDate = _a.minDate,
|
|
16885
16887
|
maxDate = _a.maxDate,
|
|
16888
|
+
fieldColor = _a.fieldColor,
|
|
16886
16889
|
_c = _a.isborderRequired,
|
|
16887
16890
|
isborderRequired = _c === void 0 ? true : _c;
|
|
16888
16891
|
|
|
@@ -16919,22 +16922,23 @@ var DatePicker = function DatePicker(_a) {
|
|
|
16919
16922
|
};
|
|
16920
16923
|
}, [clicked]);
|
|
16921
16924
|
return jsxRuntime.exports.jsxs("div", __assign({
|
|
16922
|
-
className: "
|
|
16925
|
+
className: ""
|
|
16923
16926
|
}, {
|
|
16924
16927
|
children: [jsxRuntime.exports.jsx("div", __assign({
|
|
16925
16928
|
className: "relative w-[189px]"
|
|
16926
16929
|
}, {
|
|
16927
16930
|
children: jsxRuntime.exports.jsx(InputField, {
|
|
16928
16931
|
isborderRequired: isborderRequired,
|
|
16929
|
-
start_icon: "hx_calendar",
|
|
16932
|
+
start_icon: "hx_calendar text-4",
|
|
16930
16933
|
inputProps: {
|
|
16931
16934
|
placeholder: "Select date",
|
|
16932
16935
|
onClick: inputClick,
|
|
16933
16936
|
value: date ? dayjs(date).format("MMM DD, YYYY") : selectDate === null || selectDate === void 0 ? void 0 : selectDate.toString()
|
|
16934
|
-
}
|
|
16937
|
+
},
|
|
16938
|
+
fieldColor: fieldColor
|
|
16935
16939
|
})
|
|
16936
16940
|
})), jsxRuntime.exports.jsx("div", __assign({
|
|
16937
|
-
className: "absolute mt-1 z-10
|
|
16941
|
+
className: "absolute mt-1 z-10"
|
|
16938
16942
|
}, {
|
|
16939
16943
|
children: clicked ? jsxRuntime.exports.jsx(dist.Calendar, {
|
|
16940
16944
|
date: dayjs(date).isValid() ? date : new Date(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputFieldProps } from "../types";
|
|
3
|
-
declare const InputField: ({ label, labelColor, labelSize, height, start_icon, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, inputProps, suffixInputProps, isborderRequired, suffixDropdown, isSuffixEditable, suffixPlaceholder,
|
|
3
|
+
declare const InputField: ({ label, labelColor, labelSize, height, start_icon, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, inputProps, suffixInputProps, isborderRequired, suffixDropdown, isSuffixEditable, suffixPlaceholder, fieldColor, handleSuffixClick, }: InputFieldProps) => JSX.Element;
|
|
4
4
|
export default InputField;
|
package/dist/esm/types.d.ts
CHANGED