hplx-feature-library 1.0.71 → 1.0.73
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/AlertPopup/index.js +5 -0
- package/dist/AlertPopup-D5OvNU2M.cjs +32 -0
- package/dist/AlertPopup-tF3Y6sIE.js +1069 -0
- package/dist/AllInvestigations/index.js +1 -1
- package/dist/{AllInvestigationsTable-DA2nD9k6.js → AllInvestigationsTable-CDQsqfbF.js} +1 -1
- package/dist/Attachments/index.js +1 -1
- package/dist/CustomDropdown/index.js +265 -0
- package/dist/DateTimePicker/DateAndTimePicker/index.js +6161 -0
- package/dist/PediatricsCalculator/index.js +1 -1
- package/dist/PediatricsCalculatorTable-B6OkRbld.js +832 -0
- package/dist/PediatricsCalculatorTable-DoXAWcvL.cjs +1 -0
- package/dist/ToggleButtons/index.js +17 -0
- package/dist/components/alertPopup/index.d.ts +1 -0
- package/dist/components/{CustomDropdown.d.ts → customDropdown/CustomDropdown.d.ts} +1 -1
- package/dist/components/customDropdown/index.d.ts +1 -0
- package/dist/components/dateTimePicker/index.d.ts +1 -0
- package/dist/components/{ToggleButtons.d.ts → toggleButtons/ToggleButtons.d.ts} +1 -1
- package/dist/components/toggleButtons/index.d.ts +1 -0
- package/dist/hplx-feature-library.css +1 -1
- package/dist/{index-BocogwgJ.js → index-6-2iV0ns.js} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12 -6166
- package/dist/useClickOutside-BjJyGTec.js +14 -0
- package/dist/useClickOutside-DsVG12Cs.cjs +1 -0
- package/package.json +18 -1
- package/dist/PediatricsCalculatorTable-C3bes_CH.js +0 -2177
- package/dist/PediatricsCalculatorTable-bhid_0mB.cjs +0 -40
- /package/dist/components/{AlertPopup.d.ts → alertPopup/AlertPopup.d.ts} +0 -0
- /package/dist/components/{datepicker → dateTimePicker}/DateAndTimePicker.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as o, u as v } from "./index-
|
|
1
|
+
import { j as o, u as v } from "./index-6-2iV0ns.js";
|
|
2
2
|
import { useState as f, useRef as w, useEffect as C, useMemo as N } from "react";
|
|
3
3
|
const j = ({ data: a = [], testDetails: r = [] }) => {
|
|
4
4
|
const [c, u] = f([]), [_, m] = f([]), h = w(null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as K, P as gn, Y as Qs, M as i6, c as o2,
|
|
1
|
+
import { j as K, P as gn, Y as Qs, M as i6, c as o2, g as Wy, d as l6 } from "../index-6-2iV0ns.js";
|
|
2
2
|
import * as ua from "react";
|
|
3
3
|
import an, { createContext as d1, useContext as h1, memo as Tu, useMemo as fa, useCallback as on, useState as ot, useRef as Qt, useEffect as yn, useLayoutEffect as s6, useDebugValue as o6 } from "react";
|
|
4
4
|
import { E_DOCUMENT_VIEW_TYPE as Ws, E_DOCUMENT_FORMAT as ca, E_DOCUMENT_TYPE as Qy, E_CANVAS_TOOLS as gr, E_ATTACHMENT_QUERY_TYPE as u6 } from "../types/AttachmentTypes/index.js";
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { j as l, P as ye, a as Ce, M as $e } from "../index-6-2iV0ns.js";
|
|
2
|
+
import { useCallback as j, useEffect as F, useState as P, useRef as $, useMemo as je } from "react";
|
|
3
|
+
import { u as Ne } from "../useClickOutside-BjJyGTec.js";
|
|
4
|
+
import ke from "../ToggleButtons/index.js";
|
|
5
|
+
const Le = (i, u) => {
|
|
6
|
+
const a = j(
|
|
7
|
+
(N) => {
|
|
8
|
+
i.current && !i.current.contains(N.target) && u();
|
|
9
|
+
},
|
|
10
|
+
[i, u]
|
|
11
|
+
);
|
|
12
|
+
F(() => (document.addEventListener("mouseup", a), () => {
|
|
13
|
+
document.removeEventListener("mouseup", a);
|
|
14
|
+
}), [a]);
|
|
15
|
+
}, Ee = "data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.480062%200.819173C0.650418%200.648817%200.92662%200.648817%201.09698%200.819173L4.71454%204.43674L8.3321%200.819173C8.50246%200.648817%208.77866%200.648817%208.94902%200.819173C9.11937%200.98953%209.11937%201.26573%208.94902%201.43609L5.023%205.36211C4.85264%205.53246%204.57644%205.53246%204.40608%205.36211L0.480062%201.43609C0.309706%201.26573%200.309706%200.98953%200.480062%200.819173Z'%20fill='%23667085'/%3e%3c/svg%3e";
|
|
16
|
+
function Be(i) {
|
|
17
|
+
const {
|
|
18
|
+
label: u,
|
|
19
|
+
labelClassName: a,
|
|
20
|
+
hideDropdownIcon: N,
|
|
21
|
+
showClearOption: H,
|
|
22
|
+
isRequiredField: U,
|
|
23
|
+
btnClassName: X,
|
|
24
|
+
placeholder: M,
|
|
25
|
+
options: h,
|
|
26
|
+
selectedOption: g,
|
|
27
|
+
onChangeHandler: T,
|
|
28
|
+
inputValue: s,
|
|
29
|
+
inputChangeHandler: f,
|
|
30
|
+
onInputFocusOutEvent: _,
|
|
31
|
+
inputClassName: ee,
|
|
32
|
+
isSearchable: le,
|
|
33
|
+
inputType: te,
|
|
34
|
+
showInput: k,
|
|
35
|
+
inputSuffix: G,
|
|
36
|
+
selectedLabel: R,
|
|
37
|
+
suffixPadding: ne,
|
|
38
|
+
disableInputAutoSize: oe,
|
|
39
|
+
selectedOptions: L,
|
|
40
|
+
isMulti: c,
|
|
41
|
+
dropDownItemClickHandler: z,
|
|
42
|
+
showToggle: se,
|
|
43
|
+
toggleChangeHandler: re,
|
|
44
|
+
selectedToggleOption: ie,
|
|
45
|
+
toggleOptionsList: ae,
|
|
46
|
+
border: w,
|
|
47
|
+
height: b,
|
|
48
|
+
disabled: d,
|
|
49
|
+
fieldColor: v,
|
|
50
|
+
errorMsg: E,
|
|
51
|
+
showErrorMsg: he,
|
|
52
|
+
placeholderStyle: n,
|
|
53
|
+
onInputKeyDown: W,
|
|
54
|
+
showEmptyDropdownPopup: fe = !0,
|
|
55
|
+
isDropdownFixed: y = !1,
|
|
56
|
+
dropdownClassName: ce = "",
|
|
57
|
+
wrapperClass: V = "",
|
|
58
|
+
maxInputLength: K,
|
|
59
|
+
alternateListBgStyle: de,
|
|
60
|
+
showLabelTooltip: ue = !1,
|
|
61
|
+
labelToolTipContent: pe = "",
|
|
62
|
+
inputContainerClasses: Y = "",
|
|
63
|
+
onInputFocus: O
|
|
64
|
+
} = i, [r, p] = P(!1), [m, me] = P(null), C = $(null), S = $(null), q = $(null), I = $([]), xe = je(() => h?.filter((e) => e ? e.label.toLowerCase().includes((s ?? "").toLowerCase()) : void 0), [s, h]), [ge, D] = P(!1), we = () => {
|
|
65
|
+
p(!1), c && f && f(""), me(null);
|
|
66
|
+
}, A = j(
|
|
67
|
+
(e) => {
|
|
68
|
+
e.stopPropagation(), d || p((t) => !t);
|
|
69
|
+
},
|
|
70
|
+
[d]
|
|
71
|
+
), Z = (s?.length || 0) + 2 + Number(ne || 0);
|
|
72
|
+
Le(C, we), F(() => {
|
|
73
|
+
m !== null && I.current[m] && I.current[m].scrollIntoView({ block: "nearest" });
|
|
74
|
+
}, [m]);
|
|
75
|
+
const x = j(() => {
|
|
76
|
+
if (y && r) {
|
|
77
|
+
const e = k ? S.current : q.current, t = C.current;
|
|
78
|
+
if (e && t) {
|
|
79
|
+
const o = e.getBoundingClientRect();
|
|
80
|
+
t.style.position = "fixed", t.style.top = `${window.scrollY ? o.bottom + window.scrollY : o.bottom}px`, t.style.left = `${o.left}px`, t.style.width = `${o.width}px`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, [y, r, k]);
|
|
84
|
+
F(() => {
|
|
85
|
+
if (y)
|
|
86
|
+
return r ? (x(), window.addEventListener("scroll", x, !0)) : window.removeEventListener("scroll", x, !0), () => {
|
|
87
|
+
window.removeEventListener("scroll", x, !0);
|
|
88
|
+
};
|
|
89
|
+
}, [y, x, r]), Ne(C, () => {
|
|
90
|
+
ge && _ && _();
|
|
91
|
+
});
|
|
92
|
+
const J = (e) => {
|
|
93
|
+
if (c && z) {
|
|
94
|
+
const t = L?.some((o) => o.value === e.value);
|
|
95
|
+
z(!!t, e);
|
|
96
|
+
}
|
|
97
|
+
}, be = j(
|
|
98
|
+
async (e) => {
|
|
99
|
+
e.stopPropagation(), r || p(!0), O && await O();
|
|
100
|
+
},
|
|
101
|
+
[O, r]
|
|
102
|
+
);
|
|
103
|
+
return /* @__PURE__ */ l.jsxs("div", { className: `hfl-relative hfl-inline-block hfl-text-left ${V || ""}`, children: [
|
|
104
|
+
!!u && /* @__PURE__ */ l.jsxs("div", { className: "hfl-text-Gray-700 hfl-mb-1 hfl-flex", children: [
|
|
105
|
+
/* @__PURE__ */ l.jsx(ye, { type: "Text sm", variant: "Medium", className: a || "", children: `${u}` }),
|
|
106
|
+
U && /* @__PURE__ */ l.jsx("span", { className: "hfl-ml-1 hfl-text-Error-600", children: "*" }),
|
|
107
|
+
ue && /* @__PURE__ */ l.jsx(Ce, { variant: "Right", text: pe, theme: "dark", children: /* @__PURE__ */ l.jsx("i", { className: "hx_info-filled" }) })
|
|
108
|
+
] }),
|
|
109
|
+
k ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
110
|
+
/* @__PURE__ */ l.jsxs(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
className: `hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${Y || ""} ${w || "hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${E ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${b || "hfl-h-10"} ${d ? "!hfl-bg-Gray-50 !hfl-pointer-events-none" : v || "hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,
|
|
114
|
+
onClick: d ? () => {
|
|
115
|
+
} : A,
|
|
116
|
+
children: [
|
|
117
|
+
L?.map((e, t) => /* @__PURE__ */ l.jsxs(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
className: "hfl-flex hfl-items-center hfl-bg-Blue-100 hfl-mr-2 hfl-py-1 hfl-px-2 hfl-rounded-sm hfl-font-inter-0 hfl-text-nowrap",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ l.jsx("span", { className: "hfl-pointer-events-none", children: e.label }),
|
|
123
|
+
/* @__PURE__ */ l.jsx(
|
|
124
|
+
"span",
|
|
125
|
+
{
|
|
126
|
+
onClick: (o) => {
|
|
127
|
+
o.stopPropagation(), J(e);
|
|
128
|
+
},
|
|
129
|
+
className: "hx_close hfl-text-Gray-500 hfl-my-0 hfl-text-[14px] hfl-ml-[1px] hfl-cursor-pointer"
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
`${e.label}-${t}`
|
|
135
|
+
)),
|
|
136
|
+
Object.keys(n || {}).length > 0 && /* @__PURE__ */ l.jsx("style", { children: `
|
|
137
|
+
input.input-placeholder::placeholder {
|
|
138
|
+
font-family: ${n?.fontFamily};
|
|
139
|
+
font-weight: ${n?.fontWeight};
|
|
140
|
+
line-height: ${n?.lineHeight};
|
|
141
|
+
font-size: ${n?.fontSize};
|
|
142
|
+
color: ${n?.color};
|
|
143
|
+
}
|
|
144
|
+
` }),
|
|
145
|
+
/* @__PURE__ */ l.jsx(
|
|
146
|
+
"input",
|
|
147
|
+
{
|
|
148
|
+
ref: S,
|
|
149
|
+
style: oe ? {} : { width: `${Number(s?.length) > 4 ? (s?.length || 0) + 5 : 12}ch` },
|
|
150
|
+
type: te,
|
|
151
|
+
placeholder: M,
|
|
152
|
+
value: s,
|
|
153
|
+
className: `input-placeholder hfl-flex-1 hfl-pl-2 hfl-placeholder hfl-py-1 focus-visible:hfl-outline-0 focus-visible:hfl-outline-none hfl-border-0 focus:hfl-border-0 ${d ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : v || "hfl-bg-White"} ${ee || ""}`,
|
|
154
|
+
onChange: (e) => {
|
|
155
|
+
f && f(e.target.value), D(!0);
|
|
156
|
+
},
|
|
157
|
+
onClick: be,
|
|
158
|
+
onKeyDown: (e) => W && W(e, p, S),
|
|
159
|
+
maxLength: K ?? K,
|
|
160
|
+
...i.inputProps || {}
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
!N && !H && /* @__PURE__ */ l.jsx("i", { className: "hx_down hfl-mx-2" }),
|
|
164
|
+
H && /* @__PURE__ */ l.jsx(
|
|
165
|
+
"i",
|
|
166
|
+
{
|
|
167
|
+
className: `${s ? "hx_close hfl-cursor-pointer" : "hx_down"} hfl-mx-2`,
|
|
168
|
+
onClick: () => {
|
|
169
|
+
(g?.value || s) && (f && f(""), D(!0));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
G ? /* @__PURE__ */ l.jsx(
|
|
174
|
+
"span",
|
|
175
|
+
{
|
|
176
|
+
style: { left: `${Z < 2 ? "3" : Z}ch` },
|
|
177
|
+
className: "hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",
|
|
178
|
+
children: G
|
|
179
|
+
}
|
|
180
|
+
) : null
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
he && /* @__PURE__ */ l.jsx("span", { className: "hfl-text-0 hfl-text-Error-600", children: E })
|
|
185
|
+
] }) : /* @__PURE__ */ l.jsxs(
|
|
186
|
+
"button",
|
|
187
|
+
{
|
|
188
|
+
ref: q,
|
|
189
|
+
onClick: A,
|
|
190
|
+
className: `hfl-w-full hfl-bg-White hfl-py-[6px] hfl-px-4 hfl-rounded-lg hfl-inline-flex hfl-justify-between hfl-items-center ${X || ""} ${w || "hfl-border-1"} ${E ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${b || "hfl-h-[40px]"} ${d ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : ""}`,
|
|
191
|
+
style: R || g?.label ? {} : n ? {
|
|
192
|
+
fontFamily: n?.fontFamily,
|
|
193
|
+
fontSize: n?.fontSize,
|
|
194
|
+
fontWeight: n?.fontWeight,
|
|
195
|
+
lineHeight: n?.lineHeight,
|
|
196
|
+
color: n?.color
|
|
197
|
+
} : {},
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ l.jsx("span", { className: "hfl-pr-4", children: R || g?.label || M || "Select an option" }),
|
|
200
|
+
/* @__PURE__ */ l.jsx("img", { src: Ee, alt: "down arrow" })
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
h && h?.length >= 0 && /* @__PURE__ */ l.jsxs(
|
|
205
|
+
"ul",
|
|
206
|
+
{
|
|
207
|
+
ref: C,
|
|
208
|
+
className: `custom-dropdown-menu ${r ? "hfl-visible" : "hfl-invisible"} hfl-absolute hfl-z-50 hfl-grid hfl-gap-1 hfl-mt-3 hfl-w-full hfl-rounded-lg hfl-shadow-lg hfl-bg-White hfl-font-inter-0 hfl-p-1 hfl-px-2 ${c ? "hfl-min-w-[20em]" : "hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${ce}`,
|
|
209
|
+
role: "menu",
|
|
210
|
+
"aria-orientation": "vertical",
|
|
211
|
+
"aria-labelledby": "options-menu",
|
|
212
|
+
children: [
|
|
213
|
+
se ? /* @__PURE__ */ l.jsx(
|
|
214
|
+
ke,
|
|
215
|
+
{
|
|
216
|
+
onChangeHandler: re,
|
|
217
|
+
selectedOption: ie,
|
|
218
|
+
options: ae
|
|
219
|
+
}
|
|
220
|
+
) : !1,
|
|
221
|
+
(le ? xe : h)?.map((e, t) => {
|
|
222
|
+
const o = c ? !!L?.some((B) => B.value === e?.value) : !1, Q = g?.value === e?.value, ve = m === t;
|
|
223
|
+
return e ? /* @__PURE__ */ l.jsx(
|
|
224
|
+
"li",
|
|
225
|
+
{
|
|
226
|
+
onClick: () => {
|
|
227
|
+
c ? J(e) : (T && T(e), p(!1), D(!1));
|
|
228
|
+
},
|
|
229
|
+
className: `hfl-text-1 hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item ${de ? "odd:hfl-bg-Gray-100" : ""} ${Q ? "hfl-bg-Blue-50 hfl-text-Blue-500" : ""}`,
|
|
230
|
+
role: "menuitem",
|
|
231
|
+
"aria-selected": Q,
|
|
232
|
+
tabIndex: ve ? 0 : -1,
|
|
233
|
+
ref: (B) => {
|
|
234
|
+
I.current[t] = B;
|
|
235
|
+
},
|
|
236
|
+
children: c ? /* @__PURE__ */ l.jsx(
|
|
237
|
+
$e,
|
|
238
|
+
{
|
|
239
|
+
size: "sm",
|
|
240
|
+
disabled: !1,
|
|
241
|
+
text: /* @__PURE__ */ l.jsx("span", { children: e.label }),
|
|
242
|
+
secondaryText: "",
|
|
243
|
+
id: `${e.label}-${t}`,
|
|
244
|
+
isMarked: o
|
|
245
|
+
}
|
|
246
|
+
) : e.label
|
|
247
|
+
},
|
|
248
|
+
`${e.label}-${t}`
|
|
249
|
+
) : null;
|
|
250
|
+
}),
|
|
251
|
+
h?.length === 0 && fe && /* @__PURE__ */ l.jsx(
|
|
252
|
+
"li",
|
|
253
|
+
{
|
|
254
|
+
className: "hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item",
|
|
255
|
+
children: "No items found, please change the search criteria"
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
] });
|
|
262
|
+
}
|
|
263
|
+
export {
|
|
264
|
+
Be as default
|
|
265
|
+
};
|