hplx-react-elements-dev 1.1.29 → 1.1.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.
- package/dist/esm/index.js +302 -107
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2964,8 +2964,8 @@ var TextAreaField = function TextAreaField(_a) {
|
|
|
2964
2964
|
setTimeout(function () {
|
|
2965
2965
|
var textarea = ref.current;
|
|
2966
2966
|
textarea.focus();
|
|
2967
|
-
textarea.value += ' ';
|
|
2968
2967
|
textarea.value = textarea.value.trim();
|
|
2968
|
+
if (textarea.value) textarea.value += "\n";
|
|
2969
2969
|
}, 0);
|
|
2970
2970
|
isDynamicHeight && handleHeight();
|
|
2971
2971
|
};
|
|
@@ -18226,100 +18226,105 @@ var InputTagDropdownItem = function InputTagDropdownItem(_a) {
|
|
|
18226
18226
|
};
|
|
18227
18227
|
|
|
18228
18228
|
var InputTag = function InputTag(_a) {
|
|
18229
|
-
var _b;
|
|
18229
|
+
var _b, _c;
|
|
18230
18230
|
|
|
18231
18231
|
var inputProps = _a.inputProps,
|
|
18232
18232
|
className = _a.className,
|
|
18233
18233
|
dropdownClassName = _a.dropdownClassName,
|
|
18234
|
-
|
|
18235
|
-
options =
|
|
18236
|
-
|
|
18237
|
-
tagList =
|
|
18238
|
-
|
|
18239
|
-
tagString =
|
|
18234
|
+
_d = _a.options,
|
|
18235
|
+
options = _d === void 0 ? [] : _d,
|
|
18236
|
+
_e = _a.tagList,
|
|
18237
|
+
tagList = _e === void 0 ? [] : _e,
|
|
18238
|
+
_f = _a.tagString,
|
|
18239
|
+
tagString = _f === void 0 ? "" : _f,
|
|
18240
18240
|
// comma separated string which is created into separate tags
|
|
18241
|
-
|
|
18241
|
+
_g = _a.handleValChange,
|
|
18242
18242
|
// comma separated string which is created into separate tags
|
|
18243
|
-
handleValChange =
|
|
18244
|
-
} :
|
|
18245
|
-
|
|
18246
|
-
onDropdownClick =
|
|
18247
|
-
|
|
18248
|
-
allowDuplicates =
|
|
18249
|
-
|
|
18250
|
-
getInputValue =
|
|
18243
|
+
handleValChange = _g === void 0 ? function (_, _currentInputValue, _fromEvent) {
|
|
18244
|
+
} : _g,
|
|
18245
|
+
_h = _a.onDropdownClick,
|
|
18246
|
+
onDropdownClick = _h === void 0 ? function (_selectedValue, _index, _searchString) {} : _h,
|
|
18247
|
+
_j = _a.allowDuplicates,
|
|
18248
|
+
allowDuplicates = _j === void 0 ? false : _j,
|
|
18249
|
+
_k = _a.getInputValue,
|
|
18250
|
+
getInputValue = _k === void 0 ? function (input) {
|
|
18251
18251
|
return input;
|
|
18252
|
-
} :
|
|
18252
|
+
} : _k;
|
|
18253
18253
|
|
|
18254
|
-
var
|
|
18255
|
-
disabled =
|
|
18256
|
-
onFocus =
|
|
18257
|
-
onBlur =
|
|
18258
|
-
|
|
18259
|
-
var _l = useState(false),
|
|
18260
|
-
active = _l[0],
|
|
18261
|
-
setActive = _l[1];
|
|
18254
|
+
var _l = inputProps || {},
|
|
18255
|
+
disabled = _l.disabled,
|
|
18256
|
+
onFocus = _l.onFocus,
|
|
18257
|
+
onBlur = _l.onBlur;
|
|
18262
18258
|
|
|
18263
18259
|
var _m = useState(false),
|
|
18264
|
-
|
|
18265
|
-
|
|
18260
|
+
active = _m[0],
|
|
18261
|
+
setActive = _m[1];
|
|
18266
18262
|
|
|
18267
|
-
var _o = useState(
|
|
18268
|
-
|
|
18269
|
-
|
|
18263
|
+
var _o = useState(false),
|
|
18264
|
+
showDropdown = _o[0],
|
|
18265
|
+
setShowDropdown = _o[1];
|
|
18270
18266
|
|
|
18271
18267
|
var _p = useState(""),
|
|
18272
|
-
|
|
18273
|
-
|
|
18268
|
+
dropdownOffset = _p[0],
|
|
18269
|
+
setdropdownOffset = _p[1];
|
|
18270
|
+
|
|
18271
|
+
var _q = useState(""),
|
|
18272
|
+
value = _q[0],
|
|
18273
|
+
setValue = _q[1]; // tag string
|
|
18274
18274
|
|
|
18275
18275
|
|
|
18276
18276
|
var wrapperRef = useRef(null);
|
|
18277
18277
|
var inputRef = useRef(null);
|
|
18278
|
+
var divRef = useRef([]);
|
|
18278
18279
|
var ddRef = useRef(null);
|
|
18279
18280
|
var editRef = useRef(null);
|
|
18280
18281
|
var spanRef = useRef(null);
|
|
18281
18282
|
|
|
18282
|
-
var
|
|
18283
|
-
dropdownArr =
|
|
18284
|
-
setDropdownArr =
|
|
18283
|
+
var _r = useState([]),
|
|
18284
|
+
dropdownArr = _r[0],
|
|
18285
|
+
setDropdownArr = _r[1];
|
|
18285
18286
|
|
|
18286
|
-
var
|
|
18287
|
-
tagInputValue =
|
|
18288
|
-
setTagInputValue =
|
|
18287
|
+
var _s = useState(""),
|
|
18288
|
+
tagInputValue = _s[0],
|
|
18289
|
+
setTagInputValue = _s[1]; // input field state
|
|
18289
18290
|
|
|
18290
18291
|
|
|
18291
|
-
var
|
|
18292
|
+
var _t = useState(__spreadArray(__spreadArray([], tagList.filter(Boolean), true), tagString.split(",").filter(Boolean).map(function (item) {
|
|
18292
18293
|
return item.trim();
|
|
18293
18294
|
}), true)),
|
|
18294
|
-
tags =
|
|
18295
|
-
setTags =
|
|
18295
|
+
tags = _t[0],
|
|
18296
|
+
setTags = _t[1]; // tag array
|
|
18296
18297
|
|
|
18297
18298
|
|
|
18298
|
-
var
|
|
18299
|
-
focusIndex =
|
|
18300
|
-
setFocusIndex =
|
|
18299
|
+
var _u = useState(-1),
|
|
18300
|
+
focusIndex = _u[0],
|
|
18301
|
+
setFocusIndex = _u[1];
|
|
18301
18302
|
|
|
18302
|
-
var
|
|
18303
|
-
changeLeft =
|
|
18304
|
-
setChangeLeft =
|
|
18303
|
+
var _v = useState(true),
|
|
18304
|
+
changeLeft = _v[0],
|
|
18305
|
+
setChangeLeft = _v[1];
|
|
18305
18306
|
|
|
18306
|
-
var
|
|
18307
|
-
editIndex =
|
|
18308
|
-
setEditIndex =
|
|
18307
|
+
var _w = useState(-1),
|
|
18308
|
+
editIndex = _w[0],
|
|
18309
|
+
setEditIndex = _w[1];
|
|
18309
18310
|
|
|
18310
|
-
var
|
|
18311
|
-
editInputValue =
|
|
18312
|
-
setEditInputValue =
|
|
18311
|
+
var _x = useState(""),
|
|
18312
|
+
editInputValue = _x[0],
|
|
18313
|
+
setEditInputValue = _x[1];
|
|
18313
18314
|
|
|
18314
18315
|
var dropdownClickedRef = useRef(false);
|
|
18315
18316
|
|
|
18316
|
-
var
|
|
18317
|
-
content =
|
|
18318
|
-
setContent =
|
|
18317
|
+
var _y = useState(""),
|
|
18318
|
+
content = _y[0],
|
|
18319
|
+
setContent = _y[1];
|
|
18320
|
+
|
|
18321
|
+
var _z = useState(0),
|
|
18322
|
+
width = _z[0],
|
|
18323
|
+
setWidth = _z[1];
|
|
18319
18324
|
|
|
18320
|
-
var
|
|
18321
|
-
|
|
18322
|
-
|
|
18325
|
+
var _0 = useState(-1),
|
|
18326
|
+
divIndex = _0[0],
|
|
18327
|
+
setDivIndex = _0[1];
|
|
18323
18328
|
|
|
18324
18329
|
var handleDragStart = function handleDragStart(e, index) {
|
|
18325
18330
|
e.dataTransfer.setData("text/plain", index.toString());
|
|
@@ -18392,6 +18397,64 @@ var InputTag = function InputTag(_a) {
|
|
|
18392
18397
|
dropdownClickedRef.current = false;
|
|
18393
18398
|
};
|
|
18394
18399
|
|
|
18400
|
+
var sortDropdownArray = function sortDropdownArray(index) {
|
|
18401
|
+
var inputValue = divRef.current[index].textContent;
|
|
18402
|
+
var sug = [],
|
|
18403
|
+
sortedSug = []; // Show the dropdown list
|
|
18404
|
+
|
|
18405
|
+
setShowDropdown(true);
|
|
18406
|
+
|
|
18407
|
+
if (options && options.length > 0) {
|
|
18408
|
+
// Filter options that contain the input value
|
|
18409
|
+
sug = options === null || options === void 0 ? void 0 : options.filter(function (options) {
|
|
18410
|
+
return options.label.toLowerCase().includes(inputValue.toLowerCase());
|
|
18411
|
+
});
|
|
18412
|
+
sortedSug = sug.sort(function (a, b) {
|
|
18413
|
+
var aStartsWithTerm = a.label.toLowerCase().startsWith(inputValue.toLowerCase());
|
|
18414
|
+
var bStartsWithTerm = b.label.toLowerCase().startsWith(inputValue.toLowerCase());
|
|
18415
|
+
|
|
18416
|
+
if (aStartsWithTerm && !bStartsWithTerm) {
|
|
18417
|
+
return -1;
|
|
18418
|
+
} else if (!aStartsWithTerm && bStartsWithTerm) {
|
|
18419
|
+
return 1;
|
|
18420
|
+
} else {
|
|
18421
|
+
return a.label.localeCompare(b.label);
|
|
18422
|
+
}
|
|
18423
|
+
}); // Filter out items that already exist in tags, unless allowDuplicates flag is true
|
|
18424
|
+
|
|
18425
|
+
if (!allowDuplicates) {
|
|
18426
|
+
sortedSug = sortedSug.filter(function (item) {
|
|
18427
|
+
return !tags.includes(item.value);
|
|
18428
|
+
});
|
|
18429
|
+
}
|
|
18430
|
+
|
|
18431
|
+
setDropdownArr(sortedSug);
|
|
18432
|
+
}
|
|
18433
|
+
};
|
|
18434
|
+
|
|
18435
|
+
useEffect(function () {
|
|
18436
|
+
if (divIndex >= 0) {
|
|
18437
|
+
var targetDiv = divRef.current[divIndex];
|
|
18438
|
+
|
|
18439
|
+
var mutationCallback = function mutationCallback(mutationsList) {
|
|
18440
|
+
for (var _i = 0, mutationsList_1 = mutationsList; _i < mutationsList_1.length; _i++) {
|
|
18441
|
+
var mutation = mutationsList_1[_i];
|
|
18442
|
+
|
|
18443
|
+
if (mutation.type === 'childList' || mutation.type === 'characterData') {
|
|
18444
|
+
sortDropdownArray(divIndex);
|
|
18445
|
+
}
|
|
18446
|
+
}
|
|
18447
|
+
};
|
|
18448
|
+
|
|
18449
|
+
var observer = new MutationObserver(mutationCallback);
|
|
18450
|
+
var observerConfig = {
|
|
18451
|
+
characterData: true,
|
|
18452
|
+
subtree: true
|
|
18453
|
+
}; // Start observing the target element
|
|
18454
|
+
|
|
18455
|
+
observer.observe(targetDiv, observerConfig);
|
|
18456
|
+
}
|
|
18457
|
+
}, [(_b = divRef.current[divIndex]) === null || _b === void 0 ? void 0 : _b.textContent]);
|
|
18395
18458
|
useEffect(function () {
|
|
18396
18459
|
var _a; // Filter options based on whether duplicates are allowed or not
|
|
18397
18460
|
|
|
@@ -18404,17 +18467,32 @@ var InputTag = function InputTag(_a) {
|
|
|
18404
18467
|
} // Set the dropdown offset
|
|
18405
18468
|
|
|
18406
18469
|
|
|
18407
|
-
|
|
18470
|
+
if (divIndex === -1) {
|
|
18471
|
+
showDropdown && setdropdownOffset("".concat((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.offsetLeft, "px"));
|
|
18472
|
+
}
|
|
18408
18473
|
}, [options, tags, inputRef, allowDuplicates, showDropdown]); // This function handles the click event of a dropdown item
|
|
18409
18474
|
|
|
18410
|
-
var handleDropdownClick = function handleDropdownClick(selectedItem, index) {
|
|
18475
|
+
var handleDropdownClick = function handleDropdownClick(selectedItem, index, divIndex) {
|
|
18411
18476
|
// Set a timeout to add the selected item to the tags after a certain time
|
|
18412
18477
|
var sto = setTimeout(function () {
|
|
18413
18478
|
// If allowDuplicates flag is true or the selected item is not already in the tags, add the item to the tags
|
|
18414
18479
|
if (allowDuplicates || !tags.includes(selectedItem.value)) {
|
|
18415
|
-
|
|
18416
|
-
|
|
18417
|
-
|
|
18480
|
+
if (divIndex !== -1) {
|
|
18481
|
+
var newTagList = __spreadArray([], tags, true);
|
|
18482
|
+
|
|
18483
|
+
newTagList.splice(divIndex, 0, selectedItem.value);
|
|
18484
|
+
setTags(newTagList);
|
|
18485
|
+
divRef.current[divIndex].textContent = "";
|
|
18486
|
+
setTimeout(function () {
|
|
18487
|
+
divRef.current[divIndex + 1].focus();
|
|
18488
|
+
}, 0);
|
|
18489
|
+
setDivIndex(divIndex + 1);
|
|
18490
|
+
setFocusIndex(-1);
|
|
18491
|
+
} else {
|
|
18492
|
+
setTags(function (prev) {
|
|
18493
|
+
return __spreadArray(__spreadArray([], prev, true), [selectedItem.value], false);
|
|
18494
|
+
});
|
|
18495
|
+
}
|
|
18418
18496
|
} // Add the selected item to the input value and update the displayed value
|
|
18419
18497
|
|
|
18420
18498
|
|
|
@@ -18455,12 +18533,23 @@ var InputTag = function InputTag(_a) {
|
|
|
18455
18533
|
setWidth(((_a = spanRef === null || spanRef === void 0 ? void 0 : spanRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0);
|
|
18456
18534
|
}, [content]);
|
|
18457
18535
|
|
|
18536
|
+
var handleFocusDiv = function handleFocusDiv(event, index) {
|
|
18537
|
+
var _a;
|
|
18538
|
+
|
|
18539
|
+
setdropdownOffset("".concat((_a = divRef.current[index]) === null || _a === void 0 ? void 0 : _a.offsetLeft, "px"));
|
|
18540
|
+
setShowDropdown(true);
|
|
18541
|
+
setActive(true);
|
|
18542
|
+
setDivIndex(index);
|
|
18543
|
+
onFocus && onFocus(event);
|
|
18544
|
+
};
|
|
18545
|
+
|
|
18458
18546
|
var handleFocus = function handleFocus(event) {
|
|
18459
18547
|
var _a;
|
|
18460
18548
|
|
|
18461
18549
|
setdropdownOffset("".concat((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.offsetLeft, "px"));
|
|
18462
18550
|
setShowDropdown(true);
|
|
18463
18551
|
setActive(true);
|
|
18552
|
+
setDivIndex(-1);
|
|
18464
18553
|
onFocus && onFocus(event);
|
|
18465
18554
|
};
|
|
18466
18555
|
|
|
@@ -18525,6 +18614,93 @@ var InputTag = function InputTag(_a) {
|
|
|
18525
18614
|
}
|
|
18526
18615
|
};
|
|
18527
18616
|
|
|
18617
|
+
var addTagsfromDiv = function addTagsfromDiv(e, index) {
|
|
18618
|
+
var ITEM_HEIGHT = 40;
|
|
18619
|
+
var inputValue = divRef.current[index].textContent;
|
|
18620
|
+
|
|
18621
|
+
if ((e.keyCode === 9 || e.keyCode === 13) && inputValue.trim() && inputValue.trim().length > 1 && (allowDuplicates || !tags.includes(inputValue.trim())) // check if allowDuplicates flag is true or tagInputValue is not already in tags
|
|
18622
|
+
) {
|
|
18623
|
+
e.preventDefault();
|
|
18624
|
+
|
|
18625
|
+
var newTagList = __spreadArray([], tags, true);
|
|
18626
|
+
|
|
18627
|
+
newTagList.splice(index, 0, inputValue.trim());
|
|
18628
|
+
setTags(newTagList);
|
|
18629
|
+
divRef.current[index].textContent = "";
|
|
18630
|
+
setTimeout(function () {
|
|
18631
|
+
divRef.current[index + 1].focus();
|
|
18632
|
+
}, 0);
|
|
18633
|
+
setDivIndex(index + 1);
|
|
18634
|
+
setFocusIndex(-1);
|
|
18635
|
+
focusIndex < 0 && handleValChange && handleValChange(newTagList.filter(Boolean).join(", "), tagInputValue.trim(), "");
|
|
18636
|
+
} else if (e.keyCode === 13 && inputValue.trim().length <= 1) {
|
|
18637
|
+
setFocusIndex(-1);
|
|
18638
|
+
|
|
18639
|
+
if (wrapperRef && wrapperRef.current) {
|
|
18640
|
+
wrapperRef.current.scrollTop = 0;
|
|
18641
|
+
}
|
|
18642
|
+
} //on backspace
|
|
18643
|
+
|
|
18644
|
+
|
|
18645
|
+
if (e.keyCode === 8 && !inputValue) {
|
|
18646
|
+
setShowDropdown(false); // setEditInputValue(tags[tags.length - 1] + " ");
|
|
18647
|
+
// setEditIndex(tags.length - 1);
|
|
18648
|
+
} // on key down
|
|
18649
|
+
|
|
18650
|
+
|
|
18651
|
+
if (e.keyCode === 40) {
|
|
18652
|
+
if (focusIndex < dropdownArr.length - 1) {
|
|
18653
|
+
var focusI = focusIndex + 1;
|
|
18654
|
+
|
|
18655
|
+
if (wrapperRef && wrapperRef.current && focusI > 1) {
|
|
18656
|
+
wrapperRef.current.scrollBy(0, ITEM_HEIGHT);
|
|
18657
|
+
}
|
|
18658
|
+
|
|
18659
|
+
setFocusIndex(focusI);
|
|
18660
|
+
}
|
|
18661
|
+
} // on key up
|
|
18662
|
+
|
|
18663
|
+
|
|
18664
|
+
if (e.keyCode === 38) {
|
|
18665
|
+
if (focusIndex > 0) {
|
|
18666
|
+
var focusI = focusIndex - 1;
|
|
18667
|
+
|
|
18668
|
+
if (wrapperRef && wrapperRef.current && focusI < dropdownArr.length - 2) {
|
|
18669
|
+
wrapperRef.current.scrollBy(0, -ITEM_HEIGHT);
|
|
18670
|
+
}
|
|
18671
|
+
|
|
18672
|
+
setFocusIndex(focusI);
|
|
18673
|
+
}
|
|
18674
|
+
} // on key left or right key
|
|
18675
|
+
|
|
18676
|
+
|
|
18677
|
+
if (e.keyCode === 37 || e.keyCode === 39) {
|
|
18678
|
+
if (focusIndex >= 0) {
|
|
18679
|
+
setFocusIndex(focusIndex);
|
|
18680
|
+
setTagInputValue(dropdownArr[focusIndex].value);
|
|
18681
|
+
}
|
|
18682
|
+
} // on key enter
|
|
18683
|
+
|
|
18684
|
+
|
|
18685
|
+
if (e.keyCode === 13 || e.keyCode === 9) {
|
|
18686
|
+
if (focusIndex >= 0) {
|
|
18687
|
+
e.preventDefault();
|
|
18688
|
+
|
|
18689
|
+
var newTagList = __spreadArray([], tags, true);
|
|
18690
|
+
|
|
18691
|
+
newTagList.splice(index, 0, inputValue.trim());
|
|
18692
|
+
setTags(newTagList);
|
|
18693
|
+
divRef.current[index].textContent = "";
|
|
18694
|
+
setTimeout(function () {
|
|
18695
|
+
divRef.current[index + 1].focus();
|
|
18696
|
+
}, 0);
|
|
18697
|
+
setDivIndex(index + 1);
|
|
18698
|
+
setFocusIndex(-1);
|
|
18699
|
+
handleDropdownClick(dropdownArr[focusIndex], focusIndex, index);
|
|
18700
|
+
}
|
|
18701
|
+
}
|
|
18702
|
+
};
|
|
18703
|
+
|
|
18528
18704
|
var addTags = function addTags(e) {
|
|
18529
18705
|
var ITEM_HEIGHT = 40;
|
|
18530
18706
|
|
|
@@ -18600,12 +18776,13 @@ var InputTag = function InputTag(_a) {
|
|
|
18600
18776
|
setValue(res.filter(Boolean).join(", "));
|
|
18601
18777
|
setTagInputValue("");
|
|
18602
18778
|
setFocusIndex(-1);
|
|
18603
|
-
handleDropdownClick(dropdownArr[focusIndex], focusIndex);
|
|
18779
|
+
handleDropdownClick(dropdownArr[focusIndex], focusIndex, -1);
|
|
18604
18780
|
}
|
|
18605
18781
|
}
|
|
18606
18782
|
};
|
|
18607
18783
|
|
|
18608
18784
|
var deleteTag = function deleteTag(_, del_index) {
|
|
18785
|
+
setDivIndex(-1);
|
|
18609
18786
|
var deletedValue = tags[del_index];
|
|
18610
18787
|
var remainingTags = tags.filter(function (_, index) {
|
|
18611
18788
|
return del_index !== index;
|
|
@@ -18619,16 +18796,13 @@ var InputTag = function InputTag(_a) {
|
|
|
18619
18796
|
setValue(tags.filter(Boolean).join(", "));
|
|
18620
18797
|
}, [tags]);
|
|
18621
18798
|
useEffect(function () {
|
|
18622
|
-
var _a;
|
|
18623
|
-
|
|
18624
18799
|
if (editIndex >= 0) {
|
|
18625
18800
|
editRef.current && editRef.current.focus();
|
|
18626
|
-
}
|
|
18801
|
+
} // setdropdownOffset(`${inputRef.current?.offsetLeft}px`);
|
|
18627
18802
|
|
|
18628
|
-
|
|
18629
|
-
}, [editIndex, dropdownArr]);
|
|
18803
|
+
}, [editIndex]);
|
|
18630
18804
|
return jsxRuntime.exports.jsxs("div", __assign({
|
|
18631
|
-
className: "inputTag hplxt-w-auto hplxt-
|
|
18805
|
+
className: "inputTag hplxt-w-auto hplxt-gap-y-1 hplxt-h-auto hplxt-p-1.5 hplxt-flex hplxt-flex-wrap hplxt-border-1 hplxt-rounded-lg hplxt-border-Blue_gray-100 hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active ? "hplxt-border-Primary-300 hplxt-shadow-xs-primary" : "", " ").concat(disabled ? "hplxt-bg-Gray-50" : "", " ").concat(className)
|
|
18632
18806
|
}, {
|
|
18633
18807
|
children: [tags.map(function (item, index) {
|
|
18634
18808
|
return index === editIndex ? jsxRuntime.exports.jsxs("div", {
|
|
@@ -18668,46 +18842,67 @@ var InputTag = function InputTag(_a) {
|
|
|
18668
18842
|
}, {
|
|
18669
18843
|
children: content
|
|
18670
18844
|
}))]
|
|
18671
|
-
}, "".concat(item, "+").concat(index)) : jsxRuntime.exports.jsxs(
|
|
18672
|
-
|
|
18673
|
-
|
|
18674
|
-
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
|
|
18683
|
-
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18688
|
-
|
|
18689
|
-
|
|
18845
|
+
}, "".concat(item, "+").concat(index)) : jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, {
|
|
18846
|
+
children: [jsxRuntime.exports.jsx("div", __assign({
|
|
18847
|
+
contentEditable: true,
|
|
18848
|
+
value: divRef.current[index],
|
|
18849
|
+
ref: function ref(el) {
|
|
18850
|
+
return divRef.current[index] = el;
|
|
18851
|
+
},
|
|
18852
|
+
style: {
|
|
18853
|
+
minWidth: '5px',
|
|
18854
|
+
maxWidth: 'auto',
|
|
18855
|
+
padding: '2px'
|
|
18856
|
+
},
|
|
18857
|
+
className: "focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0",
|
|
18858
|
+
onKeyDown: function onKeyDown(e) {
|
|
18859
|
+
return addTagsfromDiv(e, index);
|
|
18860
|
+
}
|
|
18861
|
+
}, inputProps, {
|
|
18862
|
+
onFocus: function onFocus(e) {
|
|
18863
|
+
return handleFocusDiv(e, index);
|
|
18864
|
+
}
|
|
18865
|
+
}), index), jsxRuntime.exports.jsxs("div", __assign({
|
|
18866
|
+
className: "hplxt-flex hplxt-items-center hplxt-bg-Primary-50 hplxt-border-1 hplxt-rounded hplxt-border-Primary-100 hplxt-py-1 hplxt-px-2",
|
|
18867
|
+
draggable: true,
|
|
18868
|
+
onDragStart: function onDragStart(e) {
|
|
18869
|
+
return handleDragStart(e, index);
|
|
18870
|
+
},
|
|
18871
|
+
onDragOver: handleDragOver,
|
|
18872
|
+
onDragEnter: function onDragEnter(e) {
|
|
18873
|
+
return handleDragEnter(e);
|
|
18874
|
+
},
|
|
18875
|
+
onDrop: function onDrop(e) {
|
|
18876
|
+
return handleDrop(e, index);
|
|
18690
18877
|
}
|
|
18691
18878
|
}, {
|
|
18692
|
-
children: jsxRuntime.exports.jsx(
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18879
|
+
children: [jsxRuntime.exports.jsx("button", __assign({
|
|
18880
|
+
onClick: function onClick() {
|
|
18881
|
+
setEditIndex(index);
|
|
18882
|
+
setEditInputValue(item);
|
|
18883
|
+
setContent(item);
|
|
18884
|
+
}
|
|
18696
18885
|
}, {
|
|
18697
|
-
children:
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18886
|
+
children: jsxRuntime.exports.jsx(Typography, __assign({
|
|
18887
|
+
variant: "Semibold",
|
|
18888
|
+
type: "Text sm",
|
|
18889
|
+
className: "hplxt-text-Gray-600"
|
|
18890
|
+
}, {
|
|
18891
|
+
children: item
|
|
18892
|
+
}))
|
|
18893
|
+
}), index), jsxRuntime.exports.jsx("i", {
|
|
18894
|
+
className: "hx_close hplxt-text-[75%] hplxt-text-Primary-700",
|
|
18895
|
+
onClick: function onClick() {
|
|
18896
|
+
return deleteTag(item, index);
|
|
18897
|
+
}
|
|
18898
|
+
})]
|
|
18899
|
+
}), "".concat(item, "+").concat(index))]
|
|
18900
|
+
});
|
|
18706
18901
|
}), jsxRuntime.exports.jsx("input", __assign({
|
|
18707
18902
|
type: "text",
|
|
18708
18903
|
value: tagInputValue,
|
|
18709
18904
|
ref: inputRef,
|
|
18710
|
-
className: "hplxt-flex-1 placeholder:hplxt-text-Gray-500 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0",
|
|
18905
|
+
className: "hplxt-flex-1 hplxt-ml-[5px] placeholder:hplxt-text-Gray-500 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0",
|
|
18711
18906
|
placeholder: "Enter Text",
|
|
18712
18907
|
onChange: function onChange(e) {
|
|
18713
18908
|
getInputValue(e.target.value);
|
|
@@ -18726,7 +18921,7 @@ var InputTag = function InputTag(_a) {
|
|
|
18726
18921
|
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),
|
|
18727
18922
|
style: {
|
|
18728
18923
|
left: changeLeft ? dropdownOffset : "",
|
|
18729
|
-
top: "".concat((((
|
|
18924
|
+
top: "".concat((((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.offsetTop) || 0) + 40, "px")
|
|
18730
18925
|
}
|
|
18731
18926
|
}, {
|
|
18732
18927
|
children: dropdownArr && dropdownArr.length > 0 && jsxRuntime.exports.jsx("div", {
|
|
@@ -18738,7 +18933,7 @@ var InputTag = function InputTag(_a) {
|
|
|
18738
18933
|
}, restOptions, {
|
|
18739
18934
|
onSelect: function onSelect() {
|
|
18740
18935
|
dropdownClickedRef.current = true;
|
|
18741
|
-
handleDropdownClick(restOptions, index);
|
|
18936
|
+
handleDropdownClick(restOptions, index, divIndex);
|
|
18742
18937
|
},
|
|
18743
18938
|
ddRef: ddRef,
|
|
18744
18939
|
setChangeLeft: setChangeLeft
|