hplx-react-elements-dev 1.0.46 → 1.0.47
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
|
@@ -2146,7 +2146,8 @@ var InputField = function InputField(_a) {
|
|
|
2146
2146
|
suffixClassName = _a.suffixClassName,
|
|
2147
2147
|
fieldColor = _a.fieldColor,
|
|
2148
2148
|
_h = _a.handleSuffixClick,
|
|
2149
|
-
handleSuffixClick = _h === void 0 ? function (_) {} : _h
|
|
2149
|
+
handleSuffixClick = _h === void 0 ? function (_) {} : _h,
|
|
2150
|
+
className = _a.className;
|
|
2150
2151
|
|
|
2151
2152
|
var _j = inputProps || {},
|
|
2152
2153
|
disabled = _j.disabled,
|
|
@@ -2246,7 +2247,7 @@ var InputField = function InputField(_a) {
|
|
|
2246
2247
|
}, {
|
|
2247
2248
|
children: jsxRuntime.exports.jsxs("div", __assign({
|
|
2248
2249
|
"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") : " ")))
|
|
2250
|
+
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
2251
|
}, {
|
|
2251
2252
|
children: [Boolean(prefix) && jsxRuntime.exports.jsx("div", __assign({
|
|
2252
2253
|
"data-testid": "input-prefix",
|
|
@@ -2270,7 +2271,7 @@ var InputField = function InputField(_a) {
|
|
|
2270
2271
|
background: "".concat(fieldColor === null || fieldColor === void 0 ? void 0 : fieldColor.split("-")[1], " "),
|
|
2271
2272
|
width: "".concat(width)
|
|
2272
2273
|
},
|
|
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"),
|
|
2274
|
+
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
2275
|
"data-testid": "text-input"
|
|
2275
2276
|
}, inputProps, {
|
|
2276
2277
|
onFocus: handleFocus,
|
|
@@ -4094,7 +4095,8 @@ var DropdownField = function DropdownField(_a) {
|
|
|
4094
4095
|
placeholder = _a.placeholder,
|
|
4095
4096
|
_f = _a.errorMsg,
|
|
4096
4097
|
errorMsg = _f === void 0 ? "" : _f,
|
|
4097
|
-
options = _a.options
|
|
4098
|
+
options = _a.options,
|
|
4099
|
+
className = _a.className;
|
|
4098
4100
|
|
|
4099
4101
|
var _g = useState(false),
|
|
4100
4102
|
openDropdown = _g[0],
|
|
@@ -4125,7 +4127,7 @@ var DropdownField = function DropdownField(_a) {
|
|
|
4125
4127
|
}, {
|
|
4126
4128
|
children: [jsxRuntime.exports.jsxs("div", __assign({
|
|
4127
4129
|
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")))
|
|
4130
|
+
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
4131
|
}, {
|
|
4130
4132
|
children: [!!value ? jsxRuntime.exports.jsx("div", __assign({
|
|
4131
4133
|
className: "hplxt-text-Gray-900"
|
|
@@ -4292,35 +4294,38 @@ var CollapsibleCard = function CollapsibleCard(props) {
|
|
|
4292
4294
|
var _a = props || {},
|
|
4293
4295
|
_b = _a.direction,
|
|
4294
4296
|
direction = _b === void 0 ? "down" : _b,
|
|
4295
|
-
_c = _a.label,
|
|
4296
|
-
label = _c === void 0 ? "" : _c,
|
|
4297
4297
|
header = _a.header,
|
|
4298
4298
|
children = _a.children,
|
|
4299
4299
|
footer = _a.footer,
|
|
4300
4300
|
title = _a.title,
|
|
4301
|
+
_c = _a.currentState,
|
|
4302
|
+
currentState = _c === void 0 ? function () {} : _c,
|
|
4301
4303
|
_d = _a.icon,
|
|
4302
4304
|
icon = _d === void 0 ? "Only" : _d,
|
|
4303
4305
|
_e = _a.openIcon,
|
|
4304
4306
|
openIcon = _e === void 0 ? "hx_add" : _e,
|
|
4305
|
-
_f = _a.
|
|
4306
|
-
|
|
4307
|
-
_g = _a.
|
|
4308
|
-
|
|
4309
|
-
_h = _a.
|
|
4310
|
-
|
|
4311
|
-
_j = _a.
|
|
4312
|
-
|
|
4307
|
+
_f = _a.label,
|
|
4308
|
+
label = _f === void 0 ? "" : _f,
|
|
4309
|
+
_g = _a.closeIcon,
|
|
4310
|
+
closeIcon = _g === void 0 ? "hx_remove" : _g,
|
|
4311
|
+
_h = _a.width,
|
|
4312
|
+
width = _h === void 0 ? "" : _h,
|
|
4313
|
+
_j = _a.height,
|
|
4314
|
+
height = _j === void 0 ? "" : _j,
|
|
4315
|
+
_k = _a.disabled,
|
|
4316
|
+
disabled = _k === void 0 ? false : _k,
|
|
4313
4317
|
handleCollapsibleDisplay = _a.handleCollapsibleDisplay,
|
|
4314
4318
|
headerRightChildren = _a.headerRightChildren;
|
|
4315
4319
|
|
|
4316
|
-
var
|
|
4317
|
-
active =
|
|
4318
|
-
setActive =
|
|
4320
|
+
var _l = useState(false),
|
|
4321
|
+
active = _l[0],
|
|
4322
|
+
setActive = _l[1];
|
|
4319
4323
|
|
|
4320
4324
|
var OnButtonClick = function OnButtonClick() {
|
|
4321
4325
|
setActive(function (prevValue) {
|
|
4322
4326
|
return !prevValue;
|
|
4323
4327
|
});
|
|
4328
|
+
currentState(active);
|
|
4324
4329
|
};
|
|
4325
4330
|
|
|
4326
4331
|
var getWidth = function getWidth(w) {
|
|
@@ -4393,14 +4398,14 @@ var CollapsibleCard = function CollapsibleCard(props) {
|
|
|
4393
4398
|
onAnimationEnd: function onAnimationEnd() {
|
|
4394
4399
|
console.log("onAnimationEnd called");
|
|
4395
4400
|
},
|
|
4396
|
-
className: "".concat(active ? "hplxt-max-h-[1000px] hplxt-overflow-visible" : "hplxt-max-h-0 hplxt-overflow-hidden", " ").concat(active ? "hplxt-p-
|
|
4401
|
+
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
4402
|
}, {
|
|
4398
4403
|
children: [header && jsxRuntime.exports.jsx("div", __assign({
|
|
4399
|
-
className: "hplxt-flex hplxt-flex-1 hplxt-
|
|
4404
|
+
className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-px-4 hplxt-pb-4"
|
|
4400
4405
|
}, {
|
|
4401
4406
|
children: header
|
|
4402
4407
|
})), children, footer && jsxRuntime.exports.jsx("div", __assign({
|
|
4403
|
-
className: "hplxt-flex hplxt-flex-1 hplxt-
|
|
4408
|
+
className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
|
|
4404
4409
|
}, {
|
|
4405
4410
|
children: footer
|
|
4406
4411
|
}))]
|
|
@@ -4430,11 +4435,11 @@ var CollapsibleCard = function CollapsibleCard(props) {
|
|
|
4430
4435
|
}
|
|
4431
4436
|
}), active && jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, {
|
|
4432
4437
|
children: [jsxRuntime.exports.jsx("div", __assign({
|
|
4433
|
-
className: "hplxt-flex hplxt-flex-1 hplxt-
|
|
4438
|
+
className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
|
|
4434
4439
|
}, {
|
|
4435
4440
|
children: header
|
|
4436
4441
|
})), children, jsxRuntime.exports.jsx("div", __assign({
|
|
4437
|
-
className: "hplxt-flex hplxt-flex-1 hplxt-
|
|
4442
|
+
className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
|
|
4438
4443
|
}, {
|
|
4439
4444
|
children: footer
|
|
4440
4445
|
}))]
|
|
@@ -16944,6 +16949,7 @@ var DatePicker = function DatePicker(_a) {
|
|
|
16944
16949
|
width = _a.width,
|
|
16945
16950
|
labelColor = _a.labelColor,
|
|
16946
16951
|
labelSize = _a.labelSize,
|
|
16952
|
+
placeholder = _a.placeholder,
|
|
16947
16953
|
_c = _a.height,
|
|
16948
16954
|
height = _c === void 0 ? "" : _c,
|
|
16949
16955
|
_d = _a.start_icon,
|
|
@@ -17015,10 +17021,10 @@ var DatePicker = function DatePicker(_a) {
|
|
|
17015
17021
|
className: ""
|
|
17016
17022
|
}, {
|
|
17017
17023
|
children: [jsxRuntime.exports.jsx("div", __assign({
|
|
17018
|
-
className: "hplxt-relative
|
|
17024
|
+
className: "hplxt-relative "
|
|
17019
17025
|
}, {
|
|
17020
17026
|
children: jsxRuntime.exports.jsx(InputField, {
|
|
17021
|
-
width: width,
|
|
17027
|
+
width: width ? width : "8em",
|
|
17022
17028
|
label: label,
|
|
17023
17029
|
labelColor: labelColor,
|
|
17024
17030
|
labelSize: labelSize,
|
|
@@ -17038,7 +17044,7 @@ var DatePicker = function DatePicker(_a) {
|
|
|
17038
17044
|
isborderRequired: isborderRequired,
|
|
17039
17045
|
start_icon: start_icon,
|
|
17040
17046
|
inputProps: {
|
|
17041
|
-
placeholder: "
|
|
17047
|
+
placeholder: placeholder ? placeholder : "select date",
|
|
17042
17048
|
onClick: inputClick,
|
|
17043
17049
|
onFocus: inputFocus,
|
|
17044
17050
|
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;
|