hplx-react-elements-dev 1.0.94 → 1.0.95
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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "react-date-range/dist/styles.css";
|
|
3
|
+
import "react-date-range/dist/theme/default.css";
|
|
4
|
+
import "../calendarView/CalenderViewCSS.css";
|
|
5
|
+
import { CalenderViewProps } from "../types";
|
|
6
|
+
declare const CalendarView: ({ date1, date2, handleDate1, handleDate2, handleSelectCalenderView, }: CalenderViewProps) => JSX.Element;
|
|
7
|
+
export default CalendarView;
|
package/dist/esm/index.js
CHANGED
|
@@ -17708,7 +17708,7 @@ var DoubleInput = function DoubleInput(_a) {
|
|
|
17708
17708
|
_l = _a.handleSuffixValChange,
|
|
17709
17709
|
handleSuffixValChange = _l === void 0 ? function (_) {} : _l,
|
|
17710
17710
|
_m = _a.onDropdownClick,
|
|
17711
|
-
onDropdownClick = _m === void 0 ? function (
|
|
17711
|
+
onDropdownClick = _m === void 0 ? function (_selectedValue, _index, _searchString) {} : _m,
|
|
17712
17712
|
_o = _a.onSuffixDropdownClick,
|
|
17713
17713
|
onSuffixDropdownClick = _o === void 0 ? function (_) {} : _o,
|
|
17714
17714
|
_p = _a.onlyDropdownItemsAllowed,
|
|
@@ -17839,10 +17839,10 @@ var DoubleInput = function DoubleInput(_a) {
|
|
|
17839
17839
|
setSuffixValue(e.target.value);
|
|
17840
17840
|
};
|
|
17841
17841
|
|
|
17842
|
-
var handleDropdownClick = function handleDropdownClick(selectedItem) {
|
|
17842
|
+
var handleDropdownClick = function handleDropdownClick(selectedItem, index) {
|
|
17843
17843
|
setValueChanged(false);
|
|
17844
|
+
onDropdownClick && onDropdownClick(selectedItem, index, value);
|
|
17844
17845
|
setValue(selectedItem.value);
|
|
17845
|
-
onDropdownClick && onDropdownClick(selectedItem);
|
|
17846
17846
|
setShowDropdown(false);
|
|
17847
17847
|
};
|
|
17848
17848
|
|
|
@@ -17953,14 +17953,14 @@ var DoubleInput = function DoubleInput(_a) {
|
|
|
17953
17953
|
className: "hplxt-absolute hplxt-border hplxt-border-Gray-300 hplxt-mt-1 hplxt-min-w-max hplxt-rounded-lg hplxt-bg-Indigo-25 hplxt-overflow-y-auto hplxt-shadow-md hplxt-z-10 hplxt-max-h-80 ".concat(dropdownClassName)
|
|
17954
17954
|
}, {
|
|
17955
17955
|
children: dropdownArr && dropdownArr.length > 0 && jsxRuntime.exports.jsx("div", {
|
|
17956
|
-
children: dropdownArr.map(function (option) {
|
|
17956
|
+
children: dropdownArr.map(function (option, index) {
|
|
17957
17957
|
var restOptions = __rest(option || {}, []);
|
|
17958
17958
|
|
|
17959
17959
|
return jsxRuntime.exports.jsx(DropdownItems, __assign({
|
|
17960
17960
|
className: "hplxt-text-Primary-700"
|
|
17961
17961
|
}, restOptions, {
|
|
17962
17962
|
onSelect: function onSelect() {
|
|
17963
|
-
return handleDropdownClick(restOptions);
|
|
17963
|
+
return handleDropdownClick(restOptions, index);
|
|
17964
17964
|
}
|
|
17965
17965
|
}));
|
|
17966
17966
|
})
|
|
@@ -18090,7 +18090,7 @@ var InputTag = function InputTag(_a) {
|
|
|
18090
18090
|
// comma separated string which is created into separate tags
|
|
18091
18091
|
handleValChange = _f === void 0 ? function (_) {} : _f,
|
|
18092
18092
|
_g = _a.onDropdownClick,
|
|
18093
|
-
onDropdownClick = _g === void 0 ? function (
|
|
18093
|
+
onDropdownClick = _g === void 0 ? function (_selectedValue, _index, _searchString) {} : _g,
|
|
18094
18094
|
_h = _a.allowDuplicates,
|
|
18095
18095
|
allowDuplicates = _h === void 0 ? false : _h,
|
|
18096
18096
|
_j = _a.getInputValue,
|
|
@@ -18230,9 +18230,8 @@ var InputTag = function InputTag(_a) {
|
|
|
18230
18230
|
showDropdown && setdropdownOffset("".concat((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.offsetLeft, "px"));
|
|
18231
18231
|
}, [options, tags, inputRef, allowDuplicates, showDropdown]); // This function handles the click event of a dropdown item
|
|
18232
18232
|
|
|
18233
|
-
var handleDropdownClick = function handleDropdownClick(selectedItem) {
|
|
18234
|
-
|
|
18235
|
-
|
|
18233
|
+
var handleDropdownClick = function handleDropdownClick(selectedItem, index) {
|
|
18234
|
+
// Set a timeout to add the selected item to the tags after a certain time
|
|
18236
18235
|
var sto = setTimeout(function () {
|
|
18237
18236
|
// If allowDuplicates flag is true or the selected item is not already in the tags, add the item to the tags
|
|
18238
18237
|
if (allowDuplicates || !tags.includes(selectedItem.value)) {
|
|
@@ -18245,12 +18244,13 @@ var InputTag = function InputTag(_a) {
|
|
|
18245
18244
|
var val = value.trim() + ", " + selectedItem.value;
|
|
18246
18245
|
setValue(val); // Call onDropdownClick function if it is defined
|
|
18247
18246
|
|
|
18248
|
-
onDropdownClick && onDropdownClick(selectedItem); // Call handleValChange function if it is defined
|
|
18247
|
+
onDropdownClick && onDropdownClick(selectedItem, index, tagInputValue); // Call handleValChange function if it is defined
|
|
18249
18248
|
|
|
18250
18249
|
handleValChange && handleValChange(val); // Reset focus index and dropdown array
|
|
18251
18250
|
|
|
18252
18251
|
setFocusIndex(-1);
|
|
18253
|
-
setDropdownArr(options);
|
|
18252
|
+
setDropdownArr(options);
|
|
18253
|
+
setTagInputValue(""); // Clear the timeout
|
|
18254
18254
|
|
|
18255
18255
|
sto && clearTimeout(sto);
|
|
18256
18256
|
}, 100); // Return a function to clear the timeout when the component unmounts or when a new dropdown item is clicked
|
|
@@ -18543,7 +18543,7 @@ var InputTag = function InputTag(_a) {
|
|
|
18543
18543
|
}, restOptions, {
|
|
18544
18544
|
onSelect: function onSelect() {
|
|
18545
18545
|
dropdownClickedRef.current = true;
|
|
18546
|
-
handleDropdownClick(restOptions);
|
|
18546
|
+
handleDropdownClick(restOptions, index);
|
|
18547
18547
|
},
|
|
18548
18548
|
ddRef: ddRef,
|
|
18549
18549
|
setChangeLeft: setChangeLeft
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -60,6 +60,13 @@ export interface DatePickerProps {
|
|
|
60
60
|
isSuffixEditable?: boolean;
|
|
61
61
|
handleSuffixValChange?: (value: any) => void;
|
|
62
62
|
}
|
|
63
|
+
export interface CalenderViewProps {
|
|
64
|
+
date1?: Date;
|
|
65
|
+
date2?: Date;
|
|
66
|
+
handleDate1: (val: Date) => void;
|
|
67
|
+
handleDate2: (val: Date) => void;
|
|
68
|
+
handleSelectCalenderView?: (val: Date) => void;
|
|
69
|
+
}
|
|
63
70
|
export interface InputFieldSplitProps {
|
|
64
71
|
label?: string;
|
|
65
72
|
labelSize?: typographyTextType;
|
|
@@ -419,7 +426,7 @@ export interface DoubleInputProps {
|
|
|
419
426
|
suffixOptions?: Array<DropdownItemsProps>;
|
|
420
427
|
handleValChange?: (value: any) => void;
|
|
421
428
|
handleSuffixValChange?: (value: any) => void;
|
|
422
|
-
onDropdownClick?: (value: any) => void;
|
|
429
|
+
onDropdownClick?: (value: any, index?: number, searchString?: string) => void;
|
|
423
430
|
onSuffixDropdownClick?: (value: any) => void;
|
|
424
431
|
dropdownClassName?: string;
|
|
425
432
|
suffixDropdownClassName?: string;
|
|
@@ -435,7 +442,7 @@ export interface InputTagProps {
|
|
|
435
442
|
tagList?: Array<string>;
|
|
436
443
|
tagString?: string;
|
|
437
444
|
dropdownClassName?: string;
|
|
438
|
-
onDropdownClick?: (value: any) => void;
|
|
445
|
+
onDropdownClick?: (value: any, index?: number, searchString?: string) => void;
|
|
439
446
|
options?: Array<DropdownItemsProps>;
|
|
440
447
|
inputProps?: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
441
448
|
handleValChange?: (value: any) => void;
|