hplx-react-elements-dev 1.1.29 → 1.1.30
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 +305 -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,92 @@ 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
|
+
} else if (e.keyCode === 13 && inputValue.trim().length <= 1) {
|
|
18636
|
+
setFocusIndex(-1);
|
|
18637
|
+
|
|
18638
|
+
if (wrapperRef && wrapperRef.current) {
|
|
18639
|
+
wrapperRef.current.scrollTop = 0;
|
|
18640
|
+
}
|
|
18641
|
+
} //on backspace
|
|
18642
|
+
|
|
18643
|
+
|
|
18644
|
+
if (e.keyCode === 8 && !inputValue) {
|
|
18645
|
+
setShowDropdown(false); // setEditInputValue(tags[tags.length - 1] + " ");
|
|
18646
|
+
// setEditIndex(tags.length - 1);
|
|
18647
|
+
} // on key down
|
|
18648
|
+
|
|
18649
|
+
|
|
18650
|
+
if (e.keyCode === 40) {
|
|
18651
|
+
if (focusIndex < dropdownArr.length - 1) {
|
|
18652
|
+
var focusI = focusIndex + 1;
|
|
18653
|
+
|
|
18654
|
+
if (wrapperRef && wrapperRef.current && focusI > 1) {
|
|
18655
|
+
wrapperRef.current.scrollBy(0, ITEM_HEIGHT);
|
|
18656
|
+
}
|
|
18657
|
+
|
|
18658
|
+
setFocusIndex(focusI);
|
|
18659
|
+
}
|
|
18660
|
+
} // on key up
|
|
18661
|
+
|
|
18662
|
+
|
|
18663
|
+
if (e.keyCode === 38) {
|
|
18664
|
+
if (focusIndex > 0) {
|
|
18665
|
+
var focusI = focusIndex - 1;
|
|
18666
|
+
|
|
18667
|
+
if (wrapperRef && wrapperRef.current && focusI < dropdownArr.length - 2) {
|
|
18668
|
+
wrapperRef.current.scrollBy(0, -ITEM_HEIGHT);
|
|
18669
|
+
}
|
|
18670
|
+
|
|
18671
|
+
setFocusIndex(focusI);
|
|
18672
|
+
}
|
|
18673
|
+
} // on key left or right key
|
|
18674
|
+
|
|
18675
|
+
|
|
18676
|
+
if (e.keyCode === 37 || e.keyCode === 39) {
|
|
18677
|
+
if (focusIndex >= 0) {
|
|
18678
|
+
setFocusIndex(focusIndex);
|
|
18679
|
+
setTagInputValue(dropdownArr[focusIndex].value);
|
|
18680
|
+
}
|
|
18681
|
+
} // on key enter
|
|
18682
|
+
|
|
18683
|
+
|
|
18684
|
+
if (e.keyCode === 13 || e.keyCode === 9) {
|
|
18685
|
+
if (focusIndex >= 0) {
|
|
18686
|
+
e.preventDefault();
|
|
18687
|
+
|
|
18688
|
+
var newTagList = __spreadArray([], tags, true);
|
|
18689
|
+
|
|
18690
|
+
newTagList.splice(index, 0, inputValue.trim());
|
|
18691
|
+
setTags(newTagList);
|
|
18692
|
+
divRef.current[index].textContent = "";
|
|
18693
|
+
setTimeout(function () {
|
|
18694
|
+
divRef.current[index + 1].focus();
|
|
18695
|
+
}, 0);
|
|
18696
|
+
setDivIndex(index + 1);
|
|
18697
|
+
setFocusIndex(-1);
|
|
18698
|
+
handleDropdownClick(dropdownArr[focusIndex], focusIndex, index);
|
|
18699
|
+
}
|
|
18700
|
+
}
|
|
18701
|
+
};
|
|
18702
|
+
|
|
18528
18703
|
var addTags = function addTags(e) {
|
|
18529
18704
|
var ITEM_HEIGHT = 40;
|
|
18530
18705
|
|
|
@@ -18600,12 +18775,13 @@ var InputTag = function InputTag(_a) {
|
|
|
18600
18775
|
setValue(res.filter(Boolean).join(", "));
|
|
18601
18776
|
setTagInputValue("");
|
|
18602
18777
|
setFocusIndex(-1);
|
|
18603
|
-
handleDropdownClick(dropdownArr[focusIndex], focusIndex);
|
|
18778
|
+
handleDropdownClick(dropdownArr[focusIndex], focusIndex, -1);
|
|
18604
18779
|
}
|
|
18605
18780
|
}
|
|
18606
18781
|
};
|
|
18607
18782
|
|
|
18608
18783
|
var deleteTag = function deleteTag(_, del_index) {
|
|
18784
|
+
setDivIndex(-1);
|
|
18609
18785
|
var deletedValue = tags[del_index];
|
|
18610
18786
|
var remainingTags = tags.filter(function (_, index) {
|
|
18611
18787
|
return del_index !== index;
|
|
@@ -18619,16 +18795,13 @@ var InputTag = function InputTag(_a) {
|
|
|
18619
18795
|
setValue(tags.filter(Boolean).join(", "));
|
|
18620
18796
|
}, [tags]);
|
|
18621
18797
|
useEffect(function () {
|
|
18622
|
-
var _a;
|
|
18623
|
-
|
|
18624
18798
|
if (editIndex >= 0) {
|
|
18625
18799
|
editRef.current && editRef.current.focus();
|
|
18626
|
-
}
|
|
18800
|
+
} // setdropdownOffset(`${inputRef.current?.offsetLeft}px`);
|
|
18627
18801
|
|
|
18628
|
-
|
|
18629
|
-
}, [editIndex, dropdownArr]);
|
|
18802
|
+
}, [editIndex]);
|
|
18630
18803
|
return jsxRuntime.exports.jsxs("div", __assign({
|
|
18631
|
-
className: "inputTag hplxt-w-auto hplxt-
|
|
18804
|
+
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
18805
|
}, {
|
|
18633
18806
|
children: [tags.map(function (item, index) {
|
|
18634
18807
|
return index === editIndex ? jsxRuntime.exports.jsxs("div", {
|
|
@@ -18668,46 +18841,71 @@ var InputTag = function InputTag(_a) {
|
|
|
18668
18841
|
}, {
|
|
18669
18842
|
children: content
|
|
18670
18843
|
}))]
|
|
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
|
-
|
|
18844
|
+
}, "".concat(item, "+").concat(index)) : jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, {
|
|
18845
|
+
children: [jsxRuntime.exports.jsx("div", __assign({
|
|
18846
|
+
contentEditable: true,
|
|
18847
|
+
value: divRef.current[index],
|
|
18848
|
+
ref: function ref(el) {
|
|
18849
|
+
return divRef.current[index] = el;
|
|
18850
|
+
},
|
|
18851
|
+
style: {
|
|
18852
|
+
minWidth: '5px',
|
|
18853
|
+
maxWidth: 'auto',
|
|
18854
|
+
padding: '2px'
|
|
18855
|
+
},
|
|
18856
|
+
className: "focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0",
|
|
18857
|
+
onChange: function onChange(e) {
|
|
18858
|
+
handleValueChange(e);
|
|
18859
|
+
getInputValue(e.target.value);
|
|
18860
|
+
},
|
|
18861
|
+
onKeyDown: function onKeyDown(e) {
|
|
18862
|
+
return addTagsfromDiv(e, index);
|
|
18863
|
+
}
|
|
18864
|
+
}, inputProps, {
|
|
18865
|
+
onFocus: function onFocus(e) {
|
|
18866
|
+
return handleFocusDiv(e, index);
|
|
18867
|
+
}
|
|
18868
|
+
}), index), jsxRuntime.exports.jsxs("div", __assign({
|
|
18869
|
+
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",
|
|
18870
|
+
draggable: true,
|
|
18871
|
+
onDragStart: function onDragStart(e) {
|
|
18872
|
+
return handleDragStart(e, index);
|
|
18873
|
+
},
|
|
18874
|
+
onDragOver: handleDragOver,
|
|
18875
|
+
onDragEnter: function onDragEnter(e) {
|
|
18876
|
+
return handleDragEnter(e);
|
|
18877
|
+
},
|
|
18878
|
+
onDrop: function onDrop(e) {
|
|
18879
|
+
return handleDrop(e, index);
|
|
18690
18880
|
}
|
|
18691
18881
|
}, {
|
|
18692
|
-
children: jsxRuntime.exports.jsx(
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18882
|
+
children: [jsxRuntime.exports.jsx("button", __assign({
|
|
18883
|
+
onClick: function onClick() {
|
|
18884
|
+
setEditIndex(index);
|
|
18885
|
+
setEditInputValue(item);
|
|
18886
|
+
setContent(item);
|
|
18887
|
+
}
|
|
18696
18888
|
}, {
|
|
18697
|
-
children:
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18889
|
+
children: jsxRuntime.exports.jsx(Typography, __assign({
|
|
18890
|
+
variant: "Semibold",
|
|
18891
|
+
type: "Text sm",
|
|
18892
|
+
className: "hplxt-text-Gray-600"
|
|
18893
|
+
}, {
|
|
18894
|
+
children: item
|
|
18895
|
+
}))
|
|
18896
|
+
}), index), jsxRuntime.exports.jsx("i", {
|
|
18897
|
+
className: "hx_close hplxt-text-[75%] hplxt-text-Primary-700",
|
|
18898
|
+
onClick: function onClick() {
|
|
18899
|
+
return deleteTag(item, index);
|
|
18900
|
+
}
|
|
18901
|
+
})]
|
|
18902
|
+
}), "".concat(item, "+").concat(index))]
|
|
18903
|
+
});
|
|
18706
18904
|
}), jsxRuntime.exports.jsx("input", __assign({
|
|
18707
18905
|
type: "text",
|
|
18708
18906
|
value: tagInputValue,
|
|
18709
18907
|
ref: inputRef,
|
|
18710
|
-
className: "hplxt-flex-1 placeholder:hplxt-text-Gray-500 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0",
|
|
18908
|
+
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
18909
|
placeholder: "Enter Text",
|
|
18712
18910
|
onChange: function onChange(e) {
|
|
18713
18911
|
getInputValue(e.target.value);
|
|
@@ -18726,7 +18924,7 @@ var InputTag = function InputTag(_a) {
|
|
|
18726
18924
|
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
18925
|
style: {
|
|
18728
18926
|
left: changeLeft ? dropdownOffset : "",
|
|
18729
|
-
top: "".concat((((
|
|
18927
|
+
top: "".concat((((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.offsetTop) || 0) + 40, "px")
|
|
18730
18928
|
}
|
|
18731
18929
|
}, {
|
|
18732
18930
|
children: dropdownArr && dropdownArr.length > 0 && jsxRuntime.exports.jsx("div", {
|
|
@@ -18738,7 +18936,7 @@ var InputTag = function InputTag(_a) {
|
|
|
18738
18936
|
}, restOptions, {
|
|
18739
18937
|
onSelect: function onSelect() {
|
|
18740
18938
|
dropdownClickedRef.current = true;
|
|
18741
|
-
handleDropdownClick(restOptions, index);
|
|
18939
|
+
handleDropdownClick(restOptions, index, divIndex);
|
|
18742
18940
|
},
|
|
18743
18941
|
ddRef: ddRef,
|
|
18744
18942
|
setChangeLeft: setChangeLeft
|