hplx-react-elements-dev 1.0.41 → 1.0.42
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 { AddSuggestionProps } from "../types";
|
|
3
|
-
declare const AddSuggestion: ({ isInputField, label, labelColor, labelSize, start_icon, end_icon, prefix, suffixButton, suffix, suffixDropdown, isSuffixEditable, suffixInputProps, suffixPlaceholder, handleSuggestionValChange, handleSuffixValChange, handleSuffixClick, char_count, onSuggestionClick,
|
|
3
|
+
declare const AddSuggestion: ({ isInputField, label, labelColor, labelSize, start_icon, end_icon, prefix, suffixButton, suffix, suffixDropdown, isSuffixEditable, suffixInputProps, suffixPlaceholder, handleSuggestionValChange, handleSuffixValChange, handleSuffixClick, char_count, onSuggestionClick, className, rows, hint_text_icon, hint_text, errorMsg, inputProps, inputFieldInputProps, options, suggestionValue, isborderRequired, isDynamicHeight, fieldColor, }: AddSuggestionProps) => JSX.Element;
|
|
4
4
|
export default AddSuggestion;
|
package/dist/esm/index.js
CHANGED
|
@@ -2545,26 +2545,42 @@ var TextAreaField = function TextAreaField(_a) {
|
|
|
2545
2545
|
_c = _a.errorMsg,
|
|
2546
2546
|
errorMsg = _c === void 0 ? "" : _c,
|
|
2547
2547
|
inputProps = _a.inputProps,
|
|
2548
|
-
|
|
2549
|
-
|
|
2548
|
+
className = _a.className,
|
|
2549
|
+
_d = _a.rows,
|
|
2550
|
+
rows = _d === void 0 ? 2 : _d,
|
|
2551
|
+
_e = _a.isDynamicHeight,
|
|
2552
|
+
isDynamicHeight = _e === void 0 ? false : _e;
|
|
2553
|
+
|
|
2554
|
+
var _f = inputProps || {},
|
|
2555
|
+
disabled = _f.disabled,
|
|
2556
|
+
onFocus = _f.onFocus,
|
|
2557
|
+
onBlur = _f.onBlur;
|
|
2550
2558
|
|
|
2551
|
-
var
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
onBlur = _e.onBlur;
|
|
2559
|
+
var _g = useState(false),
|
|
2560
|
+
active = _g[0],
|
|
2561
|
+
setActive = _g[1];
|
|
2555
2562
|
|
|
2556
|
-
var
|
|
2557
|
-
|
|
2558
|
-
|
|
2563
|
+
var _h = useState(rows),
|
|
2564
|
+
row = _h[0],
|
|
2565
|
+
setRow = _h[1];
|
|
2566
|
+
|
|
2567
|
+
var ref = useRef(null);
|
|
2568
|
+
|
|
2569
|
+
var handleHeight = function handleHeight() {
|
|
2570
|
+
var element = ref.current;
|
|
2571
|
+
isDynamicHeight && setRow(element.scrollHeight / 32);
|
|
2572
|
+
};
|
|
2559
2573
|
|
|
2560
2574
|
var handleFocus = function handleFocus(event) {
|
|
2561
2575
|
setActive(true);
|
|
2562
2576
|
onFocus && onFocus(event);
|
|
2577
|
+
isDynamicHeight && handleHeight();
|
|
2563
2578
|
};
|
|
2564
2579
|
|
|
2565
2580
|
var handleBlur = function handleBlur(event) {
|
|
2566
2581
|
setActive(false);
|
|
2567
2582
|
onBlur && onBlur(event);
|
|
2583
|
+
isDynamicHeight && setRow(rows);
|
|
2568
2584
|
};
|
|
2569
2585
|
|
|
2570
2586
|
return jsxRuntime.exports.jsxs("div", __assign({
|
|
@@ -2584,11 +2600,16 @@ var TextAreaField = function TextAreaField(_a) {
|
|
|
2584
2600
|
type: "Text md"
|
|
2585
2601
|
}, {
|
|
2586
2602
|
children: jsxRuntime.exports.jsx("div", __assign({
|
|
2587
|
-
className: "hplxt-flex hplxt-border-1 hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 ".concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " hplxt-shadow-xs hplxt-rounded-lg ").concat(
|
|
2603
|
+
className: "hplxt-flex hplxt-border-1 hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 ".concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " hplxt-shadow-xs hplxt-rounded-lg ").concat(className, " ").concat(disabled ? "hplxt-bg-Gray-50" : "hplxt-bg-White ".concat(errorMsg ? "hover:hplxt-shadow-xs-error ".concat(active && "hplxt-shadow-xs-error") : "hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active && "hplxt-border-Primary-300 hplxt-shadow-xs-primary")))
|
|
2588
2604
|
}, {
|
|
2589
2605
|
children: jsxRuntime.exports.jsx("textarea", __assign({
|
|
2590
|
-
|
|
2606
|
+
ref: ref,
|
|
2607
|
+
className: "hplxt-flex-1 hplxt-px-2 hplxt-py-2 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0",
|
|
2608
|
+
style: {
|
|
2609
|
+
height: row * 32 + 'px'
|
|
2610
|
+
}
|
|
2591
2611
|
}, inputProps, {
|
|
2612
|
+
onInput: handleHeight,
|
|
2592
2613
|
onFocus: handleFocus,
|
|
2593
2614
|
onBlur: handleBlur
|
|
2594
2615
|
}))
|
|
@@ -3320,22 +3341,22 @@ var getSizeClassName$5 = function getSizeClassName(size) {
|
|
|
3320
3341
|
var getPaddingClassName$3 = function getPaddingClassName(size, icon, iconFile) {
|
|
3321
3342
|
switch (size) {
|
|
3322
3343
|
case "sm":
|
|
3323
|
-
return icon && iconFile && icon === "Only" ? "hplxt-h-8 hplxt-w-[34px] hplxt-px-[5.8px]" : "hplxt-h-8 hplxt-px-
|
|
3344
|
+
return icon && iconFile && icon === "Only" ? "hplxt-h-8 hplxt-w-[34px] hplxt-px-[5.8px]" : "hplxt-h-8 hplxt-px-4";
|
|
3324
3345
|
|
|
3325
3346
|
case "md":
|
|
3326
|
-
return icon && iconFile && icon === "Only" ? "hplxt-h-9 hplxt-w-[42px] hplxt-px-[9.8px]" : "hplxt-h-9 hplxt-px-
|
|
3347
|
+
return icon && iconFile && icon === "Only" ? "hplxt-h-9 hplxt-w-[42px] hplxt-px-[9.8px]" : "hplxt-h-9 hplxt-px-4";
|
|
3327
3348
|
|
|
3328
3349
|
case "lg":
|
|
3329
|
-
return icon && iconFile && icon === "Only" ? "hplxt-h-10 hplxt-w-[42px] hplxt-px-[9.8px]" : "hplxt-h-10 hplxt-px-
|
|
3350
|
+
return icon && iconFile && icon === "Only" ? "hplxt-h-10 hplxt-w-[42px] hplxt-px-[9.8px]" : "hplxt-h-10 hplxt-px-4";
|
|
3330
3351
|
|
|
3331
3352
|
case "xl":
|
|
3332
|
-
return icon && iconFile && icon === "Only" ? "hplxt-h-11 hplxt-w-[46px] hplxt-px-[11.8px]" : "hplxt-h-11 hplxt-px-
|
|
3353
|
+
return icon && iconFile && icon === "Only" ? "hplxt-h-11 hplxt-w-[46px] hplxt-px-[11.8px]" : "hplxt-h-11 hplxt-px-4";
|
|
3333
3354
|
|
|
3334
3355
|
case "2xl":
|
|
3335
|
-
return icon && iconFile && icon === "Only" ? "hplxt-h-12 hplxt-w-[50px] hplxt-px-[13.8px]" : "hplxt-h-12 hplxt-px-
|
|
3356
|
+
return icon && iconFile && icon === "Only" ? "hplxt-h-12 hplxt-w-[50px] hplxt-px-[13.8px]" : "hplxt-h-12 hplxt-px-4";
|
|
3336
3357
|
|
|
3337
3358
|
default:
|
|
3338
|
-
return icon && iconFile && icon === "Only" ? "hplxt-h-8 hplxt-w-[34px] hplxt-px-[5.8px]" : "hplxt-h-8 hplxt-px-
|
|
3359
|
+
return icon && iconFile && icon === "Only" ? "hplxt-h-8 hplxt-w-[34px] hplxt-px-[5.8px]" : "hplxt-h-8 hplxt-px-4";
|
|
3339
3360
|
}
|
|
3340
3361
|
};
|
|
3341
3362
|
|
|
@@ -4273,7 +4294,7 @@ var CollapsibleCard = function CollapsibleCard(props) {
|
|
|
4273
4294
|
footer = _a.footer,
|
|
4274
4295
|
title = _a.title,
|
|
4275
4296
|
_d = _a.icon,
|
|
4276
|
-
icon = _d === void 0 ? "
|
|
4297
|
+
icon = _d === void 0 ? "Only" : _d,
|
|
4277
4298
|
_e = _a.openIcon,
|
|
4278
4299
|
openIcon = _e === void 0 ? "hx_add" : _e,
|
|
4279
4300
|
_f = _a.closeIcon,
|
|
@@ -5219,8 +5240,9 @@ var AddSuggestion = function AddSuggestion(_a) {
|
|
|
5219
5240
|
char_count = _a.char_count,
|
|
5220
5241
|
_l = _a.onSuggestionClick,
|
|
5221
5242
|
onSuggestionClick = _l === void 0 ? function (_selectedValue) {} : _l,
|
|
5222
|
-
|
|
5223
|
-
|
|
5243
|
+
className = _a.className,
|
|
5244
|
+
_m = _a.rows,
|
|
5245
|
+
rows = _m === void 0 ? 2 : _m,
|
|
5224
5246
|
_o = _a.hint_text_icon,
|
|
5225
5247
|
hint_text_icon = _o === void 0 ? "" : _o,
|
|
5226
5248
|
hint_text = _a.hint_text,
|
|
@@ -5229,21 +5251,23 @@ var AddSuggestion = function AddSuggestion(_a) {
|
|
|
5229
5251
|
inputProps = _a.inputProps,
|
|
5230
5252
|
inputFieldInputProps = _a.inputFieldInputProps,
|
|
5231
5253
|
options = _a.options,
|
|
5232
|
-
fieldColor = _a.fieldColor,
|
|
5233
5254
|
_q = _a.suggestionValue,
|
|
5234
5255
|
suggestionValue = _q === void 0 ? "" : _q,
|
|
5235
5256
|
_r = _a.isborderRequired,
|
|
5236
|
-
isborderRequired = _r === void 0 ? true : _r
|
|
5257
|
+
isborderRequired = _r === void 0 ? true : _r,
|
|
5258
|
+
_s = _a.isDynamicHeight,
|
|
5259
|
+
isDynamicHeight = _s === void 0 ? false : _s,
|
|
5260
|
+
fieldColor = _a.fieldColor;
|
|
5237
5261
|
|
|
5238
|
-
var
|
|
5239
|
-
showDropdown =
|
|
5240
|
-
setShowDropdown =
|
|
5262
|
+
var _t = useState(false),
|
|
5263
|
+
showDropdown = _t[0],
|
|
5264
|
+
setShowDropdown = _t[1];
|
|
5241
5265
|
|
|
5242
5266
|
var wrapperRef = useRef(null);
|
|
5243
5267
|
|
|
5244
|
-
var
|
|
5245
|
-
suggestionArr =
|
|
5246
|
-
setSuggestionArr =
|
|
5268
|
+
var _u = useState(),
|
|
5269
|
+
suggestionArr = _u[0],
|
|
5270
|
+
setSuggestionArr = _u[1];
|
|
5247
5271
|
|
|
5248
5272
|
var changeHandler = function changeHandler(e) {
|
|
5249
5273
|
setShowDropdown(true);
|
|
@@ -5334,7 +5358,9 @@ var AddSuggestion = function AddSuggestion(_a) {
|
|
|
5334
5358
|
hint_text: hint_text,
|
|
5335
5359
|
hint_text_icon: hint_text_icon,
|
|
5336
5360
|
errorMsg: errorMsg,
|
|
5337
|
-
|
|
5361
|
+
className: className,
|
|
5362
|
+
rows: rows,
|
|
5363
|
+
isDynamicHeight: isDynamicHeight,
|
|
5338
5364
|
inputProps: __assign(__assign({}, inputProps), {
|
|
5339
5365
|
onChange: changeHandler,
|
|
5340
5366
|
value: suggestionValue,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextAreaFieldProps } from "../types";
|
|
3
|
-
declare const TextAreaField: ({ label, hint_text_icon, hint_text, errorMsg, inputProps,
|
|
3
|
+
declare const TextAreaField: ({ label, hint_text_icon, hint_text, errorMsg, inputProps, className, rows, isDynamicHeight, }: TextAreaFieldProps) => JSX.Element;
|
|
4
4
|
export default TextAreaField;
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -62,7 +62,9 @@ export interface TextAreaFieldProps {
|
|
|
62
62
|
hint_text_icon?: string;
|
|
63
63
|
errorMsg?: string;
|
|
64
64
|
inputProps: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
|
|
65
|
-
|
|
65
|
+
className?: string;
|
|
66
|
+
rows?: number;
|
|
67
|
+
isDynamicHeight?: boolean;
|
|
66
68
|
}
|
|
67
69
|
type badgesizeType = "sm" | "md" | "lg";
|
|
68
70
|
type badgeiconType = "Left" | "Right" | "Only";
|
|
@@ -301,7 +303,9 @@ export interface NestedDropdownItemsProps {
|
|
|
301
303
|
export interface AddSuggestionProps {
|
|
302
304
|
label?: string;
|
|
303
305
|
isInputField?: boolean;
|
|
304
|
-
|
|
306
|
+
className?: string;
|
|
307
|
+
rows?: number;
|
|
308
|
+
isDynamicHeight?: boolean;
|
|
305
309
|
labelSize?: typographyTextType;
|
|
306
310
|
labelColor?: string;
|
|
307
311
|
prefix?: ReactNode;
|