@wavelengthusaf/components 2.7.3 → 2.8.1
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/README.md +4 -0
- package/dist/cjs/index.cjs +381 -18
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +21 -2
- package/dist/esm/index.d.ts +21 -2
- package/dist/esm/index.js +367 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/index.cjs
CHANGED
|
@@ -4743,9 +4743,9 @@ function WavelengthCommentDisplay(props) {
|
|
|
4743
4743
|
!selected && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4744
4744
|
_material.IconButton,
|
|
4745
4745
|
{
|
|
4746
|
-
onClick: () => {
|
|
4746
|
+
onClick: (e) => {
|
|
4747
4747
|
setSelected(!selected);
|
|
4748
|
-
props.onClick;
|
|
4748
|
+
_optionalChain([props, 'access', _7 => _7.onClick, 'optionalCall', _8 => _8(e)]);
|
|
4749
4749
|
},
|
|
4750
4750
|
style: { padding: "0px" },
|
|
4751
4751
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _CheckCircleOutline2.default, { fontSize: "small" })
|
|
@@ -4754,9 +4754,9 @@ function WavelengthCommentDisplay(props) {
|
|
|
4754
4754
|
selected && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4755
4755
|
_material.IconButton,
|
|
4756
4756
|
{
|
|
4757
|
-
onClick: () => {
|
|
4757
|
+
onClick: (e) => {
|
|
4758
4758
|
setSelected(!selected);
|
|
4759
|
-
props.onClick;
|
|
4759
|
+
_optionalChain([props, 'access', _9 => _9.onClick, 'optionalCall', _10 => _10(e)]);
|
|
4760
4760
|
},
|
|
4761
4761
|
style: { padding: "0px" },
|
|
4762
4762
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _CheckCircle2.default, { fontSize: "small", sx: { color: props.iconSelectedColor || "rgba(209, 106, 47, 1)" } })
|
|
@@ -4943,18 +4943,18 @@ var WavelengthTitleBar = class extends HTMLElement {
|
|
|
4943
4943
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
4944
4944
|
if (oldValue !== newValue) {
|
|
4945
4945
|
if (name === "title-text") {
|
|
4946
|
-
const titleElement = _optionalChain([this, 'access',
|
|
4946
|
+
const titleElement = _optionalChain([this, 'access', _11 => _11.shadowRoot, 'optionalAccess', _12 => _12.querySelector, 'call', _13 => _13(".title")]);
|
|
4947
4947
|
if (titleElement) {
|
|
4948
4948
|
titleElement.textContent = newValue;
|
|
4949
4949
|
}
|
|
4950
4950
|
} else if (name === "subtitle-text") {
|
|
4951
|
-
const subtitleElement = _optionalChain([this, 'access',
|
|
4951
|
+
const subtitleElement = _optionalChain([this, 'access', _14 => _14.shadowRoot, 'optionalAccess', _15 => _15.querySelector, 'call', _16 => _16(".subtitle")]);
|
|
4952
4952
|
if (subtitleElement) {
|
|
4953
4953
|
subtitleElement.textContent = newValue;
|
|
4954
4954
|
}
|
|
4955
4955
|
} else if (name === "text-color") {
|
|
4956
|
-
const titleElement = _optionalChain([this, 'access',
|
|
4957
|
-
const subtitleElement = _optionalChain([this, 'access',
|
|
4956
|
+
const titleElement = _optionalChain([this, 'access', _17 => _17.shadowRoot, 'optionalAccess', _18 => _18.querySelector, 'call', _19 => _19(".title")]);
|
|
4957
|
+
const subtitleElement = _optionalChain([this, 'access', _20 => _20.shadowRoot, 'optionalAccess', _21 => _21.querySelector, 'call', _22 => _22(".subtitle")]);
|
|
4958
4958
|
if (titleElement) {
|
|
4959
4959
|
titleElement.style.color = newValue;
|
|
4960
4960
|
}
|
|
@@ -4962,7 +4962,7 @@ var WavelengthTitleBar = class extends HTMLElement {
|
|
|
4962
4962
|
subtitleElement.style.color = newValue;
|
|
4963
4963
|
}
|
|
4964
4964
|
} else if (name === "has-shadow") {
|
|
4965
|
-
const titleElement = _optionalChain([this, 'access',
|
|
4965
|
+
const titleElement = _optionalChain([this, 'access', _23 => _23.shadowRoot, 'optionalAccess', _24 => _24.querySelector, 'call', _25 => _25(".title")]);
|
|
4966
4966
|
if (titleElement) {
|
|
4967
4967
|
titleElement.style.textShadow = newValue !== "false" ? "none" : "0.313rem 0.313rem 0.375rem #FFFFFF";
|
|
4968
4968
|
}
|
|
@@ -5193,8 +5193,8 @@ function WavelengthConfirmationModal(props) {
|
|
|
5193
5193
|
overflow: "scroll"
|
|
5194
5194
|
},
|
|
5195
5195
|
children: [
|
|
5196
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { style: { margin: "0px", fontSize: "28px", fontWeight: 500, padding: "0px", marginBottom: "16px", fontFamily: props.fontFamily }, children: _optionalChain([props, 'access',
|
|
5197
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { style: { margin: "0px", fontSize: "16px", lineHeight: "19.2px", fontFamily: props.fontFamily, fontWeight: 400, height: "60px" }, children: _optionalChain([props, 'access',
|
|
5196
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { style: { margin: "0px", fontSize: "28px", fontWeight: 500, padding: "0px", marginBottom: "16px", fontFamily: props.fontFamily }, children: _optionalChain([props, 'access', _26 => _26.textObj, 'optionalAccess', _27 => _27.title]) }),
|
|
5197
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { style: { margin: "0px", fontSize: "16px", lineHeight: "19.2px", fontFamily: props.fontFamily, fontWeight: 400, height: "60px" }, children: _optionalChain([props, 'access', _28 => _28.textObj, 'optionalAccess', _29 => _29.dialog]) }),
|
|
5198
5198
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", flexDirection: "row", justifyContent: "flex-end", marginTop: "40px", gap: "8px" }, children: [
|
|
5199
5199
|
props.cancelButton,
|
|
5200
5200
|
props.submitButton
|
|
@@ -5215,11 +5215,11 @@ function WavelengthContentModal(props) {
|
|
|
5215
5215
|
};
|
|
5216
5216
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Dialog, { "data-testid": "testId-WavelengthContentModal", open: show, onClose: handleClose, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description", children: [
|
|
5217
5217
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.DialogTitle, { alignContent: `center`, id: "alert-dialog-title", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { display: "flex", alignItems: "center", children: [
|
|
5218
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { flexGrow: 1, children: _optionalChain([props, 'access',
|
|
5218
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { flexGrow: 1, children: _optionalChain([props, 'access', _30 => _30.textObj, 'optionalAccess', _31 => _31.title]) }),
|
|
5219
5219
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.IconButton, { onClick: handleClose, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Close2.default, {}) }) })
|
|
5220
5220
|
] }) }),
|
|
5221
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.DialogContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { align: "center", children: _optionalChain([props, 'access',
|
|
5222
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.DialogActions, { style: { justifyContent: `center` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Button, { "data-testid": "testId-WavelengthContentModalConfirmButton", onClick: handleContentModalOnConfirmProp, color: "primary", variant: "contained", autoFocus: true, children: _optionalChain([props, 'access',
|
|
5221
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.DialogContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { align: "center", children: _optionalChain([props, 'access', _32 => _32.textObj, 'optionalAccess', _33 => _33.dialog]) }) }),
|
|
5222
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.DialogActions, { style: { justifyContent: `center` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Button, { "data-testid": "testId-WavelengthContentModalConfirmButton", onClick: handleContentModalOnConfirmProp, color: "primary", variant: "contained", autoFocus: true, children: _optionalChain([props, 'access', _34 => _34.textObj, 'optionalAccess', _35 => _35.purpose]) }) })
|
|
5223
5223
|
] });
|
|
5224
5224
|
}
|
|
5225
5225
|
|
|
@@ -5433,7 +5433,7 @@ function WavelengthDropdown({
|
|
|
5433
5433
|
borderBottomRightRadius: "8px",
|
|
5434
5434
|
borderTopRightRadius: "0px",
|
|
5435
5435
|
borderTopLeftRadius: "0px",
|
|
5436
|
-
boxShadow: _optionalChain([menuSx, 'optionalAccess',
|
|
5436
|
+
boxShadow: _optionalChain([menuSx, 'optionalAccess', _36 => _36.boxShadow]),
|
|
5437
5437
|
width: myMenusx.width,
|
|
5438
5438
|
backgroundColor: `${myMenusx.backgroundColor}`
|
|
5439
5439
|
},
|
|
@@ -6114,6 +6114,7 @@ function DefaultPagination({ totalPages, currentPageNumber, siblingCount = 1, bo
|
|
|
6114
6114
|
);
|
|
6115
6115
|
}
|
|
6116
6116
|
}
|
|
6117
|
+
var WavelengthPagination_default = DefaultPagination;
|
|
6117
6118
|
|
|
6118
6119
|
// src/components/TextField/WavelengthTextField.tsx
|
|
6119
6120
|
|
|
@@ -6187,7 +6188,7 @@ function WavelengthTextField(props) {
|
|
|
6187
6188
|
label: props.label,
|
|
6188
6189
|
onChange: (e) => {
|
|
6189
6190
|
handleChange(e);
|
|
6190
|
-
_optionalChain([props, 'access',
|
|
6191
|
+
_optionalChain([props, 'access', _37 => _37.onChange, 'optionalCall', _38 => _38(e)]);
|
|
6191
6192
|
},
|
|
6192
6193
|
error: hasError,
|
|
6193
6194
|
helperText: hasError ? props.errorMessage : "",
|
|
@@ -6236,7 +6237,7 @@ function WavelengthTextField(props) {
|
|
|
6236
6237
|
error: hasError,
|
|
6237
6238
|
onChange: (e) => {
|
|
6238
6239
|
handleChange(e);
|
|
6239
|
-
_optionalChain([props, 'access',
|
|
6240
|
+
_optionalChain([props, 'access', _39 => _39.onChange, 'optionalCall', _40 => _40(e)]);
|
|
6240
6241
|
}
|
|
6241
6242
|
}
|
|
6242
6243
|
),
|
|
@@ -6247,6 +6248,368 @@ function WavelengthTextField(props) {
|
|
|
6247
6248
|
return null;
|
|
6248
6249
|
}
|
|
6249
6250
|
|
|
6251
|
+
// src/components/DataTable/WavelengthDataTable.tsx
|
|
6252
|
+
|
|
6253
|
+
|
|
6254
|
+
|
|
6255
|
+
var ModalInputDiv = _styledcomponents2.default.div`
|
|
6256
|
+
display: flex;
|
|
6257
|
+
flex-direction: column; /* Corrected this line */
|
|
6258
|
+
gap: 3px;
|
|
6259
|
+
margin: 3px;
|
|
6260
|
+
|
|
6261
|
+
label {
|
|
6262
|
+
align-self: flex-start;
|
|
6263
|
+
color: #c6c7cc;
|
|
6264
|
+
}
|
|
6265
|
+
|
|
6266
|
+
input,
|
|
6267
|
+
select {
|
|
6268
|
+
width: 100%;
|
|
6269
|
+
padding: 12px 20px;
|
|
6270
|
+
margin: 8px 0;
|
|
6271
|
+
box-sizing: border-box;
|
|
6272
|
+
border: none;
|
|
6273
|
+
outline: none;
|
|
6274
|
+
border-bottom: 2px solid #c6c7cc;
|
|
6275
|
+
|
|
6276
|
+
&:hover {
|
|
6277
|
+
border-bottom: 2px solid black;
|
|
6278
|
+
}
|
|
6279
|
+
|
|
6280
|
+
&:focus {
|
|
6281
|
+
border-bottom: 2px solid #8fd8ff;
|
|
6282
|
+
}
|
|
6283
|
+
}
|
|
6284
|
+
`;
|
|
6285
|
+
var ModalOverlay = _styledcomponents2.default.div`
|
|
6286
|
+
position: fixed;
|
|
6287
|
+
bottom: 19%;
|
|
6288
|
+
right: 15%;
|
|
6289
|
+
width: 100%;
|
|
6290
|
+
height: 100%;
|
|
6291
|
+
background-color: rgba(0, 0, 0, 0);
|
|
6292
|
+
display: flex;
|
|
6293
|
+
justify-content: center;
|
|
6294
|
+
align-items: center;
|
|
6295
|
+
z-index: 1;
|
|
6296
|
+
`;
|
|
6297
|
+
var ModalWrapper = _styledcomponents2.default.div`
|
|
6298
|
+
background-color: white;
|
|
6299
|
+
border-radius: 8px;
|
|
6300
|
+
padding: 20px;
|
|
6301
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
|
6302
|
+
position: relative;
|
|
6303
|
+
min-width: 300px;
|
|
6304
|
+
z-index: 1;
|
|
6305
|
+
display: flex;
|
|
6306
|
+
align-items: center;
|
|
6307
|
+
`;
|
|
6308
|
+
var ModalClose = _styledcomponents2.default.button`
|
|
6309
|
+
position: absolute;
|
|
6310
|
+
top: 10px;
|
|
6311
|
+
right: 10px;
|
|
6312
|
+
font-size: 20px;
|
|
6313
|
+
cursor: pointer;
|
|
6314
|
+
border: none;
|
|
6315
|
+
background: none;
|
|
6316
|
+
z-index: 2;
|
|
6317
|
+
`;
|
|
6318
|
+
var TableHeadStyle = _styledcomponents2.default.th`
|
|
6319
|
+
position: relative;
|
|
6320
|
+
`;
|
|
6321
|
+
var KebabMenu = _styledcomponents2.default.div`
|
|
6322
|
+
display: inline-block;
|
|
6323
|
+
position: absolute;
|
|
6324
|
+
right: 0;
|
|
6325
|
+
top: 2px;
|
|
6326
|
+
`;
|
|
6327
|
+
var KebabIcon = _styledcomponents2.default.div`
|
|
6328
|
+
cursor: pointer;
|
|
6329
|
+
font-size: 20px;
|
|
6330
|
+
padding: 5px;
|
|
6331
|
+
|
|
6332
|
+
&:hover,
|
|
6333
|
+
&:focus {
|
|
6334
|
+
color: #45beff;
|
|
6335
|
+
}
|
|
6336
|
+
&:active {
|
|
6337
|
+
color: #8fd8ff;
|
|
6338
|
+
}
|
|
6339
|
+
`;
|
|
6340
|
+
var MenuOptions = _styledcomponents2.default.ul`
|
|
6341
|
+
position: absolute;
|
|
6342
|
+
right: 0;
|
|
6343
|
+
top: 100%;
|
|
6344
|
+
background-color: #f9f9f9;
|
|
6345
|
+
min-width: 160px;
|
|
6346
|
+
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
|
6347
|
+
z-index: 1;
|
|
6348
|
+
list-style: none;
|
|
6349
|
+
padding: 0;
|
|
6350
|
+
margin: 0;
|
|
6351
|
+
|
|
6352
|
+
li {
|
|
6353
|
+
padding: 10px;
|
|
6354
|
+
text-decoration: none;
|
|
6355
|
+
display: block;
|
|
6356
|
+
cursor: pointer;
|
|
6357
|
+
|
|
6358
|
+
&:hover {
|
|
6359
|
+
background-color: #ddd;
|
|
6360
|
+
}
|
|
6361
|
+
}
|
|
6362
|
+
`;
|
|
6363
|
+
var StyledBoxDiv = _styledcomponents2.default.div`
|
|
6364
|
+
background-color: white;
|
|
6365
|
+
width: 700px;
|
|
6366
|
+
height: 480px;
|
|
6367
|
+
position: relative;
|
|
6368
|
+
border-top-left-radius: 10px;
|
|
6369
|
+
border-top-right-radius: 10px;
|
|
6370
|
+
`;
|
|
6371
|
+
var StyledNavBoxDiv = _styledcomponents2.default.div`
|
|
6372
|
+
background-color: white;
|
|
6373
|
+
width: 700px;
|
|
6374
|
+
display: flex; /* Make parent a flex-container */
|
|
6375
|
+
justify-content: center;
|
|
6376
|
+
border-bottom-left-radius: 10px;
|
|
6377
|
+
border-bottom-right-radius: 10px;
|
|
6378
|
+
|
|
6379
|
+
box-shadow: 0.5px 3px 5px black;
|
|
6380
|
+
`;
|
|
6381
|
+
var StyledTd = _styledcomponents2.default.td`
|
|
6382
|
+
border-top: 1px solid #c6c7cc;
|
|
6383
|
+
border-bottom: 1px solid #c6c7cc;
|
|
6384
|
+
padding: 10px 15px;
|
|
6385
|
+
vertical-align: middle;
|
|
6386
|
+
`;
|
|
6387
|
+
var StyledTableTwo = _styledcomponents2.default.table`
|
|
6388
|
+
width: 95%;
|
|
6389
|
+
height: 95%;
|
|
6390
|
+
border-collapse: collapse;
|
|
6391
|
+
background-color: white;
|
|
6392
|
+
color: black;
|
|
6393
|
+
|
|
6394
|
+
margin-left: auto;
|
|
6395
|
+
margin-right: auto;
|
|
6396
|
+
|
|
6397
|
+
th {
|
|
6398
|
+
position: relative; /* Enable absolute positioning of pseudo-elements */
|
|
6399
|
+
padding: 10px 15px;
|
|
6400
|
+
|
|
6401
|
+
/* Create the partial right border */
|
|
6402
|
+
&:not(:last-child):after {
|
|
6403
|
+
content: ""; /* Ensure the pseudo-element is visible */
|
|
6404
|
+
position: absolute;
|
|
6405
|
+
right: 0; /* Position it on the right side of the th */
|
|
6406
|
+
top: 50%; /* Position it in the vertical center */
|
|
6407
|
+
height: 50%; /* Set the height of the border to be half the height of th */
|
|
6408
|
+
border-right: 1px solid #c6c7cc;
|
|
6409
|
+
transform: translateY(-50%); /* Center it vertically */
|
|
6410
|
+
}
|
|
6411
|
+
}
|
|
6412
|
+
`;
|
|
6413
|
+
var StyledInput = _styledcomponents2.default.input`
|
|
6414
|
+
height: 100%;
|
|
6415
|
+
width: 100%;
|
|
6416
|
+
outline: none;
|
|
6417
|
+
border: none;
|
|
6418
|
+
color: #8fd8ff;
|
|
6419
|
+
`;
|
|
6420
|
+
var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages }) => {
|
|
6421
|
+
const [localData, setLocalData] = _react.useState.call(void 0, data || []);
|
|
6422
|
+
const copiedArray = [...data || []];
|
|
6423
|
+
const [editingId, setEditingId] = _react.useState.call(void 0, null);
|
|
6424
|
+
const [editedColumnKey, setEditedColumnKey] = _react.useState.call(void 0, null);
|
|
6425
|
+
const [editedValue, setEditedValue] = _react.useState.call(void 0, "");
|
|
6426
|
+
const [noRowsOpen, setNoRowsOpen] = _react.useState.call(void 0, false);
|
|
6427
|
+
const [isModalOpen, setIsModalOpen] = _react.useState.call(void 0, false);
|
|
6428
|
+
const [searchItem, setSearchItem] = _react.useState.call(void 0, "");
|
|
6429
|
+
const [selectedValue, setSelectedValue] = _react.useState.call(void 0, _optionalChain([columns, 'access', _41 => _41[0], 'optionalAccess', _42 => _42.key]) || "");
|
|
6430
|
+
const [currentPage, setCurrentPage] = _react.useState.call(void 0, 1);
|
|
6431
|
+
const [isOpen, setIsOpen] = _react.useState.call(void 0, false);
|
|
6432
|
+
const [editingMenuKey, setEditingMenuKey] = _react.useState.call(void 0, null);
|
|
6433
|
+
const menuRef = _react.useRef.call(void 0, null);
|
|
6434
|
+
const modalRef = _react.useRef.call(void 0, null);
|
|
6435
|
+
function isNumeric(value) {
|
|
6436
|
+
return /^\d+$/.test(value);
|
|
6437
|
+
}
|
|
6438
|
+
const handleChange = (event) => {
|
|
6439
|
+
setSelectedValue(event.target.value);
|
|
6440
|
+
setLocalData(copiedArray);
|
|
6441
|
+
};
|
|
6442
|
+
_react.useEffect.call(void 0, () => {
|
|
6443
|
+
if (!selectedValue || searchItem === "") {
|
|
6444
|
+
setLocalData(copiedArray);
|
|
6445
|
+
setNoRowsOpen(false);
|
|
6446
|
+
return;
|
|
6447
|
+
}
|
|
6448
|
+
if (isNumeric(searchItem)) {
|
|
6449
|
+
const filteredItems = localData.filter((item) => item[selectedValue].toString().includes(searchItem));
|
|
6450
|
+
setLocalData(filteredItems);
|
|
6451
|
+
if (filteredItems.length === 0) {
|
|
6452
|
+
setNoRowsOpen(true);
|
|
6453
|
+
} else {
|
|
6454
|
+
setNoRowsOpen(false);
|
|
6455
|
+
}
|
|
6456
|
+
} else {
|
|
6457
|
+
const filteredItems = localData.filter((item) => item[selectedValue].toString().toLowerCase().includes(searchItem.toLowerCase()));
|
|
6458
|
+
if (filteredItems.length === 0) {
|
|
6459
|
+
setNoRowsOpen(true);
|
|
6460
|
+
} else {
|
|
6461
|
+
setLocalData(filteredItems);
|
|
6462
|
+
setNoRowsOpen(false);
|
|
6463
|
+
}
|
|
6464
|
+
}
|
|
6465
|
+
}, [selectedValue, searchItem]);
|
|
6466
|
+
const openModal = () => {
|
|
6467
|
+
setIsModalOpen(true);
|
|
6468
|
+
};
|
|
6469
|
+
const closeModal = () => {
|
|
6470
|
+
setIsModalOpen(false);
|
|
6471
|
+
};
|
|
6472
|
+
_react.useEffect.call(void 0, () => {
|
|
6473
|
+
const handleClickOutside = (event) => {
|
|
6474
|
+
if (isModalOpen && modalRef.current && !modalRef.current.contains(event.target)) {
|
|
6475
|
+
closeModal();
|
|
6476
|
+
}
|
|
6477
|
+
};
|
|
6478
|
+
if (isOpen) {
|
|
6479
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
6480
|
+
}
|
|
6481
|
+
return () => {
|
|
6482
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
6483
|
+
};
|
|
6484
|
+
}, [isModalOpen]);
|
|
6485
|
+
const toggleMenu = (key) => {
|
|
6486
|
+
setIsOpen(!isOpen);
|
|
6487
|
+
setEditingMenuKey(key);
|
|
6488
|
+
};
|
|
6489
|
+
const indexOfLastItem = currentPage * itemsPerPage;
|
|
6490
|
+
const indexOfFirstItem = indexOfLastItem - itemsPerPage;
|
|
6491
|
+
const currentPageData = localData.filter((_, index) => index >= indexOfFirstItem && index < indexOfLastItem);
|
|
6492
|
+
const [sortOrder, setSortOrder] = _react.useState.call(void 0, "asc");
|
|
6493
|
+
const handleSort = (column, sortType) => {
|
|
6494
|
+
const sortedItems = [...localData].sort((a, b) => {
|
|
6495
|
+
const valueA = a[column];
|
|
6496
|
+
const valueB = b[column];
|
|
6497
|
+
if (typeof valueA === "string" && typeof valueB === "string") {
|
|
6498
|
+
if (sortType === "asc") {
|
|
6499
|
+
return valueA.localeCompare(valueB);
|
|
6500
|
+
} else {
|
|
6501
|
+
return valueB.localeCompare(valueA);
|
|
6502
|
+
}
|
|
6503
|
+
} else if (typeof valueA === "number" && typeof valueB === "number") {
|
|
6504
|
+
if (sortType === "asc") {
|
|
6505
|
+
return valueA - valueB;
|
|
6506
|
+
} else {
|
|
6507
|
+
return valueB - valueA;
|
|
6508
|
+
}
|
|
6509
|
+
} else {
|
|
6510
|
+
return 0;
|
|
6511
|
+
}
|
|
6512
|
+
});
|
|
6513
|
+
setLocalData(sortedItems);
|
|
6514
|
+
setSortOrder(sortOrder === "asc" ? "desc" : "asc");
|
|
6515
|
+
};
|
|
6516
|
+
const handleEdit = (id, value, columnKey) => {
|
|
6517
|
+
setEditingId(id);
|
|
6518
|
+
setEditedValue(value);
|
|
6519
|
+
setEditedColumnKey(columnKey);
|
|
6520
|
+
};
|
|
6521
|
+
const saveEdit = (id, editedValue2, columnKey) => {
|
|
6522
|
+
setLocalData(localData.map((item) => id === item.id ? { ...item, [columnKey]: editedValue2 } : item));
|
|
6523
|
+
setEditingId(null);
|
|
6524
|
+
};
|
|
6525
|
+
const handleCancel = () => {
|
|
6526
|
+
setEditingId(null);
|
|
6527
|
+
};
|
|
6528
|
+
const headers = columns.map((column, index) => {
|
|
6529
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, TableHeadStyle, { children: [
|
|
6530
|
+
column.title,
|
|
6531
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, KebabMenu, { ref: menuRef, children: [
|
|
6532
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6533
|
+
KebabIcon,
|
|
6534
|
+
{
|
|
6535
|
+
title: `KebabIcon-${index}`,
|
|
6536
|
+
onClick: () => {
|
|
6537
|
+
toggleMenu(column.key);
|
|
6538
|
+
},
|
|
6539
|
+
children: "\u22EE"
|
|
6540
|
+
}
|
|
6541
|
+
),
|
|
6542
|
+
isOpen && editingMenuKey === column.key && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, MenuOptions, { children: [
|
|
6543
|
+
sortOrder === "asc" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { title: `MenuListASC-${index}`, onClick: () => handleSort(column.key, "asc"), children: [
|
|
6544
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u2B06" }),
|
|
6545
|
+
" Sort ASC"
|
|
6546
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { title: `MenuListDES-${index}`, onClick: () => handleSort(column.key, "desc"), children: [
|
|
6547
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u2B07" }),
|
|
6548
|
+
" Sort DESC"
|
|
6549
|
+
] }),
|
|
6550
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { title: `MenuListFilterButton-${index}`, onClick: openModal, children: [
|
|
6551
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u23F7" }),
|
|
6552
|
+
" Filter"
|
|
6553
|
+
] }),
|
|
6554
|
+
isModalOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalOverlay, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ModalWrapper, { ref: modalRef, children: [
|
|
6555
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalClose, { title: `ModalClose-${index}`, onClick: closeModal, children: "\xD7" }),
|
|
6556
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ModalInputDiv, { children: [
|
|
6557
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: "filterSelectId", children: "Columns: " }),
|
|
6558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "select", { title: `filterSelect-${index}`, id: "filterSelectId", value: selectedValue, onChange: handleChange, children: columns.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { children: item.key }, item.key)) })
|
|
6559
|
+
] }),
|
|
6560
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ModalInputDiv, { children: [
|
|
6561
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: "filterInputId", children: "Values: " }),
|
|
6562
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6563
|
+
"input",
|
|
6564
|
+
{
|
|
6565
|
+
title: `Inputfiltertest-${index}`,
|
|
6566
|
+
id: "filterInputId",
|
|
6567
|
+
type: isNumeric(searchItem) ? "number" : "text",
|
|
6568
|
+
value: searchItem,
|
|
6569
|
+
onKeyDown: (e) => {
|
|
6570
|
+
if (e.key === "Backspace") {
|
|
6571
|
+
setLocalData(copiedArray);
|
|
6572
|
+
}
|
|
6573
|
+
},
|
|
6574
|
+
onChange: (e) => setSearchItem(e.target.value)
|
|
6575
|
+
}
|
|
6576
|
+
)
|
|
6577
|
+
] })
|
|
6578
|
+
] }) })
|
|
6579
|
+
] })
|
|
6580
|
+
] }, index)
|
|
6581
|
+
] }, `headCell-${index}`);
|
|
6582
|
+
});
|
|
6583
|
+
const rows = !_optionalChain([currentPageData, 'optionalAccess', _43 => _43.length]) || noRowsOpen ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { title: "NoDataRows", colSpan: columns.length, children: "No data" }) }) : _optionalChain([currentPageData, 'optionalAccess', _44 => _44.map, 'call', _45 => _45((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: columns.map((column, index2) => {
|
|
6584
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledTd, { children: editingId === item.id && editedColumnKey === column.key ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6585
|
+
StyledInput,
|
|
6586
|
+
{
|
|
6587
|
+
title: `styledRow-${item.id}-${column.key}-${index2}`,
|
|
6588
|
+
type: "text",
|
|
6589
|
+
value: editedValue,
|
|
6590
|
+
onChange: (e) => setEditedValue(e.target.value),
|
|
6591
|
+
onBlur: () => saveEdit(item.id, editedValue, column.key),
|
|
6592
|
+
onKeyDown: (e) => {
|
|
6593
|
+
if (e.key === "Enter") {
|
|
6594
|
+
saveEdit(item.id, editedValue, column.key);
|
|
6595
|
+
} else if (e.key === "Escape") {
|
|
6596
|
+
handleCancel();
|
|
6597
|
+
}
|
|
6598
|
+
},
|
|
6599
|
+
autoFocus: true
|
|
6600
|
+
}
|
|
6601
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { title: `spanRow-${item.id}-${column.key}-${index2}`, onDoubleClick: () => handleEdit(item.id, item[column.key], column.key), children: item[column.key] }) }, index2);
|
|
6602
|
+
}) }, item.id))]);
|
|
6603
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
6604
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledBoxDiv, { title: "StyledBoxDiv", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, StyledTableTwo, { title: "StyledTable", children: [
|
|
6605
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "thead", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tr", { children: headers }) }),
|
|
6606
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: rows })
|
|
6607
|
+
] }) }),
|
|
6608
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledNavBoxDiv, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WavelengthPagination_default, { totalPages, currentPageNumber: currentPage, onPageChange: setCurrentPage, style: "circular" }) })
|
|
6609
|
+
] });
|
|
6610
|
+
};
|
|
6611
|
+
|
|
6612
|
+
|
|
6250
6613
|
|
|
6251
6614
|
|
|
6252
6615
|
|
|
@@ -6293,7 +6656,7 @@ function WavelengthTextField(props) {
|
|
|
6293
6656
|
|
|
6294
6657
|
|
|
6295
6658
|
|
|
6296
|
-
exports.AppLogo = AppLogo; exports.ButtonIcon = ButtonIcon; exports.ButtonMenu = ButtonMenu; exports.DefaultCarousel = DefaultCarousel; exports.DefaultIcon = DefaultIcon; exports.DefaultPagination = DefaultPagination; exports.ManyPlanesComponent = ManyPlanesComponent; exports.NotAvailablePage = NotAvailablePage; exports.SearchTextField = SearchTextField; exports.SliderCardCarousel = SliderCardCarousel; exports.TestSnackbar = TestSnackbar; exports.WavelengthAppTheme = WavelengthAppTheme; exports.WavelengthAutocomplete = WavelengthAutocomplete; exports.WavelengthBanner = WavelengthBanner2; exports.WavelengthBox = WavelengthBox; exports.WavelengthButton = WavelengthButton; exports.WavelengthCommentDisplay = WavelengthCommentDisplay; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthContentModal = WavelengthContentModal; exports.WavelengthContentPlaceholder = WavelengthContentPlaceholder; exports.WavelengthDragAndDrop = WavelengthDragAndDrop; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthDropdownButton = WavelengthDropdownButton; exports.WavelengthExampleComponent = WavelengthExampleComponent; exports.WavelengthFileDownloader = WavelengthFileDownloader; exports.WavelengthFooter = WavelengthFooter; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSideBar = WavelengthSideBar; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSpinningLogo = WavelengthSpinningLogo; exports.WavelengthSpinningOuterCircle = WavelengthSpinningOuterCircle; exports.WavelengthStandardSnackbar = WavelengthStandardSnackbar; exports.WavelengthStyledButton = WavelengthStyledButton; exports.WavelengthTextField = WavelengthTextField; exports.WavelengthTitleBar = WavelengthTitleBar2; exports.add = add; exports.ascendingRange = ascendingRange; exports.concat = concat; exports.findBestStringMatch = findBestStringMatch; exports.range = range; exports.useOutsideClick = useOutsideClick; exports.useThemeContext = useThemeContext;
|
|
6659
|
+
exports.AppLogo = AppLogo; exports.ButtonIcon = ButtonIcon; exports.ButtonMenu = ButtonMenu; exports.DefaultCarousel = DefaultCarousel; exports.DefaultIcon = DefaultIcon; exports.DefaultPagination = DefaultPagination; exports.ManyPlanesComponent = ManyPlanesComponent; exports.NotAvailablePage = NotAvailablePage; exports.SearchTextField = SearchTextField; exports.SliderCardCarousel = SliderCardCarousel; exports.TestSnackbar = TestSnackbar; exports.WavelengthAppTheme = WavelengthAppTheme; exports.WavelengthAutocomplete = WavelengthAutocomplete; exports.WavelengthBanner = WavelengthBanner2; exports.WavelengthBox = WavelengthBox; exports.WavelengthButton = WavelengthButton; exports.WavelengthCommentDisplay = WavelengthCommentDisplay; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthContentModal = WavelengthContentModal; exports.WavelengthContentPlaceholder = WavelengthContentPlaceholder; exports.WavelengthDataTable = WavelengthDataTable; exports.WavelengthDragAndDrop = WavelengthDragAndDrop; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthDropdownButton = WavelengthDropdownButton; exports.WavelengthExampleComponent = WavelengthExampleComponent; exports.WavelengthFileDownloader = WavelengthFileDownloader; exports.WavelengthFooter = WavelengthFooter; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSideBar = WavelengthSideBar; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSpinningLogo = WavelengthSpinningLogo; exports.WavelengthSpinningOuterCircle = WavelengthSpinningOuterCircle; exports.WavelengthStandardSnackbar = WavelengthStandardSnackbar; exports.WavelengthStyledButton = WavelengthStyledButton; exports.WavelengthTextField = WavelengthTextField; exports.WavelengthTitleBar = WavelengthTitleBar2; exports.add = add; exports.ascendingRange = ascendingRange; exports.concat = concat; exports.findBestStringMatch = findBestStringMatch; exports.range = range; exports.useOutsideClick = useOutsideClick; exports.useThemeContext = useThemeContext;
|
|
6297
6660
|
/*! Bundled license information:
|
|
6298
6661
|
|
|
6299
6662
|
react-is/cjs/react-is.production.min.js:
|