hplx-react-elements-dev 1.0.57 → 1.0.59
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,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DoubleInputProps } from "../types";
|
|
3
|
-
declare const DoubleInput: ({ input1value, input2value, errorMsg, prefix, start_icon, end_icon, hint_text_icon, hint_text, className, suffixClassName, dropdownClassName, suffixDropdownClassName, options, suffixOptions, handleValChange, handleSuffixValChange, onDropdownClick, onSuffixDropdownClick, onlyDropdownItemsAllowed, onlySuffixDropdownItemsAllowed, inputProps, suffixInputProps, }: DoubleInputProps) => JSX.Element;
|
|
3
|
+
declare const DoubleInput: ({ label, labelColor, labelSize, input1value, input2value, errorMsg, prefix, start_icon, end_icon, hint_text_icon, hint_text, className, suffixClassName, dropdownClassName, suffixDropdownClassName, options, suffixOptions, handleValChange, handleSuffixValChange, onDropdownClick, onSuffixDropdownClick, onlyDropdownItemsAllowed, onlySuffixDropdownItemsAllowed, inputProps, suffixInputProps, }: DoubleInputProps) => JSX.Element;
|
|
4
4
|
export default DoubleInput;
|
package/dist/esm/index.js
CHANGED
|
@@ -5478,7 +5478,7 @@ var AddSuggestion = function AddSuggestion(_a) {
|
|
|
5478
5478
|
|
|
5479
5479
|
if (options && options.length > 0) {
|
|
5480
5480
|
sug = options === null || options === void 0 ? void 0 : options.filter(function (options) {
|
|
5481
|
-
return options.label.toLowerCase().includes(e.target.value.split(",").pop().toLowerCase());
|
|
5481
|
+
return options.label.toLowerCase().includes(e.target.value.split(",").pop().trim().toLowerCase());
|
|
5482
5482
|
} // last keyboad input after ,
|
|
5483
5483
|
);
|
|
5484
5484
|
setSuggestionArr(sug);
|
|
@@ -5519,15 +5519,16 @@ var AddSuggestion = function AddSuggestion(_a) {
|
|
|
5519
5519
|
};
|
|
5520
5520
|
|
|
5521
5521
|
var handleSuggestionClick = function handleSuggestionClick(selectedItem) {
|
|
5522
|
-
var val = selectedItem.label;
|
|
5522
|
+
var val = selectedItem.label + ", ";
|
|
5523
5523
|
var result = "";
|
|
5524
5524
|
|
|
5525
5525
|
if (suggestionValue === null || suggestionValue === void 0 ? void 0 : suggestionValue.length) {
|
|
5526
|
+
suggestionValue = suggestionValue.slice(0, suggestionValue.lastIndexOf(","));
|
|
5526
5527
|
var debris = suggestionValue.trim().split(", "); //explode string into array of strings indexed by /, |. |\s /
|
|
5527
5528
|
// debris.pop(); //pop last element off the array (which we didn't want)
|
|
5528
5529
|
|
|
5529
5530
|
result = debris.join(", ");
|
|
5530
|
-
val = result + checkComma(result) + selectedItem.label;
|
|
5531
|
+
val = result + checkComma(result) + selectedItem.label + ", ";
|
|
5531
5532
|
}
|
|
5532
5533
|
|
|
5533
5534
|
handleSuggestionValChange && handleSuggestionValChange(val);
|
|
@@ -17289,7 +17290,10 @@ var DatePicker = function DatePicker(_a) {
|
|
|
17289
17290
|
};
|
|
17290
17291
|
|
|
17291
17292
|
var DoubleInput = function DoubleInput(_a) {
|
|
17292
|
-
var
|
|
17293
|
+
var label = _a.label,
|
|
17294
|
+
labelColor = _a.labelColor,
|
|
17295
|
+
labelSize = _a.labelSize,
|
|
17296
|
+
_b = _a.input1value,
|
|
17293
17297
|
input1value = _b === void 0 ? "" : _b,
|
|
17294
17298
|
_c = _a.input2value,
|
|
17295
17299
|
input2value = _c === void 0 ? "" : _c,
|
|
@@ -17377,6 +17381,7 @@ var DoubleInput = function DoubleInput(_a) {
|
|
|
17377
17381
|
var handleFocus = function handleFocus(event) {
|
|
17378
17382
|
setActive(true);
|
|
17379
17383
|
setShowDropdown(true);
|
|
17384
|
+
setDropdownArr(options);
|
|
17380
17385
|
onFocus && onFocus(event);
|
|
17381
17386
|
};
|
|
17382
17387
|
|
|
@@ -17408,11 +17413,9 @@ var DoubleInput = function DoubleInput(_a) {
|
|
|
17408
17413
|
return options.label.toLowerCase().includes(e.target.value.toLowerCase());
|
|
17409
17414
|
});
|
|
17410
17415
|
setDropdownArr(sug);
|
|
17411
|
-
}
|
|
17412
|
-
|
|
17413
|
-
|
|
17414
|
-
handleValChange && handleValChange(e.target.value); // }
|
|
17416
|
+
}
|
|
17415
17417
|
|
|
17418
|
+
handleValChange && handleValChange(e.target.value);
|
|
17416
17419
|
setValue(e.target.value);
|
|
17417
17420
|
};
|
|
17418
17421
|
|
|
@@ -17426,11 +17429,9 @@ var DoubleInput = function DoubleInput(_a) {
|
|
|
17426
17429
|
return suffixOption.label.toLowerCase().includes(e.target.value.toLowerCase());
|
|
17427
17430
|
});
|
|
17428
17431
|
setSuffixDropdownArr(sug);
|
|
17429
|
-
}
|
|
17430
|
-
|
|
17431
|
-
|
|
17432
|
-
handleSuffixValChange && handleSuffixValChange(e.target.value); // }
|
|
17432
|
+
}
|
|
17433
17433
|
|
|
17434
|
+
handleSuffixValChange && handleSuffixValChange(e.target.value);
|
|
17434
17435
|
setSuffixValue(e.target.value);
|
|
17435
17436
|
};
|
|
17436
17437
|
|
|
@@ -17467,9 +17468,18 @@ var DoubleInput = function DoubleInput(_a) {
|
|
|
17467
17468
|
variant: "Regular",
|
|
17468
17469
|
type: "Text md"
|
|
17469
17470
|
}, {
|
|
17470
|
-
children: [jsxRuntime.exports.
|
|
17471
|
+
children: [Boolean(label) && jsxRuntime.exports.jsx("div", __assign({
|
|
17472
|
+
className: "".concat(labelColor ? labelColor : "hplxt-text-Gray-700", " hplxt-mb-1")
|
|
17473
|
+
}, {
|
|
17474
|
+
children: jsxRuntime.exports.jsx(Typography, __assign({
|
|
17475
|
+
type: "".concat(labelSize ? labelSize : "Text sm"),
|
|
17476
|
+
variant: "Medium"
|
|
17477
|
+
}, {
|
|
17478
|
+
children: label
|
|
17479
|
+
}))
|
|
17480
|
+
})), jsxRuntime.exports.jsxs("div", __assign({
|
|
17471
17481
|
"data-setid": "error-msg",
|
|
17472
|
-
className: "hplxt-flex hplxt-shadow-xs hplxt-border-1 hplxt-border-Blue_gray-100 hplxt-rounded-lg hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary\n hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 hplxt-bg-White hplxt-h-10\n ".concat(errorMsg ? "hplxt-border-Error-300" :
|
|
17482
|
+
className: "hplxt-flex hplxt-shadow-xs hplxt-border-1 hplxt-border-Blue_gray-100 hplxt-rounded-lg hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary\n hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 hplxt-bg-White hplxt-h-10\n ".concat(errorMsg ? "hplxt-border-Error-300" : "", " \n ").concat(disabled ? "hplxt-bg-Gray-50" : "".concat("hplxt-bg-White", " \n ").concat(errorMsg ? "hover:hplxt-shadow-xs-error" : "hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary "))
|
|
17473
17483
|
}, {
|
|
17474
17484
|
children: [Boolean(prefix) && jsxRuntime.exports.jsx("div", __assign({
|
|
17475
17485
|
"data-testid": "input-prefix",
|
|
@@ -17507,6 +17517,7 @@ var DoubleInput = function DoubleInput(_a) {
|
|
|
17507
17517
|
onFocus: function onFocus() {
|
|
17508
17518
|
setSuffixActive(true);
|
|
17509
17519
|
setShowSuffixDropdown(true);
|
|
17520
|
+
setSuffixDropdownArr(suffixOptions);
|
|
17510
17521
|
},
|
|
17511
17522
|
onBlur: function onBlur() {
|
|
17512
17523
|
setSuffixActive(false);
|
|
@@ -17695,6 +17706,7 @@ var InputTag = function InputTag(_a) {
|
|
|
17695
17706
|
};
|
|
17696
17707
|
|
|
17697
17708
|
var handleBlur = function handleBlur(event) {
|
|
17709
|
+
setTagInputValue("");
|
|
17698
17710
|
setShowDropdown(false);
|
|
17699
17711
|
setActive(false);
|
|
17700
17712
|
onBlur && onBlur(event);
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -394,6 +394,9 @@ export interface AddSuggestionProps {
|
|
|
394
394
|
isborderRequired?: boolean;
|
|
395
395
|
}
|
|
396
396
|
export interface DoubleInputProps {
|
|
397
|
+
label?: string;
|
|
398
|
+
labelSize?: typographyTextType;
|
|
399
|
+
labelColor?: string;
|
|
397
400
|
prefix?: ReactNode;
|
|
398
401
|
start_icon?: string;
|
|
399
402
|
end_icon?: string;
|