hplx-react-elements-dev 1.0.46 → 1.0.48
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.
|
@@ -3,5 +3,5 @@ import "react-date-range/dist/styles.css";
|
|
|
3
3
|
import "react-date-range/dist/theme/default.css";
|
|
4
4
|
import "../datePicker/DatePickerCSS.css";
|
|
5
5
|
import { DatePickerProps } from "../types";
|
|
6
|
-
declare const DatePicker: ({ disabledDates, selectDate, dateVar, minDate, maxDate, label, width, labelColor, labelSize, height, start_icon, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, suffixInputProps, suffixDropdown, isSuffixEditable, suffixPlaceholder, fieldColor, isborderRequired, }: DatePickerProps) => JSX.Element;
|
|
6
|
+
declare const DatePicker: ({ disabledDates, selectDate, dateVar, minDate, maxDate, label, width, labelColor, labelSize, placeholder, height, start_icon, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, suffixInputProps, suffixDropdown, isSuffixEditable, suffixPlaceholder, fieldColor, isborderRequired, }: DatePickerProps) => JSX.Element;
|
|
7
7
|
export default DatePicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DropdownFieldProps } from "../types";
|
|
3
|
-
declare const DropdownField: ({ label, end_icon, hint_text_icon, empty_text, hint_text, value, onChange, disabled, placeholder, errorMsg, options, }: DropdownFieldProps) => JSX.Element;
|
|
3
|
+
declare const DropdownField: ({ label, end_icon, hint_text_icon, empty_text, hint_text, value, onChange, disabled, placeholder, errorMsg, options, className }: DropdownFieldProps) => JSX.Element;
|
|
4
4
|
export default DropdownField;
|
package/dist/esm/index.js
CHANGED
|
@@ -2079,9 +2079,14 @@ var DropdownItems = function DropdownItems(_a) {
|
|
|
2079
2079
|
return false;
|
|
2080
2080
|
};
|
|
2081
2081
|
|
|
2082
|
+
var handleOnSelect = function handleOnSelect(e) {
|
|
2083
|
+
e.stopPropagation();
|
|
2084
|
+
onSelect && onSelect(value);
|
|
2085
|
+
};
|
|
2086
|
+
|
|
2082
2087
|
return jsxRuntime.exports.jsxs("div", __assign({
|
|
2083
|
-
|
|
2084
|
-
!disabled &&
|
|
2088
|
+
onMouseDown: function onMouseDown(e) {
|
|
2089
|
+
!disabled && handleOnSelect(e);
|
|
2085
2090
|
},
|
|
2086
2091
|
className: "hplxt-h-10 hplxt-flex hplxt-items-center hplxt-px-2 ".concat(disabled ? "hplxt-cursor-not-allowed" : "hover:hplxt-bg-Blue_gray-100 hplxt-cursor-pointer"),
|
|
2087
2092
|
onMouseEnter: onMouseEnterHandler,
|
|
@@ -2146,7 +2151,8 @@ var InputField = function InputField(_a) {
|
|
|
2146
2151
|
suffixClassName = _a.suffixClassName,
|
|
2147
2152
|
fieldColor = _a.fieldColor,
|
|
2148
2153
|
_h = _a.handleSuffixClick,
|
|
2149
|
-
handleSuffixClick = _h === void 0 ? function (_) {} : _h
|
|
2154
|
+
handleSuffixClick = _h === void 0 ? function (_) {} : _h,
|
|
2155
|
+
className = _a.className;
|
|
2150
2156
|
|
|
2151
2157
|
var _j = inputProps || {},
|
|
2152
2158
|
disabled = _j.disabled,
|
|
@@ -2246,7 +2252,7 @@ var InputField = function InputField(_a) {
|
|
|
2246
2252
|
}, {
|
|
2247
2253
|
children: jsxRuntime.exports.jsxs("div", __assign({
|
|
2248
2254
|
"data-setid": "error-msg",
|
|
2249
|
-
className: "hplxt-flex ".concat(isborderRequired ? "hplxt-shadow-xs ".concat(border ? border : "hplxt-border-1", " hplxt-rounded-lg") : "", " hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 ").concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " ").concat(height ? height : "hplxt-h-10", " ").concat(disabled ? "hplxt-bg-Gray-50" : "".concat(fieldColor ? fieldColor : "hplxt-bg-White", " ").concat(errorMsg ? "hover:hplxt-shadow-xs-error ".concat(active && "hplxt-shadow-xs-error") : " ".concat(isborderRequired ? "hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active && "hplxt-border-Primary-300 hplxt-shadow-xs-primary") : " ")))
|
|
2255
|
+
className: "hplxt-flex ".concat(isborderRequired ? "hplxt-shadow-xs ".concat(border ? border : "hplxt-border-1", " hplxt-rounded-lg") : "", " hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 ").concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " ").concat(height ? height : "hplxt-h-10", " ").concat(disabled ? "hplxt-bg-Gray-50" : "".concat(fieldColor ? fieldColor : "hplxt-bg-White", " ").concat(errorMsg ? "hover:hplxt-shadow-xs-error ".concat(active && "hplxt-shadow-xs-error") : " ".concat(isborderRequired ? "hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active && "hplxt-border-Primary-300 hplxt-shadow-xs-primary") : " ")), " ").concat(className)
|
|
2250
2256
|
}, {
|
|
2251
2257
|
children: [Boolean(prefix) && jsxRuntime.exports.jsx("div", __assign({
|
|
2252
2258
|
"data-testid": "input-prefix",
|
|
@@ -2270,7 +2276,7 @@ var InputField = function InputField(_a) {
|
|
|
2270
2276
|
background: "".concat(fieldColor === null || fieldColor === void 0 ? void 0 : fieldColor.split("-")[1], " "),
|
|
2271
2277
|
width: "".concat(width)
|
|
2272
2278
|
},
|
|
2273
|
-
className: "hplxt-flex-1 hplxt-pl-[14px] ".concat(fieldColor, " placeholder:hplxt-text-Indigo-500 hplxt-opacity-50 hplxt-pr-[12px] hplxt-py-1 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0"),
|
|
2279
|
+
className: "hplxt-flex-1 hplxt-pl-[14px] ".concat(fieldColor, " placeholder:hplxt-text-Indigo-500 placeholder:hplxt-opacity-50 hplxt-pr-[12px] hplxt-py-1 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0"),
|
|
2274
2280
|
"data-testid": "text-input"
|
|
2275
2281
|
}, inputProps, {
|
|
2276
2282
|
onFocus: handleFocus,
|
|
@@ -4094,7 +4100,8 @@ var DropdownField = function DropdownField(_a) {
|
|
|
4094
4100
|
placeholder = _a.placeholder,
|
|
4095
4101
|
_f = _a.errorMsg,
|
|
4096
4102
|
errorMsg = _f === void 0 ? "" : _f,
|
|
4097
|
-
options = _a.options
|
|
4103
|
+
options = _a.options,
|
|
4104
|
+
className = _a.className;
|
|
4098
4105
|
|
|
4099
4106
|
var _g = useState(false),
|
|
4100
4107
|
openDropdown = _g[0],
|
|
@@ -4125,7 +4132,7 @@ var DropdownField = function DropdownField(_a) {
|
|
|
4125
4132
|
}, {
|
|
4126
4133
|
children: [jsxRuntime.exports.jsxs("div", __assign({
|
|
4127
4134
|
onClick: handleFieldClick,
|
|
4128
|
-
className: "hplxt-flex-1 hplxt-flex hplxt-items-center hplxt-pl-2 placeholder:hplxt-text-Gray-500 hplxt-justify-between hplxt-border-1 ".concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " hplxt-shadow-xs hplxt-rounded-lg hplxt-h-10 ").concat(disabled ? "hplxt-bg-Gray-50 hplxt-cursor-not-allowed" : "hplxt-bg-White hplxt-cursor-pointer ".concat(errorMsg ? "hover:hplxt-shadow-xs-error" : "".concat(openDropdown ? "hplxt-border-Primary-300 hplxt-shadow-xs-primary" : "", " hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary")))
|
|
4135
|
+
className: "hplxt-flex-1 hplxt-flex hplxt-items-center hplxt-pl-2 placeholder:hplxt-text-Gray-500 hplxt-justify-between hplxt-border-1 ".concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " hplxt-shadow-xs hplxt-rounded-lg hplxt-h-10 ").concat(disabled ? "hplxt-bg-Gray-50 hplxt-cursor-not-allowed" : "hplxt-bg-White hplxt-cursor-pointer ".concat(errorMsg ? "hover:hplxt-shadow-xs-error" : "".concat(openDropdown ? "hplxt-border-Primary-300 hplxt-shadow-xs-primary" : "", " hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary")), " ").concat(className)
|
|
4129
4136
|
}, {
|
|
4130
4137
|
children: [!!value ? jsxRuntime.exports.jsx("div", __assign({
|
|
4131
4138
|
className: "hplxt-text-Gray-900"
|
|
@@ -4292,35 +4299,38 @@ var CollapsibleCard = function CollapsibleCard(props) {
|
|
|
4292
4299
|
var _a = props || {},
|
|
4293
4300
|
_b = _a.direction,
|
|
4294
4301
|
direction = _b === void 0 ? "down" : _b,
|
|
4295
|
-
_c = _a.label,
|
|
4296
|
-
label = _c === void 0 ? "" : _c,
|
|
4297
4302
|
header = _a.header,
|
|
4298
4303
|
children = _a.children,
|
|
4299
4304
|
footer = _a.footer,
|
|
4300
4305
|
title = _a.title,
|
|
4306
|
+
_c = _a.currentState,
|
|
4307
|
+
currentState = _c === void 0 ? function () {} : _c,
|
|
4301
4308
|
_d = _a.icon,
|
|
4302
4309
|
icon = _d === void 0 ? "Only" : _d,
|
|
4303
4310
|
_e = _a.openIcon,
|
|
4304
4311
|
openIcon = _e === void 0 ? "hx_add" : _e,
|
|
4305
|
-
_f = _a.
|
|
4306
|
-
|
|
4307
|
-
_g = _a.
|
|
4308
|
-
|
|
4309
|
-
_h = _a.
|
|
4310
|
-
|
|
4311
|
-
_j = _a.
|
|
4312
|
-
|
|
4312
|
+
_f = _a.label,
|
|
4313
|
+
label = _f === void 0 ? "" : _f,
|
|
4314
|
+
_g = _a.closeIcon,
|
|
4315
|
+
closeIcon = _g === void 0 ? "hx_remove" : _g,
|
|
4316
|
+
_h = _a.width,
|
|
4317
|
+
width = _h === void 0 ? "" : _h,
|
|
4318
|
+
_j = _a.height,
|
|
4319
|
+
height = _j === void 0 ? "" : _j,
|
|
4320
|
+
_k = _a.disabled,
|
|
4321
|
+
disabled = _k === void 0 ? false : _k,
|
|
4313
4322
|
handleCollapsibleDisplay = _a.handleCollapsibleDisplay,
|
|
4314
4323
|
headerRightChildren = _a.headerRightChildren;
|
|
4315
4324
|
|
|
4316
|
-
var
|
|
4317
|
-
active =
|
|
4318
|
-
setActive =
|
|
4325
|
+
var _l = useState(false),
|
|
4326
|
+
active = _l[0],
|
|
4327
|
+
setActive = _l[1];
|
|
4319
4328
|
|
|
4320
4329
|
var OnButtonClick = function OnButtonClick() {
|
|
4321
4330
|
setActive(function (prevValue) {
|
|
4322
4331
|
return !prevValue;
|
|
4323
4332
|
});
|
|
4333
|
+
currentState(active);
|
|
4324
4334
|
};
|
|
4325
4335
|
|
|
4326
4336
|
var getWidth = function getWidth(w) {
|
|
@@ -4393,14 +4403,14 @@ var CollapsibleCard = function CollapsibleCard(props) {
|
|
|
4393
4403
|
onAnimationEnd: function onAnimationEnd() {
|
|
4394
4404
|
console.log("onAnimationEnd called");
|
|
4395
4405
|
},
|
|
4396
|
-
className: "".concat(active ? "hplxt-max-h-[1000px] hplxt-overflow-visible" : "hplxt-max-h-0 hplxt-overflow-hidden", " ").concat(active ? "hplxt-p-
|
|
4406
|
+
className: "".concat(active ? "hplxt-max-h-[1000px] hplxt-overflow-visible" : "hplxt-max-h-0 hplxt-overflow-hidden", " ").concat(active ? "hplxt-p-4" : "hplxt-p-0", " hplxt-transition-all hplxt-duration-500 hplxt-ease-in-out ").concat(getWidth(width), " ").concat(getHeight(height), " hplxt-text-ellipsis\n ")
|
|
4397
4407
|
}, {
|
|
4398
4408
|
children: [header && jsxRuntime.exports.jsx("div", __assign({
|
|
4399
|
-
className: "hplxt-flex hplxt-flex-1 hplxt-
|
|
4409
|
+
className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-px-4 hplxt-pb-4"
|
|
4400
4410
|
}, {
|
|
4401
4411
|
children: header
|
|
4402
4412
|
})), children, footer && jsxRuntime.exports.jsx("div", __assign({
|
|
4403
|
-
className: "hplxt-flex hplxt-flex-1 hplxt-
|
|
4413
|
+
className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
|
|
4404
4414
|
}, {
|
|
4405
4415
|
children: footer
|
|
4406
4416
|
}))]
|
|
@@ -4430,11 +4440,11 @@ var CollapsibleCard = function CollapsibleCard(props) {
|
|
|
4430
4440
|
}
|
|
4431
4441
|
}), active && jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, {
|
|
4432
4442
|
children: [jsxRuntime.exports.jsx("div", __assign({
|
|
4433
|
-
className: "hplxt-flex hplxt-flex-1 hplxt-
|
|
4443
|
+
className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
|
|
4434
4444
|
}, {
|
|
4435
4445
|
children: header
|
|
4436
4446
|
})), children, jsxRuntime.exports.jsx("div", __assign({
|
|
4437
|
-
className: "hplxt-flex hplxt-flex-1 hplxt-
|
|
4447
|
+
className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
|
|
4438
4448
|
}, {
|
|
4439
4449
|
children: footer
|
|
4440
4450
|
}))]
|
|
@@ -16944,6 +16954,7 @@ var DatePicker = function DatePicker(_a) {
|
|
|
16944
16954
|
width = _a.width,
|
|
16945
16955
|
labelColor = _a.labelColor,
|
|
16946
16956
|
labelSize = _a.labelSize,
|
|
16957
|
+
placeholder = _a.placeholder,
|
|
16947
16958
|
_c = _a.height,
|
|
16948
16959
|
height = _c === void 0 ? "" : _c,
|
|
16949
16960
|
_d = _a.start_icon,
|
|
@@ -17015,10 +17026,10 @@ var DatePicker = function DatePicker(_a) {
|
|
|
17015
17026
|
className: ""
|
|
17016
17027
|
}, {
|
|
17017
17028
|
children: [jsxRuntime.exports.jsx("div", __assign({
|
|
17018
|
-
className: "hplxt-relative
|
|
17029
|
+
className: "hplxt-relative "
|
|
17019
17030
|
}, {
|
|
17020
17031
|
children: jsxRuntime.exports.jsx(InputField, {
|
|
17021
|
-
width: width,
|
|
17032
|
+
width: width ? width : "8em",
|
|
17022
17033
|
label: label,
|
|
17023
17034
|
labelColor: labelColor,
|
|
17024
17035
|
labelSize: labelSize,
|
|
@@ -17038,7 +17049,7 @@ var DatePicker = function DatePicker(_a) {
|
|
|
17038
17049
|
isborderRequired: isborderRequired,
|
|
17039
17050
|
start_icon: start_icon,
|
|
17040
17051
|
inputProps: {
|
|
17041
|
-
placeholder: "
|
|
17052
|
+
placeholder: placeholder ? placeholder : "select date",
|
|
17042
17053
|
onClick: inputClick,
|
|
17043
17054
|
onFocus: inputFocus,
|
|
17044
17055
|
value: date ? dayjs(date).format("MMM DD, YYYY") : selectDate === null || selectDate === void 0 ? void 0 : selectDate.toString()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputFieldProps } from "../types";
|
|
3
|
-
declare const InputField: ({ label, labelColor, labelSize, height, start_icon, width, border, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, inputProps, suffixInputProps, isborderRequired, suffixDropdown, isSuffixEditable, suffixPlaceholder, suffixClassName, fieldColor, handleSuffixClick, }: InputFieldProps) => JSX.Element;
|
|
3
|
+
declare const InputField: ({ label, labelColor, labelSize, height, start_icon, width, border, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, inputProps, suffixInputProps, isborderRequired, suffixDropdown, isSuffixEditable, suffixPlaceholder, suffixClassName, fieldColor, handleSuffixClick, className }: InputFieldProps) => JSX.Element;
|
|
4
4
|
export default InputField;
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -25,8 +25,10 @@ export interface InputFieldProps {
|
|
|
25
25
|
handleSuffixClick?: (value: any) => void;
|
|
26
26
|
isSuffixEditable?: boolean;
|
|
27
27
|
handleSuffixValChange?: (value: any) => void;
|
|
28
|
+
className?: string;
|
|
28
29
|
}
|
|
29
30
|
export interface DatePickerProps {
|
|
31
|
+
placeholder?: string;
|
|
30
32
|
disabledDates?: Date[];
|
|
31
33
|
selectDate?: any;
|
|
32
34
|
dateVar: (val: Date) => void;
|
|
@@ -232,6 +234,7 @@ export interface DropdownFieldProps {
|
|
|
232
234
|
placeholder?: string;
|
|
233
235
|
empty_text?: string;
|
|
234
236
|
options?: Array<DropdownItemsProps>;
|
|
237
|
+
className?: string;
|
|
235
238
|
}
|
|
236
239
|
export interface CardType {
|
|
237
240
|
title: string;
|
|
@@ -239,6 +242,7 @@ export interface CardType {
|
|
|
239
242
|
type CollapseDirection = "up" | "down" | "left" | "right";
|
|
240
243
|
export interface CollapsibleCardProps {
|
|
241
244
|
title?: ReactNode;
|
|
245
|
+
currentState?: (val: boolean) => void;
|
|
242
246
|
direction?: CollapseDirection;
|
|
243
247
|
label?: string;
|
|
244
248
|
children?: ReactNode;
|
|
@@ -248,7 +252,7 @@ export interface CollapsibleCardProps {
|
|
|
248
252
|
closeIcon?: string;
|
|
249
253
|
width?: string;
|
|
250
254
|
height?: string;
|
|
251
|
-
icon
|
|
255
|
+
icon: iconType;
|
|
252
256
|
disabled?: boolean;
|
|
253
257
|
handleCollapsibleDisplay?: Function;
|
|
254
258
|
headerRightChildren?: ReactNode;
|